From 0960b5542c3e0cd1acbd9d3c57e800da8abe78a9 Mon Sep 17 00:00:00 2001 From: marston Date: Thu, 3 Aug 2023 13:20:05 -0400 Subject: [PATCH] fixed genesis --- proto/canine_chain/storage/genesis.proto | 4 + x/storage/genesis.go | 20 ++ x/storage/keeper/msg_server_report.go | 6 +- x/storage/keeper/providers.go | 8 +- x/storage/types/genesis.pb.go | 265 +++++++++++++++++++---- 5 files changed, 258 insertions(+), 45 deletions(-) diff --git a/proto/canine_chain/storage/genesis.proto b/proto/canine_chain/storage/genesis.proto index 0789cf084..a36b43d3c 100644 --- a/proto/canine_chain/storage/genesis.proto +++ b/proto/canine_chain/storage/genesis.proto @@ -24,6 +24,10 @@ message GenesisState { repeated FidCid fid_cid_list = 5 [ (gogoproto.nullable) = false ]; repeated StoragePaymentInfo payment_info_list = 7 [ (gogoproto.nullable) = false ]; repeated Collateral collateral_list = 8 [ (gogoproto.nullable) = false ]; + repeated ActiveProviders active_providers_list = 9 [ (gogoproto.nullable) = false ]; + repeated ReportForm report_forms = 10 [ (gogoproto.nullable) = false ]; + repeated AttestationForm attest_forms = 11 [ (gogoproto.nullable) = false ]; + // this line is used by starport scaffolding # genesis/proto/state } diff --git a/x/storage/genesis.go b/x/storage/genesis.go index dc8da0cce..1f155a0ce 100644 --- a/x/storage/genesis.go +++ b/x/storage/genesis.go @@ -40,6 +40,22 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.CollateralList { k.SetCollateral(ctx, elem) } + + // Set all the attestations + for _, elem := range genState.AttestForms { + k.SetAttestationForm(ctx, elem) + } + + // Set all the reports + for _, elem := range genState.ReportForms { + k.SetReportForm(ctx, elem) + } + + // Set all the active providers + for _, elem := range genState.ActiveProvidersList { + k.SetActiveProviders(ctx, elem) + } + // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -56,6 +72,10 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.FidCidList = k.GetAllFidCid(ctx) genesis.PaymentInfoList = k.GetAllStoragePaymentInfo(ctx) genesis.CollateralList = k.GetAllCollateral(ctx) + genesis.ActiveProvidersList = k.GetAllActiveProviders(ctx) + genesis.ReportForms = k.GetAllReport(ctx) + genesis.AttestForms = k.GetAllAttestation(ctx) + // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/storage/keeper/msg_server_report.go b/x/storage/keeper/msg_server_report.go index 19a6afa98..b78c5507a 100644 --- a/x/storage/keeper/msg_server_report.go +++ b/x/storage/keeper/msg_server_report.go @@ -3,10 +3,8 @@ package keeper import ( "context" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/tendermint/tendermint/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/jackalLabs/canine-chain/v3/x/storage/types" ) @@ -88,8 +86,6 @@ func (k Keeper) RequestReport(ctx sdk.Context, cid string) ([]string, error) { return nil, sdkerrors.Wrapf(types.ErrInvalidLengthQuery, "not enough providers online") } - rand.Seed(ctx.BlockHeight()) - attestations := make([]*types.Attestation, params.AttestFormSize) providerAddresses := make([]string, params.AttestFormSize) diff --git a/x/storage/keeper/providers.go b/x/storage/keeper/providers.go index 821120a07..af29d0deb 100644 --- a/x/storage/keeper/providers.go +++ b/x/storage/keeper/providers.go @@ -70,11 +70,13 @@ func (k Keeper) GetActiveProviders(ctx sdk.Context, filterAddress string) []type i64Size := int64(size) - rand.Seed(ctx.BlockHeight()) + r := rand.NewRand() // creating a new random generator to ensure no interference + + r.Seed(ctx.BlockHeight()) for i := 0; i < rounds; i++ { - x := rand.Int63n(i64Size) - y := rand.Int63n(i64Size) + x := r.Int63n(i64Size) + y := r.Int63n(i64Size) providers[x], providers[y] = providers[y], providers[x] } diff --git a/x/storage/types/genesis.pb.go b/x/storage/types/genesis.pb.go index a292ff298..bc66d780d 100644 --- a/x/storage/types/genesis.pb.go +++ b/x/storage/types/genesis.pb.go @@ -25,14 +25,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the storage module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ContractsList []Contracts `protobuf:"bytes,2,rep,name=contracts_list,json=contractsList,proto3" json:"contracts_list"` - ActiveDealsList []ActiveDeals `protobuf:"bytes,3,rep,name=active_deals_list,json=activeDealsList,proto3" json:"active_deals_list"` - ProvidersList []Providers `protobuf:"bytes,4,rep,name=providers_list,json=providersList,proto3" json:"providers_list"` - StraysList []Strays `protobuf:"bytes,6,rep,name=strays_list,json=straysList,proto3" json:"strays_list"` - FidCidList []FidCid `protobuf:"bytes,5,rep,name=fid_cid_list,json=fidCidList,proto3" json:"fid_cid_list"` - PaymentInfoList []StoragePaymentInfo `protobuf:"bytes,7,rep,name=payment_info_list,json=paymentInfoList,proto3" json:"payment_info_list"` - CollateralList []Collateral `protobuf:"bytes,8,rep,name=collateral_list,json=collateralList,proto3" json:"collateral_list"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ContractsList []Contracts `protobuf:"bytes,2,rep,name=contracts_list,json=contractsList,proto3" json:"contracts_list"` + ActiveDealsList []ActiveDeals `protobuf:"bytes,3,rep,name=active_deals_list,json=activeDealsList,proto3" json:"active_deals_list"` + ProvidersList []Providers `protobuf:"bytes,4,rep,name=providers_list,json=providersList,proto3" json:"providers_list"` + StraysList []Strays `protobuf:"bytes,6,rep,name=strays_list,json=straysList,proto3" json:"strays_list"` + FidCidList []FidCid `protobuf:"bytes,5,rep,name=fid_cid_list,json=fidCidList,proto3" json:"fid_cid_list"` + PaymentInfoList []StoragePaymentInfo `protobuf:"bytes,7,rep,name=payment_info_list,json=paymentInfoList,proto3" json:"payment_info_list"` + CollateralList []Collateral `protobuf:"bytes,8,rep,name=collateral_list,json=collateralList,proto3" json:"collateral_list"` + ActiveProvidersList []ActiveProviders `protobuf:"bytes,9,rep,name=active_providers_list,json=activeProvidersList,proto3" json:"active_providers_list"` + ReportForms []ReportForm `protobuf:"bytes,10,rep,name=report_forms,json=reportForms,proto3" json:"report_forms"` + AttestForms []AttestationForm `protobuf:"bytes,11,rep,name=attest_forms,json=attestForms,proto3" json:"attest_forms"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -124,6 +127,27 @@ func (m *GenesisState) GetCollateralList() []Collateral { return nil } +func (m *GenesisState) GetActiveProvidersList() []ActiveProviders { + if m != nil { + return m.ActiveProvidersList + } + return nil +} + +func (m *GenesisState) GetReportForms() []ReportForm { + if m != nil { + return m.ReportForms + } + return nil +} + +func (m *GenesisState) GetAttestForms() []AttestationForm { + if m != nil { + return m.AttestForms + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "canine_chain.storage.GenesisState") } @@ -133,35 +157,40 @@ func init() { } var fileDescriptor_a52da9fdb04c8b35 = []byte{ - // 448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0xc7, 0x1b, 0x56, 0x0a, 0x72, 0x47, 0xa7, 0x55, 0x3b, 0x4c, 0x15, 0xca, 0xba, 0x09, 0x89, - 0x5e, 0x48, 0xa4, 0x72, 0xe3, 0xc6, 0x3a, 0x81, 0x90, 0x22, 0x51, 0xd1, 0xdb, 0x2e, 0xd1, 0x57, - 0xc7, 0xcd, 0x0c, 0xa9, 0x1d, 0xd9, 0x66, 0xa2, 0x6f, 0xc1, 0x63, 0xed, 0xb8, 0x23, 0x27, 0x84, - 0xda, 0x47, 0xe0, 0x05, 0xa6, 0x7e, 0xb6, 0xd3, 0x1e, 0xd2, 0x9c, 0x92, 0x58, 0xbf, 0xff, 0x2f, - 0x9f, 0xfe, 0x9f, 0xc9, 0x15, 0x05, 0xc1, 0x05, 0x4b, 0xe9, 0x1d, 0x70, 0x11, 0x6b, 0x23, 0x15, - 0xe4, 0x2c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xdd, 0x34, 0xe2, 0xd4, 0xb3, 0x7e, 0xc4, 0x2a, - 0x8c, 0xb6, 0x09, 0xe9, 0xda, 0xd5, 0x58, 0x55, 0x07, 0x55, 0x07, 0x1a, 0x9b, 0x21, 0xe8, 0x3c, - 0xc4, 0xc6, 0x50, 0x72, 0x43, 0x8e, 0xdd, 0xf2, 0xac, 0xe5, 0x79, 0x93, 0xe5, 0x13, 0xcf, 0x26, - 0x3c, 0xf3, 0x96, 0x05, 0x7e, 0xa1, 0xe5, 0x96, 0x9c, 0xee, 0xaf, 0xd7, 0xaa, 0x5e, 0xa0, 0x6a, - 0x74, 0x68, 0x20, 0x7c, 0x4e, 0x6d, 0xea, 0x8b, 0x58, 0x48, 0x5f, 0x5a, 0xb9, 0x3b, 0x42, 0xf7, - 0x57, 0x72, 0x42, 0x65, 0x51, 0x80, 0x61, 0x0a, 0x0a, 0x6b, 0x7e, 0x89, 0xe6, 0xe1, 0xa1, 0xc5, - 0x7a, 0xd8, 0x19, 0x7b, 0xbb, 0xf8, 0x56, 0x78, 0x9d, 0x3c, 0xac, 0xc3, 0xe0, 0x71, 0x1d, 0x06, - 0xff, 0xd6, 0x61, 0xf0, 0x7b, 0x13, 0xb6, 0x1e, 0x37, 0x61, 0xeb, 0xcf, 0x26, 0x6c, 0xdd, 0x8e, - 0x73, 0x6e, 0xee, 0x7e, 0xce, 0x23, 0x2a, 0x97, 0xf1, 0x77, 0xa0, 0x3f, 0xa0, 0x48, 0x60, 0xae, - 0x63, 0xfb, 0x9b, 0x77, 0xf6, 0x3a, 0xff, 0xaa, 0x2e, 0xb4, 0x59, 0x95, 0x4c, 0xcf, 0x3b, 0x78, - 0x95, 0xdf, 0x3f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x20, 0xa3, 0x77, 0x24, 0x04, 0x00, 0x00, + // 515 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 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14, 0x86, 0xe4, 0xa5, 0xa9, 0xf6, 0x41, 0x19, + 0xcf, 0x50, 0xfb, 0xa6, 0xad, 0xde, 0x87, 0x95, 0xbc, 0x80, 0xff, 0x8f, 0xf1, 0x82, 0x0b, 0xd2, + 0x13, 0xb4, 0xe4, 0x42, 0x85, 0x09, 0x17, 0xb9, 0xec, 0x93, 0xb6, 0x75, 0x2f, 0x91, 0x3c, 0xe7, + 0x22, 0x37, 0x4a, 0x5b, 0xd4, 0x27, 0xd2, 0xf9, 0x4c, 0x7a, 0xa0, 0x14, 0x95, 0x95, 0xca, 0x6e, + 0x5d, 0x11, 0x49, 0x50, 0x8c, 0x17, 0x9b, 0x3e, 0x2d, 0x40, 0xdf, 0x69, 0x70, 0xbb, 0x74, 0xad, + 0xbb, 0xa5, 0x6b, 0xfd, 0x59, 0xba, 0xd6, 0xcf, 0x95, 0xdb, 0xb9, 0x5b, 0xb9, 0x9d, 0x5f, 0x2b, + 0xb7, 0x73, 0x35, 0x4e, 0x99, 0xba, 0xfe, 0x3e, 0xf7, 0x22, 0x9e, 0xfb, 0x5f, 0x21, 0xfa, 0x06, + 0x59, 0x00, 0x73, 0xe9, 0xeb, 0x8b, 0xde, 0xe9, 0xa7, 0xfc, 0xa3, 0x7e, 0xcc, 0x6a, 0x51, 0x52, + 0x39, 0xef, 0xe2, 0x33, 0x7e, 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x1d, 0x7c, 0x14, 0x20, + 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -184,6 +213,48 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AttestForms) > 0 { + for iNdEx := len(m.AttestForms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AttestForms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if len(m.ReportForms) > 0 { + for iNdEx := len(m.ReportForms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ReportForms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if len(m.ActiveProvidersList) > 0 { + for iNdEx := len(m.ActiveProvidersList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ActiveProvidersList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } if len(m.CollateralList) > 0 { for iNdEx := len(m.CollateralList) - 1; iNdEx >= 0; iNdEx-- { { @@ -356,6 +427,24 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.ActiveProvidersList) > 0 { + for _, e := range m.ActiveProvidersList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ReportForms) > 0 { + for _, e := range m.ReportForms { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AttestForms) > 0 { + for _, e := range m.AttestForms { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -665,6 +754,108 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveProvidersList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActiveProvidersList = append(m.ActiveProvidersList, ActiveProviders{}) + if err := m.ActiveProvidersList[len(m.ActiveProvidersList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReportForms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReportForms = append(m.ReportForms, ReportForm{}) + if err := m.ReportForms[len(m.ReportForms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestForms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttestForms = append(m.AttestForms, AttestationForm{}) + if err := m.AttestForms[len(m.AttestForms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:])