Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Dispute distribution implementation #3282

Merged
merged 67 commits into from
Jul 9, 2021
Merged

Conversation

eskimor
Copy link
Member

@eskimor eskimor commented Jun 17, 2021

This PR implements the dispute distribution as described in the guide it also integrates dispute distribution with other subsystems.

In particular:

  • Implement dispute distribution
  • Lets the RuntimeInfo work with a subsystem sender only, instead of a full SubsystemContext.
  • Make dispute participation report back on the availability of the candidate
  • Make dispute coordinator report back on the validity of an import (spam protection)
  • Some general cleanup/code de-duplication
  • Make request/response API more expressive

Todos:

  • Sending side
  • Handle node restarts
  • Receiver
  • Tests
  • Metrics
  • Communication coordinator <-> distribution is bidirectional: Double check for potential dead locks.
  • Cleanup imports

Vote recovery will be a second PR, disputes should already be fully functional without it, see paritytech/polkadot-sdk#965

Closes #3163 .
Closes #3399 .

@github-actions github-actions bot added the A3-in_progress Pull request is in progress. No review needed at this stage. label Jun 17, 2021
eskimor added 3 commits June 17, 2021 15:20
- Cleanup dead disputes
- Update sends for new sessions
- Retry on errors
@rphmeier
Copy link
Contributor

Vote recovery will be a second PR, disputes should already be fully functional without it.

Please file an issue! And yes, agreed. Best to split

@eskimor
Copy link
Member Author

eskimor commented Jun 20, 2021 via email



/// Get mock keystore with `Ferdie` key.
pub fn make_ferdie_keystore() -> SyncCryptoStorePtr {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

&mut self,
ctx: &mut Context,
sender: &mut Sender,
Copy link
Contributor

Choose a reason for hiding this comment

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

Glad to see this change.

/// This is, we either discarded the votes, just record them because we
/// casted our vote already or recovered availability for the candidate
/// successfully.
pending_confirmation: oneshot::Sender<ImportStatementsResult>
Copy link
Contributor

Choose a reason for hiding this comment

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

The dispute coordinator accepts all statements on all candidates, even undisputed ones. I implemented this in #3348. So there is some middle ground between "once we've cast our vote or recovered availability".

Copy link
Member Author

@eskimor eskimor Jul 8, 2021

Choose a reason for hiding this comment

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

Not 100% sure what you mean, but I clarified the comment a bit. Hopefully it makes sense - it is quite late over here already.

@eskimor eskimor dismissed drahnr’s stale review July 9, 2021 02:26

Seems to be stale. All remarks have been addressed.

@eskimor eskimor merged commit f9d71f8 into master Jul 9, 2021
@eskimor eskimor deleted the rk-dispute-distribution-impl branch July 9, 2021 02:29
Copy link
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

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

Post merge review - LGTM 👍 a few tiny nits

eskimor added a commit that referenced this pull request Aug 4, 2021
Incorporating post merge review remarks.
eskimor added a commit that referenced this pull request Aug 6, 2021
Incorporating post merge review remarks.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recover availability in dispute coordinator for spam detection Implement Dispute Participation Subsystem
5 participants