Skip to content

Conversation

@dragann-milosevic
Copy link

@dragann-milosevic dragann-milosevic commented Oct 23, 2025

First part of issue #47

Summary

Adds the first set of transaction pool management RPC endpoints. This is part 1 of the txpool RPC implementation.

Changes

  • anvil_dropTransaction(eth_hash) - Removes a specific transaction from the pool by its Ethereum hash
  • anvil_dropAllTransactions() - Clears all transactions from the pool (ready and future)
  • txpool_status() - Returns transaction pool status with pending and queued transaction counts

Implementation Details

  • Added transaction_matches_eth_hash helper function to decode extrinsics and match ETH transaction hashes
  • Added TxpoolStatus response type with pending and queued fields
  • Integrated with existing TransactionPoolHandle using report_invalid for transaction removal

Testing

Added basic integration tests:

  • test_txpool_status - Verifies pool status tracking
  • test_drop_transaction - Tests selective transaction removal
  • test_drop_all_transactions - Tests clearing the entire pool

Next Steps

Part 2 will add the remaining rest of txpool RPCs(inspect, content, remove).

@dragann-milosevic dragann-milosevic marked this pull request as ready for review October 23, 2025 14:17
@dragann-milosevic dragann-milosevic changed the title feat(anvil-polkadot): add transaction pool management RPCs 1/2 feat(anvil-polkadot): add transaction pool RPCs 1/2 Oct 23, 2025
Copy link

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

Left a few comments for the tests, will try out the RPCs soon, thanks!

Copy link

@AlexandruCihodaru AlexandruCihodaru left a comment

Choose a reason for hiding this comment

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

Overall LGTM

Copy link

@alindima alindima left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

Very nice work! Thanks

@dragann-milosevic dragann-milosevic merged commit 106024f into master Oct 27, 2025
50 of 61 checks passed
@dragann-milosevic dragann-milosevic deleted the dragann-milosevic/dropTx branch October 27, 2025 09:56
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.

5 participants