Skip to content

fix(ledger/conformance): pool deposits exact tracking + corpus v20260524 + DELEG decoder#644

Merged
michaeljfazio merged 6 commits into
mainfrom
fix/pool-deposits-exact-tracking
May 24, 2026
Merged

fix(ledger/conformance): pool deposits exact tracking + corpus v20260524 + DELEG decoder#644
michaeljfazio merged 6 commits into
mainfrom
fix/pool-deposits-exact-tracking

Conversation

@michaeljfazio
Copy link
Copy Markdown
Owner

@michaeljfazio michaeljfazio commented May 24, 2026

Summary

fix(ledger): per-pool deposit map in epoch-state dump

chore(conformance): update corpus to v20260524-075059 + fix mithril stub check

  • Mithril now has 20 real fixture files (was stub); the verification check was outdated, removed
  • New corpus: 277 ouroboros-consensus, 17 cardano-ledger, 14 cardano-node, 3001 plutus, 28,295 ledger-rules (ImpSpec Haskell), 14 cardano-base, 20 mithril

fix(conformance): expand DELEG decoder to accept tags 2 and 13

  • The new ImpSpec corpus includes DELEG vectors with tag 2 (Shelley StakeDelegation, backwards-compat in Conway) and tag 13 (ConwayRegDelegCert DelegStakeVote — register + pool + DRep)
  • Decoder previously only accepted 7–12; updated to accept tag == 2 || 7..=13
  • Reference: cardano-ledger ConwayTxCert CBOR encoding table

chore: CLAUDE.md crate count 14→15

  • Added dugite-uplc and dugite-lsm to the architecture section

Test plan

  • cargo nextest run -p dugite-ledger — 1432/1432 pass
  • cargo clippy -p dugite-ledger --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • cargo build -p dugite-conformance — clean
  • CI: build-and-test + upstream conformance (UPLC + golden decode)

…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)
@michaeljfazio michaeljfazio changed the title fix(ledger): use per-pool deposit map for deposits_stake in epoch-state dump fix(ledger): use per-pool deposit map for deposits_stake in epoch-state dump; chore: update corpus v20260524 May 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.40%. Comparing base (9b3e2da) to head (f26efe2).
✅ All tests successful. No failed tests found.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.
@michaeljfazio michaeljfazio changed the title fix(ledger): use per-pool deposit map for deposits_stake in epoch-state dump; chore: update corpus v20260524 fix(ledger/conformance): pool deposits exact tracking + corpus v20260524 + DELEG decoder May 24, 2026
…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)
@michaeljfazio michaeljfazio merged commit 3643abc into main May 24, 2026
10 checks passed
@michaeljfazio michaeljfazio deleted the fix/pool-deposits-exact-tracking branch May 24, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant