fix(ledger/conformance): pool deposits exact tracking + corpus v20260524 + DELEG decoder#644
Merged
Merged
Conversation
…te dump `epoch_state_debug::capture` was computing the pool-deposit component of `deposited` as `pool_params.len() × curPParams.pool_deposit`. This breaks when `pool_deposit` changes via PPUP after some pools are already registered: pools registered before the change paid the old deposit, so the approximation drifts from the actual locked amount. `certs.pool_deposits` already tracks the exact deposit paid at registration time for each pool (same map used by shelley.rs and conway.rs for obligation calc). Switch the dump to sum that map instead. Ref: issue #615 (deposits_stake divergence sub-item).
…ub check Mithril area now has 20 real fixture files at the pinned SHA, so the verification step's "mithril must be stub" assertion is no longer correct. Remove that check (it was based on an outdated observation). New corpus stats: ouroboros-consensus: 277 files cardano-ledger: 17 files cardano-node: 14 files plutus: 3001 files ledger-rules: 28295 files ← ImpSpec Haskell ledger-rules corpus cardano-base: 14 files mithril: 20 files ← now real (was stub)
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Sentry. |
The new ImpSpec corpus (conformance-corpus-v20260524-075059) includes DELEG vectors with: - tag 2: Shelley `StakeDelegation` (backwards-compat delegation in Conway) - tag 13: `ConwayRegDelegCert DelegStakeVote` (register + pool + DRep) The decoder previously only accepted tags 7–12. Extend to: tag == 2 || 7..=13 (matching the full Conway TxCert spec) Reference: cardano-ledger TxCert.hs ConwayTxCert encoding.
…use pool_deposits map
The test was inserting pools into pool_params but not pool_deposits, so
the new implementation (pool_deposits.values().sum()) returned 0 pool
deposits. Update the test to:
- populate pool_deposits with per-pool historical deposit amounts
- demonstrate the key property: dumps use historical values even when
pool_deposit has changed via PPUP (pool 0xaa at 400 ADA, pools 0x10/0x11
at 500 ADA, current param 600 ADA; expected total uses historical values)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix(ledger): per-pool deposit map in epoch-state dump
epoch_state_debug::capturewas computing pool deposits aspool_params.len() × curPParams.pool_deposit— an approximation that drifts whenpool_depositchanges via PPUP after some pools are already registeredcerts.pool_deposits.values().sum()(exact per-pool values at registration time)chore(conformance): update corpus to v20260524-075059 + fix mithril stub check
fix(conformance): expand DELEG decoder to accept tags 2 and 13
StakeDelegation, backwards-compat in Conway) and tag 13 (ConwayRegDelegCert DelegStakeVote— register + pool + DRep)tag == 2 || 7..=13cardano-ledgerConwayTxCertCBOR encoding tablechore: CLAUDE.md crate count 14→15
Test plan
cargo nextest run -p dugite-ledger— 1432/1432 passcargo clippy -p dugite-ledger --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleancargo build -p dugite-conformance— clean