Skip to content

fix(txpool): raise default minimal_protocol_basefee to MORPH_BASE_FEE - #246

Open
panos-xyz wants to merge 1 commit into
mainfrom
fix/txpool-minimal-protocol-basefee
Open

panos-xyz wants to merge 1 commit into
mainfrom
fix/txpool-minimal-protocol-basefee

Conversation

@panos-xyz

@panos-xyz panos-xyz commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Initialize reth's DefaultTxPoolValues with minimal_protocol_basefee = MORPH_BASE_FEE (1_000_000 wei / 0.001 Gwei) before CLI parsing in bin/morph-reth/src/main.rs, replacing Ethereum L1's 7 wei default.
  • Preserve full CLI override support via --txpool.minimal-protocol-fee (including lowering to 7 or 0 if L2 baseFee is ever reduced in the future); --help also reflects the 1000000 default.
  • Align TestNodeBuilder with the MORPH_BASE_FEE default (with .with_minimal_protocol_basefee(u64) for override testing) and add CLI + E2E txpool tests.

Motivation

Morph fixes L2 baseFee at MORPH_BASE_FEE (1_000_000 wei). With reth's Ethereum L1 default (MIN_PROTOCOL_BASE_FEE = 7 wei):

  • Transactions with 7 <= maxFeePerGas < 1_000_000 were accepted by eth_sendRawTransaction and parked indefinitely in basefee_pool even though they can never be included in a block.
  • Parked basefee_pool transactions still advance eth_getTransactionCount("pending"), causing wallets/SDKs to issue follow-up transactions at nonce + 1 that remain stuck behind the unminable transaction.
  • Rejecting < MORPH_BASE_FEE upfront maps to RPC transaction underpriced (PoolErrorKind::FeeCapBelowMinimumProtocolFeeCap), and PoolError::is_bad_transaction() returns false, so P2P peers (such as morph-geth) relaying sub-basefee transactions are not penalized.

Changes

  • bin/morph-reth/Cargo.toml, Cargo.lock: add workspace reth-node-core dependency for DefaultTxPoolValues.
  • bin/morph-reth/src/main.rs: call init_morph_txpool_defaults() prior to Cli::parse() and add CLI unit tests for default and --txpool.minimal-protocol-fee overrides.
  • crates/node/src/test_utils.rs: default TestNodeBuilder to MORPH_BASE_FEE and expose with_minimal_protocol_basefee.
  • crates/node/tests/it/txpool.rs: verify < MORPH_BASE_FEE is rejected without inflating eth_getTransactionCount("pending"), exact MORPH_BASE_FEE with 0 tip is accepted and mined, and lowering minimal_protocol_basefee restores queuing.

Test Plan

  • cargo +1.95.0 fmt --all -- --check — passed
  • cargo +1.95.0 clippy --workspace --all-targets -- -D warnings — passed
  • cargo +1.95.0 test -p morph-reth — 5/5 passed
  • cargo +1.95.0 test -p morph-node --features test-utils --test it txpool — 13/13 passed

Summary by CodeRabbit

  • New Features
    • The transaction pool now uses Morph’s base fee as its default minimum transaction fee. Transactions below the minimum are rejected, while transactions at or above it can be accepted.
    • The minimum fee remains configurable through the command-line option, allowing operators to set a different threshold.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository because its GitHub organization is not linked to your Claude organization.

To turn it back on, one person needs both roles: owner of the GitHub organization (or the account owner, for a personal repository) and admin or owner of your Claude organization. If that is not you, pass this on to someone who is.

Open Organization settings, Git providers and click Link next to the GitHub organization's name. If it is not listed, click Enable GitHub integration or Connect your GitHub first, whichever the page shows.

New pull requests are then reviewed as before. To get a review on one that is already open, someone with write access can comment @claude review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The binary now defaults the txpool minimum protocol base fee to MORPH_BASE_FEE before CLI parsing. Test nodes can override this fee, and integration tests cover transaction acceptance below, at, and above the configured minimum.

Changes: Txpool minimum protocol base fee

Layer / File(s) Summary
Initialize the binary default and verify CLI parsing
bin/morph-reth/Cargo.toml, bin/morph-reth/src/main.rs
The binary initializes the minimum protocol base fee to MORPH_BASE_FEE before CLI parsing. Tests verify the default and explicit CLI overrides.
Configure the test-node fee minimum
crates/node/src/test_utils.rs
TestNodeBuilder defaults the minimum protocol base fee to MORPH_BASE_FEE and applies configured values in both launch paths.
Test transaction acceptance at the fee floor
crates/node/tests/it/txpool.rs
Integration tests check rejection below the default fee floor, acceptance at the floor, and acceptance when the configured minimum is lowered.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: dylancai9, curryxbo

Merge Risk: Minimal · up to 329d3 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the default minimal_protocol_basefee in the txpool is raised to MORPH_BASE_FEE. The raw summary confirms this in bin/morph-reth/src/main.rs and crates/node/src/test_ut…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the default minimal_protocol_basefee in the txpool is raised to MORPH_BASE_FEE. The raw summary confirms this in bin/morph-reth/src/main.rs and crates/node/src/test_utils.rs, and the txpool tests cover the new default. The title is short, specific, and uses the conventional fix(txpool) prefix. The title does not mention the TestNodeBuilder override method, but that is a supporting change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d0a5e1c-5aa3-4102-9594-91ff05da41b8
Commits

Reviewing files that changed from the base of the PR and between e01b16a and 329d353.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 4

  • bin/morph-reth/Cargo.toml
  • bin/morph-reth/src/main.rs
  • crates/node/src/test_utils.rs
  • crates/node/tests/it/txpool.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

let below_floor = sign_eip1559_transfer(
wallet.chain_id,
&wallet.inner,
0,
let at_floor = sign_eip1559_transfer(
wallet.chain_id,
&wallet.inner,
0,

// reth pools low-fee txs for future execution when baseFee drops,
// so they are accepted into the queued set, not rejected outright.
let raw = sign_eip1559_transfer(wallet.chain_id, &wallet.inner, 0, 500_000, 500_000)?;
panos-xyz added a commit that referenced this pull request Nov 28, 2026
# Conflicts:
#	bin/morph-reth/src/main.rs
#	crates/node/src/test_utils.rs
panos-xyz added a commit that referenced this pull request Dec 1, 2026
# Conflicts:
#	bin/morph-reth/src/main.rs
#	crates/node/src/test_utils.rs
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