cosmos-sdk/x/consensus
dependabot[bot] 3ef628d5cb
build(deps): Bump github.com/cometbft/cometbft/api from 1.0.0-alpha.2.0.20240530055211-ae27f7eb3c08 to 1.0.0-rc.1 (#20552)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-06 08:06:43 +00:00
..
exported refactor! : bump comet to v1 (#19726) 2024-05-06 14:12:00 +00:00
keeper chore: move logger to core (#20388) 2024-05-28 12:30:09 +00:00
proto refactor! : bump comet to v1 (#19726) 2024-05-06 14:12:00 +00:00
testutil refactor(x/auth): spin out go.mod (#18351) 2023-11-07 11:42:58 +00:00
types refactor: decouple from sdk/codec in amino codec usage (#20369) 2024-05-14 16:52:51 +00:00
autocli.go feat(client/v2): support gov proposals (#18461) 2023-11-15 11:16:25 +00:00
CHANGELOG.md chore: consensus spinout (#20010) 2024-05-03 14:08:17 +00:00
depinject.go chore: consensus spinout (#20010) 2024-05-03 14:08:17 +00:00
go.mod build(deps): Bump github.com/cometbft/cometbft/api from 1.0.0-alpha.2.0.20240530055211-ae27f7eb3c08 to 1.0.0-rc.1 (#20552) 2024-06-06 08:06:43 +00:00
go.sum build(deps): Bump github.com/cometbft/cometbft/api from 1.0.0-alpha.2.0.20240530055211-ae27f7eb3c08 to 1.0.0-rc.1 (#20552) 2024-06-06 08:06:43 +00:00
module.go refactor: decouple from sdk/codec in amino codec usage (#20369) 2024-05-14 16:52:51 +00:00
README.md chore: fix spelling errors (#19545) 2024-02-24 15:30:31 +00:00
sonar-project.properties chore: force reload sonar cloud (#20480) 2024-05-29 11:12:09 +00:00

sidebar_position
1

x/consensus

Abstract

Functionality to modify CometBFT's ABCI consensus params.

Contents

State

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, it can be updated with governance or the address with authority.

  • Params: 0x05 | ProtocolBuffer(cometbft.ConsensusParams)
https://github.com/cosmos/cosmos-sdk/blob/381de6452693a9338371223c232fba0c42773a4b/proto/cosmos/consensus/v1/consensus.proto#L11-L18

Keepers

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

UpdateParams

Update consensus params.

https://github.com/cosmos/cosmos-sdk/blob/381de6452693a9338371223c232fba0c42773a4b/proto/cosmos/consensus/v1/tx.proto#L12-L47

The message will fail under the following conditions:

  • The signer is not the set authority
  • Not all values are set

Consensus Messages

The consensus module has a consensus message that is used to set the consensus params when the chain initializes. It is similar to the UpdateParams message but it is only used once at the start of the chain.

https://github.com/cosmos/cosmos-sdk/blob/381de6452693a9338371223c232fba0c42773a4b/proto/cosmos/consensus/v1/consensus.proto#L9-L24

Events

The consensus module emits the following events:

Message Events

MsgUpdateParams

Type Attribute Key Attribute Value
string authority msg.Signer
string parameters consensus Parameters