Skip to main content

101 posts tagged with "consensus"

View All Tags

Consensus Team Update

· 6 min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Moved the Leios database (LeiosDB) from the leios-prototype branch to main. The SQLite backend, which was one large module, is now split into modules by job: schema, queries, inserts, reads, the write queue, and maintenance (#2311).
    • The mempool now reserves room for an Endorser Block, in addition to the room for a ranking block. Each transaction gets a second measure, its cost in an Endorser Block, which includes its entry in the Endorser Block (a 32-byte hash and the transaction size). In the Dijkstra era, the Endorser Block capacity comes from the protocol parameters. In every earlier era it is zero, so the mempool capacity of those eras does not change (#2312, #2325).
    • A mempool snapshot can now split its transactions into two parts: the longest prefix that fits a ranking block, and the next run that fits an Endorser Block. The forge still passes a zero Endorser Block capacity, so it selects the same transactions as before (#2320).
    • Added the trace TraceMempoolCapacityChanged. The mempool capacity comes from the protocol parameters, so a parameter update or an era transition changes it, and no trace reported this before. With the Endorser Block term, one such change can be several megabytes (#2304).
    • Two performance fixes in the prototype. A mempool read no longer waits while a writer holds the mempool state (#2308). Block application now reads the LeiosDB through a read-only connection, so it does not compete with the writer thread for the database (#2315).
    • Fixed a crash in the database tools. A LeiosDB handle links its background copier thread to the thread that opened it. No tool closed its handle, so the runtime raised an exception in the copier, and the link passed it on to the tool. Every tool now closes its handle. The same change fixes three shutdown defects that closing exposed, for example a close that blocked forever (#2314).
    • The Leios CBOR decoders now reject malformed input from a peer. A hash must be exactly 32 bytes, and the decoder checks each count that a peer declares against maxTxsPerEb before it allocates memory. This closes findings LEI-004, LEI-005 and LEI-009 from the Anastasia Labs audit (#2358, for ouroboros-leios#1125).
    • To stress test the Leios testnet, LeiosNotify now sends up to 1000 requests before it waits for a reply (#2366).
    • Released the prototype versions prototype-2026w39 and prototype-2026w40a (ouroboros-leios#1117, ouroboros-leios#1131, with the node integration in cardano-node#6708 and cardano-node#6722). The first release has the mempool, database and shutdown fixes above. It also shrinks the SQLite write-ahead log back to 64 MiB after a burst of writes, for example a testnet sync (ouroboros-consensus#2332). The second release keeps votes for the 128 most recent points only, so the vote state no longer grows without limit. This bound lets us take load readings, but it does not resist an adversary (ouroboros-consensus#2367).
  • Maintenance and support (Treasury Funding Initiative 17: Maintenance and Support):
    • Released ouroboros-consensus 5.0 (#2356, with the dependency updates in #2341 and #2352). The release has the reworked Peras API and drops node-to-client versions below v23. The default ledger snapshot policy now takes a snapshot every 40 * k slots, where k is the security parameter, which is one snapshot a day on mainnet. A background thread now writes the snapshots. The mempool now moves a transaction from an older era to the current era in one step: it encodes the transaction in its own era and decodes it in the current era. Before, it translated the transaction through every era in between.
    • Released ouroboros-consensus 5.1.0.0 (#2368, ported to main in #2369). At startup, the node now traces its ledger snapshot policy. The snapshot interval is in slots, but the write delay and the rate limit are in seconds. So settings that suit mainnet, where a slot is one second, can be wrong on a testnet with shorter slots. If the delay or the rate limit is as long as the interval or longer, the node emits the warning ImplausibleSnapshotPolicy.
    • Moved the tracing instances for consensus types from cardano-node into the new ouroboros-consensus:tracing sublibrary. A change to a traced type and the change to its log output can now go in one commit. Some log output changes: a mempool trace at the detailed level logs a transaction as hex CBOR instead of a Haskell Show rendering, and a rejected transaction always logs the reason (#2244).
    • The database tools now read the node configuration with cardano-config, and db-synthesizer reads its forging keys with cardano-keys. The tools now apply the same rules as cardano-node. Before, db-synthesizer could forge blocks in an era that a node with the same configuration file would not enter. One visible change: every genesis file in the configuration must now come with its hash (#2259, #2335).

Consensus Team Update

· 3 min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Split the Leios database into two files, one for data a node can still roll back, and one for data that is settled. A certified Endorser Block moves from the first file to the second in the background. An operator can put the two files on different disks, and give the busier file the faster disk. The same change adds garbage collection in small steps: one thread marks the rows a node no longer needs, and a second thread deletes them in paced batches, so the deletion does not hold up the rest of the node (#2261, for ouroboros-leios#969).
    • Adapted the prototype node to the two file layout, and published the size of each part as a node metric (cardano-node#6656). Added a dashboard that shows how many Endorser Blocks and transactions sit in each part, and updated the devnet configuration to match (ouroboros-leios#1054).
    • db-synthesizer now builds a Leios chain instead of a chain of empty blocks. It fills each block with transactions, puts what does not fit into an Endorser Block, and votes on each announced Endorser Block so that a later block can certify it. It also stores each Endorser Block it forges, which an earlier version dropped. The other database tools now have a Leios chain to work on (#2241, #2283).
    • db-truncater now handles a Leios chain. After it cuts the chain back to a chosen slot, it cuts the Leios database back to the same slot, drops the transactions that no Endorser Block refers to, and shrinks the file (#2262, for ouroboros-leios#1023).
    • Moved block forging out of the node kernel into a module of its own, and split it into named steps. The behaviour does not change. The new shape makes the forging path easier to follow, easier to instrument, and easier to reuse from the database tools (#2281).
  • Maintenance and support (Treasury Funding Initiative 17: Maintenance and Support):
    • Dropped support for node-to-client protocol versions below v23. Version 23 shipped with node 10.7.0 in March 2026, and every client we checked already offers it. The older versions kept legacy code alive in the consensus layer (#2265).

Consensus Team Update

· 4 min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Rewrote the logic that decides which Leios data to download from which peer. A node now bounds both the time it spends on each decision and the memory it holds for pending downloads. It also prioritises the newest Endorser Blocks, and randomises the order in which it asks for missing transactions, so that several requests do not saturate the same limits at once (#2237, for ouroboros-leios#1021).
    • Added a cache that holds the transactions of recent Endorser Blocks. A node that already saw a transaction does not need to download it again. The download logic reads from this cache and from the mempool (#2188, for ouroboros-leios#1021).
    • Fixed a second cause of unwanted disconnects between honest nodes. A syncing node has a chain tip that is too old to check young Leios messages. Such a node now stops asking for those messages until it catches up, instead of rejecting the replies (#2255, cardano-node#6673).
    • Capped the time the mempool spends to read a ledger state from disk. A block producer that waits on disk no longer delays the forging of its own block past its slot (#2217, for ouroboros-leios#911).
    • Extended the call tracing of the block forging and chain selection threads, and improved the dashboard that shows the results. This tells us where a prototype node spends its time on the Leios devnet (#2183, ouroboros-leios#1088, for ouroboros-leios#911).
    • Moved the classification and rendering of Leios trace messages from cardano-node into the consensus layer. We can now add or change a Leios trace message without a matching change in cardano-node (#2263).
    • Integrated the two changes above into the prototype node used on the devnet (cardano-node#6681).
  • Storage layer (Treasury Funding Initiative 10: LSM including UTXO-HD):
    • Ledger state garbage collection now runs in its own thread. Before this change, the delay before a snapshot also blocked garbage collection, so a node kept every ledger state in memory until the snapshot completed (#2227).
    • Turned off IO wait accounting on the LSM storage backend. The accounting itself was a source of measurement error, see well-typed/blockio-uring#55 (#2247).
  • Maintenance and support (Treasury Funding Initiative 17: Maintenance and Support):
    • Released ouroboros-consensus 4.2.0.0 (#2242).
    • Fixed a silent failure in the GetGenesisConfig query. Version 1.19.0.0 of cardano-ledger-shelley added a field to the Shelley genesis record without a change to the node-to-client protocol version. A client that linked the new ledger then waited forever for bytes that a node with the old ledger never sends. cardano-wallet hit this against node 11.0.1 and stopped following the chain. The query now sends the original 15 fields again, and the decoder accepts a reply from an already deployed node, so a client needs no node upgrade. The fix shipped in ouroboros-consensus 4.2.1.0 (#2251, #2257, #2258).

Consensus Team Update

· One min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Closed an attack on the way nodes announce Endorser Blocks. The attack made honest nodes disconnect from each other (#2179, for ouroboros-leios#1029).
    • db-analyser now reads Leios chains. The tool replays a chain and reports the cost to apply each block. The reports now cover the transactions of each certified Endorser Block, their total size, and the time to read them (#2181, for ouroboros-leios#1023).
  • Maintenance and support (Treasury Funding Initiative 17: Maintenance and Support):
    • Forward-ported the new snapshot interval and the mempool allocation fix from the 4.x release line to the main development branch. The 2026-08-11 update describes both changes (#2209, #2215).

Consensus Team Update

· 4 min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios prototype and testnet (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Added endorser-block announcements to the node. The node now generates them and sends them to its peers. An announcement tells a peer that an endorser block exists, before the block itself arrives. The other Leios components do not use the announcements yet. This change is the first step (#2132, for ouroboros-leios#772).
    • Added announcements to the proto-devnet demo, with a new graph of the announcement age on arrival. The demo can now run a line topology. In that topology the first and third nodes have no direct link. This makes the announcement behaviour easier to watch (#1002).
    • Made the node reject malformed Dijkstra blocks. A block body must not carry both a Leios certificate and transactions. The header flag must also agree with the body content (#2178, for ouroboros-leios#932).
    • Released a new prototype, prototype-2026w32 (#6636).
    • Fixed the testnet visualizer. It lost events and reported send and receive counts that did not match. It now reads the log store with range queries instead of a live stream (#1000).
    • Corrected the units on the throughput dashboard. The certification graph now covers every node, not only the first (#1001).
  • Node performance (Treasury Funding Initiative 17: Maintenance and Support):
    • Removed the allocations from the comparison of transaction identifiers. The old code rebuilt a 32-byte hash on each comparison. The mempool and local queries use that code path heavily. Comparisons now run about five times faster and allocate nothing (#2125, for #2003).
    • Cut the allocations in the mempool snapshot code (#2195).
    • Simplified how the mempool moves a transaction into a newer era. The mempool now decodes the transaction straight into the target era. It no longer steps through each era in between (#2134).
  • Releases and the next hard fork (Treasury Funding Initiative 17: Maintenance and Support):
    • Released ouroboros-consensus 4.0.0.0 and 4.1 (#2161, #2189).
    • Allowed the node to hard fork into Dijkstra, the next Cardano era (#2167).
  • Storage and snapshots (Treasury Funding Initiative 10: LSM including UTXO-HD):
    • Changed the default snapshot policy. The node now takes a snapshot every 40*k slots, with no offset. On mainnet that is one snapshot a day. One snapshot in five lands on an epoch boundary. This keeps the node aligned with Mithril (#2194).
  • Documentation and tooling (Treasury Funding Initiative 17: Maintenance and Support):
    • Wrote a new page on hard forks and node-to-node versioning. A hard fork does not need a new node-to-node protocol version. Each block carries its own era tag. The protocol version holds back an era that is not yet active, not the wire format (#2117).
    • Corrected the db-analyser timing documentation and added two columns to its CSV output. A script that reads the CSV by column position needs an update (#2186).