Assert usei supply as deltas in mint and gov integration tests - #4134
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
PR SummaryLow Risk Overview Mint suite ( Gov burn case ( Reviewed by Cursor Bugbot for commit 602c49f. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4134 +/- ##
==========================================
- Coverage 61.25% 60.25% -1.00%
==========================================
Files 2195 2078 -117
Lines 192497 179013 -13484
==========================================
- Hits 117908 107867 -10041
+ Misses 63098 60811 -2287
+ Partials 11491 10335 -1156
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Both assertions are correctly rewritten as deltas and evaluate as intended in the Go yaml runner's left-to-right big.Int arithmetic (cmpExpr/evalArith in integration_test/runner/runner.go), and the 20000000 gov figure matches the two 10000000usei deposits (proposal JSON + explicit deposit tx). The change is a strict improvement; the only notes are a residual (much smaller) timing window and the mint suite's unchanged sibling assertions, which still break the stated midnight goal.
Findings: 0 blocking | 3 non-blocking | 0 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- [suggestion] Both new expressions still assume no mint lands between the two queries they compare. In
mint_test.yamlthe minter is read (lines 12-15) beforeTOTAL_SUPPLY(line 23), and ingov_proposal_test.yamlthe burn delta spans the whole proposal case; a mint at the UTC date change inside that window makesTOTAL_SUPPLYexceedgenesis + total - remaining, or the burn delta read as20000000 - minted. The window shrinks from unbounded to seconds/minutes, so this is far better than before — worth a follow-up (e.g. re-read the minter after the supply query and tolerate the difference) rather than a change here. - 2 non-blocking pre-existing issue(s) listed below under pre-existing issues.
Pre-existing issues
- [suggestion]
integration_test/mint_module/mint_test.yaml:30-39(unchanged by this PR) still pins single-mint state:START_DATE == LAST_MINT_DATE,REMAINING_MINT_AMOUNT == 666666666666,LAST_MINT_AMOUNT == 333333333333,LAST_MINT_HEIGHT == 0. After a second daily mintRecordSuccessfulMintsets remaining to 333333333333 andLAST_MINT_DATEpastSTART_DATE, so the suite still fails on a cluster that lives across midnight even though the new supply formula holds — the PR's stated midnight goal is only partially reached for this file. - [suggestion]
integration_test/gov_module/gov_proposal_test.yaml:139-140capturesNEW_PARAM(expedited_quorum after the rejected proposal) but no verifier in that case consumes it; the query is dead weight.
|
@seidroid review |
There was a problem hiding this comment.
Both suites are correctly converted from absolute supply figures to schedule-derived/delta assertions: the new expressions parse and evaluate as intended under the Go runner's tokenize-substitute-then-left-to-right big.Int arithmetic, the 20000000 gov delta matches the two 10000000usei deposits, and the mint math checks out against getReleaseAmountToday (999999999999 over a 3-day schedule releases exactly 333333333333 on each of days 0-2). Two residual timing/assumption windows remain, both strictly narrower than the behaviour they replace.
Findings: 0 blocking | 2 non-blocking | 2 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- None at the file/PR level.
- 2 suggestion(s)/nit(s) flagged inline on specific lines.
|
@seidroid review |
There was a problem hiding this comment.
Both suites are correctly converted from absolute supply figures to schedule-derived and delta assertions; the expressions parse and evaluate as intended under the Go runner's big.Int arithmetic, the 3-day schedule math checks out against getReleaseAmountToday, and the 20000000 gov delta matches the two deposits. One residual single-query mint window remains in the gov assertion, where the mint suite got an airtight bracket.
Findings: 0 blocking | 1 non-blocking | 1 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- None at the file/PR level.
- 1 suggestion(s)/nit(s) flagged inline on specific lines.
| # Get the current tally params | ||
| - cmd: seid q bank total --denom usei --output json | jq -r .amount | ||
| env: TOTAL_SUPPLY_BEFORE_BURN | ||
| - cmd: seid q mint minter --output json | jq -r '(.total_mint_amount|tonumber) - (.remaining_mint_amount|tonumber)' |
There was a problem hiding this comment.
[suggestion] Each minter read happens after its paired supply read, so the two snapshots can straddle a mint. If a mint lands between line 122 and this line, MINTED_BEFORE includes it but TOTAL_SUPPLY_BEFORE_BURN doesn't, and MINTED_AFTER - MINTED_BEFORE undercounts the window's minting by 333333333333 — the expression evaluates to burn - 333333333333. A mint between lines 140 and 142 skews it the other way, to burn + 333333333333.
This is far narrower than the whole-lifecycle window the previous revision had (it's now the gap between two adjacent docker exec queries), so it's a note rather than a blocker. Two ways to close it:
- Pin both reads of each snapshot to the same height (
--height $Honseid q bank totalandseid q mint minter, withHfrom a precedingseid status), which makes the equality exact by construction; or - Mirror what
mint_test.yamlnow does and bracket it: readMINTED_BEFOREbefore the before-supply query and keepMINTED_AFTERafter the after-supply query, which makes the expression provably>= 20000000, then add a second pair for the upper bound.
The first is cheaper and keeps the single exact assertion.
mint_test.yamlandgov_proposal_test.yamlasserted the absoluteuseitotal supply (5000000000333333333333, genesis plus exactly one scheduled mint), and the mint suite also pinned single-mint minter state (REMAINING == 666666666666,START_DATE == LAST_MINT_DATE,LAST_MINT_HEIGHT == 0). The localnet genesis carries a 3-day release schedule andx/mintmints again on the first block after a UTC date change, so any cluster that lives across midnight failed both suites, and packing suites into shared rows (#4133) widens that window since the assertions can now run several minutes after boot.The mint suite now derives
MINTS_SO_FAR = (total - remaining) / last_mintand checks the minter state and total supply against that (1..3mints, each333333333333, remaining and supply consistent with the count, last mint date inside the schedule), so it holds on any day of the schedule. The gov burn case checksbefore - after == 20000000(the two 10M deposits) instead of two absolute values, and the unusedNEW_PARAMquery in that case is dropped. Both sets of expressions were checked against the yaml runner's left-to-right big-int arithmetic for the one-mint and two-mint cases.Spun out of the review on #4133.