Skip to main content

93 posts tagged with "ledger"

View All Tags

Ledger Team Update

· 4 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

Leios continued to be the main focus this cycle and moved well beyond prototype on several fronts. Dijkstra forecasting for Leios landed, the forecasting itself was simplified by keeping stake data only in snapshots, and DijkstraEraForecast was extended with the Peras protocol parameters. We defined Leios' EndorserBlock, added a ledger state query for the Leios committee, switched the Leios header KES signature verification to use MemoBytes, and fixed pool BLS key handling so the key's epoch number is only renewed when the key is actually new. These were backed by tests for the Leios committee and stake distribution when injecting genesis data, and by integration of the latest Leios changes for week 41.

PlutusV4 reached a milestone for the Dijkstra era: eraMaxLanguage is now set to PlutusV4, and AlonzoTxWits encodes and decodes PlutusV4 scripts starting with Dijkstra. Work on sub-transactions continued, with allInputsTxBodyF now looking into sub-transactions, top-level supplemental datums allowed for sub-transactions, and tests added for refunds in the consumed value across a batch. On the Dijkstra era more broadly, we fixed VRF reuse at the epoch boundary, started tracking the VRF key hashes of genesis stake pools, moved NonMyopicMemberRewards into the ledger, added missing getters to AnyEraTxBody, and renamed requiredTopLevelGuardsL while bringing in its outstanding tests.

On testing and releasing we added further Entities tests, treasury value and reference-script size tests, enabled bootstrap addresses in conformance, updated the formal ledger specification, and bumped the Plinth version in the Plutus preprocessor modules. Infrastructure changes included a cardano-data changelog fix for the pointWise to pointwise rename, a round of package version bumps across the changelogs following a CHaP release, and the usual dependency bump.

Low level summary​

Features​

  • PR-6124 - Make AlonzoTxWits decode and encode PlutusV4 scripts starting with Dijkstra
  • PR-6129 - Switch allInputsTxBodyF to look into sub-transactions
  • PR-6130 - Move NonMyopicMemberRewards to Ledger
  • PR-6140 - Add missing getters to AnyEraTxBody
  • PR-6120 - Use MemoBytes for Leios header KES signature verification
  • PR-6134 - Simplify forecasting by keeping stake data only in snapshots
  • PR-6137 - Allow TopTx SupplementalDatums for SubTx
  • PR-6148 - Add Dijkstra forecasting for Leios
  • PR-6092 - Fix VRF reuse at epoch boundary in Dijkstra
  • PR-6133 - Track the VRF key hashes of genesis stake pools in Dijkstra
  • PR-6136 - Rename requiredTopLevelGuardsL and add tests from #6020
  • PR-6126 - Extend DijkstraEraForecast with Peras protocol parameters
  • PR-6168 - Add ledger state query for Leios committee
  • PR-6170 - Renew pool BLS key epoch number only when the key is new
  • PR-6174 - Define Leios' EndorserBlock

Testing​

  • PR-6125 - Tests for refunds in the consumed value across a batch
  • PR-6109 - Set Dijkstra's eraMaxLanguage to PlutusV4, fix tests
  • PR-6141 - Bump Plinth version in plutus preprocessor modules
  • PR-6132 - Additional Entities tests
  • PR-6156 - TreasuryValue and RefScriptSize tests
  • PR-6167 - Add tests for verifying Leios committee and stake distribution when injecting genesis data
  • PR-6149 - Update formal ledger specification
  • PR-6182 - Enable boostrap addresses in conformance

Infrastructure and releasing​

  • PR-6131 - Fix cardano-data CHANGELOG with Data.CanonicalMaps.pointWise rename to pointwise
  • PR-6135 - Bump package version in all CHANGELOG.md files following release in CHaP
  • PR-6143 - Bump urllib3 from 2.7.0 to 2.8.0 in /doc
  • PR-6166 - Leios: integrate latest changes for 2026w41

Ledger Team Update

· 5 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

Most of this cycle went into Leios and the block header abstraction that supports it. The EraBlockHeader interface was reshaped into a separate type class per protocol that can be specified on a per-era basis, which required a dedicated BbodySignal type and a redefined BBODY rule for Babbage, where the TPraos to Praos switch happened. Related to this, the block header now uses a more lax VersionInfo in place of ProtVer for Dijkstra and no longer relies on a self-reported version when constructing headers. On Leios itself we now select the Leios committee at the epoch boundary, expire BLS keys after KES expiry, check the BLS proof of possession in Dijkstra's POOL rule, added a lens for the announcement block header reference on LeiosEraBlockHeader, and added Dijkstra forecasting for Leios on the prototype branch. We also began laying groundwork for Peras by adding its protocol parameters, while keeping Peras certificates out of the Dijkstra block body for now.

Work on the Plutus V4 context and sub-transactions continued, with the PlutusV4 context implemented for the GuardingPurpose and the sub-transaction index now available in the Plutus context. On the Dijkstra era itself we added a DijkstraEraTx type class with a hashTx function, fixed a superclass constraint in DijkstraEraPParams, added reference-input cost protocol parameters (ppRefInputsCostPerMultiAssetPolicyL and ppRefInputsCostPerDatumByteL) starting at Dijkstra, and fixed conservation of value for phase-2-invalid transactions. Elsewhere we introduced a distinct type for the pool distribution used for governance, fixed VRF reuse when re-registering a pool, and removed some unnecessary memory overhead in native scripts.

On the testing side we continued filling in predicate-failure coverage for the sub-rules and related rules (MEMPOOL, SUBGOV, SUBLEDGER), enabled tests in CertSpec, added a BBODY ImpSpec, added regression tests for conformance, LeiosCert serialization tests, and more withdrawal tests. For infrastructure and releasing we updated the Allegra changelog, bumped the CHaP index-state, and dropped cardano-crypto-leios as a source-repository-package from the cabal project.

Low level summary​

Features​

  • PR-6054 - Use a distinct type for the pool distribution used for governance
  • PR-6062 - Fix VRF reuse when re-registering pool
  • PR-6052 - Select the Leios committee at the epoch boundary
  • PR-6047 - Expire BLS keys after KES expiry
  • PR-6089 - Fix superclass constraint in DijkstraEraPParams
  • PR-6077 - Fix conservation of value for phase2- invalid transactions
  • PR-6099 - Add DijkstraEraTx typeclass with hashTx function
  • PR-6088 - BlockHeader cross era interface
  • PR-6084 - Use more lax VersionInfo in place of ProtVer in BlockHeader for Dijkstra
  • PR-6101 - Add ebReferencesAnnouncementBlockHeaderL to LeiosEraBlockHeader
  • PR-6067 - Add Peras protocol parameters
  • PR-6068 - PlutusV4 context for GuardingPurpose
  • PR-6117 - Do not use self-reported version when constructing block headers
  • PR-6064 - [Leios Prototype] Add Dijkstra forecasting for Leios
  • PR-6110 - Add ppRefInputsCostPerMultiAssetPolicyL and ppRefInputsCostPerDatumByteL protocol parameters starting at DijkstraEra
  • PR-6085 - Check BLS proof of possession in Dijkstra's POOL rule
  • PR-6121 - Sub Tx index in plutus context
  • PR-6122 - Remove unnecessary memory overhead in NativeScripts

Testing​

  • PR-6082 - Add regression tests for conformance
  • PR-6091 - Add LeiosCert serialization tests
  • PR-6095 - MEMPOOL predicate failures
  • PR-6083 - SUBGOV predicate failures
  • PR-6115 - Enable tests in CertSpec
  • PR-6116 - BBODY Impspec
  • PR-6111 - Additional withdrawal tests
  • PR-6112 - SUBLEDGER predicate-failure tests

Infrastructure and releasing​

  • PR-6087 - Update Allegra changelog
  • PR-6107 - Update CHaP index-state and remove cardano-crypto-leios as SRP from cabal project

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

Ledger Team Update

· 4 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

Leios support in the ledger took another step forward this cycle: pool parameters now carry an actual BlsKey, replacing the placeholder types introduced previously. On the testing side, block-header serialization - Praos and Leios alike - is now covered by a dedicated round-trip test suite, giving early guard-rails on the wire format as the Leios header evolves.

Work on nested transactions in Dijkstra advanced as well: the withdrawal mechanism for sub-transactions was implemented. Predicate failures around this area were reworked to be more useful and consistent, moved into the layer the specification prescribes and given clearer names. We settled how UTxO state updates should behave under nested transactions and the AdaPots obligations invariant guard-rail was adapted accordingly. A field for the initial account balance was also added to the top-level transaction body.

On the Plutus side, a per-block script cache was introduced so that scripts decoded once for a transaction can be reused by later transactions within the same block. A related optimization now memoizes the computation of the script hashes a transaction needs.

Two CIPs advanced this cycle. CIP-50 (pledge-leverage-based staking rewards) was implemented, and groundwork for CIP-23 began with the addition of the minPoolMargin protocol parameter to the Dijkstra era.

Test coverage was expanded: the Conway conformance suite was enabled in Dijkstra, and new tests were added around stake calculations and sub-transactions - as far as the current test framework allows.

Low level summary​

Features​

  • PR-5945 - Fix JSON roundtrip for InjectionData
  • PR-5946 - Make AlonzoTx mempool decoder backwards compatible
  • PR-5942 - Optimize plutus script preparation
  • PR-5953 - Reuse script cache for script validation
  • PR-5952 - Add startingAccountBalanceInterval to TopTx body
  • PR-5930 - Fix deposits in AdaPots calculations
  • PR-5941 - Fix updating of UTxOState
  • PR-5947 - Add canonical ledger state CDDL spec and validation tests
  • PR-5938 - Rename isValid to isPhase2Valid
  • PR-5967 - Move network checks of deposits and withdrawals to (SUB)ENTITIES
  • PR-5961 - Remove unnecessary setup of the DRepPulser
  • PR-5960 - Memoize getScriptsHashesNeeded in StanTx
  • PR-5969 - Withdrawals rework in SubEntities
  • PR-5943 - CIP-50 Pledge Leverage-Based Staking Rewards
  • PR-5891 - Add BlsKey in StakePoolParams
  • PR-5854 - Add ToJSON/FromJSON instances for EraTxWits
  • PR-5949 - CIP-23 - Add minPoolMargin protocol parameter to Dijkstra era
  • PR-5950 - Drop EncCBORGroup BlockBody in Dijkstra
  • PR-5909 - Stable type for querySetSnapshotStakePoolDistr

Testing​

  • PR-5939 - Enable Conway conformance tests in Dijkstra
  • PR-5959 - Test collateral inputs are in utxo
  • PR-5971 - Add Imp test to test that DReps unregistered and reregistered in the same tx lose vote delegated stake
  • PR-5948 - Add serialization tests for block headers
  • PR-5975 - Add stake calculation tests for conway

Infrastructure and releasing​

  • PR-5874 - Update cardano-binary to 1.9.1.0
  • PR-5968 - Restore <2.6 bound for cardano-crypto-class
  • PR-5970 - Bump cardano-data version for release
  • PR-5976 - Correct a bad changlog entry

Ledger Team Update

· 4 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

Leios support in the ledger continued to take shape this cycle. Building on the block body work from the previous updates, a Leios.BlockHeader was added along with an EraBlockHeader instance for Praos that consensus needs for its 11.1 integration, which together move the block header behind a common era-parametric abstraction. On the leios-prototype branch we also backported the addition of a LeiosKey (a BLS12381 public key together with a possession proof) to StakePoolParams and StakePoolState, with the Dijkstra CDDL updated to carry the Leios key as an optional field in the pool registration certificate.

A good deal of governance and rules work landed as well. Following the introduction of the ENTITIES rule in the previous cycle, we implemented CIP-181 by removing the DRep-delegation requirement for reward withdrawals, which dropped the corresponding predicate failures from the entities and sub-entities rules. On the Plutus cost model side we followed up on the earlier argument-ordering bug fix with a more permanent safeguard: a new CostModelsUpdate newtype now wraps the update argument so the old and new cost models can no longer be swapped by accident, and the symmetric Semigroup/Monoid instances for CostModels that made that mistake possible were removed. We also adjusted the consumed/produced interface and fixed getProducedValue for the Dijkstra era, added an AccountBalanceExact constructor to AccountBalanceInterval, and switched the minor protocol version to Word32. We also fixed NoThunks instances in the Alonzo and Conway genesis types.

Several changes continued the ongoing push toward more era-parametric, abstract interfaces. SnapShots was made era parametric, and ToJSON/FromJSON instances were added for EraTxAuxData, extending the JSON serialisation coverage started last cycle for scripts. On the Canonical Ledger State front, export and import modules were introduced for handling canonical state, giving a first pass at reading and writing it through the CLS interface. On the testing side the Conway conformance tests were updated to protocol version 11 and tests were added for the newly introduced top-level guard requirement.

On the tooling and infrastructure side, the hackage index-state was bumped to pick up the latest cuddle release, which now validates that CBOR maps contain no duplicate keys per RFC 8949 and required a couple of generators to be adjusted accordingly, and the usual GitHub Actions bumps were applied.

Low level summary​

Features​

  • PR-5905 - Introduce CostModelsUpdate
  • PR-5853 - Add ToJSON/FromJSON instances for EraTxAuxData
  • PR-5869 - Add export/import modules for canonical ledger state
  • PR-5915 - Add EraBlockHeader instance for Praos
  • PR-5918 - Fix getProducedValue for Dijkstra
  • PR-5916 - Remove DRep requirement for reward withdrawals
  • PR-5919 - Adjust consumed and produced interface
  • PR-5935 - Switch minor protocol version to Word32
  • PR-5940 - [Backport] Add LeiosKey to StakePoolParams in leios-prototype branch
  • PR-5927 - Add Leios.BlockHeader
  • PR-5933 - Add AccountBalanceExact constructor to AccountBalanceInterval
  • PR-5944 - Make SnapShots era parametric
  • PR-5926 - Fix/allow thunks in Alonzo/Conway geneses

Testing​

  • PR-5900 - Update Conway conformance tests to PV 11
  • PR-5914 - Add tests for RequiredTopLevelGuards

Infrastructure and releasing​

  • PR-5917 - Bump slackapi/slack-github-action from 3.0.3 to 3.0.4 in the actions group
  • PR-5928 - Update hackage index-state version to get latest cuddle release
  • PR-5934 - Bump slackapi/slack-github-action from 3.0.4 to 4.0.0 in the actions group