From d3d6448eca2c255adcd2176a4e18d21d6c798603 Mon Sep 17 00:00:00 2001 From: Marko Date: Wed, 12 Jun 2024 15:50:58 +0200 Subject: [PATCH 01/11] fix(x/gov): limit execution in gov (#20348) Co-authored-by: Alexander Peters --- api/cosmos/circuit/v1/tx_grpc.pb.go | 2 +- api/cosmos/gov/v1/gov.pulsar.go | 211 +++++++++++++------- x/accounts/go.mod | 2 +- x/circuit/types/tx.pb.go | 2 +- x/gov/CHANGELOG.md | 1 + x/gov/README.md | 8 +- x/gov/go.mod | 4 +- x/gov/keeper/abci.go | 32 ++- x/gov/migrations/v6/store.go | 3 +- x/gov/proto/cosmos/gov/v1/gov.proto | 6 +- x/gov/simulation/genesis.go | 1 + x/gov/types/v1/gov.pb.go | 291 ++++++++++++++++------------ x/gov/types/v1/params.go | 44 +++-- 13 files changed, 363 insertions(+), 244 deletions(-) diff --git a/api/cosmos/circuit/v1/tx_grpc.pb.go b/api/cosmos/circuit/v1/tx_grpc.pb.go index a3b22335e577..2b4b95d37fe2 100644 --- a/api/cosmos/circuit/v1/tx_grpc.pb.go +++ b/api/cosmos/circuit/v1/tx_grpc.pb.go @@ -83,7 +83,7 @@ type MsgServer interface { // TripCircuitBreaker pauses processing of Msg's in the state machine. TripCircuitBreaker(context.Context, *MsgTripCircuitBreaker) (*MsgTripCircuitBreakerResponse, error) // ResetCircuitBreaker resumes processing of Msg's in the state machine that - // have been been paused using TripCircuitBreaker. + // have been paused using TripCircuitBreaker. ResetCircuitBreaker(context.Context, *MsgResetCircuitBreaker) (*MsgResetCircuitBreakerResponse, error) mustEmbedUnimplementedMsgServer() } diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index d4322dfe9e08..f0dd9abb81f3 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6645,6 +6645,7 @@ var ( fd_Params_optimistic_rejected_threshold protoreflect.FieldDescriptor fd_Params_yes_quorum protoreflect.FieldDescriptor fd_Params_expedited_quorum protoreflect.FieldDescriptor + fd_Params_proposal_execution_gas protoreflect.FieldDescriptor ) func init() { @@ -6671,6 +6672,7 @@ func init() { fd_Params_optimistic_rejected_threshold = md_Params.Fields().ByName("optimistic_rejected_threshold") fd_Params_yes_quorum = md_Params.Fields().ByName("yes_quorum") fd_Params_expedited_quorum = md_Params.Fields().ByName("expedited_quorum") + fd_Params_proposal_execution_gas = md_Params.Fields().ByName("proposal_execution_gas") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -6864,6 +6866,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ProposalExecutionGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalExecutionGas) + if !f(fd_Params_proposal_execution_gas, value) { + return + } + } } // Has reports whether a field is populated. @@ -6921,6 +6929,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.YesQuorum != "" case "cosmos.gov.v1.Params.expedited_quorum": return x.ExpeditedQuorum != "" + case "cosmos.gov.v1.Params.proposal_execution_gas": + return x.ProposalExecutionGas != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -6979,6 +6989,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.YesQuorum = "" case "cosmos.gov.v1.Params.expedited_quorum": x.ExpeditedQuorum = "" + case "cosmos.gov.v1.Params.proposal_execution_gas": + x.ProposalExecutionGas = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7067,6 +7079,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.expedited_quorum": value := x.ExpeditedQuorum return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.proposal_execution_gas": + value := x.ProposalExecutionGas + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7135,6 +7150,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.YesQuorum = value.Interface().(string) case "cosmos.gov.v1.Params.expedited_quorum": x.ExpeditedQuorum = value.Interface().(string) + case "cosmos.gov.v1.Params.proposal_execution_gas": + x.ProposalExecutionGas = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7218,6 +7235,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field yes_quorum of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.expedited_quorum": panic(fmt.Errorf("field expedited_quorum of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.proposal_execution_gas": + panic(fmt.Errorf("field proposal_execution_gas of message cosmos.gov.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7279,6 +7298,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.expedited_quorum": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.proposal_execution_gas": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7435,6 +7456,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 2 + l + runtime.Sov(uint64(l)) } + if x.ProposalExecutionGas != 0 { + n += 2 + runtime.Sov(uint64(x.ProposalExecutionGas)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -7464,6 +7488,13 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ProposalExecutionGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalExecutionGas)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } if len(x.ExpeditedQuorum) > 0 { i -= len(x.ExpeditedQuorum) copy(dAtA[i:], x.ExpeditedQuorum) @@ -8374,6 +8405,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.ExpeditedQuorum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 22: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalExecutionGas", wireType) + } + x.ProposalExecutionGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ProposalExecutionGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -10084,7 +10134,8 @@ type Params struct { YesQuorum string `protobuf:"bytes,20,opt,name=yes_quorum,json=yesQuorum,proto3" json:"yes_quorum,omitempty"` // Minimum percentage of total stake needed to vote for a result to be // considered valid for an expedited proposal. - ExpeditedQuorum string `protobuf:"bytes,21,opt,name=expedited_quorum,json=expeditedQuorum,proto3" json:"expedited_quorum,omitempty"` + ExpeditedQuorum string `protobuf:"bytes,21,opt,name=expedited_quorum,json=expeditedQuorum,proto3" json:"expedited_quorum,omitempty"` + ProposalExecutionGas uint64 `protobuf:"varint,22,opt,name=proposal_execution_gas,json=proposalExecutionGas,proto3" json:"proposal_execution_gas,omitempty"` } func (x *Params) Reset() { @@ -10254,6 +10305,13 @@ func (x *Params) GetExpeditedQuorum() string { return "" } +func (x *Params) GetProposalExecutionGas() uint64 { + if x != nil { + return x.ProposalExecutionGas + } + return 0 +} + // MessageBasedParams defines the parameters of specific messages in a proposal. // It is used to define the parameters of a proposal that is based on a specific message. // Once a message has message based params, it only supports a standard proposal type. @@ -10511,7 +10569,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, 0x01, - 0x22, 0xff, 0x0c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, + 0x22, 0xc7, 0x0d, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, @@ -10612,78 +10670,83 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x75, 0x6d, 0x12, 0x49, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xda, 0xb4, 0x2d, 0x0c, - 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x20, 0x76, 0x30, 0x2e, 0x32, 0x2e, 0x30, 0x52, 0x0f, 0x65, 0x78, - 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x3a, 0x13, 0xd2, - 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, - 0x34, 0x37, 0x22, 0xa8, 0x02, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, - 0x73, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, - 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, - 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, - 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, 0x79, 0x65, 0x73, 0x5f, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x79, 0x65, 0x73, - 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, - 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x10, 0xd2, 0xb4, 0x2d, - 0x0c, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x20, 0x76, 0x30, 0x2e, 0x32, 0x2e, 0x30, 0x2a, 0xa7, 0x01, - 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, - 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, - 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, - 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, - 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, - 0x50, 0x4c, 0x45, 0x5f, 0x43, 0x48, 0x4f, 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, - 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, - 0x54, 0x49, 0x4d, 0x49, 0x53, 0x54, 0x49, 0x43, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, - 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x45, - 0x44, 0x49, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, 0xfa, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x17, 0x0a, - 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, - 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, - 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, - 0x15, 0x0a, 0x11, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, - 0x48, 0x52, 0x45, 0x45, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, - 0x54, 0x4f, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, - 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, - 0x1a, 0x02, 0x10, 0x01, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, - 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, - 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, - 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, - 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, - 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, - 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, - 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, - 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, - 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x20, 0x76, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x52, 0x0f, 0x65, 0x78, + 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x46, 0x0a, + 0x16, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x04, 0x42, 0x10, 0xda, + 0xb4, 0x2d, 0x0c, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x20, 0x76, 0x30, 0x2e, 0x32, 0x2e, 0x30, 0x52, + 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x3a, 0x13, 0xd2, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x22, 0xa8, 0x02, 0x0a, 0x12, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, 0x73, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, + 0x2d, 0x0a, 0x0a, 0x79, 0x65, 0x73, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x63, 0x52, 0x09, 0x79, 0x65, 0x73, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, + 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, + 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x3a, 0x10, 0xd2, 0xb4, 0x2d, 0x0c, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x20, 0x76, + 0x30, 0x2e, 0x32, 0x2e, 0x30, 0x2a, 0xa7, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, + 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x43, 0x48, 0x4f, 0x49, + 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, 0x54, 0x49, 0x43, + 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x45, 0x44, 0x49, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, + 0xfa, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, + 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, + 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, + 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x13, + 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, + 0x4f, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x4f, 0x54, 0x45, 0x5f, + 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0x03, 0x12, 0x1c, + 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, + 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, + 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x55, 0x52, + 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0xce, 0x01, 0x0a, + 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, + 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, + 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, + 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x99, 0x01, + 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, + 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 56fa7562f60a..e0d0e7bc36e3 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -8,6 +8,7 @@ require ( cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000 cosmossdk.io/depinject v1.0.0-alpha.4 + cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/tx v0.13.3 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.5.0 @@ -27,7 +28,6 @@ require ( cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/circuit/types/tx.pb.go b/x/circuit/types/tx.pb.go index 667cce9d9d7a..61b184831ac3 100644 --- a/x/circuit/types/tx.pb.go +++ b/x/circuit/types/tx.pb.go @@ -453,7 +453,7 @@ type MsgServer interface { // TripCircuitBreaker pauses processing of Msg's in the state machine. TripCircuitBreaker(context.Context, *MsgTripCircuitBreaker) (*MsgTripCircuitBreakerResponse, error) // ResetCircuitBreaker resumes processing of Msg's in the state machine that - // have been been paused using TripCircuitBreaker. + // have been paused using TripCircuitBreaker. ResetCircuitBreaker(context.Context, *MsgResetCircuitBreaker) (*MsgResetCircuitBreakerResponse, error) } diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 4570b966a1b5..231a520171a9 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -56,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#18762](https://github.com/cosmos/cosmos-sdk/pull/18762) Add multiple choice proposals. * [#18856](https://github.com/cosmos/cosmos-sdk/pull/18856) Add `ProposalCancelMaxPeriod` parameters. * [#19167](https://github.com/cosmos/cosmos-sdk/pull/19167) Add `YesQuorum` parameter. +* [#20348](https://github.com/cosmos/cosmos-sdk/pull/20348) Limit gov execution of proposals to a max gas limit. The limit was added to parameters and can be modified. With this version the default is set to 10 million gas. Before it was infinite gas. ### Client Breaking Changes diff --git a/x/gov/README.md b/x/gov/README.md index b8bf1383e689..b8890b501aaa 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -24,7 +24,7 @@ they don't vote themselves. deposits if the proposal was accepted or rejected. If the proposal was vetoed, or never entered voting period (minimum deposit not reached within deposit period), the deposit is burned. This module is in use on the Cosmos Hub (a.k.a [gaia](https://github.com/cosmos/gaia)). -Features that may be added in the future are described in [Future Improvements](#future-improvements). + ## Contents @@ -278,6 +278,12 @@ There are three parameters that define if the deposit of a proposal should be bu > Note: These parameters are modifiable via governance. +#### Execution + +Execution is the process of executing the messages contained in a proposal. The execution phase will commence after the proposal has been accepted by the network. The messages contained in the proposal will be executed in the order they were submitted. + +Execution has a upper limit on how much gas can be consumed in a single block. This limit is defined by the `ProposalExecutionGas` parameter. + ## State ### Constitution diff --git a/x/gov/go.mod b/x/gov/go.mod index c049416fa50d..3a8b004bbe88 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -13,7 +13,9 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91 // indirect + cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 + cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/chzyer/readline v1.5.1 @@ -39,8 +41,6 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.1-20240312114316-c0d3497e35d6.1 // indirect cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 // indirect - cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/x/gov/keeper/abci.go b/x/gov/keeper/abci.go index 02183342d5a5..f45c3d4c0a66 100644 --- a/x/gov/keeper/abci.go +++ b/x/gov/keeper/abci.go @@ -35,6 +35,11 @@ func (k Keeper) EndBlocker(ctx context.Context) error { return err } + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + for _, prop := range inactiveProps { proposal, err := k.Proposals.Get(ctx, prop.Key.K2()) if err != nil { @@ -61,10 +66,6 @@ func (k Keeper) EndBlocker(ctx context.Context) error { return err } - params, err := k.Params.Get(ctx) - if err != nil { - return err - } if !params.BurnProposalDepositPrevote { err = k.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal } else { @@ -77,7 +78,7 @@ func (k Keeper) EndBlocker(ctx context.Context) error { // called when proposal become inactive // call hook when proposal become inactive - if err := k.BranchService.Execute(ctx, func(ctx context.Context) error { + if err = k.BranchService.Execute(ctx, func(ctx context.Context) error { return k.Hooks().AfterProposalFailedMinDeposit(ctx, proposal.Id) }); err != nil { // purposely ignoring the error here not to halt the chain if the hook fails @@ -193,16 +194,10 @@ func (k Keeper) EndBlocker(ctx context.Context) error { // Messages may mutate state thus we use a cached context. If one of // the handlers fails, no state mutation is written and the error // message is logged. - if err := k.BranchService.Execute(ctx, func(ctx context.Context) error { + _, err = k.BranchService.ExecuteWithGasLimit(ctx, params.ProposalExecutionGas, func(ctx context.Context) error { // execute all messages for idx, msg = range messages { if _, err := safeExecuteHandler(ctx, msg, k.MsgRouterService); err != nil { - // `idx` and `err` are populated with the msg index and error. - proposal.Status = v1.StatusFailed - proposal.FailedReason = err.Error() - tagValue = types.AttributeValueProposalFailed - logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) - return err } } @@ -212,7 +207,14 @@ func (k Keeper) EndBlocker(ctx context.Context) error { logMsg = "passed" return nil - }); err != nil { + }) + if err != nil { + // `idx` and `err` are populated with the msg index and error. + proposal.Status = v1.StatusFailed + proposal.FailedReason = err.Error() + tagValue = types.AttributeValueProposalFailed + logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) + break // We do not anything with the error. Returning an error halts the chain, and proposal struct is already updated. } case !burnDeposits && (proposal.ProposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED || @@ -222,10 +224,6 @@ func (k Keeper) EndBlocker(ctx context.Context) error { // once the regular voting period expires again, the tally is repeated // according to the regular proposal rules. proposal.ProposalType = v1.ProposalType_PROPOSAL_TYPE_STANDARD - params, err := k.Params.Get(ctx) - if err != nil { - return err - } endTime := proposal.VotingStartTime.Add(*params.VotingPeriod) proposal.VotingEndTime = &endTime diff --git a/x/gov/migrations/v6/store.go b/x/gov/migrations/v6/store.go index f45388e89aeb..7a05b6730447 100644 --- a/x/gov/migrations/v6/store.go +++ b/x/gov/migrations/v6/store.go @@ -11,7 +11,7 @@ import ( var votingPeriodProposalKeyPrefix = collections.NewPrefix(4) // VotingPeriodProposalKeyPrefix stores which proposals are on voting period. -// MigrateStore performs in-place store migrations from v5 (v0.50) to v6 (v0.51). The +// MigrateStore performs in-place store migrations from v5 (v0.50) to v6 (v0.52). The // migration includes: // // Addition of new field in params to store types of proposals that can be submitted. @@ -56,6 +56,7 @@ func MigrateStore(ctx context.Context, storeService corestoretypes.KVStoreServic govParams.OptimisticAuthorizedAddresses = defaultParams.OptimisticAuthorizedAddresses govParams.OptimisticRejectedThreshold = defaultParams.OptimisticRejectedThreshold govParams.ProposalCancelMaxPeriod = defaultParams.ProposalCancelMaxPeriod + govParams.ProposalExecutionGas = defaultParams.ProposalExecutionGas return paramsCollection.Set(ctx, govParams) } diff --git a/x/gov/proto/cosmos/gov/v1/gov.proto b/x/gov/proto/cosmos/gov/v1/gov.proto index e402e5cff0be..0a76009c4179 100644 --- a/x/gov/proto/cosmos/gov/v1/gov.proto +++ b/x/gov/proto/cosmos/gov/v1/gov.proto @@ -342,7 +342,9 @@ message Params { // Minimum percentage of total stake needed to vote for a result to be // considered valid for an expedited proposal. - string expedited_quorum = 21 [(cosmos_proto.scalar) = "cosmos.Dec", (cosmos_proto.field_added_in) = "x/gov v0.2.0"]; + string expedited_quorum = 21 [(cosmos_proto.scalar) = "cosmos.Dec", (cosmos_proto.field_added_in) = "x/gov v1.0.0"]; + + uint64 proposal_execution_gas = 22 [(cosmos_proto.field_added_in) = "x/gov v0.2.0"]; } // MessageBasedParams defines the parameters of specific messages in a proposal. @@ -365,4 +367,4 @@ message MessageBasedParams { // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. string veto_threshold = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; -} \ No newline at end of file +} diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index f029f692f07d..6363a3a5548d 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -194,6 +194,7 @@ func RandomizedGenState(simState *module.SimulationState) { minDepositRatio.String(), optimisticRejectedThreshold.String(), []string{}, + 10_000_000, ), ) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 80797e0381ec..c1d9c97e3e76 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -1003,7 +1003,8 @@ type Params struct { YesQuorum string `protobuf:"bytes,20,opt,name=yes_quorum,json=yesQuorum,proto3" json:"yes_quorum,omitempty"` // Minimum percentage of total stake needed to vote for a result to be // considered valid for an expedited proposal. - ExpeditedQuorum string `protobuf:"bytes,21,opt,name=expedited_quorum,json=expeditedQuorum,proto3" json:"expedited_quorum,omitempty"` + ExpeditedQuorum string `protobuf:"bytes,21,opt,name=expedited_quorum,json=expeditedQuorum,proto3" json:"expedited_quorum,omitempty"` + ProposalExecutionGas uint64 `protobuf:"varint,22,opt,name=proposal_execution_gas,json=proposalExecutionGas,proto3" json:"proposal_execution_gas,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -1186,6 +1187,13 @@ func (m *Params) GetExpeditedQuorum() string { return "" } +func (m *Params) GetProposalExecutionGas() uint64 { + if m != nil { + return m.ProposalExecutionGas + } + return 0 +} + // MessageBasedParams defines the parameters of specific messages in a proposal. // It is used to define the parameters of a proposal that is based on a specific message. // Once a message has message based params, it only supports a standard proposal type. @@ -1291,131 +1299,133 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1971 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0xdb, 0xc8, - 0x15, 0x0e, 0x25, 0x59, 0xb6, 0x9e, 0x25, 0x99, 0x1e, 0xdb, 0x6b, 0xc6, 0x5e, 0xcb, 0x8e, 0x50, - 0x2c, 0xdc, 0xec, 0x5a, 0xb2, 0xb3, 0x75, 0xbb, 0x4d, 0x37, 0x07, 0xc9, 0x62, 0x36, 0x0c, 0x62, - 0x4b, 0xa5, 0x18, 0x27, 0x69, 0x51, 0x10, 0xb4, 0x39, 0xb1, 0xb9, 0x2b, 0x72, 0x54, 0x72, 0x64, - 0xc7, 0xfd, 0x2b, 0xf6, 0xd8, 0x53, 0xd1, 0x5b, 0xf7, 0xd8, 0x43, 0xd0, 0x7b, 0x6f, 0x8b, 0x1e, - 0x8a, 0x45, 0x4e, 0xc5, 0x02, 0x4d, 0x8b, 0xe4, 0x50, 0x60, 0xff, 0x84, 0xa2, 0x40, 0x8b, 0x19, - 0x0e, 0x45, 0xea, 0x87, 0x63, 0x79, 0xd1, 0x4b, 0x22, 0xcf, 0xfb, 0xbe, 0x6f, 0xde, 0xbc, 0x5f, - 0x33, 0x12, 0x2c, 0x1f, 0x93, 0xc0, 0x25, 0x41, 0xf5, 0x84, 0x9c, 0x55, 0xcf, 0x76, 0xd8, 0x7f, - 0x95, 0xae, 0x4f, 0x28, 0x41, 0x85, 0xd0, 0x50, 0x61, 0x2b, 0x67, 0x3b, 0x2b, 0x25, 0x81, 0x3b, - 0xb2, 0x02, 0x5c, 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xeb, 0xae, 0x28, 0x84, - 0x15, 0x00, 0x00, + // 2006 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4d, 0x6f, 0xdb, 0xc8, + 0x19, 0x0e, 0x25, 0xf9, 0x43, 0xaf, 0x25, 0x99, 0x1e, 0xdb, 0x31, 0x63, 0xaf, 0x3f, 0x62, 0x14, + 0x0b, 0x37, 0xbb, 0x96, 0xec, 0x6c, 0xdd, 0x6e, 0xd3, 0xcd, 0x41, 0xb2, 0x98, 0x84, 0x41, 0x6c, + 0xa9, 0x14, 0xe3, 0x24, 0x2d, 0x0a, 0x82, 0x36, 0x27, 0x32, 0x77, 0x45, 0x8e, 0x4a, 0x8e, 0x6c, + 0xab, 0xbf, 0x62, 0x8f, 0x3d, 0x15, 0xbd, 0x75, 0x8f, 0x3d, 0x04, 0xbd, 0xf7, 0xd4, 0x45, 0x0f, + 0xc5, 0x22, 0xa7, 0x62, 0x81, 0xa6, 0x45, 0x72, 0x28, 0xb0, 0x3f, 0xa1, 0xe8, 0xa1, 0x98, 0xe1, + 0x50, 0xa4, 0x3e, 0x1c, 0xcb, 0x8b, 0x5e, 0x12, 0x79, 0xe6, 0x79, 0x9e, 0x79, 0xe7, 0xfd, 0x9a, + 0x57, 0x82, 0xa5, 0x13, 0x12, 0xb8, 0x24, 0x28, 0x35, 0xc9, 0x59, 0xe9, 0x6c, 0x97, 0xfd, 0x57, + 0x6c, 0xfb, 0x84, 0x12, 0x94, 0x0f, 0x37, 0x8a, 0x6c, 0xe5, 0x6c, 0x77, 0x79, 0x4d, 0xe0, 0x8e, + 0xad, 0x00, 0x97, 0xce, 0x76, 0x8f, 0x31, 0xb5, 0x76, 0x4b, 0x27, 0xc4, 0xf1, 0x42, 0xf8, 0xf2, + 0x42, 0x93, 0x34, 0x09, 0xff, 0x58, 0x62, 0x9f, 0xc4, 0xea, 0x7a, 0x93, 0x90, 0x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ed, 0x67, 0x61, 0x2a, 0x8a, 0x30, 0x15, 0xf7, 0x89, 0xe3, 0x55, 0xb2, 0x5f, + 0xbf, 0x59, 0xbf, 0xf1, 0xd5, 0xbf, 0xff, 0x78, 0x47, 0xd2, 0x05, 0x67, 0xf3, 0xcf, 0x53, 0x30, + 0x5d, 0x17, 0x46, 0xa0, 0x02, 0xa4, 0x7a, 0xa6, 0xa5, 0x1c, 0x1b, 0xed, 0xc0, 0xb4, 0x8b, 0x83, + 0xc0, 0x6a, 0xe2, 0x40, 0x49, 0x71, 0xf1, 0x85, 0x62, 0x18, 0x91, 0x62, 0x14, 0x91, 0x62, 0xd9, + 0xeb, 0xea, 0x3d, 0x14, 0xda, 0x83, 0xc9, 0x80, 0x5a, 0xb4, 0x13, 0x28, 0x69, 0xee, 0xcc, 0xd5, + 0x01, 0x67, 0x46, 0x47, 0x35, 0x38, 0x48, 0x17, 0x60, 0xf4, 0x08, 0xd0, 0x4b, 0xc7, 0xb3, 0x5a, + 0x26, 0xb5, 0x5a, 0xad, 0xae, 0xe9, 0xe3, 0xa0, 0xd3, 0xa2, 0x4a, 0x66, 0x43, 0xda, 0x9a, 0xb9, + 0xbb, 0x3c, 0x20, 0x61, 0x30, 0x88, 0xce, 0x11, 0xba, 0xcc, 0x59, 0x89, 0x15, 0x54, 0x86, 0x99, + 0xa0, 0x73, 0xec, 0x3a, 0xd4, 0x64, 0x69, 0xa6, 0x4c, 0x08, 0x89, 0x41, 0xab, 0x8d, 0x28, 0x07, + 0x2b, 0x99, 0x2f, 0xff, 0xb9, 0x2e, 0xe9, 0x10, 0x92, 0xd8, 0x32, 0x7a, 0x0c, 0xb2, 0xf0, 0xae, + 0x89, 0x3d, 0x3b, 0xd4, 0x99, 0x1c, 0x53, 0xa7, 0x20, 0x98, 0xaa, 0x67, 0x73, 0x2d, 0x0d, 0xf2, + 0x94, 0x50, 0xab, 0x65, 0x8a, 0x75, 0x65, 0xea, 0x1a, 0x31, 0xca, 0x71, 0x6a, 0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, 0x10, 0x4b, + 0xae, 0xb9, 0xcc, 0x15, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -2011,6 +2021,13 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ProposalExecutionGas != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalExecutionGas)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } if len(m.ExpeditedQuorum) > 0 { i -= len(m.ExpeditedQuorum) copy(dAtA[i:], m.ExpeditedQuorum) @@ -2638,6 +2655,9 @@ func (m *Params) Size() (n int) { if l > 0 { n += 2 + l + sovGov(uint64(l)) } + if m.ProposalExecutionGas != 0 { + n += 2 + sovGov(uint64(m.ProposalExecutionGas)) + } return n } @@ -5195,6 +5215,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.ExpeditedQuorum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalExecutionGas", wireType) + } + m.ProposalExecutionGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalExecutionGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 1f594e368cca..0bddd772fb3f 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -19,24 +19,25 @@ const ( // Default governance params var ( - DefaultMinDepositTokens = sdkmath.NewInt(10000000) - DefaultMinExpeditedDepositTokens = DefaultMinDepositTokens.Mul(sdkmath.NewInt(DefaultMinExpeditedDepositTokensRatio)) - DefaultQuorum = sdkmath.LegacyNewDecWithPrec(334, 3) - DefaultYesQuorum = sdkmath.LegacyNewDecWithPrec(0, 1) - DefaultExpeditedQuorum = sdkmath.LegacyNewDecWithPrec(500, 3) - DefaultThreshold = sdkmath.LegacyNewDecWithPrec(5, 1) - DefaultExpeditedThreshold = sdkmath.LegacyNewDecWithPrec(667, 3) - DefaultVetoThreshold = sdkmath.LegacyNewDecWithPrec(334, 3) - DefaultMinInitialDepositRatio = sdkmath.LegacyZeroDec() - DefaultProposalCancelRatio = sdkmath.LegacyMustNewDecFromStr("0.5") - DefaultProposalCancelDestAddress = "" - DefaultProposalCancelMaxPeriod = sdkmath.LegacyMustNewDecFromStr("0.5") - DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) - DefaultBurnVoteQuorum = false // set to false to replicate behavior of when this change was made (0.47) - DefaultBurnVoteVeto = true // set to true to replicate behavior of when this change was made (0.47) - DefaultMinDepositRatio = sdkmath.LegacyMustNewDecFromStr("0.01") - DefaultOptimisticRejectedThreshold = sdkmath.LegacyMustNewDecFromStr("0.1") - DefaultOptimisticAuthorizedAddreses = []string(nil) + DefaultMinDepositTokens = sdkmath.NewInt(10000000) + DefaultMinExpeditedDepositTokens = DefaultMinDepositTokens.Mul(sdkmath.NewInt(DefaultMinExpeditedDepositTokensRatio)) + DefaultQuorum = sdkmath.LegacyNewDecWithPrec(334, 3) + DefaultYesQuorum = sdkmath.LegacyNewDecWithPrec(0, 1) + DefaultExpeditedQuorum = sdkmath.LegacyNewDecWithPrec(500, 3) + DefaultThreshold = sdkmath.LegacyNewDecWithPrec(5, 1) + DefaultExpeditedThreshold = sdkmath.LegacyNewDecWithPrec(667, 3) + DefaultVetoThreshold = sdkmath.LegacyNewDecWithPrec(334, 3) + DefaultMinInitialDepositRatio = sdkmath.LegacyZeroDec() + DefaultProposalCancelRatio = sdkmath.LegacyMustNewDecFromStr("0.5") + DefaultProposalCancelDestAddress = "" + DefaultProposalCancelMaxPeriod = sdkmath.LegacyMustNewDecFromStr("0.5") + DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) + DefaultBurnVoteQuorum = false // set to false to replicate behavior of when this change was made (0.47) + DefaultBurnVoteVeto = true // set to true to replicate behavior of when this change was made (0.47) + DefaultMinDepositRatio = sdkmath.LegacyMustNewDecFromStr("0.01") + DefaultOptimisticRejectedThreshold = sdkmath.LegacyMustNewDecFromStr("0.1") + DefaultOptimisticAuthorizedAddreses = []string(nil) + DefaultProposalExecutionGas uint64 = 10_000_000 // ten million ) // NewParams creates a new Params instance with given values. @@ -47,6 +48,7 @@ func NewParams( burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, minDepositRatio, optimisticRejectedThreshold string, optimisticAuthorizedAddresses []string, + proposalExecutionGas uint64, ) Params { return Params{ MinDeposit: minDeposit, @@ -70,6 +72,7 @@ func NewParams( MinDepositRatio: minDepositRatio, OptimisticRejectedThreshold: optimisticRejectedThreshold, OptimisticAuthorizedAddresses: optimisticAuthorizedAddresses, + ProposalExecutionGas: proposalExecutionGas, } } @@ -97,6 +100,7 @@ func DefaultParams() Params { DefaultMinDepositRatio.String(), DefaultOptimisticRejectedThreshold.String(), DefaultOptimisticAuthorizedAddreses, + DefaultProposalExecutionGas, ) } @@ -266,6 +270,10 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error { } } + if p.ProposalExecutionGas == 0 { + return fmt.Errorf("proposal execution gas must be positive: %d", p.ProposalExecutionGas) + } + return nil } From 40492cdf10d3fe7a011f3ae004bea3ac76b7c028 Mon Sep 17 00:00:00 2001 From: testinginprod <98415576+testinginprod@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:19:13 +0200 Subject: [PATCH 02/11] feat(accounts): add genesis account initialization (#20642) Co-authored-by: unknown unknown --- api/cosmos/accounts/v1/genesis.pulsar.go | 235 +++++++++++++----- x/accounts/README.md | 47 +++- x/accounts/cli/cli.go | 11 + x/accounts/genesis.go | 40 +-- x/accounts/genesis_test.go | 20 +- x/accounts/keeper.go | 18 ++ x/accounts/msg_server.go | 17 +- .../proto/cosmos/accounts/v1/genesis.proto | 8 +- x/accounts/v1/genesis.pb.go | 116 +++++---- 9 files changed, 362 insertions(+), 150 deletions(-) diff --git a/api/cosmos/accounts/v1/genesis.pulsar.go b/api/cosmos/accounts/v1/genesis.pulsar.go index 0dcbfa57eea6..73fcc1ae59dc 100644 --- a/api/cosmos/accounts/v1/genesis.pulsar.go +++ b/api/cosmos/accounts/v1/genesis.pulsar.go @@ -12,10 +12,61 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_GenesisState_1_list)(nil) + +type _GenesisState_1_list struct { + list *[]*GenesisAccount +} + +func (x *_GenesisState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GenesisAccount) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GenesisAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { + v := new(GenesisAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_1_list) NewElement() protoreflect.Value { + v := new(GenesisAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) IsValid() bool { + return x.list != nil +} + var _ protoreflect.List = (*_GenesisState_2_list)(nil) type _GenesisState_2_list struct { - list *[]*GenesisAccount + list *[]*MsgInit } func (x *_GenesisState_2_list) Len() int { @@ -31,18 +82,18 @@ func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*GenesisAccount) + concreteValue := valueUnwrapped.Interface().(*MsgInit) (*x.list)[i] = concreteValue } func (x *_GenesisState_2_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*GenesisAccount) + concreteValue := valueUnwrapped.Interface().(*MsgInit) *x.list = append(*x.list, concreteValue) } func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { - v := new(GenesisAccount) + v := new(MsgInit) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } @@ -55,7 +106,7 @@ func (x *_GenesisState_2_list) Truncate(n int) { } func (x *_GenesisState_2_list) NewElement() protoreflect.Value { - v := new(GenesisAccount) + v := new(MsgInit) return protoreflect.ValueOfMessage(v.ProtoReflect()) } @@ -64,16 +115,16 @@ func (x *_GenesisState_2_list) IsValid() bool { } var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_account_number protoreflect.FieldDescriptor - fd_GenesisState_accounts protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_accounts protoreflect.FieldDescriptor + fd_GenesisState_init_account_msgs protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_v1_genesis_proto_init() md_GenesisState = File_cosmos_accounts_v1_genesis_proto.Messages().ByName("GenesisState") - fd_GenesisState_account_number = md_GenesisState.Fields().ByName("account_number") fd_GenesisState_accounts = md_GenesisState.Fields().ByName("accounts") + fd_GenesisState_init_account_msgs = md_GenesisState.Fields().ByName("init_account_msgs") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -141,15 +192,15 @@ func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.AccountNumber != uint64(0) { - value := protoreflect.ValueOfUint64(x.AccountNumber) - if !f(fd_GenesisState_account_number, value) { + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.Accounts}) + if !f(fd_GenesisState_accounts, value) { return } } - if len(x.Accounts) != 0 { - value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Accounts}) - if !f(fd_GenesisState_accounts, value) { + if len(x.InitAccountMsgs) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.InitAccountMsgs}) + if !f(fd_GenesisState_init_account_msgs, value) { return } } @@ -168,10 +219,10 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, // a repeated field is populated if it is non-empty. func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.v1.GenesisState.account_number": - return x.AccountNumber != uint64(0) case "cosmos.accounts.v1.GenesisState.accounts": return len(x.Accounts) != 0 + case "cosmos.accounts.v1.GenesisState.init_account_msgs": + return len(x.InitAccountMsgs) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.GenesisState")) @@ -188,10 +239,10 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.v1.GenesisState.account_number": - x.AccountNumber = uint64(0) case "cosmos.accounts.v1.GenesisState.accounts": x.Accounts = nil + case "cosmos.accounts.v1.GenesisState.init_account_msgs": + x.InitAccountMsgs = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.GenesisState")) @@ -208,14 +259,17 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.v1.GenesisState.account_number": - value := x.AccountNumber - return protoreflect.ValueOfUint64(value) case "cosmos.accounts.v1.GenesisState.accounts": if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_GenesisState_1_list{}) + } + listValue := &_GenesisState_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.GenesisState.init_account_msgs": + if len(x.InitAccountMsgs) == 0 { return protoreflect.ValueOfList(&_GenesisState_2_list{}) } - listValue := &_GenesisState_2_list{list: &x.Accounts} + listValue := &_GenesisState_2_list{list: &x.InitAccountMsgs} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -237,12 +291,14 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.v1.GenesisState.account_number": - x.AccountNumber = value.Uint() case "cosmos.accounts.v1.GenesisState.accounts": lv := value.List() - clv := lv.(*_GenesisState_2_list) + clv := lv.(*_GenesisState_1_list) x.Accounts = *clv.list + case "cosmos.accounts.v1.GenesisState.init_account_msgs": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.InitAccountMsgs = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.GenesisState")) @@ -267,10 +323,14 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p if x.Accounts == nil { x.Accounts = []*GenesisAccount{} } - value := &_GenesisState_2_list{list: &x.Accounts} + value := &_GenesisState_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.GenesisState.init_account_msgs": + if x.InitAccountMsgs == nil { + x.InitAccountMsgs = []*MsgInit{} + } + value := &_GenesisState_2_list{list: &x.InitAccountMsgs} return protoreflect.ValueOfList(value) - case "cosmos.accounts.v1.GenesisState.account_number": - panic(fmt.Errorf("field account_number of message cosmos.accounts.v1.GenesisState is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.GenesisState")) @@ -284,10 +344,11 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.GenesisState.account_number": - return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.v1.GenesisState.accounts": list := []*GenesisAccount{} + return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) + case "cosmos.accounts.v1.GenesisState.init_account_msgs": + list := []*MsgInit{} return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { @@ -358,15 +419,18 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.AccountNumber != 0 { - n += 1 + runtime.Sov(uint64(x.AccountNumber)) - } if len(x.Accounts) > 0 { for _, e := range x.Accounts { l = options.Size(e) n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.InitAccountMsgs) > 0 { + for _, e := range x.InitAccountMsgs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -396,6 +460,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.InitAccountMsgs) > 0 { + for iNdEx := len(x.InitAccountMsgs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.InitAccountMsgs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } if len(x.Accounts) > 0 { for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Accounts[iNdEx]) @@ -409,14 +489,9 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } } - if x.AccountNumber != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.AccountNumber)) - i-- - dAtA[i] = 0x8 - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -467,10 +542,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) } - x.AccountNumber = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -480,14 +555,29 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.AccountNumber |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Accounts = append(x.Accounts, &GenesisAccount{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitAccountMsgs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -514,8 +604,8 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Accounts = append(x.Accounts, &GenesisAccount{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); err != nil { + x.InitAccountMsgs = append(x.InitAccountMsgs, &MsgInit{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitAccountMsgs[len(x.InitAccountMsgs)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -1731,10 +1821,10 @@ type GenesisState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // account_number is the latest account number. - AccountNumber uint64 `protobuf:"varint,1,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` // accounts are the genesis accounts. - Accounts []*GenesisAccount `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` + Accounts []*GenesisAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + // init_accounts_msgs defines the genesis messages that will be executed to init the account. + InitAccountMsgs []*MsgInit `protobuf:"bytes,2,rep,name=init_account_msgs,json=initAccountMsgs,proto3" json:"init_account_msgs,omitempty"` } func (x *GenesisState) Reset() { @@ -1757,16 +1847,16 @@ func (*GenesisState) Descriptor() ([]byte, []int) { return file_cosmos_accounts_v1_genesis_proto_rawDescGZIP(), []int{0} } -func (x *GenesisState) GetAccountNumber() uint64 { +func (x *GenesisState) GetAccounts() []*GenesisAccount { if x != nil { - return x.AccountNumber + return x.Accounts } - return 0 + return nil } -func (x *GenesisState) GetAccounts() []*GenesisAccount { +func (x *GenesisState) GetInitAccountMsgs() []*MsgInit { if x != nil { - return x.Accounts + return x.InitAccountMsgs } return nil } @@ -1887,14 +1977,18 @@ var file_cosmos_accounts_v1_genesis_proto_rawDesc = []byte{ 0x0a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x75, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3e, 0x0a, - 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xa6, 0x01, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x11, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x0f, 0x69, 0x6e, + 0x69, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, @@ -1941,15 +2035,17 @@ var file_cosmos_accounts_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: cosmos.accounts.v1.GenesisState (*GenesisAccount)(nil), // 1: cosmos.accounts.v1.GenesisAccount (*KVPair)(nil), // 2: cosmos.accounts.v1.KVPair + (*MsgInit)(nil), // 3: cosmos.accounts.v1.MsgInit } var file_cosmos_accounts_v1_genesis_proto_depIdxs = []int32{ 1, // 0: cosmos.accounts.v1.GenesisState.accounts:type_name -> cosmos.accounts.v1.GenesisAccount - 2, // 1: cosmos.accounts.v1.GenesisAccount.state:type_name -> cosmos.accounts.v1.KVPair - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 1: cosmos.accounts.v1.GenesisState.init_account_msgs:type_name -> cosmos.accounts.v1.MsgInit + 2, // 2: cosmos.accounts.v1.GenesisAccount.state:type_name -> cosmos.accounts.v1.KVPair + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_cosmos_accounts_v1_genesis_proto_init() } @@ -1957,6 +2053,7 @@ func file_cosmos_accounts_v1_genesis_proto_init() { if File_cosmos_accounts_v1_genesis_proto != nil { return } + file_cosmos_accounts_v1_tx_proto_init() if !protoimpl.UnsafeEnabled { file_cosmos_accounts_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/x/accounts/README.md b/x/accounts/README.md index 9ffcbed6ede4..3bc9e1d48635 100644 --- a/x/accounts/README.md +++ b/x/accounts/README.md @@ -1,3 +1,48 @@ # x/accounts -The x/accounts module provides module and facilities for writing smart cosmos-sdk accounts. \ No newline at end of file +The x/accounts module provides module and facilities for writing smart cosmos-sdk accounts. + +# Genesis + +## Creating accounts on genesis + +In order to create accounts at genesis, the `x/accounts` module allows developers to provide +a list of genesis `MsgInit` messages that will be executed in the `x/accounts` genesis flow. + +The init messages are generated offline. You can also use the following CLI command to generate the +json messages: `simd accounts tx init [account type] [msg] --from me --genesis`. This will generate +a jsonified init message wrapped in an x/accounts `MsgInit`. + +This follows the same initialization flow and rules that would happen if the chain is running. +The only concrete difference is that this is happening at the genesis block. + +For example, given the following `genesis.json` file: + +```json +{ + "app_state": { + "accounts": { + "init_account_msgs": [ + { + "sender": "account_creator_address", + "account_type": "lockup", + "message": { + "@type": "cosmos.accounts.defaults.lockup.MsgInitLockupAccount", + "owner": "some_owner", + "end_time": "..", + "start_time": ".." + }, + "funds": [ + { + "denom": "stake", + "amount": "1000" + } + ] + } + ] + } + } +} +``` + +The accounts module will run the lockup account initialization message. \ No newline at end of file diff --git a/x/accounts/cli/cli.go b/x/accounts/cli/cli.go index a8ebbd914d21..12d7170ae821 100644 --- a/x/accounts/cli/cli.go +++ b/x/accounts/cli/cli.go @@ -75,9 +75,20 @@ func GetTxInitCmd() *cobra.Command { Message: msgBytes, } + isGenesis, err := cmd.Flags().GetBool("genesis") + if err != nil { + return err + } + + // in case the genesis flag is provided then the init message is printed. + if isGenesis { + return clientCtx.WithOutputFormat(flags.OutputFormatJSON).PrintProto(&msg) + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) }, } + cmd.Flags().Bool("genesis", false, "if true will print the json init message for genesis") flags.AddTxFlagsToCmd(cmd) return cmd } diff --git a/x/accounts/genesis.go b/x/accounts/genesis.go index 5f9ad3ee954e..047345789c09 100644 --- a/x/accounts/genesis.go +++ b/x/accounts/genesis.go @@ -11,15 +11,7 @@ import ( func (k Keeper) ExportState(ctx context.Context) (*v1.GenesisState, error) { genState := &v1.GenesisState{} - // get account number - accountNumber, err := k.AccountNumber.Peek(ctx) - if err != nil { - return nil, err - } - - genState.AccountNumber = accountNumber - - err = k.AccountsByType.Walk(ctx, nil, func(accAddr []byte, accType string) (stop bool, err error) { + err := k.AccountsByType.Walk(ctx, nil, func(accAddr []byte, accType string) (stop bool, err error) { accNum, err := k.AccountByNumber.Get(ctx, accAddr) if err != nil { return true, err @@ -64,7 +56,7 @@ func (k Keeper) exportAccount(ctx context.Context, addr []byte, accType string, } func (k Keeper) ImportState(ctx context.Context, genState *v1.GenesisState) error { - var largestNum *uint64 + lastAccountNumber := uint64(0) var err error // import accounts for _, acc := range genState.Accounts { @@ -73,19 +65,31 @@ func (k Keeper) ImportState(ctx context.Context, genState *v1.GenesisState) erro return fmt.Errorf("%w: %s", err, acc.Address) } - accNum := acc.AccountNumber - - if largestNum == nil || *largestNum < accNum { - largestNum = &accNum + // update lastAccountNumber if the current account being processed + // has a bigger account number. + if lastAccountNumber < acc.AccountNumber { + lastAccountNumber = acc.AccountNumber } } - if largestNum != nil { - // set the account number to the highest account number to avoid duplicate account number - err = k.AccountNumber.Set(ctx, *largestNum) + // we set the latest account number only if there were any genesis accounts, otherwise + // we leave it unset. + if genState.Accounts != nil { + // due to sequence semantics, we store the next account number. + err = k.AccountNumber.Set(ctx, lastAccountNumber+1) + if err != nil { + return err + } } - return err + // after this execute account creation msgs. + for index, msgInit := range genState.InitAccountMsgs { + _, _, err = k.initFromMsg(ctx, msgInit) + if err != nil { + return fmt.Errorf("invalid genesis account msg init at index %d, msg %s: %w", index, msgInit, err) + } + } + return nil } func (k Keeper) importAccount(ctx context.Context, acc *v1.GenesisAccount) error { diff --git a/x/accounts/genesis_test.go b/x/accounts/genesis_test.go index ecd44a91d00d..b9056827eb74 100644 --- a/x/accounts/genesis_test.go +++ b/x/accounts/genesis_test.go @@ -39,6 +39,15 @@ func TestGenesis(t *testing.T) { acc, err := NewTestAccount(deps) return testAccountType, acc, err }) + // add to state a genesis account init msg. + initMsg, err := implementation.PackAny(&types.Empty{}) + require.NoError(t, err) + state.InitAccountMsgs = append(state.InitAccountMsgs, &v1.MsgInit{ + Sender: "sender-2", + AccountType: testAccountType, + Message: initMsg, + Funds: nil, + }) err = k.ImportState(ctx, state) require.NoError(t, err) @@ -52,6 +61,12 @@ func TestGenesis(t *testing.T) { require.NoError(t, err) require.Equal(t, &types.UInt64Value{Value: 20}, resp) + // check initted on genesis account + addr3, err := k.makeAddress(2) + require.NoError(t, err) + resp, err = k.Query(ctx, addr3, &types.DoubleValue{}) + require.NoError(t, err) + require.Equal(t, &types.UInt64Value{Value: 0}, resp) // reset state k, ctx = newKeeper(t, func(deps implementation.Dependencies) (string, implementation.Account, error) { acc, err := NewTestAccount(deps) @@ -66,8 +81,9 @@ func TestGenesis(t *testing.T) { currentAccNum, err := k.AccountNumber.Peek(ctx) require.NoError(t, err) - // AccountNumber should be set to the highest account number in the genesis state - require.Equal(t, uint64(99), currentAccNum) + // AccountNumber should be set to the highest account number in the genesis state + 2 + // (one is the sequence offset, the other is the genesis account being added through init msg) + require.Equal(t, state.Accounts[0].AccountNumber+2, currentAccNum) } func TestImportAccountError(t *testing.T) { diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index a58c32604065..4ce0e8f0102a 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -15,6 +15,7 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/x/accounts/accountstd" "cosmossdk.io/x/accounts/internal/implementation" + v1 "cosmossdk.io/x/accounts/v1" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -156,6 +157,23 @@ func (k Keeper) Init( return initResp, accountAddr, nil } +// initFromMsg is a helper which inits an account given a v1.MsgInit. +func (k Keeper) initFromMsg(ctx context.Context, initMsg *v1.MsgInit) (implementation.ProtoMsg, []byte, error) { + creator, err := k.addressCodec.StringToBytes(initMsg.Sender) + if err != nil { + return nil, nil, err + } + + // decode message bytes into the concrete boxed message type + msg, err := implementation.UnpackAnyRaw(initMsg.Message) + if err != nil { + return nil, nil, err + } + + // run account creation logic + return k.Init(ctx, initMsg.AccountType, creator, msg, initMsg.Funds) +} + // init initializes the account, given the type, the creator the newly created account number, its address and the // initialization message. func (k Keeper) init( diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 182d7025d119..372941cece0e 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -2,6 +2,7 @@ package accounts import ( "context" + "fmt" "cosmossdk.io/core/event" "cosmossdk.io/x/accounts/internal/implementation" @@ -19,21 +20,9 @@ type msgServer struct { } func (m msgServer) Init(ctx context.Context, request *v1.MsgInit) (*v1.MsgInitResponse, error) { - creator, err := m.k.addressCodec.StringToBytes(request.Sender) + resp, accAddr, err := m.k.initFromMsg(ctx, request) if err != nil { - return nil, err - } - - // decode message bytes into the concrete boxed message type - msg, err := implementation.UnpackAnyRaw(request.Message) - if err != nil { - return nil, err - } - - // run account creation logic - resp, accAddr, err := m.k.Init(ctx, request.AccountType, creator, msg, request.Funds) - if err != nil { - return nil, err + return nil, fmt.Errorf("unable to initialize account: %w", err) } // encode the address diff --git a/x/accounts/proto/cosmos/accounts/v1/genesis.proto b/x/accounts/proto/cosmos/accounts/v1/genesis.proto index 83e9dc385b44..dc7d7a52d480 100644 --- a/x/accounts/proto/cosmos/accounts/v1/genesis.proto +++ b/x/accounts/proto/cosmos/accounts/v1/genesis.proto @@ -4,12 +4,14 @@ package cosmos.accounts.v1; option go_package = "cosmossdk.io/x/accounts/v1"; +import "cosmos/accounts/v1/tx.proto"; + // GenesisState defines the accounts' module's genesis state. message GenesisState { - // account_number is the latest account number. - uint64 account_number = 1; // accounts are the genesis accounts. - repeated GenesisAccount accounts = 2; + repeated GenesisAccount accounts = 1; + // init_accounts_msgs defines the genesis messages that will be executed to init the account. + repeated cosmos.accounts.v1.MsgInit init_account_msgs = 2; } // GenesisAccount defines an account to be initialized in the genesis state. diff --git a/x/accounts/v1/genesis.pb.go b/x/accounts/v1/genesis.pb.go index b06b43e903df..fba3f5832e9f 100644 --- a/x/accounts/v1/genesis.pb.go +++ b/x/accounts/v1/genesis.pb.go @@ -24,10 +24,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the accounts' module's genesis state. type GenesisState struct { - // account_number is the latest account number. - AccountNumber uint64 `protobuf:"varint,1,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` // accounts are the genesis accounts. - Accounts []*GenesisAccount `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` + Accounts []*GenesisAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + // init_accounts_msgs defines the genesis messages that will be executed to init the account. + InitAccountMsgs []*MsgInit `protobuf:"bytes,2,rep,name=init_account_msgs,json=initAccountMsgs,proto3" json:"init_account_msgs,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -63,16 +63,16 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetAccountNumber() uint64 { +func (m *GenesisState) GetAccounts() []*GenesisAccount { if m != nil { - return m.AccountNumber + return m.Accounts } - return 0 + return nil } -func (m *GenesisState) GetAccounts() []*GenesisAccount { +func (m *GenesisState) GetInitAccountMsgs() []*MsgInit { if m != nil { - return m.Accounts + return m.InitAccountMsgs } return nil } @@ -214,25 +214,28 @@ func init() { func init() { proto.RegisterFile("cosmos/accounts/v1/genesis.proto", fileDescriptor_409859d32eae9438) } var fileDescriptor_409859d32eae9438 = []byte{ - // 285 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, - 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa8, - 0xd0, 0x83, 0xa9, 0xd0, 0x2b, 0x33, 0x54, 0x2a, 0xe5, 0xe2, 0x71, 0x87, 0x28, 0x0a, 0x2e, 0x49, - 0x2c, 0x49, 0x15, 0x52, 0xe5, 0xe2, 0x83, 0x4a, 0xc7, 0xe7, 0x95, 0xe6, 0x26, 0xa5, 0x16, 0x49, - 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0xf1, 0x42, 0x45, 0xfd, 0xc0, 0x82, 0x42, 0x76, 0x5c, 0x1c, - 0x30, 0x53, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0x94, 0xf4, 0x30, 0x4d, 0xd7, 0x83, 0x1a, - 0xed, 0x08, 0x11, 0x0a, 0x82, 0xeb, 0x51, 0x5a, 0xc6, 0xc8, 0xc5, 0x87, 0x2a, 0x29, 0x24, 0xc1, - 0xc5, 0x9e, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x0c, 0xb6, 0x92, 0x33, 0x08, 0xc6, 0x15, 0x52, - 0xe4, 0xe2, 0x81, 0xb9, 0xa9, 0xa4, 0xb2, 0x20, 0x55, 0x82, 0x09, 0x2c, 0xcd, 0x0d, 0x15, 0x0b, - 0xa9, 0x2c, 0xc0, 0xe6, 0x6c, 0x66, 0x6c, 0xce, 0x36, 0xe0, 0x62, 0x2d, 0x06, 0x79, 0x53, 0x82, - 0x05, 0xec, 0x66, 0x29, 0x6c, 0x6e, 0xf6, 0x0e, 0x0b, 0x48, 0xcc, 0x2c, 0x0a, 0x82, 0x28, 0x54, - 0x32, 0xe0, 0x62, 0x83, 0x08, 0x08, 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x82, 0xdd, 0xc6, 0x13, - 0x04, 0x62, 0x0a, 0x89, 0x70, 0xb1, 0x96, 0x25, 0xe6, 0x94, 0x42, 0x1c, 0xc4, 0x13, 0x04, 0xe1, - 0x38, 0x99, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, - 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x14, 0xc4, 0xb6, - 0xe2, 0x94, 0x6c, 0xbd, 0xcc, 0x7c, 0xfd, 0x0a, 0xe4, 0x98, 0x4a, 0x62, 0x03, 0x47, 0x91, 0x31, - 0x20, 0x00, 0x00, 0xff, 0xff, 0x52, 0xae, 0xf2, 0xc5, 0xc6, 0x01, 0x00, 0x00, + // 331 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcd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x1b, 0xe9, 0x09, 0x58, 0xd9, 0x42, 0xb5, 0x9a, 0x71, 0xbb, 0xa8, 0x7f, + 0xd7, 0x52, 0xf6, 0xb8, 0x9a, 0x71, 0x7a, 0x0a, 0xf5, 0x4c, 0x12, 0xcd, 0xa7, 0x43, 0x1e, 0xdb, + 0xa5, 0x16, 0x69, 0x97, 0xd9, 0x7e, 0x4a, 0xef, 0x34, 0xa4, 0x1d, 0xa8, 0x60, 0xf2, 0x10, 0x76, + 0x59, 0x77, 0x6e, 0xe4, 0x75, 0xbe, 0x7d, 0xba, 0x0f, 0x44, 0xcc, 0x8c, 0xd0, 0xed, 0x40, 0xd5, + 0x00, 0x7a, 0x08, 0xa5, 0x09, 0x5f, 0xe9, 0x6e, 0x16, 0x4b, 0x3e, 0xe9, 0x31, 0x54, 0x16, 0xc1, + 0xcb, 0xdc, 0x14, 0xb2, 0x98, 0x19, 0xae, 0x2f, 0x3e, 0x36, 0x0e, 0x59, 0x6f, 0x1c, 0xf2, 0xb5, + 0x71, 0xc8, 0xeb, 0xd6, 0x29, 0xac, 0xb7, 0x4e, 0xe1, 0x73, 0xeb, 0x14, 0x9e, 0x1b, 0x66, 0x1b, + 0x8e, 0x27, 0x9e, 0x90, 0xfe, 0xf2, 0xf7, 0xcd, 0x86, 0x55, 0x7d, 0xb1, 0xf3, 0xef, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x06, 0xd4, 0x9c, 0x6a, 0x06, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -255,6 +258,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.InitAccountMsgs) > 0 { + for iNdEx := len(m.InitAccountMsgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitAccountMsgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } if len(m.Accounts) > 0 { for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { { @@ -266,14 +283,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } } - if m.AccountNumber != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.AccountNumber)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } @@ -387,15 +399,18 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if m.AccountNumber != 0 { - n += 1 + sovGenesis(uint64(m.AccountNumber)) - } if len(m.Accounts) > 0 { for _, e := range m.Accounts { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.InitAccountMsgs) > 0 { + for _, e := range m.InitAccountMsgs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -478,10 +493,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) } - m.AccountNumber = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -491,14 +506,29 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AccountNumber |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, &GenesisAccount{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitAccountMsgs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -525,8 +555,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Accounts = append(m.Accounts, &GenesisAccount{}) - if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.InitAccountMsgs = append(m.InitAccountMsgs, &MsgInit{}) + if err := m.InitAccountMsgs[len(m.InitAccountMsgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From abeb7eee3b644d8e5551089e625a3dacd79a0e89 Mon Sep 17 00:00:00 2001 From: son trinh Date: Wed, 12 Jun 2024 23:25:02 +0700 Subject: [PATCH 03/11] fix (x/accounts): Fix genesis condition check (#20645) --- x/accounts/genesis.go | 2 +- x/accounts/genesis_test.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/x/accounts/genesis.go b/x/accounts/genesis.go index 047345789c09..7279a25cf405 100644 --- a/x/accounts/genesis.go +++ b/x/accounts/genesis.go @@ -74,7 +74,7 @@ func (k Keeper) ImportState(ctx context.Context, genState *v1.GenesisState) erro // we set the latest account number only if there were any genesis accounts, otherwise // we leave it unset. - if genState.Accounts != nil { + if len(genState.Accounts) != 0 { // due to sequence semantics, we store the next account number. err = k.AccountNumber.Set(ctx, lastAccountNumber+1) if err != nil { diff --git a/x/accounts/genesis_test.go b/x/accounts/genesis_test.go index b9056827eb74..14c2470d84bd 100644 --- a/x/accounts/genesis_test.go +++ b/x/accounts/genesis_test.go @@ -84,6 +84,23 @@ func TestGenesis(t *testing.T) { // AccountNumber should be set to the highest account number in the genesis state + 2 // (one is the sequence offset, the other is the genesis account being added through init msg) require.Equal(t, state.Accounts[0].AccountNumber+2, currentAccNum) + + // Test when init with empty accounts list, account number is not modified + // make genesis state accounts empty + state.Accounts = []*v1.GenesisAccount{} + + // set another value for account number + err = k.AccountNumber.Set(ctx, uint64(10)) + require.NoError(t, err) + + err = k.ImportState(ctx, state) + require.NoError(t, err) + + currentAccNum, err = k.AccountNumber.Peek(ctx) + require.NoError(t, err) + // AccountNumber should be 10 + 1 + // (one is the genesis account being added through init msg) + require.Equal(t, uint64(11), currentAccNum) } func TestImportAccountError(t *testing.T) { From b22269dde1b1fa549eeb30307093a6cbcfa5526a Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 13 Jun 2024 01:48:08 +0800 Subject: [PATCH 04/11] fix(store): avoid nil error on not exhausted payload stream (#20644) Co-authored-by: Marko --- store/CHANGELOG.md | 1 + store/snapshots/manager.go | 2 +- store/v2/snapshots/manager.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 84b2a0d35eb3..6cf411505792 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -28,6 +28,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (store) [#20425](https://github.com/cosmos/cosmos-sdk/pull/20425) Fix nil pointer panic when query historical state where a new store don't exist. +* (store) [#20644](https://github.com/cosmos/cosmos-sdk/pull/20644) Avoid nil error on not exhausted payload stream. ## v1.1.0 (March 20, 2024) diff --git a/store/snapshots/manager.go b/store/snapshots/manager.go index a6f82190c537..6c7816705b8c 100644 --- a/store/snapshots/manager.go +++ b/store/snapshots/manager.go @@ -390,7 +390,7 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io. } if nextItem.GetExtensionPayload() != nil { - return errorsmod.Wrapf(err, "extension %s don't exhausted payload stream", metadata.Name) + return fmt.Errorf("extension %s don't exhausted payload stream", metadata.Name) } } return nil diff --git a/store/v2/snapshots/manager.go b/store/v2/snapshots/manager.go index b4eca52d4b9c..75e6e4ad616c 100644 --- a/store/v2/snapshots/manager.go +++ b/store/v2/snapshots/manager.go @@ -438,7 +438,7 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io. } if nextItem.GetExtensionPayload() != nil { - return errorsmod.Wrapf(err, "extension %s don't exhausted payload stream", metadata.Name) + return fmt.Errorf("extension %s don't exhausted payload stream", metadata.Name) } } From c36edbddbdf5ece3eb9f16f41f7721b3fcf9e9c8 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Wed, 12 Jun 2024 14:07:10 -0400 Subject: [PATCH 05/11] fix(x/consensus): fix .proto file placement (#20646) --- scripts/go-lint-all.bash | 2 +- .../cosmos/consensus/v1/consensus.proto | 0 x/consensus/types/consensus.pb.go | 46 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) rename {proto => x/consensus/proto}/cosmos/consensus/v1/consensus.proto (100%) diff --git a/scripts/go-lint-all.bash b/scripts/go-lint-all.bash index 601a51df390f..48d31d809ee5 100755 --- a/scripts/go-lint-all.bash +++ b/scripts/go-lint-all.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e -o pipefail +set -e REPO_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" export REPO_ROOT diff --git a/proto/cosmos/consensus/v1/consensus.proto b/x/consensus/proto/cosmos/consensus/v1/consensus.proto similarity index 100% rename from proto/cosmos/consensus/v1/consensus.proto rename to x/consensus/proto/cosmos/consensus/v1/consensus.proto diff --git a/x/consensus/types/consensus.pb.go b/x/consensus/types/consensus.pb.go index e100d31e3bf7..3545af8cac9f 100644 --- a/x/consensus/types/consensus.pb.go +++ b/x/consensus/types/consensus.pb.go @@ -168,29 +168,29 @@ func init() { } var fileDescriptor_7ed86dd7d42fb61b = []byte{ - // 349 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0xd2, 0xcb, 0x4e, 0x02, 0x31, - 0x14, 0x06, 0x60, 0x86, 0xab, 0xd6, 0x5d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 0xdc, 0x0f, 0x25, 0xcf, - 0x50, 0x55, 0xfb, 0x76, 0xd1, 0x93, 0x5d, 0xc6, 0x16, 0xd8, 0x20, 0x78, 0x09, 0xaa, 0x61, 0x44, - 0x63, 0x54, 0xd3, 0xf8, 0xb0, 0x00, 0xdf, 0x06, 0xdd, 0x47, 0xe3, 0x82, 0x32, 0xf2, 0x7a, 0x3a, - 0xae, 0x1a, 0x8b, 0x79, 0x42, 0x47, 0x19, 0x4f, 0xe6, 0xa8, 0xbe, 0xb5, 0xf1, 0x8b, 0xcb, 0xb8, - 0xc6, 0x6b, 0xa4, 0x66, 0x3d, 0x60, 0xa1, 0x9c, 0x65, 0x0c, 0x35, 0xb6, 0xce, 0xfa, 0xde, 0x24, - 0xdc, 0xac, 0x2d, 0x68, 0x1f, 0x80, 0xe6, 0xff, 0xaf, 0xd7, 0x63, 0x22, 0x55, 0x87, 0xc1, 0xc3, - 0xd7, 0x12, 0x7b, 0x8b, 0x25, 0xf6, 0x7e, 0x96, 0xd8, 0xfb, 0x58, 0xe1, 0xd2, 0x62, 0x85, 0x4b, - 0xdf, 0x2b, 0x5c, 0x7a, 0x23, 0xc3, 0x58, 0x8e, 0x66, 0x91, 0x6a, 0xe4, 0xaf, 0x77, 0x4b, 0xfd, - 0x9c, 0x8a, 0xfe, 0xd8, 0x7f, 0xff, 0xb3, 0x68, 0xfa, 0x05, 0x51, 0x5d, 0x6f, 0xcb, 0xf9, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0x8b, 0x65, 0x41, 0x89, 0x02, 0x00, 0x00, + // 340 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0xd2, 0xcb, 0x4a, 0x33, 0x31, + 0x14, 0x07, 0xf0, 0x4e, 0xaf, 0xdf, 0x17, 0x77, 0x71, 0x13, 0x8a, 0x86, 0x5a, 0x37, 0xae, 0x32, + 0xd4, 0x0b, 0x88, 0x20, 0xe8, 0x14, 0x05, 0x17, 0x82, 0x54, 0x70, 0xe1, 0x6e, 0x26, 0x4d, 0x75, + 0x68, 0x3b, 0x19, 0x92, 0x34, 0xd8, 0xb7, 0xf0, 0x81, 0x7c, 0x00, 0x97, 0x5d, 0xba, 0x94, 0xf6, + 0x45, 0x64, 0x72, 0x69, 0x05, 0xa7, 0xcb, 0x49, 0xfe, 0xbf, 0x73, 0x86, 0x93, 0x03, 0x0e, 0x29, + 0x97, 0x53, 0x2e, 0x43, 0xca, 0x33, 0xc9, 0x32, 0x39, 0x93, 0xa1, 0xee, 0x6d, 0x3e, 0x48, 0x2e, + 0xb8, 0xe2, 0x70, 0xd7, 0x86, 0xc8, 0xe6, 0x5c, 0xf7, 0xda, 0x98, 0xf2, 0x29, 0x53, 0xc9, 0x48, + 0x85, 0x6a, 0x9e, 0x33, 0xe3, 0xf2, 0x58, 0xc4, 0x53, 0x87, 0xba, 0x1f, 0x35, 0x00, 0xfb, 0x1e, + 0xdc, 0xcb, 0x97, 0x07, 0x73, 0x09, 0x2f, 0x40, 0x4b, 0x33, 0x21, 0x53, 0x9e, 0xa1, 0xa0, 0x13, + 0x1c, 0xed, 0x1c, 0x77, 0x88, 0x2f, 0x44, 0x4c, 0x21, 0xa2, 0x7b, 0xe4, 0xc9, 0x26, 0x2c, 0x19, + 0x78, 0x00, 0x4f, 0x41, 0x23, 0x99, 0x70, 0x3a, 0x46, 0x55, 0x23, 0x71, 0x89, 0x8c, 0x8a, 0x7b, + 0xe7, 0x6c, 0x18, 0x5e, 0x82, 0x7f, 0x4c, 0xa7, 0x43, 0x96, 0x51, 0x86, 0x6a, 0x06, 0x1e, 0x94, + 0xc0, 0x1b, 0x17, 0x71, 0x76, 0x4d, 0xe0, 0x15, 0xf8, 0xaf, 0xe3, 0x49, 0x3a, 0x8c, 0x15, 0x17, + 0xa8, 0x6e, 0x7c, 0xb7, 0xec, 0x97, 0x7d, 0xc6, 0x15, 0xd8, 0x20, 0x78, 0x06, 0xea, 0x71, 0x42, + 0x53, 0xd4, 0x30, 0x78, 0xbf, 0x04, 0x5f, 0x47, 0xfd, 0x3b, 0xeb, 0xa2, 0x2a, 0x0a, 0x06, 0x26, + 0x5e, 0x34, 0x96, 0xf3, 0x8c, 0xbe, 0x0a, 0x9e, 0xcd, 0x51, 0x73, 0x6b, 0xe3, 0x47, 0x9f, 0xf1, + 0x8d, 0xd7, 0xa8, 0x98, 0xf5, 0x88, 0xc5, 0x6a, 0x26, 0x18, 0x6a, 0x6d, 0x9d, 0xf5, 0xad, 0x4d, + 0xf8, 0x59, 0x3b, 0xd0, 0xdd, 0x03, 0xed, 0xbf, 0xaf, 0x37, 0x60, 0x32, 0x2f, 0x0e, 0xa3, 0xf3, + 0xcf, 0x25, 0x0e, 0x16, 0x4b, 0x1c, 0x7c, 0x2f, 0x71, 0xf0, 0xbe, 0xc2, 0x95, 0xc5, 0x0a, 0x57, + 0xbe, 0x56, 0xb8, 0xf2, 0x8c, 0xed, 0xae, 0xc8, 0xe1, 0x98, 0xa4, 0x3c, 0x7c, 0xfb, 0xb5, 0x58, + 0xa6, 0x63, 0xd2, 0x34, 0xdb, 0x71, 0xf2, 0x13, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x8f, 0x7e, 0x2c, + 0x79, 0x02, 0x00, 0x00, } func (m *ConsensusMsgParams) Marshal() (dAtA []byte, err error) { From 8d205afbb387d52c5a9921e38c1a075b6de95392 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 13 Jun 2024 01:27:19 +0700 Subject: [PATCH 06/11] (serverv2/cometbft) Read config from commands & handle `FlagNode` (#20621) --- server/v2/cometbft/commands.go | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/server/v2/cometbft/commands.go b/server/v2/cometbft/commands.go index f9c505cd34c5..fe3d513feddc 100644 --- a/server/v2/cometbft/commands.go +++ b/server/v2/cometbft/commands.go @@ -21,6 +21,7 @@ import ( "cosmossdk.io/server/v2/cometbft/client/rpc" "cosmossdk.io/server/v2/cometbft/flags" auth "cosmossdk.io/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/client" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,15 +29,25 @@ import ( "github.com/cosmos/cosmos-sdk/version" ) -func (s *CometBFTServer[T]) rpcClient() (rpc.CometRPC, error) { +func (s *CometBFTServer[T]) rpcClient(cmd *cobra.Command) (rpc.CometRPC, error) { if s.config.Standalone { - client, err := rpchttp.New(s.config.CmtConfig.RPC.ListenAddress) + client, err := rpchttp.New(client.GetConfigFromCmd(cmd).RPC.ListenAddress) if err != nil { return nil, err } return client, nil } + if s.Node == nil || cmd.Flags().Changed(flags.FlagNode) { + rpcURI, err := cmd.Flags().GetString(flags.FlagNode) + if err != nil { + return nil, err + } + if rpcURI != "" { + return rpchttp.New(rpcURI) + } + } + return local.New(s.Node), nil } @@ -46,7 +57,7 @@ func (s *CometBFTServer[T]) StatusCommand() *cobra.Command { Use: "status", Short: "Query remote node for status", RunE: func(cmd *cobra.Command, _ []string) error { - rpcclient, err := s.rpcClient() + rpcclient, err := s.rpcClient(cmd) if err != nil { return err } @@ -80,7 +91,8 @@ func (s *CometBFTServer[T]) ShowNodeIDCmd() *cobra.Command { Use: "show-node-id", Short: "Show this node's ID", RunE: func(cmd *cobra.Command, args []string) error { - nodeKey, err := p2p.LoadNodeKey(s.config.CmtConfig.NodeKeyFile()) + cmtConfig := client.GetConfigFromCmd(cmd) + nodeKey, err := p2p.LoadNodeKey(cmtConfig.NodeKeyFile()) if err != nil { return err } @@ -97,7 +109,7 @@ func (s *CometBFTServer[T]) ShowValidatorCmd() *cobra.Command { Use: "show-validator", Short: "Show this node's CometBFT validator info", RunE: func(cmd *cobra.Command, args []string) error { - cfg := s.config.CmtConfig + cfg := client.GetConfigFromCmd(cmd) privValidator := pvm.LoadFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) pk, err := privValidator.GetPubKey() if err != nil { @@ -131,7 +143,7 @@ func (s *CometBFTServer[T]) ShowAddressCmd() *cobra.Command { Use: "show-address", Short: "Shows this node's CometBFT validator consensus address", RunE: func(cmd *cobra.Command, args []string) error { - cfg := s.config.CmtConfig + cfg := client.GetConfigFromCmd(cmd) privValidator := pvm.LoadFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) // TODO: use address codec? valConsAddr := (sdk.ConsAddress)(privValidator.GetAddress()) @@ -188,7 +200,7 @@ for. Each module documents its respective events under 'xx_events.md'. version.AppName, ), RunE: func(cmd *cobra.Command, args []string) error { - rpcclient, err := s.rpcClient() + rpcclient, err := s.rpcClient(cmd) if err != nil { return err } @@ -241,7 +253,7 @@ $ %s query block --%s=%s RunE: func(cmd *cobra.Command, args []string) error { typ, _ := cmd.Flags().GetString(auth.FlagType) - rpcclient, err := s.rpcClient() + rpcclient, err := s.rpcClient(cmd) if err != nil { return err } @@ -332,7 +344,7 @@ func (s *CometBFTServer[T]) QueryBlockResultsCmd() *cobra.Command { // TODO: we should be able to do this without using client context - node, err := s.rpcClient() + node, err := s.rpcClient(cmd) if err != nil { return err } @@ -392,6 +404,7 @@ func (s *CometBFTServer[T]) BootstrapStateCmd() *cobra.Command { Short: "Bootstrap CometBFT state at an arbitrary block height using a light client", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + cfg := client.GetConfigFromCmd(cmd) height, err := cmd.Flags().GetUint64("height") if err != nil { return err @@ -404,7 +417,7 @@ func (s *CometBFTServer[T]) BootstrapStateCmd() *cobra.Command { } // TODO genensis doc provider and apphash - return node.BootstrapState(cmd.Context(), s.config.CmtConfig, cmtcfg.DefaultDBProvider, nil, height, nil) + return node.BootstrapState(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, nil, height, nil) }, } From 313ce057c42bf804bbb9079f577d270d78d9755f Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 13 Jun 2024 04:03:34 -0400 Subject: [PATCH 07/11] fix(proto): remove conditional preventing proper generated file placement (#20650) --- scripts/protocgen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index c4bbd6d1dfde..34f993bba5ce 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -39,7 +39,7 @@ for dir in $proto_dirs; do done # move generated files to the right places - if [ -d "../cosmossdk.io" -a "$dir" != "./proto" ]; then + if [ -d "../cosmossdk.io" ]; then cp -r ../cosmossdk.io/* $home rm -rf ../cosmossdk.io fi From a6844f5ed40f327ddf1050246e42126caff559af Mon Sep 17 00:00:00 2001 From: Marko Date: Thu, 13 Jun 2024 10:09:02 +0200 Subject: [PATCH 08/11] fix: remove recipient amount from map (#20625) --- x/protocolpool/keeper/keeper.go | 19 +++++++++++------ x/protocolpool/keeper/msg_server.go | 16 ++++++++++++++ x/protocolpool/keeper/msg_server_test.go | 27 +++++++++++++++++++----- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/x/protocolpool/keeper/keeper.go b/x/protocolpool/keeper/keeper.go index 5eb2ae4ec669..f9dd89267471 100644 --- a/x/protocolpool/keeper/keeper.go +++ b/x/protocolpool/keeper/keeper.go @@ -254,11 +254,15 @@ func (k Keeper) hasPermission(addr []byte) (bool, error) { return bytes.Equal(authAcc, addr), nil } +type recipientFund struct { + RecipientAddr string + Percentage math.Int +} + func (k Keeper) iterateAndUpdateFundsDistribution(ctx context.Context, toDistributeAmount math.Int) error { totalPercentageToBeDistributed := math.ZeroInt() - // Create a map to store keys & values from RecipientFundPercentage during the first iteration - recipientFundMap := make(map[string]math.Int) + recipientFundList := []recipientFund{} // Calculate totalPercentageToBeDistributed and store values err := k.RecipientFundPercentage.Walk(ctx, nil, func(key sdk.AccAddress, value math.Int) (stop bool, err error) { @@ -267,7 +271,10 @@ func (k Keeper) iterateAndUpdateFundsDistribution(ctx context.Context, toDistrib return true, err } totalPercentageToBeDistributed = totalPercentageToBeDistributed.Add(value) - recipientFundMap[addr] = value + recipientFundList = append(recipientFundList, recipientFund{ + RecipientAddr: addr, + Percentage: value, + }) return false, nil }) if err != nil { @@ -287,14 +294,14 @@ func (k Keeper) iterateAndUpdateFundsDistribution(ctx context.Context, toDistrib totalAmountToBeDistributed := toDistributeDec.MulDec(math.LegacyNewDecFromIntWithPrec(totalPercentageToBeDistributed, 2)) totalDistrAmount := totalAmountToBeDistributed.AmountOf(denom) - for keyStr, value := range recipientFundMap { + for _, value := range recipientFundList { // Calculate the funds to be distributed based on the percentage - decValue := math.LegacyNewDecFromIntWithPrec(value, 2) + decValue := math.LegacyNewDecFromIntWithPrec(value.Percentage, 2) percentage := math.LegacyNewDecFromIntWithPrec(totalPercentageToBeDistributed, 2) recipientAmount := totalDistrAmount.Mul(decValue).Quo(percentage) recipientCoins := recipientAmount.TruncateInt() - key, err := k.authKeeper.AddressCodec().StringToBytes(keyStr) + key, err := k.authKeeper.AddressCodec().StringToBytes(value.RecipientAddr) if err != nil { return err } diff --git a/x/protocolpool/keeper/msg_server.go b/x/protocolpool/keeper/msg_server.go index 911198631882..3af5f91df89b 100644 --- a/x/protocolpool/keeper/msg_server.go +++ b/x/protocolpool/keeper/msg_server.go @@ -110,6 +110,14 @@ func (k MsgServer) CreateContinuousFund(ctx context.Context, msg *types.MsgCreat return nil, err } + has, err := k.ContinuousFund.Has(ctx, recipient) + if err != nil { + return nil, err + } + if has { + return nil, fmt.Errorf("continuous fund already exists for recipient %s", msg.Recipient) + } + // Validate the message fields err = k.validateContinuousFund(ctx, *msg) if err != nil { @@ -201,6 +209,14 @@ func (k MsgServer) CancelContinuousFund(ctx context.Context, msg *types.MsgCance return nil, fmt.Errorf("failed to remove continuous fund for recipient %s: %w", msg.RecipientAddress, err) } + if err := k.RecipientFundPercentage.Remove(ctx, recipient); err != nil { + return nil, fmt.Errorf("failed to remove recipient fund percentage for recipient %s: %w", msg.RecipientAddress, err) + } + + if err := k.RecipientFundDistribution.Remove(ctx, recipient); err != nil { + return nil, fmt.Errorf("failed to remove recipient fund distribution for recipient %s: %w", msg.RecipientAddress, err) + } + return &types.MsgCancelContinuousFundResponse{ CanceledTime: canceledTime, CanceledHeight: uint64(canceledHeight), diff --git a/x/protocolpool/keeper/msg_server_test.go b/x/protocolpool/keeper/msg_server_test.go index fb9fda3ede73..9b17b3cda263 100644 --- a/x/protocolpool/keeper/msg_server_test.go +++ b/x/protocolpool/keeper/msg_server_test.go @@ -810,6 +810,10 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { recipient2 := sdk.AccAddress([]byte("recipientAddr2___________________")) recipient2StrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipient2) suite.Require().NoError(err) + recipient3 := sdk.AccAddress([]byte("recipientAddr3___________________")) + recipient3StrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipient3) + suite.Require().NoError(err) + testCases := map[string]struct { preRun func() recipientAddr sdk.AccAddress @@ -908,20 +912,26 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.HeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipientStrAddr, + Recipient: recipient3StrAddr, Percentage: percentage, Expiry: &expiry, } - err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipientAddr, cf) + suite.mockWithdrawContinuousFund() + err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient3, cf) + suite.Require().NoError(err) + err = suite.poolKeeper.RecipientFundPercentage.Set(suite.ctx, recipient3, math.ZeroInt()) + suite.Require().NoError(err) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient3, math.ZeroInt()) suite.Require().NoError(err) }, - recipientAddr: recipientAddr, + recipientAddr: recipient3, expErr: false, postRun: func() { - _, err := suite.poolKeeper.ContinuousFund.Get(suite.ctx, recipientAddr) + _, err := suite.poolKeeper.ContinuousFund.Get(suite.ctx, recipient3) suite.Require().Error(err) suite.Require().ErrorIs(err, collections.ErrNotFound) }, + withdrawnFunds: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), }, } @@ -943,7 +953,14 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { suite.Require().Contains(err.Error(), tc.expErrMsg) } else { suite.Require().NoError(err) - suite.Require().Equal(resp.WithdrawnAllocatedFund, tc.withdrawnFunds) + suite.Require().Equal(tc.withdrawnFunds, resp.WithdrawnAllocatedFund) + // All items below should return error as they are removed from the store + _, err := suite.poolKeeper.RecipientFundPercentage.Get(suite.ctx, tc.recipientAddr) + suite.Require().Contains(err.Error(), "collections: not found") + _, err = suite.poolKeeper.ContinuousFund.Get(suite.ctx, tc.recipientAddr) + suite.Require().Contains(err.Error(), "collections: not found") + _, err = suite.poolKeeper.RecipientFundDistribution.Get(suite.ctx, tc.recipientAddr) + suite.Require().Contains(err.Error(), "collections: not found") } if tc.postRun != nil { tc.postRun() From 2e774b973d789a524dd52b4ce2fca7a0c5222d84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:57:14 +0000 Subject: [PATCH 09/11] build(deps): Bump google.golang.org/protobuf from 1.34.1 to 1.34.2 (#20632) Signed-off-by: dependabot[bot] 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> Co-authored-by: son trinh Co-authored-by: marbar3778 Co-authored-by: Marko --- api/go.mod | 2 +- api/go.sum | 3 ++- client/v2/go.mod | 2 +- client/v2/go.sum | 3 ++- collections/go.mod | 2 +- collections/go.sum | 4 ++-- core/go.mod | 2 +- core/go.sum | 4 ++-- depinject/go.mod | 2 +- depinject/go.sum | 4 ++-- depinject/sonar-project.properties | 2 +- go.mod | 2 +- go.sum | 3 ++- orm/go.mod | 2 +- orm/go.sum | 4 ++-- runtime/v2/go.mod | 2 +- runtime/v2/go.sum | 3 ++- server/v2/appmanager/go.mod | 2 +- server/v2/appmanager/go.sum | 4 ++-- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 3 ++- server/v2/go.mod | 2 +- server/v2/go.sum | 4 ++-- server/v2/stf/go.mod | 2 +- server/v2/stf/go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 3 ++- sonar-project.properties | 2 +- store/go.mod | 2 +- store/go.sum | 4 ++-- store/v2/go.mod | 2 +- store/v2/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 3 ++- tests/systemtests/go.mod | 2 +- tests/systemtests/go.sum | 4 ++-- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 ++-- x/accounts/defaults/lockup/go.mod | 2 +- x/accounts/defaults/lockup/go.sum | 3 ++- x/accounts/go.mod | 2 +- x/accounts/go.sum | 3 ++- x/auth/go.mod | 2 +- x/auth/go.sum | 3 ++- x/authz/go.mod | 2 +- x/authz/go.sum | 3 ++- x/bank/go.mod | 2 +- x/bank/go.sum | 3 ++- x/circuit/go.mod | 2 +- x/circuit/go.sum | 3 ++- x/consensus/go.mod | 2 +- x/consensus/go.sum | 3 ++- x/distribution/go.mod | 2 +- x/distribution/go.sum | 3 ++- x/epochs/go.mod | 2 +- x/epochs/go.sum | 3 ++- x/evidence/go.mod | 2 +- x/evidence/go.sum | 3 ++- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 3 ++- x/gov/go.mod | 2 +- x/gov/go.sum | 3 ++- x/group/go.mod | 2 +- x/group/go.sum | 3 ++- x/mint/go.mod | 2 +- x/mint/go.sum | 3 ++- x/nft/go.mod | 2 +- x/nft/go.sum | 3 ++- x/params/go.mod | 2 +- x/params/go.sum | 3 ++- x/protocolpool/go.mod | 2 +- x/protocolpool/go.sum | 3 ++- x/slashing/go.mod | 2 +- x/slashing/go.sum | 3 ++- x/staking/go.mod | 2 +- x/staking/go.sum | 3 ++- x/tx/go.mod | 2 +- x/tx/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 3 ++- 84 files changed, 125 insertions(+), 98 deletions(-) diff --git a/api/go.mod b/api/go.mod index 756290ebe716..58714c2e0119 100644 --- a/api/go.mod +++ b/api/go.mod @@ -8,7 +8,7 @@ require ( github.com/cosmos/gogoproto v1.5.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/api/go.sum b/api/go.sum index 35ad83159ac6..0a084691b5d7 100644 --- a/api/go.sum +++ b/api/go.sum @@ -28,5 +28,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go. google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= diff --git a/client/v2/go.mod b/client/v2/go.mod index 852c52bcab46..f029cadb4e20 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -17,7 +17,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) diff --git a/client/v2/go.sum b/client/v2/go.sum index 5bf0848bc8c7..f6ba5dc2c155 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -670,8 +670,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/collections/go.mod b/collections/go.mod index 4e57b92c3e9a..cf803ec6f903 100644 --- a/collections/go.mod +++ b/collections/go.mod @@ -22,7 +22,7 @@ require ( golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collections/go.sum b/collections/go.sum index f184d88afcd8..300ee085958e 100644 --- a/collections/go.sum +++ b/collections/go.sum @@ -30,8 +30,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/core/go.mod b/core/go.mod index bd708934a896..5adbe9d79219 100644 --- a/core/go.mod +++ b/core/go.mod @@ -6,7 +6,7 @@ require ( github.com/cosmos/gogoproto v1.5.0 github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/core/go.sum b/core/go.sum index 490a2be96fe8..554ff253ccf6 100644 --- a/core/go.sum +++ b/core/go.sum @@ -33,8 +33,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/depinject/go.mod b/depinject/go.mod index 324fda6ded1d..9245fe4ce050 100644 --- a/depinject/go.mod +++ b/depinject/go.mod @@ -7,7 +7,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) diff --git a/depinject/go.sum b/depinject/go.sum index ab7249c2d53e..fcf561b1d7d4 100644 --- a/depinject/go.sum +++ b/depinject/go.sum @@ -35,8 +35,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/depinject/sonar-project.properties b/depinject/sonar-project.properties index 125633c93e3d..6aec20805981 100644 --- a/depinject/sonar-project.properties +++ b/depinject/sonar-project.properties @@ -5,7 +5,7 @@ sonar.projectName=Cosmos SDK Depinject sonar.project.monorepo.enabled=true sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go +sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go,**/*.java sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/** sonar.tests=. sonar.test.inclusions=**/*_test.go diff --git a/go.mod b/go.mod index ae05108c4c4a..c37cab3e84a8 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( golang.org/x/sync v0.7.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 sigs.k8s.io/yaml v1.4.0 diff --git a/go.sum b/go.sum index 56980d1c8c61..21f6054705c0 100644 --- a/go.sum +++ b/go.sum @@ -653,8 +653,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/orm/go.mod b/orm/go.mod index 974f28519c54..ca3ed88b89ad 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) diff --git a/orm/go.sum b/orm/go.sum index 4bdca95f8fda..5cf168750dbe 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -229,8 +229,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index 2b216727cccb..c061bc7c510a 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -32,7 +32,7 @@ require ( github.com/cosmos/gogoproto v1.5.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index 10fc43ba8b3f..549414939932 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -309,8 +309,9 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/server/v2/appmanager/go.mod b/server/v2/appmanager/go.mod index feb846fb893e..5f272491f97d 100644 --- a/server/v2/appmanager/go.mod +++ b/server/v2/appmanager/go.mod @@ -12,5 +12,5 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/server/v2/appmanager/go.sum b/server/v2/appmanager/go.sum index b44ff559fee4..174f840d47d0 100644 --- a/server/v2/appmanager/go.sum +++ b/server/v2/appmanager/go.sum @@ -12,7 +12,7 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index e1daaf5288b5..0a5e84e522e3 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -39,7 +39,7 @@ require ( github.com/spf13/pflag v1.0.5 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 sigs.k8s.io/yaml v1.4.0 ) diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index bc5a9ed1a4fa..2ea8c849adae 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/server/v2/go.mod b/server/v2/go.mod index 3770d34ee2eb..c9eabdc8df55 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -34,7 +34,7 @@ require ( github.com/stretchr/testify v1.9.0 golang.org/x/sync v0.7.0 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/server/v2/go.sum b/server/v2/go.sum index 31778d8f53cf..602d23d71275 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -370,8 +370,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/server/v2/stf/go.mod b/server/v2/stf/go.mod index 6450864490ed..1493c30a98ab 100644 --- a/server/v2/stf/go.mod +++ b/server/v2/stf/go.mod @@ -10,7 +10,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/tidwall/btree v1.7.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/server/v2/stf/go.sum b/server/v2/stf/go.sum index 6275292f1139..00afeef4cfd9 100644 --- a/server/v2/stf/go.sum +++ b/server/v2/stf/go.sum @@ -21,8 +21,8 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/simapp/go.mod b/simapp/go.mod index 0e49796e23c6..5e0a435581ea 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -42,7 +42,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require github.com/cometbft/cometbft/api v1.0.0-rc.1 diff --git a/simapp/go.sum b/simapp/go.sum index 2f3a923d8552..a48ae6fff5c0 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -1385,8 +1385,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/sonar-project.properties b/sonar-project.properties index 95bd2b396fa3..812cea1503ac 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,7 +5,7 @@ sonar.projectName=Cosmos SDK sonar.project.monorepo.enabled=true sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go,*.java +sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go,**/*.java sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,docs/**,server/v2/**,store/v2/**,x/tx/**,tools/**,simapp/**,testutil/**,test_helpers.go,tests/**,test_helpers.go,docs/**,store/**,tests/**,orm/**,client/v2/**,runtime/v2/**,core/**,store/**,x/evidence,x/feegrant,x/authz,x/auth,x/bank,api,x/gov,x/staking,x/group,x/nft sonar.tests=. sonar.test.inclusions=**/*_test.go,tests/**,**/testutil/** diff --git a/store/go.mod b/store/go.mod index 77825cb7a3b0..8421c247a4c7 100644 --- a/store/go.mod +++ b/store/go.mod @@ -23,7 +23,7 @@ require ( github.com/tidwall/btree v1.7.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) diff --git a/store/go.sum b/store/go.sum index 8f3cb8fee8e3..bd92cb27d0c8 100644 --- a/store/go.sum +++ b/store/go.sum @@ -314,8 +314,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/store/v2/go.mod b/store/v2/go.mod index fc15bc41939a..c95ec57bb5cb 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -58,7 +58,7 @@ require ( golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/store/v2/go.sum b/store/v2/go.sum index 06554a9f5720..50c293b1be2d 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -297,8 +297,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/go.mod b/tests/go.mod index 606bab894402..707e290394ca 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -28,7 +28,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) diff --git a/tests/go.sum b/tests/go.sum index 384544540b00..55cfa67940b0 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -1376,8 +1376,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index 559583b7c92f..73a42d9cd57e 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -152,7 +152,7 @@ require ( golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum index b3472acb864c..697ca5bbd5d5 100644 --- a/tests/systemtests/go.sum +++ b/tests/systemtests/go.sum @@ -981,8 +981,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index a718848bcb7f..d7ebe1cd5cd8 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -148,7 +148,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index fd7b4c58e878..4e6b172bd2ea 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -980,8 +980,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 5380d20fa7d1..ae72b2b0d1be 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -177,7 +177,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index ce93c0670cd0..54606837847f 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -1574,8 +1574,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 311ed9fd9bf8..20cee7bf8b7d 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -12,7 +12,7 @@ require ( github.com/pelletier/go-toml/v2 v2.2.2 github.com/spf13/cobra v1.8.0 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index f7f4a84e6dc5..4576d02f7326 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -976,8 +976,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index ca0f42221244..ac532aa14626 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -159,7 +159,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index 2dbbdc035151..5401f51e8a04 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -631,8 +631,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/accounts/go.mod b/x/accounts/go.mod index e0d0e7bc36e3..f3af5e24d343 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -16,7 +16,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/x/accounts/go.sum b/x/accounts/go.sum index 001f8bb11d63..f6ad832d6950 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -656,8 +656,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/auth/go.mod b/x/auth/go.mod index d05bdd27649e..bf5bab791fda 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -29,7 +29,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 sigs.k8s.io/yaml v1.4.0 diff --git a/x/auth/go.sum b/x/auth/go.sum index 6faad05a8246..fddaf1390bb8 100644 --- a/x/auth/go.sum +++ b/x/auth/go.sum @@ -660,8 +660,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/authz/go.mod b/x/authz/go.mod index b9c3976cae4f..0661b9760f09 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/x/authz/go.sum b/x/authz/go.sum index 6faad05a8246..fddaf1390bb8 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -660,8 +660,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/bank/go.mod b/x/bank/go.mod index c34ffc8c3b86..e786a6e5de0b 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -161,7 +161,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect pgregory.net/rapid v1.1.0 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 6faad05a8246..fddaf1390bb8 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -660,8 +660,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index e0a782728c26..0f9dca5ae4ae 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -160,7 +160,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index ca4e47166b63..9eaf55401f00 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/consensus/go.mod b/x/consensus/go.mod index cbe83cf1d6d1..267b0e3cb42b 100644 --- a/x/consensus/go.mod +++ b/x/consensus/go.mod @@ -159,7 +159,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/consensus/go.sum b/x/consensus/go.sum index ca4e47166b63..9eaf55401f00 100644 --- a/x/consensus/go.sum +++ b/x/consensus/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 5acdabd327a8..cf14479b0da6 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -165,7 +165,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect pgregory.net/rapid v1.1.0 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index 12c1077db7d4..8a77b4a877a5 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 8af1ec609c51..4a987921ce65 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -156,7 +156,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 7eb63e19e416..d38ef8847bee 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -658,8 +658,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 6536ca63a572..df29aa12bd7c 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -21,7 +21,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/x/evidence/go.sum b/x/evidence/go.sum index ca4e47166b63..9eaf55401f00 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index f7a8a2d3266f..200acda63bcb 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -23,7 +23,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index dd96921a98c6..82f04cb59e1c 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -672,8 +672,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/gov/go.mod b/x/gov/go.mod index 3a8b004bbe88..de9447cd2bcb 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -34,7 +34,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) diff --git a/x/gov/go.sum b/x/gov/go.sum index 8d888aa70016..842c64867657 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -670,8 +670,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/group/go.mod b/x/group/go.mod index ce0ad4f7500b..c44b88199d34 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -34,7 +34,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 pgregory.net/rapid v1.1.0 ) diff --git a/x/group/go.sum b/x/group/go.sum index c4d6d9369dfe..4a8764ae3d72 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -674,8 +674,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/mint/go.mod b/x/mint/go.mod index 9c7c08e552eb..d7003256a31c 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -151,7 +151,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect pgregory.net/rapid v1.1.0 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index 3d8b9af73759..6fd193777ddf 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -664,8 +664,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/nft/go.mod b/x/nft/go.mod index c4ce201d4c99..9b534d63060e 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -160,7 +160,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index ca4e47166b63..9eaf55401f00 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/params/go.mod b/x/params/go.mod index 2f528a196735..6ba45b10d754 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -161,7 +161,7 @@ require ( golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index ca4e47166b63..9eaf55401f00 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 41a44493659e..261b2129fe99 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -21,7 +21,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index ca4e47166b63..9eaf55401f00 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -662,8 +662,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index 30fe9eb21862..8e7c801d2680 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -22,7 +22,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) diff --git a/x/slashing/go.sum b/x/slashing/go.sum index 8f64ab0672eb..77056fcf2a39 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -664,8 +664,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/staking/go.mod b/x/staking/go.mod index cabfa348f4bb..3b0720b32e57 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) diff --git a/x/staking/go.sum b/x/staking/go.sum index 6faad05a8246..fddaf1390bb8 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -660,8 +660,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/tx/go.mod b/x/tx/go.mod index a1bf2d124c37..717d2c99ef89 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -15,7 +15,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) diff --git a/x/tx/go.sum b/x/tx/go.sum index d701188e5ffe..8fcd940caa9c 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -57,8 +57,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 16ad90c2e4a6..6add72f6a388 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -29,7 +29,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 9930baafe568..5923eae104e8 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -1378,8 +1378,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 461131146b610cc9e2daf63ca6945b77d5f16176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Thu, 13 Jun 2024 11:28:12 +0200 Subject: [PATCH 10/11] perf: add cache to address codec (#20122) --- CHANGELOG.md | 1 + codec/address/bech32_codec.go | 104 +++++++++++++- codec/address/bech32_codec_test.go | 209 +++++++++++++++++++++++++++++ codec/address/bench_test.go | 35 +++++ codec/address/fuzz_test.go | 67 +++++++++ simapp/app.go | 8 +- 6 files changed, 415 insertions(+), 9 deletions(-) create mode 100644 codec/address/bech32_codec_test.go create mode 100644 codec/address/bench_test.go create mode 100644 codec/address/fuzz_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index d7db2a3c2b8a..8c6f600c6695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### Improvements +* (codec) [#20122](https://github.com/cosmos/cosmos-sdk/pull/20122) Added a cache to address codec. * (bank) [#20354](https://github.com/cosmos/cosmos-sdk/pull/20354) Reduce the number of `ValidateDenom` calls in `bank.SendCoins`. * (types) [#19869](https://github.com/cosmos/cosmos-sdk/pull/19869) Removed `Any` type from `codec/types` and replaced it with an alias for `cosmos/gogoproto/types/any`. * (server) [#19854](https://github.com/cosmos/cosmos-sdk/pull/19854) Add customizability to start command. diff --git a/codec/address/bech32_codec.go b/codec/address/bech32_codec.go index ea6b669e6828..40cb29529d1d 100644 --- a/codec/address/bech32_codec.go +++ b/codec/address/bech32_codec.go @@ -2,30 +2,78 @@ package address import ( "errors" + "fmt" "strings" + "sync" + + "github.com/hashicorp/golang-lru/simplelru" "cosmossdk.io/core/address" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/internal/conv" sdkAddress "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/bech32" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) +var errEmptyAddress = errors.New("empty address string is not allowed") + +var ( + _ address.Codec = &Bech32Codec{} + _ address.Codec = &cachedBech32Codec{} +) + type Bech32Codec struct { Bech32Prefix string } -var _ address.Codec = &Bech32Codec{} +type cachedBech32Codec struct { + codec Bech32Codec + mu *sync.Mutex + cache *simplelru.LRU +} + +type CachedCodecOptions struct { + Mu *sync.Mutex + Lru *simplelru.LRU +} func NewBech32Codec(prefix string) address.Codec { - return Bech32Codec{prefix} + return &Bech32Codec{Bech32Prefix: prefix} +} + +func NewCachedBech32Codec(prefix string, opts CachedCodecOptions) (address.Codec, error) { + var err error + ac := Bech32Codec{prefix} + if opts.Mu == nil && opts.Lru == nil { + opts.Mu = new(sync.Mutex) + opts.Lru, err = simplelru.NewLRU(256, nil) + if err != nil { + return nil, fmt.Errorf("failed to create LRU cache: %w", err) + } + } else if opts.Mu == nil && opts.Lru != nil { + // The LRU cache uses a map internally. Without a mutex, concurrent access to this map can lead to race conditions. + // Therefore, a mutex is required to ensure thread-safe operations on the LRU cache. + return nil, errors.New("mutex must be provided alongside the LRU cache") + } else if opts.Mu != nil && opts.Lru == nil { + opts.Lru, err = simplelru.NewLRU(256, nil) + if err != nil { + return nil, fmt.Errorf("failed to create LRU cache: %w", err) + } + } + + return cachedBech32Codec{ + codec: ac, + cache: opts.Lru, + mu: opts.Mu, + }, nil } // StringToBytes encodes text to bytes func (bc Bech32Codec) StringToBytes(text string) ([]byte, error) { if len(strings.TrimSpace(text)) == 0 { - return []byte{}, errors.New("empty address string is not allowed") + return []byte{}, errEmptyAddress } hrp, bz, err := bech32.DecodeAndConvert(text) @@ -61,3 +109,53 @@ func (bc Bech32Codec) BytesToString(bz []byte) (string, error) { return text, nil } + +func (cbc cachedBech32Codec) BytesToString(bz []byte) (string, error) { + if len(bz) == 0 { + return "", nil + } + + key := conv.UnsafeBytesToStr(bz) + cbc.mu.Lock() + defer cbc.mu.Unlock() + + addrs, ok := cbc.cache.Get(key) + if !ok { + addrs = make(map[string]string) + cbc.cache.Add(key, addrs) + } + + addrMap, ok := addrs.(map[string]string) + if !ok { + return "", fmt.Errorf("cache contains non-map[string]string value for key %s", key) + } + + addr, ok := addrMap[cbc.codec.Bech32Prefix] + if !ok { + var err error + addr, err = cbc.codec.BytesToString(bz) + if err != nil { + return "", err + } + addrMap[cbc.codec.Bech32Prefix] = addr + } + + return addr, nil +} + +func (cbc cachedBech32Codec) StringToBytes(text string) ([]byte, error) { + cbc.mu.Lock() + defer cbc.mu.Unlock() + + if addr, ok := cbc.cache.Get(text); ok { + return addr.([]byte), nil + } + + addr, err := cbc.codec.StringToBytes(text) + if err != nil { + return nil, err + } + cbc.cache.Add(text, addr) + + return addr, nil +} diff --git a/codec/address/bech32_codec_test.go b/codec/address/bech32_codec_test.go new file mode 100644 index 000000000000..faa8432f07d0 --- /dev/null +++ b/codec/address/bech32_codec_test.go @@ -0,0 +1,209 @@ +package address + +import ( + "crypto/rand" + "sync" + "sync/atomic" + "testing" + + "github.com/hashicorp/golang-lru/simplelru" + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/internal/conv" +) + +var ( + lru, _ = simplelru.NewLRU(500, nil) + cacheOptions = CachedCodecOptions{ + Mu: &sync.Mutex{}, + Lru: lru, + } +) + +func generateAddresses(totalAddresses int) ([][]byte, error) { + keys := make([][]byte, totalAddresses) + addr := make([]byte, 32) + for i := 0; i < totalAddresses; i++ { + _, err := rand.Read(addr) + if err != nil { + return nil, err + } + keys[i] = addr + } + + return keys, nil +} + +func TestNewBech32Codec(t *testing.T) { + tests := []struct { + name string + mu *sync.Mutex + lru func(t *testing.T) *simplelru.LRU + error bool + }{ + { + name: "lru and mutex provided", + mu: &sync.Mutex{}, + lru: func(t *testing.T) *simplelru.LRU { + t.Helper() + newLru, err := simplelru.NewLRU(500, nil) + require.NoError(t, err) + return newLru + }, + }, + { + name: "both empty", + mu: nil, + lru: func(t *testing.T) *simplelru.LRU { + t.Helper() + return nil + }, + }, + { + name: "only lru provided", + mu: nil, + lru: func(t *testing.T) *simplelru.LRU { + t.Helper() + newLru, err := simplelru.NewLRU(500, nil) + require.NoError(t, err) + return newLru + }, + error: true, + }, + { + name: "only mutex provided", + mu: &sync.Mutex{}, + lru: func(t *testing.T) *simplelru.LRU { + t.Helper() + return nil + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + newLru := tt.lru(t) + got, err := NewCachedBech32Codec("cosmos", CachedCodecOptions{ + Mu: tt.mu, + Lru: newLru, + }) + if tt.error { + require.Error(t, err) + } else { + require.NoError(t, err) + require.NotNil(t, got) + } + }) + } +} + +func TestBech32Codec(t *testing.T) { + tests := []struct { + name string + prefix string + lru *simplelru.LRU + address string + }{ + { + name: "create accounts cached bech32 codec", + prefix: "cosmos", + lru: lru, + address: "cosmos1p8s0p6gqc6c9gt77lgr2qqujz49huhu6a80smx", + }, + { + name: "create validator cached bech32 codec", + prefix: "cosmosvaloper", + lru: lru, + address: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0", + }, + { + name: "create consensus cached bech32 codec", + prefix: "cosmosvalcons", + lru: lru, + address: "cosmosvalcons1ntk8eualewuprz0gamh8hnvcem2nrcdsgz563h", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ac, err := NewCachedBech32Codec(tt.prefix, cacheOptions) + require.NoError(t, err) + + cached, ok := ac.(cachedBech32Codec) + require.True(t, ok) + require.Equal(t, cached.cache, tt.lru) + + addr, err := ac.StringToBytes(tt.address) + require.NoError(t, err) + + cachedAddr, ok := tt.lru.Get(tt.address) + require.True(t, ok) + require.Equal(t, addr, cachedAddr) + + accAddr, err := ac.BytesToString(addr) + require.NoError(t, err) + + cachedStrAddr, ok := tt.lru.Get(conv.UnsafeBytesToStr(addr)) + require.True(t, ok) + cachedStrAddrMap, ok := cachedStrAddr.(map[string]string) + require.True(t, ok) + require.Equal(t, accAddr, cachedStrAddrMap[tt.prefix]) + }) + } +} + +func TestMultipleBech32Codec(t *testing.T) { + cAc, err := NewCachedBech32Codec("cosmos", cacheOptions) + require.NoError(t, err) + cosmosAc, ok := cAc.(cachedBech32Codec) + require.True(t, ok) + sAc, err := NewCachedBech32Codec("stake", cacheOptions) + require.NoError(t, err) + stakeAc, ok := sAc.(cachedBech32Codec) + require.True(t, ok) + require.Equal(t, cosmosAc.cache, stakeAc.cache) + + addr := make([]byte, 32) + _, err = rand.Read(addr) + require.NoError(t, err) + + cosmosAddr, err := cosmosAc.BytesToString(addr) + require.NoError(t, err) + stakeAddr, err := stakeAc.BytesToString(addr) + require.NoError(t, err) + require.True(t, cosmosAddr != stakeAddr) + + cachedCosmosAddr, err := cosmosAc.BytesToString(addr) + require.NoError(t, err) + require.Equal(t, cosmosAddr, cachedCosmosAddr) + + cachedStakeAddr, err := stakeAc.BytesToString(addr) + require.NoError(t, err) + require.Equal(t, stakeAddr, cachedStakeAddr) +} + +func TestBech32CodecRace(t *testing.T) { + ac, err := NewCachedBech32Codec("cosmos", cacheOptions) + require.NoError(t, err) + myAddrBz := []byte{0x1, 0x2, 0x3, 0x4, 0x5} + + var ( + wgStart, wgDone sync.WaitGroup + errCount atomic.Uint32 + ) + const n = 3 + wgStart.Add(n) + wgDone.Add(n) + for i := 0; i < n; i++ { + go func() { + wgStart.Done() + wgStart.Wait() // wait for all routines started + + got, err := ac.BytesToString(myAddrBz) + if err != nil || got != "cosmos1qypqxpq9dc9msf" { + errCount.Add(1) + } + wgDone.Done() + }() + } + wgDone.Wait() // wait for all routines completed + require.Equal(t, errCount.Load(), uint32(0)) +} diff --git a/codec/address/bench_test.go b/codec/address/bench_test.go new file mode 100644 index 000000000000..f7558aa0af7e --- /dev/null +++ b/codec/address/bench_test.go @@ -0,0 +1,35 @@ +package address + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/core/address" +) + +func BenchmarkCodecWithCache(b *testing.B) { + cdc, err := NewCachedBech32Codec("cosmos", cacheOptions) + require.NoError(b, err) + bytesToString(b, cdc) +} + +func BenchmarkCodecWithoutCache(b *testing.B) { + cdc := Bech32Codec{Bech32Prefix: "cosmos"} + bytesToString(b, cdc) +} + +func bytesToString(b *testing.B, cdc address.Codec) { + b.Helper() + addresses, err := generateAddresses(10) + require.NoError(b, err) + + b.Helper() + b.ReportAllocs() + b.ResetTimer() + + for i := 0; i < b.N; i++ { + _, err := cdc.BytesToString(addresses[i%len(addresses)]) + require.NoError(b, err) + } +} diff --git a/codec/address/fuzz_test.go b/codec/address/fuzz_test.go new file mode 100644 index 000000000000..7f52039f3f09 --- /dev/null +++ b/codec/address/fuzz_test.go @@ -0,0 +1,67 @@ +package address + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/core/address" + + sdkAddress "github.com/cosmos/cosmos-sdk/types/address" +) + +func FuzzCachedAddressCodec(f *testing.F) { + if testing.Short() { + f.Skip() + } + + addresses, err := generateAddresses(2) + require.NoError(f, err) + + for _, addr := range addresses { + f.Add(addr) + } + cdc, err := NewCachedBech32Codec("cosmos", cacheOptions) + require.NoError(f, err) + + f.Fuzz(func(t *testing.T, addr []byte) { + checkAddress(t, addr, cdc) + }) +} + +func FuzzAddressCodec(f *testing.F) { + if testing.Short() { + f.Skip() + } + addresses, err := generateAddresses(2) + require.NoError(f, err) + + for _, addr := range addresses { + f.Add(addr) + } + + cdc := Bech32Codec{Bech32Prefix: "cosmos"} + + f.Fuzz(func(t *testing.T, addr []byte) { + checkAddress(t, addr, cdc) + }) +} + +func checkAddress(t *testing.T, addr []byte, cdc address.Codec) { + t.Helper() + if len(addr) > sdkAddress.MaxAddrLen { + return + } + strAddr, err := cdc.BytesToString(addr) + if err != nil { + t.Fatal(err) + } + b, err := cdc.StringToBytes(strAddr) + if err != nil { + if !errors.Is(errEmptyAddress, err) { + t.Fatal(err) + } + } + require.Equal(t, len(addr), len(b)) +} diff --git a/simapp/app.go b/simapp/app.go index 348359921049..c441659f18c1 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -203,12 +203,8 @@ func NewSimApp( interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ ProtoFiles: proto.HybridResolver, SigningOptions: signing.Options{ - AddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), - }, - ValidatorAddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), - }, + AddressCodec: address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: address.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), }, }) appCodec := codec.NewProtoCodec(interfaceRegistry) From 43991b99e4b2086959c8bceb4a6464808268062e Mon Sep 17 00:00:00 2001 From: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:27:44 +0200 Subject: [PATCH 11/11] fix(x/staking): stop validators from rotating to the same key on the same block (#20649) --- x/staking/keeper/cons_pubkey.go | 14 +++++++++++++- x/staking/keeper/msg_server_test.go | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/x/staking/keeper/cons_pubkey.go b/x/staking/keeper/cons_pubkey.go index 12a5baafe48c..966ffedeaccc 100644 --- a/x/staking/keeper/cons_pubkey.go +++ b/x/staking/keeper/cons_pubkey.go @@ -34,7 +34,19 @@ func (k Keeper) setConsPubKeyRotationHistory( Height: height, Fee: fee, } - err := k.RotationHistory.Set(ctx, collections.Join(valAddr.Bytes(), height), history) + + // check if there's another key rotation for this same key in the same block + allRotations, err := k.GetBlockConsPubKeyRotationHistory(ctx) + if err != nil { + return err + } + for _, r := range allRotations { + if r.NewConsPubkey.Compare(newPubKey) == 0 { + return types.ErrConsensusPubKeyAlreadyUsedForValidator + } + } + + err = k.RotationHistory.Set(ctx, collections.Join(valAddr.Bytes(), height), history) if err != nil { return err } diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index c22cc78b10a4..14163c6bcf42 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -1378,3 +1378,30 @@ func (s *KeeperTestSuite) TestConsKeyRotn() { }) } } + +// TestConsKeyRotationInSameBlock tests the scenario where multiple validators try to +// rotate to the **same** consensus key in the same block. +func (s *KeeperTestSuite) TestConsKeyRotationInSameBlock() { + stakingKeeper, ctx := s.stakingKeeper, s.ctx + + msgServer := stakingkeeper.NewMsgServerImpl(stakingKeeper) + s.setValidators(2) + validators, err := stakingKeeper.GetAllValidators(ctx) + s.Require().NoError(err) + + s.Require().Len(validators, 2) + + req, err := types.NewMsgRotateConsPubKey(validators[0].GetOperator(), PKs[444]) + s.Require().NoError(err) + + s.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().NoError(err) + + req, err = types.NewMsgRotateConsPubKey(validators[1].GetOperator(), PKs[444]) + s.Require().NoError(err) + + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().ErrorContains(err, "consensus pubkey is already used for a validator") +}