You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
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
Use the existing rpc helper in lib/miner-info.js to make RPC API calls directly
Rework smart contract state queries to ask for state as of a given tipset
Implement a lightweight solution to parse binary responses to JavaScript objects
Implementation Notes
We already use the rpc helper for MinerInfo state queries
This approach may be easier than using Ethers.js or viem for this specific use case
The optimization should be implemented soon after the initial version deployment (within days)