Skip to content

fix(rpc): use External origin for raw txs and enforce blockHash in filter changes#22000

Closed
gakonst wants to merge 1 commit intomainfrom
georgios/fix-reth-393-394
Closed

fix(rpc): use External origin for raw txs and enforce blockHash in filter changes#22000
gakonst wants to merge 1 commit intomainfrom
georgios/fix-reth-393-394

Conversation

@gakonst
Copy link
Member

@gakonst gakonst commented Feb 9, 2026

Summary

Two audit fixes for RPC behavior.

Changes

1. eth_sendRawTransaction treated as local origin

BatchTxRequest hardcoded TransactionOrigin::Local for all transactions going through the RPC batch path. This meant eth_sendRawTransaction submissions bypassed non-local admission controls (min priority fee filtering, stricter sender slot limits).

Fix: plumb TransactionOrigin through BatchTxRequest and partition batches by origin. The send_transaction RPC path now submits as External.

2. eth_getFilterChanges ignores blockHash constraints

append_matching_block_logs didn't call filter.matches_block(), unlike matching_block_logs_with_tx_hashes which does. When FilterBlockOption::AtBlockHash was used in filter_changes, logs from multiple blocks could be returned.

Fix: add filter.matches_block() early-return guard to append_matching_block_logs, matching the existing behavior in matching_block_logs_with_tx_hashes.

Testing

cargo test -p reth-transaction-pool --lib batcher  # 4 passed
cargo test -p reth-rpc-eth-types --lib logs_utils  # 9 passed
cargo clippy -p reth-transaction-pool -p reth-rpc -p reth-rpc-eth-types  # clean

…and enforce blockHash in filter changes

- batcher: plumb TransactionOrigin through BatchTxRequest instead of hardcoding Local
- batcher: partition batches by origin before pool insertion
- rpc: submit eth_sendRawTransaction as External origin
- logs_utils: add matches_block guard to append_matching_block_logs

Amp-Thread-ID: https://ampcode.com/threads/T-019c4401-f497-7668-a25e-64c6fe49d873
Co-authored-by: Amp <amp@ampcode.com>
@gakonst gakonst added the A-rpc Related to the RPC implementation label Feb 9, 2026
@gakonst gakonst requested a review from Rjected as a code owner February 9, 2026 20:17
@gakonst gakonst added the A-rpc Related to the RPC implementation label Feb 9, 2026
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

⚠️ Changelog not found.

A changelog entry is required before merging. We've generated a suggested changelog based on your changes:

Preview
---
reth-rpc: patch
reth-rpc-eth-types: patch
reth-transaction-pool: patch
---

Fixed `eth_sendRawTransaction` to use `TransactionOrigin::External` instead of `Local`, and added block hash filtering in `append_matching_block_logs` to prevent processing irrelevant blocks.

Add changelog to commit this to your branch.

@emmajam
Copy link
Member

emmajam commented Feb 9, 2026

Closing: the batcher origin plumbing was already merged via #21969. The matches_block fix for RETH-392 will be submitted as a separate PR.

@emmajam emmajam closed this Feb 9, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants