fix(tests): correct mip4 transition test for subsequent forks#30
Open
pdobacz wants to merge 1 commit into
Open
fix(tests): correct mip4 transition test for subsequent forks#30pdobacz wants to merge 1 commit into
pdobacz wants to merge 1 commit into
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
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.
Derive pre-transition precompile availability from transitions_from() so MONAD_NINEToMONAD_NEXT passes.
Greptile Summary
This PR fixes the
test_fork_transitiontest so it also passes for subsequent-fork parametrisations (e.g.MONAD_NINEToMONAD_NEXT). The fix introduces aprecompile_beforeflag derived fromfork.transitions_from().precompiles()and uses it to set the correct pre-transition expected storage value instead of the previously hard-coded0.precompile_beforecomputation usingfork.transitions_from().precompiles()— correct for both the initial MONAD_NINE transition (returnsFalse) and subsequent-fork transitions where the precompile already exists (returnsTrue).callee_addressstorage at slot14_999from the hard-coded0to1 if precompile_before else 0, and cleans up a now-stale inline comment at the same line.Confidence Score: 5/5
Safe to merge — targeted fix to a single test file with no impact on production code.
The
precompile_beforederivation viafork.transitions_from().precompiles()is consistent with how the framework exposes transition fork metadata, and correctly handles both the initial MONAD_NINE transition and subsequent-fork runs. No logic errors were found.No files require special attention; the docstring in the single changed file is mildly stale but does not affect correctness.
Important Files Changed
precompile_beforeflag derived fromfork.transitions_from().precompiles()to correctly parameterise the pre-fork expected storage value; logic is correct for both MONAD_NINE and subsequent-fork transitions. Docstring still only describes the MONAD_NINE scenario.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[test_fork_transition runs] --> B{precompile in transitions_from precompiles?} B -- Yes - MONAD_NINEToMONAD_NEXT --> C[precompile_before = True] B -- No - First transition to MONAD_NINE --> D[precompile_before = False] C --> E[Block 14999 - callee slot = 1] D --> F[Block 14999 - callee slot = 0] E --> G[Block 15000 fork transition - callee slot = 1] F --> G G --> H[Block 15001 - callee slot = 1] H --> I[Assert post state]%%{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"}}}%% flowchart TD A[test_fork_transition runs] --> B{precompile in transitions_from precompiles?} B -- Yes - MONAD_NINEToMONAD_NEXT --> C[precompile_before = True] B -- No - First transition to MONAD_NINE --> D[precompile_before = False] C --> E[Block 14999 - callee slot = 1] D --> F[Block 14999 - callee slot = 0] E --> G[Block 15000 fork transition - callee slot = 1] F --> G G --> H[Block 15001 - callee slot = 1] H --> I[Assert post state]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 (2): Last reviewed commit: "fix(tests): correct mip4 transition test..." | Re-trigger Greptile