Skip to main content

96 posts tagged with "ledger"

View All Tags

Ledger Team Update

· 4 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

We continued with Leios work this cycle, with most of the work going into the endorser block and the block header. The endorser block rule gained its real validations, moving it past the placeholder check it started out with. The Leios header hash was corrected so that it covers only the header body and the KES signature. Forecasting was extended with the maximum transaction size, which Leios is the first protocol to have a reason to forecast, and the block header coders were brought back.

CIP-172, self-usable transaction outputs, was implemented, reaching across the Babbage, Conway and Dijkstra eras.

Two protocol-level safety fixes landed. Governance updates that would set the maximum pledge leverage below one are now rejected, since such a value can produce negative pool rewards and abort reward application entirely. Separately, a change to the VRF duplicate counter that had accidentally altered Conway behavior while fixing Dijkstra was reverted, the two code paths having turned out not to be equivalent.

Sub-transaction support was rounded out on the API side. The helper reporting the outputs a transaction produces now includes sub-transaction outputs, where a batch creating three UTxOs previously reported only the top-level one. The timelock upgrade function was also fixed and renamed.

Testing was dominated by Plutus V4 and by conformance. The V4 transaction info translation, which had been merged without unit tests, received a thorough set covering each translated field. The Plutus script decoder is now checked to agree with the Plutus deserializer across every language, PLC version, protocol version and builtin. A transaction-level guard script exercises batch validation, including the phase-2-invalid cases. The formal ledger specification was updated three times over the cycle, each time enabling further tests, and the maximum pool stake calculation is now property-tested against the specification.

Tooling gained a custom git diff driver for CBOR files, wired up automatically through the development shell, so binary CBOR now shows up as readable text in diffs.

Low level summary​

Features​

  • PR-6268 - EB rule validations
  • PR-6287 - Hash only header body and signature
  • PR-6285 - DijkstraForecast: include maxTxSize
  • PR-6282 - Bring back coders for the block header
  • PR-6252 - CIP-172: Self-Usable Transaction Outputs
  • PR-6277 - Reject maximum pledge leverage updates below one
  • PR-6300 - Revert previous behavior of VRF duplicates counter initialization
  • PR-6280 - Include Dijkstra subtransaction outputs in producedTxOuts
  • PR-6296 - Fix upgradeTimelock and rename it

Testing​

  • PR-6254 - Add unit tests for the PlutusV4 TxInfo translation in Dijkstra
  • PR-6286 - Test that decodePlutusRunnable uses the correct Plutus ledger language
  • PR-6294 - Add inputSpendingGuard PlutusV4 tx-level validation guard test
  • PR-6291 - Test maxPool in conformance
  • PR-6279 - Make modifyPParams affect future pparams
  • PR-6281 - Update formal-ledger-specification and enable tests
  • PR-6293 - Update formal-ledger-specifications and enable tests
  • PR-6306 - Update formal ledger specification and enable tests
  • PR-6299 - Convert Alonzo golden CBOR file from hex to binary

Infrastructure and releasing​

  • PR-6288 - Auto-setup a custom git diff driver for CBOR files

Ledger Team Update

· 4 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

We continued to focus on Leios this cycle, with the endorser block moving from a data definition to something the ledger can actually validate and apply. The EB and EBLEDGERS rules were implemented, a Leios certificate validation API was exposed from the ledger API, and endorser block application arrived through applyEndorserBlock. Endorser block references were made era-parametric, so they are no longer pinned to a single era. On the pool side, updates that only touch BLS keys no longer require owner witnesses, closing a gap that would have forced unnecessary signatures on key rotation.

Dijkstra gained a distinct mempool transaction representation, separating what the mempool carries from the transaction type used elsewhere. Plutus V4 scripts are now evaluated against the actual V4 API rather than borrowing the previous version's. The state-annotated transaction now also carries reference script size and execution units, so the rules no longer recompute them on every use.

The reference input cost parameter for multi-assets was renamed and retyped, moving from a per-policy to a per-byte cost. Per-policy pricing could not be made fair, since a single policy may carry arbitrarily many asset names, whereas the binary overhead of a multi-asset is straightforward to compute directly.

Testing concentrated on conformance and on the new endorser block machinery. Conformance now tracks which tests are expected to fail, so a disabled test that starts passing is no longer silently ignored, and the tests that already passed were re-enabled. A property test for top-level transaction info was added, comparing the aggregated result against a reference implementation built field by field across the nested transactions of a batch.

Low level summary​

Features​

  • PR-6216 - Leios certificate validation API
  • PR-6215 - Add EB and EBLEDGERS
  • PR-6248 - Add DijkstraApplyBlock with applyEndorserBlock
  • PR-6241 - Make EbReferences era parametric
  • PR-6217 - Do not require owners to witness updates for BLS keys
  • PR-6257 - Introduce BlockEnv for ApplyBlock
  • PR-6260 - Follow-up to #6257: export mkDijkstraBlockEnv, remove mkBbodyEnv
  • PR-6222 - Add MempoolTx
  • PR-6235 - Remove certsTx from SubCertsEnv
  • PR-6255 - Use Plutus v4 API for Plutus v4
  • PR-6244 - Enhanced memoization in StAnnTx
  • PR-6263 - Rename ppRefInputsCostPerMultiAssetByte
  • PR-6251 - Expose PParams from Conway and Dijkstra API

Testing​

  • PR-6237 - Add TopTxInfo property test which compares to reference implementations
  • PR-5984 - Check that disabled tests fail in conformance
  • PR-6240 - Ensure EbSpec test doesn't fail spuriously because of too small txout
  • PR-6256 - Update formal ledger specification

Infrastructure and releasing​

  • PR-6253 - Bump up changelogs and versions after a release
  • PR-6258 - Add Changelog for 11.1 and 11.2

Ledger Team Update

· 5 min read
Alexey Kuleshevich
Ledger Team Software Engineer

High level summary​

Leios remained the main focus and moved further toward its concrete block and certificate structure. We added the LEIOSCERT rule together with the Leios-certificate-related BBODY failures, defined the EbReferences CDDL and an Annotator decoder for it, and started tracking the last tick slot number in the new epoch state and the last endorser block announcement in the ledger state. We also prevented duplicate BLS keys from being used, improved how Leios committee seats are rendered (hex keys and decimal weights), integrated the week 42 ledger changes on the prototype branch, and backed the work with Leios certificate golden tests and better example parameters.

A significant milestone was the Dijkstra era gaining its economic machinery: we implemented the minFee calculation for Dijkstra, adopted the CIP-23 effective cost and margin in the rewards calculations, and fixed the block body size computation. There was also a cluster of serialisation and decoder fixes, covering the PlutusData decoder, redeemers for protocol version 12, NonEmpty set and map decoders, and the IPv4 encoding order (now network order rather than swapped), with property tests added for Plutus data conversion.

Work on sub-transactions continued, with min-ada validation switched to a non-static check and submitTx in the ImpTests now randomly exercising top-level and sub-level transactions, alongside new Imp tests for SUBDELEG, SUBPOOL and SUBGOVCERT. On the rules side we added LEDGER rule limits and stopped inverting predicate failures in the small-steps framework, and we simplified transaction hashing by removing hashTx and the DijkstraEraTx type class in favour of the existing HashAnnotated. We also added a queryStakePoolState ledger state query.

On the testing and releasing side we enabled ExUnits tests and fixed the bootstrap witness in conformance, made the Plutus tests run with arbitrary Plutus versions, added tests for transValidityInterval and for the ValidityInterval/VotingProcedures semigroup and monoid instances, tested voting stake computation for pools with zero delegations, updated the formal ledger specification, and filled in a few missing predicate-check ImpTests. Infrastructure changes were limited to a cleret bump to 0.5.2.1 and a dependency update.

Low level summary​

Features​

  • PR-6162 - Add queryStakePoolState
  • PR-6188 - Switch sub-transaction min-ada validation to be a non-static check
  • PR-6189 - Fix decoder for PlutusData
  • PR-6187 - Fix IPv4 encoding order to use network order instead of swapped
  • PR-6193 - Leios prototype: Integrate ledger changes for w42
  • PR-6165 - Prevent duplicate BlsKey from being used
  • PR-6195 - Remove hashTx and DijkstraEraTx in favor of HashAnnotated
  • PR-6184 - Add last tick slot number to NES and last EB announcement to LS
  • PR-6202 - Add Leios certificate related BBODY failures
  • PR-6210 - EbReferences CDDL
  • PR-6190 - Implement minFee calculation for Dijkstra
  • PR-6197 - Use CIP-23 effective cost and margin in rewards calculations
  • PR-6208 - Stop inverting predicate failures in small-steps
  • PR-6201 - Render Leios committee seats as hex keys and decimal weights
  • PR-6219 - Add an Annotator decoder for EbReferences
  • PR-6224 - Fix redeemers for PV12
  • PR-6225 - Fix block body size computation in Dijkstra
  • PR-6209 - Add LEIOSCERT
  • PR-6221 - LEDGER rule limits
  • PR-6230 - Some decoder fixes for NonEmpty Sets and Maps

Testing​

  • PR-6160 - Make submitTx randomly submit top-level and sub-level transactions in ImpTests
  • PR-6192 - Fix bootstrap witness in conformance
  • PR-6169 - Make plutus tests run with arbitrary Plutus versions
  • PR-6163 - Tests for Semigroup and Monoid instances for ValidityInterval and VotingProcedures
  • PR-6200 - Enable exunits tests in conformance
  • PR-6183 - Add tests for transValidityInterval
  • PR-6011 - Add leios cert golden tests
  • PR-6194 - Set better Leios example parameters
  • PR-6103 - Test voting stake computation for pools with zero delegations
  • PR-6218 - Add property tests for Plutus Data conversion
  • PR-6223 - Fix generator for script hash integrity tests
  • PR-6059 - Add Imp tests for SUBDELEG, SUBPOOL and SUBGOVCERT
  • PR-6228 - Update formal ledger specification
  • PR-6232 - Add missing ImpTests for some predicate checks

Infrastructure and releasing​

  • PR-6220 - Bump certifi from 2025.1.31 to 2026.10.19 in /doc
  • PR-6231 - Update cleret to 0.5.2.1

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