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

backing: improve session buffering for runtime information #3421

Closed
alindima opened this issue Feb 21, 2024 · 0 comments · Fixed by #6284
Closed

backing: improve session buffering for runtime information #3421

alindima opened this issue Feb 21, 2024 · 0 comments · Fixed by #6284
Assignees
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. T0-node This PR/Issue is related to the topic “node”. T4-runtime_API This PR/Issue is related to runtime APIs. T8-polkadot This PR/Issue is related to/affects the Polkadot network.

Comments

@alindima
Copy link
Contributor

See #3229 (comment)

@alindima alindima added T0-node This PR/Issue is related to the topic “node”. T8-polkadot This PR/Issue is related to/affects the Polkadot network. I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. labels Feb 21, 2024
@sw10pa sw10pa linked a pull request Oct 30, 2024 that will close this issue
8 tasks
@sw10pa sw10pa added T4-runtime_API This PR/Issue is related to runtime APIs. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Oct 30, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 13, 2024
## Issue
[[#3421] backing: improve session buffering for runtime
information](#3421)

## Description
In the current implementation of the backing module, certain pieces of
information, which remain unchanged throughout a session, are fetched
multiple times via runtime API calls. The goal of this task was to
introduce a local cache to store such session-stable information and
perform the runtime API call only once per session.

This PR implements caching specifically for the validators list, node
features, executor parameters, minimum backing votes threshold, and
validator-to-group mapping, which were previously fetched from the
runtime or computed each time `PerRelayParentState` was built. Now, this
information is cached and reused within the session.

## TODO
* [X] Create a separate struct for per-session caches;
* [X] Cache validators list;
* [X] Cache node features;
* [X] Cache executor parameters;
* [X] Cache minimum backing votes threshold;
* [X] Cache validator-to-group mapping;
* [X] Update tests to reflect these changes;
* [X] Add prdoc.

## For the next PR
Cache validator groups and any other session-stable data (if present).
@github-project-automation github-project-automation bot moved this from In Progress to Completed in parachains team board Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. T0-node This PR/Issue is related to the topic “node”. T4-runtime_API This PR/Issue is related to runtime APIs. T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

2 participants