Skip to content

Commit

Permalink
statement-distribution: validator disabling (#1841)
Browse files Browse the repository at this point in the history
Closes #1591.

The purpose of this PR is filter out backing statements from the network
signed by disabled validators. This is just an optimization, since we
will do filtering in the runtime in #1863 to avoid nodes to filter
garbage out at block production time.

- [x] Ensure it's ok to fiddle with the mask of manifests
- [x] Write more unit tests
- [x] Test locally
- [x] simple zombienet test
- [x] PRDoc

---------

Co-authored-by: Tsvetomir Dimitrov <[email protected]>
  • Loading branch information
ordian and tdimitrov authored Jan 10, 2024
1 parent 01ea45c commit a419532
Show file tree
Hide file tree
Showing 14 changed files with 1,407 additions and 663 deletions.
8 changes: 8 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ zombienet-polkadot-functional-0009-approval-voting-coalescing:
--local-dir="${LOCAL_DIR}/functional"
--test="0009-approval-voting-coalescing.zndsl"

zombienet-polkadot-functional-0010-validator-disabling:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0010-validator-disabling.zndsl"

zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
- .zombienet-polkadot-common
Expand Down
3 changes: 3 additions & 0 deletions polkadot/node/network/statement-distribution/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ pub enum Error {
#[error("Fetching availability cores failed {0:?}")]
FetchAvailabilityCores(RuntimeApiError),

#[error("Fetching disabled validators failed {0:?}")]
FetchDisabledValidators(runtime::Error),

#[error("Fetching validator groups failed {0:?}")]
FetchValidatorGroups(RuntimeApiError),

Expand Down
4 changes: 3 additions & 1 deletion polkadot/node/network/statement-distribution/src/v2/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ impl GridTracker {
/// This checks whether the peer is allowed to send us manifests
/// about this group at this relay-parent. This also does sanity
/// checks on the format of the manifest and the amount of votes
/// it contains. It has effects on the stored state only when successful.
/// it contains. It assumes that the votes from disabled validators
/// are already filtered out.
/// It has effects on the stored state only when successful.
///
/// This returns a `bool` on success, which if true indicates that an acknowledgement is
/// to be sent in response to the received manifest. This only occurs when the
Expand Down
Loading

0 comments on commit a419532

Please sign in to comment.