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

chore(consensus): add cometInfo to consensus #20615

Merged
merged 13 commits into from
Jun 13, 2024
2 changes: 1 addition & 1 deletion api/cosmos/circuit/v1/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,351 changes: 547 additions & 804 deletions api/cosmos/consensus/v1/consensus.pulsar.go

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions proto/cosmos/consensus/v1/consensus.proto

This file was deleted.

2 changes: 1 addition & 1 deletion x/circuit/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions x/consensus/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type Keeper struct {

authority string
ParamsStore collections.Item[cmtproto.ConsensusParams]
// storage of the last comet info
cometInfo collections.Item[types.CometInfo]
}

var _ exported.ConsensusParamSetter = Keeper{}.ParamsStore
Expand All @@ -35,6 +37,7 @@ func NewKeeper(cdc codec.BinaryCodec, env appmodule.Environment, authority strin
Environment: env,
authority: authority,
ParamsStore: collections.NewItem(sb, collections.NewPrefix("Consensus"), "params", codec.CollValue[cmtproto.ConsensusParams](cdc)),
cometInfo: collections.NewItem(sb, collections.NewPrefix("CometInfo"), "comet_info", codec.CollValue[types.CometInfo](cdc)),
}
}

Expand Down
19 changes: 19 additions & 0 deletions x/consensus/proto/cosmos/consensus/v1/consensus.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Since: cosmos-sdk 0.52
syntax = "proto3";
package cosmos.consensus.v1;

import "cometbft/abci/v1/types.proto";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The import path cometbft/abci/v1/types.proto in consensus.proto is incorrect or the file is missing from the repository. Please verify the correct path or ensure that the required file is added to the repository.

  • File: x/consensus/proto/cosmos/consensus/v1/consensus.proto
  • Line: 5
Analysis chain

Ensure the import path is correctly specified and accessible.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for types.proto in the consensus.proto file.

# Test: Search for the import path in the repository. Expect: Path exists.
fd --type file 'types.proto' | grep 'cometbft/abci/v1'

Length of output: 52



Script:

#!/bin/bash
# Description: Search for types.proto in the entire repository to determine its location.

# Test: Search for the types.proto file in the repository. Expect: Path exists.
fd --type file 'types.proto'

Length of output: 221



Script:

#!/bin/bash
# Description: Search for directories or files related to cometbft in the repository.

# Test: Search for any directories or files related to cometbft. Expect: Path exists.
fd --type d 'cometbft' || fd --type f 'cometbft'

Length of output: 42


option go_package = "cosmossdk.io/x/consensus/types";

// ConsensusMsgParamsResponse defines the response structure for executing a
// ConsensusMsgParams message.
message ConsensusMsgParamsResponse {}

// CometInfo defines the structure of the x/consensus module's comet info.
message CometInfo {
repeated cometbft.abci.v1.Misbehavior evidence = 1;
bytes validators_hash = 2;
bytes proposer_address = 3;
cometbft.abci.v1.CommitInfo last_commit = 4;
}
Loading
Loading