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

Version codec #1981

Merged
merged 19 commits into from
Apr 22, 2020
Merged

Version codec #1981

merged 19 commits into from
Apr 22, 2020

Conversation

coot
Copy link
Contributor

@coot coot commented Apr 21, 2020

This PR changes how Handshake codec works. Previously it would fail if
an unknown version number was submitted, now it will not.

This change should not change wire format of the handshake messages.

In addition it allows to confiugure which protocols versions are used by
consensus, there will be an accompanying PR in cardano-node repository which
adds an option to the confituration file.

I hope this fixes #1971, though I havent tested it (for that we need a new protocol
version).

  • Make it possible to configure NodeToNodeVersion / NodeToClientVersion
  • Make test-cddl run with cabal by default
  • Updated 'test-cddl' component
  • Fix a typo, added TODO comment
  • Updated chain-sync demo
  • Updatd test-network
  • Updated ouroboros-protocol-tests library
  • Updated ouroboros-network library
  • CodecCBORTerm deserves its own module
  • Move Unversioned to its own module
  • Updated ping-pong demo
  • Updated ouroboros-network-framework-tests
  • Added unversionedHandshakeCodec
  • RefuseReason changes
  • Change Handshake protocol codec
  • Change Socket API

All function take now handshake codec as an argument, this is
a preparation for further changes.
@coot coot added networking node-to-client Issues & PRs related to node-to-client protocols node-to-node Issues and PRs relate to node-to-node protocols labels Apr 21, 2020
@coot coot requested review from dcoutts and karknu April 21, 2020 10:03
Copy link
Contributor

@karknu karknu left a comment

Choose a reason for hiding this comment

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

LGTM.

coot added 18 commits April 22, 2020 12:51
Decoding version numbers must be done in two steps to avoid failing if
we receive a verions number that we don't know how to decode.  For that
reason we use 'CodecCBORTerm' record which encodes / decodes
'Codec.CBOR.Term.Term's.

The requirement of 'Serialised' instance on version number is not yet
removed, this will be done in next patch.
There are two changes in this patch:
- Added argument to 'VersionMismatch' which includes tags of versions
  that we were unable to decode.  Knowning only about versions we know
  is not that helpful.
- Reimplement its codec using 'CodecCBORTerm' for encoding / decoding
  version numbers.
This is 'Hanshake' codec which which is using 'Unversioned' version
numbers - used in tests.
test-cddl requires path to the `message.cddl` file, which is different
for `nix` and `cabal`.
This allows to configure node to use a particular set of protocols,
instead of just the compiled it ones.
This only seems unrelated to this patch set, I will use this test in the
following patch.
Asymmetric in the sense that the client and server codecs are different.
The server understands only a subset of versions that the client can
propose.
@coot
Copy link
Contributor Author

coot commented Apr 22, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Apr 22, 2020

@iohk-bors iohk-bors bot merged commit fcd1a4f into master Apr 22, 2020
@iohk-bors iohk-bors bot deleted the coot/protocol-versions branch April 22, 2020 11:52
iohk-bors bot added a commit that referenced this pull request Apr 22, 2020
1982: Enable -Wall in ouroboros-network-framework r=coot a=coot

Also use `-Werror` on CI; fix all the tiny issues.

This is done on top of #1981; I'll rebase it once #1981 is merged.


Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-to-client Issues & PRs related to node-to-client protocols node-to-node Issues and PRs relate to node-to-node protocols
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deserialise failure when connecting to FC4 node
2 participants