-
Notifications
You must be signed in to change notification settings - Fork 34
[WIP] Enrich block bodies to contain Peras certificates #1722
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
base: peras-staging
Are you sure you want to change the base?
[WIP] Enrich block bodies to contain Peras certificates #1722
Conversation
- Avoid orphans - We actually can't check that the open states are consistent directly as we would need to statefully get that info from the SUT.
It makes sense to use this without using an entire PerasCertDB, so decouple these. It might be nice to rename PerasCertDB-bench, but doesn't seem like a priority.
using cabal-docspec (not yet nixified)
This is purely for concise QuickCheck counterexample output.
This is in preparation for weighted chain comparisons.
Also remove the version for `ValidatedChainDiff` as it is unused.
Brings in cardano-base and propagates a set of `CardanoFeatureFlag`s from the top-level `RunNodeArgs` down to the `NodeKernelArgs`. This is currently needed by an upcoming PR to the GSM to distinguish whether having an established PerasCertDiffusion connection with a given peer is necessary or not when trying to decide if such peer is idling.
Bumps the external ouroboros-network source-repository-package to the updated peras-staging/pr-5202, which incorporates the changes from: IntersectMBO/ouroboros-network#5202 In addition, it tweak call sites of `nodeToNodeProtocols` to match its updated signature, passing down the enabled feature flags.
24dba5c to
13e6fa7
Compare
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs
Show resolved
Hide resolved
|
|
||
| instance ShelleyCompatible proto era => Condense (ShelleyBlock proto era) where | ||
| condense = show . shelleyBlockRaw | ||
| condense = show . ((shelleyBlockHeader &&& shelleyBlockBody) &&& shelleyBlockPerasCert) |
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.
We might want to tweak this instance.
65b3897 to
a93ba8f
Compare
ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs
Show resolved
Hide resolved
a93ba8f to
c0822d7
Compare
amesgen
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.
This looks good to me for now, let's wait until we get feedback from Ledger
| -- | Reconstruct a Shelley ledger block from a 'ShelleyBlock'. | ||
| -- | ||
| -- TODO: we should be able to avoid this conversion in most cases | ||
| fromShelleyBlock :: ShelleyBlock proto era -> SL.Block (ShelleyProtocolHeader proto) era | ||
| fromShelleyBlock blk = SL.Block (shelleyBlockHeader blk) (shelleyBlockBody blk) | ||
|
|
||
| -- | Construct a 'ShelleyBlock' from a Shelley ledger block. | ||
| -- | ||
| -- TODO: we should be able to avoid this conversion in most cases | ||
| toShelleyBlock :: | ||
| ShelleyCompatible proto era => SL.Block (ShelleyProtocolHeader proto) era -> ShelleyBlock proto era | ||
| toShelleyBlock (SL.Block hdr body) = mkShelleyBlock hdr body |
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.
We could also just store an SL.Block, but encode it differently. But either way, this conversion should be super cheap
ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs
Show resolved
Hide resolved
a97ac93 to
eef954f
Compare
Closes tweag/cardano-peras#141