From 517c694e61704512dfb28d5d0c587f542a293233 Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 14:49:17 -0300 Subject: [PATCH 01/16] remove the `InfractionParameters` from proto --- proto/vaas/provider/v1/query.proto | 10 +- proto/vaas/provider/v1/tx.proto | 10 +- x/vaas/provider/types/query.pb.go | 367 ++++++++++------------------- x/vaas/provider/types/tx.pb.go | 262 ++++++-------------- 4 files changed, 206 insertions(+), 443 deletions(-) diff --git a/proto/vaas/provider/v1/query.proto b/proto/vaas/provider/v1/query.proto index 33106cb..d25a53d 100644 --- a/proto/vaas/provider/v1/query.proto +++ b/proto/vaas/provider/v1/query.proto @@ -138,8 +138,10 @@ message Chain { // The metadata of the consumer chain ConsumerMetadata metadata = 4 [(gogoproto.nullable) = false ]; string consumer_id = 5; - // Infraction parameters for slashing and jailing - InfractionParameters infraction_parameters = 6; + + // reserved for removed per-consumer infraction parameters + reserved 6; + reserved "infraction_parameters"; } message QueryValidatorConsumerAddrRequest { @@ -257,7 +259,9 @@ message QueryConsumerChainResponse { string phase = 4; ConsumerMetadata metadata = 5 [ (gogoproto.nullable) = false ]; ConsumerInitializationParameters init_params = 6; - InfractionParameters infraction_parameters = 7; + // reserved for removed per-consumer infraction parameters + reserved 7; + reserved "infraction_parameters"; // corresponds to the id of the client that is created during launch string client_id = 8; diff --git a/proto/vaas/provider/v1/tx.proto b/proto/vaas/provider/v1/tx.proto index b7e1092..d40e175 100644 --- a/proto/vaas/provider/v1/tx.proto +++ b/proto/vaas/provider/v1/tx.proto @@ -129,8 +129,9 @@ message MsgCreateConsumer { ConsumerInitializationParameters initialization_parameters = 4; - // infraction parameters for slashing and jailing - InfractionParameters infraction_parameters = 5; + // reserved for removed per-consumer infraction parameters + reserved 5; + reserved "infraction_parameters"; } // MsgCreateConsumerResponse defines response type for MsgCreateConsumer @@ -162,8 +163,9 @@ message MsgUpdateConsumer { // This field is optional and can remain empty (i.e., `new_chain_id = ""`) or correspond to the chain id the chain already has. string new_chain_id = 6; - // infraction parameters for slashing and jailing - InfractionParameters infraction_parameters = 7; + // reserved for removed per-consumer infraction parameters + reserved 7; + reserved "infraction_parameters"; } // MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages diff --git a/x/vaas/provider/types/query.pb.go b/x/vaas/provider/types/query.pb.go index 7b2c205..79ca9c7 100644 --- a/x/vaas/provider/types/query.pb.go +++ b/x/vaas/provider/types/query.pb.go @@ -241,8 +241,6 @@ type Chain struct { // The metadata of the consumer chain Metadata ConsumerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` ConsumerId string `protobuf:"bytes,5,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - // Infraction parameters for slashing and jailing - InfractionParameters *InfractionParameters `protobuf:"bytes,6,opt,name=infraction_parameters,json=infractionParameters,proto3" json:"infraction_parameters,omitempty"` } func (m *Chain) Reset() { *m = Chain{} } @@ -313,13 +311,6 @@ func (m *Chain) GetConsumerId() string { return "" } -func (m *Chain) GetInfractionParameters() *InfractionParameters { - if m != nil { - return m.InfractionParameters - } - return nil -} - type QueryValidatorConsumerAddrRequest struct { // The consensus address of the validator on the provider chain ProviderAddress string `protobuf:"bytes,1,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty" yaml:"address"` @@ -1153,13 +1144,12 @@ func (m *QueryConsumerChainRequest) GetConsumerId() string { } type QueryConsumerChainResponse struct { - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - Phase string `protobuf:"bytes,4,opt,name=phase,proto3" json:"phase,omitempty"` - Metadata ConsumerMetadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` - InitParams *ConsumerInitializationParameters `protobuf:"bytes,6,opt,name=init_params,json=initParams,proto3" json:"init_params,omitempty"` - InfractionParameters *InfractionParameters `protobuf:"bytes,7,opt,name=infraction_parameters,json=infractionParameters,proto3" json:"infraction_parameters,omitempty"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + Phase string `protobuf:"bytes,4,opt,name=phase,proto3" json:"phase,omitempty"` + Metadata ConsumerMetadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` + InitParams *ConsumerInitializationParameters `protobuf:"bytes,6,opt,name=init_params,json=initParams,proto3" json:"init_params,omitempty"` // corresponds to the id of the client that is created during launch ClientId string `protobuf:"bytes,8,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` } @@ -1239,13 +1229,6 @@ func (m *QueryConsumerChainResponse) GetInitParams() *ConsumerInitializationPara return nil } -func (m *QueryConsumerChainResponse) GetInfractionParameters() *InfractionParameters { - if m != nil { - return m.InfractionParameters - } - return nil -} - func (m *QueryConsumerChainResponse) GetClientId() string { if m != nil { return m.ClientId @@ -1372,118 +1355,118 @@ func init() { func init() { proto.RegisterFile("vaas/provider/v1/query.proto", fileDescriptor_71b3f55ed407aa51) } var fileDescriptor_71b3f55ed407aa51 = []byte{ - // 1770 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x4d, 0x6c, 0x1b, 0x45, - 0x1b, 0xce, 0x3a, 0x3f, 0x75, 0xc7, 0x6d, 0xda, 0x6f, 0xbe, 0xe4, 0x8b, 0xe3, 0x26, 0x71, 0xbb, - 0xfd, 0xf9, 0xfa, 0x97, 0xdd, 0xda, 0x69, 0x2a, 0x14, 0x0a, 0x28, 0x4e, 0x49,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, 0xb2, 0x84, 0x03, 0x9f, 0xa3, 0xc0, 0x2f, 0xc2, 0x62, 0x8f, 0xe2, 0x49, 0x55, 0x42, - 0x10, 0x7f, 0xa9, 0xfc, 0xf0, 0xd9, 0x94, 0xf4, 0xe8, 0xd9, 0x94, 0xf4, 0xfb, 0xb3, 0x29, 0xe9, - 0xde, 0xf3, 0xa9, 0xbe, 0x47, 0xcf, 0xa7, 0xfa, 0x9e, 0x3e, 0x9f, 0xea, 0xbb, 0xa9, 0xd6, 0x89, - 0xbb, 0xd6, 0xaa, 0x2a, 0x35, 0xb3, 0xa9, 0xa2, 0x46, 0x83, 0x18, 0x55, 0xe2, 0x3a, 0x6c, 0x87, - 0xbb, 0xa1, 0x8d, 0xdc, 0x8e, 0x85, 0x9d, 0xea, 0x10, 0x15, 0x1c, 0x33, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0x4f, 0x72, 0x6e, 0x43, 0x8b, 0x17, 0x00, 0x00, + // 1768 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x3d, 0x6c, 0x1b, 0x47, + 0x16, 0xd6, 0xd2, 0x12, 0x45, 0x0f, 0x6d, 0x59, 0x37, 0x27, 0x9d, 0x28, 0x5a, 0x12, 0xe5, 0xf5, + 0xcf, 0xc9, 0x3f, 0xda, 0x35, 0x29, 0xcb, 0x38, 0xe8, 0x7c, 0x77, 0x10, 0xe5, 0x93, 0x8e, 0xf6, + 0xf9, 0xcc, 0x5b, 0xe9, 0x5c, 0x18, 0xb8, 0x23, 0x86, 0xdc, 0x31, 0x35, 0x27, 0x72, 0x77, 0xbd, + 0xbb, 0xa4, 0xcd, 0x08, 0x6a, 0x52, 0xa5, 0x48, 0x00, 0x03, 0x29, 0x52, 0xa4, 0x31, 0x82, 0x94, + 0x29, 0x5d, 0x04, 0x01, 0xd2, 0xbb, 0x34, 0xec, 0xc6, 0x49, 0xa1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xcd, 0x6c, 0xaa, 0xa8, 0xd1, 0x20, 0x46, 0x95, 0xb8, 0x0e, 0xdb, 0xe1, 0x61, 0x68, + 0x23, 0xb7, 0x63, 0x61, 0xa7, 0x9a, 0xa4, 0x82, 0x63, 0xe1, 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xa7, 0xf7, 0x59, 0xf9, 0x0b, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2142,18 +2125,6 @@ func (m *Chain) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.InfractionParameters != nil { - { - size, err := m.InfractionParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } if len(m.ConsumerId) > 0 { i -= len(m.ConsumerId) copy(dAtA[i:], m.ConsumerId) @@ -2840,18 +2811,6 @@ func (m *QueryConsumerChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, err i-- dAtA[i] = 0x42 } - if m.InfractionParameters != nil { - { - size, err := m.InfractionParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } if m.InitParams != nil { { size, err := m.InitParams.MarshalToSizedBuffer(dAtA[:i]) @@ -2955,12 +2914,12 @@ func (m *QueryConsumerGenesisTimeResponse) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l - n13, err13 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.GenesisTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.GenesisTime):]) - if err13 != nil { - return 0, err13 + n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.GenesisTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.GenesisTime):]) + if err11 != nil { + return 0, err11 } - i -= n13 - i = encodeVarintQuery(dAtA, i, uint64(n13)) + i -= n11 + i = encodeVarintQuery(dAtA, i, uint64(n11)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -3060,10 +3019,6 @@ func (m *Chain) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.InfractionParameters != nil { - l = m.InfractionParameters.Size() - n += 1 + l + sovQuery(uint64(l)) - } return n } @@ -3352,10 +3307,6 @@ func (m *QueryConsumerChainResponse) Size() (n int) { l = m.InitParams.Size() n += 1 + l + sovQuery(uint64(l)) } - if m.InfractionParameters != nil { - l = m.InfractionParameters.Size() - n += 1 + l + sovQuery(uint64(l)) - } l = len(m.ClientId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -3973,42 +3924,6 @@ func (m *Chain) Unmarshal(dAtA []byte) error { } m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InfractionParameters == nil { - m.InfractionParameters = &InfractionParameters{} - } - if err := m.InfractionParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5942,42 +5857,6 @@ func (m *QueryConsumerChainResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InfractionParameters == nil { - m.InfractionParameters = &InfractionParameters{} - } - if err := m.InfractionParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) diff --git a/x/vaas/provider/types/tx.pb.go b/x/vaas/provider/types/tx.pb.go index 354b985..c6d1628 100644 --- a/x/vaas/provider/types/tx.pb.go +++ b/x/vaas/provider/types/tx.pb.go @@ -474,8 +474,6 @@ type MsgCreateConsumer struct { ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Metadata ConsumerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata"` InitializationParameters *ConsumerInitializationParameters `protobuf:"bytes,4,opt,name=initialization_parameters,json=initializationParameters,proto3" json:"initialization_parameters,omitempty"` - // infraction parameters for slashing and jailing - InfractionParameters *InfractionParameters `protobuf:"bytes,5,opt,name=infraction_parameters,json=infractionParameters,proto3" json:"infraction_parameters,omitempty"` } func (m *MsgCreateConsumer) Reset() { *m = MsgCreateConsumer{} } @@ -539,13 +537,6 @@ func (m *MsgCreateConsumer) GetInitializationParameters() *ConsumerInitializatio return nil } -func (m *MsgCreateConsumer) GetInfractionParameters() *InfractionParameters { - if m != nil { - return m.InfractionParameters - } - return nil -} - // MsgCreateConsumerResponse defines response type for MsgCreateConsumer type MsgCreateConsumerResponse struct { ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` @@ -607,8 +598,6 @@ type MsgUpdateConsumer struct { // the chain id CANNOT be updated. // This field is optional and can remain empty (i.e., `new_chain_id = ""`) or correspond to the chain id the chain already has. NewChainId string `protobuf:"bytes,6,opt,name=new_chain_id,json=newChainId,proto3" json:"new_chain_id,omitempty"` - // infraction parameters for slashing and jailing - InfractionParameters *InfractionParameters `protobuf:"bytes,7,opt,name=infraction_parameters,json=infractionParameters,proto3" json:"infraction_parameters,omitempty"` } func (m *MsgUpdateConsumer) Reset() { *m = MsgUpdateConsumer{} } @@ -686,13 +675,6 @@ func (m *MsgUpdateConsumer) GetNewChainId() string { return "" } -func (m *MsgUpdateConsumer) GetInfractionParameters() *InfractionParameters { - if m != nil { - return m.InfractionParameters - } - return nil -} - // MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages type MsgUpdateConsumerResponse struct { } @@ -750,76 +732,76 @@ func init() { func init() { proto.RegisterFile("vaas/provider/v1/tx.proto", fileDescriptor_a07778b1d094765c) } var fileDescriptor_a07778b1d094765c = []byte{ - // 1102 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4d, 0x6f, 0xdc, 0x44, - 0x18, 0x5e, 0xe7, 0xab, 0xed, 0x24, 0xa4, 0xc4, 0xa4, 0x64, 0x77, 0x29, 0xbb, 0xed, 0x22, 0x28, - 0x14, 0xb0, 0x49, 0x90, 0x5a, 0x29, 0x42, 0x48, 0xf9, 0x40, 0x22, 0x42, 0x2b, 0x22, 0x57, 0xf4, - 0x00, 0x08, 0x6b, 0x6c, 0x4f, 0xbd, 0xa3, 0xd8, 0x33, 0x96, 0x67, 0x76, 0xd3, 0xe5, 0x84, 0x38, - 0x20, 0xc4, 0x09, 0x0e, 0xdc, 0xfb, 0x13, 0x7a, 0xe0, 0x47, 0xf4, 0x58, 0x38, 0x21, 0x0e, 0x15, - 0x4a, 0x24, 0xca, 0x99, 0x5f, 0x80, 0x3c, 0x33, 0xf6, 0xda, 0x5e, 0xef, 0x07, 0x05, 0x2e, 0x2b, - 0xcf, 0xbc, 0xcf, 0x3c, 0xef, 0x3b, 0xcf, 0xfb, 0x8c, 0x67, 0x0d, 0x1a, 0x03, 0x08, 0x99, 0x19, - 0xc5, 0x74, 0x80, 0x3d, 0x14, 0x9b, 0x83, 0x6d, 0x93, 0xdf, 0x37, 0xa2, 0x98, 0x72, 0xaa, 0x3f, - 0x9f, 0x84, 0x8c, 0x34, 0x64, 0x0c, 0xb6, 0x9b, 0x1b, 0x30, 0xc4, 0x84, 0x9a, 0xe2, 0x57, 0x82, - 0x9a, 0x57, 0x7d, 0x4a, 0xfd, 0x00, 0x99, 0x30, 0xc2, 0x26, 0x24, 0x84, 0x72, 0xc8, 0x31, 0x25, - 0x4c, 0x45, 0xdb, 0x2a, 0x2a, 0x46, 0x4e, 0xff, 0x9e, 0xc9, 0x71, 0x88, 0x18, 0x87, 0x61, 0xa4, - 0x00, 0xad, 0x32, 0xc0, 0xeb, 0xc7, 0x82, 0x41, 0xc5, 0x1b, 0xe5, 0x38, 0x24, 0x43, 0x15, 0xda, - 0xf4, 0xa9, 0x4f, 0xc5, 0xa3, 0x99, 0x3c, 0xa5, 0x0b, 0x5c, 0xca, 0x42, 0xca, 0x6c, 0x19, 0x90, - 0x03, 0x15, 0xda, 0x92, 0x23, 0x33, 0x64, 0x7e, 0xb2, 0xcf, 0x90, 0xf9, 0x69, 0x95, 0xd8, 0x71, - 0x4d, 0x97, 0xc6, 0xc8, 0x74, 0x03, 0x8c, 0x08, 0x4f, 0xa2, 0xf2, 0x29, 0x05, 0x8c, 0x89, 0x94, - 0xa9, 0x22, 0x01, 0x66, 0xc2, 0x10, 0x60, 0xbf, 0xc7, 0xe5, 0x3a, 0x66, 0x72, 0x44, 0x3c, 0x14, - 0x87, 0x58, 0xb2, 0x8d, 0x46, 0x29, 0x63, 0x2e, 0xce, 0x87, 0x11, 0x62, 0x26, 0x4a, 0xf8, 0x88, - 0x8b, 0x24, 0xa0, 0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d2, 0x3f, 0x07, - 0x6b, 0x85, 0xdb, 0xfb, 0xfa, 0x94, 0x02, 0x25, 0xa4, 0xf9, 0xc6, 0x4c, 0x48, 0xca, 0xde, 0x5c, - 0xfe, 0xea, 0xe9, 0xc3, 0x9b, 0xda, 0xfe, 0xd1, 0xa3, 0xb3, 0x96, 0xf6, 0xf8, 0xac, 0xa5, 0xfd, - 0x7e, 0xd6, 0xd2, 0xbe, 0x3f, 0x6f, 0xd5, 0x1e, 0x9f, 0xb7, 0x6a, 0xbf, 0x9e, 0xb7, 0x6a, 0x9f, - 0x9a, 0x3e, 0xe6, 0xbd, 0xbe, 0x63, 0xb8, 0x34, 0x34, 0x61, 0x10, 0x60, 0xe2, 0x60, 0xce, 0x4c, - 0xf1, 0x41, 0x71, 0xdf, 0x2c, 0x7e, 0x57, 0x88, 0x3f, 0x58, 0xce, 0x8a, 0xf8, 0x00, 0x78, 0xf7, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9d, 0xe2, 0x5d, 0x55, 0x9a, 0x0d, 0x00, 0x00, + // 1099 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0x5e, 0x27, 0x9b, 0x6d, 0x3a, 0x09, 0x6d, 0x62, 0x52, 0xb2, 0xbb, 0x94, 0xdd, 0xd6, 0x88, + 0x16, 0x0a, 0xd8, 0x24, 0x48, 0xad, 0x14, 0x21, 0xa4, 0xfc, 0x40, 0x22, 0x45, 0x2b, 0x22, 0x57, + 0xf4, 0x80, 0x10, 0xd6, 0xd8, 0x9e, 0x7a, 0x47, 0x59, 0xcf, 0xac, 0x3c, 0xb3, 0x9b, 0x2e, 0x27, + 0xc4, 0x01, 0x71, 0x84, 0x03, 0xf7, 0x9e, 0x38, 0xf7, 0xc0, 0x1f, 0x51, 0x71, 0x2a, 0x9c, 0x10, + 0x87, 0x0a, 0x25, 0x87, 0x72, 0xe6, 0x2f, 0x40, 0x9e, 0x19, 0x3b, 0xb6, 0xd7, 0xfb, 0x83, 0xc2, + 0x65, 0xb5, 0x33, 0xef, 0x7b, 0xdf, 0x7b, 0xf3, 0xbd, 0x37, 0x7e, 0x03, 0x1a, 0x43, 0x08, 0x99, + 0xd5, 0x8f, 0xe8, 0x10, 0xfb, 0x28, 0xb2, 0x86, 0x5b, 0x16, 0x7f, 0x68, 0xf6, 0x23, 0xca, 0xa9, + 0xbe, 0x16, 0x9b, 0xcc, 0xc4, 0x64, 0x0e, 0xb7, 0x9a, 0xeb, 0x30, 0xc4, 0x84, 0x5a, 0xe2, 0x57, + 0x82, 0x9a, 0x57, 0x03, 0x4a, 0x83, 0x1e, 0xb2, 0x60, 0x1f, 0x5b, 0x90, 0x10, 0xca, 0x21, 0xc7, + 0x94, 0x30, 0x65, 0x6d, 0x2b, 0xab, 0x58, 0xb9, 0x83, 0x07, 0x16, 0xc7, 0x21, 0x62, 0x1c, 0x86, + 0x7d, 0x05, 0x68, 0x15, 0x01, 0xfe, 0x20, 0x12, 0x0c, 0xca, 0xde, 0x28, 0xda, 0x21, 0x19, 0x29, + 0xd3, 0x46, 0x40, 0x03, 0x2a, 0xfe, 0x5a, 0xf1, 0xbf, 0xc4, 0xc1, 0xa3, 0x2c, 0xa4, 0xcc, 0x91, + 0x06, 0xb9, 0x50, 0xa6, 0x4d, 0xb9, 0xb2, 0x42, 0x16, 0xc4, 0xe7, 0x0c, 0x59, 0x90, 0x64, 0x89, + 0x5d, 0xcf, 0xf2, 0x68, 0x84, 0x2c, 0xaf, 0x87, 0x11, 0xe1, 0xb1, 0x55, 0xfe, 0x4b, 0x00, 0x63, + 0x22, 0xa5, 0xaa, 0x48, 0x80, 0x15, 0x33, 0xf4, 0x70, 0xd0, 0xe5, 0xd2, 0x8f, 0x59, 0x1c, 0x11, + 0x1f, 0x45, 0x21, 0x96, 0x6c, 0xe7, 0xab, 0x84, 0x31, 0x63,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xca, 0x63, 0xe4, 0x41, 0x13, 0x62, 0x94, 0xcf, 0x00, 0xfd, 0x0b, 0xb0, 0x9a, 0x9b, + 0x9e, 0xd7, 0xa7, 0x24, 0x28, 0x21, 0xcd, 0xb7, 0x66, 0x42, 0x12, 0xf6, 0xe6, 0xd2, 0xd7, 0xcf, + 0x1f, 0xdf, 0xd2, 0xf6, 0x0e, 0x9f, 0x9c, 0xb6, 0xb4, 0xa7, 0xa7, 0x2d, 0xed, 0xcf, 0xd3, 0x96, + 0xf6, 0xfd, 0x59, 0xab, 0xf2, 0xf4, 0xac, 0x55, 0xf9, 0xfd, 0xac, 0x55, 0xf9, 0xdc, 0x0a, 0x30, + 0xef, 0x0e, 0x5c, 0xd3, 0xa3, 0xa1, 0x05, 0x7b, 0x3d, 0x4c, 0x5c, 0xcc, 0x99, 0x25, 0x1e, 0xf4, + 0x0f, 0xad, 0xfc, 0xbb, 0x5e, 0x3c, 0x70, 0xdc, 0x9a, 0x78, 0x80, 0xbf, 0xff, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x7a, 0x2c, 0x4a, 0x11, 0x1a, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1491,18 +1473,6 @@ func (m *MsgCreateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.InfractionParameters != nil { - { - size, err := m.InfractionParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if m.InitializationParameters != nil { { size, err := m.InitializationParameters.MarshalToSizedBuffer(dAtA[:i]) @@ -1592,18 +1562,6 @@ func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.InfractionParameters != nil { - { - size, err := m.InfractionParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } if len(m.NewChainId) > 0 { i -= len(m.NewChainId) copy(dAtA[i:], m.NewChainId) @@ -1861,10 +1819,6 @@ func (m *MsgCreateConsumer) Size() (n int) { l = m.InitializationParameters.Size() n += 1 + l + sovTx(uint64(l)) } - if m.InfractionParameters != nil { - l = m.InfractionParameters.Size() - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -1911,10 +1865,6 @@ func (m *MsgUpdateConsumer) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.InfractionParameters != nil { - l = m.InfractionParameters.Size() - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -3088,42 +3038,6 @@ func (m *MsgCreateConsumer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InfractionParameters == nil { - m.InfractionParameters = &InfractionParameters{} - } - if err := m.InfractionParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3456,42 +3370,6 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } m.NewChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InfractionParameters == nil { - m.InfractionParameters = &InfractionParameters{} - } - if err := m.InfractionParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 61207d1e193a23a1df498b394d5eb7661968b246 Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 18:40:55 -0300 Subject: [PATCH 02/16] fix `NewMsgCreateConsumer` --- x/vaas/provider/types/msg.go | 40 +--------------- x/vaas/provider/types/msg_test.go | 80 +++++-------------------------- 2 files changed, 13 insertions(+), 107 deletions(-) diff --git a/x/vaas/provider/types/msg.go b/x/vaas/provider/types/msg.go index 8461b15..47b19c7 100644 --- a/x/vaas/provider/types/msg.go +++ b/x/vaas/provider/types/msg.go @@ -143,14 +143,12 @@ func (msg MsgSubmitConsumerDoubleVoting) ValidateBasic() error { // NewMsgCreateConsumer creates a new MsgCreateConsumer instance func NewMsgCreateConsumer(submitter, chainId string, metadata ConsumerMetadata, initializationParameters *ConsumerInitializationParameters, - infractionParameters *InfractionParameters, ) (*MsgCreateConsumer, error) { return &MsgCreateConsumer{ Submitter: submitter, ChainId: chainId, Metadata: metadata, InitializationParameters: initializationParameters, - InfractionParameters: infractionParameters, }, nil } @@ -195,19 +193,13 @@ func (msg MsgCreateConsumer) ValidateBasic() error { } } - if msg.InfractionParameters != nil { - if err := ValidateInfractionParameters(*msg.InfractionParameters); err != nil { - return errorsmod.Wrapf(ErrInvalidMsgCreateConsumer, "InfractionParameters: %s", err.Error()) - } - } - return nil } // NewMsgUpdateConsumer creates a new MsgUpdateConsumer instance func NewMsgUpdateConsumer(owner, consumerId, ownerAddress string, metadata *ConsumerMetadata, initializationParameters *ConsumerInitializationParameters, - newChainId string, infractionParameters *InfractionParameters, + newChainId string, ) (*MsgUpdateConsumer, error) { return &MsgUpdateConsumer{ Owner: owner, @@ -216,7 +208,6 @@ func NewMsgUpdateConsumer(owner, consumerId, ownerAddress string, metadata *Cons Metadata: metadata, InitializationParameters: initializationParameters, NewChainId: newChainId, - InfractionParameters: infractionParameters, }, nil } @@ -240,12 +231,6 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { } } - if msg.InfractionParameters != nil { - if err := ValidateInfractionParameters(*msg.InfractionParameters); err != nil { - return errorsmod.Wrapf(ErrInvalidMsgUpdateConsumer, "InfractionParameters: %s", err.Error()) - } - } - return nil } @@ -388,29 +373,6 @@ func ValidateInitializationParameters(initializationParameters ConsumerInitializ return nil } -// ValidateInfractionParameters validates that all the provided infraction parameters are in the expected range -func ValidateInfractionParameters(initializationParameters InfractionParameters) error { - if initializationParameters.DoubleSign != nil { - if initializationParameters.DoubleSign.JailDuration < 0 { - return errorsmod.Wrap(ErrInvalidConsumerInfractionParameters, "DoubleSign.JailDuration cannot be negative") - } - if err := vaastypes.ValidateFraction(initializationParameters.DoubleSign.SlashFraction); err != nil { - return errorsmod.Wrapf(ErrInvalidConsumerInfractionParameters, "DoubleSign.SlashFraction: %s", err.Error()) - } - } - - if initializationParameters.Downtime != nil { - if initializationParameters.Downtime.JailDuration < 0 { - return errorsmod.Wrap(ErrInvalidConsumerInfractionParameters, "Downtime.JailDuration cannot be negative") - } - if err := vaastypes.ValidateFraction(initializationParameters.Downtime.SlashFraction); err != nil { - return errorsmod.Wrapf(ErrInvalidConsumerInfractionParameters, "Downtime.SlashFraction: %s", err.Error()) - } - } - - return nil -} - func ValidateByteSlice(hash []byte, maxLength int) error { if len(hash) > maxLength { return fmt.Errorf("hash is too long; got: %d, max: %d", len(hash), maxLength) diff --git a/x/vaas/provider/types/msg_test.go b/x/vaas/provider/types/msg_test.go index e15412c..867ffd0 100644 --- a/x/vaas/provider/types/msg_test.go +++ b/x/vaas/provider/types/msg_test.go @@ -8,8 +8,6 @@ import ( clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" "github.com/stretchr/testify/require" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" cryptoutil "github.com/allinbits/vaas/testutil/crypto" @@ -163,7 +161,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: now, UnbondingPeriod: time.Duration(100000000000), - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 10000, ConnectionId: "", }, @@ -177,7 +175,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: now, UnbondingPeriod: time.Duration(100000000000), - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 10000, ConnectionId: "", }, @@ -191,7 +189,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: now, UnbondingPeriod: time.Duration(100000000000), - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 10000, ConnectionId: "", }, @@ -205,7 +203,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: time.Time{}, UnbondingPeriod: time.Duration(100000000000), - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 10000, ConnectionId: "", }, @@ -219,7 +217,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: now, UnbondingPeriod: 0, - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 10000, ConnectionId: "", }, @@ -233,7 +231,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: now, UnbondingPeriod: time.Duration(100000000000), - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 0, ConnectionId: "", }, @@ -247,7 +245,7 @@ func TestValidateInitializationParameters(t *testing.T) { BinaryHash: []byte{0x01}, SpawnTime: now, UnbondingPeriod: time.Duration(100000000000), - VaasTimeoutPeriod: time.Duration(100000000000), + VaasTimeoutPeriod: time.Duration(100000000000), HistoricalEntries: 10000, ConnectionId: coolStr, }, @@ -265,7 +263,6 @@ func TestValidateInitializationParameters(t *testing.T) { } } - func TestValidateByteSlice(t *testing.T) { testCases := []struct { name string @@ -305,93 +302,40 @@ func TestValidateByteSlice(t *testing.T) { func TestMsgCreateConsumerValidateBasic(t *testing.T) { testCases := []struct { - name string - chainId string - infractionParameters *types.InfractionParameters - expPass bool + name string + chainId string + expPass bool }{ { "empty chain id", "", - nil, false, }, { "empty chain id after trimming", " ", - nil, false, }, { "neutron chain id that cannot be reused", "neutron-1", - nil, false, }, { "stride chain id that cannot be reused", "stride-1", - nil, false, }, { "valid chain id", "somechain-1", - &types.InfractionParameters{ - DoubleSign: &types.SlashJailParameters{ - JailDuration: time.Duration(1<<63 - 1), // max duration - SlashFraction: math.LegacyNewDecWithPrec(5, 2), // 0.05 - Tombstone: true, - }, - Downtime: &types.SlashJailParameters{ - JailDuration: 600 * time.Second, - SlashFraction: math.LegacyNewDec(0), - Tombstone: false, - }, - }, // valid infraction params true, }, - { - "invalid infraction downtime jailing parameters", - "somechain-1", - &types.InfractionParameters{Downtime: &types.SlashJailParameters{ - JailDuration: -1, - SlashFraction: math.LegacyNewDec(0), - }}, - false, - }, - { - "invalid infraction downtime slashing parameters", - "somechain-1", - &types.InfractionParameters{Downtime: &types.SlashJailParameters{ - JailDuration: 600 * time.Second, - SlashFraction: math.LegacyNewDec(2), - }}, - false, - }, - { - "invalid infraction double sign jailing parameters", - "somechain-1", - &types.InfractionParameters{Downtime: &types.SlashJailParameters{ - JailDuration: -1, - SlashFraction: math.LegacyNewDec(0), - }}, - false, - }, - { - "invalid infraction double sign slashing parameters", - "somechain-1", - &types.InfractionParameters{Downtime: &types.SlashJailParameters{ - JailDuration: 600 * time.Second, - SlashFraction: math.LegacyNewDec(2), - }}, - false, - }, } for _, tc := range testCases { validConsumerMetadata := types.ConsumerMetadata{Name: "name", Description: "description", Metadata: "metadata"} - msg, err := types.NewMsgCreateConsumer("submitter", tc.chainId, validConsumerMetadata, nil, tc.infractionParameters) + msg, err := types.NewMsgCreateConsumer("submitter", tc.chainId, validConsumerMetadata, nil) require.NoError(t, err) err = msg.ValidateBasic() if tc.expPass { @@ -416,7 +360,7 @@ func TestMsgUpdateConsumerValidateBasic(t *testing.T) { } for _, tc := range testCases { - msg, _ := types.NewMsgUpdateConsumer("", "0", "cosmos1p3ucd3ptpw902fluyjzhq3ffgq4ntddac9sa3s", nil, nil, tc.newChainId, nil) + msg, _ := types.NewMsgUpdateConsumer("", "0", "cosmos1p3ucd3ptpw902fluyjzhq3ffgq4ntddac9sa3s", nil, nil, tc.newChainId) err := msg.ValidateBasic() if tc.expPass { require.NoError(t, err, "valid case: %s should not return error. got %w", tc.name, err) From 0ca97be54f6c22b705f44b1d7be16281b616d5d6 Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 18:41:24 -0300 Subject: [PATCH 03/16] remove unused keys --- x/vaas/provider/types/keys.go | 50 ------------------------------ x/vaas/provider/types/keys_test.go | 9 ------ 2 files changed, 59 deletions(-) diff --git a/x/vaas/provider/types/keys.go b/x/vaas/provider/types/keys.go index 98ec3f9..e07f536 100644 --- a/x/vaas/provider/types/keys.go +++ b/x/vaas/provider/types/keys.go @@ -89,12 +89,6 @@ const ( ClientIdToConsumerIdKeyName = "ClientIdToConsumerIdKey" PrioritylistKeyName = "PrioritylistKey" - - ConsumerIdToInfractionParametersKeyName = "ConsumerIdToInfractionParametersKey" - - ConsumerIdToQueuedInfractionParametersKeyName = "ConsumerIdToQueuedInfractionParametersKeyName" - - InfractionScheduledTimeToConsumerIdsKeyName = "InfractionScheduledTimeToConsumerIdsKeyName" ) // getKeyPrefixes returns a constant map of all the byte prefixes for existing keys @@ -197,15 +191,6 @@ func getKeyPrefixes() map[string]byte { // prioritylisted. PrioritylistKeyName: 26, - // ConsumerIdToInfractionParametersKeyName is the key for storing slashing and jailing infraction parameters for a specific consumer chain - ConsumerIdToInfractionParametersKeyName: 27, - - // ConsumerIdToQueuedInfractionParametersKeyName is the key for storing queued infraction parameters that will be used to update consumer infraction parameters - ConsumerIdToQueuedInfractionParametersKeyName: 28, - - // InfractionScheduledTimeToConsumerIdsKeyName is the key for storing time when the infraction parameters will be updated for the specific consumer - InfractionScheduledTimeToConsumerIdsKeyName: 29, - // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } } @@ -511,41 +496,6 @@ func ClientIdToConsumerIdKey(clientId string) []byte { ) } -// ConsumerIdToInfractionParametersKeyPrefix returns the key prefix for storing consumer infraction parameters -func ConsumerIdToInfractionParametersKeyPrefix() byte { - return mustGetKeyPrefix(ConsumerIdToInfractionParametersKeyName) -} - -// ConsumerIdToInfractionParametersKey returns the key used to store the infraction parameters that corresponds to this consumer id -func ConsumerIdToInfractionParametersKey(consumerId string) []byte { - return StringIdWithLenKey(ConsumerIdToInfractionParametersKeyPrefix(), consumerId) -} - -// ConsumerIdToQueuedInfractionParametersKeyPrefix returns the key prefix for storing queued consumer infraction parameters that will be applied after due time -func ConsumerIdToQueuedInfractionParametersKeyPrefix() byte { - return mustGetKeyPrefix(ConsumerIdToQueuedInfractionParametersKeyName) -} - -// ConsumerIdToQueuedInfractionParametersKey returns the key used to store the queued consumer infraction parameters that will be applied after due time -func ConsumerIdToQueuedInfractionParametersKey(consumerId string) []byte { - return StringIdWithLenKey(ConsumerIdToQueuedInfractionParametersKeyPrefix(), consumerId) -} - -// InfractionScheduledTimeToConsumerIdsKeyPrefix returns the key prefix for storing pending consumers ids that needs to update their infraction parameters at the specific time -func InfractionScheduledTimeToConsumerIdsKeyPrefix() byte { - return mustGetKeyPrefix(InfractionScheduledTimeToConsumerIdsKeyName) -} - -// InfractionScheduledTimeToConsumerIdsKey returns the key prefix for storing pending consumers ids that needs to update their infraction parameters at the specific time -func InfractionScheduledTimeToConsumerIdsKey(updateTime time.Time) []byte { - return vaastypes.AppendMany( - // append the prefix - []byte{InfractionScheduledTimeToConsumerIdsKeyPrefix()}, - // append the time - sdk.FormatTimeBytes(updateTime), - ) -} - // NOTE: DO NOT ADD FULLY DEFINED KEY FUNCTIONS WITHOUT ADDING THEM TO getAllFullyDefinedKeys() IN keys_test.go // diff --git a/x/vaas/provider/types/keys_test.go b/x/vaas/provider/types/keys_test.go index 49e835b..dacdd30 100644 --- a/x/vaas/provider/types/keys_test.go +++ b/x/vaas/provider/types/keys_test.go @@ -83,12 +83,6 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(26), providertypes.PrioritylistKeyPrefix()) i++ - require.Equal(t, byte(27), providertypes.ConsumerIdToInfractionParametersKeyPrefix()) - i++ - require.Equal(t, byte(28), providertypes.ConsumerIdToQueuedInfractionParametersKeyPrefix()) - i++ - require.Equal(t, byte(29), providertypes.InfractionScheduledTimeToConsumerIdsKeyPrefix()) - i++ prefixes := providertypes.GetAllKeyPrefixes() require.Equal(t, len(prefixes), i) @@ -136,9 +130,6 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.RemovalTimeToConsumerIdsKey(time.Time{}), providertypes.ClientIdToConsumerIdKey("clientId"), providertypes.PrioritylistKey("13", providertypes.NewProviderConsAddress([]byte{0x05})), - providertypes.ConsumerIdToInfractionParametersKey("13"), - providertypes.ConsumerIdToQueuedInfractionParametersKey("13"), - providertypes.InfractionScheduledTimeToConsumerIdsKey(time.Time{}), } } From 67cecdf33fd96014561b3abc0aedf5d1cfe73887 Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 18:42:06 -0300 Subject: [PATCH 04/16] fix query infraction parameters --- x/vaas/provider/keeper/grpc_query.go | 35 ++++++++++------------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/x/vaas/provider/keeper/grpc_query.go b/x/vaas/provider/keeper/grpc_query.go index 2f0f599..601bb94 100644 --- a/x/vaas/provider/keeper/grpc_query.go +++ b/x/vaas/provider/keeper/grpc_query.go @@ -98,18 +98,12 @@ func (k Keeper) GetConsumerChain(ctx sdk.Context, consumerId string) (types.Chai return types.Chain{}, fmt.Errorf("cannot find metadata (%s): %s", consumerId, err.Error()) } - infractionParameters, err := types.DefaultConsumerInfractionParameters(ctx, k.slashingKeeper) - if err != nil { - return types.Chain{}, fmt.Errorf("cannot get default infraction parameters: %s", err.Error()) - } - return types.Chain{ - ChainId: chainID, - ClientId: clientID, - Phase: k.GetConsumerPhase(ctx, consumerId).String(), - Metadata: metadata, - ConsumerId: consumerId, - InfractionParameters: &infractionParameters, + ChainId: chainID, + ClientId: clientID, + Phase: k.GetConsumerPhase(ctx, consumerId).String(), + Metadata: metadata, + ConsumerId: consumerId, }, nil } @@ -327,22 +321,17 @@ func (k Keeper) QueryConsumerChain(goCtx context.Context, req *types.QueryConsum } initParams, _ := k.GetConsumerInitializationParameters(ctx, consumerId) - infractionParams, err := types.DefaultConsumerInfractionParameters(ctx, k.slashingKeeper) - if err != nil { - return nil, status.Errorf(codes.Internal, "cannot retrieve default infraction parameters: %s", err) - } clientId, _ := k.GetConsumerClientId(ctx, consumerId) return &types.QueryConsumerChainResponse{ - ChainId: chainId, - ConsumerId: consumerId, - OwnerAddress: ownerAddress, - Phase: phase.String(), - Metadata: metadata, - InitParams: &initParams, - InfractionParameters: &infractionParams, - ClientId: clientId, + ChainId: chainId, + ConsumerId: consumerId, + OwnerAddress: ownerAddress, + Phase: phase.String(), + Metadata: metadata, + InitParams: &initParams, + ClientId: clientId, }, nil } From 2a8594522a929f5348bb6f66e44f1c56a549e68f Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 18:42:49 -0300 Subject: [PATCH 05/16] remove infraction_parameters from tx cli --- x/vaas/provider/client/cli/tx.go | 43 +++++++------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/x/vaas/provider/client/cli/tx.go b/x/vaas/provider/client/cli/tx.go index 767542d..cb4a709 100644 --- a/x/vaas/provider/client/cli/tx.go +++ b/x/vaas/provider/client/cli/tx.go @@ -238,23 +238,11 @@ where create_consumer.json has the following structure: "ccv_timeout_period": 2419200000000000, "historical_entries": 10000, "connection_id": "" - }, - "infraction_parameters":{ - "double_sign":{ - "slash_fraction": "0.05", - "jail_duration": 9223372036854775807, - "tombstone": true - }, - "downtime":{ - "slash_fraction": "0.0001", - "jail_duration": 600000000000, - "tombstone": false - } } } Note that both 'chain_id' and 'metadata' are mandatory; -and 'initialization_parameters' and 'infraction_parameters' are optional. +and 'initialization_parameters' is optional. The parameters not provided are set to their zero value. `, version.AppName)), Args: cobra.ExactArgs(1), @@ -281,8 +269,7 @@ The parameters not provided are set to their zero value. return fmt.Errorf("consumer data unmarshalling failed: %w", err) } - msg, err := types.NewMsgCreateConsumer(submitter, consCreate.ChainId, consCreate.Metadata, consCreate.InitializationParameters, - consCreate.InfractionParameters) + msg, err := types.NewMsgCreateConsumer(submitter, consCreate.ChainId, consCreate.Metadata, consCreate.InitializationParameters) if err != nil { return err } @@ -328,30 +315,18 @@ where update_consumer.json has the following structure: }, "genesis_hash": "", "binary_hash": "", - "spawn_time": "2024-08-29T12:26:16.529913Z", - "unbonding_period": 1728000000000000, - "ccv_timeout_period": 2419200000000000, - "historical_entries": 10000, - "connection_id": "" - }, - "infraction_parameters":{ - "double_sign":{ - "slash_fraction": "0.05", - "jail_duration": 9223372036854775807, - "tombstone": true - }, - "downtime":{ - "slash_fraction": "0.0001", - "jail_duration": 600000000000, - "tombstone": false - } + "spawn_time": "2024-08-29T12:26:16.529913Z", + "unbonding_period": 1728000000000000, + "ccv_timeout_period": 2419200000000000, + "historical_entries": 10000, + "connection_id": "" }, "new_chain_id": "newConsumer-1" // is optional and can be empty (i.e., "new_chain_id": "") } Note that only 'consumer_id' is mandatory. The others are optional. Not providing one of them will leave the existing values unchanged. -Providing one of 'metadata', 'initialization_parameters', or 'infraction_parameters' +Providing one of 'metadata' or 'initialization_parameters' will update all the containing fields. If one of the fields is missing, it will be set to its zero value. `, version.AppName)), @@ -385,7 +360,7 @@ If one of the fields is missing, it will be set to its zero value. } msg, err := types.NewMsgUpdateConsumer(owner, consUpdate.ConsumerId, consUpdate.NewOwnerAddress, consUpdate.Metadata, - consUpdate.InitializationParameters, consUpdate.NewChainId, consUpdate.InfractionParameters) + consUpdate.InitializationParameters, consUpdate.NewChainId) if err != nil { return err } From edef51956eeaf8d076e04d855b0d63f295334e7e Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 18:43:26 -0300 Subject: [PATCH 06/16] remove unused error --- x/vaas/provider/types/errors.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/vaas/provider/types/errors.go b/x/vaas/provider/types/errors.go index 0a8d339..f0ad3b6 100644 --- a/x/vaas/provider/types/errors.go +++ b/x/vaas/provider/types/errors.go @@ -28,5 +28,4 @@ var ( ErrInvalidMsgAssignConsumerKey = errorsmod.Register(ModuleName, 46, "invalid assign consumer key message") ErrInvalidMsgSubmitConsumerMisbehaviour = errorsmod.Register(ModuleName, 47, "invalid submit consumer misbehaviour message") ErrInvalidMsgSubmitConsumerDoubleVoting = errorsmod.Register(ModuleName, 48, "invalid submit consumer double voting message") - ErrInvalidConsumerInfractionParameters = errorsmod.Register(ModuleName, 54, "invalid consumer infraction parameters") ) From b66b38cf7872ee9b22e6789f4a348fdbf3841419 Mon Sep 17 00:00:00 2001 From: Pantani Date: Wed, 4 Feb 2026 23:40:29 -0300 Subject: [PATCH 07/16] update docs, summary and plan --- PLAN.md | 2 +- README.md | 2 +- REWRITE_SUMMARY.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PLAN.md b/PLAN.md index 67964dc..73778d4 100644 --- a/PLAN.md +++ b/PLAN.md @@ -16,7 +16,7 @@ Rewrite `x/vaas/provider` and `x/vaas/consumer` in a new `vaas` folder as a **ne | Partial Set Security (PSS) | **REMOVE** | All validators validate all consumers (no opt-in/out) | | Power Shaping | **REMOVE** | No caps, allowlists, denylists, etc. | | Key Assignment | **KEEP** | Validators can use different keys per consumer | -| Per-Consumer Infraction Parameters | **KEEP** | Customizable slash/jail params per consumer | +| Per-Consumer Infraction Parameters | **REMOVE** | Use provider defaults; no per-consumer customization | | Slash Packet Throttling | **REMOVE** | Remove all slash-related functionality | | Consumer Reward Distribution | **REMOVE** | No cross-chain rewards | | Double Voting Evidence | **KEEP** | Handle double voting evidence from consumers | diff --git a/README.md b/README.md index c3a366a..6df688d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ VAAS allows Cosmos blockchains to lease their proof-of-stake security to consume |---------|-------------| | Consumer Lifecycle | Full lifecycle management (REGISTERED → INITIALIZED → LAUNCHED → STOPPED → DELETED) | | Key Assignment | Validators can use different consensus keys per consumer chain | -| Per-Consumer Infraction Parameters | Customizable slash/jail parameters per consumer | +| Slashing Parameters | Uses provider defaults; per-consumer customization removed | | VSC Packets | Validator set updates sent at epoch boundaries | | Double Voting Evidence | Handle double voting evidence from consumers | | Light Client Misbehavior | Detection and logging of misbehavior | diff --git a/REWRITE_SUMMARY.md b/REWRITE_SUMMARY.md index b7f6e31..e484024 100644 --- a/REWRITE_SUMMARY.md +++ b/REWRITE_SUMMARY.md @@ -34,7 +34,7 @@ The rewrite simplifies the interchain security modules by removing several featu ### Provider Module - Consumer Lifecycle Management (REGISTERED → INITIALIZED → LAUNCHED → STOPPED → DELETED) - Key Assignment (validators can use different keys per consumer) -- Per-Consumer Infraction Parameters (custom slash/jail params per consumer) +- Provider Slashing Parameters only (per-consumer customization removed) - VSC Packet Generation at epoch boundaries - IBC Channel Management - Double Voting Evidence handling From 897bd3040a600d11aaa76ddb0f23b229341f1de4 Mon Sep 17 00:00:00 2001 From: Pantani Date: Fri, 13 Feb 2026 10:32:09 -0300 Subject: [PATCH 08/16] - Make repeated evidence submissions idempotent when the validator is already tombstoned - Enforce infraction header height == evidence height and header chain-id matches the consumer chain-id. --- go.mod | 7 +- go.sum | 20 +-- .../provider/keeper/consumer_equivocation.go | 56 +++--- x/vaas/provider/keeper/msg_server.go | 39 +++- x/vaas/provider/types/msg.go | 42 +++-- x/vaas/provider/types/submit_msgs_test.go | 169 ++++++++++++++++++ 6 files changed, 268 insertions(+), 65 deletions(-) create mode 100644 x/vaas/provider/types/submit_msgs_test.go diff --git a/go.mod b/go.mod index e6ae9f4..21b6580 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.25 replace ( cosmossdk.io/x/evidence => github.com/atomone-hub/cosmos-sdk/x/evidence v0.1.1 cosmossdk.io/x/upgrade => github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251218143825-cbb67818e94a - github.com/bytedance/sonic => github.com/bytedance/sonic v1.12.7 + github.com/bytedance/sonic => github.com/bytedance/sonic v1.15.0 github.com/cosmos/cosmos-sdk => github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251218143825-cbb67818e94a github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) @@ -79,12 +79,13 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/bits-and-blooms/bitset v1.22.0 // indirect + github.com/bytedance/gopkg v0.1.3 // indirect github.com/bytedance/sonic v1.13.2 // indirect - github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/bytedance/sonic/loader v0.5.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect - github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cloudwego/base64x v0.1.6 // indirect github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240616162244-4768e80dfb9a // indirect diff --git a/go.sum b/go.sum index cb55402..32f18cb 100644 --- a/go.sum +++ b/go.sum @@ -154,11 +154,12 @@ github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/ github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= -github.com/bytedance/sonic v1.12.7 h1:CQU8pxOy9HToxhndH0Kx/S1qU/CuS9GnKYrGioDcU1Q= -github.com/bytedance/sonic v1.12.7/go.mod h1:tnbal4mxOMju17EGfknm2XyYcpyCnIROYOEYuemj13I= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= -github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= +github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= +github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE= +github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k= +github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE= +github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -182,9 +183,8 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= -github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= +github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= @@ -546,10 +546,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -792,6 +790,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= @@ -1143,7 +1142,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.11 h1:f/qXNc2/3DpoSZkHt1DQu6rj4zGC8JmkkLkWss0MgN0= nhooyr.io/websocket v1.8.11/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/x/vaas/provider/keeper/consumer_equivocation.go b/x/vaas/provider/keeper/consumer_equivocation.go index c2ecd60..0c373dd 100644 --- a/x/vaas/provider/keeper/consumer_equivocation.go +++ b/x/vaas/provider/keeper/consumer_equivocation.go @@ -79,11 +79,23 @@ func (k Keeper) HandleConsumerDoubleVoting( return err } + alreadyTombstoned := false if err = k.SlashValidator(ctx, providerAddr, infractionParams.DoubleSign); err != nil { - return err + // Make repeated (already-processed) evidence submissions idempotent. + if errors.Is(err, slashingtypes.ErrValidatorTombstoned) { + alreadyTombstoned = true + } else { + return err + } } - if err = k.JailAndTombstoneValidator(ctx, providerAddr, infractionParams.DoubleSign); err != nil { - return err + if !alreadyTombstoned { + if err = k.JailAndTombstoneValidator(ctx, providerAddr, infractionParams.DoubleSign); err != nil { + if errors.Is(err, slashingtypes.ErrValidatorTombstoned) { + alreadyTombstoned = true + } else { + return err + } + } } k.Logger(ctx).Info( @@ -91,6 +103,7 @@ func (k Keeper) HandleConsumerDoubleVoting( "consumerId", consumerId, "chainId", chainId, "byzantine validator address", providerAddr.String(), + "already_tombstoned", alreadyTombstoned, ) return nil @@ -166,14 +179,14 @@ func (k Keeper) VerifyDoubleVotingEvidence( // Light Client Attack (IBC misbehavior) section // -// HandleConsumerMisbehaviour checks if the given IBC misbehaviour corresponds to an equivocation light client attack, -// and in this case, slashes, jails, and tombstones +// HandleConsumerMisbehaviour checks if the given IBC misbehaviour corresponds to an equivocation light client attack. +// VAAS only validates and logs misbehaviour submissions (no slashing/jailing/tombstoning). func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { logger := k.Logger(ctx) // Check that the misbehaviour is valid and that the client consensus states at trusted heights are within trusting period if err := k.CheckMisbehaviour(ctx, consumerId, misbehaviour); err != nil { - logger.Info("Misbehaviour rejected", err.Error()) + logger.Info("misbehaviour rejected", "error", err.Error()) return err } @@ -189,45 +202,20 @@ func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, m } provAddrs := make([]types.ProviderConsAddress, 0, len(byzantineValidators)) - - // get default infraction parameters (per-consumer params removed) - infractionParams, err := types.DefaultConsumerInfractionParameters(ctx, k.slashingKeeper) - if err != nil { - return err - } - - // slash, jail, and tombstone the Byzantine validators for _, v := range byzantineValidators { providerAddr := k.GetProviderAddrFromConsumerAddr( ctx, consumerId, types.NewConsumerConsAddress(sdk.ConsAddress(v.Address.Bytes())), ) - err := k.SlashValidator(ctx, providerAddr, infractionParams.DoubleSign) - if err != nil { - logger.Error("failed to slash validator: %s", err) - continue - } - err = k.JailAndTombstoneValidator(ctx, providerAddr, infractionParams.DoubleSign) - // JailAndTombstoneValidator should never return an error if - // SlashValidator succeeded because both methods fail if the malicious - // validator is either or both !found, unbonded and tombstoned. - if err != nil { - panic(err) - } - provAddrs = append(provAddrs, providerAddr) } - // Return an error if no validators were punished - if len(provAddrs) == 0 { - return fmt.Errorf("failed to slash, jail, or tombstone all validators: %v", byzantineValidators) - } - logger.Info( - "confirmed equivocation light client attack", + "confirmed equivocation light client attack (no slashing applied)", "consumerId", consumerId, - "byzantine validators slashed, jailed and tombstoned", provAddrs, + "chainId", misbehaviour.Header1.Header.ChainID, + "byzantine_validators", provAddrs, ) return nil diff --git a/x/vaas/provider/keeper/msg_server.go b/x/vaas/provider/keeper/msg_server.go index f27270e..c073c79 100644 --- a/x/vaas/provider/keeper/msg_server.go +++ b/x/vaas/provider/keeper/msg_server.go @@ -102,16 +102,24 @@ func (k msgServer) AssignConsumerKey(goCtx context.Context, msg *types.MsgAssign func (k msgServer) SubmitConsumerMisbehaviour(goCtx context.Context, msg *types.MsgSubmitConsumerMisbehaviour) (*types.MsgSubmitConsumerMisbehaviourResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + + if msg.Misbehaviour == nil || + msg.Misbehaviour.Header1 == nil || msg.Misbehaviour.Header1.Header == nil || + msg.Misbehaviour.Header2 == nil || msg.Misbehaviour.Header2.Header == nil { + return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerMisbehaviour, "misbehaviour cannot be nil") + } + if err := k.Keeper.HandleConsumerMisbehaviour(ctx, msg.ConsumerId, *msg.Misbehaviour); err != nil { return nil, err } + chainID := msg.Misbehaviour.Header1.Header.ChainID ctx.EventManager().EmitEvent( sdk.NewEvent( vaastypes.EventTypeSubmitConsumerMisbehaviour, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), sdk.NewAttribute(types.AttributeConsumerId, msg.ConsumerId), - sdk.NewAttribute(types.AttributeConsumerChainId, msg.Misbehaviour.Header1.Header.ChainID), + sdk.NewAttribute(types.AttributeConsumerChainId, chainID), sdk.NewAttribute(vaastypes.AttributeConsumerMisbehaviour, msg.Misbehaviour.String()), sdk.NewAttribute(vaastypes.AttributeMisbehaviourClientId, msg.Misbehaviour.ClientId), sdk.NewAttribute(vaastypes.AttributeMisbehaviourHeight1, msg.Misbehaviour.Header1.GetHeight().String()), @@ -131,6 +139,33 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. return nil, err } + if msg.InfractionBlockHeader == nil || msg.InfractionBlockHeader.Header == nil { + return nil, errorsmod.Wrapf(vaastypes.ErrInvalidDoubleVotingEvidence, "infraction block header cannot be nil") + } + + consumerChainId, err := k.GetConsumerChainId(ctx, msg.ConsumerId) + if err != nil { + return nil, err + } + if msg.InfractionBlockHeader.Header.ChainID != consumerChainId { + return nil, errorsmod.Wrapf( + vaastypes.ErrInvalidDoubleVotingEvidence, + "infraction block header chain id (%s) does not match consumer chain id (%s) (consumerId: %s)", + msg.InfractionBlockHeader.Header.ChainID, + consumerChainId, + msg.ConsumerId, + ) + } + if msg.InfractionBlockHeader.Header.Height != evidence.VoteA.Height { + return nil, errorsmod.Wrapf( + vaastypes.ErrInvalidDoubleVotingEvidence, + "infraction block header height (%d) does not match duplicate vote evidence height (%d) (consumerId: %s)", + msg.InfractionBlockHeader.Header.Height, + evidence.VoteA.Height, + msg.ConsumerId, + ) + } + // parse the validator set of the infraction block header in order // to find the public key of the validator who double voted @@ -165,7 +200,7 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. vaastypes.EventTypeSubmitConsumerDoubleVoting, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), sdk.NewAttribute(types.AttributeConsumerId, msg.ConsumerId), - sdk.NewAttribute(types.AttributeConsumerChainId, msg.InfractionBlockHeader.Header.ChainID), + sdk.NewAttribute(types.AttributeConsumerChainId, consumerChainId), sdk.NewAttribute(vaastypes.AttributeConsumerDoubleVoting, msg.DuplicateVoteEvidence.String()), sdk.NewAttribute(types.AttributeSubmitterAddress, msg.Submitter), ), diff --git a/x/vaas/provider/types/msg.go b/x/vaas/provider/types/msg.go index 47b19c7..648ac40 100644 --- a/x/vaas/provider/types/msg.go +++ b/x/vaas/provider/types/msg.go @@ -95,10 +95,17 @@ func NewMsgSubmitConsumerMisbehaviour( // ValidateBasic implements the sdk.HasValidateBasic interface. func (msg MsgSubmitConsumerMisbehaviour) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Submitter); err != nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerMisbehaviour, "Submitter: %s", err.Error()) + } + if err := vaastypes.ValidateConsumerId(msg.ConsumerId); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerMisbehaviour, "ConsumerId: %s", err.Error()) } + if msg.Misbehaviour == nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerMisbehaviour, "Misbehaviour cannot be nil") + } if err := msg.Misbehaviour.ValidateBasic(); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerMisbehaviour, "Misbehaviour: %s", err.Error()) } @@ -121,18 +128,31 @@ func NewMsgSubmitConsumerDoubleVoting( // ValidateBasic implements the sdk.HasValidateBasic interface. func (msg MsgSubmitConsumerDoubleVoting) ValidateBasic() error { - if dve, err := cmttypes.DuplicateVoteEvidenceFromProto(msg.DuplicateVoteEvidence); err != nil { + if _, err := sdk.AccAddressFromBech32(msg.Submitter); err != nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "Submitter: %s", err.Error()) + } + + dve, err := cmttypes.DuplicateVoteEvidenceFromProto(msg.DuplicateVoteEvidence) + if err != nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "DuplicateVoteEvidence: %s", err.Error()) + } + if err := dve.ValidateBasic(); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "DuplicateVoteEvidence: %s", err.Error()) - } else { - if err = dve.ValidateBasic(); err != nil { - return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "DuplicateVoteEvidence: %s", err.Error()) - } } if err := ValidateHeaderForConsumerDoubleVoting(msg.InfractionBlockHeader); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "ValidateTendermintHeader: %s", err.Error()) } + if msg.InfractionBlockHeader.Header.Height != dve.VoteA.Height { + return errorsmod.Wrapf( + ErrInvalidMsgSubmitConsumerDoubleVoting, + "infraction block header height (%d) does not match duplicate vote evidence height (%d)", + msg.InfractionBlockHeader.Header.Height, + dve.VoteA.Height, + ) + } + if err := vaastypes.ValidateConsumerId(msg.ConsumerId); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "ConsumerId: %s", err.Error()) } @@ -278,16 +298,8 @@ func ValidateHeaderForConsumerDoubleVoting(header *ibctmtypes.Header) error { return errors.New("infraction block header cannot be nil") } - if header.SignedHeader == nil { - return errors.New("signed header in infraction block header cannot be nil") - } - - if header.SignedHeader.Header == nil { - return errors.New("invalid signed header in infraction block header, 'SignedHeader.Header' is nil") - } - - if header.ValidatorSet == nil { - return errors.New("invalid infraction block header, validator set is nil") + if err := header.ValidateBasic(); err != nil { + return err } return nil diff --git a/x/vaas/provider/types/submit_msgs_test.go b/x/vaas/provider/types/submit_msgs_test.go new file mode 100644 index 0000000..1a53577 --- /dev/null +++ b/x/vaas/provider/types/submit_msgs_test.go @@ -0,0 +1,169 @@ +package types_test + +import ( + "sync" + "testing" + "time" + + cmtversion "github.com/cometbft/cometbft/proto/tendermint/version" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + cometversion "github.com/cometbft/cometbft/version" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + ibctmtypes "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + cryptoutil "github.com/allinbits/vaas/testutil/crypto" + "github.com/allinbits/vaas/x/vaas/provider/types" +) + +var bech32CfgOnce sync.Once + +func setupBech32Cfg() { + bech32CfgOnce.Do(func() { + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount("cosmos", "cosmospub") + cfg.SetBech32PrefixForValidator("cosmosvaloper", "cosmosvaloperpub") + cfg.SetBech32PrefixForConsensusNode("cosmosvalcons", "cosmosvalconspub") + cfg.Seal() + }) +} + +func makeValidIBCTMHeader(t *testing.T, chainID string, height int64, valSet *tmtypes.ValidatorSet, blockTime time.Time) *ibctmtypes.Header { + t.Helper() + + h := tmtypes.Header{ + Version: cmtversion.Consensus{Block: cometversion.BlockProtocol}, + ChainID: chainID, + Height: height, + Time: blockTime, + + ValidatorsHash: valSet.Hash(), + NextValidatorsHash: valSet.Hash(), + + // Optional fields left empty/zero for basic validation. + ProposerAddress: valSet.Proposer.Address, + } + + commit := &tmtypes.Commit{ + Height: height, + Round: 0, + BlockID: tmtypes.BlockID{Hash: h.Hash()}, + Signatures: []tmtypes.CommitSig{ + { + BlockIDFlag: tmtypes.BlockIDFlagCommit, + ValidatorAddress: valSet.Proposer.Address, + Timestamp: blockTime, + Signature: []byte{0x01}, + }, + }, + } + + signedHeader := &tmtypes.SignedHeader{ + Header: &h, + Commit: commit, + } + + valSetProto, err := valSet.ToProto() + require.NoError(t, err) + + revision := clienttypes.ParseChainID(chainID) + return &ibctmtypes.Header{ + SignedHeader: signedHeader.ToProto(), + ValidatorSet: valSetProto, + TrustedHeight: clienttypes.NewHeight(revision, uint64(height-1)), + TrustedValidators: valSetProto, + } +} + +func makeValidDoubleVoteEvidenceAndHeader(t *testing.T, chainID string, height int64) (*tmproto.DuplicateVoteEvidence, *ibctmtypes.Header) { + t.Helper() + + blockTime := time.Now().UTC() + + signer := tmtypes.NewMockPV() + val := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{val}) + + blockID1 := cryptoutil.MakeBlockID([]byte("blockhash"), 1000, []byte("partshash")) + blockID2 := cryptoutil.MakeBlockID([]byte("blockhash2"), 1000, []byte("partshash")) + + vote1 := cryptoutil.MakeAndSignVote(blockID1, height, blockTime, valSet, signer, chainID) + vote2 := cryptoutil.MakeAndSignVote(blockID2, height, blockTime, valSet, signer, chainID) + + dve, err := tmtypes.NewDuplicateVoteEvidence(vote1, vote2, blockTime, valSet) + require.NoError(t, err) + + header := makeValidIBCTMHeader(t, chainID, height, valSet, blockTime) + return dve.ToProto(), header +} + +func TestMsgSubmitConsumerMisbehaviourValidateBasic_NilMisbehaviourDoesNotPanic(t *testing.T) { + setupBech32Cfg() + + submitter := sdk.AccAddress(make([]byte, 20)).String() + msg := types.MsgSubmitConsumerMisbehaviour{ + Submitter: submitter, + Misbehaviour: nil, + ConsumerId: "1", + } + + require.NotPanics(t, func() { + err := msg.ValidateBasic() + require.Error(t, err) + }) +} + +func TestMsgSubmitConsumerDoubleVotingValidateBasic_RejectsInvalidSubmitter(t *testing.T) { + setupBech32Cfg() + + ev, header := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-1", 10) + + msg := types.MsgSubmitConsumerDoubleVoting{ + Submitter: "not-a-bech32-address", + DuplicateVoteEvidence: ev, + InfractionBlockHeader: header, + ConsumerId: "1", + } + + err := msg.ValidateBasic() + require.Error(t, err) +} + +func TestMsgSubmitConsumerDoubleVotingValidateBasic_RejectsHeightMismatch(t *testing.T) { + setupBech32Cfg() + + submitter := sdk.AccAddress(make([]byte, 20)).String() + ev, _ := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-1", 10) + _, headerWrongHeight := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-1", 11) + + msg := types.MsgSubmitConsumerDoubleVoting{ + Submitter: submitter, + DuplicateVoteEvidence: ev, + InfractionBlockHeader: headerWrongHeight, + ConsumerId: "1", + } + + err := msg.ValidateBasic() + require.Error(t, err) +} + +func TestMsgSubmitConsumerDoubleVotingValidateBasic_AcceptsValidMsg(t *testing.T) { + setupBech32Cfg() + + submitter := sdk.AccAddress(make([]byte, 20)).String() + ev, header := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-1", 10) + + msg := types.MsgSubmitConsumerDoubleVoting{ + Submitter: submitter, + DuplicateVoteEvidence: ev, + InfractionBlockHeader: header, + ConsumerId: "1", + } + + require.NoError(t, msg.ValidateBasic()) +} + From a822f1d0bc0000199b36b53f3f803f157d99e088 Mon Sep 17 00:00:00 2001 From: Pantani Date: Fri, 13 Feb 2026 10:53:57 -0300 Subject: [PATCH 09/16] fix potencial issues and panics --- x/vaas/provider/keeper/msg_server.go | 40 +++++++--- x/vaas/provider/keeper/msg_server_test.go | 90 +++++++++++++++++++++++ 2 files changed, 121 insertions(+), 9 deletions(-) diff --git a/x/vaas/provider/keeper/msg_server.go b/x/vaas/provider/keeper/msg_server.go index c073c79..77189d5 100644 --- a/x/vaas/provider/keeper/msg_server.go +++ b/x/vaas/provider/keeper/msg_server.go @@ -103,9 +103,13 @@ func (k msgServer) AssignConsumerKey(goCtx context.Context, msg *types.MsgAssign func (k msgServer) SubmitConsumerMisbehaviour(goCtx context.Context, msg *types.MsgSubmitConsumerMisbehaviour) (*types.MsgSubmitConsumerMisbehaviourResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + if msg == nil { + return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerMisbehaviour, "message cannot be nil") + } + if msg.Misbehaviour == nil || - msg.Misbehaviour.Header1 == nil || msg.Misbehaviour.Header1.Header == nil || - msg.Misbehaviour.Header2 == nil || msg.Misbehaviour.Header2.Header == nil { + msg.Misbehaviour.Header1 == nil || msg.Misbehaviour.Header1.SignedHeader == nil || msg.Misbehaviour.Header1.SignedHeader.Header == nil || + msg.Misbehaviour.Header2 == nil || msg.Misbehaviour.Header2.SignedHeader == nil || msg.Misbehaviour.Header2.SignedHeader.Header == nil { return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerMisbehaviour, "misbehaviour cannot be nil") } @@ -113,7 +117,7 @@ func (k msgServer) SubmitConsumerMisbehaviour(goCtx context.Context, msg *types. return nil, err } - chainID := msg.Misbehaviour.Header1.Header.ChainID + chainID := msg.Misbehaviour.Header1.SignedHeader.Header.ChainID ctx.EventManager().EmitEvent( sdk.NewEvent( vaastypes.EventTypeSubmitConsumerMisbehaviour, @@ -134,34 +138,52 @@ func (k msgServer) SubmitConsumerMisbehaviour(goCtx context.Context, msg *types. func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types.MsgSubmitConsumerDoubleVoting) (*types.MsgSubmitConsumerDoubleVotingResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + if msg == nil { + return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerDoubleVoting, "message cannot be nil") + } + if msg.DuplicateVoteEvidence == nil { + return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerDoubleVoting, "duplicate vote evidence cannot be nil") + } + evidence, err := tmtypes.DuplicateVoteEvidenceFromProto(msg.DuplicateVoteEvidence) if err != nil { return nil, err } + if evidence.VoteA == nil || evidence.VoteB == nil { + return nil, errorsmod.Wrap(vaastypes.ErrInvalidDoubleVotingEvidence, "duplicate vote evidence must include both votes") + } - if msg.InfractionBlockHeader == nil || msg.InfractionBlockHeader.Header == nil { + if msg.InfractionBlockHeader == nil || + msg.InfractionBlockHeader.SignedHeader == nil || + msg.InfractionBlockHeader.SignedHeader.Header == nil { return nil, errorsmod.Wrapf(vaastypes.ErrInvalidDoubleVotingEvidence, "infraction block header cannot be nil") } + if msg.InfractionBlockHeader.ValidatorSet == nil { + return nil, errorsmod.Wrapf(vaastypes.ErrInvalidDoubleVotingEvidence, "infraction block header validator set cannot be nil") + } consumerChainId, err := k.GetConsumerChainId(ctx, msg.ConsumerId) if err != nil { return nil, err } - if msg.InfractionBlockHeader.Header.ChainID != consumerChainId { + headerChainID := msg.InfractionBlockHeader.SignedHeader.Header.ChainID + if headerChainID != consumerChainId { return nil, errorsmod.Wrapf( vaastypes.ErrInvalidDoubleVotingEvidence, "infraction block header chain id (%s) does not match consumer chain id (%s) (consumerId: %s)", - msg.InfractionBlockHeader.Header.ChainID, + headerChainID, consumerChainId, msg.ConsumerId, ) } - if msg.InfractionBlockHeader.Header.Height != evidence.VoteA.Height { + headerHeight := msg.InfractionBlockHeader.SignedHeader.Header.Height + if headerHeight != evidence.VoteA.Height || headerHeight != evidence.VoteB.Height { return nil, errorsmod.Wrapf( vaastypes.ErrInvalidDoubleVotingEvidence, - "infraction block header height (%d) does not match duplicate vote evidence height (%d) (consumerId: %s)", - msg.InfractionBlockHeader.Header.Height, + "infraction block header height (%d) does not match duplicate vote evidence height (%d/%d) (consumerId: %s)", + headerHeight, evidence.VoteA.Height, + evidence.VoteB.Height, msg.ConsumerId, ) } diff --git a/x/vaas/provider/keeper/msg_server_test.go b/x/vaas/provider/keeper/msg_server_test.go index 0a24cba..a9eb9ba 100644 --- a/x/vaas/provider/keeper/msg_server_test.go +++ b/x/vaas/provider/keeper/msg_server_test.go @@ -2,11 +2,16 @@ package keeper_test import ( "testing" + "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + ibctmtypes "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec/address" + cryptoutil "github.com/allinbits/vaas/testutil/crypto" testkeeper "github.com/allinbits/vaas/testutil/keeper" providerkeeper "github.com/allinbits/vaas/x/vaas/provider/keeper" providertypes "github.com/allinbits/vaas/x/vaas/provider/types" @@ -132,3 +137,88 @@ func TestUpdateConsumer(t *testing.T) { require.NoError(t, err) require.Equal(t, expectedConsumerMetadata, actualConsumerMetadata) } + +func TestSubmitConsumerMisbehaviourRejectsNilMessage(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + require.NotPanics(t, func() { + _, err := msgServer.SubmitConsumerMisbehaviour(ctx, nil) + require.Error(t, err) + require.Contains(t, err.Error(), "message cannot be nil") + }) +} + +func TestSubmitConsumerMisbehaviourRejectsNilSignedHeader(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + msg := &providertypes.MsgSubmitConsumerMisbehaviour{ + ConsumerId: "0", + Submitter: "submitter", + Misbehaviour: &ibctmtypes.Misbehaviour{ + Header1: &ibctmtypes.Header{}, + Header2: &ibctmtypes.Header{}, + }, + } + + require.NotPanics(t, func() { + _, err := msgServer.SubmitConsumerMisbehaviour(ctx, msg) + require.Error(t, err) + require.Contains(t, err.Error(), "misbehaviour cannot be nil") + }) +} + +func TestSubmitConsumerDoubleVotingRejectsNilHeaderSignedHeader(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + consumerID := "0" + chainID := "consumer-chain-id" + providerKeeper.SetConsumerChainId(ctx, consumerID, chainID) + + evidence := makeDuplicateVoteEvidenceProto(t, chainID, 12) + header := &ibctmtypes.Header{} // SignedHeader is nil + + msg := &providertypes.MsgSubmitConsumerDoubleVoting{ + ConsumerId: consumerID, + Submitter: "submitter", + DuplicateVoteEvidence: evidence, + InfractionBlockHeader: header, + } + + require.NotPanics(t, func() { + _, err := msgServer.SubmitConsumerDoubleVoting(ctx, msg) + require.Error(t, err) + require.Contains(t, err.Error(), "infraction block header cannot be nil") + }) +} + +func makeDuplicateVoteEvidenceProto(t *testing.T, chainID string, height int64) *tmproto.DuplicateVoteEvidence { + t.Helper() + + signer := tmtypes.NewMockPV() + validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + + blockID1 := cryptoutil.MakeBlockID([]byte("blockhash1"), 1000, []byte("partshash1")) + blockID2 := cryptoutil.MakeBlockID([]byte("blockhash2"), 1000, []byte("partshash2")) + now := time.Now().UTC() + + voteA := cryptoutil.MakeAndSignVote(blockID1, height, now, valSet, signer, chainID) + voteB := cryptoutil.MakeAndSignVote(blockID2, height, now, valSet, signer, chainID) + + return &tmproto.DuplicateVoteEvidence{ + VoteA: voteA.ToProto(), + VoteB: voteB.ToProto(), + TotalVotingPower: validator.VotingPower, + ValidatorPower: validator.VotingPower, + Timestamp: now, + } +} From df28ed17fbc919bebdcf8b77ef7230f22f8f4ae4 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Thu, 19 Feb 2026 16:52:22 -0300 Subject: [PATCH 10/16] Update x/vaas/provider/types/submit_msgs_test.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- x/vaas/provider/types/submit_msgs_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/x/vaas/provider/types/submit_msgs_test.go b/x/vaas/provider/types/submit_msgs_test.go index 1a53577..56e0add 100644 --- a/x/vaas/provider/types/submit_msgs_test.go +++ b/x/vaas/provider/types/submit_msgs_test.go @@ -167,3 +167,20 @@ func TestMsgSubmitConsumerDoubleVotingValidateBasic_AcceptsValidMsg(t *testing.T require.NoError(t, msg.ValidateBasic()) } +func TestMsgSubmitConsumerDoubleVotingValidateBasic_RejectsChainIDMismatch(t *testing.T) { + setupBech32Cfg() + + submitter := sdk.AccAddress(make([]byte, 20)).String() + ev, _ := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-1", 10) + _, headerWrongChainID := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-2", 10) + + msg := types.MsgSubmitConsumerDoubleVoting{ + Submitter: submitter, + DuplicateVoteEvidence: ev, + InfractionBlockHeader: headerWrongChainID, + ConsumerId: "1", + } + + err := msg.ValidateBasic() + require.Error(t, err) +} From 28fced6ceda62477aba9d399ac6f3139ae8d5dc0 Mon Sep 17 00:00:00 2001 From: Pantani Date: Mon, 23 Feb 2026 22:44:42 -0300 Subject: [PATCH 11/16] fix missbehaviur check --- .../provider/keeper/consumer_equivocation.go | 16 ++++ x/vaas/provider/keeper/msg_server.go | 16 ++-- x/vaas/provider/keeper/msg_server_test.go | 88 +++++++++++++++++++ x/vaas/provider/types/msg.go | 8 ++ 4 files changed, 120 insertions(+), 8 deletions(-) diff --git a/x/vaas/provider/keeper/consumer_equivocation.go b/x/vaas/provider/keeper/consumer_equivocation.go index 0c373dd..b578a86 100644 --- a/x/vaas/provider/keeper/consumer_equivocation.go +++ b/x/vaas/provider/keeper/consumer_equivocation.go @@ -184,6 +184,14 @@ func (k Keeper) VerifyDoubleVotingEvidence( func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { logger := k.Logger(ctx) + // Defensive nil checks + if misbehaviour.Header1 == nil || misbehaviour.Header1.SignedHeader == nil || misbehaviour.Header1.SignedHeader.Header == nil { + return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header1 or its nested headers are nil") + } + if misbehaviour.Header2 == nil || misbehaviour.Header2.SignedHeader == nil || misbehaviour.Header2.SignedHeader.Header == nil { + return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header2 or its nested headers are nil") + } + // Check that the misbehaviour is valid and that the client consensus states at trusted heights are within trusting period if err := k.CheckMisbehaviour(ctx, consumerId, misbehaviour); err != nil { logger.Info("misbehaviour rejected", "error", err.Error()) @@ -300,6 +308,14 @@ func headerToLightBlock(h ibctmtypes.Header) (*tmtypes.LightBlock, error) { // CheckMisbehaviour checks that headers in the given misbehaviour forms // a valid light client attack from an ICS consumer chain and that the light client isn't expired func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { + // Defensive nil checks + if misbehaviour.Header1 == nil || misbehaviour.Header1.SignedHeader == nil || misbehaviour.Header1.SignedHeader.Header == nil { + return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header1 or its nested headers are nil") + } + if misbehaviour.Header2 == nil || misbehaviour.Header2.SignedHeader == nil || misbehaviour.Header2.SignedHeader.Header == nil { + return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header2 or its nested headers are nil") + } + chainId := misbehaviour.Header1.Header.ChainID consumerChainId, err := k.GetConsumerChainId(ctx, consumerId) diff --git a/x/vaas/provider/keeper/msg_server.go b/x/vaas/provider/keeper/msg_server.go index 77189d5..7b43ccc 100644 --- a/x/vaas/provider/keeper/msg_server.go +++ b/x/vaas/provider/keeper/msg_server.go @@ -145,14 +145,6 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerDoubleVoting, "duplicate vote evidence cannot be nil") } - evidence, err := tmtypes.DuplicateVoteEvidenceFromProto(msg.DuplicateVoteEvidence) - if err != nil { - return nil, err - } - if evidence.VoteA == nil || evidence.VoteB == nil { - return nil, errorsmod.Wrap(vaastypes.ErrInvalidDoubleVotingEvidence, "duplicate vote evidence must include both votes") - } - if msg.InfractionBlockHeader == nil || msg.InfractionBlockHeader.SignedHeader == nil || msg.InfractionBlockHeader.SignedHeader.Header == nil { @@ -176,6 +168,14 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. msg.ConsumerId, ) } + + evidence, err := tmtypes.DuplicateVoteEvidenceFromProto(msg.DuplicateVoteEvidence) + if err != nil { + return nil, err + } + if evidence.VoteA == nil || evidence.VoteB == nil { + return nil, errorsmod.Wrap(vaastypes.ErrInvalidDoubleVotingEvidence, "duplicate vote evidence must include both votes") + } headerHeight := msg.InfractionBlockHeader.SignedHeader.Header.Height if headerHeight != evidence.VoteA.Height || headerHeight != evidence.VoteB.Height { return nil, errorsmod.Wrapf( diff --git a/x/vaas/provider/keeper/msg_server_test.go b/x/vaas/provider/keeper/msg_server_test.go index a9eb9ba..5198030 100644 --- a/x/vaas/provider/keeper/msg_server_test.go +++ b/x/vaas/provider/keeper/msg_server_test.go @@ -200,6 +200,94 @@ func TestSubmitConsumerDoubleVotingRejectsNilHeaderSignedHeader(t *testing.T) { }) } +func TestSubmitConsumerDoubleVotingRejectsMismatchedChainID(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + consumerID := "0" + storedChainID := "consumer-chain-id" + differentChainID := "different-chain-id" + providerKeeper.SetConsumerChainId(ctx, consumerID, storedChainID) + + height := int64(12) + evidence := makeDuplicateVoteEvidenceProto(t, differentChainID, height) + + // Create a header with a different chain_id than the stored consumer chain_id + signer := tmtypes.NewMockPV() + validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + + header := makeHeader(t, differentChainID, height, valSet, signer) + + msg := &providertypes.MsgSubmitConsumerDoubleVoting{ + ConsumerId: consumerID, + Submitter: "submitter", + DuplicateVoteEvidence: evidence, + InfractionBlockHeader: header, + } + + require.NotPanics(t, func() { + _, err := msgServer.SubmitConsumerDoubleVoting(ctx, msg) + require.Error(t, err) + require.Contains(t, err.Error(), "infraction block header chain id") + require.Contains(t, err.Error(), "does not match consumer chain id") + }) +} + +func TestSubmitConsumerDoubleVotingRejectsMismatchedHeights(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + consumerID := "0" + chainID := "consumer-chain-id" + providerKeeper.SetConsumerChainId(ctx, consumerID, chainID) + + evidenceHeight := int64(12) + headerHeight := int64(15) + evidence := makeDuplicateVoteEvidenceProto(t, chainID, evidenceHeight) + + signer := tmtypes.NewMockPV() + validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + + header := makeHeader(t, chainID, headerHeight, valSet, signer) + + msg := &providertypes.MsgSubmitConsumerDoubleVoting{ + ConsumerId: consumerID, + Submitter: "submitter", + DuplicateVoteEvidence: evidence, + InfractionBlockHeader: header, + } + + require.NotPanics(t, func() { + _, err := msgServer.SubmitConsumerDoubleVoting(ctx, msg) + require.Error(t, err) + require.Contains(t, err.Error(), "infraction block header height") + require.Contains(t, err.Error(), "does not match duplicate vote evidence height") + }) +} + +func makeHeader(t *testing.T, chainID string, height int64, valSet *tmtypes.ValidatorSet, signer tmtypes.PrivValidator) *ibctmtypes.Header { + t.Helper() + + tmSignedHeader := tmtypes.SignedHeader{ + Header: &tmtypes.Header{ + ChainID: chainID, + Height: height, + Time: time.Now().UTC(), + }, + } + + return &ibctmtypes.Header{ + SignedHeader: tmSignedHeader.ToProto(), + ValidatorSet: valSet, + } +} + func makeDuplicateVoteEvidenceProto(t *testing.T, chainID string, height int64) *tmproto.DuplicateVoteEvidence { t.Helper() diff --git a/x/vaas/provider/types/msg.go b/x/vaas/provider/types/msg.go index 648ac40..ce7561b 100644 --- a/x/vaas/provider/types/msg.go +++ b/x/vaas/provider/types/msg.go @@ -298,6 +298,14 @@ func ValidateHeaderForConsumerDoubleVoting(header *ibctmtypes.Header) error { return errors.New("infraction block header cannot be nil") } + if header.SignedHeader == nil || header.SignedHeader.Header == nil { + return errors.New("infraction block header signed header or header cannot be nil") + } + + if header.ValidatorSet == nil { + return errors.New("infraction block header validator set cannot be nil") + } + if err := header.ValidateBasic(); err != nil { return err } From e12841d7d5b4b5c4a61843e7a8adffcaf4a169fe Mon Sep 17 00:00:00 2001 From: Pantani Date: Mon, 23 Feb 2026 22:47:51 -0300 Subject: [PATCH 12/16] fix wrong valset header --- x/vaas/provider/keeper/msg_server_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x/vaas/provider/keeper/msg_server_test.go b/x/vaas/provider/keeper/msg_server_test.go index 5198030..5919e1c 100644 --- a/x/vaas/provider/keeper/msg_server_test.go +++ b/x/vaas/provider/keeper/msg_server_test.go @@ -219,7 +219,7 @@ func TestSubmitConsumerDoubleVotingRejectsMismatchedChainID(t *testing.T) { validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - header := makeHeader(t, differentChainID, height, valSet, signer) + header := makeHeader(t, differentChainID, height, valSet) msg := &providertypes.MsgSubmitConsumerDoubleVoting{ ConsumerId: consumerID, @@ -254,7 +254,7 @@ func TestSubmitConsumerDoubleVotingRejectsMismatchedHeights(t *testing.T) { validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - header := makeHeader(t, chainID, headerHeight, valSet, signer) + header := makeHeader(t, chainID, headerHeight, valSet) msg := &providertypes.MsgSubmitConsumerDoubleVoting{ ConsumerId: consumerID, @@ -271,7 +271,7 @@ func TestSubmitConsumerDoubleVotingRejectsMismatchedHeights(t *testing.T) { }) } -func makeHeader(t *testing.T, chainID string, height int64, valSet *tmtypes.ValidatorSet, signer tmtypes.PrivValidator) *ibctmtypes.Header { +func makeHeader(t *testing.T, chainID string, height int64, valSet *tmtypes.ValidatorSet) *ibctmtypes.Header { t.Helper() tmSignedHeader := tmtypes.SignedHeader{ @@ -281,10 +281,12 @@ func makeHeader(t *testing.T, chainID string, height int64, valSet *tmtypes.Vali Time: time.Now().UTC(), }, } + protoValSet, err := valSet.ToProto() + require.NoError(t, err) return &ibctmtypes.Header{ SignedHeader: tmSignedHeader.ToProto(), - ValidatorSet: valSet, + ValidatorSet: protoValSet, } } From d409f0d5aec2c060b911df1366ec523e90365c74 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 00:58:20 -0300 Subject: [PATCH 13/16] fix tests --- x/vaas/provider/types/msg.go | 22 +++++++++++++++++++ x/vaas/provider/types/submit_msgs_test.go | 26 ++++++++++++++++++----- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/x/vaas/provider/types/msg.go b/x/vaas/provider/types/msg.go index ce7561b..1748f66 100644 --- a/x/vaas/provider/types/msg.go +++ b/x/vaas/provider/types/msg.go @@ -153,6 +153,28 @@ func (msg MsgSubmitConsumerDoubleVoting) ValidateBasic() error { ) } + // Validate that evidence signatures are valid for the infraction header chain ID. + valset, err := cmttypes.ValidatorSetFromProto(msg.InfractionBlockHeader.ValidatorSet) + if err != nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "InfractionBlockHeader.ValidatorSet: %s", err.Error()) + } + _, validator := valset.GetByAddress(dve.VoteA.ValidatorAddress) + if validator == nil { + return errorsmod.Wrapf( + ErrInvalidMsgSubmitConsumerDoubleVoting, + "misbehaving validator %X cannot be found in infraction block header validator set", + dve.VoteA.ValidatorAddress, + ) + } + + headerChainID := msg.InfractionBlockHeader.Header.ChainID + if err := dve.VoteA.Verify(headerChainID, validator.PubKey); err != nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "DuplicateVoteEvidence.VoteA: %s", err.Error()) + } + if err := dve.VoteB.Verify(headerChainID, validator.PubKey); err != nil { + return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "DuplicateVoteEvidence.VoteB: %s", err.Error()) + } + if err := vaastypes.ValidateConsumerId(msg.ConsumerId); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "ConsumerId: %s", err.Error()) } diff --git a/x/vaas/provider/types/submit_msgs_test.go b/x/vaas/provider/types/submit_msgs_test.go index 56e0add..5854305 100644 --- a/x/vaas/provider/types/submit_msgs_test.go +++ b/x/vaas/provider/types/submit_msgs_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - cmtversion "github.com/cometbft/cometbft/proto/tendermint/version" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtversion "github.com/cometbft/cometbft/proto/tendermint/version" tmtypes "github.com/cometbft/cometbft/types" cometversion "github.com/cometbft/cometbft/version" @@ -171,16 +171,32 @@ func TestMsgSubmitConsumerDoubleVotingValidateBasic_RejectsChainIDMismatch(t *te setupBech32Cfg() submitter := sdk.AccAddress(make([]byte, 20)).String() - ev, _ := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-1", 10) - _, headerWrongChainID := makeValidDoubleVoteEvidenceAndHeader(t, "consumer-2", 10) + height := int64(10) + blockTime := time.Now().UTC() + + signer := tmtypes.NewMockPV() + val := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{val}) + + blockID1 := cryptoutil.MakeBlockID([]byte("blockhash"), 1000, []byte("partshash")) + blockID2 := cryptoutil.MakeBlockID([]byte("blockhash2"), 1000, []byte("partshash")) + + vote1 := cryptoutil.MakeAndSignVote(blockID1, height, blockTime, valSet, signer, "consumer-1") + vote2 := cryptoutil.MakeAndSignVote(blockID2, height, blockTime, valSet, signer, "consumer-1") + + dve, err := tmtypes.NewDuplicateVoteEvidence(vote1, vote2, blockTime, valSet) + require.NoError(t, err) + + headerWrongChainID := makeValidIBCTMHeader(t, "consumer-2", height, valSet, blockTime) msg := types.MsgSubmitConsumerDoubleVoting{ Submitter: submitter, - DuplicateVoteEvidence: ev, + DuplicateVoteEvidence: dve.ToProto(), InfractionBlockHeader: headerWrongChainID, ConsumerId: "1", } - err := msg.ValidateBasic() + err = msg.ValidateBasic() require.Error(t, err) + require.Contains(t, err.Error(), "DuplicateVoteEvidence.VoteA") } From 40c66ec7d096688b8796ee7d97d4ada216882b78 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 10 Mar 2026 20:10:22 -0300 Subject: [PATCH 14/16] apply code review --- proto/vaas/provider/v1/query.proto | 7 -- proto/vaas/provider/v1/tx.proto | 8 -- .../provider/keeper/consumer_equivocation.go | 16 --- x/vaas/provider/keeper/msg_server.go | 34 +----- x/vaas/provider/keeper/msg_server_test.go | 100 +++++++++++++----- x/vaas/provider/types/msg.go | 7 +- 6 files changed, 81 insertions(+), 91 deletions(-) diff --git a/proto/vaas/provider/v1/query.proto b/proto/vaas/provider/v1/query.proto index d25a53d..6f8cd20 100644 --- a/proto/vaas/provider/v1/query.proto +++ b/proto/vaas/provider/v1/query.proto @@ -138,10 +138,6 @@ message Chain { // The metadata of the consumer chain ConsumerMetadata metadata = 4 [(gogoproto.nullable) = false ]; string consumer_id = 5; - - // reserved for removed per-consumer infraction parameters - reserved 6; - reserved "infraction_parameters"; } message QueryValidatorConsumerAddrRequest { @@ -259,9 +255,6 @@ message QueryConsumerChainResponse { string phase = 4; ConsumerMetadata metadata = 5 [ (gogoproto.nullable) = false ]; ConsumerInitializationParameters init_params = 6; - // reserved for removed per-consumer infraction parameters - reserved 7; - reserved "infraction_parameters"; // corresponds to the id of the client that is created during launch string client_id = 8; diff --git a/proto/vaas/provider/v1/tx.proto b/proto/vaas/provider/v1/tx.proto index d40e175..1fed440 100644 --- a/proto/vaas/provider/v1/tx.proto +++ b/proto/vaas/provider/v1/tx.proto @@ -128,10 +128,6 @@ message MsgCreateConsumer { ConsumerMetadata metadata = 3 [ (gogoproto.nullable) = false ]; ConsumerInitializationParameters initialization_parameters = 4; - - // reserved for removed per-consumer infraction parameters - reserved 5; - reserved "infraction_parameters"; } // MsgCreateConsumerResponse defines response type for MsgCreateConsumer @@ -162,10 +158,6 @@ message MsgUpdateConsumer { // the chain id CANNOT be updated. // This field is optional and can remain empty (i.e., `new_chain_id = ""`) or correspond to the chain id the chain already has. string new_chain_id = 6; - - // reserved for removed per-consumer infraction parameters - reserved 7; - reserved "infraction_parameters"; } // MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages diff --git a/x/vaas/provider/keeper/consumer_equivocation.go b/x/vaas/provider/keeper/consumer_equivocation.go index b578a86..0c373dd 100644 --- a/x/vaas/provider/keeper/consumer_equivocation.go +++ b/x/vaas/provider/keeper/consumer_equivocation.go @@ -184,14 +184,6 @@ func (k Keeper) VerifyDoubleVotingEvidence( func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { logger := k.Logger(ctx) - // Defensive nil checks - if misbehaviour.Header1 == nil || misbehaviour.Header1.SignedHeader == nil || misbehaviour.Header1.SignedHeader.Header == nil { - return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header1 or its nested headers are nil") - } - if misbehaviour.Header2 == nil || misbehaviour.Header2.SignedHeader == nil || misbehaviour.Header2.SignedHeader.Header == nil { - return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header2 or its nested headers are nil") - } - // Check that the misbehaviour is valid and that the client consensus states at trusted heights are within trusting period if err := k.CheckMisbehaviour(ctx, consumerId, misbehaviour); err != nil { logger.Info("misbehaviour rejected", "error", err.Error()) @@ -308,14 +300,6 @@ func headerToLightBlock(h ibctmtypes.Header) (*tmtypes.LightBlock, error) { // CheckMisbehaviour checks that headers in the given misbehaviour forms // a valid light client attack from an ICS consumer chain and that the light client isn't expired func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { - // Defensive nil checks - if misbehaviour.Header1 == nil || misbehaviour.Header1.SignedHeader == nil || misbehaviour.Header1.SignedHeader.Header == nil { - return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header1 or its nested headers are nil") - } - if misbehaviour.Header2 == nil || misbehaviour.Header2.SignedHeader == nil || misbehaviour.Header2.SignedHeader.Header == nil { - return errorsmod.Wrap(ibcclienttypes.ErrInvalidMisbehaviour, "misbehaviour Header2 or its nested headers are nil") - } - chainId := misbehaviour.Header1.Header.ChainID consumerChainId, err := k.GetConsumerChainId(ctx, consumerId) diff --git a/x/vaas/provider/keeper/msg_server.go b/x/vaas/provider/keeper/msg_server.go index 7b43ccc..588c233 100644 --- a/x/vaas/provider/keeper/msg_server.go +++ b/x/vaas/provider/keeper/msg_server.go @@ -106,11 +106,8 @@ func (k msgServer) SubmitConsumerMisbehaviour(goCtx context.Context, msg *types. if msg == nil { return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerMisbehaviour, "message cannot be nil") } - - if msg.Misbehaviour == nil || - msg.Misbehaviour.Header1 == nil || msg.Misbehaviour.Header1.SignedHeader == nil || msg.Misbehaviour.Header1.SignedHeader.Header == nil || - msg.Misbehaviour.Header2 == nil || msg.Misbehaviour.Header2.SignedHeader == nil || msg.Misbehaviour.Header2.SignedHeader.Header == nil { - return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerMisbehaviour, "misbehaviour cannot be nil") + if err := msg.ValidateBasic(); err != nil { + return nil, err } if err := k.Keeper.HandleConsumerMisbehaviour(ctx, msg.ConsumerId, *msg.Misbehaviour); err != nil { @@ -141,17 +138,8 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. if msg == nil { return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerDoubleVoting, "message cannot be nil") } - if msg.DuplicateVoteEvidence == nil { - return nil, errorsmod.Wrap(types.ErrInvalidMsgSubmitConsumerDoubleVoting, "duplicate vote evidence cannot be nil") - } - - if msg.InfractionBlockHeader == nil || - msg.InfractionBlockHeader.SignedHeader == nil || - msg.InfractionBlockHeader.SignedHeader.Header == nil { - return nil, errorsmod.Wrapf(vaastypes.ErrInvalidDoubleVotingEvidence, "infraction block header cannot be nil") - } - if msg.InfractionBlockHeader.ValidatorSet == nil { - return nil, errorsmod.Wrapf(vaastypes.ErrInvalidDoubleVotingEvidence, "infraction block header validator set cannot be nil") + if err := msg.ValidateBasic(); err != nil { + return nil, err } consumerChainId, err := k.GetConsumerChainId(ctx, msg.ConsumerId) @@ -173,20 +161,6 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. if err != nil { return nil, err } - if evidence.VoteA == nil || evidence.VoteB == nil { - return nil, errorsmod.Wrap(vaastypes.ErrInvalidDoubleVotingEvidence, "duplicate vote evidence must include both votes") - } - headerHeight := msg.InfractionBlockHeader.SignedHeader.Header.Height - if headerHeight != evidence.VoteA.Height || headerHeight != evidence.VoteB.Height { - return nil, errorsmod.Wrapf( - vaastypes.ErrInvalidDoubleVotingEvidence, - "infraction block header height (%d) does not match duplicate vote evidence height (%d/%d) (consumerId: %s)", - headerHeight, - evidence.VoteA.Height, - evidence.VoteB.Height, - msg.ConsumerId, - ) - } // parse the validator set of the infraction block header in order // to find the public key of the validator who double voted diff --git a/x/vaas/provider/keeper/msg_server_test.go b/x/vaas/provider/keeper/msg_server_test.go index 5919e1c..721d795 100644 --- a/x/vaas/provider/keeper/msg_server_test.go +++ b/x/vaas/provider/keeper/msg_server_test.go @@ -1,15 +1,20 @@ package keeper_test import ( + "sync" "testing" "time" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtversion "github.com/cometbft/cometbft/proto/tendermint/version" tmtypes "github.com/cometbft/cometbft/types" + cometversion "github.com/cometbft/cometbft/version" ibctmtypes "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec/address" + sdk "github.com/cosmos/cosmos-sdk/types" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" cryptoutil "github.com/allinbits/vaas/testutil/crypto" testkeeper "github.com/allinbits/vaas/testutil/keeper" @@ -17,6 +22,23 @@ import ( providertypes "github.com/allinbits/vaas/x/vaas/provider/types" ) +var keeperBech32CfgOnce sync.Once + +func setupKeeperBech32Cfg() { + keeperBech32CfgOnce.Do(func() { + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount("cosmos", "cosmospub") + cfg.SetBech32PrefixForValidator("cosmosvaloper", "cosmosvaloperpub") + cfg.SetBech32PrefixForConsensusNode("cosmosvalcons", "cosmosvalconspub") + cfg.Seal() + }) +} + +func validSubmitter() string { + setupKeeperBech32Cfg() + return sdk.AccAddress(make([]byte, 20)).String() +} + func TestCreateConsumer(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -159,7 +181,7 @@ func TestSubmitConsumerMisbehaviourRejectsNilSignedHeader(t *testing.T) { msg := &providertypes.MsgSubmitConsumerMisbehaviour{ ConsumerId: "0", - Submitter: "submitter", + Submitter: validSubmitter(), Misbehaviour: &ibctmtypes.Misbehaviour{ Header1: &ibctmtypes.Header{}, Header2: &ibctmtypes.Header{}, @@ -169,7 +191,7 @@ func TestSubmitConsumerMisbehaviourRejectsNilSignedHeader(t *testing.T) { require.NotPanics(t, func() { _, err := msgServer.SubmitConsumerMisbehaviour(ctx, msg) require.Error(t, err) - require.Contains(t, err.Error(), "misbehaviour cannot be nil") + require.Contains(t, err.Error(), "Misbehaviour") }) } @@ -188,7 +210,7 @@ func TestSubmitConsumerDoubleVotingRejectsNilHeaderSignedHeader(t *testing.T) { msg := &providertypes.MsgSubmitConsumerDoubleVoting{ ConsumerId: consumerID, - Submitter: "submitter", + Submitter: validSubmitter(), DuplicateVoteEvidence: evidence, InfractionBlockHeader: header, } @@ -196,7 +218,7 @@ func TestSubmitConsumerDoubleVotingRejectsNilHeaderSignedHeader(t *testing.T) { require.NotPanics(t, func() { _, err := msgServer.SubmitConsumerDoubleVoting(ctx, msg) require.Error(t, err) - require.Contains(t, err.Error(), "infraction block header cannot be nil") + require.Contains(t, err.Error(), "ValidateTendermintHeader") }) } @@ -212,18 +234,12 @@ func TestSubmitConsumerDoubleVotingRejectsMismatchedChainID(t *testing.T) { providerKeeper.SetConsumerChainId(ctx, consumerID, storedChainID) height := int64(12) - evidence := makeDuplicateVoteEvidenceProto(t, differentChainID, height) - - // Create a header with a different chain_id than the stored consumer chain_id - signer := tmtypes.NewMockPV() - validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - + evidence, valSet := makeDuplicateVoteEvidenceProtoWithValSet(t, differentChainID, height) header := makeHeader(t, differentChainID, height, valSet) msg := &providertypes.MsgSubmitConsumerDoubleVoting{ ConsumerId: consumerID, - Submitter: "submitter", + Submitter: validSubmitter(), DuplicateVoteEvidence: evidence, InfractionBlockHeader: header, } @@ -248,17 +264,12 @@ func TestSubmitConsumerDoubleVotingRejectsMismatchedHeights(t *testing.T) { evidenceHeight := int64(12) headerHeight := int64(15) - evidence := makeDuplicateVoteEvidenceProto(t, chainID, evidenceHeight) - - signer := tmtypes.NewMockPV() - validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - + evidence, valSet := makeDuplicateVoteEvidenceProtoWithValSet(t, chainID, evidenceHeight) header := makeHeader(t, chainID, headerHeight, valSet) msg := &providertypes.MsgSubmitConsumerDoubleVoting{ ConsumerId: consumerID, - Submitter: "submitter", + Submitter: validSubmitter(), DuplicateVoteEvidence: evidence, InfractionBlockHeader: header, } @@ -274,25 +285,60 @@ func TestSubmitConsumerDoubleVotingRejectsMismatchedHeights(t *testing.T) { func makeHeader(t *testing.T, chainID string, height int64, valSet *tmtypes.ValidatorSet) *ibctmtypes.Header { t.Helper() - tmSignedHeader := tmtypes.SignedHeader{ - Header: &tmtypes.Header{ - ChainID: chainID, - Height: height, - Time: time.Now().UTC(), + blockTime := time.Now().UTC() + header := tmtypes.Header{ + Version: cmtversion.Consensus{Block: cometversion.BlockProtocol}, + ChainID: chainID, + Height: height, + Time: blockTime, + + ValidatorsHash: valSet.Hash(), + NextValidatorsHash: valSet.Hash(), + ProposerAddress: valSet.Proposer.Address, + } + + commit := &tmtypes.Commit{ + Height: height, + Round: 0, + BlockID: tmtypes.BlockID{Hash: header.Hash()}, + Signatures: []tmtypes.CommitSig{ + { + BlockIDFlag: tmtypes.BlockIDFlagCommit, + ValidatorAddress: valSet.Proposer.Address, + Timestamp: blockTime, + Signature: []byte{0x01}, + }, }, } + + tmSignedHeader := tmtypes.SignedHeader{ + Header: &header, + Commit: commit, + } + protoValSet, err := valSet.ToProto() require.NoError(t, err) + revision := clienttypes.ParseChainID(chainID) + return &ibctmtypes.Header{ - SignedHeader: tmSignedHeader.ToProto(), - ValidatorSet: protoValSet, + SignedHeader: tmSignedHeader.ToProto(), + ValidatorSet: protoValSet, + TrustedHeight: clienttypes.NewHeight(revision, uint64(height-1)), + TrustedValidators: protoValSet, } } func makeDuplicateVoteEvidenceProto(t *testing.T, chainID string, height int64) *tmproto.DuplicateVoteEvidence { t.Helper() + evidence, _ := makeDuplicateVoteEvidenceProtoWithValSet(t, chainID, height) + return evidence +} + +func makeDuplicateVoteEvidenceProtoWithValSet(t *testing.T, chainID string, height int64) (*tmproto.DuplicateVoteEvidence, *tmtypes.ValidatorSet) { + t.Helper() + signer := tmtypes.NewMockPV() validator := tmtypes.NewValidator(signer.PrivKey.PubKey(), 1) valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) @@ -310,5 +356,5 @@ func makeDuplicateVoteEvidenceProto(t *testing.T, chainID string, height int64) TotalVotingPower: validator.VotingPower, ValidatorPower: validator.VotingPower, Timestamp: now, - } + }, valSet } diff --git a/x/vaas/provider/types/msg.go b/x/vaas/provider/types/msg.go index 1748f66..f96b7cf 100644 --- a/x/vaas/provider/types/msg.go +++ b/x/vaas/provider/types/msg.go @@ -144,11 +144,12 @@ func (msg MsgSubmitConsumerDoubleVoting) ValidateBasic() error { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "ValidateTendermintHeader: %s", err.Error()) } - if msg.InfractionBlockHeader.Header.Height != dve.VoteA.Height { + header := msg.InfractionBlockHeader.SignedHeader.Header + if header.Height != dve.VoteA.Height { return errorsmod.Wrapf( ErrInvalidMsgSubmitConsumerDoubleVoting, "infraction block header height (%d) does not match duplicate vote evidence height (%d)", - msg.InfractionBlockHeader.Header.Height, + header.Height, dve.VoteA.Height, ) } @@ -167,7 +168,7 @@ func (msg MsgSubmitConsumerDoubleVoting) ValidateBasic() error { ) } - headerChainID := msg.InfractionBlockHeader.Header.ChainID + headerChainID := header.ChainID if err := dve.VoteA.Verify(headerChainID, validator.PubKey); err != nil { return errorsmod.Wrapf(ErrInvalidMsgSubmitConsumerDoubleVoting, "DuplicateVoteEvidence.VoteA: %s", err.Error()) } From 16e4f9cfd136b94107918dbd4d1baefa7f6253a9 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 10 Mar 2026 20:15:09 -0300 Subject: [PATCH 15/16] fix proto numbers --- proto/vaas/provider/v1/query.proto | 2 +- x/vaas/provider/types/query.pb.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/vaas/provider/v1/query.proto b/proto/vaas/provider/v1/query.proto index 6f8cd20..c6195f0 100644 --- a/proto/vaas/provider/v1/query.proto +++ b/proto/vaas/provider/v1/query.proto @@ -257,7 +257,7 @@ message QueryConsumerChainResponse { ConsumerInitializationParameters init_params = 6; // corresponds to the id of the client that is created during launch - string client_id = 8; + string client_id = 7; } message QueryConsumerGenesisTimeRequest { diff --git a/x/vaas/provider/types/query.pb.go b/x/vaas/provider/types/query.pb.go index 79ca9c7..e0bc69e 100644 --- a/x/vaas/provider/types/query.pb.go +++ b/x/vaas/provider/types/query.pb.go @@ -1151,7 +1151,7 @@ type QueryConsumerChainResponse struct { Metadata ConsumerMetadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` InitParams *ConsumerInitializationParameters `protobuf:"bytes,6,opt,name=init_params,json=initParams,proto3" json:"init_params,omitempty"` // corresponds to the id of the client that is created during launch - ClientId string `protobuf:"bytes,8,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientId string `protobuf:"bytes,7,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` } func (m *QueryConsumerChainResponse) Reset() { *m = QueryConsumerChainResponse{} } @@ -2809,7 +2809,7 @@ func (m *QueryConsumerChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, err copy(dAtA[i:], m.ClientId) i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x3a } if m.InitParams != nil { { @@ -5857,7 +5857,7 @@ func (m *QueryConsumerChainResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } From 7e9c87a4da28bc77993b109304ac8e2d59914cc1 Mon Sep 17 00:00:00 2001 From: Pantani Date: Mon, 23 Mar 2026 19:58:45 -0300 Subject: [PATCH 16/16] remove from json --- Makefile | 2 +- tests/e2e/testdata/create_consumer.json | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 6f3ed16..516ebbd 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,7 @@ consumer-init: build-apps consumer-create: @echo "Creating consumer chain on provider..." @mkdir -p /tmp/vaas-test - @echo '{"chain_id": "consumer-localnet", "metadata": {"name": "consumer", "description": "test consumer chain", "metadata": "{}"}, "initialization_parameters": {"initial_height": {"revision_number": 0, "revision_height": 1}, "genesis_hash": "", "binary_hash": "", "spawn_time": "2024-01-01T00:00:00Z", "unbonding_period": 1728000000000000, "vaas_timeout_period": 2419200000000000, "historical_entries": 10000, "connection_id": ""}, "infraction_parameters": {"double_sign": {"slash_fraction": "0.05", "jail_duration": 9223372036854775807, "tombstone": true}, "downtime": {"slash_fraction": "0.0001", "jail_duration": 600000000000, "tombstone": false}}}' > /tmp/vaas-test/create_consumer.json + @echo '{"chain_id": "consumer-localnet", "metadata": {"name": "consumer", "description": "test consumer chain", "metadata": "{}"}, "initialization_parameters": {"initial_height": {"revision_number": 0, "revision_height": 1}, "genesis_hash": "", "binary_hash": "", "spawn_time": "2024-01-01T00:00:00Z", "unbonding_period": 1728000000000000, "vaas_timeout_period": 2419200000000000, "historical_entries": 10000, "connection_id": ""}}' > /tmp/vaas-test/create_consumer.json $(providerd) tx provider create-consumer /tmp/vaas-test/create_consumer.json --from val --gas auto --gas-adjustment 1.5 --fees 10000uatone -y @echo "Consumer chain created. Wait for spawn time, then run 'make consumer-genesis' to fetch the genesis." diff --git a/tests/e2e/testdata/create_consumer.json b/tests/e2e/testdata/create_consumer.json index ec544f2..f635118 100644 --- a/tests/e2e/testdata/create_consumer.json +++ b/tests/e2e/testdata/create_consumer.json @@ -17,17 +17,5 @@ "vaas_timeout_period": 2419200000000000, "historical_entries": 10000, "connection_id": "" - }, - "infraction_parameters": { - "double_sign": { - "slash_fraction": "0.05", - "jail_duration": 9223372036854775807, - "tombstone": true - }, - "downtime": { - "slash_fraction": "0.0001", - "jail_duration": 600000000000, - "tombstone": false - } } }