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

Test & fix backwards compatibility between Byron and Cardano #2385

Merged
merged 7 commits into from Jul 10, 2020

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Jul 10, 2020

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.

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.
@mrBliss mrBliss added the consensus issues related to ouroboros-consensus label Jul 10, 2020
@mrBliss mrBliss requested a review from edsko July 10, 2020 14:46
Comment on lines +163 to +162
instance ConvertRawHash ByronToCardano where
toRawHash _ = toRawHash pb
fromRawHash _ = fromRawHash pb
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still needed?

Copy link
Contributor Author

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.

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.

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.
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 10, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Jul 10, 2020
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>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 10, 2020

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.
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 10, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 10, 2020

@iohk-bors iohk-bors bot merged commit 1a9b5f6 into master Jul 10, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/backwards-compat branch July 10, 2020 15:51
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
Development

Successfully merging this pull request may close these issues.

Test compatibility between Byron and Cardano with the hard fork disabled
2 participants