Skip to content

Commit

Permalink
docs(x/consensus): fixes (#22114)
Browse files Browse the repository at this point in the history
  • Loading branch information
raynaudoe authored Oct 4, 2024
1 parent 080ff34 commit a1978c2
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions x/consensus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,53 @@ Functionality to modify CometBFT's ABCI consensus params.

## Contents

* [Abstract](#abstract)
* [Contents](#contents)
* [State](#state)
* [Params](#params)
* [Keepers](#keepers)
* [Keeper](#keeper)
* [Messages](#messages)
* [Consensus Messages](#consensus-messages)
* [UpdateParams](#updateparams)
* [Events](#events)
* [Message Events](#message-events)


## State

The `x/consensus` module keeps state of the consensus params from cometbft.:
The `x/consensus` module keeps state of the consensus params from CometBFT.

## Params

The consensus module stores it's params in state with the prefix of `0x05`,
The consensus module stores its params in state with the prefix of `0x05`,
it can be updated with governance or the address with authority.

* Params: `0x05 | ProtocolBuffer(cometbft.ConsensusParams)`

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/release/v0.52.x/x/consensus/proto/cosmos/consensus/v1/consensus.proto#L9-L15
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/consensus/proto/cosmos/consensus/v1/query.proto#L21-L27
```

```protobuf reference
https://github.com/cometbft/cometbft/blob/v0.34.35/proto/tendermint/types/params.proto#L11-L18
```

## Keepers
## Keeper

The Keeper of the `x/consensus` module provides the following functions:

* `Params`: Retrieves the current consensus parameters.

* `UpdateParams`: Updates the consensus parameters. Only the authority can perform this operation.

* `BlockParams`: Returns the maximum gas and bytes allowed in a block.

* `ValidatorPubKeyTypes`: Provides the list of public key types allowed for validators.

* `EvidenceParams`: Returns the evidence parameters, including maximum age and bytes.

* `AppVersion`: Returns the current application version.


Note: It is recommended to use the `x/consensus` module keeper to get consensus params instead of accessing them through the context.

The consensus module provides methods to Set and Get consensus params. It is recommended to use the `x/consensus` module keeper to get consensus params instead of accessing them through the context.

## Messages

Expand All @@ -45,7 +65,7 @@ The consensus module provides methods to Set and Get consensus params. It is rec
Update consensus params.

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/release/v0.52.x/x/consensus/proto/cosmos/consensus/v1/tx.proto#L23-L44
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/consensus/proto/cosmos/consensus/v1/tx.proto#L24-L44
```

The message will fail under the following conditions:
Expand Down

0 comments on commit a1978c2

Please sign in to comment.