docs: Improve markdownlint configuration (#11104)
## Description Closes: #9404 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
This commit is contained in:
@@ -4,4 +4,4 @@ order: 0
|
||||
|
||||
# Slashing
|
||||
|
||||
- [Slashing](spec/README.md) - validator punishment mechanisms.
|
||||
* [Slashing](spec/README.md) - validator punishment mechanisms.
|
||||
|
||||
@@ -14,7 +14,7 @@ Proposers are incentivized to include precommits from all validators in the Tend
|
||||
by receiving additional fees proportional to the difference between the voting
|
||||
power included in the `LastCommitInfo` and +2/3 (see [fee distribution](x/distribution/spec/03_begin_block.md)).
|
||||
|
||||
```
|
||||
```go
|
||||
type LastCommitInfo struct {
|
||||
Round int32
|
||||
Votes []VoteInfo
|
||||
@@ -27,8 +27,8 @@ number of blocks by being automatically jailed, potentially slashed, and unbonde
|
||||
Information about validator's liveness activity is tracked through `ValidatorSigningInfo`.
|
||||
It is indexed in the store as follows:
|
||||
|
||||
- ValidatorSigningInfo: `0x01 | ConsAddrLen (1 byte) | ConsAddress -> ProtocolBuffer(ValSigningInfo)`
|
||||
- MissedBlocksBitArray: `0x02 | ConsAddrLen (1 byte) | ConsAddress | LittleEndianUint64(signArrayIndex) -> VarInt(didMiss)` (varint is a number encoding format)
|
||||
* ValidatorSigningInfo: `0x01 | ConsAddrLen (1 byte) | ConsAddress -> ProtocolBuffer(ValSigningInfo)`
|
||||
* MissedBlocksBitArray: `0x02 | ConsAddrLen (1 byte) | ConsAddress | LittleEndianUint64(signArrayIndex) -> VarInt(didMiss)` (varint is a number encoding format)
|
||||
|
||||
The first mapping allows us to easily lookup the recent signing info for a
|
||||
validator based on the validator's consensus address.
|
||||
@@ -48,4 +48,4 @@ bonded validator. The `SignedBlocksWindow` parameter defines the size
|
||||
|
||||
The information stored for tracking validator liveness is as follows:
|
||||
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/slashing/v1beta1/slashing.proto#L11-L33
|
||||
+++ <https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/slashing/v1beta1/slashing.proto#L11-L33>
|
||||
|
||||
@@ -22,7 +22,7 @@ message MsgUnjail {
|
||||
|
||||
Below is a pseudocode of the `MsgSrv/Unjail` RPC:
|
||||
|
||||
```
|
||||
```go
|
||||
unjail(tx MsgUnjail)
|
||||
validator = getValidator(tx.ValidatorAddr)
|
||||
if validator == nil
|
||||
|
||||
@@ -12,16 +12,16 @@ The slashing module implements the `StakingHooks` defined in `x/staking` and are
|
||||
|
||||
The following hooks impact the slashing state:
|
||||
|
||||
+ `AfterValidatorBonded` creates a `ValidatorSigningInfo` instance as described in the following section.
|
||||
+ `AfterValidatorCreated` stores a validator's consensus key.
|
||||
+ `AfterValidatorRemoved` removes a validator's consensus key.
|
||||
* `AfterValidatorBonded` creates a `ValidatorSigningInfo` instance as described in the following section.
|
||||
* `AfterValidatorCreated` stores a validator's consensus key.
|
||||
* `AfterValidatorRemoved` removes a validator's consensus key.
|
||||
|
||||
## 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.
|
||||
|
||||
```
|
||||
```go
|
||||
onValidatorBonded(address sdk.ValAddress)
|
||||
|
||||
signingInfo, found = GetValidatorSigningInfo(address)
|
||||
|
||||
@@ -10,9 +10,9 @@ The slashing module emits the following events:
|
||||
|
||||
### MsgUnjail
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ------- | ------------- | --------------- |
|
||||
| message | module | slashing |
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ------- | ------------- | ------------------ |
|
||||
| message | module | slashing |
|
||||
| message | sender | {validatorAddress} |
|
||||
|
||||
## Keeper
|
||||
@@ -27,7 +27,7 @@ The slashing module emits the following events:
|
||||
| slash | jailed [0] | {validatorConsensusAddress} |
|
||||
| slash | burned coins | {sdk.Int} |
|
||||
|
||||
- [0] Only included if the validator is jailed.
|
||||
* [0] Only included if the validator is jailed.
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| -------- | ------------- | --------------------------- |
|
||||
@@ -37,7 +37,7 @@ The slashing module emits the following events:
|
||||
|
||||
### Slash
|
||||
|
||||
+ same as `"slash"` event from `HandleValidatorSignature`, but without the `jailed` attribute.
|
||||
* same as `"slash"` event from `HandleValidatorSignature`, but without the `jailed` attribute.
|
||||
|
||||
### Jail
|
||||
|
||||
|
||||
@@ -113,11 +113,11 @@ comparing potential future ones to find the max.
|
||||
|
||||
Currently the only Tendermint ABCI fault is:
|
||||
|
||||
- Unjustified precommits (double signs)
|
||||
* Unjustified precommits (double signs)
|
||||
|
||||
It is currently planned to include the following fault in the near future:
|
||||
|
||||
- Signing a precommit when you're in unbonding phase (needed to make light client bisection safe)
|
||||
* Signing a precommit when you're in unbonding phase (needed to make light client bisection safe)
|
||||
|
||||
Given that these faults are both attributable byzantine faults, we will likely
|
||||
want to slash them equally, and thus we can enact the above change.
|
||||
|
||||
@@ -6,31 +6,31 @@ order: 9
|
||||
|
||||
A user can query and interact with the `slashing` module using the CLI.
|
||||
|
||||
### Query
|
||||
## Query
|
||||
|
||||
The `query` commands allow users to query `slashing` state.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing --help
|
||||
```
|
||||
|
||||
#### params
|
||||
### params
|
||||
|
||||
The `params` command allows users to query genesis parameters for the slashing module.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing params [flags]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing params
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```yml
|
||||
downtime_jail_duration: 600s
|
||||
min_signed_per_window: "0.500000000000000000"
|
||||
signed_blocks_window: "100"
|
||||
@@ -38,24 +38,24 @@ 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.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing signing-infos [flags]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Auxs3865HpB/EfssYOzfqNhEJjzys6jD5B6tPgC8="}'
|
||||
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```yml
|
||||
address: cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c
|
||||
index_offset: "2068"
|
||||
jailed_until: "1970-01-01T00:00:00Z"
|
||||
@@ -64,23 +64,23 @@ start_height: "0"
|
||||
tombstoned: false
|
||||
```
|
||||
|
||||
#### signing-infos
|
||||
### signing-infos
|
||||
|
||||
The `signing-infos` command allows users to query signing infos of all validators.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing signing-infos [flags]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
simd query slashing signing-infos
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```yml
|
||||
info:
|
||||
- address: cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c
|
||||
index_offset: "2075"
|
||||
@@ -93,7 +93,7 @@ pagination:
|
||||
total: "0"
|
||||
```
|
||||
|
||||
### Transactions
|
||||
## Transactions
|
||||
|
||||
The `tx` commands allow users to interact with the `slashing` module.
|
||||
|
||||
@@ -101,7 +101,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.
|
||||
|
||||
@@ -123,19 +123,19 @@ A user can query the `slashing` module using gRPC endpoints.
|
||||
|
||||
The `Params` endpoint allows users to query the parameters of slashing module.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cosmos.slashing.v1beta1.Query/Params
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
grpcurl -plaintext localhost:9090 cosmos.slashing.v1beta1.Query/Params
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```json
|
||||
{
|
||||
"params": {
|
||||
"signedBlocksWindow": "100",
|
||||
@@ -151,19 +151,19 @@ Example Output:
|
||||
|
||||
The SigningInfo queries the signing info of given cons address.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cosmos.slashing.v1beta1.Query/SigningInfo
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
grpcurl -plaintext -d '{"cons_address":"cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c"}' localhost:9090 cosmos.slashing.v1beta1.Query/SigningInfo
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```json
|
||||
{
|
||||
"valSigningInfo": {
|
||||
"address": "cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c",
|
||||
@@ -177,19 +177,19 @@ Example Output:
|
||||
|
||||
The SigningInfos queries signing info of all validators.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cosmos.slashing.v1beta1.Query/SigningInfos
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
grpcurl -plaintext localhost:9090 cosmos.slashing.v1beta1.Query/SigningInfos
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```json
|
||||
{
|
||||
"info": [
|
||||
{
|
||||
@@ -210,19 +210,19 @@ A user can query the `slashing` module using REST endpoints.
|
||||
|
||||
### Params
|
||||
|
||||
```bash
|
||||
```sh
|
||||
/cosmos/slashing/v1beta1/params
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
curl "localhost:1317/cosmos/slashing/v1beta1/params"
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```json
|
||||
{
|
||||
"params": {
|
||||
"signed_blocks_window": "100",
|
||||
@@ -235,19 +235,19 @@ Example Output:
|
||||
|
||||
### signing_info
|
||||
|
||||
```bash
|
||||
```sh
|
||||
/cosmos/slashing/v1beta1/signing_infos/%s
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
curl "localhost:1317/cosmos/slashing/v1beta1/signing_infos/cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c"
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```json
|
||||
{
|
||||
"val_signing_info": {
|
||||
"address": "cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c",
|
||||
@@ -262,19 +262,19 @@ Example Output:
|
||||
|
||||
### signing_infos
|
||||
|
||||
```bash
|
||||
```sh
|
||||
/cosmos/slashing/v1beta1/signing_infos
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
curl "localhost:1317/cosmos/slashing/v1beta1/signing_infos
|
||||
```
|
||||
|
||||
Example Output:
|
||||
|
||||
```bash
|
||||
```json
|
||||
{
|
||||
"info": [
|
||||
{
|
||||
|
||||
+16
-16
@@ -17,33 +17,33 @@ by a protocol-recognized actor with value at stake by penalizing them ("slashing
|
||||
|
||||
Penalties may include, but are not limited to:
|
||||
|
||||
- Burning some amount of their stake
|
||||
- Removing their ability to vote on future blocks for a period of time.
|
||||
* Burning some amount of their stake
|
||||
* Removing their ability to vote on future blocks for a period of time.
|
||||
|
||||
This module will be used by the Cosmos Hub, the first hub in the Cosmos ecosystem.
|
||||
|
||||
## Contents
|
||||
|
||||
1. **[Concepts](01_concepts.md)**
|
||||
- [States](01_concepts.md#states)
|
||||
- [Tombstone Caps](01_concepts.md#tombstone-caps)
|
||||
- [ASCII timelines](01_concepts.md#ascii-timelines)
|
||||
* [States](01_concepts.md#states)
|
||||
* [Tombstone Caps](01_concepts.md#tombstone-caps)
|
||||
* [ASCII timelines](01_concepts.md#ascii-timelines)
|
||||
2. **[State](02_state.md)**
|
||||
- [Signing Info](02_state.md#signing-info)
|
||||
* [Signing Info](02_state.md#signing-info)
|
||||
3. **[Messages](03_messages.md)**
|
||||
- [Unjail](03_messages.md#unjail)
|
||||
* [Unjail](03_messages.md#unjail)
|
||||
4. **[Begin-Block](04_begin_block.md)**
|
||||
- [Evidence handling](04_begin_block.md#evidence-handling)
|
||||
- [Uptime tracking](04_begin_block.md#uptime-tracking)
|
||||
* [Evidence handling](04_begin_block.md#evidence-handling)
|
||||
* [Uptime tracking](04_begin_block.md#uptime-tracking)
|
||||
5. **[05_hooks.md](05_hooks.md)**
|
||||
- [Hooks](05_hooks.md#hooks)
|
||||
* [Hooks](05_hooks.md#hooks)
|
||||
6. **[Events](06_events.md)**
|
||||
- [BeginBlocker](06_events.md#beginblocker)
|
||||
- [Handlers](06_events.md#handlers)
|
||||
* [BeginBlocker](06_events.md#beginblocker)
|
||||
* [Handlers](06_events.md#handlers)
|
||||
7. **[Staking Tombstone](07_tombstone.md)**
|
||||
- [Abstract](07_tombstone.md#abstract)
|
||||
* [Abstract](07_tombstone.md#abstract)
|
||||
8. **[Parameters](08_params.md)**
|
||||
9. **[Client](09_client.md)**
|
||||
- [CLI](09_client.md#cli)
|
||||
- [gRPC](09_client.md#grpc)
|
||||
- [REST](09_client.md#rest)
|
||||
* [CLI](09_client.md#cli)
|
||||
* [gRPC](09_client.md#grpc)
|
||||
* [REST](09_client.md#rest)
|
||||
|
||||
Reference in New Issue
Block a user