IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.

Home Page:https://cardano.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] - 8.1.1-pre fails for NodeToClient protocols

AndrewWestberg opened this issue · comments

External

Area
NodeToClient miniprotocols

Summary
Between 1.35.7 and 8.1.1, the serialization format for some of the NodeToClient protocols has been altered. Serialization formats should not be changed unless the NodeToClient version is also incremented. The result is downstream tools breaking and unable to communicate with the nodes without code changes or externally knowing what version of the node they are communicating with. In 8.0.0, this was noticed for the protocolParameters query which was then fixed in 8.1.1. There are 3 additional queries that also need to be fixed in order for 8.1.1 and beyond to be properly compatible with the NodeToClient standards.

Steps to reproduce
Steps to reproduce the behavior:
From Kogmios/Ogmios 5.6.0, query an 8.1.1 node. Notice that the wire formats are changed for:
query delegationsAndRewards
query utxo
query stakeDistribution

Query 8.1.1 Node
Screenshot from 2023-06-17 20-08-18

Query 1.35.7 Node
Screenshot from 2023-06-17 20-10-25

Expected behavior
Within a NodeToClient protocol version, the wire formats should not change between cardano-node releases.

System info (please complete the following information):

  • OS Name: Ubuntu
  • OS Version: 22.04
  • Node version: 8.1.1-pre
  • CLI version: 8.1.1-pre

Screenshots and attachments
See:
CardanoSolutions/ogmios#313
CardanoSolutions/ogmios#315
CardanoSolutions/ogmios#316

Additional context
This breaks Ogmios, Phyrhose, probably TxPipe, cncli, SundaeSwap Scoopers, and any tools and downstream utilities that use these miniprotocols. Tools should be free to stay on their same NodeToClient version without worrying about breaking changes to the API. They should then be free to upgrade to newer versions of NodeToClient on their own timelines.

commented

+1 , This not only breaks downstream solutions delaying further ability to properly expire 1.35.x nodes, but also introduces unnecessary interim versions that cannot be used in different scenarios

Within a NodeToClient protocol version, the wire formats should not change between cardano-node releases.

💯

I've ran this by the ledger team. This is a problem with the deserialization of indefinte vs definite length lists. After being deserialized the format is the same, so this does not need a new NodeToClient version. Our assumption is people are trying to run a version of ogmios that hasn't been updated to work with 8.x.x.

It also looks like Ogmios uses Cardano.Binary instread of Cardano.Ledger.Binary for serialization/deserialization. Cardano.Ledger.Binary is safer. Some of the toCBOR instances in Cardano.Binary are bad because they have to break CBOR rules for legacy byron. Cardano.Ledger.Binary basically only uses Cardano.Binary when it has to (usually byron related). Cardano.Ledger.Binary also is versioned now as of 8.0.0.

@KtorZ According to the SPO call yesterday, it was made clear that Ogmios would need to be updated to fix the remaining format issues here.

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

Closing as downstream tools will change to adjust to this bug.