x/consensus module allows governance to update CometBFT’s ABCI consensus parameters on a live chain without a software upgrade.
Consensus Parameters
The module manages the following CometBFT consensus parameters:Block Parameters
| Parameter | Description |
|---|---|
MaxBytes | Maximum block size in bytes |
MaxGas | Maximum gas per block (-1 for unlimited) |
Evidence Parameters
| Parameter | Description |
|---|---|
MaxAgeNumBlocks | Maximum age of evidence in blocks |
MaxAgeDuration | Maximum age of evidence as a duration |
MaxBytes | Maximum total evidence size per block in bytes |
Validator Parameters
| Parameter | Description |
|---|---|
PubKeyTypes | Supported public key types for validators (e.g., ed25519, secp256k1, bls12381) |
ABCI Parameters
| Parameter | Description |
|---|---|
VoteExtensionsEnableHeight | Block height at which vote extensions are enabled (0 to disable) |
Messages
MsgUpdateParams
Updates consensus parameters via governance. All ofblock, evidence, and validator must be provided. abci is optional.
AuthorityParams
Authority management can be centralized via thex/consensus module using AuthorityParams. The AuthorityParams field in ConsensusParams stores the authority address on-chain. When set, it takes precedence over the per-keeper authority parameter.
Keeper constructors still accept the authority parameter. It is used as a fallback when no authority is configured in consensus params.
How It Works
When a module validates authority (e.g., inUpdateParams), it checks consensus params first. If no authority is set there, it falls back to the keeper’s authority field:
AuthorityParams in consensus params via a governance proposal targeting the x/consensus module’s MsgUpdateParams.