Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions integration_test/gov_module/gov_proposal_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
# 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)'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 $H on seid q bank total and seid q mint minter, with H from a preceding seid status), which makes the equality exact by construction; or
  • Mirror what mint_test.yaml now does and bracket it: read MINTED_BEFORE before the before-supply query and keep MINTED_AFTER after 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.

env: MINTED_BEFORE
# Make a new expedited proposal
- cmd: seidbin=seid; chainid=sei; source integration_test/utils/_tx_helpers.sh && submit_gov_proposal admin "Gov Param Change Expedited" gov submit-proposal param-change ./integration_test/gov_module/proposal/expedited_proposal.json --fees 2000usei
env: PROPOSAL_ID
Expand All @@ -135,15 +137,12 @@
# the expedited proposal auto-converts to regular; drive progress until it reaches a terminal status
- cmd: seidbin=seid; chainid=sei; source integration_test/utils/_tx_helpers.sh && wait_for_proposal_status $PROPOSAL_ID PROPOSAL_STATUS_REJECTED admin
env: PROPOSAL_STATUS
# Get the tally params again after proposal is passed
- cmd: seid q gov params --output json | jq -r .tally_params.expedited_quorum
env: NEW_PARAM
# Get the current tally params
- cmd: seid q bank total --denom usei --output json | jq -r .amount
env: TOTAL_SUPPLY_AFTER_BURN
- cmd: seid q mint minter --output json | jq -r '(.total_mint_amount|tonumber) - (.remaining_mint_amount|tonumber)'
env: MINTED_AFTER
verifiers:
# Check if the total supply is reduced or not to verify token burns
- type: eval
expr: TOTAL_SUPPLY_BEFORE_BURN == 5000000000333333333333
# The rejected proposal burns both deposits (10000000usei initial + 10000000usei top-up);
# a daily mint landing during the proposal is netted out
- type: eval
expr: TOTAL_SUPPLY_AFTER_BURN == 5000000000333313333333
expr: TOTAL_SUPPLY_BEFORE_BURN + MINTED_AFTER - MINTED_BEFORE - TOTAL_SUPPLY_AFTER_BURN == 20000000
24 changes: 14 additions & 10 deletions integration_test/mint_module/mint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,30 @@
env: LAST_MINT_AMOUNT
- cmd: seid q mint minter --output --json | jq ".last_mint_date" -r
env: LAST_MINT_DATE
- cmd: seid q mint minter --output --json | jq ".last_mint_height" -r
env: LAST_MINT_HEIGHT
# Compare the total supply and make sure that it increased
- cmd: seid q bank total --output json | jq -r -M ".supply[] | select(.denom==\"usei\").amount"
env: TOTAL_SUPPLY
# Re-read after the supply query so a mint landing between the two reads is accounted for
- cmd: seid q mint minter --output json | jq -r .remaining_mint_amount
env: REMAINING_AFTER_SUPPLY
# Number of daily mints so far (one at genesis, plus one per UTC midnight the cluster has lived through)
- cmd: echo $(( (TOTAL_MINT_AMOUNT - REMAINING_MINT_AMOUNT) / LAST_MINT_AMOUNT ))
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
env: MINTS_SO_FAR
verifiers:
- type: eval
expr: DENOM == "usei"
# Start date should be equal to last mint date since there's only one mint on the first day
# The schedule spans three days starting today; every mint so far lands inside it
- type: eval
expr: START_DATE == LAST_MINT_DATE and END_DATE > START_DATE
# Total Mint Amount = Remaining Mint Amount + Last Mint Amount
expr: LAST_MINT_DATE >= START_DATE and END_DATE > LAST_MINT_DATE
- type: eval
expr: TOTAL_MINT_AMOUNT == 999999999999
- type: eval
expr: REMAINING_MINT_AMOUNT == 666666666666
# 999999999999 over three days releases exactly 333333333333 each day
- type: eval
expr: LAST_MINT_AMOUNT == 333333333333
- type: eval
expr: LAST_MINT_HEIGHT == 0
# Total supply should have gone up by LAST_MINT_AMOUNT
expr: MINTS_SO_FAR >= 1 and MINTS_SO_FAR <= 3
- type: eval
expr: MINTS_SO_FAR * LAST_MINT_AMOUNT + REMAINING_MINT_AMOUNT == TOTAL_MINT_AMOUNT
# Genesis supply (5e21 usei) plus everything the schedule has minted so far
- type: eval
expr: TOTAL_SUPPLY == 5000000000333333333333
expr: TOTAL_SUPPLY >= 5000000000000000000000 + TOTAL_MINT_AMOUNT - REMAINING_MINT_AMOUNT and TOTAL_SUPPLY <= 5000000000000000000000 + TOTAL_MINT_AMOUNT - REMAINING_AFTER_SUPPLY
Loading