-
Notifications
You must be signed in to change notification settings - Fork 292
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
dev: add LRU cache layer to block fetching client-side #947
Comments
As @tdelabro pointed me to this issue I can try to work on this for our RPC layer. Would be glad to try out performance testing as well. |
Yes sure. Try to draw inspiration from the frontier impl: https://github.com/paritytech/frontier |
Hey ! Sorry for not giving news before today, was taken out by a bad cold. I have been wondering about a detail in the cache implementation which I think is still important to determine. In frontier implementation we can see that they have a However, this implementation has one flaw I think, it only looks at stored values size and not at the allocated size (e.g.: for a value
Eager to get your take on that 🙌 |
I think in the first time you can go with the easier one. |
This commit introduces a base LRU cache that will be used for the RPC layer. It is inspired by frontier's code base: https://github.com/paritytech/frontier/blob/194f6bb06152402ba44b340c3d401ae6e0670d96/client/rpc/src/eth/cache/mod.rs#L76 Extending it, our approach proposes two types of limiter: - Values size limiter: A limiter that will base its cache management on the total size of all values stored in the cache - Allocated size limiter: A limiter that will base its cache management on the allocated memory for the cache This allows for either an approximate or a precise memory management, which could prove useful in our P2P context.
We added a StorageValue for blocks in the pallet_starknet, allowing us to retrieve block data through storage.
We chose to keep memory management by allocated memory as this allows for a more precise control.
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. |
@tchataigner has been working on l1-l2 messaging recently. |
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. |
This code was taken from frontier and is extensively used on their RPC layer. We should investigate adding this on our side and evaluate the performance gain using https://github.com/keep-starknet-strange/gomu-gomu-no-gatling
The text was updated successfully, but these errors were encountered: