Skip to main content

Ledger Team Update

· 6 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

This update spans four weeks, so it covers a larger than usual body of work. The headline item is that Dijkstra's batch validation now executes Plutus scripts from sub-transactions and accounts for their execution budgets. Previously it skipped Plutus execution for sub-transactions, so spending validators and minting policies inside a sub-transaction were not enforced and their ExUnits were left out of transaction and block limits and of script fees; that gap is now closed, and sub-transaction budgets count toward limits and fees. Alongside this, withdrawals handling in the ENTITIES rule was reworked to implement the full set of responsibilities from the specification, covering the network and existence checks, the legacy-mode full-drain and per-account sub-aggregate cap, and the non-legacy pre-batch existence check and batch-wide aggregate cap over the top transaction together with all of its sub-transactions. This moved the batch withdrawal checks out of UTXO and into ENTITIES, and was accompanied by conservation of value in legacy mode and by SUBUTXO/SUBUTXOW predicate failures.

A second major thread was the Plutus V4 context: we implemented the TxInfo translation for protocol version 4, redid the PlutusPurpose translation, made further TxInfo improvements, fixed the Dijkstra cost model injection, and bumped plutus-ledger-api to at least 1.68.

Progress continued on the Dijkstra era rules and on Leios. A POOL rule was added for Dijkstra, an EMax /= 0 well-formedness check was introduced, the stake calculation was made consistent by moving SNAP to the end of the EPOCH, and account balance intervals are now enforced. On the Leios side, the Leios protocol parameters were added to the Dijkstra era and the leios_certificate signer set is now size-constrained. We also removed the hardforkConwayMoveWithdrawalsAndDRepChecksToLedgerRule transition flag and the WithdrawalsNotInRewardsCERTS failure, finishing the migration of those withdrawal and DRep checks into the ledger rule.

The rest of the work spanned serialisation, more abstract interfaces, conformance, and releasing. On serialisation we adjusted transaction serialisation in the block body, made the OutputVRF decoder more resilient, removed a guard from the IndividualPoolStake codecs, and improved the custom PParamUpdate encoding. The move toward era-parametric interfaces continued with an era parameter on StakePoolParams, forcing of the Shelley initial-funds injection result, and ToJSON/FromJSON instances for EraTxOut and for TxBody/Tx across all eras. On testing we landed two formal-ledger-specification updates (one enabling the corresponding tests), conformance for the Dijkstra EPOCH rule and for starting account balance intervals, the Shelley Pool Imp tests in Dijkstra conformance, an era-generic Conway CERTS test, and a fix for a produced vs. consumed conformance failure. Finally, we updated to crypton == 1.1 (replacing memory with ram), hardened the branch-history CI job, and landed two rounds of backports of fixes for node 11.1.1.

Low level summary​

Features​

  • PR-5983 - Implement TxInfo translation for PV4
  • PR-6017 - shelley: force the initial-funds injection result
  • PR-6031 - Add EMax /= 0 as well formed check to Dijkstra era
  • PR-6012 - Conservation of value in legacy mode
  • PR-5888 - Constrain the size of leios_certificate signers
  • PR-6033 - Make OutputVRF decoder more resilient
  • PR-5986 - Make stake calculation consistent in dijkstra by moving SNAP to the end of the EPOCH
  • PR-5985 - Adjust transaction serialization in BlockBody
  • PR-6001 - Enforce (starting_)account_balance_intervals
  • PR-6002 - Add Leios protocol parameters to DijkstraEra
  • PR-6041 - Remove hardforkConwayMoveWithdrawalsAndDRepChecksToLedgerRule and WithdrawalsNotInRewardsCERTS
  • PR-6040 - Add era parameter to StakePoolParams
  • PR-6046 - Bump plutus-ledger-api to >=1.68
  • PR-5855 - Add ToJSON/FromJSON instances for EraTxOut
  • PR-6038 - Redo PlutusPurpose translation
  • PR-6030 - Fix CostModels injection for Dijkstra
  • PR-6051 - TxInfo improvements
  • PR-6029 - Add POOL rule for Dijkstra
  • PR-5997 - Withdrawals rework in ENTITIES
  • PR-6071 - Execute Plutus scripts from sub-transactions and count their ExUnits
  • PR-6070 - Improve versatility of custom PParamUpdate encoding
  • PR-6042 - Remove guard from IndividualPoolStake codecs
  • PR-6076 - Add ToJSON/FromJSON instances for TxBody l and Tx l in all eras

Testing​

  • PR-6019 - Improve tests in UtxoSpec
  • PR-6022 - Update formal-ledger-specification
  • PR-5995 - Update formal-ledger-specification and enable tests
  • PR-6024 - Enable Shelley Imp tests for Pool in conformance (Dijkstra)
  • PR-5842 - Add a submitFailingSubsetTx helper
  • PR-6009 - Make Conway CERTS test era-generic
  • PR-6056 - Conformance for EPOCH rule in Dijkstra
  • PR-6044 - Conformance for starting account balance intervals
  • PR-6034 - SUBUTXOW predicate failures
  • PR-6055 - SUBUTXO predicate failures
  • PR-6074 - Fix conformance failure in produced vs. consumed

Infrastructure and releasing​

  • PR-6014 - Make the branch-history CI job more robust
  • PR-5999 - Update to crypton == 1.1 and replace memory package with ram
  • PR-6025 - Backport of fixes for node 11.1.1
  • PR-6028 - Backport of fixes for node 11.1.1 - take 2
  • PR-6032 - Add changelog for cardano-ledger-shelley-1.19.0.1 backport