mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
Dispute distribution implementation (#3282)
* Dispute protocol. * Dispute distribution protocol. * Get network requests routed. * WIP: Basic dispute sender logic. * Basic validator determination logic. * WIP: Getting things to typecheck. * Slightly larger timeout. * More typechecking stuff. * Cleanup. * Finished most of the sending logic. * Handle active leaves updates - Cleanup dead disputes - Update sends for new sessions - Retry on errors * Pass sessions in already. * Startup dispute sending. * Provide incoming decoding facilities and use them in statement-distribution. * Relaxed runtime util requirements. We only need a `SubsystemSender` not a full `SubsystemContext`. * Better usability of incoming requests. Make it possible to consume stuff without clones. * Add basic receiver functionality. * Cleanup + fixes for sender. * One more sender fix. * Start receiver. * Make sure to send responses back. * WIP: Exposed authority discovery * Make tests pass. * Fully featured receiver. * Decrease cost of `NotAValidator`. * Make `RuntimeInfo` LRU cache size configurable. * Cache more sessions. * Fix collator protocol. * Disable metrics for now. * Make dispute-distribution a proper subsystem. * Fix naming. * Code style fixes. * Factored out 4x copied mock function. * WIP: Tests. * Whitespace cleanup. * Accessor functions. * More testing. * More Debug instances. * Fix busy loop. * Working tests. * More tests. * Cleanup. * Fix build. * Basic receiving test. * Non validator message gets dropped. * More receiving tests. * Test nested and subsequent imports. * Fix spaces. * Better formatted imports. * Import cleanup. * Metrics. * Message -> MuxedMessage * Message -> MuxedMessage * More review remarks. * Add missing metrics.rs. * Fix flaky test. * Dispute coordinator - deliver confirmations. * Send out `DisputeMessage` on issue local statement. * Unwire dispute distribution. * Review remarks. * Review remarks. * Better docs.
This commit is contained in:
@@ -20,7 +20,7 @@ use parity_scale_codec::{Decode, Encode};
|
||||
|
||||
use polkadot_primitives::v1::{CandidateHash, CandidateReceipt, CommittedCandidateReceipt, Hash, ValidatorIndex};
|
||||
use polkadot_primitives::v1::Id as ParaId;
|
||||
use polkadot_node_primitives::{AvailableData, PoV, ErasureChunk};
|
||||
use polkadot_node_primitives::{AvailableData, DisputeMessage, ErasureChunk, PoV, UncheckedDisputeMessage};
|
||||
|
||||
use super::request::IsRequest;
|
||||
use super::Protocol;
|
||||
@@ -192,3 +192,28 @@ impl IsRequest for StatementFetchingRequest {
|
||||
type Response = StatementFetchingResponse;
|
||||
const PROTOCOL: Protocol = Protocol::StatementFetching;
|
||||
}
|
||||
|
||||
/// A dispute request.
|
||||
///
|
||||
/// Contains an invalid vote a valid one for a particular candidate in a given session.
|
||||
#[derive(Clone, Encode, Decode, Debug)]
|
||||
pub struct DisputeRequest(pub UncheckedDisputeMessage);
|
||||
|
||||
impl From<DisputeMessage> for DisputeRequest {
|
||||
fn from(msg: DisputeMessage) -> Self {
|
||||
Self(msg.into())
|
||||
}
|
||||
}
|
||||
|
||||
/// Possible responses to a `DisputeRequest`.
|
||||
#[derive(Encode, Decode, Debug, PartialEq, Eq)]
|
||||
pub enum DisputeResponse {
|
||||
/// Recipient successfully processed the dispute request.
|
||||
#[codec(index = 0)]
|
||||
Confirmed
|
||||
}
|
||||
|
||||
impl IsRequest for DisputeRequest {
|
||||
type Response = DisputeResponse;
|
||||
const PROTOCOL: Protocol = Protocol::DisputeSending;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user