-
Notifications
You must be signed in to change notification settings - Fork 690
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
Enforce validator disabling in the runtime #1592
Comments
@eskimor @ordian @Overkillus this is the way I envision the disabling in the runtime. Please share your feedback. |
Yes, but make sure to not include dead weight in the block. This means conceptually on block production you have to filter on block import we have to return an error if data from disabled validators are present. To avoid divergence of code I would suggest to do the same filtering both on import and creation, but check the length in import before and after - if they differ: return an error. This way it should be possible to maintain almost identical code paths (which prevents bugs from them getting out of sync). They would look like this (Rust inspired pseude code): let len_pre_filter = statements.len();
filter_disabled(&mut statements);
let len_after_filter = statements.len();
if importing && len_pre_filter != len_after_filter {
return Error(...)
} |
For using the relay parent of the candidate as basis for disabled state. I know we said to do this to have consistency on the node side. In the runtime this seems annoying though .. .would make more sense to use the current block state here. Might make sense to discuss this one more time. |
Actually did we even say this? What we could do is the following: A node is considered enabled on the node side, if we have at least one leaf in our view where it is enabled. Meaning, if there is at least one leaf where the validator is enabled we will not prematurely drop statements for example. Different story in runtime and provisioner: Here we can (and should) drop statements based on the leaf we are currently operating on. Potential problem: We don't have consensus here: Depending on our view we might filter votes, while other nodes do not. If then later on we learn about a better fork, which does not have the validator disabled then we dropped votes, which we should actually have kept. Possible solution: No premature filtering at all: Subsystems accept votes from disabled notes, then for subsystems which operate with peer views, things stay easy: We only forward messages to nodes that have a leaf in their view where the validator is enabled. For disputes, this does not work .... so I see why we decided on using the relay parent. Thoughts from your end? |
What could work: Indeed no premature/early filtering, but the above and we don't participate in disputes if all negative votes are all from disabled nodes as in our currently active leaves. On leaf updates which cause disabled status by above definition to change to enabled again, we would need to make up for that missed participation. This sounds like it could cause consensus issues, but in fact it should be fine: Once a single not disabled node participated, disabled status does not matter anymore. We don't need perfect consensus here. |
I assume you talk about this filtering. If yes - I don't understand your idea. Why not filter the data just before the weights are calculated and ignore the disabled votes altogether? Maybe it is related to the two code paths of
Afair we didn't agree on anything. I'm proposing this because:
I am more worried about 2. What I mean:
Let's assume we make a decision that in N+1 a dispute has concluded and in N+2 some validartor (which have alreadyu voted) gets disabled. We need to reevaluate the decision about the dispute? Or do something else? Not considering if a validator is disabled in the current leaf has got its drawbacks - potential offenders (or buggy validators) can do wild things in the fork before they get disabled. In the general case it is just one block but in a dispute storm this window might get quite big. |
Yeah, this won't work. EDIT: I wasn't aware that |
…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]>
Based on the new updated validator disabling strategy Just need to merge into feature branch and test holistically. |
…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]>
…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]>
…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]>
…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]>
Desired outcome
With the disabling strategy in place (#784 (comment)) the actual disabling needs to be enforced by the runtime. This means that the runtime should ignore the following data from disabled validators:
polkadot-sdk/polkadot/primitives/src/v5/mod.rs
Line 1426 in 1e2a2f0
polkadot-sdk/polkadot/primitives/src/v5/mod.rs
Line 703 in 1e2a2f0
polkadot-sdk/polkadot/primitives/src/v5/mod.rs
Line 1364 in 1e2a2f0
When a validator is disabled
Each candidate has got a relay parent. If a validator is disabled at this relay parent, we consider the validator disabled in the context of the candidate.
So if a candidate is included at height A and B and validator X is disabled at height A but re-enabled at height B we will ignore its votes in the first case and count them in the latter.
How data filtering will work
All votes/statements will be filtered in
polkadot-sdk/polkadot/runtime/parachains/src/paras_inherent/mod.rs
Line 326 in 1e2a2f0
Related to #784 (comment)
The text was updated successfully, but these errors were encountered: