Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate common concurrent RPC calls #117

Open
ptrus opened this issue Dec 15, 2021 · 0 comments
Open

Deduplicate common concurrent RPC calls #117

ptrus opened this issue Dec 15, 2021 · 0 comments
Labels
p:2 Priority: desired feature performance

Comments

@ptrus
Copy link
Member

ptrus commented Dec 15, 2021

Some method calls are extremely common (mostly method calls for fetching latest block info).

Using a package like sync/singleflight these calls can easily can easily be de-deuplicated so that the DB/oasis-node is queried only once for any number of concurrent requests.

The following methods are obvious candidates:

  • GetBlockByNumber - dedeuplicate by: {blockNumber}-{fullTx}
  • GetBlockTransactionCountByNumber - deduplicate by: {blockNumber}
  • GasPrice
  • GetBlockHash - deduplicate by: {blockNumber}
  • BlockNumber

Potentially (if overhead of using singleflight is small enough) this could be done for all read-only RPC calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:2 Priority: desired feature performance
Projects
None yet
Development

No branches or pull requests

1 participant