-
|
Question for @razgraf @gavriliumircea These e.g. https://github.com/sablier-labs/indexers/tree/main/apps/flow-envio/.cache |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 32 replies
-
|
Yes, they are. That is where we keep the token-details as they get queried. They're supposed to be used between deployments, so the cache has to be persisted (so we don't query for the same token again next time we deploy the indexer). |
Beta Was this translation helpful? Give feedback.
-
|
I'm reopening this discussion because I want to understand what exactly is being optimized for here. Is the goal to reduce RPC calls? Is that why we're keeping this folder in version control? Because if yes, the development overhead of:
Does not seem worth it to me, and I thus suggest getting rid of it (entirely, not just from version control). We're not making indexer deployments that often, and when we do it, we should be able to pull all token details from the RPC URLs. Am I missing something? Besides RPC calls, what does this cache help with, @razgraf? Edit: I looked at the Edit 2: does the fetch occur when running |
Beta Was this translation helpful? Give feedback.
-
|
One more question, @razgraf Does the implementation handle scenarios whereby tokens' metadata change over time? e.g. the token symbol/name changes (because of upgradeability). |
Beta Was this translation helpful? Give feedback.
-
|
Aaand one more :D I guess this RPC overloading issue is why we need to define 5+ RPCs per chain? indexers/packages/constants/src/bundles/definitions.ts Lines 27 to 33 in f23d7f3 |
Beta Was this translation helpful? Give feedback.
-
|
Another question @razgraf It looks like the new Based on my reading of the docs, the way this works is that they 'memoize' the web2 request so that if N events all make the same query for obtaining, say, the ERC-20 metadata for USDC on Arbitrum, that request will be executed only once. More research needed to confirm this but it looks promising! |
Beta Was this translation helpful? Give feedback.
Outside of data we can extract from events, we need access to some other onchain values. An example would be the name and symbol of the ERC-20 token.
To get them, we need to call the contracts and ask. While The Graph has a baked in mechanism to query data mid-handler, Envio doesn't. To cover this need, we implemented a system that queries through RPCs on demand (we came up with this solution together with their team).
→ → →
Now, whenever a deployment happens, events will start getting indexed and hundreds (if not more) of tokens will need their details figured out. With simple on-demand queries this caused: