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
Test & fix backwards compatibility between Byron and Cardano #2385
Conversation
Sometimes it is more convenient to simply define the data/type instances without having to define the whole type class instances. For example, when wrapping an existing block to override the serialisation instances, we should not have to provide instances for classes like `LedgerSupportsMempool` when we only want to wrap the associated (data) types.
Sometimes it is more convenient to simply define the data/type instances without having to define the whole type class instances. For example, when wrapping an existing block to override the serialisation instances, we should not have to provide instances for classes like `GetHeader` when we only want to wrap the associated data type.
Sometimes it is more convenient to simply define the data/type instances without having to define the whole type class instances. For example, when wrapping an existing block to override the serialisation instances, we should not have to provide instances for classes like `QueryLedger` when we only want to wrap the associated data type.
These pattern synonyms could be used to construct queries, but not to pattern match on them because it is a GADT. Note the double "double" arrow, the second set of constraints are those provided by the pattern.
instance ConvertRawHash ByronToCardano where | ||
toRawHash _ = toRawHash pb | ||
fromRawHash _ = fromRawHash pb |
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.
Still needed?
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.
Yes, a superclass constraint of SerialiseNodeToNodeConstraints
.
ouroboros-consensus-cardano/test/Test/Consensus/Cardano/ByronCompatibility.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/test/Test/Consensus/Cardano/ByronCompatibility.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/test/Test/Consensus/Cardano/ByronCompatibility.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/test/Test/Consensus/Cardano/ByronCompatibility.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/test/Test/Consensus/Cardano/ByronCompatibility.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/test/Test/Consensus/Cardano/ByronCompatibility.hs
Outdated
Show resolved
Hide resolved
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.
Nice, great to have this tested now.
Some idiot broke backwards compatibility in #2349. We were no longer able to exchange queries via the `LocalStateQuery` protocol with a Byron-only node.
ce9f147
to
8929cb9
Compare
bors merge |
2385: Test & fix backwards compatibility between Byron and Cardano r=mrBliss a=mrBliss Test backwards compatibility between Byron and Cardano Fixes #2361. A node running `CardanoBlock` can communicate with older nodes that run `ByronBlock`, until the hard fork happens (as the other nodes won't support Shelley). Test that we're actually backwards compatible. This test did exactly what it was supposed to do: it found a bug! Some idiot broke backwards compatibility in #2349. We were no longer able to exchange queries via the `LocalStateQuery` protocol with a Byron-only node. Fix it. Co-authored-by: Thomas Winant <thomas@well-typed.com>
Build failed |
Fixes #2361. A node running `CardanoBlock` can communicate with older nodes that run `ByronBlock`, until the hard fork happens (as the other nodes won't support Shelley). Test that we're actually backwards compatible.
8929cb9
to
1a53abe
Compare
bors merge |
Test backwards compatibility between Byron and Cardano
Fixes #2361.
A node running
CardanoBlock
can communicate with older nodes that runByronBlock
, until the hard fork happens (as the other nodes won't supportShelley). Test that we're actually backwards compatible.
This test did exactly what it was supposed to do: it found a bug!
Some idiot broke backwards compatibility in #2349. We were no longer able to exchange queries via the
LocalStateQuery
protocolwith a Byron-only node. Fix it.