Replace `RollingSessionWindow` in approval-voting with `RuntimeInfo` (#7123)
* Replace `RollingSessionWindow` with `RuntimeInfo` - initial commit * Fix tests in import * Fix the rest of the tests * Remove dead code * Fix todos * Simplify session caching * Comments for `SessionInfoProvider` * Separate `SessionInfoProvider` from `State` * `cache_session_info_for_head` becomes freestanding function * Remove unneeded `mut` usage * fn session_info -> fn get_session_info() to avoid name clashes. The function also tries to initialize `SessionInfoProvider` * Fix SessionInfo retrieval * Code cleanup * Don't wrap `SessionInfoProvider` in an `Option` * Remove `earliest_session()` * Remove pre-caching -> wip * Fix some tests and code cleanup * Fix all tests * Fixes in tests * Fix comments, variable names and small style changes * Fix a warning * impl From<SessionWindowSize> for NonZeroUsize * Fix logging for `get_session_info` - remove redundant logs and decrease log level to DEBUG * Code review feedback
parent
3b91d778
Showing
- polkadot/node/core/approval-voting/src/import.rs 137 additions, 97 deletionspolkadot/node/core/approval-voting/src/import.rs
- polkadot/node/core/approval-voting/src/lib.rs 182 additions, 116 deletionspolkadot/node/core/approval-voting/src/lib.rs
- polkadot/node/core/approval-voting/src/tests.rs 17 additions, 60 deletionspolkadot/node/core/approval-voting/src/tests.rs
- polkadot/node/primitives/src/lib.rs 7 additions, 1 deletionpolkadot/node/primitives/src/lib.rs
Please register or sign in to comment