This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a partial and incomplete design which, when completed, might close #1362. Putting this up and switching focus because that issue has been deprioritized.
- Loading branch information
1 parent
8c1a5a5
commit 68b6295
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
roadmap/implementers-guide/src/runtime-api/misbehavior-reporting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Misbehavior Reporting | ||
|
||
This API is the boundary layer between the runtime modules, which understand only the current block | ||
in a fork-free model of the blockchain, and the node subsystems, which handle forking and finality. | ||
As such, there are two types of misbehavior which we are concerned with: local and remote. | ||
|
||
## Local Disputes | ||
|
||
Local disputes are detected by the runtime and communicated to the node by an as-yet-unspecified | ||
mechanism. | ||
|
||
> TODO: figure out that mechanism. | ||
> | ||
> A pull mechanism which lets the node request new disputes from the runtime is most similar to | ||
> existing runtime APIs; it might look like: | ||
> | ||
> ```rust | ||
> fn get_new_disputes(at: Block) -> Vec<Dispute> | ||
> ``` | ||
> | ||
> However, that design feels suboptimal. There is probably a push design possible which would allow | ||
> the runtime to directly notify the node when it discovers cause for a dispute, but it's not obvious | ||
> as of now what such a design would look like. | ||
Local disputes are forwarded as [`ProvisionerMessage`](../types/overseer-protocol.md#provisioner-message)`::Dispute`. | ||
## Remote Disputes | ||
When a dispute has occurred on another fork, we need to transplant that dispute to every other fork. | ||
This preserves the property that a misbehaving validator is slashed in every possible future; it can't | ||
escape punishment just because its misbehavior was detected and prevented before taking effect. | ||
### Concluded Remote Dispute | ||
A concluded remote dispute has had the dispute process run to completion: it simply rolls up | ||
all [attestations](../types/backing.md#signed-statement-type) for and against the block. | ||
It can be resolved in a single transaction; it is an open-and-shut case of a quorum of validators | ||
disagreeing with each other. | ||
```rust | ||
struct ConcludedRemoteDispute { | ||
attestations: Vec<SignedStatement>, | ||
} | ||
fn concluded_remote_distpute(dispute: ConcludedRemoteDispute) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# DisputeInherent Module | ||
|
||
This module propagates remote dispute data into the runtime. This entrypoint is mandatory, in that | ||
it must be invoked exactly once within every block, and it is also inherent in that it is provided | ||
with no origin by the block author. The data wihtin it carries its own authentication. If any of | ||
the steps within fails, the entrypoint is considered to have failed and the block will be invalid. | ||
|
||
## Storage | ||
|
||
```rust | ||
Included: Option<()>, | ||
``` | ||
|
||
## Finalization | ||
|
||
1. Take (get and clear) the value of `Included`. Ensure that it is `None` or throw an unrecoverable error. | ||
|
||
## Entry Points | ||
|
||
- `disputes`. | ||
|
||
> TODO: design how the disputes inherent is used to propagate unconcluded remote disputes |