cannon: Make state version available to MIPS contracts.#15425
Closed
cannon: Make state version available to MIPS contracts.#15425
Conversation
All JSON files are unsupported.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #15425 +/- ##
===========================================
- Coverage 46.48% 46.39% -0.10%
===========================================
Files 1250 1250
Lines 103813 103845 +32
===========================================
- Hits 48262 48180 -82
- Misses 52159 52287 +128
+ Partials 3392 3378 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
Author
|
Closing in favour of #15487 |
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.
Description
Updates MIPS2.sol and MIPS64.sol to pass the state version through to the contract constructor. This can then be used as a feature toggle like in the go version to enable new opcodes or sys calls only when a new state version is used.
The MIPS deployment is still a singleton that can be shared across the superchain, this just allows maintaining support for multiple versions in
developbranch and thus not blocking contract releases while new features are in development.The existing
mipsVersionused with op-deployer and OPCM is reused here, so version 1 continues to mean the single threadedMIPS.soland 2 meansMIPS64.solas before. Going forward when a new state version is added (e.g. for go 1.23 support), MIPS64.sol should be deployed with the actual state version specified. Defaults in op-deployer can be updated when the new version becomes the standard version so this option should only need to be specified as part of testing.Implementing the new sys call would be done with a feature toggle. We currently have a bunch of ifs like:
optimism/packages/contracts-bedrock/src/cannon/MIPS2.sol
Lines 570 to 571 in f5b73fc
and this would just add another one:
Tests
Updated tests.