Skip to content
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

Cache results of RPC requests #1820

Closed
svyatonik opened this issue Jan 25, 2023 · 1 comment
Closed

Cache results of RPC requests #1820

svyatonik opened this issue Jan 25, 2023 · 1 comment
Assignees
Labels

Comments

@svyatonik
Copy link
Contributor

Looking at the logs of RBH<>WBH complex relay (4 nodes connected, 4 messages race relays, 2 on-demand header relays, 2 on-demand parachain relays, version guards, metrics), we're doing ~30 RPC requests per second. We don't care much about relay performance, but it looks too much :) Most of requests are method=chain_getBlockHash and method=chain_getHeader. That's because every relay (and we have 8 relays running) are polling nodes for new headers. We may have some cache for these results.

Ideally we'll need to traitify the whole Substrate Client. This would give us possibility to use it in tests => allow to test client-specific code. And when we talk about this issue, we may have some CachedClient that nests the regular Client and maintains some results cache for some (or all) calls.

@svyatonik
Copy link
Contributor Author

fixed by #2129 and several follow up PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants