docs: fix toc links (#13770)
This commit is contained in:
+43
-43
@@ -42,9 +42,9 @@ This module will be used by the Cosmos Hub, the first hub in the Cosmos ecosyste
|
||||
* [gRPC](#grpc)
|
||||
* [REST](#rest)
|
||||
|
||||
# Concepts
|
||||
## Concepts
|
||||
|
||||
## States
|
||||
### States
|
||||
|
||||
At any given time, there are any number of validators registered in the state
|
||||
machine. Each block, the top `MaxValidators` (defined by `x/staking`) validators
|
||||
@@ -56,7 +56,7 @@ For each of these validators we keep a `ValidatorSigningInfo` record that contai
|
||||
information partaining to validator's liveness and other infraction related
|
||||
attributes.
|
||||
|
||||
## Tombstone Caps
|
||||
### Tombstone Caps
|
||||
|
||||
In order to mitigate the impact of initially likely categories of non-malicious
|
||||
protocol faults, the Cosmos Hub implements for each validator
|
||||
@@ -67,7 +67,7 @@ somewhat blunt the economic impact of unintentional misconfiguration.
|
||||
|
||||
Liveness faults do not have caps, as they can't stack upon each other. Liveness bugs are "detected" as soon as the infraction occurs, and the validators are immediately put in jail, so it is not possible for them to commit multiple liveness faults without unjailing in between.
|
||||
|
||||
## Infraction Timelines
|
||||
### Infraction Timelines
|
||||
|
||||
To illustrate how the `x/slashing` module handles submitted evidence through
|
||||
Tendermint consensus, consider the following examples:
|
||||
@@ -81,14 +81,14 @@ _D<sub>n</sub>_ : infraction `n` discovered
|
||||
_V<sub>b</sub>_ : validator bonded
|
||||
_V<sub>u</sub>_ : validator unbonded
|
||||
|
||||
### Single Double Sign Infraction
|
||||
#### Single Double Sign Infraction
|
||||
|
||||
\[----------C<sub>1</sub>----D<sub>1</sub>,V<sub>u</sub>-----\]
|
||||
|
||||
A single infraction is committed then later discovered, at which point the
|
||||
validator is unbonded and slashed at the full amount for the infraction.
|
||||
|
||||
### Multiple Double Sign Infractions
|
||||
#### Multiple Double Sign Infractions
|
||||
|
||||
\[----------C<sub>1</sub>--C<sub>2</sub>---C<sub>3</sub>---D<sub>1</sub>,D<sub>2</sub>,D<sub>3</sub>V<sub>u</sub>-----\]
|
||||
|
||||
@@ -96,9 +96,9 @@ Multiple infractions are committed and then later discovered, at which point the
|
||||
validator is jailed and slashed for only one infraction. Because the validator
|
||||
is also tombstoned, they can not rejoin the validator set.
|
||||
|
||||
# State
|
||||
## State
|
||||
|
||||
## Signing Info (Liveness)
|
||||
### Signing Info (Liveness)
|
||||
|
||||
Every block includes a set of precommits by the validators for the previous block,
|
||||
known as the `LastCommitInfo` provided by Tendermint. A `LastCommitInfo` is valid so
|
||||
@@ -146,7 +146,7 @@ The information stored for tracking validator liveness is as follows:
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v0.46.0/proto/cosmos/slashing/v1beta1/slashing.proto#L12-L33
|
||||
```
|
||||
|
||||
## Params
|
||||
### Params
|
||||
|
||||
The slashing module stores it's params in state with the prefix of `0x00`,
|
||||
it can be updated with governance or the address with authority.
|
||||
@@ -157,11 +157,11 @@ it can be updated with governance or the address with authority.
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc3/proto/cosmos/slashing/v1beta1/slashing.proto#L35-L45
|
||||
```
|
||||
|
||||
# Messages
|
||||
## Messages
|
||||
|
||||
In this section we describe the processing of messages for the `slashing` module.
|
||||
|
||||
## Unjail
|
||||
### Unjail
|
||||
|
||||
If a validator was automatically unbonded due to downtime and wishes to come back online &
|
||||
possibly rejoin the bonded set, it must send `MsgUnjail`:
|
||||
@@ -205,9 +205,9 @@ If the validator has enough stake to be in the top `n = MaximumBondedValidators`
|
||||
and all delegators still delegated to the validator will be rebonded and begin to again collect
|
||||
provisions and rewards.
|
||||
|
||||
# BeginBlock
|
||||
## BeginBlock
|
||||
|
||||
## Liveness Tracking
|
||||
### Liveness Tracking
|
||||
|
||||
At the beginning of each block, we update the `ValidatorSigningInfo` for each
|
||||
validator and check if they've crossed below the liveness threshold over a
|
||||
@@ -300,11 +300,11 @@ for vote in block.LastCommitInfo.Votes {
|
||||
}
|
||||
```
|
||||
|
||||
# Hooks
|
||||
## Hooks
|
||||
|
||||
This section contains a description of the module's `hooks`. Hooks are operations that are executed automatically when events are raised.
|
||||
|
||||
## Staking hooks
|
||||
### Staking hooks
|
||||
|
||||
The slashing module implements the `StakingHooks` defined in `x/staking` and are used as record-keeping of validators information. During the app initialization, these hooks should be registered in the staking module struct.
|
||||
|
||||
@@ -314,7 +314,7 @@ The following hooks impact the slashing state:
|
||||
* `AfterValidatorCreated` stores a validator's consensus key.
|
||||
* `AfterValidatorRemoved` removes a validator's consensus key.
|
||||
|
||||
## Validator Bonded
|
||||
### Validator Bonded
|
||||
|
||||
Upon successful first-time bonding of a new validator, we create a new `ValidatorSigningInfo` structure for the
|
||||
now-bonded validator, which `StartHeight` of the current block.
|
||||
@@ -342,22 +342,22 @@ onValidatorBonded(address sdk.ValAddress)
|
||||
return
|
||||
```
|
||||
|
||||
# Events
|
||||
## Events
|
||||
|
||||
The slashing module emits the following events:
|
||||
|
||||
## MsgServer
|
||||
### MsgServer
|
||||
|
||||
### MsgUnjail
|
||||
#### MsgUnjail
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ------- | ------------- | ------------------ |
|
||||
| message | module | slashing |
|
||||
| message | sender | {validatorAddress} |
|
||||
|
||||
## Keeper
|
||||
### Keeper
|
||||
|
||||
## BeginBlocker: HandleValidatorSignature
|
||||
### BeginBlocker: HandleValidatorSignature
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ----- | ------------- | --------------------------- |
|
||||
@@ -375,19 +375,19 @@ The slashing module emits the following events:
|
||||
| liveness | missed_blocks | {missedBlocksCounter} |
|
||||
| liveness | height | {blockHeight} |
|
||||
|
||||
### Slash
|
||||
#### Slash
|
||||
|
||||
* same as `"slash"` event from `HandleValidatorSignature`, but without the `jailed` attribute.
|
||||
|
||||
### Jail
|
||||
#### Jail
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ----- | ------------- | ------------------ |
|
||||
| slash | jailed | {validatorAddress} |
|
||||
|
||||
# Staking Tombstone
|
||||
## Staking Tombstone
|
||||
|
||||
## Abstract
|
||||
### Abstract
|
||||
|
||||
In the current implementation of the `slashing` module, when the consensus engine
|
||||
informs the state machine of a validator's consensus fault, the validator is
|
||||
@@ -472,7 +472,7 @@ stay with them. Given that consensus safety faults are so egregious
|
||||
(way more so than liveness faults), it is probably prudent to have delegators not
|
||||
"auto-rebond" to the validator.
|
||||
|
||||
### Proposal: infinite jail
|
||||
#### Proposal: infinite jail
|
||||
|
||||
We propose setting the "jail time" for a
|
||||
validator who commits a consensus safety fault, to `infinite` (i.e. a tombstone state).
|
||||
@@ -487,7 +487,7 @@ will make the `slashing` module way simpler, especially because we can remove al
|
||||
of the hooks defined in the `slashing` module consumed by the `staking` module
|
||||
(the `slashing` module still consumes hooks defined in `staking`).
|
||||
|
||||
### Single slashing amount
|
||||
#### Single slashing amount
|
||||
|
||||
Another optimization that can be made is that if we assume that all ABCI faults
|
||||
for Tendermint consensus are slashed at the same level, we don't have to keep
|
||||
@@ -509,7 +509,7 @@ want to slash them equally, and thus we can enact the above change.
|
||||
> not for a different consensus algorithm or future versions of Tendermint that
|
||||
> may want to punish at different levels (for example, partial slashing).
|
||||
|
||||
# Parameters
|
||||
## Parameters
|
||||
|
||||
The slashing module contains the following parameters:
|
||||
|
||||
@@ -521,11 +521,11 @@ The slashing module contains the following parameters:
|
||||
| SlashFractionDoubleSign | string (dec) | "0.050000000000000000" |
|
||||
| SlashFractionDowntime | string (dec) | "0.010000000000000000" |
|
||||
|
||||
# CLI
|
||||
## CLI
|
||||
|
||||
A user can query and interact with the `slashing` module using the CLI.
|
||||
|
||||
## Query
|
||||
### Query
|
||||
|
||||
The `query` commands allow users to query `slashing` state.
|
||||
|
||||
@@ -533,7 +533,7 @@ The `query` commands allow users to query `slashing` state.
|
||||
simd query slashing --help
|
||||
```
|
||||
|
||||
### params
|
||||
#### params
|
||||
|
||||
The `params` command allows users to query genesis parameters for the slashing module.
|
||||
|
||||
@@ -557,7 +557,7 @@ slash_fraction_double_sign: "0.050000000000000000"
|
||||
slash_fraction_downtime: "0.010000000000000000"
|
||||
```
|
||||
|
||||
### signing-info
|
||||
#### signing-info
|
||||
|
||||
The `signing-info` command allows users to query signing-info of the validator using consensus public key.
|
||||
|
||||
@@ -583,7 +583,7 @@ start_height: "0"
|
||||
tombstoned: false
|
||||
```
|
||||
|
||||
### signing-infos
|
||||
#### signing-infos
|
||||
|
||||
The `signing-infos` command allows users to query signing infos of all validators.
|
||||
|
||||
@@ -612,7 +612,7 @@ pagination:
|
||||
total: "0"
|
||||
```
|
||||
|
||||
## Transactions
|
||||
### Transactions
|
||||
|
||||
The `tx` commands allow users to interact with the `slashing` module.
|
||||
|
||||
@@ -620,7 +620,7 @@ The `tx` commands allow users to interact with the `slashing` module.
|
||||
simd tx slashing --help
|
||||
```
|
||||
|
||||
### unjail
|
||||
#### unjail
|
||||
|
||||
The `unjail` command allows users to unjail a validator previously jailed for downtime.
|
||||
|
||||
@@ -634,11 +634,11 @@ Example:
|
||||
simd tx slashing unjail --from mykey
|
||||
```
|
||||
|
||||
## gRPC
|
||||
### gRPC
|
||||
|
||||
A user can query the `slashing` module using gRPC endpoints.
|
||||
|
||||
### Params
|
||||
#### Params
|
||||
|
||||
The `Params` endpoint allows users to query the parameters of slashing module.
|
||||
|
||||
@@ -666,7 +666,7 @@ Example Output:
|
||||
}
|
||||
```
|
||||
|
||||
### SigningInfo
|
||||
#### SigningInfo
|
||||
|
||||
The SigningInfo queries the signing info of given cons address.
|
||||
|
||||
@@ -692,7 +692,7 @@ Example Output:
|
||||
}
|
||||
```
|
||||
|
||||
### SigningInfos
|
||||
#### SigningInfos
|
||||
|
||||
The SigningInfos queries signing info of all validators.
|
||||
|
||||
@@ -723,11 +723,11 @@ Example Output:
|
||||
}
|
||||
```
|
||||
|
||||
## REST
|
||||
### REST
|
||||
|
||||
A user can query the `slashing` module using REST endpoints.
|
||||
|
||||
### Params
|
||||
#### Params
|
||||
|
||||
```shell
|
||||
/cosmos/slashing/v1beta1/params
|
||||
@@ -752,7 +752,7 @@ Example Output:
|
||||
}
|
||||
```
|
||||
|
||||
### signing_info
|
||||
#### signing_info
|
||||
|
||||
```shell
|
||||
/cosmos/slashing/v1beta1/signing_infos/%s
|
||||
@@ -779,7 +779,7 @@ Example Output:
|
||||
}
|
||||
```
|
||||
|
||||
### signing_infos
|
||||
#### signing_infos
|
||||
|
||||
```shell
|
||||
/cosmos/slashing/v1beta1/signing_infos
|
||||
|
||||
Reference in New Issue
Block a user