Arbos 60: Increase Stylus contract size limit#890
Open
wurdum wants to merge 6 commits into
Open
Conversation
52334bf to
43a71cb
Compare
13 tasks
43a71cb to
225f4e8
Compare
Merged
13 tasks
225f4e8 to
9a37c3c
Compare
Make InstructionSelfDestruct public to be reused in Arbitrum (#11605)
9a37c3c to
deb7467
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Implements ArbOS 60 support to increase Stylus contract size limits by introducing fragmented Stylus programs (root + fragment contracts), updating activation/gas-charging logic, and exposing new owner/public precompile methods for configuring fragment limits.
Changes:
- Add ArbOS 60 Stylus fragmentation: new bytecode prefixes (classic/root/fragment), root parsing, fragment reassembly, and fragment-read gas charging.
- Add precompile methods to set/get
MaxStylusContractFragments, plus migrateStylusParamslayout/state for v60 (incl. increasedMaxWasmSize). - Add a Stylus SELFDESTRUCT guard (revert when executed by a Stylus contract) and route deployable Stylus prefixes into the Stylus runtime.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nethermind.Arbitrum/Stylus/WasmStoreRebuilder.cs | Updates rebuild filtering to recognize deployable Stylus prefixes by ArbOS version. |
| src/Nethermind.Arbitrum/Precompiles/Parser/ArbOwnerPublicParser.cs | Adds getMaxStylusContractFragments precompile parsing/dispatch gated at ArbOS 60. |
| src/Nethermind.Arbitrum/Precompiles/Parser/ArbOwnerParser.cs | Adds setMaxStylusContractFragments precompile parsing/dispatch gated at ArbOS 60. |
| src/Nethermind.Arbitrum/Precompiles/ArbitrumPrecompileExecutionContext.cs | Replaces DestroyList with AccessTracker for activation/selfdestruct-related tracking. |
| src/Nethermind.Arbitrum/Precompiles/ArbWasm.cs | Updates activation call signature to pass ReleaseSpec and AccessTracker. |
| src/Nethermind.Arbitrum/Precompiles/ArbOwnerPublic.cs | Exposes MaxFragmentCount getter via ArbOwnerPublic. |
| src/Nethermind.Arbitrum/Precompiles/ArbOwner.cs | Adds setter for MaxFragmentCount in Stylus params. |
| src/Nethermind.Arbitrum/Evm/ArbitrumVirtualMachine.cs | Routes deployable Stylus prefixes to WASM runtime and overrides SELFDESTRUCT opcode handler. |
| src/Nethermind.Arbitrum/Evm/ArbitrumEvmInstructions.SelfDestruct.cs | Implements Stylus SELFDESTRUCT revert guard while preserving EIP-6780 semantics otherwise. |
| src/Nethermind.Arbitrum/Config/IArbitrumConfig.cs | Adds Stylus namespace import for config integration. |
| src/Nethermind.Arbitrum/Config/ArbitrumConfig.cs | Adds Stylus namespace import for config integration. |
| src/Nethermind.Arbitrum/Arbos/StylusOperationResultType.cs | Extends result types for fragmented activation and decompression/root validation failures. |
| src/Nethermind.Arbitrum/Arbos/Storage/ArbosStorage.cs | Exposes underlying world state via WorldState property for program rebuild path. |
| src/Nethermind.Arbitrum/Arbos/Programs/StylusRoot.cs | Adds root contract parsing (dict byte, declared decompressed length, fragment address list). |
| src/Nethermind.Arbitrum/Arbos/Programs/StylusPrograms.cs | Adds fragmented activation flow, fragment-read gas charging, dictionary resolution, and updated activation signature. |
| src/Nethermind.Arbitrum/Arbos/Programs/StylusParams.cs | Adds MaxFragmentCount, bumps default max wasm size at ArbOS 60, and adds v60 migration/serialization. |
| src/Nethermind.Arbitrum/Arbos/Programs/StylusCode.cs | Adds versioned discriminants (classic/root/fragment) and helpers to build/recognize prefixes. |
| src/Nethermind.Arbitrum/Arbos/Burner.cs | Adds BurnOut() and a default Burn(in MultiGas) implementation for fragment-read charging. |
| src/Nethermind.Arbitrum/Arbos/ArbosVersion.cs | Adds Sixty constant and StylusContractLimit milestone alias. |
| src/Nethermind.Arbitrum/Arbos/ArbosState.cs | Adds ArbOS 60 upgrade case and reserves 52–59 for Orbit chains. |
| src/Nethermind.Arbitrum.Test/Stylus/StylusSelfDestructTests.cs | Adds integration tests ensuring Stylus SELFDESTRUCT reverts while non-Stylus transfers balance. |
| src/Nethermind.Arbitrum.Test/Precompiles/Parser/ArbOwnerParserTests.cs | Adds parser test for setMaxStylusContractFragments at ArbOS 60. |
| src/Nethermind.Arbitrum.Test/Precompiles/ArbWasmTests.cs | Ensures AccessTracker is present in precompile activation tests. |
| src/Nethermind.Arbitrum.Test/Precompiles/ArbOwnerTests.cs | Adds setter visibility/dispatch/boundary tests for MaxStylusContractFragments. |
| src/Nethermind.Arbitrum.Test/Precompiles/ArbOwnerPublicTests.cs | Adds getter visibility/dispatch test for getMaxStylusContractFragments. |
| src/Nethermind.Arbitrum.Test/Infrastructure/TestArbosStorage.cs | Extends test burner with BurnOut() used by fragment affordability pre-flight. |
| src/Nethermind.Arbitrum.Test/Infrastructure/PrecompileTestContextBuilder.cs | Mirrors production precompile path by always providing a StackAccessTracker in test contexts. |
| src/Nethermind.Arbitrum.Test/Infrastructure/ArbitrumRpcTestBlockchain.cs | Adds HasCode helper to support SELFDESTRUCT guard assertions. |
| src/Nethermind.Arbitrum.Test/Arbos/Stylus/Infrastructure/DeployTestsContract.cs | Adds helpers to deploy fragmented Stylus programs and custom roots for tests. |
| src/Nethermind.Arbitrum.Test/Arbos/Programs/StylusProgramsTests.cs | Updates activation calls to provide ReleaseSpec and StackAccessTracker. |
| src/Nethermind.Arbitrum.Test/Arbos/Programs/StylusProgramsFragmentTests.cs | Adds comprehensive fragmented activation/gas/dictionary ordering tests. |
| src/Nethermind.Arbitrum.Test/Arbos/Programs/StylusParamsTests.cs | Adds serialization/migration tests for MaxFragmentCount and v60 MaxWasmSize. |
| src/Nethermind.Arbitrum.Test/Arbos/Programs/StylusCodeTests.cs | Adds unit tests for classic/root/fragment prefix detection and root parsing. |
| src/Nethermind | Bumps Nethermind subproject commit (likely needed for SELFDESTRUCT/EIP flag or multi-gas plumbing). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #878