Skip to content

fix(txpool): enforce hardfork activation for EIP-7702 and MorphTx#59

Merged
panos-xyz merged 3 commits intomainfrom
fix/txpool-hardfork-activation
Mar 26, 2026
Merged

fix(txpool): enforce hardfork activation for EIP-7702 and MorphTx#59
panos-xyz merged 3 commits intomainfrom
fix/txpool-hardfork-activation

Conversation

@panos-xyz
Copy link
Copy Markdown
Contributor

@panos-xyz panos-xyz commented Mar 25, 2026

Summary

Adds txpool-level validation to reject transaction types that are not yet active based on hardfork timestamps:

  • EIP-7702 (type 0x04): Rejected before Viridian hardfork (PRAGUE SpecId)
  • MorphTx (type 0x7F): Rejected before Emerald hardfork

This aligns morph-reth's txpool with go-ethereum's MakeSigner, which only registers these transaction types after their respective hardfork activation.

Test plan

  • cargo check -p morph-txpool passes
  • Existing unit tests pass
  • Verify EIP-7702 tx rejected when Viridian not active
  • Verify MorphTx rejected when Emerald not active

Summary by CodeRabbit

  • New Features
    • Transaction validation now rejects EIP7702 transactions when Viridian hardfork is inactive
    • Transaction validation now rejects MorphTx transactions when Emerald hardfork is inactive

Add txpool-level rejection for:
- EIP-7702 transactions before Viridian hardfork (PRAGUE activation)
- MorphTx (0x7F) before Emerald hardfork

This aligns with go-ethereum's MakeSigner behavior which only registers
these transaction types after their respective hardfork activation.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

Warning

Rate limit exceeded

@panos-xyz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 578a8837-e4a5-4713-b259-87c11db81612

📥 Commits

Reviewing files that changed from the base of the PR and between c991f05 and 1e744d7.

📒 Files selected for processing (1)
  • crates/txpool/src/validator.rs
📝 Walkthrough

Walkthrough

The PR adds early rejection logic in the transaction validator to mark EIP-7702 transactions as unsupported when Viridian is inactive and MorphTx transactions as unsupported when Emerald is inactive, before proceeding with standard validation.

Changes

Cohort / File(s) Summary
Transaction Validator Hardfork Checks
crates/txpool/src/validator.rs
Added early rejection logic for EIP-7702 and MorphTx transactions based on hardfork activation status (Viridian and Emerald respectively) before standard validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • chengwenxi

Poem

🐰✨ A hop through the hardfork gates,

Viridian and Emerald now validate!

Early rejections quick and neat,

Make the validation flow complete. 🌿💫

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'enforce hardfork activation for EIP-7702 and MorphTx' directly and clearly describes the main changes: adding validation to reject EIP-7702 transactions before Viridian and MorphTx before Emerald based on hardfork activation status.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/txpool-hardfork-activation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@anylots anylots left a comment

Choose a reason for hiding this comment

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

For MorphTx transactions, is_morph_tx() is called twice — at line 261 and line 273. It is recommended to change let is_morph_tx = is_morph_tx(&transaction) at line 273 to reuse the result from the earlier check.

@panos-xyz
Copy link
Copy Markdown
Contributor Author

For MorphTx transactions, is_morph_tx() is called twice — at line 261 and line 273. It is recommended to change let is_morph_tx = is_morph_tx(&transaction) at line 273 to reuse the result from the earlier check.

good catch

@panos-xyz panos-xyz merged commit 6ea9660 into main Mar 26, 2026
9 checks passed
@panos-xyz panos-xyz deleted the fix/txpool-hardfork-activation branch March 26, 2026 07:46
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.

2 participants