diff --git a/proto/interchain_security/ccv/consumer/v1/query.proto b/proto/interchain_security/ccv/consumer/v1/query.proto index ff2a5901fe..3ad1f24df8 100644 --- a/proto/interchain_security/ccv/consumer/v1/query.proto +++ b/proto/interchain_security/ccv/consumer/v1/query.proto @@ -7,6 +7,7 @@ option go_package = "github.com/cosmos/interchain-security/v3/x/ccv/consumer/typ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "interchain_security/ccv/consumer/v1/consumer.proto"; +import "interchain_security/ccv/v1/wire.proto"; service Query { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -24,6 +25,11 @@ service Query { rpc QueryProviderInfo(QueryProviderInfoRequest) returns (QueryProviderInfoResponse) { option (google.api.http).get = "/interchain_security/ccv/consumer/provider-info"; } + + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + rpc QueryThrottleState(QueryThrottleStateRequest) returns (QueryThrottleStateResponse) { + option (google.api.http).get = "/interchain_security/ccv/consumer/throttle_state"; + } } // NextFeeDistributionEstimate holds information about next fee distribution @@ -65,6 +71,14 @@ message QueryProviderInfoResponse { ChainInfo provider = 2 [ (gogoproto.nullable) = false ]; } +message QueryThrottleStateRequest {} + +message QueryThrottleStateResponse { + SlashRecord slash_record = 1 [ (gogoproto.nullable) = true ]; + repeated interchain_security.ccv.v1.ConsumerPacketData packet_data_queue = 2 [ (gogoproto.nullable) = false ]; +} + + message ChainInfo { string chainID = 1; string clientID = 2; diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 57fc06e6c9..06940d48cd 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -26,8 +26,7 @@ type ChainState struct { ConsumerChains *map[chainID]bool AssignedKeys *map[validatorID]string ProviderKeys *map[validatorID]string // validatorID: validator provider key - ConsumerChainQueueSizes *map[chainID]uint - GlobalSlashQueueSize *uint + ConsumerPendingPacketQueueSize *uint // Only relevant to consumer chains RegisteredConsumerRewardDenoms *[]string } @@ -173,6 +172,11 @@ func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState chainState.RegisteredConsumerRewardDenoms = ®isteredConsumerRewardDenoms } + if modelState.ConsumerPendingPacketQueueSize != nil { + pendingPacketQueueSize := tr.getPendingPacketQueueSize(chain) + chainState.ConsumerPendingPacketQueueSize = &pendingPacketQueueSize + } + if *verbose { log.Println("Done getting chain state:\n" + pretty.Sprint(chainState)) } @@ -694,6 +698,27 @@ func (tr TestRun) getRegisteredConsumerRewardDenoms(chain chainID) []string { return rewardDenoms } +func (tr TestRun) getPendingPacketQueueSize(chain chainID) uint { + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. + cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + + "query", "ccvconsumer", "throttle-state", + `--node`, tr.getQueryNode(chain), + `-o`, `json`, + ) + bz, err := cmd.CombinedOutput() + if err != nil { + log.Fatal(err, "\n", string(bz)) + } + + if !gjson.ValidBytes(bz) { + panic("invalid json response from query ccvconsumer throttle-state: " + string(bz)) + } + + packetData := gjson.Get(string(bz), "packet_data_queue").Array() + return uint(len(packetData)) +} + func (tr TestRun) getValidatorNode(chain chainID, validator validatorID) string { // for CometMock, validatorNodes are all the same address as the query node (which is CometMocks address) if tr.useCometmock { @@ -742,3 +767,7 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { verbosity := false executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) } + +func uintPtr(i uint) *uint { + return &i +} diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index f79b945ec0..d5f994879c 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -293,6 +293,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 500, validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // bob's downtime slash packet is queued }, }, }, @@ -321,6 +322,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 500, validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(0), // slash packet handled ack clears consumer queue }, }, }, @@ -344,6 +346,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 500, // VSC packet jailing bob is not yet relayed to consumer validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // carol's downtime slash packet is queued }, }, }, @@ -368,6 +371,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 0, // VSC packet applying bob jailing is also relayed and recv by consumer validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // slash packet bounced ack keeps carol's downtime slash packet queued }, }, }, diff --git a/x/ccv/consumer/client/cli/query.go b/x/ccv/consumer/client/cli/query.go index dc1ecfc2f4..f1a0c0f258 100644 --- a/x/ccv/consumer/client/cli/query.go +++ b/x/ccv/consumer/client/cli/query.go @@ -22,6 +22,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand( CmdNextFeeDistribution(), CmdProviderInfo(), + CmdThrottleState(), ) return cmd @@ -80,3 +81,30 @@ func CmdProviderInfo() *cobra.Command { return cmd } + +func CmdThrottleState() *cobra.Command { + cmd := &cobra.Command{ + Use: "throttle-state", + Short: "Query throttle state", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryThrottleStateRequest{} + res, err := queryClient.QueryThrottleState(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/ccv/consumer/keeper/grpc_query.go b/x/ccv/consumer/keeper/grpc_query.go index 80e6b695a9..0d1bb78d16 100644 --- a/x/ccv/consumer/keeper/grpc_query.go +++ b/x/ccv/consumer/keeper/grpc_query.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) var _ types.QueryServer = Keeper{} //nolint:golint @@ -51,3 +52,25 @@ func (k Keeper) QueryProviderInfo(c context.Context, //nolint:golint return k.GetProviderInfo(ctx) } + +func (k Keeper) QueryThrottleState(c context.Context, + req *types.QueryThrottleStateRequest, +) (*types.QueryThrottleStateResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + resp := types.QueryThrottleStateResponse{} + + slashRecord, found := k.GetSlashRecord(ctx) + if found { + resp.SlashRecord = &slashRecord + } else { + resp.SlashRecord = nil + } + + resp.PacketDataQueue = make([]ccvtypes.ConsumerPacketData, 0) + pendingPackets := k.GetAllPendingPacketsWithIdx(ctx) + for _, packet := range pendingPackets { + resp.PacketDataQueue = append(resp.PacketDataQueue, packet.ConsumerPacketData) + } + return &resp, nil +} diff --git a/x/ccv/consumer/types/query.pb.go b/x/ccv/consumer/types/query.pb.go index 5ed38da3f8..282718d4e8 100644 --- a/x/ccv/consumer/types/query.pb.go +++ b/x/ccv/consumer/types/query.pb.go @@ -384,6 +384,94 @@ func (m *QueryProviderInfoResponse) GetProvider() ChainInfo { return ChainInfo{} } +type QueryThrottleStateRequest struct { +} + +func (m *QueryThrottleStateRequest) Reset() { *m = QueryThrottleStateRequest{} } +func (m *QueryThrottleStateRequest) String() string { return proto.CompactTextString(m) } +func (*QueryThrottleStateRequest) ProtoMessage() {} +func (*QueryThrottleStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f627751d3cc10225, []int{7} +} +func (m *QueryThrottleStateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryThrottleStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryThrottleStateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryThrottleStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryThrottleStateRequest.Merge(m, src) +} +func (m *QueryThrottleStateRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryThrottleStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryThrottleStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryThrottleStateRequest proto.InternalMessageInfo + +type QueryThrottleStateResponse struct { + SlashRecord *SlashRecord `protobuf:"bytes,1,opt,name=slash_record,json=slashRecord,proto3" json:"slash_record,omitempty"` + PacketDataQueue []types.ConsumerPacketData `protobuf:"bytes,2,rep,name=packet_data_queue,json=packetDataQueue,proto3" json:"packet_data_queue"` +} + +func (m *QueryThrottleStateResponse) Reset() { *m = QueryThrottleStateResponse{} } +func (m *QueryThrottleStateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryThrottleStateResponse) ProtoMessage() {} +func (*QueryThrottleStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f627751d3cc10225, []int{8} +} +func (m *QueryThrottleStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryThrottleStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryThrottleStateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryThrottleStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryThrottleStateResponse.Merge(m, src) +} +func (m *QueryThrottleStateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryThrottleStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryThrottleStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryThrottleStateResponse proto.InternalMessageInfo + +func (m *QueryThrottleStateResponse) GetSlashRecord() *SlashRecord { + if m != nil { + return m.SlashRecord + } + return nil +} + +func (m *QueryThrottleStateResponse) GetPacketDataQueue() []types.ConsumerPacketData { + if m != nil { + return m.PacketDataQueue + } + return nil +} + type ChainInfo struct { ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` ClientID string `protobuf:"bytes,2,opt,name=clientID,proto3" json:"clientID,omitempty"` @@ -395,7 +483,7 @@ func (m *ChainInfo) Reset() { *m = ChainInfo{} } func (m *ChainInfo) String() string { return proto.CompactTextString(m) } func (*ChainInfo) ProtoMessage() {} func (*ChainInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f627751d3cc10225, []int{7} + return fileDescriptor_f627751d3cc10225, []int{9} } func (m *ChainInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -460,6 +548,8 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "interchain_security.ccv.consumer.v1.QueryParamsResponse") proto.RegisterType((*QueryProviderInfoRequest)(nil), "interchain_security.ccv.consumer.v1.QueryProviderInfoRequest") proto.RegisterType((*QueryProviderInfoResponse)(nil), "interchain_security.ccv.consumer.v1.QueryProviderInfoResponse") + proto.RegisterType((*QueryThrottleStateRequest)(nil), "interchain_security.ccv.consumer.v1.QueryThrottleStateRequest") + proto.RegisterType((*QueryThrottleStateResponse)(nil), "interchain_security.ccv.consumer.v1.QueryThrottleStateResponse") proto.RegisterType((*ChainInfo)(nil), "interchain_security.ccv.consumer.v1.ChainInfo") } @@ -468,50 +558,59 @@ func init() { } var fileDescriptor_f627751d3cc10225 = []byte{ - // 686 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6b, 0x13, 0x41, - 0x14, 0xcf, 0xa6, 0x4d, 0xdb, 0x4c, 0xf5, 0xe0, 0x18, 0x21, 0xae, 0x65, 0x2d, 0xab, 0x60, 0x14, - 0xb2, 0xdb, 0xb4, 0x87, 0xea, 0xa1, 0x5a, 0x6c, 0x2c, 0x06, 0x54, 0xea, 0x22, 0x14, 0xb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0x1c, 0x5f, 0x2b, 0xfb, 0xe1, 0xdf, 0x86, 0x9b, 0x32, 0x16, 0x75, 0x19, 0x0d, 0xe8, 0xe7, - 0x28, 0xc3, 0xc4, 0xd7, 0x69, 0xbc, 0x1d, 0xeb, 0x7b, 0x07, 0x8e, 0xb5, 0x7f, 0xe0, 0x58, 0x3f, - 0x0f, 0x1c, 0xeb, 0xe3, 0xa1, 0x53, 0xd8, 0x3f, 0x74, 0x0a, 0xdf, 0x0f, 0x9d, 0xc2, 0xeb, 0xa5, - 0x0e, 0x55, 0xdd, 0x70, 0xd3, 0xc3, 0xbc, 0xef, 0x63, 0x2e, 0xfb, 0x5c, 0x66, 0xb8, 0xeb, 0x43, - 0xee, 0x68, 0xc1, 0xdf, 0x19, 0x4d, 0xa0, 0x76, 0x07, 0x44, 0x6e, 0x4e, 0xe8, 0x3f, 0xcf, 0xc2, - 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x69, 0x59, 0x43, 0x6b, 0x07, 0x00, 0x00, + // 825 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0xd3, 0x36, 0xbb, 0x99, 0x2e, 0x42, 0x3b, 0x04, 0xc9, 0x78, 0x57, 0xa1, 0x32, 0x20, + 0x02, 0x52, 0xec, 0x24, 0x3d, 0x74, 0x39, 0x2c, 0x5b, 0xb5, 0xa1, 0x22, 0x12, 0xa0, 0xd4, 0xad, + 0x54, 0xc1, 0x25, 0x4c, 0x27, 0xd3, 0xc4, 0x22, 0xf1, 0xb8, 0x33, 0x63, 0xd3, 0xde, 0x10, 0xdc, + 0x11, 0x12, 0xff, 0x84, 0x3f, 0xc0, 0xb5, 0x12, 0x07, 0x2a, 0x71, 0x00, 0x2e, 0x08, 0xb5, 0xfc, + 0x08, 0x8e, 0x68, 0xc6, 0xe3, 0xd4, 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 0xff, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x98, 0xfe, 0x6e, 0x83, 0x5d, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -532,6 +631,8 @@ type QueryClient interface { // QueryParams queries the ccv/consumer module parameters. QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) QueryProviderInfo(ctx context.Context, in *QueryProviderInfoRequest, opts ...grpc.CallOption) (*QueryProviderInfoResponse, error) + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + QueryThrottleState(ctx context.Context, in *QueryThrottleStateRequest, opts ...grpc.CallOption) (*QueryThrottleStateResponse, error) } type queryClient struct { @@ -569,6 +670,15 @@ func (c *queryClient) QueryProviderInfo(ctx context.Context, in *QueryProviderIn return out, nil } +func (c *queryClient) QueryThrottleState(ctx context.Context, in *QueryThrottleStateRequest, opts ...grpc.CallOption) (*QueryThrottleStateResponse, error) { + out := new(QueryThrottleStateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.consumer.v1.Query/QueryThrottleState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -577,6 +687,8 @@ type QueryServer interface { // QueryParams queries the ccv/consumer module parameters. QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) QueryProviderInfo(context.Context, *QueryProviderInfoRequest) (*QueryProviderInfoResponse, error) + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + QueryThrottleState(context.Context, *QueryThrottleStateRequest) (*QueryThrottleStateResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -592,6 +704,9 @@ func (*UnimplementedQueryServer) QueryParams(ctx context.Context, req *QueryPara func (*UnimplementedQueryServer) QueryProviderInfo(ctx context.Context, req *QueryProviderInfoRequest) (*QueryProviderInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryProviderInfo not implemented") } +func (*UnimplementedQueryServer) QueryThrottleState(ctx context.Context, req *QueryThrottleStateRequest) (*QueryThrottleStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryThrottleState not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -651,6 +766,24 @@ func _Query_QueryProviderInfo_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_QueryThrottleState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryThrottleStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryThrottleState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.consumer.v1.Query/QueryThrottleState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryThrottleState(ctx, req.(*QueryThrottleStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.consumer.v1.Query", HandlerType: (*QueryServer)(nil), @@ -667,6 +800,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryProviderInfo", Handler: _Query_QueryProviderInfo_Handler, }, + { + MethodName: "QueryThrottleState", + Handler: _Query_QueryThrottleState_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/consumer/v1/query.proto", @@ -918,6 +1055,78 @@ func (m *QueryProviderInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *QueryThrottleStateRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryThrottleStateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryThrottleStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryThrottleStateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryThrottleStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryThrottleStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PacketDataQueue) > 0 { + for iNdEx := len(m.PacketDataQueue) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PacketDataQueue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.SlashRecord != nil { + { + size, err := m.SlashRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ChainInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1078,6 +1287,34 @@ func (m *QueryProviderInfoResponse) Size() (n int) { return n } +func (m *QueryThrottleStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryThrottleStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SlashRecord != nil { + l = m.SlashRecord.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.PacketDataQueue) > 0 { + for _, e := range m.PacketDataQueue { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *ChainInfo) Size() (n int) { if m == nil { return 0 @@ -1779,6 +2016,176 @@ func (m *QueryProviderInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryThrottleStateRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryThrottleStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryThrottleStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryThrottleStateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryThrottleStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryThrottleStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashRecord", 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.SlashRecord == nil { + m.SlashRecord = &SlashRecord{} + } + if err := m.SlashRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketDataQueue", 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 + } + m.PacketDataQueue = append(m.PacketDataQueue, types.ConsumerPacketData{}) + if err := m.PacketDataQueue[len(m.PacketDataQueue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ChainInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/consumer/types/query.pb.gw.go b/x/ccv/consumer/types/query.pb.gw.go index 1151ab0b60..46ad461324 100644 --- a/x/ccv/consumer/types/query.pb.gw.go +++ b/x/ccv/consumer/types/query.pb.gw.go @@ -87,6 +87,24 @@ func local_request_Query_QueryProviderInfo_0(ctx context.Context, marshaler runt } +func request_Query_QueryThrottleState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryThrottleStateRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryThrottleState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryThrottleState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryThrottleStateRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryThrottleState(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -162,6 +180,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryThrottleState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryThrottleState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryThrottleState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -263,6 +304,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryThrottleState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryThrottleState_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryThrottleState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -272,6 +333,8 @@ var ( pattern_Query_QueryParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "consumer", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryProviderInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "consumer", "provider-info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryThrottleState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "consumer", "throttle_state"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -280,4 +343,6 @@ var ( forward_Query_QueryParams_0 = runtime.ForwardResponseMessage forward_Query_QueryProviderInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryThrottleState_0 = runtime.ForwardResponseMessage )