Skip to content

add EIP-3860 initcode size check in txpool validation#13473

Merged
onbjerg merged 2 commits intofoundry-rs:masterfrom
DanielGuupta:EIP-3860
Feb 27, 2026
Merged

add EIP-3860 initcode size check in txpool validation#13473
onbjerg merged 2 commits intofoundry-rs:masterfrom
DanielGuupta:EIP-3860

Conversation

@DanielGuupta
Copy link
Copy Markdown
Contributor

Motivation

Contract creation transactions with initcode exceeding 49152 bytes were accepted into the mempool and only rejected at execution time.

Solution

Add the missing EIP-3860 size check in validate_pool_transaction_for so oversized txs are rejected early at eth_sendRawTransaction, consistent with how we handle other fork-aware validations (EIP-1559, EIP-4844).

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Copy Markdown
Member

@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 believe this clashes with settings we have and ideally we want to allow using larger txs

Copy link
Copy Markdown
Member

@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.

so I think instead of this we should add a way to make this configurable

@DanielGuupta
Copy link
Copy Markdown
Contributor Author

so I think instead of this we should add a way to make this configurable

updated to respect limit_contract_code_size from CfgEnv. Now it follows the EIP-3860 formula (2 * code_size_limit) and is effectively skipped when --disable-code-size-limit is used.

@DanielGuupta DanielGuupta requested a review from mattsse February 18, 2026 08:20
@onbjerg onbjerg enabled auto-merge (squash) February 27, 2026 12:22
@onbjerg onbjerg merged commit ac4a5c6 into foundry-rs:master Feb 27, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Foundry Feb 27, 2026
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.

3 participants