RPC: pending extrinsics entering mempool #3473
Labels
I5-enhancement
An additional feature request.
I10-unconfirmed
Issue might be valid, but it's not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
Was looking for a subscription (websocket pubsub) to monitor the live mempool/txpool for incoming extrinsics.
There is the
author_pendingExtrinsics
RPC; but this gives a snapshot view of the mempool upon request.Request
A new RPC endpoint which should simply allow a caller to subscribe to all incoming pending extrinsics.
Once a user subscribes, the RPC endpoint will stream out live incoming transactions (type
Extrinsic
) in theReady
state.The transactions do not need to be finalized - as that defeats the purpose since the state has already been set.
Solution
A new subscription in the
client/rpc-api/src/author/mod.rs
file.Something like so:
This should be fairly simple to implement (already have a local implementation building/streaming out to WS connection).
Example response (scale encoded extrinsic):
Potential concerns
If there are issues (DoS, etc.); maybe this could be put behind feature flags - similar to what frontier has done for the ethereum txpool subscriptions.
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: