Skip to content

feat(p2p): reject and evict txs with insufficient max fee per gas#21281

Merged
spalladino merged 6 commits intomerge-train/spartanfrom
palla/max-fee-per-gas-validation
Mar 12, 2026
Merged

feat(p2p): reject and evict txs with insufficient max fee per gas#21281
spalladino merged 6 commits intomerge-train/spartanfrom
palla/max-fee-per-gas-validation

Conversation

@spalladino
Copy link
Contributor

Summary

  • Previously, GasTxValidator returned skipped when a tx's maxFeesPerGas was below current block fees, allowing it to wait for lower fees. This changes it to invalid, rejecting the tx outright.
  • Extracts MaxFeePerGasValidator as a standalone generic validator (like GasLimitsValidator) so it can be used in pool migration alongside full Tx validation.
  • Adds InsufficientFeePerGasEvictionRule that evicts pending txs after a new block is mined if their maxFeesPerGas no longer meets the block's gas fees.
  • Adds maxFeesPerGas to TxMetaValidationData so the eviction rule and pool migration validator can access it from metadata.

Caveat: This may evict transactions that would become valid if block fees later drop. A more nuanced approach would define a threshold (e.g. 50% of current fees) and only reject/evict below that. The current approach is simpler and ensures the pool doesn't accumulate low-fee txs unlikely to be mined soon.

🤖 Generated with Claude Code

Copy link
Collaborator

@PhilWindle PhilWindle left a comment

Choose a reason for hiding this comment

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

Thanks for this.

Could you add tests to tx_pool_v2.test.ts please?

spalladino and others added 2 commits March 10, 2026 20:46
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@spalladino spalladino force-pushed the palla/max-fee-per-gas-validation branch from 6f36358 to 0614fbc Compare March 10, 2026 20:52
@spalladino spalladino enabled auto-merge (squash) March 11, 2026 01:08
private readonly nodeRef: AztecNodeProxy,
) {
super(pxe, nodeRef);
this.minFeePadding = 5;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Thunkar you ok with this change?

Copy link
Contributor

@Thunkar Thunkar Mar 11, 2026

Choose a reason for hiding this comment

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

Do we need it always or just for this test? (There's a setter)

In general, TestWallet can be altered to fit tests, EmbeddedWallet is the public facing class now!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need it always or just for this test? (There's a setter)

Every test potentially needs it!

@spalladino spalladino added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Mar 11, 2026
@spalladino spalladino force-pushed the palla/max-fee-per-gas-validation branch from 5a84ee8 to 26534ab Compare March 11, 2026 17:30
@AztecBot
Copy link
Collaborator

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/fce72367613af837�fce72367613af8378;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/gossip_network_no_cheat.test.ts (165s) (code: 0) group:e2e-p2p-epoch-flakes

@spalladino spalladino merged commit 9e2d79c into merge-train/spartan Mar 12, 2026
10 checks passed
@spalladino spalladino deleted the palla/max-fee-per-gas-validation branch March 12, 2026 15:06
@AztecBot
Copy link
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

AztecBot pushed a commit that referenced this pull request Mar 12, 2026
…e per gas (#21281)

Cherry-pick of 9e2d79c with conflicts.

Conflicts:
- yarn-project/end-to-end/src/spartan/block_capacity.test.ts: modify/delete conflict
  (deleted in v4-next, modified in source)
spalladino added a commit that referenced this pull request Mar 12, 2026
spalladino added a commit that referenced this pull request Mar 12, 2026
ludamad pushed a commit that referenced this pull request Mar 12, 2026
…e per gas (#21281)

Cherry-pick of 9e2d79c with conflicts.

Conflicts:
- yarn-project/end-to-end/src/spartan/block_capacity.test.ts: modify/delete conflict
  (deleted in v4-next, modified in source)
AztecBot pushed a commit that referenced this pull request Mar 13, 2026
…e per gas (#21281)

Cherry-pick of 9e2d79c with conflicts.

Conflicts:
- yarn-project/end-to-end/src/spartan/block_capacity.test.ts: modify/delete conflict
  (deleted in v4-next, modified in source)
github-merge-queue bot pushed a commit that referenced this pull request Mar 16, 2026
BEGIN_COMMIT_OVERRIDE
feat: add ETHEREUM_HTTP_TIMEOUT_MS env var for viem HTTP transport
(#20919)
fix(archiver): filter tagged log queries by block number (#21388)
fix(node): handle slot zero in getL2ToL1Messages (#21386)
feat(sequencer): redistribute checkpoint budget evenly across remaining
blocks (#21378)
fix: fall back to package.json for CLI version detection (#21382)
chore: Removed multiplier config (#21412)
chore: Removed default snapshot url config (#21413)
chore: Read tx filestores from network config (#21416)
fix(node): check world state against requested block hash (#21385)
feat(p2p): use l2 priority fee only for tx priority (#21420)
feat(p2p): reject and evict txs with insufficient max fee per gas
(#21281)
revert "feat(p2p): reject and evict txs with insufficient max fee per
gas (#21281)" (#21432)
chore: Reduce log spam (#21436)
fix(tx): reject txs with invalid setup when unprotecting (#21224)
fix: orchestrator enqueue yield (#21286)
chore(builder): check archive tree next leaf index during block building
(#21457)
fix: scenario deployment (#21428)
chore: add claude skill to read network-logs (#21495)
chore: update claude network-logs skill (#21523)
feat(rpc): add package version to RPC response headers (#21526)
chore(prover): silence "epoch to prove" debug logs (#21527)
chore(sequencer): do not log blob data (#21530)
fix: dependabot alerts (#21531)
docs(p2p): nicer READMEs (#21456)
fix(archiver): guard getL1ToL2Messages against incomplete message sync
(#21494)
fix(sequencer): await syncing proposed block to archiver (#21554)
feat(ethereum): check VK tree root and protocol contracts hash in rollup
compatibility (#21537)
fix: marking peer as dumb on failed responses (#21316)
fix(kv-store): make LMDB clear and drop operations atomic across
sub-databases (#21539)
feat(world-state): add blockHash verification to syncImmediate (#21556)
chore(monitor): print out l2 fees components (#21559)
chore: rm faucet (#21538)
chore: remove old merkle trees (#21577)
feat: Implement commit all and revert all for world state checkpoints
(#21532)
chore: skip flaky browser acir tests in CI (#21596)
fix: Better detection for epoch prune (#21478)
chore: logging (#21604)
fix: Don't update state if we failed to execute sufficient transactions
(#21443)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v4-next ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants