Skip to main content

103 posts tagged with "consensus"

View All Tags

Consensus Team Update

· 3 min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios implementation on main (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • In the Dijkstra era, block producers now forge endorser blocks from the transactions that do not fit in the ranking block, and write them to the LeiosDB (#2377, #2442).
    • The ChainDB now opens the LeiosDB and drives its garbage collection (#2431). The LeiosDB no longer de-duplicates transactions, which makes its schema simpler (#2370).
    • Chain selection now checks the Leios certificate of a block when the block arrives. It waits to select the block until the node has the certified endorser block (#2439, #2433).
    • The node now relays Leios votes. It checks each vote once and disconnects from a peer that sends an invalid vote (#2430).
    • The Leios decoders now reject oversized hashes and endorser blocks. This ports the fix for audit finding LEI-004 from the prototype (#2440, #2458).
    • The LeiosDB benchmark now measures latency under load instead of throughput (#2422).
  • Leios prototype (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Released rc-2026w43. The LeiosDB writes endorser blocks faster, and block producers forge certifying blocks in milliseconds instead of up to 0.9 s (#2449, #2451).
    • Released rc-2026w44 with adaptive endorsements. If endorser blocks do not get enough votes, block producers forge smaller ones, so throughput goes down step by step instead of falling back to Praos levels (#2475, ouroboros-leios#1152).
    • The node now traces the time and cost to validate an endorser block, for our performance models (#2443).
  • Maintenance and support (Treasury Funding Initiative 17: Maintenance and Support):
    • Released ouroboros-consensus 5.3.0.0 (#2470). It lowers memory use when the node writes ledger snapshots (#2467, #2468). The forging traces no longer count the mempool snapshot time as block forging time (#2471).
    • cardano-node no longer reports a false configuration difference for the default LSM database path (cardano-node#6742).

Consensus Team Update

· 5 min read
Damian Nadales
Consensus Team Lead

High level summary​

  • Leios implementation on main (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Merged the Praos2 protocol into main. Praos2 is Praos plus the Leios overlay. One definition, PolyPraos, now has all the Praos rules, and both Praos and Praos2 are variants of it. When a later Praos variant comes, it will extend PolyPraos instead of adding a new protocol next to it (#2386). A follow-up fixes the translation of the LedgerView from Conway to Dijkstra, a defect that #2386 kept from the old code (#2399).
    • An Endorser Block can no longer get its certificate in a later era or a later epoch than the block that announced it. The era rule avoids open design questions about a block that crosses an era boundary. The epoch rule keeps the interface between consensus and the ledger simpler (#2409).
    • Moved the LeiosNotify clients from the leios-prototype branch to main. A client disconnects from a peer that sends a message that an honest node would not send. A new test suite runs the real node against peers that can send any message (#2403).
    • Moved the LeiosFetch servers from the leios-prototype branch to main (#2416). The next step is the logic that decides which Endorser Blocks to fetch, and the clients that fetch them.
    • Fixed a defect in the LeiosDB garbage collection. If an exception stopped a collection pass, the rows that the pass marked for deletion stayed in the database. The next pass now finds and deletes them (#2401).
    • The Leios design document now has a detailed section on Endorser Block diffusion. It gives the plan that came out of the LeiosFetch design work, and how the node keeps its memory use bounded (ouroboros-leios#1005).
  • Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Merged a large change that makes Endorser Block diffusion in the prototype close to the production design (#2282). Some examples:
      • The node fetches an Endorser Block only when an election or a certificate justifies it, never because a peer offers it.
      • A peer can offer only an Endorser Block that it announced, and each part only once. If a peer breaks a rule, the node disconnects from it.
      • If an announcement gives the wrong size for an Endorser Block, the node does not relay that block and does not vote for it.
      • The node checks the certificate in a ranking block when the block arrives, before chain selection.
    • Before #2282, the prototype used the Leios header format in all eras. It now uses the Leios format from Dijkstra only, and the unchanged Praos format before. The testnet starts before Dijkstra, so we must restart its chain from genesis, and every node must update.
    • LeiosNotify has two new messages, MsgQuit and MsgCanceled, so the node can stop a session while it waits for a reply. Before, this was not possible. So when the peer governor moved a peer from hot to warm, the node closed the whole connection (#2344).
    • Backported the epoch rule from #2409 to the prototype (#2415).
  • Maintenance and support (Treasury Funding Initiative 17: Maintenance and Support):
    • Released ouroboros-consensus 5.1.0.1. The tool db-truncater has a new flag, --leios. Without the flag, the tool does not need the LeiosDB files and does not change them (#2393).
    • Tracing now shows the Dijkstra ledger predicate failures. Before, the log formatting for these failures called error, so a Dijkstra block that failed validation crashed the thread that wrote the trace (#2406, ported to main in #2407).
    • Added the local state query GetStakePoolState, which the ledger defines in cardano-ledger#6162 (#2412, for #2405).
    • Added golden tests for the ledger queries. They catch a change to the encoding of a query or its result, which would break client tools. Queries that the ledger already defines, such as NonMyopicMemberRewards, now come from the ledger (#2348).
    • A ledger snapshot now has one version number at the top level, instead of one number for each part. New tests check the golden snapshot files against the CDDL specification, which catches an encoding that does not match the specification. This change also fixes the Peras CDDL (#2395).
    • db-synthesizer now uses the forge function and the mempool of the node, instead of its own copy of the forging logic. One visible change: every slot leader now forges a block, so the synthesized chain can have forks (#2284).

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).