Skip to main content

· 2 min read
Jean-Philippe Raynaud

High level overview

This week, the Mithril team continued implementing new succinct proofs. The team completed the lottery target value computation for SNARK, updated the protocol parameters to SNARK-friendly values, prepared the SNARK circuit refactoring, and removed the off-circuit module from the Halo2 circuit. They also continued working on SNARK pre-aggregation primitives and on signer authentication for SNARK, on the full review of the recursive circuit prototype, and on the technical report for the recursive Halo2 circuit.

Additionally, the team continued work on the new certification for Cardano blocks and transactions, implementing the transaction membership prover and proof routes in the aggregator REST API. They also started preparing the release of the 2608 distribution.

Finally, they fixed a bug related to a breaking change of the snapshot converter in Cardano node v.10.6.2 and fixed flaky unit tests in the SNARK circuit.

Low level overview

Features

  • Completed the issue Compute Lottery Target Value for SNARK #2974
  • Completed the issue Update protocol parameters to SNARK friendly values - Phase 2 #2969
  • Completed the issue Prepare refactoring of SNARK circuit #2990
  • Completed the issue Remove off-circuit module in Halo2 circuit #2945
  • Worked on the issue Implement SNARK pre-aggregation primitives in STM library - Phase 2 #2943
  • Worked on the issue Full review of recursive SNARK circuit prototype #2982
  • Worked on the issue Prepare technical report for recursive Halo2 circuit #2981
  • Worked on the issue Support for authenticated signer registration for SNARK #2915
  • Worked on the issue Calibrate precision and Taylor expansion iterations for Lottery Target value computation #3034
  • Worked on the issue Implement proof route for Cardano Blocks and Transactions in aggregator REST API #2988
  • Worked on the issue Release 2608 distribution #2967

Protocol maintenance

  • Completed the issue Fix snapshot-converter breaking change in 10.6.2 #3010
  • Completed the issue Certification stopped in testing-preview network #3015
  • Completed the issue Aggregator in testing-preview panics at startup #3023
  • Completed the issue Cardano blocks and transaction import fails on dev-mainnet #3028
  • Completed the issue Client CLI proposes to restore a Legacy UTxO-HD snapshot above 10.6.2 #3029
  • Worked on the issue Upgrade to Cardano 10.6 #2790
  • Worked on the issue Some unit tests are flaky with future_snark feature #3017
  • Worked on the issue Enhance protocol security page on website #2703

· 5 min read
Michael Karg

High level summary

  • Benchmarking: Release benchmarks for 10.5.4 and 10.6.2; Parallel GC benchmarks.
  • Development: Preparation of new PlutusV3 baseline.
  • Infrastructure: Performance cluster gets custom, isolated Nix cache - safe benchmarks for security-critical changes.
  • Tracing: Improving robustness by forcing lazy values in controlled sections of code.
  • Leios: LTL Trace Verifier completed, waiting integration.
  • Node Diversity: Formal trace schema definition entering validation phase; Trace forwarding in native Rust entering testing.

Low level overview

Benchmarking

We've performed, analysed and published relase benchmarks for both Node versions 10.5.4 and 10.6.2. We could determine both to be free of performance regressions. The 10.6.2 release contains the new 'Defensive Mempool' feature, which is therefore also covered by our benchmark. The 10.6.2 release has shown to be somewhat more efficient in its use of CPU time, but exhibited a slightly higher tendency to perform Major GC cycles.

To that end, we've reopened an old PR which changes the default / recommended GC settings for the Node process to a parallel, load-balanced GC (cardano-node PR#6222). The motivation is to update the current recommended settings (which are still tuned to GHC8.10) such that the ocurrence of Major GC cycles is greatly reduced (as they may temporarily halt the Node process to complete). We found in our benchmark that, apart from being even slightly more efficient regarding CPU time, the occurrence of Major GCs could be reduced by almost factor 30.

Development

We're performing an overhaul of the plutus-scripts-bench package, a library of benchmarkable Plutus scripts targeting various aspects of the Plutus interpreter, the respective cost model and the execution budgets. The aim is to create up-to-date performance baselines by using exclusively PlutusV3 scripts that have been built with a recent version of the compiler - thus factoring in potential performance improvements in generated code. Currently, the PR cardano-node PR#6440 is work in progress.

Infrastructure

Up to now, a benchmarking deployment required the target commit to be a public item on GitHub; the nix build (or cache retrieval from our CI) would be decentralized, with each cluster instance creating the benchmarking artifact independently. When there's a requirement to benchmark security-critical changes in an isolated, opaque fashion, this approach would reach its limits promptly. Together with SRE, we devised a way to achieve just that: An artifact can be built from a local commit on one cluster instance into its nix store, which in turn will serve as a substituter (i.e. cache) in a centralized manner for all other instances (cardano-node PR#6450).

Tracing

The new tracing system highly encourages trace values to be lazy. Thus, the emitting thread has the lowest possible overhead when doing so - which is highly relevant when you're on a hot code path. Furthermore, this overhead is assumed to be a constant factor - regardless of whether those traces are consumed by any subscriber or not. We're currently exploring an approach to increase robustness, guarding against shaky implementations of trace values themselves. The burden of evaluating a lazy trace still remains with a subscriber, however, this is now decoupled from handing over the trace result (such as a log line, a metric, etc.). By forcing a lazy trace value in a controlled section of code, immediately prior to handover, the system will reliably handle even blatant implementation errors in lazy traces.

Leios

