fix(tests): correct mip4 transition and MIP-11 shim#30
Merged
Conversation
Derive pre-transition precompile availability from transitions_from() so MONAD_NINEToMONAD_NEXT passes. Co-Authored-By: Claude <claude-opus-4-8>
3bd80c2 to
4d6f537
Compare
MIP-11 shim so post-state roots match a full MIP-11 client when no proposer/validators are wired up. Co-Authored-By: Claude <claude-opus-4-8>
test_credit_with_transaction_fee credits fee_recipient; MIP-11 burns priority fees, so reward is zero for fork >= MONAD_NEXT. Co-Authored-By: Claude <claude-opus-4-8>
Collaborator
Author
|
@greptileai re-review |
mijovic
approved these changes
Jul 1, 2026
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.
Closes ENG-1131
Derive pre-transition precompile availability from transitions_from() so MONAD_NINEToMONAD_NEXT passes.
Greptile Summary
This PR fixes the MIP-4 fork-transition test so it passes for subsequent forks (e.g.
MONAD_NINEToMONAD_NEXT) by derivingprecompile_beforefromfork.transitions_from().precompiles()instead of hard-coding0. It also wires in a MIP-11 shim that burns priority fees in themonad_nextexecution layer and adjusts the corresponding coinbase-reward assertion in the reserve-balance transfer test.test_fork_transition.py: Computesprecompile_beforeat collection time viafork.transitions_from().precompiles(), making the14_999storage slot assertion correct for bothMONAD_EIGHTToMONAD_NINE(0) andMONAD_NINEToMONAD_NEXT(1).Address.__eq__ignores thelabelkwarg and compares raw bytes, so theinmembership check is sound.fork.py/test_transfers.py: Introduces a MIP-11 shim that stops crediting priority fees to the coinbase (they are effectively burned); the transfer test's expectedrewardis updated to0forfork >= MONAD_NEXT, which resolves correctly for transition forks viaTransitionBaseMetaClass.__ge__.Confidence Score: 5/5
Safe to merge — all three changes are narrowly scoped to test correctness and a well-documented execution-layer shim.
The core fix (deriving precompile availability from
transitions_from().precompiles()) is logically correct and consistent with how address equality is implemented in the base types. The MIP-11 priority-fee burn is intentional and clearly documented, and the companion test adjustment matches the new behaviour. No functional regressions were identified.No files require special attention.
Important Files Changed
precompile_beforeflag derived fromfork.transitions_from().precompiles()to correctly handle subsequent-fork case (MONAD_NINEToMONAD_NEXT) where the reserve balance precompile is already live before the fork under test. Logic and address-equality semantics are sound.rewardcalculation to 0 for MONAD_NEXT and later (MIP-11 burns priority fees instead of crediting coinbase). Thefork >= MONAD_NEXTcomparison correctly resolves throughTransitionBaseMetaClass.__ge__for transition forks.create_ethercall for priority fees (MIP-11 shim: burns priority fees rather than crediting coinbase) and comments out now-unusedpriority_fee_per_gas/transaction_feevariables with a TODO to revisit after MIP-11 lands.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Test as test_fork_transition participant Fork as TransitionFork participant Pre as transitions_from() participant Post as transitions_to() Test->>Fork: fork.transitions_from() Fork-->>Pre: e.g. MONAD_EIGHT or MONAD_NINE Test->>Pre: .precompiles() Pre-->>Test: list of Address objects Test->>Test: "precompile_before = Address(0x1001) in list" Note over Test: Block ts=14999 (pre-fork) Test->>Pre: CALL 0x1001 Pre-->>Test: "RETURNDATASIZE == 32 if precompile_before else 0" Note over Test: Block ts=15000 (fork block) Test->>Post: CALL 0x1001 Post-->>Test: "RETURNDATASIZE == 32" Note over Test: Block ts=15001 (post-fork) Test->>Post: CALL 0x1001 Post-->>Test: "RETURNDATASIZE == 32"%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Test as test_fork_transition participant Fork as TransitionFork participant Pre as transitions_from() participant Post as transitions_to() Test->>Fork: fork.transitions_from() Fork-->>Pre: e.g. MONAD_EIGHT or MONAD_NINE Test->>Pre: .precompiles() Pre-->>Test: list of Address objects Test->>Test: "precompile_before = Address(0x1001) in list" Note over Test: Block ts=14999 (pre-fork) Test->>Pre: CALL 0x1001 Pre-->>Test: "RETURNDATASIZE == 32 if precompile_before else 0" Note over Test: Block ts=15000 (fork block) Test->>Post: CALL 0x1001 Post-->>Test: "RETURNDATASIZE == 32" Note over Test: Block ts=15001 (post-fork) Test->>Post: CALL 0x1001 Post-->>Test: "RETURNDATASIZE == 32"Comments Outside Diff (2)
tests/monad_nine/mip4_checkreservebalance/test_fork_transition.py, line 32-37 (link)subsequent_forks=TrueThe docstring still reads "Before the fork, the precompile doesn't exist, so CALL returns empty output". When this test runs for a subsequent transition (e.g.
MONAD_NINEToMONAD_NEXT),precompile_beforeisTrueand the precompile is already live before the tested fork, so the "before" block gets a 32-byte return, not empty output. The docstring should describe both variants (or at least note the conditional behaviour introduced bysubsequent_forks=True).Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
tests/monad_nine/mip4_checkreservebalance/test_fork_transition.py, line 110 (link)precompile_before=TruecaseWhen
precompile_beforeisTrue(e.g.MONAD_NINEToMONAD_NEXT), the outer CALL tocallee_addressstill succeeds (result1), but the precompile is not "returning empty" — it returns 32 bytes. The comment is misleading for the subsequent-fork scenario.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (5): Last reviewed commit: "fix(tests): zero priority fee reward at ..." | Re-trigger Greptile