Skip to content

Arbos 60: Increase Stylus contract size limit#890

Open
wurdum wants to merge 6 commits into
mainfrom
feat/arbos60-increase-stylus-contract-size
Open

Arbos 60: Increase Stylus contract size limit#890
wurdum wants to merge 6 commits into
mainfrom
feat/arbos60-increase-stylus-contract-size

Conversation

@wurdum
Copy link
Copy Markdown
Collaborator

@wurdum wurdum commented May 13, 2026

Closes #878

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 81.41264% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.46%. Comparing base (d86ce87) to head (d2ca31a).

Files with missing lines Patch % Lines
...thermind.Arbitrum/Arbos/Programs/StylusPrograms.cs 76.34% 13 Missing and 9 partials ⚠️
...bitrum/Evm/ArbitrumEvmInstructions.SelfDestruct.cs 70.73% 5 Missing and 7 partials ⚠️
...rbitrum/Precompiles/Parser/ArbOwnerPublicParser.cs 33.33% 6 Missing ⚠️
...Nethermind.Arbitrum/Arbos/Programs/StylusParams.cs 89.74% 2 Missing and 2 partials ⚠️
.../Nethermind.Arbitrum/Evm/ArbitrumVirtualMachine.cs 55.55% 3 Missing and 1 partial ⚠️
src/Nethermind.Arbitrum/Arbos/Burner.cs 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #890      +/-   ##
==========================================
+ Coverage   76.09%   76.46%   +0.36%     
==========================================
  Files         234      236       +2     
  Lines       14151    14377     +226     
  Branches     2137     2190      +53     
==========================================
+ Hits        10768    10993     +225     
+ Misses       2629     2608      -21     
- Partials      754      776      +22     
Files with missing lines Coverage Δ
src/Nethermind.Arbitrum/Arbos/ArbosState.cs 90.47% <100.00%> (+0.31%) ⬆️
...c/Nethermind.Arbitrum/Arbos/Programs/StylusCode.cs 100.00% <100.00%> (+8.33%) ⬆️
...c/Nethermind.Arbitrum/Arbos/Programs/StylusRoot.cs 100.00% <100.00%> (ø)
.../Nethermind.Arbitrum/Arbos/Storage/ArbosStorage.cs 97.79% <100.00%> (+0.01%) ⬆️
src/Nethermind.Arbitrum/Config/ArbitrumConfig.cs 91.17% <ø> (ø)
src/Nethermind.Arbitrum/Precompiles/ArbOwner.cs 89.47% <100.00%> (+0.22%) ⬆️
.../Nethermind.Arbitrum/Precompiles/ArbOwnerPublic.cs 96.15% <100.00%> (+0.15%) ⬆️
src/Nethermind.Arbitrum/Precompiles/ArbWasm.cs 72.15% <100.00%> (ø)
.../Precompiles/ArbitrumPrecompileExecutionContext.cs 100.00% <100.00%> (ø)
...mind.Arbitrum/Precompiles/Parser/ArbOwnerParser.cs 98.39% <100.00%> (+0.03%) ⬆️
... and 7 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/Nethermind.Arbitrum/Arbos/Programs/StylusPrograms.cs Dismissed
@wurdum wurdum force-pushed the feat/arbos60-increase-stylus-contract-size branch from 52334bf to 43a71cb Compare May 13, 2026 14:02
@wurdum wurdum force-pushed the feat/arbos60-increase-stylus-contract-size branch from 43a71cb to 225f4e8 Compare May 14, 2026 12:30
@wurdum wurdum force-pushed the feat/arbos60-increase-stylus-contract-size branch from 225f4e8 to 9a37c3c Compare May 15, 2026 08:37
@wurdum wurdum force-pushed the feat/arbos60-increase-stylus-contract-size branch from 9a37c3c to deb7467 Compare May 15, 2026 08:44
Comment thread src/Nethermind.Arbitrum/Evm/ArbitrumEvmInstructions.SelfDestruct.cs Dismissed
Comment thread src/Nethermind.Arbitrum/Evm/ArbitrumEvmInstructions.SelfDestruct.cs Dismissed
@wurdum wurdum marked this pull request as ready for review May 15, 2026 09:38
Copilot AI review requested due to automatic review settings May 15, 2026 09:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 migrate StylusParams layout/state for v60 (incl. increased MaxWasmSize).
  • 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.

Comment thread src/Nethermind.Arbitrum/Arbos/Programs/StylusPrograms.cs
Comment thread src/Nethermind.Arbitrum/Arbos/Burner.cs
Comment thread src/Nethermind.Arbitrum/Arbos/Programs/StylusParams.cs
Comment thread src/Nethermind.Arbitrum/Arbos/Programs/StylusPrograms.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ArbOS 60] Stylus Contract Size Limit Increase

3 participants