Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganise ouroboros-consensus #1657

Merged
merged 5 commits into from
Feb 19, 2020
Merged

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Feb 18, 2020

Fixes #1651 and #1652.

  • Split off Byron related code and tests to ./ouroboros-consensus-byron.

  • Split off Byron Spec related code and tests to
    ./ouroboros-consensus-byronspec.

  • Split off mock block related code and tests to
    ./ouroboros-consensus/ouroboros-consensus-mock.

  • Split off test infrastructure code and tests to
    ./ouroboros-consensus/ouroboros-consensus-test-infra.

These last two are both internal libraries of ouroboros-consensus and
separate packages, because the test suites of ouroboros-consensus depend on
them, while other packages, i.e., ouroboros-consensus-byron, cardano-node,
..., will also depend on them. If only Cabal supported multiple public
libraries in one project.

  • Remove the Exception instance of PBftLeaderCredentialsError, as it was
    never actually thrown.

  • Add nodeToExitReason, as it can be blk-dependent.

  • Rename Ouroboros.Storage to Ouroboros.Consensus.Storage.

@mrBliss mrBliss added the consensus issues related to ouroboros-consensus label Feb 18, 2020
@mrBliss mrBliss requested review from edsko and nfrisby February 18, 2020 11:14
@mrBliss mrBliss force-pushed the mrBliss/reorganise-consensus branch from 2395572 to 0afe404 Compare February 18, 2020 11:16
@mrBliss mrBliss linked an issue Feb 18, 2020 that may be closed by this pull request
@mrBliss mrBliss mentioned this pull request Feb 18, 2020
@edsko
Copy link
Contributor

edsko commented Feb 18, 2020

While we're at it (can be separate PR): ChainSync.Client and ChainSync.Server?

@edsko
Copy link
Contributor

edsko commented Feb 18, 2020

The -byron package should probably have a different module hiearchy: Ouroboros.Consensus.Byron.*? Otherwise people like @mrBliss might start complaining it's hard to locate modules :)

@mrBliss mrBliss force-pushed the mrBliss/reorganise-consensus branch from 0afe404 to 5833f6b Compare February 18, 2020 12:32
@edsko
Copy link
Contributor

edsko commented Feb 18, 2020

Moving Ouroboros.Storage to Ouroboros.Consensus.Storage, but we should probably flatten this a bit:

  • Merge Ouroboros.Consensus.Util and Ouroboros.Consensus.Storage.Util
  • Move up Ouroboros.Consensus.Storage.Common
  • Move up some other modules (EpochInfo for instance)?

@mrBliss mrBliss force-pushed the mrBliss/reorganise-consensus branch 4 times, most recently from 3b3dc7f to c37cbfd Compare February 18, 2020 16:06
Copy link
Contributor

@edsko edsko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed over hangout. And I thought I was bad when it came to refactoring 😁 Good stuff, will be great to get this in. Then more refactoring coming up soon :)

@mrBliss mrBliss force-pushed the mrBliss/reorganise-consensus branch from c37cbfd to 8be6a2b Compare February 18, 2020 17:58
Fixes #1651 and #1652.

* Split off Byron related code and tests to `./ouroboros-consensus-byron`.

* Split off Byron Spec related code and tests to
  `./ouroboros-consensus-byronspec`.

* Split off mock block related code and tests to
  `./ouroboros-consensus/ouroboros-consensus-mock`.

* Split off test infrastructure code and tests to
  `./ouroboros-consensus/ouroboros-consensus-test-infra`.

These last two are both internal libraries of `ouroboros-consensus` and
separate packages, because the test suites of `ouroboros-consensus` depend on
them, while other packages, i.e., `ouroboros-consensus-byron`, `cardano-node`,
..., will also depend on them. If only Cabal supported multiple public
libraries in one project.

* Remove the `Exception` instance of `PBftLeaderCredentialsError`, as it was
  never actually thrown.

* Add `nodeToExitReason`, as it can be `blk`-dependent.

* Rename `Ouroboros.Storage` to `Ouroboros.Consensus.Storage`.
Running `cabal test all` should not run the tests of `cardano-ledger`, etc.
@mrBliss mrBliss force-pushed the mrBliss/reorganise-consensus branch from 5c6f693 to 56e5331 Compare February 18, 2020 18:51
If we disable it now without having a nightly job to run it, it will bitrot
for sure.

