Runtime: allow backing multiple candidates of same parachain on different cores (#3231)
Fixes https://github.com/paritytech/polkadot-sdk/issues/3144 Builds on top of https://github.com/paritytech/polkadot-sdk/pull/3229 ### Summary Some preparations for Runtime to support elastic scaling, guarded by config node features bit `FeatureIndex::ElasticScalingMVP`. This PR introduces a per-candidate `CoreIndex` but does it in a hacky way to avoid changing `CandidateCommitments`, `CandidateReceipts` primitives and networking protocols. #### Including `CoreIndex` in `BackedCandidate` If the `ElasticScalingMVP` feature bit is enabled then `BackedCandidate::validator_indices` is extended by 8 bits. The value stored in these bits represents the assumed core index for the candidate. It is temporary solution which works by creating a mapping from `BackedCandidate` to `CoreIndex` by assuming the `CoreIndex` can be discovered by checking in which validator group the validator that signed the statement is. TODO: - [x] fix tests - [x] add new tests - [x] Bump runtime API for Kusama, so we have that node features thing! -> https://github.com/polkadot-fellows/runtimes/pull/194 --------- Signed-off-by:Andrei Sandu <andrei-mihail@parity.io> Signed-off-by:
alindima <alin@parity.io> Co-authored-by:
alindima <alin@parity.io>
parent
6fc1d41d
Showing
- .gitlab/pipeline/zombienet/polkadot.yml 8 additions, 0 deletions.gitlab/pipeline/zombienet/polkadot.yml
- Cargo.lock 37 additions, 0 deletionsCargo.lock
- polkadot/node/core/backing/Cargo.toml 1 addition, 0 deletionspolkadot/node/core/backing/Cargo.toml
- polkadot/node/core/backing/src/lib.rs 7 additions, 12 deletionspolkadot/node/core/backing/src/lib.rs
- polkadot/node/core/backing/src/tests/mod.rs 56 additions, 14 deletionspolkadot/node/core/backing/src/tests/mod.rs
- polkadot/node/core/provisioner/src/lib.rs 1 addition, 1 deletionpolkadot/node/core/provisioner/src/lib.rs
- polkadot/node/core/provisioner/src/tests.rs 41 additions, 29 deletionspolkadot/node/core/provisioner/src/tests.rs
- polkadot/primitives/src/v6/mod.rs 188 additions, 20 deletionspolkadot/primitives/src/v6/mod.rs
- polkadot/runtime/parachains/Cargo.toml 1 addition, 0 deletionspolkadot/runtime/parachains/Cargo.toml
- polkadot/runtime/parachains/src/builder.rs 4 additions, 3 deletionspolkadot/runtime/parachains/src/builder.rs
- polkadot/runtime/parachains/src/inclusion/mod.rs 50 additions, 41 deletionspolkadot/runtime/parachains/src/inclusion/mod.rs
- polkadot/runtime/parachains/src/inclusion/tests.rs 341 additions, 82 deletionspolkadot/runtime/parachains/src/inclusion/tests.rs
- polkadot/runtime/parachains/src/paras_inherent/benchmarking.rs 2 additions, 2 deletions...dot/runtime/parachains/src/paras_inherent/benchmarking.rs
- polkadot/runtime/parachains/src/paras_inherent/mod.rs 213 additions, 75 deletionspolkadot/runtime/parachains/src/paras_inherent/mod.rs
- polkadot/runtime/parachains/src/paras_inherent/tests.rs 537 additions, 67 deletionspolkadot/runtime/parachains/src/paras_inherent/tests.rs
- polkadot/runtime/parachains/src/paras_inherent/weights.rs 2 additions, 2 deletionspolkadot/runtime/parachains/src/paras_inherent/weights.rs
- polkadot/zombienet_tests/functional/0012-elastic-scaling-mvp.toml 38 additions, 0 deletions.../zombienet_tests/functional/0012-elastic-scaling-mvp.toml
- polkadot/zombienet_tests/functional/0012-elastic-scaling-mvp.zndsl 28 additions, 0 deletions...zombienet_tests/functional/0012-elastic-scaling-mvp.zndsl
- polkadot/zombienet_tests/functional/0012-enable-node-feature.js 37 additions, 0 deletions...ot/zombienet_tests/functional/0012-enable-node-feature.js
- polkadot/zombienet_tests/functional/0012-register-para.js 37 additions, 0 deletionspolkadot/zombienet_tests/functional/0012-register-para.js
Please register or sign in to comment