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

refactor(x/consensus): audit QA #21151

Merged
merged 8 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions api/cosmos/consensus/v1/tx.pulsar.go

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

108 changes: 54 additions & 54 deletions store/snapshots/types/snapshot.pb.go

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

8 changes: 5 additions & 3 deletions x/consensus/proto/cosmos/consensus/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ message MsgUpdateParams {
cometbft.types.v1.EvidenceParams evidence = 3;
cometbft.types.v1.ValidatorParams validator = 4;

// Since: cosmos-sdk 0.51
cometbft.types.v1.ABCIParams abci = 5 [deprecated = true, (cosmos_proto.field_added_in) = "cosmos-sdk 0.50"];
cometbft.types.v1.SynchronyParams synchrony = 6 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.51"];
// Since: cosmos-sdk 0.50
Copy link
Member

Choose a reason for hiding this comment

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

we can kill all those Since comments btw

cometbft.types.v1.ABCIParams abci = 5 [deprecated = true, (cosmos_proto.field_added_in) = "cosmos-sdk 0.50"];

// Since: cosmos-sdk 0.52
cometbft.types.v1.SynchronyParams synchrony = 6 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"];
cometbft.types.v1.FeatureParams feature = 7 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"];
}

Expand Down
14 changes: 4 additions & 10 deletions x/consensus/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,19 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, e

if msg.Feature != nil {
if msg.Feature.VoteExtensionsEnableHeight != nil {
cp.Feature.VoteExtensionsEnableHeight = &types.Int64Value{
Value: msg.Feature.GetVoteExtensionsEnableHeight().GetValue(),
}
cp.Feature.VoteExtensionsEnableHeight = msg.Feature.VoteExtensionsEnableHeight
}
if msg.Feature.PbtsEnableHeight != nil {
cp.Feature.PbtsEnableHeight = &types.Int64Value{
Value: msg.Feature.GetPbtsEnableHeight().GetValue(),
}
cp.Feature.PbtsEnableHeight = msg.Feature.PbtsEnableHeight
}
}

if msg.Synchrony != nil {
if msg.Synchrony.MessageDelay != nil {
delay := *msg.Synchrony.MessageDelay
cp.Synchrony.MessageDelay = &delay
cp.Synchrony.MessageDelay = msg.Synchrony.MessageDelay
}
if msg.Synchrony.Precision != nil {
precision := *msg.Synchrony.Precision
cp.Synchrony.Precision = &precision
cp.Synchrony.Precision = msg.Synchrony.Precision
}
}

Expand Down
Loading
Loading