From 6339b86ff78a29f0f9a86da0ef3b063a97b0a8cd Mon Sep 17 00:00:00 2001 From: Marston Connell <34043723+TheMarstonConnell@users.noreply.github.com> Date: Fri, 16 Jun 2023 23:23:44 -0400 Subject: [PATCH 1/2] re-adding the storage stats route --- proto/canine_chain/storage/query.proto | 17 + x/storage/client/cli/query.go | 1 + x/storage/client/cli/query_storage_stats.go | 36 ++ x/storage/keeper/grpc_query_storage_stats.go | 46 ++ x/storage/types/query.pb.go | 640 ++++++++++++++++--- x/storage/types/query.pb.gw.go | 65 ++ 6 files changed, 703 insertions(+), 102 deletions(-) create mode 100644 x/storage/client/cli/query_storage_stats.go create mode 100644 x/storage/keeper/grpc_query_storage_stats.go diff --git a/proto/canine_chain/storage/query.proto b/proto/canine_chain/storage/query.proto index 6c222bc6d..e8b7cde38 100644 --- a/proto/canine_chain/storage/query.proto +++ b/proto/canine_chain/storage/query.proto @@ -136,6 +136,12 @@ service Query { option (google.api.http).get = "/jackal-dao/canine-chain/storage/price_check/{duration}/{bytes}"; } + + // Queries the storage space used and purchased + rpc StorageStats(QueryStorageStatsRequest) returns (QueryStorageStatsResponse) { + option (google.api.http).get = + "/jackal-dao/canine-chain/storage/storage_stats"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -280,4 +286,15 @@ message QueryPriceCheckResponse { int64 price = 1; } +message QueryStorageStatsRequest {} + +message QueryStorageStatsResponse { + uint64 purchased = 1; + uint64 used = 2; + bytes usedRatio = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 activeUsers = 4; +} // this line is used by starport scaffolding # 3 diff --git a/x/storage/client/cli/query.go b/x/storage/client/cli/query.go index ab930e925..73b1143bc 100644 --- a/x/storage/client/cli/query.go +++ b/x/storage/client/cli/query.go @@ -50,6 +50,7 @@ func GetQueryCmd(_ string) *cobra.Command { cmd.AddCommand(CmdCheckPrice()) // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdGetStorageStats()) return cmd } diff --git a/x/storage/client/cli/query_storage_stats.go b/x/storage/client/cli/query_storage_stats.go new file mode 100644 index 000000000..61fed5bde --- /dev/null +++ b/x/storage/client/cli/query_storage_stats.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdGetStorageStats() *cobra.Command { + cmd := &cobra.Command{ + Use: "get-storage-stats", + Short: "lists stats about storage on the network", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryStorageStatsRequest{} + + res, err := queryClient.StorageStats(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/keeper/grpc_query_storage_stats.go b/x/storage/keeper/grpc_query_storage_stats.go new file mode 100644 index 000000000..1cbf65c8f --- /dev/null +++ b/x/storage/keeper/grpc_query_storage_stats.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) StorageStats(c context.Context, req *types.QueryStorageStatsRequest) (*types.QueryStorageStatsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + + payment := k.GetAllStoragePaymentInfo(ctx) + + var spacePurchased int64 + var spaceUsed int64 + var activeUsers uint64 + + for _, info := range payment { + if info.End.Before(time.Now()) { + continue + } + spacePurchased += info.SpaceAvailable + spaceUsed += info.SpaceUsed + activeUsers++ + } + + decSpent := sdk.NewDec(spacePurchased) + decUsed := sdk.NewDec(spaceUsed) + + ratio := decUsed.Quo(decSpent).MulInt64(100) + + return &types.QueryStorageStatsResponse{ + Purchased: uint64(spacePurchased), + Used: uint64(spaceUsed), + UsedRatio: ratio, + ActiveUsers: activeUsers, + }, nil +} diff --git a/x/storage/types/query.pb.go b/x/storage/types/query.pb.go index 331be1c9d..864144269 100644 --- a/x/storage/types/query.pb.go +++ b/x/storage/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -1857,6 +1858,103 @@ func (m *QueryPriceCheckResponse) GetPrice() int64 { return 0 } +type QueryStorageStatsRequest struct { +} + +func (m *QueryStorageStatsRequest) Reset() { *m = QueryStorageStatsRequest{} } +func (m *QueryStorageStatsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryStorageStatsRequest) ProtoMessage() {} +func (*QueryStorageStatsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9fe03bff51a37284, []int{40} +} +func (m *QueryStorageStatsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryStorageStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryStorageStatsRequest.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 *QueryStorageStatsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStorageStatsRequest.Merge(m, src) +} +func (m *QueryStorageStatsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryStorageStatsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStorageStatsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryStorageStatsRequest proto.InternalMessageInfo + +type QueryStorageStatsResponse struct { + Purchased uint64 `protobuf:"varint,1,opt,name=purchased,proto3" json:"purchased,omitempty"` + Used uint64 `protobuf:"varint,2,opt,name=used,proto3" json:"used,omitempty"` + UsedRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=usedRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"usedRatio"` + ActiveUsers uint64 `protobuf:"varint,4,opt,name=activeUsers,proto3" json:"activeUsers,omitempty"` +} + +func (m *QueryStorageStatsResponse) Reset() { *m = QueryStorageStatsResponse{} } +func (m *QueryStorageStatsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryStorageStatsResponse) ProtoMessage() {} +func (*QueryStorageStatsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9fe03bff51a37284, []int{41} +} +func (m *QueryStorageStatsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryStorageStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryStorageStatsResponse.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 *QueryStorageStatsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStorageStatsResponse.Merge(m, src) +} +func (m *QueryStorageStatsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryStorageStatsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStorageStatsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryStorageStatsResponse proto.InternalMessageInfo + +func (m *QueryStorageStatsResponse) GetPurchased() uint64 { + if m != nil { + return m.Purchased + } + return 0 +} + +func (m *QueryStorageStatsResponse) GetUsed() uint64 { + if m != nil { + return m.Used + } + return 0 +} + +func (m *QueryStorageStatsResponse) GetActiveUsers() uint64 { + if m != nil { + return m.ActiveUsers + } + return 0 +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "canine_chain.storage.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "canine_chain.storage.QueryParamsResponse") @@ -1898,114 +1996,124 @@ func init() { proto.RegisterType((*QueryFileUploadCheckResponse)(nil), "canine_chain.storage.QueryFileUploadCheckResponse") proto.RegisterType((*QueryPriceCheckRequest)(nil), "canine_chain.storage.QueryPriceCheckRequest") proto.RegisterType((*QueryPriceCheckResponse)(nil), "canine_chain.storage.QueryPriceCheckResponse") + proto.RegisterType((*QueryStorageStatsRequest)(nil), "canine_chain.storage.QueryStorageStatsRequest") + proto.RegisterType((*QueryStorageStatsResponse)(nil), "canine_chain.storage.QueryStorageStatsResponse") } func init() { proto.RegisterFile("canine_chain/storage/query.proto", fileDescriptor_9fe03bff51a37284) } var fileDescriptor_9fe03bff51a37284 = []byte{ - // 1619 bytes of a gzipped FileDescriptorProto + // 1746 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcd, 0x6f, 0xdc, 0x44, - 0x14, 0x8f, 0xbb, 0x34, 0xed, 0x4e, 0x4a, 0x81, 0x21, 0x85, 0x62, 0xa2, 0xb4, 0xb1, 0x68, 0x93, - 0xa6, 0xc9, 0x3a, 0xd9, 0xa6, 0x1f, 0xa4, 0x95, 0x4a, 0x9a, 0x2a, 0xa1, 0x55, 0x91, 0xd2, 0xad, - 0xb8, 0x20, 0x24, 0x33, 0x6b, 0xcf, 0x6e, 0x87, 0x3a, 0xf6, 0xd6, 0x76, 0x22, 0x56, 0x51, 0x2f, - 0x70, 0x47, 0x08, 0x84, 0xe0, 0xd2, 0x1e, 0xf8, 0x10, 0x42, 0xe2, 0x54, 0x71, 0xe0, 0x0a, 0x12, - 0x52, 0x6f, 0x54, 0xe2, 0xc2, 0x09, 0xa1, 0x96, 0x3f, 0x04, 0x79, 0xfc, 0xc6, 0xf6, 0xee, 0x7a, - 0xc7, 0x76, 0xb5, 0x9c,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 0x27, 0x88, 0xa6, 0x39, 0xd4, 0x75, 0x21, 0x5f, 0xe1, 0x32, 0xea, 0xa6, 0x58, 0x23, 0x2e, + 0xc3, 0x68, 0xf8, 0xf0, 0xbb, 0x29, 0x54, 0x8d, 0xca, 0x30, 0xd2, 0x4b, 0x76, 0x53, 0x24, 0xf5, + 0x5f, 0x76, 0x53, 0xc2, 0x48, 0xba, 0x1b, 0xa5, 0x17, 0x71, 0xa3, 0x7f, 0xf9, 0x59, 0x82, 0x68, + 0x6f, 0x38, 0x94, 0xba, 0x36, 0x51, 0x69, 0x76, 0x82, 0xaa, 0xd0, 0x80, 0xdb, 0x9e, 0xe5, 0xd0, + 0x75, 0xab, 0x69, 0x7a, 0xd9, 0x3a, 0x15, 0xd0, 0x49, 0x98, 0x81, 0x70, 0x8c, 0xa2, 0xe3, 0x6c, + 0x03, 0x34, 0x82, 0x85, 0x24, 0x43, 0xe3, 0x26, 0x6d, 0xc4, 0x0a, 0xaa, 0xbf, 0x11, 0x2a, 0xb0, + 0x45, 0x34, 0xad, 0x37, 0x74, 0x53, 0xdb, 0xd0, 0x0d, 0x9a, 0x98, 0x09, 0xf5, 0x78, 0x26, 0xd4, + 0x75, 0x4d, 0x5a, 0x09, 0x3d, 0x8e, 0x24, 0xe1, 0xe0, 0x69, 0x34, 0x12, 0x06, 0x58, 0xd1, 0xed, + 0xd0, 0x85, 0xe1, 0x70, 0xef, 0x96, 0xed, 0x4a, 0x67, 0xd1, 0xcb, 0x00, 0xcb, 0x21, 0xad, 0xde, + 0x63, 0x67, 0x0b, 0xee, 0x28, 0x10, 0x8b, 0x2f, 0xa3, 0xe0, 0x5a, 0xe4, 0x5f, 0x46, 0x4c, 0x29, + 0xba, 0x8c, 0x02, 0x0d, 0x49, 0x01, 0xd0, 0xab, 0x86, 0x11, 0x7c, 0xef, 0x77, 0xcd, 0x3e, 0x14, + 0xc2, 0xb1, 0x1a, 0x5b, 0x48, 0xc1, 0x5d, 0x2a, 0x86, 0xbb, 0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, 0x9b, 0x54, 0xad, 0xc5, 0x07, 0xe0, 0x29, 0x04, 0xef, 0xda, 0x7b, + 0xae, 0xff, 0xde, 0x1a, 0x64, 0x86, 0x92, 0x5b, 0xd5, 0xa3, 0x33, 0xe8, 0x38, 0xc3, 0x8f, 0x3f, + 0x11, 0xd0, 0x50, 0x40, 0x05, 0x71, 0x8f, 0xfa, 0xeb, 0x66, 0x9e, 0xe2, 0xf9, 0x1c, 0x92, 0x41, + 0x2c, 0x24, 0xf9, 0xa3, 0x3f, 0xfe, 0xf9, 0xfc, 0xd8, 0x79, 0x3c, 0x23, 0x7f, 0x40, 0xd4, 0x3d, + 0x62, 0x2c, 0x68, 0xc4, 0x92, 0x03, 0xed, 0x85, 0x34, 0x5a, 0x8f, 0x1f, 0x09, 0xa8, 0x1c, 0x51, + 0x2a, 0x3c, 0xc7, 0xb1, 0xd4, 0x41, 0x52, 0xc5, 0x0b, 0xb9, 0x64, 0x01, 0xd7, 0x55, 0x86, 0xab, + 0x8a, 0x17, 0x33, 0x71, 0x45, 0x74, 0x4e, 0x3e, 0x54, 0x75, 0xed, 0x01, 0xfe, 0x46, 0x40, 0x23, + 0x11, 0xc0, 0x55, 0xc3, 0xc0, 0x15, 0x8e, 0xdd, 0x14, 0x02, 0x2b, 0xca, 0xb9, 0xe5, 0x01, 0x6b, + 0x95, 0x61, 0x9d, 0xc7, 0x73, 0xf9, 0xb1, 0xe2, 0xef, 0x05, 0x34, 0x9c, 0xe0, 0x3b, 0x78, 0x9e, + 0x67, 0xb4, 0x93, 0x55, 0x8a, 0x0b, 0x39, 0xa5, 0x01, 0xe0, 0x35, 0x06, 0xf0, 0x12, 0xbe, 0x98, + 0x09, 0x30, 0x49, 0xd6, 0x20, 0x9e, 0x3f, 0x0a, 0xe8, 0x54, 0x02, 0xa9, 0x1f, 0xd1, 0x45, 0x7e, + 0x84, 0xba, 0xf9, 0xa6, 0xb8, 0x54, 0x40, 0x03, 0x40, 0x5f, 0x62, 0xa0, 0x65, 0xbc, 0x50, 0x08, + 0x34, 0xfe, 0x5a, 0x40, 0xe5, 0x88, 0xa4, 0x70, 0xeb, 0xb3, 0x83, 0xfe, 0x71, 0xeb, 0xb3, 0x93, + 0xf8, 0x49, 0xd7, 0x19, 0xba, 0xcb, 0x78, 0x39, 0xbb, 0x6f, 0x42, 0x30, 0xf2, 0x21, 0xcc, 0xe0, + 0xa0, 0x46, 0x23, 0x90, 0x39, 0x6a, 0xb4, 0x93, 0x16, 0x66, 0xd5, 0x68, 0x17, 0xc3, 0x2b, 0x50, + 0xa3, 0x31, 0xa1, 0xfb, 0x56, 0x40, 0xe5, 0x88, 0x1c, 0x61, 0x5e, 0x78, 0x3a, 0x99, 0x9a, 0x38, + 0x9f, 0x4f, 0xb8, 0x70, 0x30, 0xeb, 0xa1, 0x6e, 0x22, 0x98, 0xdf, 0x09, 0x08, 0xc5, 0x9c, 0x8c, + 0xdb, 0x49, 0x5d, 0xf4, 0x90, 0xdb, 0x49, 0xdd, 0x44, 0x4f, 0x5a, 0x61, 0x48, 0x97, 0x71, 0x35, + 0x13, 0xa9, 0xff, 0x57, 0x37, 0x1b, 0x09, 0x9c, 0x0f, 0x05, 0x74, 0x32, 0x24, 0x78, 0xdc, 0xc2, + 0xec, 0xe0, 0x8b, 0xdc, 0xc2, 0xec, 0x64, 0x8c, 0x05, 0x06, 0x67, 0x5d, 0x37, 0x35, 0xa5, 0xae, + 0x1b, 0x54, 0x3e, 0xac, 0xfb, 0x8d, 0xfe, 0x99, 0x80, 0x86, 0x02, 0xc2, 0x84, 0x67, 0xb8, 0x51, + 0x89, 0x79, 0xa6, 0x38, 0x9b, 0x2d, 0x58, 0xb8, 0x9d, 0x03, 0x9a, 0x06, 0xd3, 0xe7, 0x4b, 0x01, + 0x95, 0x03, 0x50, 0x7e, 0x9b, 0x5c, 0xe0, 0x97, 0x7d, 0x1b, 0x0d, 0xe5, 0xd6, 0x60, 0x17, 0xa3, + 0x2c, 0x70, 0x11, 0x02, 0x8d, 0xfc, 0x4d, 0x40, 0x78, 0x93, 0x7a, 0x1d, 0x1c, 0x0e, 0xf3, 0x26, + 0x5d, 0x3a, 0x51, 0x14, 0xab, 0x45, 0x54, 0x00, 0xee, 0xdb, 0x0c, 0xee, 0x1a, 0x7e, 0x2b, 0x13, + 0x6e, 0x83, 0x7a, 0x8a, 0xca, 0x4e, 0x51, 0xfc, 0xee, 0x51, 0x3a, 0xdb, 0xe7, 0x0b, 0x01, 0x0d, + 0x05, 0x94, 0x89, 0xfb, 0xc2, 0x68, 0xa3, 0x7b, 0xdc, 0x17, 0x46, 0x3b, 0x6d, 0x93, 0x2e, 0x33, + 0xa4, 0x8b, 0xb8, 0x92, 0xa3, 0x20, 0x19, 0xbb, 0x83, 0x72, 0xfc, 0xca, 0x9f, 0x3e, 0xec, 0xa8, + 0x1c, 0x99, 0x6f, 0x47, 0x37, 0x9f, 0x4f, 0x18, 0x00, 0x2e, 0x32, 0x80, 0x73, 0x78, 0x36, 0x2f, + 0x40, 0x7f, 0x30, 0xa2, 0x4d, 0xea, 0x01, 0xa3, 0xc3, 0xfc, 0xe7, 0x56, 0x92, 0x26, 0x8a, 0x73, + 0x79, 0x44, 0x01, 0xd7, 0x0d, 0x86, 0xeb, 0x4d, 0x7c, 0x25, 0x57, 0x8a, 0x6d, 0xd2, 0x52, 0x34, + 0xe2, 0x91, 0x44, 0x66, 0x7f, 0x15, 0x10, 0xee, 0x66, 0x27, 0x78, 0x39, 0x63, 0xe4, 0xa5, 0x52, + 0x31, 0xf1, 0x52, 0x41, 0xad, 0xc2, 0x4e, 0x24, 0x19, 0x57, 0xc2, 0x89, 0x5f, 0x04, 0x74, 0xba, + 0xfb, 0x7c, 0xbf, 0x24, 0xae, 0x64, 0xf5, 0x77, 0x2f, 0x57, 0xae, 0x16, 0x57, 0x2c, 0x3c, 0xc4, + 0x92, 0xde, 0xe0, 0x9f, 0x04, 0xf4, 0xff, 0x0e, 0x66, 0xc5, 0x9d, 0x13, 0xe9, 0xa4, 0x8e, 0x3b, + 0x27, 0x7a, 0x10, 0xb7, 0x02, 0x17, 0x96, 0x7f, 0x13, 0x28, 0x4d, 0x76, 0x84, 0xa2, 0x32, 0x88, + 0x8f, 0x05, 0x84, 0x62, 0x3a, 0xc6, 0xbd, 0x58, 0xbb, 0x18, 0x20, 0xf7, 0x62, 0xed, 0xe6, 0x78, + 0xd2, 0x26, 0xc3, 0xb9, 0x8a, 0x6f, 0xe4, 0x78, 0x9f, 0xe8, 0x2a, 0x0d, 0x10, 0xca, 0x87, 0x21, + 0xa9, 0x7c, 0x20, 0x1f, 0x32, 0x1a, 0xf9, 0xc0, 0x7f, 0x58, 0x8f, 0x24, 0x59, 0x1f, 0xf7, 0x69, + 0x95, 0xc2, 0x1d, 0xb9, 0x4f, 0xab, 0x34, 0x3a, 0x59, 0x60, 0xc0, 0x85, 0xff, 0xb8, 0xe0, 0xfa, + 0xfa, 0x6b, 0x77, 0x9e, 0x1c, 0x4d, 0x08, 0x4f, 0x8f, 0x26, 0x84, 0xbf, 0x8f, 0x26, 0x84, 0x4f, + 0x9f, 0x4f, 0x0c, 0x3c, 0x7d, 0x3e, 0x31, 0xf0, 0xe7, 0xf3, 0x89, 0x81, 0x77, 0xab, 0x09, 0x4e, + 0x19, 0x9c, 0x79, 0x87, 0xec, 0xb8, 0xed, 0x67, 0x7e, 0x18, 0x9d, 0xca, 0x38, 0xe6, 0xce, 0x10, + 0xfb, 0xaf, 0xc8, 0x8b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x07, 0x13, 0xb0, 0x2c, 0x1e, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2060,6 +2168,8 @@ type QueryClient interface { FileUploadCheck(ctx context.Context, in *QueryFileUploadCheckRequest, opts ...grpc.CallOption) (*QueryFileUploadCheckResponse, error) // Queries whether user can upload a file based on size PriceCheck(ctx context.Context, in *QueryPriceCheckRequest, opts ...grpc.CallOption) (*QueryPriceCheckResponse, error) + // Queries the storage space used and purchased + StorageStats(ctx context.Context, in *QueryStorageStatsRequest, opts ...grpc.CallOption) (*QueryStorageStatsResponse, error) } type queryClient struct { @@ -2250,6 +2360,15 @@ func (c *queryClient) PriceCheck(ctx context.Context, in *QueryPriceCheckRequest return out, nil } +func (c *queryClient) StorageStats(ctx context.Context, in *QueryStorageStatsRequest, opts ...grpc.CallOption) (*QueryStorageStatsResponse, error) { + out := new(QueryStorageStatsResponse) + err := c.cc.Invoke(ctx, "/canine_chain.storage.Query/StorageStats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -2292,6 +2411,8 @@ type QueryServer interface { FileUploadCheck(context.Context, *QueryFileUploadCheckRequest) (*QueryFileUploadCheckResponse, error) // Queries whether user can upload a file based on size PriceCheck(context.Context, *QueryPriceCheckRequest) (*QueryPriceCheckResponse, error) + // Queries the storage space used and purchased + StorageStats(context.Context, *QueryStorageStatsRequest) (*QueryStorageStatsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2358,6 +2479,9 @@ func (*UnimplementedQueryServer) FileUploadCheck(ctx context.Context, req *Query func (*UnimplementedQueryServer) PriceCheck(ctx context.Context, req *QueryPriceCheckRequest) (*QueryPriceCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PriceCheck not implemented") } +func (*UnimplementedQueryServer) StorageStats(ctx context.Context, req *QueryStorageStatsRequest) (*QueryStorageStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StorageStats not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2723,6 +2847,24 @@ func _Query_PriceCheck_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Query_StorageStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryStorageStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StorageStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/canine_chain.storage.Query/StorageStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StorageStats(ctx, req.(*QueryStorageStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "canine_chain.storage.Query", HandlerType: (*QueryServer)(nil), @@ -2807,6 +2949,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PriceCheck", Handler: _Query_PriceCheck_Handler, }, + { + MethodName: "StorageStats", + Handler: _Query_StorageStats_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "canine_chain/storage/query.proto", @@ -4182,6 +4328,77 @@ func (m *QueryPriceCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryStorageStatsRequest) 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 *QueryStorageStatsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryStorageStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryStorageStatsResponse) 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 *QueryStorageStatsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryStorageStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ActiveUsers != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ActiveUsers)) + i-- + dAtA[i] = 0x20 + } + { + size := m.UsedRatio.Size() + i -= size + if _, err := m.UsedRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Used != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Used)) + i-- + dAtA[i] = 0x10 + } + if m.Purchased != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Purchased)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -4736,6 +4953,35 @@ func (m *QueryPriceCheckResponse) Size() (n int) { return n } +func (m *QueryStorageStatsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryStorageStatsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Purchased != 0 { + n += 1 + sovQuery(uint64(m.Purchased)) + } + if m.Used != 0 { + n += 1 + sovQuery(uint64(m.Used)) + } + l = m.UsedRatio.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.ActiveUsers != 0 { + n += 1 + sovQuery(uint64(m.ActiveUsers)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -8255,6 +8501,196 @@ func (m *QueryPriceCheckResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryStorageStatsRequest) 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: QueryStorageStatsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStorageStatsRequest: 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 *QueryStorageStatsResponse) 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: QueryStorageStatsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStorageStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Purchased", wireType) + } + m.Purchased = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Purchased |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Used", wireType) + } + m.Used = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Used |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsedRatio", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.UsedRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveUsers", wireType) + } + m.ActiveUsers = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActiveUsers |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/storage/types/query.pb.gw.go b/x/storage/types/query.pb.gw.go index fed819079..d14230ed2 100644 --- a/x/storage/types/query.pb.gw.go +++ b/x/storage/types/query.pb.gw.go @@ -973,6 +973,24 @@ func local_request_Query_PriceCheck_0(ctx context.Context, marshaler runtime.Mar } +func request_Query_StorageStats_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryStorageStatsRequest + var metadata runtime.ServerMetadata + + msg, err := client.StorageStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_StorageStats_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryStorageStatsRequest + var metadata runtime.ServerMetadata + + msg, err := server.StorageStats(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. @@ -1439,6 +1457,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_StorageStats_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_StorageStats_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_StorageStats_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1880,6 +1921,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_StorageStats_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_StorageStats_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_StorageStats_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1923,6 +1984,8 @@ var ( pattern_Query_FileUploadCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine-chain", "storage", "file_upload_check"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PriceCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"jackal-dao", "canine-chain", "storage", "price_check", "duration", "bytes"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_StorageStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine-chain", "storage", "storage_stats"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1965,4 +2028,6 @@ var ( forward_Query_FileUploadCheck_0 = runtime.ForwardResponseMessage forward_Query_PriceCheck_0 = runtime.ForwardResponseMessage + + forward_Query_StorageStats_0 = runtime.ForwardResponseMessage ) From 6835bf2ee7ce4e380b7bcf52cd47c63e9bef3751 Mon Sep 17 00:00:00 2001 From: Marston Connell <34043723+TheMarstonConnell@users.noreply.github.com> Date: Sat, 17 Jun 2023 11:45:50 -0400 Subject: [PATCH 2/2] determinism query --- x/storage/keeper/grpc_query_storage_stats.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/storage/keeper/grpc_query_storage_stats.go b/x/storage/keeper/grpc_query_storage_stats.go index 1cbf65c8f..fd5b8bf22 100644 --- a/x/storage/keeper/grpc_query_storage_stats.go +++ b/x/storage/keeper/grpc_query_storage_stats.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/jackalLabs/canine-chain/x/storage/types" @@ -24,7 +23,7 @@ func (k Keeper) StorageStats(c context.Context, req *types.QueryStorageStatsRequ var activeUsers uint64 for _, info := range payment { - if info.End.Before(time.Now()) { + if info.End.Before(ctx.BlockTime()) { continue } spacePurchased += info.SpaceAvailable