mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 08:27:55 +00:00
implement dispute participation subsystem (#3234)
* implement dispute participation subsystem * guide: minor fix in dispute participation * Update node/core/dispute-participation/src/lib.rs Co-authored-by: Andronik Ordian <write@reusable.software> * dispute: add comments to participation logic * dispute-coordinator: fix test compilation * implementers-guide: update dispute participation * dispute-participation: add error for missing validation code * dispute-participation: add tests * Update node/core/dispute-participation/src/lib.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com> * guide: update overseer protocol dispute participation message * dispute-participation: remove duplication in tests Co-authored-by: Andronik Ordian <write@reusable.software> Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -16,9 +16,17 @@ Output:
|
||||
|
||||
## Functionality
|
||||
|
||||
In-memory state:
|
||||
|
||||
```rust
|
||||
struct State {
|
||||
recent_block_hash: Option<(BlockNumber, Hash)>
|
||||
}
|
||||
```
|
||||
|
||||
### On `OverseerSignal::ActiveLeavesUpdate`
|
||||
|
||||
Do nothing.
|
||||
Update `recent_block` in in-memory state according to the highest observed active leaf.
|
||||
|
||||
### On `OverseerSignal::BlockFinalized`
|
||||
|
||||
@@ -34,8 +42,7 @@ Conclude.
|
||||
* Issue an [`AvailabilityRecoveryMessage::RecoverAvailableData`][AvailabilityRecoveryMessage]
|
||||
* If the result is `Unavailable`, return.
|
||||
* If the result is `Invalid`, [cast invalid votes](#cast-votes) and return.
|
||||
* Fetch the block number of `candidate_receipt.descriptor.relay_parent` using a [`ChainApiMessage::BlockNumber`][ChainApiMessage].
|
||||
* If the data is recovered, dispatch a [`RuntimeApiMessage::ValidationCodeByHash`][RuntimeApiMessage] with the parameters `(candidate_receipt.descriptor.validation_code_hash)`.
|
||||
* If the data is recovered, dispatch a [`RuntimeApiMessage::ValidationCodeByHash`][RuntimeApiMessage] with the parameters `(candidate_receipt.descriptor.validation_code_hash)` at `state.recent_block.hash`.
|
||||
* Dispatch a [`AvailabilityStoreMessage::StoreAvailableData`][AvailabilityStoreMessage] with the data.
|
||||
* If the code is not fetched from the chain, return. This should be impossible with correct relay chain configuration, at least if chain synchronization is working correctly.
|
||||
* Dispatch a [`CandidateValidationMessage::ValidateFromExhaustive`][CandidateValidationMessage] with the available data and the validation code.
|
||||
|
||||
Reference in New Issue
Block a user