Approval voting overlay db (#3366)
* node/approval-voting: Introduce Backend trait and Overlaybackend This commit introduces a Backend trait and attempts to move away from the Action model via an OverlayBackend as in the ChainSelection subsystem. * node/approval-voting: Add WriteOps for StoredBlockRange and BlocksAtHeight * node/approval-voting: Add load_all_blocks to overlay * node/approval-voting: Get all module tests to pass. This commit modifies all tests to ensure tests are passing. * node/approval-voting: Address oversights in the previous commit This commit addresses some oversights in the prior commit. 1. Inner errors in backend.write were swallowed 2. One-off write functions removed to avoid useless abstraction 3. Touch-ups in general * node/approval-voting: Move from TestDB to dyn KeyValueDB This commit removes the TestDB from tests.rs and replaces it with an in-memory kvdb. * node/approval-voting: Address feedback * node/approval-voting: Add license to ops.rs * node/approval-voting: Address second-pass feedback * Add TODO * node/approval-voting: Bump spec_version * node/approval-voting: Address final comments.
Showing
- polkadot/node/core/approval-voting/src/approval_db/v1/mod.rs 174 additions, 432 deletionspolkadot/node/core/approval-voting/src/approval_db/v1/mod.rs
- polkadot/node/core/approval-voting/src/approval_db/v1/tests.rs 164 additions, 170 deletions...dot/node/core/approval-voting/src/approval_db/v1/tests.rs
- polkadot/node/core/approval-voting/src/backend.rs 194 additions, 0 deletionspolkadot/node/core/approval-voting/src/backend.rs
- polkadot/node/core/approval-voting/src/import.rs 41 additions, 70 deletionspolkadot/node/core/approval-voting/src/import.rs
- polkadot/node/core/approval-voting/src/lib.rs 75 additions, 141 deletionspolkadot/node/core/approval-voting/src/lib.rs
- polkadot/node/core/approval-voting/src/ops.rs 334 additions, 0 deletionspolkadot/node/core/approval-voting/src/ops.rs
- polkadot/node/core/approval-voting/src/persisted_entries.rs 19 additions, 6 deletionspolkadot/node/core/approval-voting/src/persisted_entries.rs
- polkadot/node/core/approval-voting/src/tests.rs 432 additions, 317 deletionspolkadot/node/core/approval-voting/src/tests.rs
- polkadot/node/subsystem/src/lib.rs 3 additions, 0 deletionspolkadot/node/subsystem/src/lib.rs
- polkadot/runtime/kusama/src/lib.rs 1 addition, 1 deletionpolkadot/runtime/kusama/src/lib.rs
- polkadot/runtime/polkadot/src/lib.rs 1 addition, 1 deletionpolkadot/runtime/polkadot/src/lib.rs
- polkadot/runtime/westend/src/lib.rs 1 addition, 1 deletionpolkadot/runtime/westend/src/lib.rs
Please register or sign in to comment