Skip to content

feat(contracts-bedrock): scale ResourceConfig to fit smaller gasLimits (v7.0.0)#20925

Open
maurelian wants to merge 1 commit into
proposal/op-contracts/v7.0.0from
feat/dynamic-resource-config-v7
Open

feat(contracts-bedrock): scale ResourceConfig to fit smaller gasLimits (v7.0.0)#20925
maurelian wants to merge 1 commit into
proposal/op-contracts/v7.0.0from
feat/dynamic-resource-config-v7

Conversation

@maurelian
Copy link
Copy Markdown
Contributor

Backport of #20919 to proposal/op-contracts/v7.0.0.

DeployOPChain.s.sol now derives the ResourceConfig from _input.gasLimit via a _resourceConfigForGasLimit(uint64) helper instead of hardcoding Constants.DEFAULT_RESOURCE_CONFIG(). For gasLimit >= 21M the default is returned unchanged (every production chain), and below that maxResourceLimit is scaled down to fit while preserving systemTxMaxGas and the EIP-1559 parameters. Enables small-chain deploys (e.g. 5M) without adding any new inputs to op-deployer.

Cherry-pick was a clean auto-merge with no conflicts.

@maurelian maurelian requested review from a team and digorithm May 20, 2026 18:53
Comment thread packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol
Comment thread packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol
Production chains (gasLimit >= 21M) are unaffected. Below that, the deploy
script derives a ResourceConfig whose maxResourceLimit + systemTxMaxGas
matches the requested gasLimit, so small chains (e.g. 5M) can deploy
without callers having to supply their own ResourceConfig.
@maurelian maurelian force-pushed the feat/dynamic-resource-config-v7 branch from 5d52df0 to ba86f94 Compare May 20, 2026 19:52
Comment thread packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.6%. Comparing base (4c23d27) to head (ba86f94).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           proposal/op-contracts/v7.0.0   #20925     +/-   ##
===============================================================
+ Coverage                          76.4%    82.6%   +6.2%     
===============================================================
  Files                               186      131     -55     
  Lines                             10695     6660   -4035     
===============================================================
- Hits                               8171     5502   -2669     
+ Misses                             2380     1158   -1222     
+ Partials                            144        0    -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 82.6% <ø> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 56 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants