From f030508920ca348510802655c838acb4d4b25bba Mon Sep 17 00:00:00 2001 From: eskimor Date: Tue, 22 Nov 2022 12:13:45 +0100 Subject: [PATCH 1/6] Update disputes subsytems section. --- .../src/node/disputes/README.md | 53 ++++++------------- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/roadmap/implementers-guide/src/node/disputes/README.md b/roadmap/implementers-guide/src/node/disputes/README.md index 2db891aa216f..13ec06b32957 100644 --- a/roadmap/implementers-guide/src/node/disputes/README.md +++ b/roadmap/implementers-guide/src/node/disputes/README.md @@ -1,40 +1,17 @@ # Disputes Subsystems -This section is for the node-side subsystems that lead to participation in disputes. There are five major roles that validator nodes must participate in when it comes to disputes - * Detection. Detect bad parablocks, either during candidate backing or approval checking, and initiate a dispute. - * Participation. Participate in active disputes. When a node becomes aware of a dispute, it should recover the data for the disputed block, check the validity of the parablock, and issue a statement regarding the validity of the parablock. - * Distribution. Validators should notify each other of active disputes and relevant statements over the network. - * Submission. When authoring a block, a validator should inspect the state of the parent block and provide any information about disputes that the chain needs as part of the `ParaInherent`. This should initialize new disputes on-chain as necessary. - * Fork-choice and Finality. When observing a block issuing a `DisputeRollback` digest in the header, that branch of the relay chain should be abandoned all the way back to the indicated block. When voting on chains in GRANDPA, no chains that contain blocks with active disputes or disputes that concluded invalid should be voted on. - -## Components - -### Dispute Coordinator - -This component is responsible for coordinating other subsystems around disputes. - -This component should track all statements received from all validators over some window of sessions. This includes backing statements, approval votes, and statements made specifically for disputes. This will be used to identify disagreements or instances where validators conflict with themselves. - -This is responsible for tracking and initiating disputes. Disputes will be initiated either externally by another subsystem which has identified an issue with a parablock or internally upon observing two statements which conflict with each other on the validity of a parablock. - -No more than one statement by each validator on each side of the dispute needs to be stored. That is, validators are allowed to participate on both sides of the dispute, although we won't write code to do so. Such behavior has negative extractable value in the runtime. - -This will notify the dispute participation subsystem of a new dispute if the local validator has not issued any statements on the disputed candidate already. - -Locally authored statements related to disputes will be forwarded to the dispute distribution subsystem. - -This subsystem also provides two further behaviors for the interactions between disputes and fork-choice - - Enhancing the finality voting rule. Given description of a chain and candidates included at different heights in that chain, it returns the `BlockHash` corresponding to the highest `BlockNumber` that there are no disputes before. I expect that we will slightly change `ApprovalVoting::ApprovedAncestor` to return this set and then the target block to vote on will be further constrained by this function. - - Chain roll-backs. Whenever importing new blocks, the header should be scanned for a roll-back digest. If there is one, the chain should be rolled back according to the digest. I expect this would be implemented with a `ChainApi` function and possibly an `ApprovalVoting` function to clean up the approval voting DB. - -### Dispute Participation - -This subsystem ties together the dispute tracker, availability recovery, candidate validation, and dispute distribution subsystems. When notified of a new dispute by the Dispute Tracker, the data should be recovered, the validation code loaded from the relay chain, and the candidate is executed. - -A statement depending on the outcome of the execution is produced, signed, and imported to the dispute tracker. - -### Dispute Distribution - -This is a networking component by which validators notify each other of live disputes and statements on those disputes. - -Validators will in the future distribute votes to each other via the network, but at the moment learn of disputes just from watching the chain. +If approval voting finds an invalid candidate, a dispute is raised. The disputes +subsystems make that possible: + +1. Disputes can be raised +2. Disputes (votes) get propagated to all other validators +3. Votes get recorded as necessary +3. Nodes will participate in disputes in a sensible fashion +4. Finality is halted if a candidate on the chain is disputed +5. Chains can be reverted in case a dispute concluded invalid +6. Votes are provided to the provisioner so losing validators can be slashed on chain + +The dispute-coordinator subsystem interfaces with the provisioner and chain +selection to make the bulk of this possible. dispute-distribution is concerned +with getting votes out to other validators and receiving them in a spam +resilient way. From bf60712515e3b1ecd7b005033e40f16eea1e3dad Mon Sep 17 00:00:00 2001 From: eskimor Date: Tue, 22 Nov 2022 14:40:54 +0100 Subject: [PATCH 2/6] Update roadmap/implementers-guide/src/node/disputes/README.md Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com> --- roadmap/implementers-guide/src/node/disputes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roadmap/implementers-guide/src/node/disputes/README.md b/roadmap/implementers-guide/src/node/disputes/README.md index 13ec06b32957..2beb1dbe438c 100644 --- a/roadmap/implementers-guide/src/node/disputes/README.md +++ b/roadmap/implementers-guide/src/node/disputes/README.md @@ -12,6 +12,6 @@ subsystems make that possible: 6. Votes are provided to the provisioner so losing validators can be slashed on chain The dispute-coordinator subsystem interfaces with the provisioner and chain -selection to make the bulk of this possible. dispute-distribution is concerned +selection to make the bulk of this possible. `dispute-distribution` is concerned with getting votes out to other validators and receiving them in a spam resilient way. From 9c7701072959a2d24c446a12b5a2116e0f32a3a7 Mon Sep 17 00:00:00 2001 From: eskimor Date: Tue, 22 Nov 2022 14:41:16 +0100 Subject: [PATCH 3/6] Update roadmap/implementers-guide/src/node/disputes/README.md Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com> --- roadmap/implementers-guide/src/node/disputes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roadmap/implementers-guide/src/node/disputes/README.md b/roadmap/implementers-guide/src/node/disputes/README.md index 2beb1dbe438c..0f04b2428cd5 100644 --- a/roadmap/implementers-guide/src/node/disputes/README.md +++ b/roadmap/implementers-guide/src/node/disputes/README.md @@ -1,7 +1,7 @@ # Disputes Subsystems If approval voting finds an invalid candidate, a dispute is raised. The disputes -subsystems make that possible: +subsystems are concerned with the following: 1. Disputes can be raised 2. Disputes (votes) get propagated to all other validators From 180c73dbcbb1e3b5b6f3958a1ae0538594b7934d Mon Sep 17 00:00:00 2001 From: eskimor Date: Tue, 22 Nov 2022 14:41:30 +0100 Subject: [PATCH 4/6] Update roadmap/implementers-guide/src/node/disputes/README.md Co-authored-by: ordian --- roadmap/implementers-guide/src/node/disputes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roadmap/implementers-guide/src/node/disputes/README.md b/roadmap/implementers-guide/src/node/disputes/README.md index 0f04b2428cd5..8a89cb4cb5d4 100644 --- a/roadmap/implementers-guide/src/node/disputes/README.md +++ b/roadmap/implementers-guide/src/node/disputes/README.md @@ -7,7 +7,7 @@ subsystems are concerned with the following: 2. Disputes (votes) get propagated to all other validators 3. Votes get recorded as necessary 3. Nodes will participate in disputes in a sensible fashion -4. Finality is halted if a candidate on the chain is disputed +4. Finality is stopped while a candidate is being disputed on chain 5. Chains can be reverted in case a dispute concluded invalid 6. Votes are provided to the provisioner so losing validators can be slashed on chain From 99fe132c38e380e65628c5b9671758a931477ab7 Mon Sep 17 00:00:00 2001 From: eskimor Date: Tue, 22 Nov 2022 14:41:40 +0100 Subject: [PATCH 5/6] Update roadmap/implementers-guide/src/node/disputes/README.md Co-authored-by: ordian --- roadmap/implementers-guide/src/node/disputes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roadmap/implementers-guide/src/node/disputes/README.md b/roadmap/implementers-guide/src/node/disputes/README.md index 8a89cb4cb5d4..e3c72f18f381 100644 --- a/roadmap/implementers-guide/src/node/disputes/README.md +++ b/roadmap/implementers-guide/src/node/disputes/README.md @@ -8,7 +8,7 @@ subsystems are concerned with the following: 3. Votes get recorded as necessary 3. Nodes will participate in disputes in a sensible fashion 4. Finality is stopped while a candidate is being disputed on chain -5. Chains can be reverted in case a dispute concluded invalid +5. Chains can be reverted in case a dispute concludes invalid 6. Votes are provided to the provisioner so losing validators can be slashed on chain The dispute-coordinator subsystem interfaces with the provisioner and chain From 2d650e156e97c8ad4a358164b7048b07d55dca3d Mon Sep 17 00:00:00 2001 From: eskimor Date: Tue, 22 Nov 2022 14:45:45 +0100 Subject: [PATCH 6/6] Review feedback. --- roadmap/implementers-guide/src/node/disputes/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roadmap/implementers-guide/src/node/disputes/README.md b/roadmap/implementers-guide/src/node/disputes/README.md index e3c72f18f381..a6e126b1534b 100644 --- a/roadmap/implementers-guide/src/node/disputes/README.md +++ b/roadmap/implementers-guide/src/node/disputes/README.md @@ -9,7 +9,8 @@ subsystems are concerned with the following: 3. Nodes will participate in disputes in a sensible fashion 4. Finality is stopped while a candidate is being disputed on chain 5. Chains can be reverted in case a dispute concludes invalid -6. Votes are provided to the provisioner so losing validators can be slashed on chain +6. Votes are provided to the provisioner for importing on chain, in order for + slashing to work. The dispute-coordinator subsystem interfaces with the provisioner and chain selection to make the bulk of this possible. `dispute-distribution` is concerned