Skip to content
Snippets Groups Projects
  • Stephane Gurgenidze's avatar
    backing: improve session buffering for runtime information (#6284) · e617d1d0
    Stephane Gurgenidze authored
    ## Issue
    [[#3421] backing: improve session buffering for runtime
    information](https://github.com/paritytech/polkadot-sdk/issues/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).
    Unverified
    e617d1d0
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
pr_6284.prdoc 746 B