Skip to content

Commit e617d1d

Browse files
authored
backing: improve session buffering for runtime information (#6284)
## 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).
1 parent a84f259 commit e617d1d

5 files changed

Lines changed: 405 additions & 221 deletions

File tree

polkadot/node/core/backing/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ pub enum Error {
105105

106106
#[error("Availability store error")]
107107
StoreAvailableData(#[source] StoreAvailableDataError),
108+
109+
#[error("Runtime API returned None for executor params")]
110+
MissingExecutorParams,
108111
}
109112

110113
/// Utility for eating top level errors and log them.

0 commit comments

Comments
 (0)