Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter votes from disabled validators in BackedCandidates in process_inherent_data #1863

Merged
merged 43 commits into from
Nov 30, 2023

Conversation

tdimitrov
Copy link
Contributor

@tdimitrov tdimitrov commented Oct 12, 2023

Fixes #1592

Please refer to the issue for details.


// Filters statements from disabled validators in `BackedCandidate` and `MultiDisputeStatementSet`.
// Returns `true` if at least one statement is removed and `false` otherwise.
fn filter_backed_statements<T: Config>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ordian can you have a look at this? Does the index arithmetic here make sense?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just merged #1257 that has a disabled_validators implementation, which could be extracted into a common module. There's a small caveat though, it doesn't work at session boundaries. But maybe that's not really an issue since availability cores are cleared out on session boundaries anyway.

Copy link
Contributor Author

@tdimitrov tdimitrov Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved your implementation in pallet_shared so that we can call it from the api impl and paras_inherent. Quite a lot of boilerplate code for such small change but it is what it is :)

If you have got an idea for a better place - please share.

@@ -480,6 +487,7 @@ impl<T: Config> Pallet<T> {
}

ensure!(all_weight_before.all_lte(max_block_weight), Error::<T>::InherentOverweight);
ensure!(!statements_were_dropped, Error::<T>::InherentOverweight);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to reject blocks where at least one statement is dropped? what do we do with disputes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afair the else statement is executed during block execution only (right?) and this is a sanity check that we are not importing votes from disabled validators. We discussed this here.

@tdimitrov tdimitrov changed the base branch from master to tsv-disabling October 16, 2023 11:37
@tdimitrov tdimitrov added the A0-needs_burnin Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix label Oct 16, 2023
@tdimitrov tdimitrov mentioned this pull request Oct 20, 2023
4 tasks
@tdimitrov tdimitrov marked this pull request as ready for review October 26, 2023 13:56
@tdimitrov tdimitrov requested review from a team October 26, 2023 13:56
@tdimitrov tdimitrov requested a review from athei as a code owner October 26, 2023 13:56
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4532515

@tdimitrov tdimitrov merged commit f2d4c48 into tsv-disabling Nov 30, 2023
119 of 120 checks passed
@tdimitrov tdimitrov deleted the tsv-disabling-runtime branch November 30, 2023 11:16
tdimitrov added a commit that referenced this pull request Jan 9, 2024
…s_inherent_data (#1863)

Fixes #1592

Please refer to the issue for details.

---------

Co-authored-by: ordian <[email protected]>
Co-authored-by: ordian <[email protected]>
Co-authored-by: Maciej <[email protected]>
ordian added a commit that referenced this pull request Jan 10, 2024
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]>
github-merge-queue bot pushed a commit that referenced this pull request Jan 18, 2024
…s_inherent_data (#2889)

Backport of #1863 to
master

Extend candidate sanitation in paras_inherent by removing backing votes
from disabled validators. Check
#1592 for more details.

This change is related to the disabling strategy implementation
(#2226).

---------

Co-authored-by: ordian <[email protected]>
Co-authored-by: ordian <[email protected]>
Co-authored-by: Maciej <[email protected]>
franciscoaguirre pushed a commit to paritytech/xcm that referenced this pull request Jan 25, 2024
…s_inherent_data (#2889)

Backport of paritytech/polkadot-sdk#1863 to
master

Extend candidate sanitation in paras_inherent by removing backing votes
from disabled validators. Check
paritytech/polkadot-sdk#1592 for more details.

This change is related to the disabling strategy implementation
(paritytech/polkadot-sdk#2226).

---------

Co-authored-by: ordian <[email protected]>
Co-authored-by: ordian <[email protected]>
Co-authored-by: Maciej <[email protected]>
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
…s_inherent_data (paritytech#2889)

Backport of paritytech#1863 to
master

Extend candidate sanitation in paras_inherent by removing backing votes
from disabled validators. Check
paritytech#1592 for more details.

This change is related to the disabling strategy implementation
(paritytech#2226).

---------

Co-authored-by: ordian <[email protected]>
Co-authored-by: ordian <[email protected]>
Co-authored-by: Maciej <[email protected]>
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Mar 26, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Mar 27, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* "refund" proof size in GRANDPa pallet

* clippy

* extra_proof_size_bytes_works

* use saturated_into

* fix review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-needs_burnin Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce validator disabling in the runtime
4 participants