Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(x/consensus): fixes #22114

Merged
merged 5 commits into from
Oct 4, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading