Skip to content

feat: configurable EVM execution limits#21088

Merged
mattsse merged 48 commits intoparadigmxyz:mainfrom
rezzmah:21018-configurable-evm-execution-limits
Jan 26, 2026
Merged

feat: configurable EVM execution limits#21088
mattsse merged 48 commits intoparadigmxyz:mainfrom
rezzmah:21018-configurable-evm-execution-limits

Conversation

@rezzmah
Copy link
Contributor

@rezzmah rezzmah commented Jan 15, 2026

closes #21018

i.e. allows for configurable MAX_CODE_SIZE, MAX_INITCODE_SIZE, and tx_gas_limit_cap on existing chain specs.

This PR doesn't implement genesis parsing into the chainspec as that requires an opinionated approach on the genesis file shape.

i realised a valid alternative is to have a custom ChainSpecParser which also meets most requirements

Closes RETH-186

fix comment

reuse constants in revm

fix: add correct overrides for EthEvmConfig and OpEvmConfig
fix and extend tests

fix(evm): preserve tx_gas_limit_cap from helper and consolidate tests

rename test

refactor tests

fix comment

remove hardcoded values

x

fix tests

extend tests

consistency with tests

x
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I think directionally this is appropriate, but I'd like to avoid the setter code duplications

wdyt @klkvr

self.chain_spec(),
self.chain_spec().chain().id(),
))
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd be nicer if we can make this like .with_limits() then we dont need to duplicate all of the setters, so I'd like to move the EvmLimits type to the alloy repo instead then we can use it in evmenv and elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed that's cleaner. I'll start on it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Jan 15, 2026
@rezzmah

This comment was marked as outdated.

@rezzmah rezzmah requested a review from mattsse January 16, 2026 18:22
@emmajam emmajam requested review from klkvr and mattsse January 23, 2026 10:15
@rezzmah rezzmah requested a review from shekhirin as a code owner January 26, 2026 06:40
Update transaction.rs

x

Update Cargo.toml

fixes tests more

run zepter
@rezzmah rezzmah force-pushed the 21018-configurable-evm-execution-limits branch from c50b9a8 to 416142a Compare January 26, 2026 08:27
@klkvr klkvr force-pushed the 21018-configurable-evm-execution-limits branch 2 times, most recently from ec834fc to ef502ec Compare January 26, 2026 11:12
Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

looks good to me

sorry for completely changing the direction fo the PR but I think simply querying this data from evm should pay off eventually

@klkvr klkvr force-pushed the 21018-configurable-evm-execution-limits branch from ef502ec to aebd0b4 Compare January 26, 2026 11:18
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

makes sense, I think this will be easy to migrate actually

+ FromRecoveredTx<TxTy<Self::Primitives>>
+ FromTxWithEncoded<TxTy<Self::Primitives>>,
Precompiles = PrecompilesMap,
Spec: Into<SpecId>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems appropirate given that this is kinda enshrined by revm as well

Comment on lines +785 to +789
// Get EVM limits from evm_config.evm_env()
let evm_env = self
.evm_config
.evm_env(new_tip_block)
.expect("evm_env should not fail for executed block");
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems fine to do on a per block basis

@mattsse mattsse added this pull request to the merge queue Jan 26, 2026
Merged via the queue into paradigmxyz:main with commit b87cde5 Jan 26, 2026
45 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jan 26, 2026
rakita pushed a commit that referenced this pull request Jan 26, 2026
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 29, 2026
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Feb 11, 2026
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
klkvr added a commit that referenced this pull request Feb 13, 2026
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
klkvr added a commit that referenced this pull request Feb 13, 2026
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat: configurable EVM execution limits

3 participants