You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users repeatedly have asked for a reliable API reference of the LocalStateQuery protocol available on the Node-to-Client (N2C) socket of the cardano-node.
The cardano-node implements this API through the ouroboros-network, ouroboros-consensus and cardano-ledger components, where the resulting protocol is comprised by messages and their binary CBOR encodings from these three components.
There are multiple clients/servers with varying completeness of this API:
This is a meta-issue to collect these issues and tackle them in course of the cardano-blueprint initiative. On top of these issues, there has been also repeated questions on communication channels about this API.
What
An API reference for the N2C protocols, especially the LocalStateQuery should be:
human readable to discover available functionality
machine readable to test and ensure consistency with implementations
An explanation of the protocol (acquiring, querying, ...) with messages defined as CDDL
A definite list of all queries available
can be searched
can be linked to
Each query holds an explanation (to answer questions like these)
Each query and its possible responses are defined as a CDDL
Can be used to encoder/decoder implementations
Notable implementations like pallas, gouroboros and dingo have test suites to check conformance
The API definition is automatically checked against the cardano-node reference implementation
Contributors to ouroboros-network, ouroboros-consensus and cardano-ledger get notified about inconsistencies
The API definition is versioned, such that
it is clear which API is available in a given cardano-node version (or any of other client/server implementations)
modifications of the API can be done freely before releasing components
How
As also discussed in this and this issue, the concrete API is a combination of the ouroboros-network protocol, that delegates handling of a list of queries defined by ouroboros-consensus, which in turn often relies on cardano-ledger to provide the actual query results.
Why
Users repeatedly have asked for a reliable API reference of the
LocalStateQueryprotocol available on the Node-to-Client (N2C) socket of thecardano-node.The
cardano-nodeimplements this API through theouroboros-network,ouroboros-consensusandcardano-ledgercomponents, where the resulting protocol is comprised by messages and their binary CBOR encodings from these three components.There are multiple clients/servers with varying completeness of this API:
.cddlfiles).Implementing them resulted in users asking for this in multiple issues scattered across repositories:
This is a meta-issue to collect these issues and tackle them in course of the cardano-blueprint initiative. On top of these issues, there has been also repeated questions on communication channels about this API.
What
An API reference for the N2C protocols, especially the
LocalStateQueryshould be:Concretely this means we need:
CDDLCDDLpallas,gouroborosanddingohave test suites to check conformancecardano-nodereference implementationouroboros-network,ouroboros-consensusandcardano-ledgerget notified about inconsistenciescardano-nodeversion (or any of other client/server implementations)How
As also discussed in this and this issue, the concrete API is a combination of the
ouroboros-networkprotocol, that delegates handling of a list of queries defined byouroboros-consensus, which in turn often relies oncardano-ledgerto provide the actual query results.Current situation
ouroboros-networkdefines a CDDL forlocalStateQueryMessagein local-state-query.cddlquery = anyandresult = anyplaceholdersouroboros-consensusdoes not define a CDDL ledger queries, there is this PR though: Refine the CDDL spec of theLocalStateQuerymini-protocol IntersectMBO/ouroboros-network#5074, where (shelley era) query messages are defined in data instance BlockQuery and encoding/decoding is provided byencodeShelleyQueryandencodeShelleyResult.resulttype, thecardano-ledgeris involved in providing the response.cardano-ledgergenerates a composite CDDL for theconwayera using cuddle into conway.cddl (with "huddle" source here)UTxOresult ofGetUTxOByTxInquery (needs to know how the Haskell typeUTxOis mapped to CBOR)PParamsseems not to be coveredConcrete solution idea
Create a binary, CDDL-based equivalence of the ledger state query documentation of ogmios:
.cddlfiles (see below).cddlfiles for each query/resultcardano-ledger'sconway.cddlouroboros-consensusthat test eachQuery.cddlfiles to be composed withconway.cddl.cddlof the overall protocolqueryandresultcombinationsouroboros-network'slocal-state-query.cddlconway.cddlSteps
cardano-nodecomponentspallasorgouroborosclientsTBD