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

Improve the number of web3 calls the sdk makes #537

Closed
2 of 4 tasks
Tracked by #546
r-marques opened this issue Jun 21, 2023 · 1 comment
Closed
2 of 4 tasks
Tracked by #546

Improve the number of web3 calls the sdk makes #537

r-marques opened this issue Jun 21, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request performance sdk

Comments

@r-marques
Copy link
Member

r-marques commented Jun 21, 2023

Image

The goal is to try to reduce the number of calls the sdk makes to the web3rpc endpoints. I think that some of them can be reduced by simply caching the values on the sdk during instantiation

  • eth_getTransactionByHash: I think this is coming from the nvm one backend that needs to fetch the transaction receipts for the events. should be fixed when we improve the subgraphs
  • eth_getBlockByNumber: Same as above
  • eth_chainId: This method is used in multiple places in the sdk. I think this value is being queried every time we need it. If that is the case it would be enough to just add this value as a property of sdk.keeper during initialization and then just use that value
  • eth_accounts: Not sure why this method is called. We don't use accounts stored in the node. infura always returns an empty array. I think this is called when doing sdk.accounts.list() which we use a lot. In any case the accounts list should be populated at sdk instantiation time and the values re-used after that
@r-marques
Copy link
Member Author

Other improvements that may help further reduce web3calls when listening to events on chain is #559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance sdk
Projects
None yet
Development

No branches or pull requests

1 participant