paritytech / paritytech/json-rpc-interface-spec

RFE: Add support for `author_poolStatus` RPC

Open
#164 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
37
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Add a new author_poolStatus to get the current status of the transaction pool for which the extrinsic is being sent to.

Implemented at https://github.com/paritytech/polkadot-sdk/pull/7334.

Description

This RFE is for adding a new RPC author_poolStatus which shows the current status of the substrate transaction pool.

During one of the implementation of a queue which submits batch transaction in thousands, I did not find a way of getting the status of the pool. We set the pool limit in transactions and its size with --pool-limit & --pool-kbytes respectively.
I wanted a way to find if the transaction pool is nearing its limit or not before any new bulk transactions are sent to the pool so the transaction do not get bounced, which is my current case.

I have used author_pendingExtrinsics RPC but it does not give the bytes occupied in the pool. Since bytes occupied is also another crucial factor along with count for the limit to be enforced whether the pool is full or not.
Another downside of using this RPC is that that response is too big adding unnecessary load to the nodes and to parse the data as well.

Since we are already using status() method at various places of TransactionPool trait. Send the data as a RPC too, benefitting with low response size.

In future I wish to add the current limits on count and size to this response as well. For now I will assume that transaction-pool will be full when ready.count + future.count(10% of ready.count) > pool_limit or ready.total_bytes + future.total_bytes(10% of ready.total_bytes) > pool_limit_bytes.

Review Notes

Utilise the status() method of TransactionPool trait to expose that data as part of a new RPC call named poolStatus as part of author.
I have added tests to demonstrate the same.

I have been recommended that this RPC must be approved here for the PR at polkadot-sdk to be merged.
https://github.com/paritytech/polkadot-sdk/pull/7334#pullrequestreview-2573226612

Signed-off-by: Shreevatsa N i.mnshreevatsa@gmail.com

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked polkadot-sdk pull request and the existing author RPC definitions it extends. Confirm that the specification describes author_poolStatus using the transaction pool status data and matches the tests mentioned in the issue; done means the RPC is approved for the implementation to merge.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.