-
Notifications
You must be signed in to change notification settings - Fork 1.6k
dispute-coordinator: Cleanup + Bug fixes #5323
Conversation
@@ -118,7 +118,7 @@ impl JfyiError { | |||
pub fn log(self) { | |||
match self { | |||
// don't spam the log with spurious errors | |||
Self::Runtime(_) | Self::Oneshot(_) | Self::DisputeImportOneshotSend => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can warn again, because senders who don't care will pass in None
now for pending_confirmation
@@ -84,14 +76,12 @@ pub struct Initialized { | |||
highest_session: SessionIndex, | |||
spam_slots: SpamSlots, | |||
participation: Participation, | |||
ordering_provider: OrderingProvider, | |||
scraper: ChainScraper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scraper now also takes care of on chain vote scraping.
/// the first place. | ||
#[derive(Copy, Clone)] | ||
#[cfg_attr(test, derive(Debug))] | ||
struct CandidateComparator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got moved here, because scraper no longer cares about the actual comparator. All it does, is provide info on whether a candidate has been included anywhere.
/// | ||
/// Returns: On chain vote for the leaf and any ancestors we might not yet have seen. | ||
#[must_use] | ||
pub async fn process_active_leaves_update<Sender: SubsystemSender>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return value is scraped votes, for further processing.
@@ -376,60 +319,17 @@ impl Initialized { | |||
|
|||
/// Scrapes on-chain votes (backing votes and concluded disputes) for a active leaf of the | |||
/// relay chain. | |||
async fn scrape_on_chain_votes( | |||
async fn process_on_chain_votes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actual scraping is now done by scraper, we only need to process the votes.
.await?; | ||
let is_included = comparator.is_some(); | ||
|
||
let is_included = self.scraper.is_candidate_included(&candidate_receipt.hash()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scraper tells us whether or not a candidate has been seen included.
@@ -927,13 +829,14 @@ impl Initialized { | |||
// Participate in dispute if the imported vote was not local, we did not vote before either | |||
// and we actually have keys to issue a local vote. | |||
if !is_local && !voted_already && is_disputed && !controlled_indices.is_empty() { | |||
let priority = ParticipationPriority::with_priority_if(is_included); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is included - make it priority.
@@ -0,0 +1,300 @@ | |||
// Copyright 2021 Parity Technologies (UK) Ltd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 2022
First batch of dispute-coordinator improvements, mostly cleanup + one bug fix. Signature check from on chain vote import would not actually succeed previously, as the wrong relay parent was used.
Next up: Some more metrics to better understand where time is spent.