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

dispute-coordinator sometimes fails importing dispute votes on startup due to missing CandidateReceipt #7009

Closed
tdimitrov opened this issue Apr 5, 2023 · 0 comments · Fixed by #7013
Assignees
Labels
T5-parachains_protocol This PR/Issue is related to Parachains features and protocol changes.

Comments

@tdimitrov
Copy link
Contributor

While testing disputes on versi I stumbled upon the following error:

Cannot import votes, without `CandidateReceipt` available! session=703 ...

After some debugging I discovered that:

  • The failure happens only when onchain votes are imported. This is logical as it is the only possible case when dispute-coordinator relies on CandidateReceipt being available in the DB.
  • The reason for the failure is that the vote is scraped before (1) it is imported by dispute-distribution and (2) the backing vote is scraped onchain.

The reason for (1) is that dispute-coordinator was still waiting for a leaf and ignored the import from dispute-distribution. This is confirmed by:

TRACE tokio-runtime-worker parachain::dispute-distribution: No batch yet - triggering immediate import candidate_hash=.....
DEBUG tokio-runtime-worker parachain::dispute-distribution: error=ImportCanceled(.....)

The reason for (2) is that backing votes (which provide the CandidateReceipt) are not scraped beyond finality (as pointed by @eskimor).

The remedy is to adjust the oinchain scraper not to prune 10 blocks into finality, but also scrape ten blocks beyond it. This will not fully resolve the issue but will make it almost negligible.

@tdimitrov tdimitrov added the T5-parachains_protocol This PR/Issue is related to Parachains features and protocol changes. label Apr 5, 2023
@tdimitrov tdimitrov self-assigned this Apr 5, 2023
tdimitrov added a commit that referenced this issue Apr 6, 2023
…ED_BLOCKS_COUNT` blocks before finality

The purpose is to make the availability of a `CandidateReceipt` for finalized candidates more likely.

For details see:  #7009
@tdimitrov tdimitrov moved this from Todo to In Progress in Disputes + Slashing + Rewards Apr 6, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Disputes + Slashing + Rewards Apr 7, 2023
paritytech-processbot bot pushed a commit that referenced this issue Apr 7, 2023
…ED_BLOCKS_COUNT` blocks before finality (#7013)

* Onchain scraper in `dispute-coordinator` will scrape `SCRAPED_FINALIZED_BLOCKS_COUNT` blocks before finality

The purpose is to make the availability of a `CandidateReceipt` for finalized candidates more likely.

For details see:  #7009

* Fix off by one error

* Replace `SCRAPED_FINALIZED_BLOCKS_COUNT` with `DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T5-parachains_protocol This PR/Issue is related to Parachains features and protocol changes.
Projects
No open projects
1 participant