The Linear Temporal Logic (LTL) Trace Verifier Cardano Trace LTL has reached production readiness. It is able to ingest multiple streams of trace evidence, basically multiple Node log files as they're being produced, and continuously evaluate a set of LTL propositions against them. While performant, real-time evaluation is a valuable thing to have, it required some of the LTL operators to be bounded to be able to operate in constant space over a long time. We've discussed our fragment of LTL with Formal Methods to start building a collection of properties worth checking, and to ensure there's provably no disjoint semantics introduced by the bounded operators.

The service is currently being integrated with the existing tooling in the cardano-node project, and will form a regular part of Leios setups / deployments in the future.

Node Diversity

We've reached basic viability of the comprehensive formal schema definition of all the Node's existing trace messages. We're building an automated verification suite that will ensure all definitions are fully compliant with existing JSON schema, as well as the observables implemented in (and the trace messages logged by) the Haskell Node conform to the defined schema. Further manual refinement of types in the schema will be the next step; eventually, this will serve as a basis to automatically derive parsers, and to render a human-readable reference documentation.

The implementation of our trace / metrics forwarding mini-protocol in Rust has completed and is now in testing phase. After cleanup and merge, this allows Rust projects to emit Cardano-style structured traces directly, and forward them to a running cardano-tracer for logging, processing and metrics exposition.

· 2 min read
Jean-Philippe Raynaud

High level overview

This week, the Mithril team focused on implementing new succinct proofs. The team worked on pre-aggregation SNARK primitives in the STM library, completed bridging between CPU and circuit implementations, and worked on lottery target pre-computation. They also continued to adapt the certificate chain for SNARK-friendliness and to implement signer authentication for SNARK verification keys.

Additionally, the team continued work on the new certification for Cardano blocks and transactions. This included implementing the prover, along with the proof routes in the aggregator REST API, and the diffusion of signing configuration.

Finally, they continued working on static builds for Mithril nodes, fixed some CI bugs, and implemented support for Cardano node v.10.6.2.

Low level overview

Features

  • Completed the issue Implement SNARK pre-aggregation primitives in STM library - Phase 1 #2792
  • Completed the issue Hash to curve CPU/circuit discrepancy for message signature in Schnorr signature #2993
  • Completed the issue Implement signable builder for Cardano Blocks and Transactions #2908
  • Completed the issue Implement signing configuration for Cardano Blocks and Transactions #2971
  • Worked on the issue Compute Lottery Target Value for SNARK #2974
  • Worked on the issue Implement SNARK pre-aggregation primitives in STM library - Phase 2 #2943
  • Worked on the issue Remove off-circuit module in Halo2 circuit #2945
  • Worked on the issue Prepare refactoring of SNARK circuit #2990
  • Worked on the issue Full review of recursive SNARK circuit prototype #2982
  • Worked on the issue Adapt certificate chain to support SNARK AVK #2811
  • Worked on the issue Support for authenticated signer registration for SNARK #2915
  • Worked on the issue Implement proof route for Cardano Blocks and Transactions in aggregator REST API #2988
  • Worked on the issue Implement new prover for Cardano Blocks and Transactions #2987
  • Worked on the issue Implement static build of Mithril nodes in CI #2989
  • Worked on the issue Integrate Mithril into the Cardano developer documentation website #3012

Protocol maintenance

  • Worked on the issue Upgrade to Cardano 10.6 #2790
  • Worked on the issue Fix snapshot-converter breaking change in 10.6.2 #3010
  • Worked on the issue Fix crates and npm packages publications GitHub workflows #2970
  • Worked on the issue Enhance protocol security page on website #2703

· 2 min read
Marcin Szamotulski

Overview of sprint 107.

Cardano Node 10.5.4

We rolled out cardano-node-10.5.4 release.

Leios

PR / IssueStatus
Mux Leios Simulationmerged
Mux egress prioritisationin progress
Mux egress fairnessresolved

Ouroboros-Network

PR / IssueStatusNotes
StandardHash with NFData constraintmerged
Tracing Librariesmerged
[tx-submission robustness and testing enhancements][pr#5315]in review
RNG handling in SRV lookups for public root peersin reviewcontribution by Saviour Uzoukwu
cardano ping implemented with ouroboros-networkblocked

Documentation

Maintenance

DMQ-Node

PR / IssueStatus
SigSubmission v2in review
Integration with cardano-tracerin progress
[Set the correct magic field][pr#30]merged
[Churn test][#5303]in review

· One min read
Damian Nadales

High level summary

  • Continued work on Node 10.7 integration (Treasury Funding Initiative 17: Maintenance and Support):
    • Integrated network packages up to ouroboros-network-0.22.6 (#1819, #1865).
    • Integrated latest ledger changes (#1762).
    • Integrated kes-agent-1.1 (#1819) (Treasury Funding Initiative 9: KES Agent).
  • Node improvements (Treasury Funding Initiative 17: Maintenance and Support):
    • Enhanced observability by exposing the reason for chain switches in the ChainSel tracer (#1826).
    • Added support for the new GetDRepDelegations ledger state query in NodeToClientV_23 (#1794).
    • Fixed an exception due to a mix-up of resources in the V2 LedgerDB (#1842).
    • Minor: code cleanup (#1854).
    • Added documentation for the Consensus-Ledger interaction (#1830).
  • Continued Leios prototype development (Treasury Funding Initiative 4: Ouroboros Leios Implementation, MS4.6):
    • Refactored to use EbHash instead of EbId for cleaner design (#1859).
    • Simplified to monomorphic types for more rapid iteration (#1846).
    • Implemented in-memory LeiosDb for ThreadNet tests (#1837).