Skip to content

Fix retryable gas calculation bug and add ArbOS51 version#4047

Merged
joshuacolvin0 merged 20 commits into
masterfrom
arbos_51
Nov 24, 2025
Merged

Fix retryable gas calculation bug and add ArbOS51 version#4047
joshuacolvin0 merged 20 commits into
masterfrom
arbos_51

Conversation

@tsahee

@tsahee tsahee commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Fixes NIT-4132
Depends on OffchainLabs/go-ethereum#583

This PR solves ArbOS 50 issue with retryable transactions then one or more gas constraints are configured for the new pricer algorithm. Original bug was caused by an incorrect calculation of the cost of updating the gas pool, which led to the failure of the redemption transaction due to the ran out of gas.

Includes:

  • Store ArbOs version in L2PricingState
  • Fix for constraints gas pool update cost calculation
  • Add ArbOS version 51 and make it default
  • Configure gas pricing constrains by default in system tests and fix related system tests

@tsahee tsahee force-pushed the arbos_51 branch 2 times, most recently from b799fe7 to ff7a573 Compare November 20, 2025 22:33
@github-actions

github-actions Bot commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2174 2 2172 0
View the top 2 failed tests by shortest run time
TestVersion40
Stack Traces | 5.930s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
=== CONT  TestVersion40
    precompile_inclusion_test.go:94: goroutine 455440 [running]:
        runtime/debug.Stack()
        	/opt/hostedtoolcache/go/1.25.4/x64/src/runtime/debug/stack.go:26 +0x5e
        github.com/offchainlabs/nitro/util/testhelpers.RequireImpl({0x40e2bf0, 0xc0a8e23180}, {0x40a0480, 0xc0e2429740}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/util/testhelpers/testhelpers.go:29 +0x55
        github.com/offchainlabs/nitro/system_tests.Require(0xc0a8e23180, {0x40a0480, 0xc0e2429740}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/system_tests/common_test.go:1790 +0x5d
        github.com/offchainlabs/nitro/system_tests.testPrecompiles(0xc0a8e23180, 0x28, {0xc08a059df8, 0x5, 0x18?})
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:94 +0x371
        github.com/offchainlabs/nitro/system_tests.TestVersion40(0xc0a8e23180?)
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:71 +0x64b
        testing.tRunner(0xc0a8e23180, 0x3d256e0)
        	/opt/hostedtoolcache/go/1.25.4/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.4/x64/src/testing/testing.go:1997 +0x465
        
    precompile_inclusion_test.go:94: �[31;1m [] execution aborted (timeout = 5s) �[0;0m
�[90mhostio-test: deployed to 0x457b1BA688E9854BDbed2f473F7510C476A3dA09�[0;0m
--- FAIL: TestVersion40 (5.93s)
TestEthSyncing
Stack Traces | 34.150s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
DEBUG[11-24|21:38:25.564] Served eth_call                          reqid=4853  duration="405.908µs"
TRACE[11-24|21:38:25.564] Handled RPC response                     reqid=7590  duration="1.643µs"
DEBUG[11-24|21:38:25.564] Served eth_getBlockByNumber              reqid=9766  duration="88.365µs"
DEBUG[11-24|21:38:25.564] redis producer: check responses starting
DEBUG[11-24|21:38:25.564] Finality not supported, not pushing finality data to execution
TRACE[11-24|21:38:25.564] Handled RPC response                     reqid=9766  duration="1.132µs"
DEBUG[11-24|21:38:25.564] Finality not supported, not pushing finality data to execution
DEBUG[11-24|21:38:25.564] Pushed sync data from consensus to execution synced=true  maxMessageCount=6   updatedAt=2025-11-24T21:38:25+0000 hasProgressMap=false
DEBUG[11-24|21:38:25.563] Pushed sync data from consensus to execution synced=true  maxMessageCount=8   updatedAt=2025-11-24T21:38:25+0000 hasProgressMap=false
DEBUG[11-24|21:38:25.564] Finality not supported, not pushing finality data to execution
DEBUG[11-24|21:38:25.564] Pushed sync data from consensus to execution synced=true  maxMessageCount=13  updatedAt=2025-11-24T21:38:25+0000 hasProgressMap=false
TRACE[11-24|21:38:25.564] Handled RPC response                     reqid=7277  duration="2.044µs"
TRACE[11-24|21:38:25.564] Handled RPC response                     reqid=15321 duration="2.104µs"
DEBUG[11-24|21:38:25.564] Pushed sync data from consensus to execution synced=true  maxMessageCount=8   updatedAt=2025-11-24T21:38:25+0000 hasProgressMap=false
DEBUG[11-24|21:38:25.564] Pushed sync data from consensus to execution synced=true  maxMessageCount=185 updatedAt=2025-11-24T21:38:25+0000 hasProgressMap=false
DEBUG[11-24|21:38:25.564] Served eth_getBlockByNumber              reqid=1437  duration="87.814µs"
DEBUG[11-24|21:38:25.564] Executing EVM call finished              runtime="274.082µs"
DEBUG[11-24|21:38:25.572] Served eth_call                          reqid=7591  duration=7.959865ms
DEBUG[11-24|21:38:25.572] Served eth_getBlockByNumber              reqid=4099  duration="94.246µs"
--- FAIL: TestEthSyncing (34.15s)

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Comment thread arbos/constraints/single_dimensional.go Outdated
Comment thread arbos/l2pricing/l2pricing.go
@gligneul gligneul self-requested a review November 21, 2025 12:28
Comment thread arbos/l2pricing/l2pricing.go
Comment thread system_tests/full_challenge_impl_test.go
gligneul
gligneul previously approved these changes Nov 24, 2025
@eljobe eljobe marked this pull request as ready for review November 24, 2025 14:26
@eljobe eljobe self-assigned this Nov 24, 2025
eljobe
eljobe previously requested changes Nov 24, 2025

@eljobe eljobe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please update the PR description and title so that someone reading the history will understand why we're making this change.

@eljobe eljobe assigned tsahee and unassigned eljobe Nov 24, 2025
@joshuacolvin0 joshuacolvin0 changed the title Arbos 51 Fix retryable gas calculation bug Nov 24, 2025
@joshuacolvin0 joshuacolvin0 dismissed eljobe’s stale review November 24, 2025 21:12

Description and title updated to be more descriptive

@joshuacolvin0 joshuacolvin0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@joshuacolvin0 joshuacolvin0 changed the title Fix retryable gas calculation bug Fix retryable gas calculation bug and add ArbOS51 version Nov 24, 2025
@joshuacolvin0

Copy link
Copy Markdown
Member

closing and reopening to unstick CI

auto-merge was automatically disabled November 24, 2025 21:24

Pull request was closed

@joshuacolvin0 joshuacolvin0 reopened this Nov 24, 2025
@codecov

codecov Bot commented Nov 24, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.51515% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.58%. Comparing base (7ce0519) to head (9007ad1).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4047      +/-   ##
==========================================
+ Coverage   18.10%   18.58%   +0.47%     
==========================================
  Files         387      387              
  Lines       48541    48558      +17     
==========================================
+ Hits         8788     9023     +235     
+ Misses      38067    37827     -240     
- Partials     1686     1708      +22     

@joshuacolvin0 joshuacolvin0 added this pull request to the merge queue Nov 24, 2025
Merged via the queue into master with commit adf531c Nov 24, 2025
67 of 75 checks passed
@joshuacolvin0 joshuacolvin0 deleted the arbos_51 branch November 24, 2025 23:13
joshuacolvin0 added a commit that referenced this pull request Nov 25, 2025
This PR solves ArbOS 50 issue with retryable transactions then one or more gas constraints are configured for the new pricer algorithm. Original bug was caused by an incorrect calculation of the cost of updating the gas pool, which led to the failure of the redemption transaction due to the ran out of gas.

Includes:

Store ArbOs version in L2PricingState
Fix for constraints gas pool update cost calculation
Add ArbOS version 51 and make it default
Configure gas pricing constrains by default in system tests and fix related system tests
MishkaRogachev added a commit that referenced this pull request Nov 25, 2025
* l2pricing: add arbosVersion parameter

* create free-storage and use for gas constraints

* l2pricing-simulator: build fix

* common test: test by default with multiple constraints

* fix TestRetryableSubmissionAndRedeemFees

* lint fixes

* system_test: don't take ownership if no owner

* fix more system tests

* fix more tests

* Add test proving issue with redeem and constraints

* Refactor redeem gasPoolUpdateCost to a function

* Revert "create free-storage and use for gas constraints"

This reverts commit f48b38f.

* Correct GasPoolUpdateCost for ArbOS 51

* Increase redeemAllAndCreateAddresses gas for retryable

* recreate_rpc: do take ownership

* l2pricingstate: restructure arbos version checking

* l2pricingmodel: fixes

* rework gas constraints

* fix typo in test

* Post-merge fix: use gasConstraintsMaxNum

---------

Co-authored-by: Mikhail Rogachev <mrogachev@offchainlabs.com>
eljobe pushed a commit that referenced this pull request Nov 25, 2025
)

* l2pricing: add arbosVersion parameter

* create free-storage and use for gas constraints

* l2pricing-simulator: build fix

* common test: test by default with multiple constraints

* fix TestRetryableSubmissionAndRedeemFees

* lint fixes

* system_test: don't take ownership if no owner

* fix more system tests

* fix more tests

* Add test proving issue with redeem and constraints

* Refactor redeem gasPoolUpdateCost to a function

* Revert "create free-storage and use for gas constraints"

This reverts commit f48b38f.

* Correct GasPoolUpdateCost for ArbOS 51

* Increase redeemAllAndCreateAddresses gas for retryable

* recreate_rpc: do take ownership

* l2pricingstate: restructure arbos version checking

* l2pricingmodel: fixes

* rework gas constraints

* fix typo in test

* Post-merge fix: use gasConstraintsMaxNum

---------

Co-authored-by: Tsahi Zidenberg <65945052+tsahee@users.noreply.github.com>
MishkaRogachev added a commit that referenced this pull request Nov 25, 2025
* l2pricing: add arbosVersion parameter

* create free-storage and use for gas constraints

* l2pricing-simulator: build fix

* common test: test by default with multiple constraints

* fix TestRetryableSubmissionAndRedeemFees

* lint fixes

* system_test: don't take ownership if no owner

* fix more system tests

* fix more tests

* Add test proving issue with redeem and constraints

* Refactor redeem gasPoolUpdateCost to a function

* Revert "create free-storage and use for gas constraints"

This reverts commit f48b38f.

* Correct GasPoolUpdateCost for ArbOS 51

* Increase redeemAllAndCreateAddresses gas for retryable

* recreate_rpc: do take ownership

* l2pricingstate: restructure arbos version checking

* l2pricingmodel: fixes

* rework gas constraints

* fix typo in test

* Post-merge fix: use gasConstraintsMaxNum

---------

Co-authored-by: Mikhail Rogachev <mrogachev@offchainlabs.com>
MishkaRogachev added a commit that referenced this pull request Nov 25, 2025
* l2pricing: add arbosVersion parameter

* create free-storage and use for gas constraints

* l2pricing-simulator: build fix

* common test: test by default with multiple constraints

* fix TestRetryableSubmissionAndRedeemFees

* lint fixes

* system_test: don't take ownership if no owner

* fix more system tests

* fix more tests

* Add test proving issue with redeem and constraints

* Refactor redeem gasPoolUpdateCost to a function

* Revert "create free-storage and use for gas constraints"

This reverts commit f48b38f.

* Correct GasPoolUpdateCost for ArbOS 51

* Increase redeemAllAndCreateAddresses gas for retryable

* recreate_rpc: do take ownership

* l2pricingstate: restructure arbos version checking

* l2pricingmodel: fixes

* rework gas constraints

* fix typo in test

* Post-merge fix: use gasConstraintsMaxNum

---------

Co-authored-by: Mikhail Rogachev <mrogachev@offchainlabs.com>
MishkaRogachev added a commit that referenced this pull request Nov 25, 2025
* l2pricing: add arbosVersion parameter

* create free-storage and use for gas constraints

* l2pricing-simulator: build fix

* common test: test by default with multiple constraints

* fix TestRetryableSubmissionAndRedeemFees

* lint fixes

* system_test: don't take ownership if no owner

* fix more system tests

* fix more tests

* Add test proving issue with redeem and constraints

* Refactor redeem gasPoolUpdateCost to a function

* Revert "create free-storage and use for gas constraints"

This reverts commit f48b38f.

* Correct GasPoolUpdateCost for ArbOS 51

* Increase redeemAllAndCreateAddresses gas for retryable

* recreate_rpc: do take ownership

* l2pricingstate: restructure arbos version checking

* l2pricingmodel: fixes

* rework gas constraints

* fix typo in test

* Post-merge fix: use gasConstraintsMaxNum

---------

Co-authored-by: Mikhail Rogachev <mrogachev@offchainlabs.com>
joshuacolvin0 added a commit that referenced this pull request Nov 25, 2025
…-con5-rel

Fix retryable gas calculation bug and add ArbOS51 version (#4047)
0x19 pushed a commit to Tenderly/net-nitro that referenced this pull request Nov 28, 2025
…bs#4047) (OffchainLabs#4068)

* l2pricing: add arbosVersion parameter

* create free-storage and use for gas constraints

* l2pricing-simulator: build fix

* common test: test by default with multiple constraints

* fix TestRetryableSubmissionAndRedeemFees

* lint fixes

* system_test: don't take ownership if no owner

* fix more system tests

* fix more tests

* Add test proving issue with redeem and constraints

* Refactor redeem gasPoolUpdateCost to a function

* Revert "create free-storage and use for gas constraints"

This reverts commit f48b38f.

* Correct GasPoolUpdateCost for ArbOS 51

* Increase redeemAllAndCreateAddresses gas for retryable

* recreate_rpc: do take ownership

* l2pricingstate: restructure arbos version checking

* l2pricingmodel: fixes

* rework gas constraints

* fix typo in test

* Post-merge fix: use gasConstraintsMaxNum

---------

Co-authored-by: Tsahi Zidenberg <65945052+tsahee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants