Add txpool_content JSON-RPC method#10120
Merged
fab-10 merged 3 commits intobesu-eth:mainfrom Mar 30, 2026
Merged
Conversation
2463b67 to
44954f7
Compare
1 task
macfarla
approved these changes
Mar 30, 2026
Contributor
macfarla
left a comment
There was a problem hiding this comment.
Non-blocking: No test for getAllBySender merging across multiple layers in the layered pool - only the RPC handler is unit-tested. An integration or layer-level test for AbstractTransactionsLayer.getAllBySender with multiple layers would strengthen confidence in the merge logic
Implements the spec-defined `txpool_content` endpoint that returns all pending and queued transactions in the pool, grouped by sender address and nonce. - Add `TxPoolContent` RPC handler and `TransactionPoolContentResult` - Add `getPendingTransactionsBySender()` to `PendingTransactions` interface - Add `getAllBySender()` to `TransactionsLayer` interface - Implement in `LayeredPendingTransactions` and `AbstractPendingTransactionsSorter` - Unit tests: 8 cases covering empty pool, all-pending, all-queued, mixed split, multiple senders, and nonce ordering Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Contributor
Author
done, added a specific test scenario in |
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
Implements the spec-defined
txpool_contentJSON-RPC method. Given no parameters, returns all pending (executable) and queued (non-executable) transactions in the pool, grouped by sender address and then by nonce.Related to #10111 (
txpool_contentFrom).Changes
TxPoolContent: RPC handler; splits each sender's transactions into pending (consecutive from account nonce) and queued (nonce gap) using the same logic astxpool_contentFromTransactionPoolContentResult: result type{ pending: Map<address, Map<nonce, tx>>, queued: Map<address, Map<nonce, tx>> }matchingTxpoolContentschemaPendingTransactions: addedgetPendingTransactionsBySender()to interfaceTransactionsLayer: addedgetAllBySender()to interface, with Javadoc documenting the nonce-ordering invariantAbstractTransactionsLayer: merges current-layer and next-layer sender maps, preserving nonce-ascending order per senderEndLayer: base case returnsMap.of()LayeredPendingTransactions: implementsgetPendingTransactionsBySender()usinggetAllBySender()+getCurrentNonceFor()per sender (synchronized)AbstractPendingTransactionsSorter: implementsgetPendingTransactionsBySender()fromtransactionsBySenderTreeMapDisabledPendingTransactions: no-op returnsMap.of()Test plan
TxPoolContentTest— 8 unit tests: empty pool, all-pending, all-queued, mixed split, multiple senders, default nonce=0, sender absent from pending map, nonce ordering preservedtxpool_contentresponse matchesTxpoolContentschema from execution-apis spec🤖 Generated with Claude Code