Skip to content

Conversation

@cuiweixie
Copy link
Contributor

@cuiweixie cuiweixie commented Dec 2, 2025

I think this rpc is necessary, at least for my scene, do need this rpc to clear tx pool.
reth already has this rpc method.
in paradigmxyz/reth#18539

@jwasinger
Copy link
Contributor

Why do you need this?

The original reth-linked issue has the following rationale:

In some L2 architectures where the L1 blockchain acts as the sequencer, we need to maintain strict transaction ordering between L1 and L2 layers. This ensures proper mempool clearing and prevents ordering discrepancies that could arise from transaction persistence issues.

It's not clear to me how this functionality is facilitated by making the mempool clear an rpc method, or if Geth even cares about that use-case..

@cuiweixie
Copy link
Contributor Author

cuiweixie commented Dec 2, 2025

In my case, this rpc can be used to clear tx pool when benchmark the chain using tools like https://github.com/0gfoundation/evmchainbench or https://github.com/cuiweixie/adventure/tree/leo/contract-deploy. Whose gas price is fixed generally, but basefee will go higher that fixed gas price, or txpool is full cause some tx got pending, those txs can not get on chain, when we stop the benchmark or restart the benchmark, before that, we need to clear tx pool.

Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

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

I am supportive of this change, having needed it in the past. I do think admin is the wrong place for it, though - no matter where reth decided to put it. It should be in debug_ as this has no place in regular node operation - and it might be a problem with FOCIL down the road as an admin could accidentally clear the mempool of transactions that must be included. Presumably, debug_ isn't activated in production.

@cuiweixie cuiweixie force-pushed the admin_clearTxpool branch 2 times, most recently from 51b0fb7 to cf69675 Compare December 14, 2025 10:03
@cuiweixie cuiweixie requested a review from gballet December 14, 2025 10:05
@cuiweixie cuiweixie changed the title eth: add admin_clearTxpool api Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants