fix(rpc): use External origin for raw txs and enforce blockHash in filter changes#22000
Closed
fix(rpc): use External origin for raw txs and enforce blockHash in filter changes#22000
Conversation
…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>
Contributor
|
Member
|
Closing: the batcher origin plumbing was already merged via #21969. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two audit fixes for RPC behavior.
Changes
1.
eth_sendRawTransactiontreated as local originBatchTxRequesthardcodedTransactionOrigin::Localfor all transactions going through the RPC batch path. This meanteth_sendRawTransactionsubmissions bypassed non-local admission controls (min priority fee filtering, stricter sender slot limits).Fix: plumb
TransactionOriginthroughBatchTxRequestand partition batches by origin. Thesend_transactionRPC path now submits asExternal.2.
eth_getFilterChangesignores blockHash constraintsappend_matching_block_logsdidn't callfilter.matches_block(), unlikematching_block_logs_with_tx_hasheswhich does. WhenFilterBlockOption::AtBlockHashwas used infilter_changes, logs from multiple blocks could be returned.Fix: add
filter.matches_block()early-return guard toappend_matching_block_logs, matching the existing behavior inmatching_block_logs_with_tx_hashes.Testing