Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7dedecd
Re-organize the documentation frontpage.
dnadales May 30, 2025
baa1e6b
Add an introduction to the Explanation section
dnadales May 30, 2025
55900a3
Add a "Design Goals" section
dnadales May 30, 2025
b73350d
Add a "Interaction with the Ledger Layer" section
dnadales Jun 2, 2025
762d433
Add sections about ticking and forecasting
dnadales Jun 3, 2025
7a66676
Add a section on Cardano Instances for ledger-related types and classes
dnadales Jun 3, 2025
08949d4
Add a section explaining the queries mechanism in Consensus
dnadales Jun 4, 2025
dc24f1b
Minor edits to the Queries section
dnadales Jun 4, 2025
a688388
Replace explanation of the removed `querySupportedVersion`
dnadales Jun 5, 2025
5800fec
Add a section on query serialization
dnadales Jun 5, 2025
d014aae
Add a HOWTO on adding new queries
dnadales Jun 6, 2025
a70eb17
Add a Consensus Protocol Section
dnadales Jun 26, 2025
77fcc20
Add haddocks for `selectView`
dnadales Jul 1, 2025
f50a9bb
Add `LedgerSupportsProtocol` section
dnadales Jul 1, 2025
51272ac
Add `BlockSupportsProtocol` section
dnadales Jul 1, 2025
535afc3
Add haddocks for `selectView`
dnadales Jul 1, 2025
4091b92
Add haddocks to `ChainOrderConfig`
dnadales Jul 1, 2025
c573f06
Add a section on envelope validation (`ValidateEnvelope`)
dnadales Jul 2, 2025
2780f37
Add an explanation about `BlockProtocol`
dnadales Jul 4, 2025
5218d4a
Add a section on the extended ledger state (`ExtLedgerState`)
dnadales Jul 4, 2025
5785878
Add an explanation about `ProtocolHeaderSupportsLedger`
dnadales Jul 4, 2025
559f88e
Add a section on Chain Validity
dnadales Jul 4, 2025
010b374
Minor
dnadales Jul 7, 2025
d4e72cd
Add an explanation about chain ordering
dnadales Jul 8, 2025
c03302e
Correct typo
dnadales Jul 8, 2025
35c863a
Address Nick's comments on the `ChainOrder` section
dnadales Jul 9, 2025
881e6d4
Address Alex's feedback on chain ordering explanation
dnadales Jul 9, 2025
fcb4615
Minor
dnadales Jul 9, 2025
6c1f0e2
Add a section on Chain Selection
dnadales Jul 11, 2025
087ccd4
Add a section on block forging
dnadales Jul 14, 2025
9006ea5
Add a section on the k security parameter
dnadales Jul 14, 2025
9ac679c
Add a section on PBFT
dnadales Jul 14, 2025
50ea594
Add a section on TPraos
dnadales Jul 14, 2025
24b51f9
Add a section about Praos
dnadales Jul 15, 2025
ca3a2b1
Move Genesis.md to genesis-design.md
dnadales Jul 16, 2025
52d8937
Edit Notation, Requirements, Components sections of genesis-design.md
dnadales Jul 16, 2025
02b0114
Edit "How the Components Satisfy the Requirements"
dnadales Jul 16, 2025
6403c82
Add Genesis Design to the sidebar
dnadales Jul 21, 2025
e76e6a9
Edit first batch of component level design sections
dnadales Jul 21, 2025
a761e72
Replace `---` with `&mdash`
dnadales Jul 21, 2025
4403179
Edit "The Genesis Density Disconnection Component without CSJ"
dnadales Jul 21, 2025
c9d9fda
Edit "The Limit on Patience Component" section
dnadales Jul 21, 2025
54cf44e
Edit "The Limit on Patience Component"
dnadales Jul 21, 2025
3968a6c
Incorporate minor edits to the Genesis Design section
dnadales Jul 23, 2025
c1fa8f3
Incorporate second round of minor edits to the Genesis Design section
dnadales Jul 23, 2025
a4e5179
Update stale note about honest peers with candidate fragments ...
dnadales Jul 23, 2025
e7d2b2f
Change best=worst to average=worst
dnadales Jul 23, 2025
67a10f3
Update "The Genesis Density Disconnection Component with CSJ" section
dnadales Jul 23, 2025
67636c2
Update Genesis Design to account for #1598
dnadales Jul 24, 2025
8c2809b
Add a section briefly explaining features of the Genesis protocol
dnadales Jul 25, 2025
c8a5b9c
Add a section on managing updates
dnadales Jul 25, 2025
b3f9112
Add a reference to LoE
dnadales Jul 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/website/contents/explanation/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Custom implementations of the Cardano node client are free to bypass this check

Our code does not use the negotiated [`NodeToClientVersion`][n2c] directly, but translates them first to a [`CardanoNodeToClientVersion`][cardano-n2c] and then to [`ShelleyNodeToClientVersion`][shelley-n2c].

- The [`querySupportedVersion`][query-supported-version] function assigns a [`ShelleyNodeToClientVersion`][shelley-n2c] to each Shelley-based query.
- The [`querySupportedVersion`][query-supported-version] function assigns a [`ShelleyNodeToClientVersion`][shelley-n2c] to each Shelley-based query, indicating the minimum *Shelley* version that supports the query.
Copy link
Member

Choose a reason for hiding this comment

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

- Each [`CardanoNodeToClientVersionX`][cardano-n2c] specifies the [`ShelleyNodeToClientVersion`][shelley-n2c] for each era, or indicates that a specific [era][feature-table] is not supported. As an example, consider
```haskell
pattern CardanoNodeToClientVersion10 :: BlockNodeToClientVersion (CardanoBlock c)
Expand All @@ -74,7 +74,7 @@ Our code does not use the negotiated [`NodeToClientVersion`][n2c] directly, but
```
This tells us that in Shelley, Allegra, Mary, Alonzo and Babbage, we use `ShelleyNodeToClientVersion6`, and Conway is disabled. This means that no queries that were introduced in `ShelleyNodeToClientVersion7` can be used, and no queries in the Conway era are possible at all.

In order to reduce the number of possible version combinations, we currently follow the convention that all `ShelleyNodeToClientVersion`s in one `CardanoNodeToClientVersionX` are equal. This means that the developers of clients (like `cardano-api`, etc) can rely on the fact that once a `NodeToClient` version has been negotiated, all enabled Shelley-based eras support exactly the same queries.[^conway-queries] We might weaken this guarantee in the future, see [#864](https://github.com/IntersectMBO/ouroboros-consensus/issues/864).
To reduce the number of possible version combinations, we currently follow the convention that all `ShelleyNodeToClientVersion`s in one `CardanoNodeToClientVersionX` are equal. This means that the developers of clients (like `cardano-api`, etc) can rely on the fact that once a `NodeToClient` version has been negotiated, all enabled Shelley-based eras support exactly the same queries.[^conway-queries] We might weaken this guarantee in the future, see [#864](https://github.com/IntersectMBO/ouroboros-consensus/issues/864).

The mapping from `NodeToClientVersion`s to `CardanoNodeToClientVersion`s is [`supportedNodeToClientVersions`][supportedNodeToClientVersions]. Additionally, all versions larger than a certain `NodeToClientVersion` (see [`latestReleasedNodeVersion`][latestReleasedNodeVersion]) are considered experimental, which means that queries newly enabled by them can be added and changed at will, without compatibility guarantees. They are only offered in the version negotiation when a flag (currently, `ExperimentalProtocolsEnabled`) is set; also see [`limitToLatestReleasedVersion`][limitToLatestReleasedVersion] and its call/usage sites.

Expand All @@ -88,8 +88,8 @@ That same fundamental hypothetical of genuine chains with different block types

Each `ShelleyNodeToClientVersion` has a set of queries it supports. Assume the maximum version is $X$, and that it has queries $Q_0, \dots, Q_{n-1}$ associated to it. If no node was released that supports version $X$, ie `ShelleyNodeToClientVersionX`, we have a reasonable degree of certainty that no client will send any $Q_i$, $x \in [0, n - 1]$ to older nodes (since no such node was yet released). Therefore, if we add a new query $Q_n$ we can associate it to the unreleased version $X$ (`ShelleyNodeToClientVersionX`).

On the other hand, the node that supports version `X` has been released, then we
need to increase the maximum Shelley node-to-client version, by adding one more constructor to `ShelleyNodeToClientVersion`, which is defined in module [Ouroboros.Consensus.Shelley.Ledger.NetworkProtocolVersion](https://github.com/IntersectMBO/ouroboros-consensus/blob/main/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs). By adding this new version the node is able to detect if other Cardano clients that respect this versioning mechanism support said query.
On the other hand, once the node that supports version `X` has been released, we need to increase the maximum Shelley node-to-client version, by adding one more constructor to `ShelleyNodeToClientVersion`, say `ShelleyNodeToClientVersionY`, which is defined in module [Ouroboros.Consensus.Shelley.Ledger.NetworkProtocolVersion](https://github.com/IntersectMBO/ouroboros-consensus/blob/main/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs).
By adding this new version the node is able to detect if other Cardano clients that respect this versioning mechanism support said query.

Henceforth, we call an unreleased version "experimental" (ie only used for demo purposes/specific to an unreleased era).

Expand Down
Loading