-
Notifications
You must be signed in to change notification settings - Fork 4
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
Optimize RPC API Calls to Reduce Glif Bill #120
Comments
This is not the only solution possible. Another option is to use a different Ethers API that will allow us to invoke the smart contract state query as of the given block number (instead of assuming the latest block number). |
We don't need to change our code as long as the Ethers.js API used by our lookup ends up invoking What we need to do as part of this issue:
You should be able to observe raw HTTP request/response bodies sent/received by Ethers.js by enabling debug logging, see e.g. here: Info from Glif:
|
Description
We need to optimize the smart contract state query to make the RPC API requests cache-able by Glif. Currently, our implementation is causing excessive RPC calls which is significantly increasing our Glif bill.
Background
This issue was identified in PR #117 where we're adding ethers.js as a dependency to address miners not having their scores recorded. While implementing this solution, we discovered that our current approach to state queries is not optimal for cacheability.
Proposed Solution
rpc
helper inlib/miner-info.js
to make RPC API calls directlyImplementation Notes
rpc
helper for MinerInfo state queriesRelated PR
Originally posted by @bajtos in feat: peer id smart contract support #117 (comment)
The text was updated successfully, but these errors were encountered: