IntersectMBO / ouroboros-network

Specifications of network protocols and implementations of components running these protocols which support a family of Ouroboros Consesus protocols; the diffusion layer of the Cardano Node.
https://ouroboros-network.cardano.intersectmbo.org
Apache License 2.0
267 stars 86 forks source link

Relax handshake negotiation #4599

Open coot opened 1 year ago

coot commented 1 year ago

When negotiating versions we should ignore versions for which version data cannot be decoded. We do that only in codecHandshake which decodes bytes to cborg Term, but not in acceptOrRefuse which decodes the Term to a Haskell data type.

The PR should also enhance our test suite to send a mixture of:

One can easily test this by breaking encoding of one of the version data in cardano-ping library (that's how the issue was discovered).

coot commented 1 year ago

Output from a broken cardano-ping which sends invalid data for NodeToClientV_16:

$ cardano-cli ping -Q -u /run/user/1000/coot-node.socket
/run/user/1000/coot-node.socket network rtt: 0.000
/run/user/1000/coot-node.socket handshake rtt: 0.127011123s
/run/user/1000/coot-node.socket Protocol error DecodeError 32783 "unknown encoding: TInt 764824073"