IntersectMBO / ouroboros-consensus

Implementation of a Consensus Layer for the Ouroboros family of protocols
https://ouroboros-consensus.cardano.intersectmbo.org
Apache License 2.0
33 stars 22 forks source link

Consensus reorganization of packages and migration #27

Closed jasagredo closed 1 year ago

jasagredo commented 1 year ago

Since the beginning, the consensus layer of Cardano has co-existed with the network layer. However, as we progress towards a more Open-Source structure, it happens to be a good moment to part sides with the Network layer.

Also, Consensus grew organically into many packages that although they split nicely the functionality in “separate parts”, they become quite difficult to keep in sync. We made the decision to distribute those packages in bundles but that is just an artificial grouping (not completely artificial though) that Cabal doesn’t understand. Therefore problems started appearing as bundles were broken and supposedly impossible situations took place.

So now we took the decision to make a big reorganization and at the same time migrate the code to a new repository.

Structure

The package structure will now be as follows:

The graph of dependencies for the implementation packages is as follows:

This reorganization will impact downstream clients and there will be some time of adaptation.

Steps of the migration

  1. Merge the whole history of the old repo into this one.
  2. Delete the unneeded packages.
  3. Do the reorganization
  4. Set up side services, I will list a few to not forget them
    1. CI
    2. Nix
    3. PR checks
    4. Code owners
    5. Branch protection
    6. Docs website
    7. Haddock website
    8. Readme
  5. Migrate the issues (discussion needed)
  6. Migrate PRs (discussion needed)
  7. Remove the packages from the old repository
  8. Update downstream clients
nfrisby commented 1 year ago

The following are my notes from the discussion we had about migrating the issues. We also thought to ping MPJ and @abailly-iohk for their thoughts on this issue.

The only downside is that occurrences of old issue numbers outside of GitHub metadata cannot be automatically updated.

The "perfect" scenario would be:

The only remaining risk of ambiguity would then be among issues created after the migration: Networking will eventually create a Issue numbered 5000 and so will Consensus too. But that is inevitable (unless we artificially inflate our counts to start at 100000 for new issues etc :grimacing:)

I'd say the biggest risk of that "perfect" plan is if our list of issues to transfer was incomplete. If we missed one during the original attempt, then when we later Transfer it, there's now way for it to end up having the same number in the new repository (because we already "consumed" that number with a "dummy" issue).

nfrisby commented 1 year ago

I think migrating PRs is less of a concern; there aren't as many of them.

We probably do have commit messages that refer to Issue and/or PR "#30" for example. But there's nothing we can do about that.... except create a dummy Issues (from my above comment) that link to the corresponding ouroboros-network Issue or PR instead of just being deleted.

jasagredo commented 1 year ago

These are the two PRs that implement this migration:

jasagredo commented 1 year ago

I'm closing this as complete. We can always refer back to it.