You can still disable the test locally by disabling the `cddl` flag in your
`cabal.project.local`.
@mrBliss
Copy link
Contributor Author

mrBliss commented Feb 19, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 19, 2020
1657: Reorganise ouroboros-consensus r=mrBliss a=mrBliss

Fixes #1651 and #1652.

* Split off Byron related code and tests to `./ouroboros-consensus-byron`.

* Split off Byron Spec related code and tests to
  `./ouroboros-consensus-byronspec`.

* Split off mock block related code and tests to
  `./ouroboros-consensus/ouroboros-consensus-mock`.

* Split off test infrastructure code and tests to
  `./ouroboros-consensus/ouroboros-consensus-test-infra`.

These last two are both internal libraries of `ouroboros-consensus` and
separate packages, because the test suites of `ouroboros-consensus` depend on
them, while other packages, i.e., `ouroboros-consensus-byron`, `cardano-node`,
..., will also depend on them. If only Cabal supported multiple public
libraries in one project.

* Remove the `Exception` instance of `PBftLeaderCredentialsError`, as it was
  never actually thrown.

* Add `nodeToExitReason`, as it can be `blk`-dependent.

* Rename `Ouroboros.Storage` to `Ouroboros.Consensus.Storage`.

Co-authored-by: Thomas Winant <thomas@well-typed.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 19, 2020

@iohk-bors iohk-bors bot merged commit eba39ad into master Feb 19, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/reorganise-consensus branch February 19, 2020 09:29
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 19, 2020
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 19, 2020
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 19, 2020
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 19, 2020
@mrBliss mrBliss mentioned this pull request Feb 20, 2020
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 20, 2020
After IntersectMBO/ouroboros-network#1657

Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 25, 2020
After IntersectMBO/ouroboros-network#1657

Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
iohk-bors bot added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 25, 2020
588: Update ouroboros-network dependency r=mrBliss a=mrBliss


Issue
------

Pushing through the changes made in IntersectMBO/ouroboros-network#1657


checklist
---------
- [ ] This PR contains all the work required to resolve the linked issue.

- [ ] This PR results in breaking changes to upstream dependencies.

- [ ] The work contained has sufficient documentation to describe what it does and how to do it.

- [ ] The work has sufficient tests and/or testing.

- [ ] I have committed clear and descriptive commits. Be considerate as somebody else will have to read these.

- [ ] I have added the appropriate labels to this PR.


Co-authored-by: Thomas Winant <thomas@well-typed.com>
Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
intricate pushed a commit to IntersectMBO/cardano-node that referenced this pull request Feb 26, 2020
After IntersectMBO/ouroboros-network#1657

Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
intricate pushed a commit to IntersectMBO/cardano-node that referenced this pull request Feb 26, 2020
After IntersectMBO/ouroboros-network#1657

Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
intricate pushed a commit to IntersectMBO/cardano-node that referenced this pull request Feb 26, 2020
After IntersectMBO/ouroboros-network#1657

Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
intricate pushed a commit to IntersectMBO/cardano-node that referenced this pull request Feb 26, 2020
After IntersectMBO/ouroboros-network#1657

Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
iohk-bors bot added a commit to IntersectMBO/cardano-node that referenced this pull request Feb 27, 2020
588: Update ouroboros-network dependency r=mrBliss a=mrBliss


Issue
------

Pushing through the changes made in IntersectMBO/ouroboros-network#1657


checklist
---------
- [ ] This PR contains all the work required to resolve the linked issue.

- [ ] This PR results in breaking changes to upstream dependencies.

- [ ] The work contained has sufficient documentation to describe what it does and how to do it.

- [ ] The work has sufficient tests and/or testing.

- [ ] I have committed clear and descriptive commits. Be considerate as somebody else will have to read these.

- [ ] I have added the appropriate labels to this PR.


Co-authored-by: Thomas Winant <thomas@well-typed.com>
Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
Co-authored-by: Luke Nadur <19835357+intricate@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus
Projects
None yet
2 participants