-
Notifications
You must be signed in to change notification settings - Fork 36
Factor out application of transition configuration to the Ledger repository #934
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
Factor out application of transition configuration to the Ledger repository #934
Conversation
... to match those of the corresponding ledger functions.
…g.Numeric` This instance was removed from `cardano-base`.
... which is used in the `ThreadNet` tests. The correctness of this change relies on the ledger not registering the initial funds in the genesis configuration file. This was recently changed in the Ledger component.
We rely on the `injectIntoTestState` function, which is now defined at the Ledger side.
784f977 to
c11286c
Compare
ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs
Show resolved
Hide resolved
| type family ShelleyBlockLedgerEra blk where | ||
| ShelleyBlockLedgerEra (ShelleyBlock proto era) = era |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should live in the shelley subdir somewhere, perhaps in Shelley/Block.hs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could even be used to share code with
Lines 203 to 207 in af4b27e
| type family ShelleyBlockEra blk where | |
| ShelleyBlockEra (ShelleyBlock proto era) = era | |
| class L.Era (ShelleyBlockEra blk) => IsShelleyBlock blk | |
| instance L.Era era => IsShelleyBlock (ShelleyBlock proto era) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue for leaving it here for the same reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I missed your last comment, @amesgen. Could I use ShelleyBlockEra instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also consider replacing IsShelleyBlock with IsShelleyBlock in
Lines 203 to 207 in af4b27e
| type family ShelleyBlockEra blk where | |
| ShelleyBlockEra (ShelleyBlock proto era) = era | |
| class L.Era (ShelleyBlockEra blk) => IsShelleyBlock blk | |
| instance L.Era era => IsShelleyBlock (ShelleyBlock proto era) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that Cardano.Tools.DBAnalyser.Block.Cardano is a consumer of the module Ouroboros.Consensus.Cardano.Node this comment is attached to, so one can't use things from Cardano.Tools.DBAnalyser.Block.Cardano in Ouroboros.Consensus.Cardano.Node. So @jasagredo's suggestion of moving these utilities further up the module dependency tree (eg to Ouroboros.Consensus.Shelley.Ledger.Block) and using them in both places makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize the snippet you sent was in DBAnalyser. I could introduce a new module and reuse definitions from there 👍
74664d2 to
2552206
Compare
nfrisby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff looks great to me---happy to have Consensus out of the loop on this data flow 👏. (I'm not Approving only because there're ongoing conversations about where some of the type-level utilities should live.)
23da4ad to
42356a9
Compare
4d77e00 to
a6bf691
Compare
a513385 to
2b6d5f5
Compare
|
Superseded by #1032 |
…gerEra` (#1073) Pending change from #934 (comment)
Closes #899
Needs IntersectMBO/cardano-ledger#4023