Skip to main content

Ledger Team Update

· 4 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary

The most visible result of the past two weeks is that the Plutus context performance arc has reached its first real payoff. Two cycles ago we memoized the Plutus related parts of transaction validation, last cycle we threaded the state-annotated transaction StAnnTx through the LEDGER, UTXOW, UTXO and MEMPOOL rules across every era, and this cycle the rules actually start consuming the precomputed information stored in StAnnTx instead of recomputing it. In parallel we kicked off a sizeable effort to remove the legacy Coders machinery from the codebase: several call sites have been switched off Coders, a new SparseKeyed alternative has been introduced, and decodeSparseKeyed was extended to cover additional types. This is part of a broader cleanup that is expected to continue for several more cycles.

On the Dijkstra era CDDL front the work begun with the new block_body definition continued: we introduced a dedicated transaction_mempool rule so that the transaction decoder used in the mempool can be distinguished from the one used inside the block body, tightened the chain_code specification to 32 bytes, and landed a thorough pass of fixes to the Dijkstra CddlSpec so that all of the CDDL tests pass. We also pushed forward the second installment of conformance testing preparation for Dijkstra, this time adding an era type parameter to SpecTranslate and SpecTransM, instantiating it for the Conway modules, and updating the formal-ledger-specifications dependency accordingly.

The namespace work for the canonical ledger state initiative also continued, with a new entities/accounts/v0 namespace and a refactor of gov/proposals/v0 that preserves the proposals order, which is required to reconstruct ledger state faithfully.

On the benchmarking and tooling side we added two new criterion microbenchmarks for the TICK and NEWEPOCH rules, which we expect to be a tremendously useful tool for analysing epoch transition performance. Vector-map benchmarks were also fixed and we switched some hot paths to unsafe vector indexing where bounds checking is redundant. A new generate-cbor CLI tool was added, which makes it possible to generate CBOR for any rule in any era from the command line and should be useful both for our own debugging and for downstream consumers, such as serialization libraries and alternative node implementotions. The test reorganization started last cycle continued with the CddlSpec hierarchy being inverted to give cleaner test output and the predicate failure CBOR roundtrip tests being folded into the per-era ImpSpec set, which also brought in missing tests for the BBODY, MEMPOOL and Dijkstra-specific rules. Finally on the infrastructure side, the doctesting setup that was temporarily disabled in the last cycle has been properly refactored to use cabal repl --with-repl=doctest instead of cabal-doctest, and the index-state was bumped to pull in cardano-base 0.1.4.

Low level summary

Features

  • PR-5807 - Stop using Coders in some places
  • PR-5815 - Switch to unsafe vector indexing
  • PR-5804 - Use precomputed data from state-annotated transactions
  • PR-5834 - Coder's SparseKeyed alternative
  • PR-5843 - Add transaction_mempool
  • PR-5846 - Update Dijkstra chain_code
  • PR-5738 - Refactor gov/proposals/v0 namespace to include the proposals order
  • PR-5699 - Add entities/accounts/v0 namespace
  • PR-5847 - decodeSparseKeyed for more types

Testing

  • PR-5810 - Add examplePParams[Update] to EraTest for goldens.
  • PR-5814 - Add TICK and NEWEPOCH benchmarks
  • PR-5841 - Invert CddlSpec hierarchy
  • PR-5830 - Prepare conformance for Dijkstra 2
  • PR-5851 - Organize predicate failure CBOR roundtrip tests
  • PR-5779 - Fix various issues in Dijkstra CddlSpec to make all the tests pass

Infrastructure and releasing

Mithril Team Update

· 3 min read
Jean-Philippe Raynaud
Mithril Tech Lead

High level overview

This week, the Mithril team completed the analysis of the impact of the recursive SNARK on the security of the Mithril protocol, implemented benchmarks for the non-recursive SNARK, and refactored the error handling of the SNARK recursive circuit. They continued work on circuit key caching for the SNARK circuit in the STM library, the removal of the helpers module for the SNARK recursive circuit, the prover input for the recursive SNARK aggregation primitives, and the implementation of the SNARK-friendly genesis certificate.

They also enhanced the synchronization of immutable files in the Cardano database, implemented robust support for unknown and in-progress signed entity types, removed the Cardano database v1 backend, and continued working on the prototype for Cardano node ledger state certification. Additionally, they enforced the DMQ message ID format and enhanced the support of the genesis verification key in the explorer.

Finally, the team completed the update of the protocol security page on the website and continued work on shipping the Mithril signer node binary in the Cardano node bundle.

Low level overview

Features

  • Completed the issue Refactor SNARK recursive circuit - Error handling #3127
  • Completed the issue Impact of recursive SNARK on Mithril protocol security #3133
  • Completed the issue Implement benchmarks for non recursive SNARK #3154
  • Completed the issue Enhance synchronization of immutable files of Cardano database #3243
  • Completed the issue Add non-recursive certificate circuit benchmarks #3274
  • Worked on the issue Circuit keys caching for SNARK circuit in STM #3043
  • Worked on the issue Refactor SNARK recursive circuit - Remove helpers module #3132
  • Worked on the issue Recursive SNARK aggregation primitives: Prepare prover input #3138
  • Worked on the issue Implement SNARK-friendly genesis certificate #3145
  • Worked on the issue Prototype Cardano node ledger state certification #3269
  • Worked on the issue Enhance support of genesis verification key in explorer #3270

Protocol maintenance

  • Completed the issue Enhance protocol security page on website #2703
  • Completed the issue Robust support for unknown and in progress signed entity types #3172
  • Completed the issue Remove Cardano database v1 backend #3268
  • Worked on the issue Ship Mithril signer node binary in Cardano node bundle in GitHub #3011
  • Worked on the issue Enforcement of DMQ message id format #3251

Mithril Team Update

· 3 min read
Jean-Philippe Raynaud
Mithril Tech Lead

High level overview

This week, the Mithril team completed the refactoring of the recursive circuit, the preparation of the prover input implementation in the STM library, the off-circuit verification tests for the recursive SNARK circuit prototype, and the replacement of the temporary certificate circuit with the STM circuit. They also continued work on circuit key caching for the SNARK circuit in the STM library, the recursive SNARK aggregation primitives prover input, the preparation of the SNARK-friendly genesis certificate implementation, and the non-recursive certificate circuit benchmarks.

The team continued work on shipping the Mithril signer node binary in the Cardano node bundle, robust support for unknown and in-progress signed entity types, enforcement of the DMQ message ID format, and enhancements to immutable file synchronization for the Cardano database.

Finally, the team completed enforcement of Mithril crate versions in downstream Mithril crates and enhanced the protocol security page on the website.

Low level overview

Features

  • Completed the issue Prepare the refactoring of the recursive circuit #3126
  • Completed the issue Prepare implementation of the prover input in STM #3137
  • Completed the issue Add off-circuit verification tests for recursive SNARK circuit prototype #3193
  • Completed the issue Replace temporary certificate circuit with STM circuit #3195
  • Worked on the issue Circuit keys caching for SNARK circuit in STM #3043
  • Worked on the issue Recursive SNARK aggregation primitives: Prepare prover input #3138
  • Worked on the issue Implement SNARK-friendly genesis certificate #3145
  • Worked on the issue Prepare SNARK-friendly genesis certificate implementation #3262
  • Worked on the issue Add non-recursive certificate circuit benchmarks #3274

Protocol maintenance

  • Completed the issue Enforce Mithril crates versions in downstream Mithril crates #3245
  • Worked on the issue Ship Mithril signer node binary in Cardano node bundle in GitHub #3011
  • Worked on the issue Enhance synchronization of immutable files of Cardano database #3243
  • Worked on the issue Enforcement of DMQ message id format #3251
  • Worked on the issue Enhance protocol security page on website #2703
  • Worked on the issue Robust support for unknown and in progress signed entity types #3172

Consensus Team Update

· 2 min read
Damian Nadales
Consensus Team Lead

High level summary

  • Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation):
    • Landed the first voting capability in the Leios prototype: nodes now diffuse votes over a dedicated mini-protocol and a voting thread casts votes on completed endorser-block closures. This is the foundation for committee-based endorsement and is exercised by new threadnet property tests (#1963).
    • Ongoing: reworking the prototype branch ("Leios prototype remake") to target the same ouroboros-consensus-3.0.1.0 release that ships in cardano-node 11.0.1, so downstream consumers building against that node release can pick up Leios without a separate consensus branch (#2041).
    • Ongoing: adding late-join support, so a node that joins the network after an endorser block was produced can still resolve the resulting certified blocks (#2040).
    • Ongoing: replacing the placeholder voting from #1963 with stake-based committee selection and real BLS signatures, so votes are individually validated before being relayed (#2039).
    • Ongoing: performance work on the in-memory Leios database to remove contention and laziness issues that were causing nodes to time out under load (#2032).
  • LedgerDB cleanup (Treasury Funding Initiative 10: LSM including UTXO-HD):
    • Retired the V1 LedgerDB implementation and the LMDB backing store. V2 has been the default for some time; removing V1 deletes a large amount of now-unreachable code, drops the LMDB dependency, and simplifies the LedgerDB API (for example, snapshots no longer block the caller, and the tryFlush no-op is gone) (#2030). This paves the way for adding more tables to the ledger state, enabling them to be stored on disk.

Hydra Team Update

· 2 min read
Noon van der Silk
Software Engineering Lead

High-level Summary

This week the team shipped hydra-node 2.1.0 - a significant release that brings improved deposit security, the new SQLite-backed event store, a ~7% reduction in snapshot confirmation latency, and compatibility with cardano-node protocol version 12+. We encourage all operators to upgrade. Alongside the release, work continues on two long-standing items: partial fanout and a user-friendly configuration file for hydra-node to replace the current sprawl of command-line flags.

What did the team achieve?

  • Released hydra-node 2.1.0, which includes improved deposit security, the SQLite-backed event store, a ~7% reduction in snapshot confirmation latency, and compatibility with cardano-node protocol version 12+ release 2.1.0
  • Upgraded to cardano-api 11.1 / cardano-node 11.0.1 to support protocol version 12+ #2607
  • Switched from a lazy to a strict Map to reduce memory pressure during transaction processing #2599

What's next?

  • Continue work on partial fanout — choosing the UTxO set to fan out and final code review #2593, #2324, #2573
  • Reduce disk usage in hydra-node #2601, #2600
  • Investigate a node observing/persisting deposit events from unrelated Heads #2606
  • User-friendly hydra-node configuration via config file #2581
  • Accept PaymentExtendedKey (HD wallet keys) #2583