Skip to content

Commit

Permalink
Elastic scaling: use an assumed CoreIndex in candidate-backing (#…
Browse files Browse the repository at this point in the history
…3229)

First step in implementing
#3144

### Summary of changes
- switch statement `Table` candidate mapping from `ParaId` to
`CoreIndex`
- introduce experimental `InjectCoreIndex`  node feature.
- determine and assume a `CoreIndex` for a candidate based on statement
validator index. If the signature is valid it means validator controls
the validator that index and we can easily map it to a validator
group/core.
- introduce a temporary provisioner fix until we fully enable elastic
scaling in the subystem. The fix ensures we don't fetch the same
backable candidate when calling `get_backable_candidate` for each core.

TODO:
- [x] fix backing tests
- [x] fix statement table tests
- [x] add new test

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: alindima <alin@parity.io>
Co-authored-by: alindima <alin@parity.io>
  • Loading branch information
2 people authored and eskimor committed Feb 26, 2024
1 parent 9b6d331 commit 27c3315
Show file tree
Hide file tree
Showing 13 changed files with 462 additions and 96 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions polkadot/node/core/backing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
gum = { package = "tracing-gum", path = "../../gum" }
thiserror = { workspace = true }
fatality = "0.0.6"
schnellru = "0.2.1"

[dev-dependencies]
sp-core = { path = "../../../../substrate/primitives/core" }
Expand Down
3 changes: 3 additions & 0 deletions polkadot/node/core/backing/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pub enum Error {
#[error("Candidate is not found")]
CandidateNotFound,

#[error("CoreIndex cannot be determined for a candidate")]
CoreIndexUnavailable,

#[error("Signature is invalid")]
InvalidSignature,

Expand Down
Loading

0 comments on commit 27c3315

Please sign in to comment.