Improve Fetching of Contract Currency Details
marklandgrebe-cb
released this
29 Oct 20:59
·
4 commits
to master
since this release
What's Changed
Improve Fetching of Contract Currency Details.
Motivation
To improve /block latency. A major bottleneck is that contractCurrencyMap is created fresh for each transaction, so it only caches within a single transaction's logs. That's why we see repeated GetContractCurrency calls for the same contracts across different transactions.
Solution
Add an LRU cache that stores contract currency details across blocks. Also, don't go to the node for allow listed tokens to get symbol and decimals (if env var USE_TOKEN_WHITE_LIST_METADATA="true"), as they can be retrieved from the config.
New Contributors
- @marklandgrebe-cb made their first contribution in #136
Full Changelog: v0.0.18...v0.0.19