IntersectMBO / IntersectMBO/cardano-ledger

`getRatifyEnv` does not account for proposal deposits

Open
#6,069 0 comments 0 reactions 0 assignees View on GitHub
:detective: testing bug
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 7h
Merged PRs (30d)
29

Description

The helper testing function `getRatifyEnv` does not take into consideration voting stake that in the RATIFY rule is included from the proposals deposits.

Originally reported by Copilot:
> `getRatifyEnv` now derives `reVotingStakePoolDistr` from `nesPdL` via `toVotingStakePoolDistr`. Since `PoolDistr` no longer includes proposal deposits, this `RatifyEnv` can undercount stake-pool voting stake in tests that create proposals with deposits. Consider deriving the voting pool distribution from the `DRepPulsingState`/`PulsingSnapshot` (or otherwise adding proposal deposits) to match ledger behavior.

_Originally posted by @lehins in [#6054](https://github.com/IntersectMBO/cardano-ledger/pull/6054/changes#r3982596577)_

Contributor guide

Open the contributing guide

Research direction

Start at the getRatifyEnv helper and trace how nesPdL is passed to toVotingStakePoolDistr. Read the DRepPulsingState and PulsingSnapshot handling to compare the helper with ledger behavior. Done means proposal deposits are represented in the stake-pool voting distribution, with tests covering proposals that include deposits.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
blockchain, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.