diff --git a/app/ante.go b/app/ante.go index 3291f11c59..77cf50ebb0 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,9 +1,9 @@ package app import ( + txsigning "cosmossdk.io/x/tx/signing" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" - "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" dualstakingante "github.com/lavanet/lava/v4/x/dualstaking/ante" dualstakingkeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" @@ -11,7 +11,7 @@ import ( "github.com/lavanet/lava/v4/x/spec/keeper" ) -func NewAnteHandler(accountKeeper ante.AccountKeeper, bankKeeper authtypes.BankKeeper, dualstakingKeeper dualstakingkeeper.Keeper, signModeHandler signing.SignModeHandler, feegrantKeeper ante.FeegrantKeeper, specKeeper keeper.Keeper, sigGasConsumer ante.SignatureVerificationGasConsumer) sdk.AnteHandler { +func NewAnteHandler(accountKeeper ante.AccountKeeper, bankKeeper authtypes.BankKeeper, dualstakingKeeper dualstakingkeeper.Keeper, signModeHandler *txsigning.HandlerMap, feegrantKeeper ante.FeegrantKeeper, specKeeper keeper.Keeper, sigGasConsumer ante.SignatureVerificationGasConsumer) sdk.AnteHandler { anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first ante.NewExtensionOptionsDecorator(nil), diff --git a/app/app.go b/app/app.go index d219fb6c69..4d43ba4e6e 100644 --- a/app/app.go +++ b/app/app.go @@ -6,15 +6,16 @@ import ( "os" "path/filepath" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/grpc/node" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/x/authz" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/fixationstore" fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" @@ -23,18 +24,27 @@ import ( timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" - "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" - packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" - - dbm "github.com/cometbft/cometbft-db" + "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" + packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" + + "cosmossdk.io/log" + "cosmossdk.io/x/evidence" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/upgrade" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server/api" @@ -56,9 +66,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" @@ -66,12 +73,6 @@ import ( distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -92,27 +93,25 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" "github.com/lavanet/lava/v4/app/keepers" appparams "github.com/lavanet/lava/v4/app/params" "github.com/lavanet/lava/v4/app/upgrades" @@ -179,10 +178,11 @@ func getGovProposalHandlers() []govclient.ProposalHandler { govProposalHandlers = append(govProposalHandlers, paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, + // UNFORKING v2 TODO: Verify it is okay to remove these + // upgradeclient.LegacyProposalHandler, + // upgradeclient.LegacyCancelProposalHandler, + // ibcclientclient.UpdateClientProposalHandler, + // ibcclientclient.UpgradeProposalHandler, specmoduleclient.SpecAddProposalHandler, plansmoduleclient.PlansAddProposalHandler, plansmoduleclient.PlansDelProposalHandler, @@ -261,10 +261,7 @@ var ( } ) -var ( - _ servertypes.Application = (*LavaApp)(nil) - _ runtime.AppI = (*LavaApp)(nil) -) +var _ runtime.AppI = (*LavaApp)(nil) func init() { userHomeDir, err := os.UserHomeDir() @@ -304,6 +301,8 @@ type LavaApp struct { // module configurator. configurator module.Configurator + + ModuleBasics module.BasicManager } // New returns a reference to an initialized blockchain app @@ -324,14 +323,14 @@ func New( interfaceRegistry := encodingConfig.InterfaceRegistry level := appOpts.Get(flags.FlagLogLevel) - utils.SetGlobalLoggingLevel(cast.ToString(level)) + utils.SetGlobalLoggingLevelSilent(cast.ToString(level)) bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) - keys := sdk.NewKVStoreKeys( + keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, @@ -351,10 +350,9 @@ func New( rewardsmoduletypes.StoreKey, group.StoreKey, authzkeeper.StoreKey, - // this line is used by starport scaffolding # stargate/app/storeKey ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) app := &LavaApp{ BaseApp: bApp, @@ -371,8 +369,8 @@ func New( app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) - bApp.SetParamStore(&app.ConsensusParamsKeeper) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), runtime.EventService{}) + bApp.SetParamStore(&app.ConsensusParamsKeeper.ParamsStore) // add capability keeper and ScopeToModule for ibc module app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) @@ -386,39 +384,57 @@ func New( // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, keys[authtypes.StoreKey], authtypes.ProtoBaseAccount, maccPerms, + appCodec, + runtime.NewKVStoreService(keys[authtypes.StoreKey]), + authtypes.ProtoBaseAccount, + maccPerms, + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), sdk.GetConfig().GetBech32AccountAddrPrefix(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.ModuleAccountAddrs(), + appCodec, + runtime.NewKVStoreService(keys[banktypes.StoreKey]), + app.AccountKeeper, + app.ModuleAccountAddrs(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), + bApp.Logger(), ) + app.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, + appCodec, + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, keys[distrtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, authtypes.FeeCollectorName, + appCodec, + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, app.LegacyAmino(), keys[slashingtypes.StoreKey], app.StakingKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.CrisisKeeper = *crisiskeeper.NewKeeper( appCodec, - keys[crisistypes.StoreKey], invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, + app.LegacyAmino(), + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), + app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + app.CrisisKeeper = *crisiskeeper.NewKeeper( + appCodec, runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())) - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) + app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper) app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, group.DefaultConfig()) - app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper) + app.AuthzKeeper = authzkeeper.NewKeeper(runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), appCodec, app.MsgServiceRouter(), app.AccountKeeper) app.UpgradeKeeper = *upgradekeeper.NewKeeper( skipUpgradeHeights, - keys[upgradetypes.StoreKey], + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, @@ -432,7 +448,13 @@ func New( // Create IBC Keeper app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibcexported.StoreKey], app.GetSubspace(ibcexported.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + appCodec, + keys[ibcexported.StoreKey], + app.GetSubspace(ibcexported.ModuleName), + app.StakingKeeper, + app.UpgradeKeeper, + scopedIBCKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.PacketForwardKeeper = packetforwardkeeper.NewKeeper( @@ -517,6 +539,7 @@ func New( ) dualstakingModule := dualstakingmodule.NewAppModule(appCodec, app.DualstakingKeeper, app.AccountKeeper, app.BankKeeper) + distributionKeeperWrapper := rewardsmoduletypes.DistributionKeeperWrapper{Keeper: &app.DistrKeeper} app.RewardsKeeper = *rewardsmodulekeeper.NewKeeper( appCodec, keys[rewardsmoduletypes.StoreKey], @@ -529,7 +552,7 @@ func New( app.DowntimeKeeper, app.StakingKeeper, app.DualstakingKeeper, - app.DistrKeeper, + &distributionKeeperWrapper, authtypes.FeeCollectorName, app.TimerStoreKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -587,15 +610,13 @@ func New( AddRoute(paramproposal.RouterKey, specmodule.NewParamChangeProposalHandler(app.ParamsKeeper)). // user defined AddRoute(plansmoduletypes.ProposalsRouterKey, plansmodule.NewPlansProposalsHandler(app.PlansKeeper)). - AddRoute(pairingmoduletypes.ProposalsRouterKey, pairingmodule.NewPairingProposalsHandler(app.PairingKeeper)). + AddRoute(pairingmoduletypes.ProposalsRouterKey, pairingmodule.NewPairingProposalsHandler(app.PairingKeeper)) - // - // default - // TODO: Check alternatives to this - // AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.UpgradeKeeper)). - // AddRoute(ibcexported.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + // TODO check all these proposals still work YAROM + // AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). + // AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.UpgradeKeeper)). + // AddRoute(ibcexported.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + // AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( @@ -604,10 +625,11 @@ func New( app.GetSubspace(ibctransfertypes.ModuleName), app.PacketForwardKeeper, app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) transferModule := transfer.NewAppModule(app.TransferKeeper) app.PacketForwardKeeper.SetTransferKeeper(app.TransferKeeper) @@ -617,32 +639,34 @@ func New( app.GetSubspace(icahosttypes.SubModuleName), app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) icaControllerKeeper := icacontrollerkeeper.NewKeeper( appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) icaModule := ica.NewAppModule(&icaControllerKeeper, &app.ICAHostKeeper) icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) // Create evidence Keeper for to register the IBC light client misbehaviour evidence route evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], app.StakingKeeper, app.SlashingKeeper, + appCodec, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr), runtime.ProvideCometInfoService(), ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper govConfig := govtypes.Config{MaxMetadataLen: 3000} // 1640 TODO fix it from spec test proposal govKeeper := govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govConfig, + appCodec, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, + app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) govKeeper.SetLegacyRouter(govRouter) @@ -710,7 +734,7 @@ func New( app.mm = module.NewManager( genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, + app.AccountKeeper, app.StakingKeeper, app.BaseApp, encodingConfig.TxConfig, ), auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), @@ -719,10 +743,10 @@ func New( capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(&app.UpgradeKeeper), + upgrade.NewAppModule(&app.UpgradeKeeper, addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())), evidence.NewAppModule(app.EvidenceKeeper), groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -753,7 +777,6 @@ func New( // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, timerstoretypes.ModuleName, fixationtypes.ModuleName, capabilitytypes.ModuleName, @@ -787,6 +810,10 @@ func New( feegrant.ModuleName, paramstypes.ModuleName) + app.mm.SetOrderPreBlockers( + upgradetypes.ModuleName, + ) + app.mm.SetOrderEndBlockers( capabilitytypes.ModuleName, authtypes.ModuleName, @@ -867,7 +894,10 @@ func New( app.mm.RegisterInvariants(&app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + err := app.mm.RegisterServices(app.configurator) + if err != nil { + panic(err) + } // setupUpgradeHandlers. must be called before LoadLatestVersion as storeloader is sealed after that app.setupUpgradeHandlers() @@ -881,7 +911,7 @@ func New( gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), params.NewAppModule(app.ParamsKeeper), evidence.NewAppModule(app.EvidenceKeeper), ibc.NewAppModule(app.IBCKeeper), @@ -902,6 +932,15 @@ func New( ) app.sm.RegisterStoreDecoders() + app.ModuleBasics = module.NewBasicManagerFromManager( + app.mm, + map[string]module.AppModuleBasic{ + "gov": gov.NewAppModuleBasic( + getGovProposalHandlers(), + ), + }, + ) + // initialize stores app.MountKVStores(keys) app.MountTransientStores(tkeys) @@ -922,6 +961,7 @@ func New( ante.DefaultSigVerificationGasConsumer), ) app.SetEndBlocker(app.EndBlocker) + app.SetPreBlocker(app.PreBlocker) if loadLatest { if err := app.LoadLatestVersion(); err != nil { @@ -973,22 +1013,31 @@ func (app *LavaApp) setupUpgradeHandlers() { func (app *LavaApp) Name() string { return app.BaseApp.Name() } // BeginBlocker application updates every begin block -func (app *LavaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) +func (app *LavaApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.mm.BeginBlock(ctx) } // EndBlocker application updates every end block -func (app *LavaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) +func (app *LavaApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.mm.EndBlock(ctx) +} + +func (app *LavaApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.mm.PreBlock(ctx) } // InitChainer application update at chain initialization -func (app *LavaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (app *LavaApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + + err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + if err != nil { + panic(err) + } + return app.mm.InitGenesis(ctx, app.appCodec, genesisState) } @@ -997,8 +1046,8 @@ func (app *LavaApp) LoadHeight(height int64) error { return app.LoadVersion(height) } -func (app *LavaApp) RegisterNodeService(clientCtx client.Context) { - node.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *LavaApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + node.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } // ModuleAccountAddrs returns all the app's module account addresses. @@ -1068,11 +1117,15 @@ func (app *LavaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register node gRPC service for grpc-gateway. node.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + module.NewBasicManagerFromManager(app.mm, nil).RegisterGRPCGatewayRoutes( + clientCtx, + apiSvr.GRPCGatewayRouter, + ) // register app's OpenAPI routes. docs.RegisterOpenAPIService(Name, apiSvr.Router) @@ -1085,7 +1138,7 @@ func (app *LavaApp) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *LavaApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, @@ -1106,6 +1159,14 @@ func GetMaccPerms() map[string][]string { func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) + // legacy param set to for ibc migrator + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable) + paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) + paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable()) + paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) + paramsKeeper.Subspace(authtypes.ModuleName) paramsKeeper.Subspace(banktypes.ModuleName) paramsKeeper.Subspace(stakingtypes.ModuleName) @@ -1113,10 +1174,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(slashingtypes.ModuleName) paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(v1.ParamKeyTable()) //nolint:staticcheck paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibcexported.ModuleName) - paramsKeeper.Subspace(icacontrollertypes.SubModuleName) - paramsKeeper.Subspace(icahosttypes.SubModuleName) paramsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable()) paramsKeeper.Subspace(specmoduletypes.ModuleName) paramsKeeper.Subspace(epochstoragemoduletypes.ModuleName) @@ -1140,3 +1197,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino func (app *LavaApp) SimulationManager() *module.SimulationManager { return app.sm } + +func (app *LavaApp) ModuleManager() module.Manager { + return *app.mm +} diff --git a/app/encoding.go b/app/encoding.go index 2e2d4ef0a5..375833576a 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -2,7 +2,6 @@ package app import ( "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/x/auth/tx" @@ -12,7 +11,7 @@ import ( // makeEncodingConfig creates an EncodingConfig for an amino based test configuration. func makeEncodingConfig() params.EncodingConfig { amino := codec.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() + interfaceRegistry := params.MakeEncodingConfig().InterfaceRegistry marshaler := codec.NewProtoCodec(interfaceRegistry) txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) @@ -29,7 +28,7 @@ func MakeEncodingConfig() params.EncodingConfig { encodingConfig := makeEncodingConfig() std.RegisterLegacyAminoCodec(encodingConfig.Amino) std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) + // ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) return encodingConfig } diff --git a/app/export.go b/app/export.go index 48eadf6ac8..12915ebf6d 100644 --- a/app/export.go +++ b/app/export.go @@ -2,15 +2,13 @@ package app import ( "encoding/json" - "log" + "fmt" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // ExportAppStateAndValidators( @@ -21,171 +19,40 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. func (app *LavaApp) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, - modulesToExport []string, + forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContextLegacy(true, tmproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. height := app.LastBlockHeight() + 1 if forZeroHeight { - height = 0 - app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + return servertypes.ExportedApp{}, fmt.Errorf("forZeroHeight not supported") } - genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) - appState, err := json.MarshalIndent(genState, "", " ") + genState, err := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) if err != nil { return servertypes.ExportedApp{}, err } - - validators, err := staking.WriteValidators(ctx, app.StakingKeeper) + appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err } + + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) return servertypes.ExportedApp{ AppState: appState, Validators: validators, Height: height, ConsensusParams: app.BaseApp.GetConsensusParams(ctx), - }, nil + }, err } -// prepare for fresh start at zero height -// NOTE zero height genesis is a temporary feature which will be deprecated -// -// in favour of export at a block height -func (app *LavaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { - applyAllowedAddrs := false - - // check if there is a allowed address list - if len(jailAllowedAddrs) > 0 { - applyAllowedAddrs = true - } - - allowedAddrsMap := make(map[string]bool) - - for _, addr := range jailAllowedAddrs { - _, err := sdk.ValAddressFromBech32(addr) - if err != nil { - log.Fatal(err) - } - allowedAddrsMap[addr] = true - } - - /* Just to be safe, assert the invariants on current state. */ - app.CrisisKeeper.AssertInvariants(ctx) - - /* Handle fee distribution state. */ - - // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) - if err != nil { - panic(err) - } - return false - }) - - // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) - for _, delegation := range dels { - _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) - if err != nil { - panic(err) - } - } - - // clear validator slash events - app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) - - // clear validator historical rewards - app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) - - // set context height to zero - height := ctx.BlockHeight() - ctx = ctx.WithBlockHeight(0) - - // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) - return false - }) - - // reinitialize all delegations - for _, del := range dels { - app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) - app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) - } - - // reset context height - ctx = ctx.WithBlockHeight(height) - - /* Handle staking state. */ - - // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { - for i := range red.Entries { - red.Entries[i].CreationHeight = 0 - } - app.StakingKeeper.SetRedelegation(ctx, red) - return false - }) - - // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { - for i := range ubd.Entries { - ubd.Entries[i].CreationHeight = 0 - } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) - return false - }) - - // Iterate through validators by power descending, reset bond heights, and - // update bond intra-tx counters. - store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - counter := int16(0) - - for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(iter.Key()[1:]) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") - } - - validator.UnbondingHeight = 0 - if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { - validator.Jailed = true - } - - app.StakingKeeper.SetValidator(ctx, validator) - counter++ - } - - iter.Close() - - if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { +func (app *LavaApp) ExportState(ctx sdk.Context) map[string]json.RawMessage { + export, err := app.mm.ExportGenesis(ctx, app.AppCodec()) + if err != nil { panic(err) } - - /* Handle slashing state. */ - - // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( - ctx, - func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { - info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) - return false - }, - ) + return export } diff --git a/app/keepers/lavaKeepers.go b/app/keepers/lavaKeepers.go index e9e7ff3123..11c3c6e061 100644 --- a/app/keepers/lavaKeepers.go +++ b/app/keepers/lavaKeepers.go @@ -1,25 +1,25 @@ package keepers import ( + evidencekeeper "cosmossdk.io/x/evidence/keeper" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" conflictmodulekeeper "github.com/lavanet/lava/v4/x/conflict/keeper" downtimemodulekeeper "github.com/lavanet/lava/v4/x/downtime/keeper" dualstakingmodulekeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" diff --git a/app/params/proto.go b/app/params/proto.go new file mode 100644 index 0000000000..9a8d5d1907 --- /dev/null +++ b/app/params/proto.go @@ -0,0 +1,39 @@ +package params + +import ( + "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/x/tx/signing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +func MakeEncodingConfig() EncodingConfig { + amino := codec.NewLegacyAmino() + interfaceRegistry, err := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + }, + }) + if err != nil { + panic(err) + } + cdc := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(cdc, tx.DefaultSignModes) + return EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Marshaler: cdc, + TxConfig: txCfg, + Amino: amino, + } +} diff --git a/app/simulation_test.go b/app/simulation_test.go deleted file mode 100644 index 73fb5dc02f..0000000000 --- a/app/simulation_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package app_test - -import ( - "os" - "testing" - "time" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" - simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - "github.com/cosmos/ibc-go/v7/testing/simapp" - "github.com/lavanet/lava/v4/app" - "github.com/stretchr/testify/require" -) - -func init() { - cli.GetSimulatorFlags() -} - -var defaultConsensusParams = &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ - MaxBytes: 200000, - MaxGas: 2000000, - }, - Evidence: &tmproto.EvidenceParams{ - MaxAgeNumBlocks: 302400, - MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration - MaxBytes: 10000, - }, - Validator: &tmproto.ValidatorParams{ - PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeEd25519, - }, - }, -} - -// BenchmarkSimulation run the chain simulation -// Running using starport command: -// `starport chain simulate -v --numBlocks 200 --blockSize 50` -// Running as go benchmark test: -// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` -func BenchmarkSimulation(b *testing.B) { - simapp.FlagEnabledValue = true - simapp.FlagCommitValue = true - config, db, dir, logger, _, err := simapp.SetupSimulation("goleveldb-app-sim", "Simulation") - require.NoError(b, err, "simulation setup failed") - - b.Cleanup(func() { - db.Close() - err = os.RemoveAll(dir) - require.NoError(b, err) - }) - - encoding := app.MakeEncodingConfig() - - app := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - encoding, - sims.EmptyAppOptions{}, - ) - - // Run randomized simulations - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - app.BaseApp, - simapp.AppStateFn(app.AppCodec(), app.SimulationManager()), - simulationtypes.RandomAccounts, - sims.SimulationOperations(app, app.AppCodec(), config), - app.ModuleAccountAddrs(), - config, - app.AppCodec(), - ) - - err = sims.CheckExportSimulation(app, config, simParams) - require.NoError(b, err) - require.NoError(b, simErr) - - if config.Commit { - simapp.PrintStats(db) - } -} diff --git a/app/test_helper.go b/app/test_helper.go index 516f68a52a..b6d7bd697a 100644 --- a/app/test_helper.go +++ b/app/test_helper.go @@ -1,17 +1,16 @@ package app import ( - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "cosmossdk.io/log" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" ) // Setup a new App for testing purposes func TestSetup() (*LavaApp, sdk.Context) { - db := tmdb.NewMemDB() + db := dbm.NewMemDB() encoding := MakeEncodingConfig() app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, encoding, sims.EmptyAppOptions{}) - return app, app.NewContext(true, tmproto.Header{}) + return app, app.NewContext(true) } diff --git a/app/upgrades/empty_upgrades.go b/app/upgrades/empty_upgrades.go index 3cb03b74e0..157639513a 100644 --- a/app/upgrades/empty_upgrades.go +++ b/app/upgrades/empty_upgrades.go @@ -1,10 +1,11 @@ package upgrades import ( - store "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" + "context" + + store "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/lavanet/lava/v4/app/keepers" ) @@ -14,7 +15,7 @@ func defaultUpgradeHandler( bapm BaseAppParamManager, lk *keepers.LavaKeepers, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { return m.RunMigrations(ctx, c, vm) } } diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 3120ddc6c8..31dd8807cd 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -1,22 +1,32 @@ package upgrades import ( - "github.com/cometbft/cometbft/proto/tendermint/types" - store "github.com/cosmos/cosmos-sdk/store/types" + store "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/lavanet/lava/v4/app/keepers" ) +// BaseAppParamManager defines an interrace that BaseApp is expected to fulfill +// that allows upgrade handlers to modify BaseApp parameters. type BaseAppParamManager interface { - GetConsensusParams(ctx sdk.Context) *types.ConsensusParams - StoreConsensusParams(ctx sdk.Context, cp *types.ConsensusParams) + GetConsensusParams(ctx sdk.Context) tmproto.ConsensusParams + StoreConsensusParams(ctx sdk.Context, cp tmproto.ConsensusParams) error } +// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal +// must have written, in order for the state migration to go smoothly. +// An upgrade must implement this struct, and then set it in the app.go. +// The app.go will then define the handler. type Upgrade struct { - // Upgrade version name. - UpgradeName string + // Upgrade version name, for the upgrade handler, e.g. `v7` + UpgradeName string + + // CreateUpgradeHandler defines the function that creates an upgrade handler CreateUpgradeHandler func(*module.Manager, module.Configurator, BaseAppParamManager, *keepers.LavaKeepers) upgradetypes.UpgradeHandler - StoreUpgrades store.StoreUpgrades + + // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. + StoreUpgrades store.StoreUpgrades } diff --git a/app/upgrades/upgrade_0_35_0.go b/app/upgrades/upgrade_0_35_0.go index 76ebe64cf6..a36e01bc0d 100644 --- a/app/upgrades/upgrade_0_35_0.go +++ b/app/upgrades/upgrade_0_35_0.go @@ -1,11 +1,13 @@ package upgrades import ( + "context" + + upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/gogoproto/proto" - ibctypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibctypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" "github.com/lavanet/lava/v4/app/keepers" protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" spectypes "github.com/lavanet/lava/v4/x/spec/types" @@ -17,7 +19,8 @@ func v_35_0( _ BaseAppParamManager, lk *keepers.LavaKeepers, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return func(context context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(context) // reset allowlist to empty lk.SpecKeeper.AllowlistReset(ctx) diff --git a/cmd/lavad/cmd/config.go b/cmd/lavad/cmd/config.go index fadda3af4a..3372bc15ea 100644 --- a/cmd/lavad/cmd/config.go +++ b/cmd/lavad/cmd/config.go @@ -6,7 +6,7 @@ import ( "github.com/lavanet/lava/v4/app" ) -func InitSDKConfig() { +func init() { // Set prefixes accountPubKeyPrefix := app.AccountAddressPrefix + "pub" validatorAddressPrefix := app.AccountAddressPrefix + "valoper" diff --git a/cmd/lavad/cmd/genaccounts.go b/cmd/lavad/cmd/genaccounts.go index 24fcb5b694..2b1d626533 100644 --- a/cmd/lavad/cmd/genaccounts.go +++ b/cmd/lavad/cmd/genaccounts.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -139,7 +140,10 @@ lavad add-genesis-account bela 30000000ulava --vesting-start-time 1704707673 -- balances.Address = moduleAddress genAccount = authtypes.NewModuleAccount(baseAccount, args[0], authtypes.Burner, authtypes.Staking) } else if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + if err != nil { + return fmt.Errorf("failed to create base vesting account: %w", err) + } if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { @@ -163,17 +167,20 @@ lavad add-genesis-account bela 30000000ulava --vesting-start-time 1704707673 -- if err := periodicFirst.Validate(); err != nil { return errors.New("periodic account must have vesting first emission none negative " + err.Error()) } - if !vestingAmt.QuoInt(sdk.NewInt(periodicNumber)).MulInt(sdk.NewInt(periodicNumber)).IsEqual(vestingAmt) { + if !vestingAmt.QuoInt(math.NewInt(periodicNumber)).MulInt(math.NewInt(periodicNumber)).Equal(vestingAmt) { return errors.New("periodic vesting amount must be divisble by the periodicNumber") } periods := []authvesting.Period{{Length: 0, Amount: periodicFirst}} for i := int64(0); i < periodicNumber; i++ { - period := authvesting.Period{Length: periodicLength, Amount: vestingAmt.QuoInt(sdk.NewInt(periodicNumber))} + period := authvesting.Period{Length: periodicLength, Amount: vestingAmt.QuoInt(math.NewInt(periodicNumber))} periods = append(periods, period) } - genAccount = authvesting.NewPeriodicVestingAccount(baseAccount, vestingAmt.Add(periodicFirst...), vestingStart, periods) + genAccount, err = authvesting.NewPeriodicVestingAccount(baseAccount, vestingAmt.Add(periodicFirst...), vestingStart, periods) + if err != nil { + return fmt.Errorf("failed to create periodic vesting account: %w", err) + } case vestingStart != 0 && vestingEnd != 0: genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) diff --git a/cmd/lavad/cmd/root.go b/cmd/lavad/cmd/root.go index 24845d6302..e25cf025ab 100644 --- a/cmd/lavad/cmd/root.go +++ b/cmd/lavad/cmd/root.go @@ -6,16 +6,23 @@ import ( "os" "path/filepath" - tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - snapshotoptions "github.com/cosmos/cosmos-sdk/snapshots/types" - - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshotoptions "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + confixcmd "cosmossdk.io/tools/confix/cmd" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -23,14 +30,14 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/rpc" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/types" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" @@ -56,10 +63,12 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). + WithAccountRetriever(authtypes.AccountRetriever{}). WithHomeDir(app.DefaultNodeHome). WithViper("") + tempApplication := app.New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{}, app.DefaultNodeHome, 5, encodingConfig, sims.EmptyAppOptions{}) + rootCmd := &cobra.Command{ Use: app.Name + "d", Short: "Lava blockchain node daemon", @@ -91,6 +100,10 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { initRootCmd(rootCmd, encodingConfig) addLogFlagsToSubCommands(rootCmd) + + if err := autoCliOpts(initClientCtx, tempApplication).EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } return rootCmd, encodingConfig } @@ -102,7 +115,7 @@ func NewLavaProtocolRootCmd() *cobra.Command { WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). + WithAccountRetriever(authtypes.AccountRetriever{}). WithHomeDir(app.DefaultNodeHome). WithViper("") @@ -136,27 +149,54 @@ func NewLavaProtocolRootCmd() *cobra.Command { }, } + tempApplication := app.New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{}, app.DefaultNodeHome, 5, encodingConfig, sims.EmptyAppOptions{}) + initLavaProtocolRootCmd(rootCmd) addLogFlagsToSubCommands(rootCmd) + if err := autoCliOpts(initClientCtx, tempApplication).EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } + return rootCmd } +func autoCliOpts(initClientCtx client.Context, tempApp *app.LavaApp) autocli.AppOptions { + modules := make(map[string]appmodule.AppModule, 0) + for _, m := range tempApp.ModuleManager().Modules { + if moduleWithName, ok := m.(module.HasName); ok { + moduleName := moduleWithName.Name() + if appModule, ok := moduleWithName.(appmodule.AppModule); ok { + modules[moduleName] = appModule + } + } + } + + return autocli.AppOptions{ + Modules: modules, + ModuleOptions: runtimeservices.ExtractAutoCLIOptions(tempApp.ModuleManager().Modules), + AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), + ClientCtx: initClientCtx, + } +} + func initLavaProtocolRootCmd( rootCmd *cobra.Command, ) { - InitSDKConfig() rootCmd.AddCommand( tmcli.NewCompletionCmd(rootCmd, true), ) + rootCmd.AddCommand( queryCommand(), txCommand(), - keys.Commands(app.DefaultNodeHome), + keys.Commands(), ) rootCmd.AddCommand( - config.Cmd(), + confixcmd.ConfigCommand(), ) } @@ -193,29 +233,27 @@ func initRootCmd( rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig, ) { - // Set config - InitSDKConfig() - gentxModule, ok := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) if !ok { panic("cant get gentx module") } - + valOperAddressCodec := address.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()) rootCmd.AddCommand( genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, gentxModule.GenTxValidator), - genutilcli.MigrateGenesisCmd(), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, gentxModule.GenTxValidator, valOperAddressCodec), + // genutilcli.MigrateGenesisCmd(), genutilcli.GenTxCmd( app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, + valOperAddressCodec, ), genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), debug.Cmd(), - config.Cmd(), + confixcmd.ConfigCommand(), // this line is used by starport scaffolding # root/commands ) @@ -234,10 +272,10 @@ func initRootCmd( // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), queryCommand(), txCommand(), - keys.Commands(app.DefaultNodeHome), + keys.Commands(), ) } @@ -272,14 +310,13 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - authcmd.GetAccountCmd(), + CmdModuleNameToAddress(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), ) - app.ModuleBasics.AddQueryCommands(cmd) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd @@ -306,7 +343,6 @@ func txCommand() *cobra.Command { authcmd.GetDecodeCommand(), ) - app.ModuleBasics.AddTxCommands(cmd) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd @@ -344,7 +380,7 @@ func (a appCreator) newApp( traceStore io.Writer, appOpts servertypes.AppOptions, ) servertypes.Application { - var cache sdk.MultiStorePersistentCache + var cache storetypes.MultiStorePersistentCache if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() @@ -362,7 +398,7 @@ func (a appCreator) newApp( snapshotDir := filepath.Join( cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) + snapshotDB, err := dbm.NewGoLevelDB("metadata", snapshotDir, nil) if err != nil { panic(err) } @@ -383,7 +419,7 @@ func (a appCreator) newApp( } if chainID == "" { // fallback to genesis chain-id - appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) + appGenesis, err := genutiltypes.AppGenesisFromFile(filepath.Join(homeDir, "config", "genesis.json")) if err != nil { panic(err) } @@ -506,3 +542,20 @@ lru_size = 0` return customAppTemplate, customAppConfig } + +func CmdModuleNameToAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "module-name-to-address [module-name]", + Short: "module name to address", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + address := authtypes.NewModuleAddress(args[0]) + return clientCtx.PrintString(address.String()) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/lavad/main.go b/cmd/lavad/main.go index 922fc26361..b49ba07911 100644 --- a/cmd/lavad/main.go +++ b/cmd/lavad/main.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/lavanet/lava/v4/app" cmdcommon "github.com/lavanet/lava/v4/cmd/common" @@ -59,12 +58,6 @@ func main() { }) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + os.Exit(1) } } diff --git a/cmd/lavap/main.go b/cmd/lavap/main.go index e57f91651b..0be64f2d99 100644 --- a/cmd/lavap/main.go +++ b/cmd/lavap/main.go @@ -7,7 +7,6 @@ import ( "strings" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/lavanet/lava/v4/app" "github.com/lavanet/lava/v4/cmd/lavad/cmd" @@ -84,13 +83,7 @@ func main() { }) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + os.Exit(1) } } diff --git a/cmd/lavavisor/main.go b/cmd/lavavisor/main.go index 93895f0b72..ee9cd351a6 100644 --- a/cmd/lavavisor/main.go +++ b/cmd/lavavisor/main.go @@ -4,7 +4,6 @@ import ( "fmt" "os" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/lavanet/lava/v4/app" "github.com/lavanet/lava/v4/cmd/lavad/cmd" @@ -41,13 +40,7 @@ func main() { rootCmd.AddCommand(cmdLavavisorCreateService) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + os.Exit(1) } } diff --git a/go.mod b/go.mod index b1ad1afffa..cc7766966b 100644 --- a/go.mod +++ b/go.mod @@ -1,38 +1,48 @@ module github.com/lavanet/lava/v4 -go 1.20 +go 1.22.3 require ( + cosmossdk.io/api v0.7.5 // indirect + cosmossdk.io/core v0.12.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.1 + cosmossdk.io/math v1.3.0 + cosmossdk.io/store v1.1.1 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/tx v0.13.5 + cosmossdk.io/x/upgrade v0.1.1 github.com/99designs/keyring v1.2.1 // indirect - github.com/cometbft/cometbft v0.37.5 - github.com/cometbft/cometbft-db v0.8.0 - github.com/confio/ics23/go v0.9.0 // indirect - github.com/cosmos/cosmos-sdk v0.47.13 - github.com/cosmos/ibc-go/v7 v7.4.0 + github.com/cometbft/cometbft v0.38.12 + github.com/cometbft/cometbft-db v0.11.0 // indirect + github.com/cosmos/cosmos-sdk v0.50.10 + github.com/cosmos/ibc-go/v8 v8.2.1 github.com/ethereum/go-ethereum v1.10.18 github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/websocket/v2 v2.0.22 github.com/gogo/protobuf v1.3.3 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cast v1.6.0 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/grpc v1.62.1 - google.golang.org/protobuf v1.33.0 + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/grpc v1.64.1 + google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v2 v2.4.0 ) require ( + cosmossdk.io/client/v2 v2.0.0-beta.1 cosmossdk.io/collections v0.4.0 - cosmossdk.io/core v0.10.0 - cosmossdk.io/errors v1.0.1 - cosmossdk.io/math v1.3.0 - github.com/btcsuite/btcd/btcec/v2 v2.3.2 + cosmossdk.io/tools/confix v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 + github.com/btcsuite/btcd/btcec/v2 v2.3.4 + github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 + github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/dgraph-io/badger/v4 v4.1.0 github.com/fullstorydev/grpcurl v1.8.5 github.com/goccy/go-json v0.10.2 @@ -40,49 +50,50 @@ require ( github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/itchyny/gojq v0.12.16 - github.com/jhump/protoreflect v1.15.1 + github.com/jhump/protoreflect v1.15.3 github.com/joho/godotenv v1.3.0 github.com/newrelic/go-agent/v3 v3.20.4 github.com/praserx/ipconv v1.2.1 github.com/spf13/pflag v1.0.5 github.com/tidwall/gjson v1.16.0 github.com/tidwall/sjson v1.2.5 - go.uber.org/mock v0.3.0 + go.uber.org/mock v0.4.0 gonum.org/v1/gonum v0.13.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( - cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute v1.23.3 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/storage v1.36.0 // indirect - cosmossdk.io/api v0.7.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/aws/aws-sdk-go v1.44.203 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/bufbuild/protocompile v0.4.0 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/golang/glog v1.2.0 // indirect @@ -91,64 +102,70 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/orderedmap v0.2.0 // indirect + github.com/iancoleman/orderedmap v0.3.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/itchyny/timefmt-go v0.1.6 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect + github.com/tyler-smith/go-bip39 v1.0.2 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.155.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/api v0.171.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect + gotest.tools/v3 v3.5.1 // indirect pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) require ( filippo.io/edwards25519 v1.0.0 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/andybalholm/brotli v1.0.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v0.20.1 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 @@ -171,46 +188,40 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/websocket v1.5.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 + github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/websocket v1.5.3 + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 github.com/mtibben/percent v0.2.1 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.16.0 - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect - github.com/rakyll/statik v0.1.7 // indirect + github.com/prometheus/client_golang v1.20.1 + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -220,28 +231,26 @@ require ( github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/zondax/hid v0.9.2 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/net v0.23.0 - golang.org/x/sync v0.6.0 - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.18.0 - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 + golang.org/x/net v0.28.0 + golang.org/x/sync v0.8.0 + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 + golang.org/x/text v0.17.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce gopkg.in/yaml.v3 v3.0.1 nhooyr.io/websocket v1.8.6 // indirect ) -replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - -replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - -replace github.com/cosmos/cosmos-sdk => github.com/lavanet/cosmos-sdk v0.47.13-lava-cosmos // branch: v0.47.13-lava - replace ( - cosmossdk.io/api => cosmossdk.io/api v0.3.1 - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb + + // TODO(https://github.com/cosmos/rosetta/issues/76): Rosetta requires cosmossdk.io/core v0.12.0 erroneously but + // should use v0.11.0. The Cosmos build fails with types/context.go:65:29: undefined: comet.BlockInfo otherwise. + cosmossdk.io/core => cosmossdk.io/core v0.11.0 + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index 2b7631814c..efb007b6cf 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -71,10 +71,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -112,8 +110,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -174,8 +172,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -188,27 +186,39 @@ cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuW cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= +cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/tools/confix v0.1.0 h1:2OOZTtQsDT5e7P3FM5xqM0bPfluAxZlAwxqaDmYBE+E= +cosmossdk.io/tools/confix v0.1.0/go.mod h1:TdXKVYs4gEayav5wM+JHT+kTU2J7fozFNqoVaN+8CdY= +cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= +cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= +cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= +cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= +cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= @@ -216,18 +226,20 @@ github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwR github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -239,9 +251,8 @@ github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -261,15 +272,13 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= -github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= @@ -280,6 +289,7 @@ github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7 github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -289,36 +299,19 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= -github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -331,8 +324,8 @@ github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -357,34 +350,32 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= -github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= +github.com/cockroachdb/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= -github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= -github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= -github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= -github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= +github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= +github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= +github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -393,54 +384,56 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-sdk v0.50.10 h1:zXfeu/z653tWZARr/jESzAEiCUYjgJwwG4ytnYWMoDM= +github.com/cosmos/cosmos-sdk v0.50.10/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= -github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= -github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= -github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= +github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 h1:dyLNlDElY6+5zW/BT/dO/3Ad9FpQblfh+9dQpYQodbA= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= +github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= +github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/v8 v8.2.1 h1:MTsnZZjxvGD4Fv5pYyx5UkELafSX0rlPt6IfsE2BpTQ= +github.com/cosmos/ibc-go/v8 v8.2.1/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= @@ -450,7 +443,6 @@ github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN github.com/dgraph-io/badger/v4 v4.1.0 h1:E38jc0f+RATYrycSUf9LMv/t47XAy+3CApyYSq4APOQ= github.com/dgraph-io/badger/v4 v4.1.0/go.mod h1:P50u28d39ibBRmIJuQC/NSdBOg46HnHw7al2SW5QRHg= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -462,11 +454,11 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -481,6 +473,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -492,15 +486,14 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/ethereum/go-ethereum v1.10.18 h1:hLEd5M+UD0GJWPaROiYMRgZXl6bi5YwoTJSthsx5CZw= github.com/ethereum/go-ethereum v1.10.18/go.mod h1:RD3NhcSBjZpj3k+SnQq24wBrmnmie78P5R/P62iNBD8= github.com/fasthttp/websocket v1.5.0 h1:B4zbe3xXyvIdnqjOZrafVFklCUq5ZLo/TqCt5JA1wLE= github.com/fasthttp/websocket v1.5.0/go.mod h1:n0BlOQvJdPbTuBkZT0O5+jk/sp/1/VCzquR1BehI2F4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= @@ -508,9 +501,11 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlK github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -522,22 +517,28 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqG github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -546,8 +547,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -559,10 +560,13 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -668,12 +672,14 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -694,7 +700,6 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -714,39 +719,35 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -758,11 +759,17 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -770,22 +777,28 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= @@ -798,12 +811,13 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= -github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -830,11 +844,9 @@ github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJG github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.10.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -846,13 +858,13 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= @@ -864,7 +876,6 @@ github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -872,8 +883,8 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -889,24 +900,21 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lavanet/cosmos-sdk v0.47.13-lava-cosmos h1:j9CPgCpsZkw4/0LJKcaQtWaBKIt6fQWKe/wZ7PuqNfI= -github.com/lavanet/cosmos-sdk v0.47.13-lava-cosmos/go.mod h1:pYMzhTfKFn9AJB5X64Epwe9NgYk0y3v7XN8Ks5xqWoo= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -921,6 +929,7 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -942,12 +951,7 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -962,7 +966,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= @@ -973,10 +976,13 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -990,15 +996,19 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/newrelic/go-agent/v3 v3.20.4 h1:fkxr0oUEYrPeXyfJC0D0BwDs1FYMe4NgUSqnzqPESI0= github.com/newrelic/go-agent/v3 v3.20.4/go.mod h1:rT6ZUxJc5rQbWLyCtjqQCOcfb01lKRFbc1yMQkcboWM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -1009,15 +1019,19 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1028,6 +1042,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -1035,18 +1050,19 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1066,16 +1082,16 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1084,20 +1100,18 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1113,14 +1127,14 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1135,7 +1149,6 @@ github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZj github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 h1:Orn7s+r1raRTBKLSc9DmbktTT04sL+vkzsbRD2Q8rOI= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899/go.mod h1:oejLrk1Y/5zOF+c/aHtXqn3TFlzzbAgPWg8zBiAHDas= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -1147,6 +1160,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1164,16 +1178,16 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1184,6 +1198,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1192,6 +1207,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +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= @@ -1203,10 +1219,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.16.0 h1:SyXa+dsSPpUlcwEDuKuEBJEz5vzTvOea+9rjyYodQFg= github.com/tidwall/gjson v1.16.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1214,7 +1228,6 @@ github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= @@ -1233,7 +1246,8 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -1250,13 +1264,10 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1269,8 +1280,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1283,63 +1294,75 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1352,20 +1375,22 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1431,8 +1456,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1458,8 +1483,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1474,8 +1499,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1501,6 +1526,7 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1553,11 +1579,12 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1582,14 +1609,14 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1599,10 +1626,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1618,6 +1644,7 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1626,9 +1653,12 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1643,6 +1673,7 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1673,8 +1704,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1682,8 +1713,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1741,8 +1773,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= -google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= +google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1751,8 +1783,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1863,12 +1893,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1911,8 +1941,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1930,8 +1960,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1950,7 +1980,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1971,9 +2000,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1991,7 +2019,6 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/proto/lavanet/lava/conflict/params.proto b/proto/lavanet/lava/conflict/params.proto index 3b0193eba2..9acb4ac558 100644 --- a/proto/lavanet/lava/conflict/params.proto +++ b/proto/lavanet/lava/conflict/params.proto @@ -11,7 +11,7 @@ message Params { string majorityPercent = 1[ (gogoproto.moretags) = "yaml:\"majority_percent\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; uint64 voteStartSpan = 2; @@ -22,17 +22,17 @@ message Params { message Rewards { string winnerRewardPercent = 1[ (gogoproto.moretags) = "yaml:\"winner_reward_percent\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string clientRewardPercent = 2[ (gogoproto.moretags) = "yaml:\"client_reward_percent\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string votersRewardPercent = 3[ (gogoproto.moretags) = "yaml:\"voters_reward_percent\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; diff --git a/proto/lavanet/lava/conflict/tx.proto b/proto/lavanet/lava/conflict/tx.proto index 3fd86dcc8b..f248d29d7d 100644 --- a/proto/lavanet/lava/conflict/tx.proto +++ b/proto/lavanet/lava/conflict/tx.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package lavanet.lava.conflict; import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; // this line is used by starport scaffolding # proto/tx/import import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; @@ -20,6 +21,7 @@ service Msg { // TODO:: change coin type to another proto (define proto in another file int this directory) message MsgDetection { option (amino.name) = "conflict/Detection"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; reserved 2; reserved 3; @@ -35,6 +37,7 @@ message MsgDetectionResponse { message MsgConflictVoteCommit { option (amino.name) = "conflict/ConflictVoteCommit"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string voteID = 2; bytes hash = 3; @@ -45,6 +48,7 @@ message MsgConflictVoteCommitResponse { message MsgConflictVoteReveal { option (amino.name) = "conflict/ConflictVoteReveal"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string voteID = 2; int64 nonce = 3; diff --git a/proto/lavanet/lava/dualstaking/tx.proto b/proto/lavanet/lava/dualstaking/tx.proto index cf54420366..a9523a8e55 100644 --- a/proto/lavanet/lava/dualstaking/tx.proto +++ b/proto/lavanet/lava/dualstaking/tx.proto @@ -4,7 +4,7 @@ import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; - +import "cosmos/msg/v1/msg.proto"; option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; // Msg defines the Msg service. @@ -18,6 +18,7 @@ service Msg { message MsgDelegate { option (amino.name) = "dualstaking/Delegate"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string validator = 5; string provider = 2; @@ -30,6 +31,7 @@ message MsgDelegateResponse { message MsgRedelegate { option (amino.name) = "dualstaking/Redelegate"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string from_provider = 2; string to_provider = 3; @@ -43,6 +45,7 @@ message MsgRedelegateResponse { message MsgUnbond { option (amino.name) = "dualstaking/Unbond"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string validator = 5; string provider = 2; @@ -55,6 +58,7 @@ message MsgUnbondResponse { message MsgClaimRewards { option (amino.name) = "dualstaking/MsgClaimRewards"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; // delegator string provider = 2; } diff --git a/proto/lavanet/lava/pairing/params.proto b/proto/lavanet/lava/pairing/params.proto index efb0e9c5af..651785e220 100644 --- a/proto/lavanet/lava/pairing/params.proto +++ b/proto/lavanet/lava/pairing/params.proto @@ -13,7 +13,7 @@ message Params { uint64 epochBlocksOverlap = 8 [(gogoproto.moretags) = "yaml:\"epoch_blocks_overlap\""]; string QoSWeight = 13 [ (gogoproto.moretags) = "yaml:\"data_reliability_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; uint64 recommendedEpochNumToCollectPayment = 14 [(gogoproto.moretags) = "yaml:\"recommended_epoch_num_to_collect_payment\""]; diff --git a/proto/lavanet/lava/pairing/query.proto b/proto/lavanet/lava/pairing/query.proto index 0f806dd49e..351b183c1d 100644 --- a/proto/lavanet/lava/pairing/query.proto +++ b/proto/lavanet/lava/pairing/query.proto @@ -152,7 +152,7 @@ message QueryProviderPairingChanceRequest { } message QueryProviderPairingChanceResponse { - string chance = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string chance = 1 [(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; } message QueryUserEntryRequest { diff --git a/proto/lavanet/lava/pairing/relay.proto b/proto/lavanet/lava/pairing/relay.proto index a74bd761ee..caf8d562c5 100644 --- a/proto/lavanet/lava/pairing/relay.proto +++ b/proto/lavanet/lava/pairing/relay.proto @@ -97,17 +97,17 @@ message RelayReply { message QualityOfServiceReport{ string latency = 1 [ (gogoproto.moretags) = "yaml:\"Latency\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string availability = 2 [ (gogoproto.moretags) = "yaml:\"availability\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string sync = 3 [ (gogoproto.moretags) = "yaml:\"sync\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/lavanet/lava/pairing/tx.proto b/proto/lavanet/lava/pairing/tx.proto index 6392d65ff8..0949e9ffa9 100644 --- a/proto/lavanet/lava/pairing/tx.proto +++ b/proto/lavanet/lava/pairing/tx.proto @@ -7,7 +7,7 @@ import "lavanet/lava/epochstorage/endpoint.proto"; import "lavanet/lava/pairing/relay.proto"; import "cosmos/staking/v1beta1/staking.proto"; import "amino/amino.proto"; - +import "cosmos/msg/v1/msg.proto"; option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; // Msg defines the Msg service. @@ -23,6 +23,7 @@ service Msg { message MsgStakeProvider { option (amino.name) = "pairing/StakeProvider"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string chainID = 2; cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; @@ -41,6 +42,7 @@ message MsgStakeProviderResponse { message MsgUnstakeProvider { option (amino.name) = "pairing/UnstakeProvider"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string chainID = 2; string validator = 3; @@ -51,6 +53,7 @@ message MsgUnstakeProviderResponse { message MsgRelayPayment { option (amino.name) = "pairing/RelayPayment"; + option (cosmos.msg.v1.signer) = "creator"; reserved 3; string creator = 1; repeated RelaySession relays = 2; @@ -69,6 +72,7 @@ message MsgRelayPaymentResponse { message MsgFreezeProvider { option (amino.name) = "pairing/Freeze"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; repeated string chainIds = 2; string reason = 3; @@ -79,6 +83,7 @@ message MsgFreezeProviderResponse { message MsgUnfreezeProvider { option (amino.name) = "pairing/Unfreeze"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; repeated string chainIds = 2; } @@ -89,6 +94,7 @@ message MsgUnfreezeProviderResponse { message MsgMoveProviderStake { option (amino.name) = "pairing/MoveProviderStake"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string src_chain =2; string dst_chain =3; diff --git a/proto/lavanet/lava/projects/tx.proto b/proto/lavanet/lava/projects/tx.proto index e3fec5cb1f..97a7ff2d59 100644 --- a/proto/lavanet/lava/projects/tx.proto +++ b/proto/lavanet/lava/projects/tx.proto @@ -5,7 +5,7 @@ import "amino/amino.proto"; import "lavanet/lava/projects/project.proto"; import "lavanet/lava/plans/policy.proto"; import "gogoproto/gogo.proto"; - +import "cosmos/msg/v1/msg.proto"; // this line is used by starport scaffolding # proto/tx/import option go_package = "github.com/lavanet/lava/v4/x/projects/types"; @@ -21,6 +21,7 @@ service Msg { message MsgAddKeys { option (amino.name) = "projects/AddKeys"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string project = 2; repeated ProjectKey project_keys = 3 [(gogoproto.nullable) = false]; @@ -31,6 +32,7 @@ message MsgAddKeysResponse { message MsgDelKeys { option (amino.name) = "projects/DelKeys"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string project = 2; repeated ProjectKey project_keys = 3 [(gogoproto.nullable) = false]; @@ -41,6 +43,7 @@ message MsgDelKeysResponse { message MsgSetPolicy { option (amino.name) = "projects/SetPolicy"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; string project = 2; lavanet.lava.plans.Policy policy = 3; @@ -51,6 +54,7 @@ message MsgSetPolicyResponse { message MsgSetSubscriptionPolicy { option (amino.name) = "projects/SetSubscriptionPolicy"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; repeated string projects = 2; lavanet.lava.plans.Policy policy = 3; diff --git a/proto/lavanet/lava/protocol/tx.proto b/proto/lavanet/lava/protocol/tx.proto index 4b0067332a..67842bd096 100644 --- a/proto/lavanet/lava/protocol/tx.proto +++ b/proto/lavanet/lava/protocol/tx.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.protocol; import "amino/amino.proto"; - +import "cosmos/msg/v1/msg.proto"; // this line is used by starport scaffolding # proto/tx/import import "lavanet/lava/protocol/params.proto"; option go_package = "github.com/lavanet/lava/v4/x/protocol/types"; @@ -15,6 +15,7 @@ service Msg { // this line is used by starport scaffolding # proto/tx/message message MsgSetVersion { option (amino.name) = "protocol/MsgSetVersion"; + option (cosmos.msg.v1.signer) = "authority"; string authority = 1; Version version = 2; } diff --git a/proto/lavanet/lava/rewards/base_pay.proto b/proto/lavanet/lava/rewards/base_pay.proto index ec07185330..67c4ce6d83 100644 --- a/proto/lavanet/lava/rewards/base_pay.proto +++ b/proto/lavanet/lava/rewards/base_pay.proto @@ -12,12 +12,12 @@ option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; message BasePay { string total = 1 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string totalAdjusted = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; diff --git a/proto/lavanet/lava/rewards/params.proto b/proto/lavanet/lava/rewards/params.proto index 314184c3d5..c94266a55a 100644 --- a/proto/lavanet/lava/rewards/params.proto +++ b/proto/lavanet/lava/rewards/params.proto @@ -11,25 +11,25 @@ message Params { string min_bonded_target = 1 [ (gogoproto.moretags) = "yaml:\"min_bonded_target\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string max_bonded_target = 2 [ (gogoproto.moretags) = "yaml:\"max_bonded_target\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string low_factor = 3 [ (gogoproto.moretags) = "yaml:\"low_factor\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string leftover_burn_rate = 4 [ (gogoproto.moretags) = "yaml:\"leftover_burn_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -37,7 +37,7 @@ message Params { string validators_subscription_participation = 6 [ (gogoproto.moretags) = "yaml:\"validators_subscription_participation\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/proto/lavanet/lava/rewards/tx.proto b/proto/lavanet/lava/rewards/tx.proto index e6930bd1b2..02d487c3bf 100644 --- a/proto/lavanet/lava/rewards/tx.proto +++ b/proto/lavanet/lava/rewards/tx.proto @@ -3,6 +3,7 @@ package lavanet.lava.rewards; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; // this line is used by starport scaffolding # proto/tx/import @@ -16,6 +17,7 @@ service Msg { } message MsgSetIprpcData { + option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "rewards/MsgSetIprpcData"; string authority = 1; cosmos.base.v1beta1.Coin min_iprpc_cost = 2 [(gogoproto.nullable) = false]; @@ -27,6 +29,7 @@ message MsgSetIprpcDataResponse { message MsgFundIprpc { option (amino.name) = "rewards/MsgFundIprpc"; + option (cosmos.msg.v1.signer) = "creator"; string creator = 1; uint64 duration = 2; // vesting duration in months repeated cosmos.base.v1beta1.Coin amounts = 3 [ diff --git a/proto/lavanet/lava/spec/spec.proto b/proto/lavanet/lava/spec/spec.proto index 069ca5374e..381b265b64 100644 --- a/proto/lavanet/lava/spec/spec.proto +++ b/proto/lavanet/lava/spec/spec.proto @@ -34,7 +34,7 @@ message Spec { repeated ApiCollection api_collections = 16; repeated string contributor =17; string contributor_percentage=18 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" ]; uint64 shares = 19; string identity = 20; diff --git a/proto/lavanet/lava/subscription/tx.proto b/proto/lavanet/lava/subscription/tx.proto index b8c445b5bd..079a3cb846 100644 --- a/proto/lavanet/lava/subscription/tx.proto +++ b/proto/lavanet/lava/subscription/tx.proto @@ -6,6 +6,7 @@ import "amino/amino.proto"; import "lavanet/lava/projects/project.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; +import "cosmos/msg/v1/msg.proto"; // Msg defines the Msg service. service Msg { @@ -18,6 +19,8 @@ service Msg { message MsgBuy { option (amino.name) = "subscription/Buy"; + option (cosmos.msg.v1.signer) = "creator"; + reserved 5; string creator = 1; string consumer = 2; @@ -32,6 +35,8 @@ message MsgBuyResponse { message MsgAddProject { option (amino.name) = "subscription/AddProject"; + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; lavanet.lava.projects.ProjectData project_data = 2 [(gogoproto.nullable) = false]; } @@ -41,6 +46,8 @@ message MsgAddProjectResponse { message MsgDelProject { option (amino.name) = "subscription/DelProject"; + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; string name = 2; } @@ -50,6 +57,8 @@ message MsgDelProjectResponse { message MsgAutoRenewal { option (amino.name) = "subscription/AutoRenewal"; + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; bool enable = 2; string consumer = 3; diff --git a/protocol/chainlib/common_test_utils.go b/protocol/chainlib/common_test_utils.go index 88b545a721..c855333273 100644 --- a/protocol/chainlib/common_test_utils.go +++ b/protocol/chainlib/common_test_utils.go @@ -11,13 +11,14 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/gorilla/websocket" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/utils/rand" "github.com/lavanet/lava/v4/utils/sigs" "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -51,11 +52,11 @@ func (mrw mockResponseWriter) WriteHeader(statusCode int) { } type myServiceImplementation struct { - *tmservice.UnimplementedServiceServer + *cmtservice.UnimplementedServiceServer serverCallback http.HandlerFunc } -func (bbb myServiceImplementation) GetLatestBlock(ctx context.Context, reqIn *tmservice.GetLatestBlockRequest) (*tmservice.GetLatestBlockResponse, error) { +func (bbb myServiceImplementation) GetLatestBlock(ctx context.Context, reqIn *cmtservice.GetLatestBlockRequest) (*cmtservice.GetLatestBlockResponse, error) { metadata, exists := metadata.FromIncomingContext(ctx) req := &http.Request{} if exists { @@ -70,7 +71,7 @@ func (bbb myServiceImplementation) GetLatestBlock(ctx context.Context, reqIn *tm num := 5 respWriter := mockResponseWriter{blockToReturn: &num} bbb.serverCallback(respWriter, req) - return &tmservice.GetLatestBlockResponse{Block: &types.Block{Header: types.Header{Height: int64(num)}}}, nil + return &cmtservice.GetLatestBlockResponse{Block: &types.Block{Header: types.Header{Height: int64(num)}}}, nil } func generateCombinations(arr []string) [][]string { @@ -175,7 +176,7 @@ func CreateChainLibMocks( } go func() { service := myServiceImplementation{serverCallback: httpServerCallback} - tmservice.RegisterServiceServer(grpcServer, service) + cmtservice.RegisterServiceServer(grpcServer, service) gogoreflection.Register(grpcServer) // Serve requests on the buffered connection if err := grpcServer.Serve(lis); err != nil { @@ -220,7 +221,11 @@ type TestStruct struct { } func (ts *TestStruct) BondDenom() string { - return ts.Keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ts.Ctx)) + denom, err := ts.Keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ts.Ctx)) + if err != nil { + panic(err) + } + return denom } func SetupForTests(t *testing.T, numOfProviders int, specID string, getToTopMostPath string) TestStruct { @@ -233,12 +238,12 @@ func SetupForTests(t *testing.T, numOfProviders int, specID string, getToTopMost ts.Validator = testcommon.CreateNewAccount(ts.Ctx, *ts.Keepers, balance) msg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(ts.Validator.Addr), + sdk.ValAddress(ts.Validator.Addr).String(), ts.Validator.PubKey, - sdk.NewCoin(ts.BondDenom(), sdk.NewIntFromUint64(uint64(balance))), + sdk.NewCoin(ts.BondDenom(), math.NewIntFromUint64(uint64(balance))), stakingtypes.Description{}, - stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1)), - sdk.ZeroInt(), + stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1)), + math.ZeroInt(), ) require.NoError(t, err) _, err = ts.Servers.StakingServer.CreateValidator(ts.Ctx, msg) diff --git a/protocol/common/endpoints.go b/protocol/common/endpoints.go index 03998cc2ff..fb1385dcae 100644 --- a/protocol/common/endpoints.go +++ b/protocol/common/endpoints.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/utils/sigs" @@ -247,7 +248,7 @@ type ConflictHandlerInterface interface { type ProviderInfo struct { ProviderAddress string - ProviderQoSExcellenceSummery sdk.Dec // the number represents the average qos for this provider session + ProviderQoSExcellenceSummery math.LegacyDec // the number represents the average qos for this provider session ProviderStake sdk.Coin } diff --git a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go index 194265384c..b06ac1f72c 100644 --- a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go +++ b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/utils/rand" "github.com/lavanet/lava/v4/utils/sigs" @@ -201,7 +202,7 @@ func TestConsensusHashesInsertion(t *testing.T) { } func TestQoS(t *testing.T) { - decToSet, _ := sdk.NewDecFromStr("0.05") // test values fit 0.05 Availability requirements + decToSet, _ := math.LegacyNewDecFromStr("0.05") // test values fit 0.05 Availability requirements lavasession.AvailabilityPercentage = decToSet rand.InitRandomSeed() chainsToTest := []string{"APT1", "LAV1", "ETH1"} @@ -287,9 +288,9 @@ func TestQoS(t *testing.T) { require.Equal(t, uint64(1), singleConsumerSession.QoSInfo.TotalRelays) require.Equal(t, int64(1), singleConsumerSession.QoSInfo.SyncScoreSum) require.Equal(t, int64(1), singleConsumerSession.QoSInfo.TotalSyncScore) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) latestServicedBlock = expectedBH + 1 singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) @@ -297,9 +298,9 @@ func TestQoS(t *testing.T) { require.Equal(t, uint64(2), singleConsumerSession.QoSInfo.TotalRelays) require.Equal(t, int64(2), singleConsumerSession.QoSInfo.SyncScoreSum) require.Equal(t, int64(2), singleConsumerSession.QoSInfo.TotalSyncScore) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) singleConsumerSession.QoSInfo.TotalRelays++ // this is how we add a failure singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) @@ -308,9 +309,9 @@ func TestQoS(t *testing.T) { require.Equal(t, int64(3), singleConsumerSession.QoSInfo.SyncScoreSum) require.Equal(t, int64(3), singleConsumerSession.QoSInfo.TotalSyncScore) - require.Equal(t, sdk.ZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + require.Equal(t, math.LegacyZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) latestServicedBlock = expectedBH - 1 // is one block below threshold singleConsumerSession.CalculateQoS(currentLatency, expectedLatency*2, expectedBH-latestServicedBlock, numOfProviders, 1) @@ -319,17 +320,17 @@ func TestQoS(t *testing.T) { require.Equal(t, int64(3), singleConsumerSession.QoSInfo.SyncScoreSum) require.Equal(t, int64(4), singleConsumerSession.QoSInfo.TotalSyncScore) - require.Equal(t, sdk.ZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 - require.Equal(t, sdk.MustNewDecFromStr("0.75"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + require.Equal(t, math.LegacyZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 + require.Equal(t, math.LegacyMustNewDecFromStr("0.75"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) latestServicedBlock = expectedBH + 1 // add in a loop so availability goes above 95% for i := 5; i < 100; i++ { singleConsumerSession.CalculateQoS(currentLatency, expectedLatency*2, expectedBH-latestServicedBlock, numOfProviders, 1) } - require.Equal(t, sdk.MustNewDecFromStr("0.8"), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 - require.Equal(t, sdk.MustNewDecFromStr("0.989898989898989898"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + require.Equal(t, math.LegacyMustNewDecFromStr("0.8"), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 + require.Equal(t, math.LegacyMustNewDecFromStr("0.989898989898989898"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, math.LegacyOneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) finalizationInsertionsSpreadBlocks := []finalizationTestInsertion{ finalizationInsertionForProviders(chainID, epoch, 200, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], diff --git a/protocol/lavasession/common.go b/protocol/lavasession/common.go index dc18f49950..a89f7d22b4 100644 --- a/protocol/lavasession/common.go +++ b/protocol/lavasession/common.go @@ -13,9 +13,9 @@ import ( "time" sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" "golang.org/x/exp/slices" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/status" "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" "github.com/lavanet/lava/v4/utils" @@ -48,7 +48,7 @@ const ( unixPrefix = "unix:" ) -var AvailabilityPercentage sdk.Dec = sdk.NewDecWithPrec(1, 1) // TODO move to params pairing +var AvailabilityPercentage math.LegacyDec = math.LegacyNewDecWithPrec(1, 1) // TODO move to params pairing const ( PercentileToCalculateLatency = 0.9 MinProvidersForSync = 0.6 @@ -186,10 +186,16 @@ func SortByGeolocations(pairingEndpoints []*Endpoint, currentGeo planstypes.Geol } // sort the endpoints by geolocation relevance: - lessFunc := func(a *Endpoint, b *Endpoint) bool { + lessFunc := func(a *Endpoint, b *Endpoint) int { latencyA := int(latencyToGeo(a.Geolocation, currentGeo)) latencyB := int(latencyToGeo(b.Geolocation, currentGeo)) - return latencyA < latencyB + if latencyA < latencyB { + return -1 + } + if latencyA > latencyB { + return 1 + } + return 0 } slices.SortStableFunc(pairingEndpoints, lessFunc) } diff --git a/protocol/lavasession/consumer_types.go b/protocol/lavasession/consumer_types.go index 22c6bed45c..7c3c4207b4 100644 --- a/protocol/lavasession/consumer_types.go +++ b/protocol/lavasession/consumer_types.go @@ -7,6 +7,7 @@ import ( "sync/atomic" "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/protocol/provideroptimizer" "github.com/lavanet/lava/v4/utils" @@ -62,7 +63,7 @@ type UsedProvidersInf interface { type SessionInfo struct { Session *SingleConsumerSession StakeSize sdk.Coin - QoSSummeryResult sdk.Dec // using ComputeQoS to get the total QOS + QoSSummeryResult math.LegacyDec // using ComputeQoS to get the total QOS Epoch uint64 ReportedProviders []*pairingtypes.ReportedProvider } @@ -88,7 +89,7 @@ type QoSReport struct { LastQoSReport *pairingtypes.QualityOfServiceReport LastExcellenceQoSReport *pairingtypes.QualityOfServiceReport LastExcellenceQoSReportRaw *pairingtypes.QualityOfServiceReport - LatencyScoreList []sdk.Dec + LatencyScoreList []math.LegacyDec SyncScoreSum int64 TotalSyncScore int64 TotalRelays uint64 @@ -593,9 +594,9 @@ func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSes return connected, endpointsList, cswp.PublicLavaAddress, nil } -func CalculateAvailabilityScore(qosReport *QoSReport) (downtimePercentageRet, scaledAvailabilityScoreRet sdk.Dec) { - downtimePercentage := sdk.NewDecWithPrec(int64(qosReport.TotalRelays-qosReport.AnsweredRelays), 0).Quo(sdk.NewDecWithPrec(int64(qosReport.TotalRelays), 0)) - scaledAvailabilityScore := sdk.MaxDec(sdk.ZeroDec(), AvailabilityPercentage.Sub(downtimePercentage).Quo(AvailabilityPercentage)) +func CalculateAvailabilityScore(qosReport *QoSReport) (downtimePercentageRet, scaledAvailabilityScoreRet math.LegacyDec) { + downtimePercentage := math.LegacyNewDecWithPrec(int64(qosReport.TotalRelays-qosReport.AnsweredRelays), 0).Quo(math.LegacyNewDecWithPrec(int64(qosReport.TotalRelays), 0)) + scaledAvailabilityScore := math.LegacyMaxDec(math.LegacyZeroDec(), AvailabilityPercentage.Sub(downtimePercentage).Quo(AvailabilityPercentage)) return downtimePercentage, scaledAvailabilityScore } diff --git a/protocol/lavasession/consumer_types_test.go b/protocol/lavasession/consumer_types_test.go index 931226cfed..be54dc0572 100644 --- a/protocol/lavasession/consumer_types_test.go +++ b/protocol/lavasession/consumer_types_test.go @@ -3,7 +3,7 @@ package lavasession import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" "github.com/stretchr/testify/require" ) @@ -28,7 +28,7 @@ func TestCalculateAvailabilityScore(t *testing.T) { downTime, availabilityScore = CalculateAvailabilityScore(qosReport) downTimeFloat, err = downTime.Float64() require.NoError(t, err) - halfDec, err := sdk.NewDecFromStr("0.5") + halfDec, err := math.LegacyNewDecFromStr("0.5") require.NoError(t, err) require.Equal(t, downTimeFloat*2, avialabilityAsFloat) require.Equal(t, halfDec, availabilityScore) diff --git a/protocol/lavasession/single_consumer_session.go b/protocol/lavasession/single_consumer_session.go index dfea92c4ce..ccd1e57f96 100644 --- a/protocol/lavasession/single_consumer_session.go +++ b/protocol/lavasession/single_consumer_session.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - sdk "github.com/cosmos/cosmos-sdk/types" + cosmosmath "cosmossdk.io/math" "github.com/lavanet/lava/v4/utils" pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) @@ -38,7 +38,7 @@ func (cs *SingleConsumerSession) CalculateExpectedLatency(timeoutGivenToRelay ti } // cs should be locked here to use this method, returns the computed qos or zero if last qos is nil or failed to compute. -func (cs *SingleConsumerSession) getQosComputedResultOrZero() sdk.Dec { +func (cs *SingleConsumerSession) getQosComputedResultOrZero() cosmosmath.LegacyDec { if cs.QoSInfo.LastExcellenceQoSReport != nil { qosComputed, errComputing := cs.QoSInfo.LastExcellenceQoSReport.ComputeQoSExcellence() if errComputing == nil { // if we failed to compute the qos will be 0 so this provider wont be picked to return the error in case we get it @@ -46,7 +46,7 @@ func (cs *SingleConsumerSession) getQosComputedResultOrZero() sdk.Dec { } utils.LavaFormatError("Failed computing QoS used for error parsing", errComputing, utils.LogAttr("Report", cs.QoSInfo.LastExcellenceQoSReport)) } - return sdk.ZeroDec() + return cosmosmath.LegacyZeroDec() } func (cs *SingleConsumerSession) CalculateQoS(latency, expectedLatency time.Duration, blockHeightDiff int64, numOfProviders int, servicersToCount int64) { @@ -60,13 +60,13 @@ func (cs *SingleConsumerSession) CalculateQoS(latency, expectedLatency time.Dura downtimePercentage, scaledAvailabilityScore := CalculateAvailabilityScore(&cs.QoSInfo) cs.QoSInfo.LastQoSReport.Availability = scaledAvailabilityScore - if sdk.OneDec().GT(cs.QoSInfo.LastQoSReport.Availability) { + if cosmosmath.LegacyOneDec().GT(cs.QoSInfo.LastQoSReport.Availability) { utils.LavaFormatDebug("QoS Availability report", utils.Attribute{Key: "Availability", Value: cs.QoSInfo.LastQoSReport.Availability}, utils.Attribute{Key: "down percent", Value: downtimePercentage}) } - latencyScore := sdk.MinDec(sdk.OneDec(), sdk.NewDecFromInt(sdk.NewInt(int64(expectedLatency))).Quo(sdk.NewDecFromInt(sdk.NewInt(int64(latency))))) + latencyScore := cosmosmath.LegacyMinDec(cosmosmath.LegacyOneDec(), cosmosmath.LegacyNewDecFromInt(cosmosmath.NewInt(int64(expectedLatency))).Quo(cosmosmath.LegacyNewDecFromInt(cosmosmath.NewInt(int64(latency))))) - insertSorted := func(list []sdk.Dec, value sdk.Dec) []sdk.Dec { + insertSorted := func(list []cosmosmath.LegacyDec, value cosmosmath.LegacyDec) []cosmosmath.LegacyDec { index := sort.Search(len(list), func(i int) bool { return list[i].GTE(value) }) @@ -88,8 +88,8 @@ func (cs *SingleConsumerSession) CalculateQoS(latency, expectedLatency time.Dura cs.QoSInfo.SyncScoreSum++ } cs.QoSInfo.TotalSyncScore++ - cs.QoSInfo.LastQoSReport.Sync = sdk.NewDec(cs.QoSInfo.SyncScoreSum).QuoInt64(cs.QoSInfo.TotalSyncScore) - if sdk.OneDec().GT(cs.QoSInfo.LastQoSReport.Sync) { + cs.QoSInfo.LastQoSReport.Sync = cosmosmath.LegacyNewDec(cs.QoSInfo.SyncScoreSum).QuoInt64(cs.QoSInfo.TotalSyncScore) + if cosmosmath.LegacyOneDec().GT(cs.QoSInfo.LastQoSReport.Sync) { utils.LavaFormatDebug("QoS Sync report", utils.Attribute{Key: "Sync", Value: cs.QoSInfo.LastQoSReport.Sync}, utils.Attribute{Key: "block diff", Value: blockHeightDiff}, @@ -100,7 +100,7 @@ func (cs *SingleConsumerSession) CalculateQoS(latency, expectedLatency time.Dura } } else { // we prefer to give them a score of 1 when there is no other data, since otherwise we damage their payments - cs.QoSInfo.LastQoSReport.Sync = sdk.NewDec(1) + cs.QoSInfo.LastQoSReport.Sync = cosmosmath.LegacyNewDec(1) } } diff --git a/protocol/provideroptimizer/provider_optimizer.go b/protocol/provideroptimizer/provider_optimizer.go index 6f9198a9e9..b3b7a5ed97 100644 --- a/protocol/provideroptimizer/provider_optimizer.go +++ b/protocol/provideroptimizer/provider_optimizer.go @@ -6,7 +6,7 @@ import ( "sync" "time" - sdk "github.com/cosmos/cosmos-sdk/types" + cosmosmath "cosmossdk.io/math" "github.com/dgraph-io/ristretto" "github.com/lavanet/lava/v4/protocol/common" "github.com/lavanet/lava/v4/protocol/metrics" @@ -593,7 +593,7 @@ func (po *ProviderOptimizer) GetExcellenceQoSReportForProvider(providerAddress s syncScore := turnFloatToDec(providerData.Sync.Num/providerData.Sync.Denom, precision) // if our sync score is un initialized due to lack of providers if syncScore.IsZero() { - syncScore = sdk.OneDec() + syncScore = cosmosmath.LegacyOneDec() } availabilityScore := turnFloatToDec(providerData.Availability.Num/providerData.Availability.Denom, precision) ret := &pairingtypes.QualityOfServiceReport{ @@ -619,9 +619,9 @@ func (po *ProviderOptimizer) GetExcellenceQoSReportForProvider(providerAddress s return ret, rawQosReport } -func turnFloatToDec(floatNum float64, precision int64) sdk.Dec { +func turnFloatToDec(floatNum float64, precision int64) cosmosmath.LegacyDec { integerNum := int64(math.Round(floatNum * math.Pow(10, float64(precision)))) - return sdk.NewDecWithPrec(integerNum, precision) + return cosmosmath.LegacyNewDecWithPrec(integerNum, precision) } func (po *ProviderOptimizer) Strategy() Strategy { diff --git a/protocol/rpcconsumer/relay_errors.go b/protocol/rpcconsumer/relay_errors.go index 2f8edbdfbd..d3c27d0041 100644 --- a/protocol/rpcconsumer/relay_errors.go +++ b/protocol/rpcconsumer/relay_errors.go @@ -5,7 +5,7 @@ import ( "regexp" "strconv" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" "github.com/lavanet/lava/v4/protocol/common" "github.com/lavanet/lava/v4/utils" ) @@ -50,7 +50,7 @@ func (r *RelayErrors) sanitizeError(err error) string { func (r *RelayErrors) GetBestErrorMessageForUser() RelayError { bestIndex := -1 - bestResult := github_com_cosmos_cosmos_sdk_types.ZeroDec() + bestResult := sdkmath.LegacyZeroDec() errorMap := make(map[string][]int) for idx, relayError := range r.relayErrors { errorMessage := r.sanitizeError(relayError.err) diff --git a/protocol/rpcconsumer/relay_errors_test.go b/protocol/rpcconsumer/relay_errors_test.go index 5e48db5975..3c20f26f8b 100644 --- a/protocol/rpcconsumer/relay_errors_test.go +++ b/protocol/rpcconsumer/relay_errors_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/protocol/common" "github.com/stretchr/testify/require" @@ -23,35 +24,35 @@ func TestRelayError(t *testing.T) { { err: fmt.Errorf("test1"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("test2"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 20), }, }, { err: fmt.Errorf("test3"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 30), }, }, { err: fmt.Errorf("test4"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 40), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 50), }, }, @@ -66,49 +67,49 @@ func TestRelayError(t *testing.T) { { err: fmt.Errorf("test1"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.5"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.5"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("test1"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.25"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.25"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("test3"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.6"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.6"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("test3"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.7"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.7"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("test4"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.7"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.7"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("test4"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.7"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.7"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.8"), + ProviderQoSExcellenceSummery: math.LegacyMustNewDecFromStr("0.8"), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, @@ -123,35 +124,35 @@ func TestRelayError(t *testing.T) { { err: fmt.Errorf("test1"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 1000), }, }, { err: fmt.Errorf("test2"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 1000), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.ZeroDec(), + ProviderQoSExcellenceSummery: math.LegacyZeroDec(), ProviderStake: sdk.NewInt64Coin("ulava", 0), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.ZeroDec(), + ProviderQoSExcellenceSummery: math.LegacyZeroDec(), ProviderStake: sdk.NewInt64Coin("ulava", 0), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.ZeroDec(), + ProviderQoSExcellenceSummery: math.LegacyZeroDec(), ProviderStake: sdk.NewInt64Coin("ulava", 0), }, }, @@ -166,35 +167,35 @@ func TestRelayError(t *testing.T) { { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 20), }, }, { err: fmt.Errorf("test3"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 30), }, }, { err: fmt.Errorf("test4"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 40), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, @@ -209,35 +210,35 @@ func TestRelayError(t *testing.T) { { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 20), }, }, { err: fmt.Errorf("test3"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 30), }, }, { err: fmt.Errorf("test4"), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 40), }, }, { err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ - ProviderQoSExcellenceSummery: sdk.OneDec(), + ProviderQoSExcellenceSummery: math.LegacyOneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, diff --git a/protocol/rpcconsumer/relay_processor.go b/protocol/rpcconsumer/relay_processor.go index 589c054fcc..0b805e63cd 100644 --- a/protocol/rpcconsumer/relay_processor.go +++ b/protocol/rpcconsumer/relay_processor.go @@ -10,7 +10,7 @@ import ( "sync" "sync/atomic" - sdktypes "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" "github.com/lavanet/lava/v4/protocol/common" "github.com/lavanet/lava/v4/protocol/lavaprotocol" "github.com/lavanet/lava/v4/protocol/lavasession" @@ -306,7 +306,7 @@ func (rp *RelayProcessor) responsesQuorum(results []common.RelayResult, quorumSi countMap := make(map[string]int) // Map to store the count of each unique result.Reply.Data deterministic := rp.RelayStateMachine.GetProtocolMessage().GetApi().Category.Deterministic var bestQosResult common.RelayResult - bestQos := sdktypes.ZeroDec() + bestQos := math.LegacyZeroDec() nilReplies := 0 nilReplyIdx := -1 for idx, result := range results { diff --git a/protocol/rpcconsumer/rpcconsumer_server.go b/protocol/rpcconsumer/rpcconsumer_server.go index 4b3612dd1d..d353aef330 100644 --- a/protocol/rpcconsumer/rpcconsumer_server.go +++ b/protocol/rpcconsumer/rpcconsumer_server.go @@ -12,6 +12,7 @@ import ( "github.com/goccy/go-json" sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/protocol/chainlib" @@ -747,7 +748,7 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( } if rpccs.debugRelays && singleConsumerSession.QoSInfo.LastQoSReport != nil && singleConsumerSession.QoSInfo.LastQoSReport.Sync.BigInt() != nil && - singleConsumerSession.QoSInfo.LastQoSReport.Sync.LT(sdk.MustNewDecFromStr("0.9")) { + singleConsumerSession.QoSInfo.LastQoSReport.Sync.LT(math.LegacyMustNewDecFromStr("0.9")) { utils.LavaFormatDebug("identified QoS mismatch", utils.Attribute{Key: "expectedBH", Value: expectedBH}, utils.Attribute{Key: "latestServicedBlock", Value: latestBlock}, diff --git a/protocol/rpcprovider/rewardserver/reward_db_test.go b/protocol/rpcprovider/rewardserver/reward_db_test.go index 6c9796bd72..3dd1d27c4d 100644 --- a/protocol/rpcprovider/rewardserver/reward_db_test.go +++ b/protocol/rpcprovider/rewardserver/reward_db_test.go @@ -19,7 +19,7 @@ func TestSave(t *testing.T) { err := rs.AddDB(db) require.NoError(t, err) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "providerAddr", []byte{}, uint64(0), "specId", nil) cpe := &rewardserver.RewardEntity{ @@ -44,7 +44,7 @@ func TestSaveBatch(t *testing.T) { err := rs.AddDB(db) require.NoError(t, err) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "providerAddr", []byte{}, uint64(0), "specId", nil) cpes := []*rewardserver.RewardEntity{} @@ -72,7 +72,7 @@ func TestFindAll(t *testing.T) { err := rs.AddDB(db) require.NoError(t, err) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "providerAddr", []byte{}, uint64(0), "specId", nil) cpe := &rewardserver.RewardEntity{ @@ -96,7 +96,7 @@ func TestFindOne(t *testing.T) { err := rs.AddDB(db) require.NoError(t, err) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "providerAddr", []byte{}, uint64(0), "specId", nil) proof.Epoch = 1 @@ -122,7 +122,7 @@ func TestDeleteClaimedRewards(t *testing.T) { require.NoError(t, err) privKey, addr := sigs.GenerateFloatingKey() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "providerAddr", []byte{}, uint64(0), "specId", nil) proof.Epoch = 1 @@ -157,7 +157,7 @@ func TestDeleteEpochRewards(t *testing.T) { require.NoError(t, err) privKey, addr := sigs.GenerateFloatingKey() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "providerAddr", []byte{}, uint64(0), "specId", nil) proof.Epoch = 1 @@ -193,7 +193,7 @@ func TestRewardsWithTTL(t *testing.T) { require.NoError(t, err) privKey, addr := sigs.GenerateFloatingKey() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proof := common.BuildRelayRequest(ctx, "provider", []byte{}, uint64(0), "spec", nil) proof.Epoch = 1 diff --git a/protocol/rpcprovider/rewardserver/reward_server_test.go b/protocol/rpcprovider/rewardserver/reward_server_test.go index c86d920e45..31f1c726da 100644 --- a/protocol/rpcprovider/rewardserver/reward_server_test.go +++ b/protocol/rpcprovider/rewardserver/reward_server_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/lavanet/lava/v4/testutil/common" "github.com/lavanet/lava/v4/utils/rand" "github.com/lavanet/lava/v4/utils/sigs" @@ -31,9 +32,9 @@ func stubPaymentEvents(num int, specId string, sessionId uint64) (tos []map[stri Provider: "lava@test0", RelayNum: 5, QosReport: &pairingtypes.QualityOfServiceReport{ - Latency: sdk.OneDec(), - Availability: sdk.OneDec(), - Sync: sdk.OneDec(), + Latency: math.LegacyOneDec(), + Availability: math.LegacyOneDec(), + Sync: math.LegacyOneDec(), }, Epoch: 20, UnresponsiveProviders: nil, @@ -132,7 +133,7 @@ func TestSendNewProof(t *testing.T) { rewardDB, err := createInMemoryRewardDb([]string{specId, "newSpec"}) require.NoError(t, err) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) testCases := []struct { Proofs []*pairingtypes.RelaySession ExpectedExistingCu uint64 @@ -192,7 +193,7 @@ func TestSendNewProof(t *testing.T) { func TestSendNewProofWillSetBadgeWhenPrefProofDoesNotHaveOneSet(t *testing.T) { rand.InitRandomSeed() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) rewardDB, err := createInMemoryRewardDb([]string{"specId"}) require.NoError(t, err) @@ -212,7 +213,7 @@ func TestSendNewProofWillSetBadgeWhenPrefProofDoesNotHaveOneSet(t *testing.T) { func TestSendNewProofWillNotSetBadgeWhenPrefProofHasOneSet(t *testing.T) { rand.InitRandomSeed() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) db := NewMemoryDB("specId") rewardStore := NewRewardDB() err := rewardStore.AddDB(db) @@ -251,7 +252,7 @@ func TestUpdateEpoch(t *testing.T) { rws, stubRewardsTxSender, _ := setupRewardsServer() privKey, acc := sigs.GenerateFloatingKey() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) for _, sessionId := range []uint64{1, 2, 3, 4, 5} { epoch := sessionId%2 + 1 proof := common.BuildRelayRequestWithSession(ctx, "provider", []byte{}, sessionId, uint64(0), "spec", nil) @@ -282,7 +283,7 @@ func TestUpdateEpoch(t *testing.T) { rws, stubRewardsTxSender, db := setupRewardsServer() privKey, acc := sigs.GenerateFloatingKey() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) epoch := uint64(1) for _, sessionId := range []uint64{1, 2, 3, 4, 5} { proof := common.BuildRelayRequestWithSession(ctx, "provider", []byte{}, sessionId, uint64(0), "spec", nil) @@ -322,7 +323,7 @@ func TestSaveRewardsToDB(t *testing.T) { epoch := uint64(1) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proofs := []*pairingtypes.RelaySession{} for _, spec := range specs { proofs = append(proofs, common.BuildRelayRequestWithSession(ctx, providerAddr, make([]byte, 0), uint64(1), uint64(10), spec, nil)) @@ -352,7 +353,7 @@ func TestDeleteRewardsFromDBWhenRewardApproved(t *testing.T) { epoch, sessionId := uint64(1), uint64(1) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proofs := []*pairingtypes.RelaySession{} for _, spec := range specs { proofs = append(proofs, common.BuildRelayRequestWithSession(ctx, providerAddr, []byte{}, sessionId, uint64(10), spec, nil)) @@ -397,7 +398,7 @@ func TestDeleteRewardsFromDBWhenRewardEpochNotInMemory(t *testing.T) { epoch, sessionId := uint64(1), uint64(1) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) proofs := []*pairingtypes.RelaySession{} for _, chainId := range specs { proofs = append(proofs, common.BuildRelayRequestWithSession(ctx, providerAddr, []byte{}, sessionId, uint64(10), chainId, nil)) @@ -440,7 +441,7 @@ func TestRestoreRewardsFromDB(t *testing.T) { epoch, sessionId := uint64(1), uint64(1) - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) privKey, acc := sigs.GenerateFloatingKey() for _, spec := range specs { proof := common.BuildRelayRequestWithSession(ctx, providerAddr, []byte{}, sessionId, uint64(10), spec, nil) @@ -482,7 +483,7 @@ func TestFailedPaymentRequestAttemptsHappyFlow(t *testing.T) { }, } - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) rws := NewRewardServer(&stubRewardsTxSender, nil, rewardDB, "badger_test", 1, 1, nil) session := common.BuildRelayRequestWithSession(ctx, providerAddr, []byte{}, uint64(1), uint64(42), spec, nil) @@ -514,7 +515,7 @@ func TestFailedPaymentRequestAttemptsHappyMultipleSessions(t *testing.T) { }, } - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) rws := NewRewardServer(&stubRewardsTxSender, nil, rewardDB, "badger_test", 10000, 10000, nil) require.Equal(t, 3, MaxPaymentRequestsRetiresForSession, @@ -562,7 +563,7 @@ func TestFailedPaymentRequestAttemptsHappyMultipleSessions(t *testing.T) { func BenchmarkSendNewProofInMemory(b *testing.B) { rand.InitRandomSeed() - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) specs := []string{"spec", "spec2"} rewardDB, err := createInMemoryRewardDb(specs) require.NoError(b, err) @@ -578,7 +579,7 @@ func BenchmarkSendNewProofLocal(b *testing.B) { rand.InitRandomSeed() os.RemoveAll("badger_test") - ctx := sdk.WrapSDKContext(sdk.NewContext(nil, tmproto.Header{}, false, nil)) + ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) db1 := NewLocalDB("badger_test", "provider", "spec", 0) db2 := NewLocalDB("badger_test", "provider", "spec2", 0) rewardStore := NewRewardDB() diff --git a/protocol/statetracker/events.go b/protocol/statetracker/events.go index 9b41f74842..33df04dbc7 100644 --- a/protocol/statetracker/events.go +++ b/protocol/statetracker/events.go @@ -74,7 +74,7 @@ func eventsLookup(ctx context.Context, clientCtx client.Context, blocks, fromBlo utils.LavaFormatError("invalid blockResults status", err) return } - for _, event := range blockResults.BeginBlockEvents { + for _, event := range blockResults.FinalizeBlockEvents { checkEventForShow(eventName, event, hasAttributeName, value, block, showAttributeName) } transactionResults := blockResults.TxsResults diff --git a/protocol/statetracker/tx_sender.go b/protocol/statetracker/tx_sender.go index b0e42d5a5d..a3d1347298 100644 --- a/protocol/statetracker/tx_sender.go +++ b/protocol/statetracker/tx_sender.go @@ -12,12 +12,13 @@ import ( "github.com/goccy/go-json" + "cosmossdk.io/math" + "cosmossdk.io/x/feegrant" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" typestx "github.com/cosmos/cosmos-sdk/types/tx" - "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/lavanet/lava/v4/protocol/common" "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" @@ -50,7 +51,7 @@ func NewTxSender(ctx context.Context, clientCtx client.Context, txFactory tx.Fac func (ts *TxSender) checkProfitability(simResult *typestx.SimulateResponse, gasUsed uint64, txFactory tx.Factory) error { txEvents := simResult.GetResult().Events - lavaReward := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(0)) + lavaReward := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(0)) for _, txEvent := range txEvents { if txEvent.Type == utils.EventPrefix+pairingtypes.RelayPaymentEventName { for _, attribute := range txEvent.Attributes { @@ -86,9 +87,6 @@ func (ts *TxSender) SimulateAndBroadCastTxWithRetryOnSeqMismatch(ctx context.Con txfactory = ts.txFactory.WithFeeGranter(feeGranter) } - if err := msg.ValidateBasic(); err != nil { - return err - } clientCtx := ts.clientCtx txfactory, err := ts.prepareFactory(txfactory) if err != nil { diff --git a/protocol/statetracker/updaters/event_tracker.go b/protocol/statetracker/updaters/event_tracker.go index 6f442a83af..341646a30e 100644 --- a/protocol/statetracker/updaters/event_tracker.go +++ b/protocol/statetracker/updaters/event_tracker.go @@ -107,7 +107,7 @@ func (et *EventTracker) getLatestVersionEvents(latestBlock int64) (updated bool, if et.latestUpdatedBlock != latestBlock { return false, utils.LavaFormatWarning("event results are different than expected", nil, utils.Attribute{Key: "requested latestBlock", Value: latestBlock}, utils.Attribute{Key: "current latestBlock", Value: et.latestUpdatedBlock}) } - for _, event := range et.blockResults.EndBlockEvents { + for _, event := range et.blockResults.FinalizeBlockEvents { if event.Type == utils.EventPrefix+"param_change" { for _, attribute := range event.Attributes { if attribute.Key == "param" && attribute.Value == "Version" { @@ -126,7 +126,7 @@ func (et *EventTracker) getLatestDowntimeParamsUpdateEvents(latestBlock int64) ( if et.latestUpdatedBlock != latestBlock { return false, utils.LavaFormatWarning("event results are different than expected", nil, utils.Attribute{Key: "requested latestBlock", Value: latestBlock}, utils.Attribute{Key: "current latestBlock", Value: et.latestUpdatedBlock}) } - for _, event := range et.blockResults.EndBlockEvents { + for _, event := range et.blockResults.FinalizeBlockEvents { if event.Type == utils.EventPrefix+"param_change" { for _, attribute := range event.Attributes { if attribute.Key == "param" && (attribute.Value == "DowntimeDuration" || attribute.Value == "EpochDuration") { @@ -149,7 +149,7 @@ func (et *EventTracker) getLatestSpecModifyEvents(latestBlock int64) (updated bo utils.EventPrefix + spectypes.SpecModifyEventName, utils.EventPrefix + spectypes.SpecRefreshEventName, } - for _, event := range et.blockResults.EndBlockEvents { + for _, event := range et.blockResults.FinalizeBlockEvents { if slices.Contains(eventsListToListenTo, event.Type) { utils.LavaFormatInfo("Spec update event identified", utils.LogAttr("Event", event.Type)) return true, nil @@ -179,7 +179,7 @@ func (et *EventTracker) getLatestVoteEvents(latestBlock int64) (votes []*reliabi } } - beginBlockEvents := et.blockResults.BeginBlockEvents + beginBlockEvents := et.blockResults.FinalizeBlockEvents for _, event := range beginBlockEvents { if event.Type == utils.EventPrefix+conflicttypes.ConflictVoteRevealEventName { voteID, voteDeadline, err := reliabilitymanager.BuildBaseVoteDataFromEvent(event) @@ -217,7 +217,7 @@ type tendermintRPC interface { ) (*ctypes.ResultConsensusParams, error) } -func TryIntoTendermintRPC(cl client.TendermintRPC) (tendermintRPC, error) { +func TryIntoTendermintRPC(cl client.CometRPC) (tendermintRPC, error) { brp, ok := cl.(tendermintRPC) if !ok { return nil, fmt.Errorf("client does not implement tendermintRPC: %T", cl) diff --git a/protocol/statetracker/updaters/state_query.go b/protocol/statetracker/updaters/state_query.go index 51cb45ec61..4a8949bed1 100644 --- a/protocol/statetracker/updaters/state_query.go +++ b/protocol/statetracker/updaters/state_query.go @@ -271,7 +271,7 @@ func (psq *ProviderStateQuery) VoteEvents(ctx context.Context, latestBlock int64 } } - beginBlockEvents := blockResults.BeginBlockEvents + beginBlockEvents := blockResults.FinalizeBlockEvents for _, event := range beginBlockEvents { if event.Type == utils.EventPrefix+conflicttypes.ConflictVoteRevealEventName { voteID, voteDeadline, err := reliabilitymanager.BuildBaseVoteDataFromEvent(event) diff --git a/scripts/init_chain.sh b/scripts/init_chain.sh index 756c77f702..89bbb0d53e 100755 --- a/scripts/init_chain.sh +++ b/scripts/init_chain.sh @@ -13,8 +13,8 @@ fi rm -rf ~/.lava chainID="lava" lavad init validator --chain-id $chainID -lavad config broadcast-mode sync -lavad config keyring-backend test +lavad config set client broadcast-mode sync +lavad config set client keyring-backend test # Specify the file path, field to edit, and new value path="$HOME/.lava/config/" @@ -67,7 +67,6 @@ fi echo -n "$data" > "$path$genesis" echo "using genesis file" -echo $(cat "$path$genesis") # Determine OS os_name=$(uname) diff --git a/scripts/useful_commands.sh b/scripts/useful_commands.sh index e6ac07bbbf..6e8e0d77bb 100755 --- a/scripts/useful_commands.sh +++ b/scripts/useful_commands.sh @@ -23,11 +23,11 @@ sleep_until_next_epoch() { # Function to wait until next block wait_next_block() { - current=$( lavad q block | jq .block.header.height) + current=$(lavad status 2>/dev/null | jq -r '.sync_info.latest_block_height') echo "waiting for next block $current" while true; do display_ticker - new=$( lavad q block | jq .block.header.height) + new=$(lavad status 2>/dev/null | jq -r '.sync_info.latest_block_height') if [ "$current" != "$new" ]; then echo "finished waiting at block $new" break diff --git a/testutil/common/common.go b/testutil/common/common.go index ab88059c23..22efc025fa 100644 --- a/testutil/common/common.go +++ b/testutil/common/common.go @@ -5,6 +5,7 @@ import ( "encoding/json" "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" @@ -21,7 +22,11 @@ import ( func CreateNewAccount(ctx context.Context, keepers testkeeper.Keepers, balance int64) (acc sigs.Account) { acc = sigs.GenerateDeterministicFloatingKey(testkeeper.Randomizer) testkeeper.Randomizer.Inc() - coins := sdk.NewCoins(sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.NewInt(balance))) + bondDenom, err := keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)) + if err != nil { + panic(err) + } + coins := sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewInt(balance))) keepers.BankKeeper.SetBalance(sdk.UnwrapSDKContext(ctx), acc.Addr, coins) return } @@ -32,14 +37,17 @@ func StakeAccount(t *testing.T, ctx context.Context, keepers testkeeper.Keepers, endpoints = append(endpoints, epochstoragetypes.Endpoint{IPPORT: "123", ApiInterfaces: []string{collection.CollectionData.ApiInterface}, Geolocation: 1}) } - _, err := servers.PairingServer.StakeProvider(ctx, &pairingtypes.MsgStakeProvider{ + bondDenom, err := keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)) + require.NoError(t, err) + + _, err = servers.PairingServer.StakeProvider(ctx, &pairingtypes.MsgStakeProvider{ Creator: acc.Addr.String(), Address: acc.Addr.String(), ChainID: spec.Index, - Amount: sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.NewInt(stake)), + Amount: sdk.NewCoin(bondDenom, math.NewInt(stake)), Geolocation: 1, Endpoints: endpoints, - DelegateLimit: sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.ZeroInt()), + DelegateLimit: sdk.NewCoin(bondDenom, math.ZeroInt()), DelegateCommission: 100, Validator: sdk.ValAddress(validator.Addr).String(), Description: MockDescription(), @@ -163,7 +171,7 @@ func prepareRelayData(ctx context.Context, conflictData *conflicttypes.ConflictR CuSum: 0, Epoch: sdk.UnwrapSDKContext(ctx).BlockHeight(), RelayNum: 0, - QosReport: &pairingtypes.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, + QosReport: &pairingtypes.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, } } diff --git a/testutil/common/mock.go b/testutil/common/mock.go index f1ef3441aa..4453df7279 100644 --- a/testutil/common/mock.go +++ b/testutil/common/mock.go @@ -1,6 +1,7 @@ package common import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" plantypes "github.com/lavanet/lava/v4/x/plans/types" @@ -16,7 +17,7 @@ func CreateMockSpec() spectypes.Spec { spec.ReliabilityThreshold = 4294967295 spec.BlockDistanceForFinalizedData = 0 spec.DataReliabilityEnabled = true - spec.MinStakeProvider = sdk.NewCoin(commonconsts.TestTokenDenom, sdk.NewInt(1000)) + spec.MinStakeProvider = sdk.NewCoin(commonconsts.TestTokenDenom, math.NewInt(1000)) spec.ApiCollections = []*spectypes.ApiCollection{{Enabled: true, CollectionData: spectypes.CollectionData{ApiInterface: "stub", Type: "GET"}, Apis: []*spectypes.Api{{Name: specName + "API", ComputeUnits: 100, Enabled: true}}}} spec.BlockDistanceForFinalizedData = 0 spec.Shares = 1 @@ -29,7 +30,7 @@ func CreateMockPlan() plantypes.Plan { Description: "plan for testing", Type: "rpc", Block: 100, - Price: sdk.NewCoin(commonconsts.TestTokenDenom, sdk.NewInt(100)), + Price: sdk.NewCoin(commonconsts.TestTokenDenom, math.NewInt(100)), AllowOveruse: true, OveruseRate: 10, AnnualDiscountPercentage: 20, diff --git a/testutil/common/tester.go b/testutil/common/tester.go index 9032bcf281..5dece0ac66 100644 --- a/testutil/common/tester.go +++ b/testutil/common/tester.go @@ -10,7 +10,6 @@ import ( "time" "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -96,7 +95,7 @@ func (ts *Tester) SetChainID(chainID string) { blockHeader := ts.Ctx.BlockHeader() blockHeader.ChainID = chainID ts.Ctx = ts.Ctx.WithBlockHeader(blockHeader) - ts.GoCtx = sdk.WrapSDKContext(ts.Ctx) + ts.GoCtx = ts.Ctx } func (ts *Tester) SetupAccounts(numSub, numAdm, numDev int) *Tester { @@ -231,7 +230,7 @@ func (ts *Tester) StakeProviderFull( } } - stake := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(amount)) + stake := sdk.NewCoin(ts.TokenDenom(), math.NewInt(amount)) description := stakingtypes.NewDescription(moniker, identity, website, securityContact, descriptionDetails) _, err := ts.TxPairingStakeProvider(vault, provider, spec.Index, stake, endpoints, geoloc, description, commission) @@ -242,8 +241,8 @@ func (ts *Tester) StakeProviderFull( // Usually, you get the account of your created validator with ts.GetAccount // so input valAcc.addr to this function func (ts *Tester) GetValidator(addr sdk.AccAddress) stakingtypes.Validator { - v, found := ts.Keepers.StakingKeeper.GetValidator(ts.Ctx, sdk.ValAddress(addr)) - require.True(ts.T, found) + v, err := ts.Keepers.StakingKeeper.GetValidator(ts.Ctx, sdk.ValAddress(addr)) + require.NoError(ts.T, err) return v } @@ -254,8 +253,7 @@ func (ts *Tester) SlashValidator(valAcc sigs.Account, fraction math.LegacyDec, p valConsAddr := sdk.GetConsAddress(valAcc.PubKey) ts.Keepers.SlashingKeeper.Slash(ts.Ctx, valConsAddr, fraction, power, ts.Ctx.BlockHeight()) - var req abci.RequestBeginBlock - ts.Keepers.Dualstaking.BeginBlock(ts.Ctx, req) + ts.Keepers.Dualstaking.BeginBlock(ts.Ctx) // calculate expected burned tokens consensusPowerTokens := ts.Keepers.StakingKeeper.TokensFromConsensusPower(ts.Ctx, power) @@ -311,7 +309,7 @@ func (ts *Tester) Policy(name string) planstypes.Policy { } func (ts *Tester) TokenDenom() string { - return ts.Keepers.StakingKeeper.BondDenom(ts.Ctx) + return ts.BondDenom() } func (ts *Tester) AddProjectData(name string, pd projectstypes.ProjectData) *Tester { @@ -344,7 +342,7 @@ func (ts *Tester) Spec(name string) spectypes.Spec { // misc shortcuts func NewCoin(tokenDenom string, amount int64) sdk.Coin { - return sdk.NewCoin(tokenDenom, sdk.NewInt(amount)) + return sdk.NewCoin(tokenDenom, math.NewInt(amount)) } func NewCoins(tokenDenom string, amount ...int64) []sdk.Coin { @@ -354,8 +352,7 @@ func NewCoins(tokenDenom string, amount ...int64) []sdk.Coin { // keeper helpers func (ts *Tester) GetBalance(accAddr sdk.AccAddress) int64 { - denom := ts.Keepers.StakingKeeper.BondDenom(ts.Ctx) - return ts.Keepers.BankKeeper.GetBalance(ts.Ctx, accAddr, denom).Amount.Int64() + return ts.Keepers.BankKeeper.GetBalance(ts.Ctx, accAddr, ts.BondDenom()).Amount.Int64() } func (ts *Tester) GetBalances(accAddr sdk.AccAddress) sdk.Coins { @@ -608,7 +605,7 @@ func (ts *Tester) TxPairingStakeProvider( Amount: amount, Geolocation: geoloc, Endpoints: endpoints, - DelegateLimit: sdk.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), sdk.ZeroInt()), + DelegateLimit: sdk.NewCoin(ts.BondDenom(), math.ZeroInt()), DelegateCommission: commission, Address: provider, Description: description, @@ -749,12 +746,12 @@ func (ts *Tester) TxCreateValidator(validator sigs.Account, amount math.Int) { // create a validator msg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(validator.Addr), + sdk.ValAddress(validator.Addr).String(), validator.PubKey, - sdk.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), amount), - stakingtypes.Description{}, - stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1)), - sdk.ZeroInt(), + sdk.NewCoin(ts.BondDenom(), amount), + stakingtypes.Description{Moniker: "test_validator"}, + stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1)), + math.OneInt(), ) require.Nil(ts.T, err) _, err = ts.Servers.StakingServer.CreateValidator(ts.GoCtx, msg) @@ -765,9 +762,9 @@ func (ts *Tester) TxCreateValidator(validator sigs.Account, amount math.Int) { // TxDelegateValidator: implement 'tx staking delegate' func (ts *Tester) TxDelegateValidator(delegator, validator sigs.Account, amount math.Int) (*stakingtypes.MsgDelegateResponse, error) { msg := stakingtypes.NewMsgDelegate( - delegator.Addr, - sdk.ValAddress(validator.Addr), - sdk.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), amount), + delegator.Addr.String(), + sdk.ValAddress(validator.Addr).String(), + sdk.NewCoin(ts.BondDenom(), amount), ) return ts.Servers.StakingServer.Delegate(ts.GoCtx, msg) } @@ -775,10 +772,10 @@ func (ts *Tester) TxDelegateValidator(delegator, validator sigs.Account, amount // TxReDelegateValidator: implement 'tx staking redelegate' func (ts *Tester) TxReDelegateValidator(delegator, fromValidator, toValidator sigs.Account, amount math.Int) (*stakingtypes.MsgBeginRedelegateResponse, error) { msg := stakingtypes.NewMsgBeginRedelegate( - delegator.Addr, - sdk.ValAddress(fromValidator.Addr), - sdk.ValAddress(toValidator.Addr), - sdk.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), amount), + delegator.Addr.String(), + sdk.ValAddress(fromValidator.Addr).String(), + sdk.ValAddress(toValidator.Addr).String(), + sdk.NewCoin(ts.BondDenom(), amount), ) rf := dualstakingante.NewRedelegationFlager(ts.Keepers.Dualstaking) err := rf.DisableRedelegationHooks(ts.Ctx, []sdk.Msg{msg}) @@ -789,9 +786,9 @@ func (ts *Tester) TxReDelegateValidator(delegator, fromValidator, toValidator si // TxUnbondValidator: implement 'tx staking undond' func (ts *Tester) TxUnbondValidator(delegator, validator sigs.Account, amount math.Int) (*stakingtypes.MsgUndelegateResponse, error) { msg := stakingtypes.NewMsgUndelegate( - delegator.Addr, - sdk.ValAddress(validator.Addr), - sdk.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), amount), + delegator.Addr.String(), + sdk.ValAddress(validator.Addr).String(), + sdk.NewCoin(ts.BondDenom(), amount), ) return ts.Servers.StakingServer.Undelegate(ts.GoCtx, msg) } @@ -799,8 +796,8 @@ func (ts *Tester) TxUnbondValidator(delegator, validator sigs.Account, amount ma // TxUnbondValidator: implement 'tx staking undond' func (ts *Tester) TxCancelUnbondValidator(delegator, validator sigs.Account, block int64, amount sdk.Coin) (*stakingtypes.MsgCancelUnbondingDelegationResponse, error) { msg := stakingtypes.NewMsgCancelUnbondingDelegation( - delegator.Addr, - sdk.ValAddress(validator.Addr), + delegator.Addr.String(), + sdk.ValAddress(validator.Addr).String(), block, amount, ) @@ -1151,7 +1148,11 @@ func (ts *Tester) AdvanceMonthsFrom(from time.Time, months int) *Tester { } func (ts *Tester) BondDenom() string { - return ts.Keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ts.Ctx)) + denom, err := ts.Keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ts.Ctx)) + if err != nil { + panic("BondDenom: failed to fetch: " + err.Error()) + } + return denom } // AdvanceMonth advanced blocks by given months, like AdvanceMonthsFrom, @@ -1259,13 +1260,15 @@ func (ts *Tester) SendRelay(provider string, clientAcc sigs.Account, chainIDs [] // DisableParticipationFees zeros validators and community participation fees func (ts *Tester) DisableParticipationFees() { distParams := distributiontypes.DefaultParams() - distParams.CommunityTax = sdk.ZeroDec() - err := ts.Keepers.Distribution.SetParams(ts.Ctx, distParams) + distParams.CommunityTax = math.LegacyZeroDec() + err := ts.Keepers.Distribution.Params.Set(ts.Ctx, distParams) + require.Nil(ts.T, err) + params, err := ts.Keepers.Distribution.Params.Get(ts.Ctx) require.Nil(ts.T, err) - require.True(ts.T, ts.Keepers.Distribution.GetParams(ts.Ctx).CommunityTax.IsZero()) + require.True(ts.T, params.CommunityTax.IsZero()) paramKey := string(rewardstypes.KeyValidatorsSubscriptionParticipation) - zeroDec, err := sdk.ZeroDec().MarshalJSON() + zeroDec, err := math.LegacyZeroDec().MarshalJSON() require.Nil(ts.T, err) paramVal := string(zeroDec) err = ts.TxProposalChangeParam(rewardstypes.ModuleName, paramKey, paramVal) diff --git a/testutil/e2e/paymentE2E.go b/testutil/e2e/paymentE2E.go index 99bc108d50..135ebf87b2 100644 --- a/testutil/e2e/paymentE2E.go +++ b/testutil/e2e/paymentE2E.go @@ -12,8 +12,8 @@ import ( "strings" "time" + cosmosmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v4/cmd/lavad/cmd" commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" e2esdk "github.com/lavanet/lava/v4/testutil/e2e/sdk" "github.com/lavanet/lava/v4/utils" @@ -117,7 +117,7 @@ func (lt *lavaTest) getRewards(addresses []string) ([]sdk.Coin, error) { if err != nil { return nil, fmt.Errorf("could not get rewards of address %s. err: %s", sdkAddr.String(), err.Error()) } - total := sdk.NewCoin(commonconsts.TestTokenDenom, sdk.ZeroInt()) + total := sdk.NewCoin(commonconsts.TestTokenDenom, cosmosmath.ZeroInt()) for _, r := range res.Rewards { total = total.AddAmount(r.Amount.AmountOf(commonconsts.TestTokenDenom)) } @@ -166,7 +166,7 @@ func (lt *lavaTest) checkPayment(providers []string, startRewards []sdk.Coin) { utils.Attribute{Key: "provider", Value: providers[i]}, utils.Attribute{Key: "start_balance", Value: startRewards[i].String()}, utils.Attribute{Key: "expected_payout", Value: expectedPayoutArr[i]}, - utils.Attribute{Key: "start_balance+expected_payout", Value: startRewards[i].AddAmount(sdk.NewIntFromUint64(expectedPayoutArr[i])).String()}, + utils.Attribute{Key: "start_balance+expected_payout", Value: startRewards[i].AddAmount(cosmosmath.NewIntFromUint64(expectedPayoutArr[i])).String()}, utils.Attribute{Key: "actual_balance", Value: newRewards[i]}, )) } @@ -266,7 +266,6 @@ var ( ) func runPaymentE2E(timeout time.Duration) { - cmd.InitSDKConfig() os.RemoveAll(protocolLogsFolder) gopath := os.Getenv("GOPATH") if gopath == "" { diff --git a/testutil/keeper/conflict.go b/testutil/keeper/conflict.go index beb8636a9b..b96a4d2d93 100644 --- a/testutil/keeper/conflict.go +++ b/testutil/keeper/conflict.go @@ -3,11 +3,11 @@ package keeper import ( "testing" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/lavanet/lava/v4/x/conflict/keeper" @@ -19,7 +19,7 @@ import ( func ConflictKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { epochstorage, stateStore, db := EpochstorageKeeperWithDB(t) - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) diff --git a/testutil/keeper/dualstaking.go b/testutil/keeper/dualstaking.go index e6149d6f4b..af9f2c64eb 100644 --- a/testutil/keeper/dualstaking.go +++ b/testutil/keeper/dualstaking.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/lavanet/lava/v4/x/dualstaking/keeper" @@ -22,11 +23,11 @@ import ( ) func DualstakingKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/keeper/epochstorage.go b/testutil/keeper/epochstorage.go index 7cc584527a..33fc86ebaa 100644 --- a/testutil/keeper/epochstorage.go +++ b/testutil/keeper/epochstorage.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/lavanet/lava/v4/x/epochstorage/keeper" @@ -17,12 +18,12 @@ import ( "github.com/stretchr/testify/require" ) -func EpochstorageKeeperWithDB(t testing.TB) (*keeper.Keeper, storetypes.CommitMultiStore, *tmdb.MemDB) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) +func EpochstorageKeeperWithDB(t testing.TB) (*keeper.Keeper, storetypes.CommitMultiStore, *dbm.MemDB) { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) diff --git a/testutil/keeper/keepers_init.go b/testutil/keeper/keepers_init.go index b9e289b376..6bdb204b5e 100644 --- a/testutil/keeper/keepers_init.go +++ b/testutil/keeper/keepers_init.go @@ -7,19 +7,21 @@ import ( "testing" "time" + "cosmossdk.io/log" "cosmossdk.io/math" - tmdb "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cometbft/cometbft/rpc/core" tenderminttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -113,10 +115,6 @@ type Servers struct { DistributionServer distributiontypes.MsgServer } -type KeeperBeginBlockerWithRequest interface { - BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) -} - type KeeperBeginBlocker interface { BeginBlock(ctx sdk.Context) } @@ -131,77 +129,77 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { Randomizer = sigs.NewZeroReader(seed) fmt.Println("Reproduce With testing seed: ", seed) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) registry := codectypes.NewInterfaceRegistry() cryptocodec.RegisterInterfaces(registry) cdc := codec.NewProtoCodec(registry) legacyCdc := codec.NewLegacyAmino() - distributionStoreKey := sdk.NewKVStoreKey(distributiontypes.StoreKey) + distributionStoreKey := storetypes.NewKVStoreKey(distributiontypes.StoreKey) stateStore.MountStoreWithDB(distributionStoreKey, storetypes.StoreTypeIAVL, db) - stakingStoreKey := sdk.NewKVStoreKey(stakingtypes.StoreKey) + stakingStoreKey := storetypes.NewKVStoreKey(stakingtypes.StoreKey) stateStore.MountStoreWithDB(stakingStoreKey, storetypes.StoreTypeIAVL, db) - slashingStoreKey := sdk.NewKVStoreKey(slashingtypes.StoreKey) + slashingStoreKey := storetypes.NewKVStoreKey(slashingtypes.StoreKey) stateStore.MountStoreWithDB(slashingStoreKey, storetypes.StoreTypeIAVL, db) - pairingStoreKey := sdk.NewKVStoreKey(pairingtypes.StoreKey) + pairingStoreKey := storetypes.NewKVStoreKey(pairingtypes.StoreKey) pairingMemStoreKey := storetypes.NewMemoryStoreKey(pairingtypes.MemStoreKey) stateStore.MountStoreWithDB(pairingStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(pairingMemStoreKey, storetypes.StoreTypeMemory, nil) - specStoreKey := sdk.NewKVStoreKey(spectypes.StoreKey) + specStoreKey := storetypes.NewKVStoreKey(spectypes.StoreKey) specMemStoreKey := storetypes.NewMemoryStoreKey(spectypes.MemStoreKey) stateStore.MountStoreWithDB(specStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(specMemStoreKey, storetypes.StoreTypeMemory, nil) - plansStoreKey := sdk.NewKVStoreKey(planstypes.StoreKey) + plansStoreKey := storetypes.NewKVStoreKey(planstypes.StoreKey) plansMemStoreKey := storetypes.NewMemoryStoreKey(planstypes.MemStoreKey) stateStore.MountStoreWithDB(plansStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(plansMemStoreKey, storetypes.StoreTypeMemory, nil) - projectsStoreKey := sdk.NewKVStoreKey(projectstypes.StoreKey) + projectsStoreKey := storetypes.NewKVStoreKey(projectstypes.StoreKey) projectsMemStoreKey := storetypes.NewMemoryStoreKey(projectstypes.MemStoreKey) stateStore.MountStoreWithDB(projectsStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(projectsMemStoreKey, storetypes.StoreTypeMemory, nil) - protocolStoreKey := sdk.NewKVStoreKey(protocoltypes.StoreKey) + protocolStoreKey := storetypes.NewKVStoreKey(protocoltypes.StoreKey) protocolMemStoreKey := storetypes.NewMemoryStoreKey(protocoltypes.MemStoreKey) stateStore.MountStoreWithDB(protocolStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(protocolMemStoreKey, storetypes.StoreTypeMemory, nil) - subscriptionStoreKey := sdk.NewKVStoreKey(subscriptiontypes.StoreKey) + subscriptionStoreKey := storetypes.NewKVStoreKey(subscriptiontypes.StoreKey) subscriptionMemStoreKey := storetypes.NewMemoryStoreKey(subscriptiontypes.MemStoreKey) stateStore.MountStoreWithDB(subscriptionStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(subscriptionMemStoreKey, storetypes.StoreTypeMemory, nil) - dualstakingStoreKey := sdk.NewKVStoreKey(dualstakingtypes.StoreKey) + dualstakingStoreKey := storetypes.NewKVStoreKey(dualstakingtypes.StoreKey) dualstakingMemStoreKey := storetypes.NewMemoryStoreKey(dualstakingtypes.MemStoreKey) stateStore.MountStoreWithDB(dualstakingStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(dualstakingMemStoreKey, storetypes.StoreTypeMemory, nil) - epochStoreKey := sdk.NewKVStoreKey(epochstoragetypes.StoreKey) + epochStoreKey := storetypes.NewKVStoreKey(epochstoragetypes.StoreKey) epochMemStoreKey := storetypes.NewMemoryStoreKey(epochstoragetypes.MemStoreKey) stateStore.MountStoreWithDB(epochStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(epochMemStoreKey, storetypes.StoreTypeMemory, nil) - paramsStoreKey := sdk.NewKVStoreKey(paramstypes.StoreKey) + paramsStoreKey := storetypes.NewKVStoreKey(paramstypes.StoreKey) stateStore.MountStoreWithDB(paramsStoreKey, storetypes.StoreTypeIAVL, db) - tkey := sdk.NewTransientStoreKey(paramstypes.TStoreKey) + tkey := storetypes.NewTransientStoreKey(paramstypes.TStoreKey) stateStore.MountStoreWithDB(tkey, storetypes.StoreTypeIAVL, db) - conflictStoreKey := sdk.NewKVStoreKey(conflicttypes.StoreKey) + conflictStoreKey := storetypes.NewKVStoreKey(conflicttypes.StoreKey) conflictMemStoreKey := storetypes.NewMemoryStoreKey(conflicttypes.MemStoreKey) stateStore.MountStoreWithDB(conflictStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(conflictMemStoreKey, storetypes.StoreTypeMemory, nil) - downtimeKey := sdk.NewKVStoreKey(downtimemoduletypes.StoreKey) + downtimeKey := storetypes.NewKVStoreKey(downtimemoduletypes.StoreKey) stateStore.MountStoreWithDB(downtimeKey, storetypes.StoreTypeIAVL, db) - rewardsStoreKey := sdk.NewKVStoreKey(rewardstypes.StoreKey) + rewardsStoreKey := storetypes.NewKVStoreKey(rewardstypes.StoreKey) rewardsMemStoreKey := storetypes.NewMemoryStoreKey(rewardstypes.MemStoreKey) stateStore.MountStoreWithDB(rewardsStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(rewardsMemStoreKey, storetypes.StoreTypeMemory, nil) @@ -248,23 +246,24 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { ks := Keepers{} ks.TimerStoreKeeper = timerstorekeeper.NewKeeper(cdc) - ks.AccountKeeper = mockAccountKeeper{} + ks.AccountKeeper = mockAccountKeeper{ac: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())} ks.BankKeeper = mockBankKeeper{} init_balance() - ks.StakingKeeper = *stakingkeeper.NewKeeper(cdc, stakingStoreKey, ks.AccountKeeper, ks.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - ks.Distribution = distributionkeeper.NewKeeper(cdc, distributionStoreKey, ks.AccountKeeper, ks.BankKeeper, ks.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + ks.StakingKeeper = *stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(stakingStoreKey), ks.AccountKeeper, ks.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix())) + ks.Distribution = distributionkeeper.NewKeeper(cdc, runtime.NewKVStoreService(distributionStoreKey), ks.AccountKeeper, ks.BankKeeper, ks.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) ks.Spec = *speckeeper.NewKeeper(cdc, specStoreKey, specMemStoreKey, specparamsSubspace, ks.StakingKeeper) ks.Epochstorage = *epochstoragekeeper.NewKeeper(cdc, epochStoreKey, epochMemStoreKey, epochparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Spec, ks.StakingKeeper) ks.FixationStoreKeeper = fixationkeeper.NewKeeper(cdc, ks.TimerStoreKeeper, ks.Epochstorage.BlocksToSaveRaw) ks.Dualstaking = *dualstakingkeeper.NewKeeper(cdc, dualstakingStoreKey, dualstakingMemStoreKey, dualstakingparamsSubspace, &ks.BankKeeper, &ks.StakingKeeper, &ks.AccountKeeper, ks.Epochstorage, ks.Spec, ks.FixationStoreKeeper) // register the staking hooks ks.StakingKeeper.SetHooks(stakingtypes.NewMultiStakingHooks(ks.Dualstaking.Hooks())) - ks.SlashingKeeper = slashingkeeper.NewKeeper(cdc, legacyCdc, slashingStoreKey, ks.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + ks.SlashingKeeper = slashingkeeper.NewKeeper(cdc, legacyCdc, runtime.NewKVStoreService(slashingStoreKey), ks.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) ks.Plans = *planskeeper.NewKeeper(cdc, plansStoreKey, plansMemStoreKey, plansparamsSubspace, ks.Epochstorage, ks.Spec, ks.FixationStoreKeeper, ks.StakingKeeper) ks.Projects = *projectskeeper.NewKeeper(cdc, projectsStoreKey, projectsMemStoreKey, projectsparamsSubspace, ks.Epochstorage, ks.FixationStoreKeeper) ks.Protocol = *protocolkeeper.NewKeeper(cdc, protocolStoreKey, protocolMemStoreKey, protocolparamsSubspace, authtypes.NewModuleAddress(govtypes.ModuleName).String()) ks.Downtime = downtimekeeper.NewKeeper(cdc, downtimeKey, downtimeParamsSubspace, ks.Epochstorage) - ks.Rewards = *rewardskeeper.NewKeeper(cdc, rewardsStoreKey, rewardsMemStoreKey, rewardsparamsSubspace, ks.BankKeeper, ks.AccountKeeper, ks.Spec, ks.Epochstorage, ks.Downtime, ks.StakingKeeper, ks.Dualstaking, ks.Distribution, authtypes.FeeCollectorName, ks.TimerStoreKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + distributionKeeperWrapper := rewardstypes.DistributionKeeperWrapper{Keeper: &ks.Distribution} + ks.Rewards = *rewardskeeper.NewKeeper(cdc, rewardsStoreKey, rewardsMemStoreKey, rewardsparamsSubspace, ks.BankKeeper, ks.AccountKeeper, ks.Spec, ks.Epochstorage, ks.Downtime, ks.StakingKeeper, ks.Dualstaking, &distributionKeeperWrapper, authtypes.FeeCollectorName, ks.TimerStoreKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) ks.Subscription = *subscriptionkeeper.NewKeeper(cdc, subscriptionStoreKey, subscriptionMemStoreKey, subscriptionparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, &ks.Epochstorage, ks.Projects, ks.Plans, ks.Dualstaking, ks.Rewards, ks.Spec, ks.FixationStoreKeeper, ks.TimerStoreKeeper, ks.StakingKeeper) ks.Pairing = *pairingkeeper.NewKeeper(cdc, pairingStoreKey, pairingMemStoreKey, pairingparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Spec, &ks.Epochstorage, ks.Projects, ks.Subscription, ks.Plans, ks.Downtime, ks.Dualstaking, &ks.StakingKeeper, ks.FixationStoreKeeper, ks.TimerStoreKeeper) ks.ParamsKeeper = paramsKeeper @@ -277,7 +276,7 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { stakingparams := stakingtypes.DefaultParams() stakingparams.BondDenom = commonconsts.TestTokenDenom ks.StakingKeeper.SetParams(ctx, stakingparams) - ks.Distribution.SetParams(ctx, distributiontypes.DefaultParams()) + ks.Distribution.Params.Set(ctx, distributiontypes.DefaultParams()) ks.SlashingKeeper.SetParams(ctx, slashingtypes.DefaultParams()) ks.Pairing.SetParams(ctx, pairingtypes.DefaultParams()) ks.Spec.SetParams(ctx, spectypes.DefaultParams()) @@ -313,20 +312,18 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { ss.RewardsServer = rewardskeeper.NewMsgServerImpl(ks.Rewards) ss.DistributionServer = distributionkeeper.NewMsgServerImpl(ks.Distribution) - core.SetEnvironment(&core.Environment{BlockStore: &ks.BlockStore}) - ks.Epochstorage.SetEpochDetails(ctx, *epochstoragetypes.DefaultGenesis().EpochDetails) // pools allocationPoolBalance := uint64(30000000000000) err := ks.BankKeeper.AddToBalance(GetModuleAddress(string(rewardstypes.ValidatorsRewardsAllocationPoolName)), - sdk.NewCoins(sdk.NewCoin(stakingparams.BondDenom, sdk.NewIntFromUint64(allocationPoolBalance)))) + sdk.NewCoins(sdk.NewCoin(stakingparams.BondDenom, math.NewIntFromUint64(allocationPoolBalance)))) require.NoError(t, err) err = ks.BankKeeper.AddToBalance( GetModuleAddress(string(rewardstypes.ProvidersRewardsAllocationPool)), - sdk.NewCoins(sdk.NewCoin(stakingparams.BondDenom, sdk.NewIntFromUint64(allocationPoolBalance)))) + sdk.NewCoins(sdk.NewCoin(stakingparams.BondDenom, math.NewIntFromUint64(allocationPoolBalance)))) require.NoError(t, err) if !fixedTime { @@ -348,7 +345,7 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { NewBlock(ctx, &ks) - return &ss, &ks, sdk.WrapSDKContext(ctx) + return &ss, &ks, ctx } func SimulateParamChange(ctx sdk.Context, paramKeeper paramskeeper.Keeper, subspace, key, value string) (err error) { @@ -407,7 +404,7 @@ func AdvanceBlock(ctx context.Context, ks *Keepers, customBlockTime ...time.Dura EndBlock(unwrapedCtx, ks) unwrapedCtx = UpdateBlockCtx(ctx, ks, customBlockTime...) NewBlock(unwrapedCtx, ks) - return sdk.WrapSDKContext(unwrapedCtx) + return unwrapedCtx } func UpdateBlockCtx(ctx context.Context, ks *Keepers, customBlockTime ...time.Duration) sdk.Context { @@ -483,10 +480,6 @@ func NewBlock(ctx sdk.Context, ks *Keepers) { if beginBlocker, ok := fieldValue.Interface().(KeeperBeginBlocker); ok { beginBlocker.BeginBlock(ctx) } - - if beginBlocker, ok := fieldValue.Interface().(KeeperBeginBlockerWithRequest); ok { - beginBlocker.BeginBlock(ctx, abci.RequestBeginBlock{}) - } } } diff --git a/testutil/keeper/mock_keepers.go b/testutil/keeper/mock_keepers.go index 535c25c180..940fdc6c04 100644 --- a/testutil/keeper/mock_keepers.go +++ b/testutil/keeper/mock_keepers.go @@ -1,25 +1,30 @@ package keeper import ( + "context" "fmt" "time" + "cosmossdk.io/core/address" + "cosmossdk.io/math" tenderminttypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) // account keeper mock -type mockAccountKeeper struct{} +type mockAccountKeeper struct { + ac address.Codec +} -func (k mockAccountKeeper) IterateAccounts(ctx sdk.Context, process func(authtypes.AccountI) (stop bool)) { +func (k mockAccountKeeper) IterateAccounts(ctx context.Context, process func(sdk.AccountI) (stop bool)) { } -func (k mockAccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI { +func (k mockAccountKeeper) GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI { return nil } -func (k mockAccountKeeper) GetModuleAccount(ctx sdk.Context, module string) authtypes.ModuleAccountI { +func (k mockAccountKeeper) GetModuleAccount(ctx context.Context, module string) sdk.ModuleAccountI { moduleAddress := authtypes.NewModuleAddress(module).String() baseAccount := authtypes.NewBaseAccount(nil, nil, 0, 0) baseAccount.Address = moduleAddress @@ -30,7 +35,11 @@ func (k mockAccountKeeper) GetModuleAddress(moduleName string) sdk.AccAddress { return GetModuleAddress(moduleName) } -func (k mockAccountKeeper) SetModuleAccount(sdk.Context, authtypes.ModuleAccountI) { +func (k mockAccountKeeper) SetModuleAccount(context.Context, sdk.ModuleAccountI) { +} + +func (k mockAccountKeeper) AddressCodec() address.Codec { + return k.ac } // mock bank keeper @@ -42,12 +51,12 @@ func init_balance() { balance = make(map[string]sdk.Coins) } -func (k mockBankKeeper) SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins { +func (k mockBankKeeper) SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins { return nil } -func (k mockBankKeeper) GetSupply(ctx sdk.Context, denom string) sdk.Coin { - total := sdk.NewCoin(denom, sdk.ZeroInt()) +func (k mockBankKeeper) GetSupply(ctx context.Context, denom string) sdk.Coin { + total := sdk.NewCoin(denom, math.ZeroInt()) for _, coins := range balance { for _, coin := range coins { if coin.Denom == denom { @@ -58,25 +67,25 @@ func (k mockBankKeeper) GetSupply(ctx sdk.Context, denom string) sdk.Coin { return total } -func (k mockBankKeeper) LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins { +func (k mockBankKeeper) LockedCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins { return k.GetAllBalances(ctx, addr) } -func (k mockBankKeeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin { +func (k mockBankKeeper) GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin { coins := balance[addr.String()] for i := 0; i < coins.Len(); i++ { if coins.GetDenomByIndex(i) == denom { return coins[i] } } - return sdk.NewCoin(denom, sdk.ZeroInt()) + return sdk.NewCoin(denom, math.ZeroInt()) } -func (k mockBankKeeper) GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins { +func (k mockBankKeeper) GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins { return balance[addr.String()] } -func (k mockBankKeeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error { +func (k mockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error { moduleAcc := GetModuleAddress(recipientModule) accountCoins := k.GetAllBalances(ctx, senderAddr) if !accountCoins.IsAllGTE(amt) { @@ -88,11 +97,11 @@ func (k mockBankKeeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr return nil } -func (k mockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error { +func (k mockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error { return k.SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt) } -func (k mockBankKeeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error { +func (k mockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error { moduleAcc := GetModuleAddress(senderModule) accountCoins := k.GetAllBalances(ctx, moduleAcc) if !accountCoins.IsAllGTE(amt) { @@ -104,29 +113,29 @@ func (k mockBankKeeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModu return nil } -func (k mockBankKeeper) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error { +func (k mockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error { senderModuleAcc := GetModuleAddress(senderModule) return k.SendCoinsFromAccountToModule(ctx, senderModuleAcc, recipientModule, amt) } -func (k mockBankKeeper) DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error { +func (k mockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error { // TODO support multiple coins return k.SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt) } -func (k mockBankKeeper) MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error { +func (k mockBankKeeper) MintCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error { acc := GetModuleAddress(moduleName) k.AddToBalance(acc, amounts) return nil } -func (k mockBankKeeper) BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error { +func (k mockBankKeeper) BurnCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error { acc := GetModuleAddress(moduleName) k.SubFromBalance(acc, amounts) return nil } -func (k mockBankKeeper) SetBalance(ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error { +func (k mockBankKeeper) SetBalance(ctx context.Context, addr sdk.AccAddress, amounts sdk.Coins) error { balance[addr.String()] = amounts return nil } diff --git a/testutil/keeper/pairing.go b/testutil/keeper/pairing.go index 5c9a91ba30..4b9b60d146 100644 --- a/testutil/keeper/pairing.go +++ b/testutil/keeper/pairing.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" epochstoragemodule "github.com/lavanet/lava/v4/x/epochstorage" @@ -23,14 +24,14 @@ import ( ) func PairingKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - epochStoreKey := sdk.NewKVStoreKey(epochstoragetypes.StoreKey) + epochStoreKey := storetypes.NewKVStoreKey(epochstoragetypes.StoreKey) epochMemStoreKey := storetypes.NewMemoryStoreKey(epochstoragetypes.MemStoreKey) stateStore.MountStoreWithDB(epochStoreKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(epochMemStoreKey, storetypes.StoreTypeMemory, nil) diff --git a/testutil/keeper/plan.go b/testutil/keeper/plan.go index 8a19802050..b78e845f2a 100644 --- a/testutil/keeper/plan.go +++ b/testutil/keeper/plan.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" @@ -22,11 +23,11 @@ import ( ) func PlanKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/keeper/projects.go b/testutil/keeper/projects.go index ac818e7c55..5945d64e71 100644 --- a/testutil/keeper/projects.go +++ b/testutil/keeper/projects.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" @@ -21,11 +22,11 @@ import ( ) func ProjectsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/keeper/protocol.go b/testutil/keeper/protocol.go index c0dea6a920..2d1f708102 100644 --- a/testutil/keeper/protocol.go +++ b/testutil/keeper/protocol.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -20,11 +21,11 @@ import ( ) func ProtocolKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/keeper/rewards.go b/testutil/keeper/rewards.go index 4bf2afcc4e..ff2226647a 100644 --- a/testutil/keeper/rewards.go +++ b/testutil/keeper/rewards.go @@ -3,13 +3,16 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" @@ -29,11 +32,11 @@ import ( ) func RewardsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) @@ -62,14 +65,14 @@ func RewardsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { "EpochStorageParams", ) - downtimeKey := sdk.NewKVStoreKey(downtimemoduletypes.StoreKey) + downtimeKey := storetypes.NewKVStoreKey(downtimemoduletypes.StoreKey) stateStore.MountStoreWithDB(downtimeKey, storetypes.StoreTypeIAVL, db) - stakingStoreKey := sdk.NewKVStoreKey(stakingtypes.StoreKey) - stakingKeeper := *stakingkeeper.NewKeeper(cdc, stakingStoreKey, mockAccountKeeper{}, mockBankKeeper{}, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + stakingStoreKey := storetypes.NewKVStoreKey(stakingtypes.StoreKey) + stakingKeeper := *stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(stakingStoreKey), mockAccountKeeper{}, mockBankKeeper{}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix())) - distributionStoreKey := sdk.NewKVStoreKey(distributiontypes.StoreKey) - distributionKeeper := distributionkeeper.NewKeeper(cdc, distributionStoreKey, mockAccountKeeper{}, mockBankKeeper{}, stakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + distributionStoreKey := storetypes.NewKVStoreKey(distributiontypes.StoreKey) + distributionKeeper := distributionkeeper.NewKeeper(cdc, runtime.NewKVStoreService(distributionStoreKey), mockAccountKeeper{}, mockBankKeeper{}, stakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) epochstorageKeeper := epochstoragekeeper.NewKeeper(cdc, nil, nil, paramsSubspaceEpochstorage, nil, nil, nil, stakingKeeper) downtimeKeeper := downtimekeeper.NewKeeper(cdc, downtimeKey, paramsSubspaceDowntime, epochstorageKeeper) @@ -78,6 +81,7 @@ func RewardsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { downtimeKeeper.SetParams(ctx, v1.DefaultParams()) + distributionKeeperWrapper := types.DistributionKeeperWrapper{Keeper: &distributionKeeper} k := keeper.NewKeeper( cdc, storeKey, @@ -90,7 +94,7 @@ func RewardsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { downtimeKeeper, stakingKeeper, nil, - distributionKeeper, + &distributionKeeperWrapper, authtypes.FeeCollectorName, timerstorekeeper.NewKeeper(cdc), authtypes.NewModuleAddress(govtypes.ModuleName).String(), diff --git a/testutil/keeper/subscription.go b/testutil/keeper/subscription.go index 6d27f976a1..f1c0f863e1 100644 --- a/testutil/keeper/subscription.go +++ b/testutil/keeper/subscription.go @@ -3,13 +3,14 @@ package keeper import ( "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" dualstakingkeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" @@ -24,11 +25,11 @@ import ( ) func SubscriptionKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/network/network.go b/testutil/network/network.go index a1b72c2e92..c46bea0cb8 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -9,17 +9,16 @@ import ( "github.com/stretchr/testify/require" - tmdb "github.com/cometbft/cometbft-db" + "cosmossdk.io/store/pruning/types" tmrand "github.com/cometbft/cometbft/libs/rand" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/lavanet/lava/v4/app" ) @@ -60,7 +59,7 @@ func DefaultConfig() network.Config { AccountRetriever: authtypes.AccountRetriever{}, AppConstructor: func(val network.ValidatorI) servertypes.Application { return app.New( - val.GetCtx().Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.GetCtx().Config.RootDir, 0, + val.GetCtx().Logger, dbm.NewMemDB(), nil, true, map[int64]bool{}, val.GetCtx().Config.RootDir, 0, encoding, sims.EmptyAppOptions{}, baseapp.SetPruning(types.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), diff --git a/utils/cli/multisend.go b/utils/cli/multisend.go index 6fe0658c91..8a19f3c6b9 100644 --- a/utils/cli/multisend.go +++ b/utils/cli/multisend.go @@ -141,14 +141,12 @@ func NewMultiSendTxCmd() *cobra.Command { } getResponse := func(account string, sequence uint64) bool { - tmEvents := []string{ - fmt.Sprintf("%s.%s='%s/%d'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, account, sequence), - } + tmEvents := fmt.Sprintf("%s.%s='%s/%d'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, account, sequence) var err error var txs *sdk.SearchTxsResult for i := 0; i < retries; i++ { - txs, err = authtx.QueryTxsByEvents(clientCtxOrigin, tmEvents, query.DefaultPage, query.DefaultLimit, "") + txs, err = authtx.QueryTxsByEvents(clientCtxOrigin, query.DefaultPage, query.DefaultLimit, tmEvents, "") if err == nil { break } @@ -266,7 +264,7 @@ func NewMultiSendTxCmd() *cobra.Command { } if progress.Progress == PRG_bank_send_verified || progress.Progress == PRG_ready { - msg := banktypes.NewMsgMultiSend([]banktypes.Input{banktypes.NewInput(clientCtxHotWallet.FromAddress, totalAmount)}, output) + msg := banktypes.NewMsgMultiSend(banktypes.NewInput(clientCtxHotWallet.FromAddress, totalAmount), output) fmt.Printf("*********************sending records from %d to %d, total tokens %s*******************\n", progress.Index, i, totalAmount.String()) currentSequence, err := getSequence(clientCtxHotWallet.FromAddress.String()) if err != nil { @@ -383,10 +381,9 @@ func NewQueryTotalGasCmd() *cobra.Command { } getResponse := func(account string, sequence uint64) *sdk.TxResponse { - tmEvents := []string{ - fmt.Sprintf("%s.%s='%s/%d'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, account, sequence), - } - txs, err := authtx.QueryTxsByEvents(clientCtx, tmEvents, query.DefaultPage, query.DefaultLimit, "") + tmEvents := fmt.Sprintf("%s.%s='%s/%d'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, account, sequence) + + txs, err := authtx.QueryTxsByEvents(clientCtx, query.DefaultPage, query.DefaultLimit, tmEvents, "") if err != nil { fmt.Printf("failed to query tx %s\n", err) return nil diff --git a/utils/collcompat/collcompat.go b/utils/collcompat/collcompat.go index c2d4588166..7a36391eb4 100644 --- a/utils/collcompat/collcompat.go +++ b/utils/collcompat/collcompat.go @@ -5,8 +5,8 @@ import ( collcodec "cosmossdk.io/collections/codec" "cosmossdk.io/core/store" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/gogo/protobuf/proto" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/utils/keeper/spec.go b/utils/keeper/spec.go index b31d6d696e..7ffcad1f6b 100644 --- a/utils/keeper/spec.go +++ b/utils/keeper/spec.go @@ -8,13 +8,14 @@ import ( "strings" "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/lavanet/lava/v4/x/spec/client/utils" @@ -30,11 +31,11 @@ func SpecKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { } func specKeeper() (*keeper.Keeper, sdk.Context, error) { - storeKey := sdk.NewKVStoreKey(spectypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(spectypes.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(spectypes.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) err := stateStore.LoadLatestVersion() diff --git a/utils/lavalog.go b/utils/lavalog.go index 5e7908d185..37e24d6602 100644 --- a/utils/lavalog.go +++ b/utils/lavalog.go @@ -11,7 +11,7 @@ import ( "time" sdkerrors "cosmossdk.io/errors" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" zerolog "github.com/rs/zerolog" zerologlog "github.com/rs/zerolog/log" @@ -98,6 +98,12 @@ func SetGlobalLoggingLevel(logLevel string) { LavaFormatInfo("setting log level", Attribute{Key: "loglevel", Value: logLevel}) } +func SetGlobalLoggingLevelSilent(logLevel string) { + // setting global level prevents us from having two different levels for example one for stdout and one for rolling log. + // zerolog.SetGlobalLevel(getLogLevel(logLevel)) + defaultGlobalLogLevel = getLogLevel(logLevel) +} + func SetLogLevelFieldName(fieldName string) { zerolog.LevelFieldName = fieldName } diff --git a/utils/lavaslices/slices.go b/utils/lavaslices/slices.go index 56b385d38e..4c411d73f6 100644 --- a/utils/lavaslices/slices.go +++ b/utils/lavaslices/slices.go @@ -348,7 +348,16 @@ func SplitGenericSliceIntoChunks[T any](arr []T, chunkSize int) [][]T { } func SortStable[T constraints.Ordered](slice []T) { - slices.SortStableFunc(slice, func(i, j T) bool { return i < j }) + slices.SortStableFunc(slice, func(i, j T) int { + switch { + case i < j: + return -1 + case i > j: + return 1 + default: + return 0 + } + }) } // This function is used to check if the slice is consecutive. diff --git a/utils/lavaslices/slices_test.go b/utils/lavaslices/slices_test.go index 8ae4f1bb39..5f3b8309d9 100644 --- a/utils/lavaslices/slices_test.go +++ b/utils/lavaslices/slices_test.go @@ -3,6 +3,7 @@ package lavaslices import ( "math" "reflect" + "slices" "testing" "time" @@ -564,3 +565,26 @@ func TestDifference(t *testing.T) { }) } } + +func TestSortStable(t *testing.T) { + tests := []struct { + name string + input []int + expected []int + }{ + {"empty slice", []int{}, []int{}}, + {"already sorted", []int{1, 2, 3}, []int{1, 2, 3}}, + {"reverse order", []int{3, 2, 1}, []int{1, 2, 3}}, + {"duplicates", []int{3, 1, 3, 2}, []int{1, 2, 3, 3}}, + {"negative numbers", []int{-2, 1, -3, 0}, []int{-3, -2, 0, 1}}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + SortStable(tt.input) + if !slices.Equal(tt.input, tt.expected) { + t.Errorf("got %v, want %v", tt.input, tt.expected) + } + }) + } +} diff --git a/utils/sigs/sigs.go b/utils/sigs/sigs.go index a21232a396..70d207264d 100644 --- a/utils/sigs/sigs.go +++ b/utils/sigs/sigs.go @@ -61,9 +61,9 @@ func Sign(pkey *btcSecp256k1.PrivateKey, data Signable) ([]byte, error) { msgData = HashMsg(msgData) } - sig, err := btcSecp256k1Ecdsa.SignCompact(pkey, msgData, false) - if err != nil { - return nil, err + sig := btcSecp256k1Ecdsa.SignCompact(pkey, msgData, false) + if len(sig) == 0 { + return nil, errors.New("failed to sign") } return sig, nil diff --git a/x/conflict/handler.go b/x/conflict/handler.go deleted file mode 100644 index f3043b67a9..0000000000 --- a/x/conflict/handler.go +++ /dev/null @@ -1,36 +0,0 @@ -package conflict - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/conflict/keeper" - "github.com/lavanet/lava/v4/x/conflict/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgDetection: - res, err := msgServer.Detection(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgConflictVoteCommit: - res, err := msgServer.ConflictVoteCommit(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgConflictVoteReveal: - res, err := msgServer.ConflictVoteReveal(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/conflict/keeper/conflict_vote.go b/x/conflict/keeper/conflict_vote.go index 903b5416f1..903e9603f2 100644 --- a/x/conflict/keeper/conflict_vote.go +++ b/x/conflict/keeper/conflict_vote.go @@ -1,7 +1,8 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/conflict/types" ) @@ -47,7 +48,7 @@ func (k Keeper) RemoveConflictVote( // GetAllConflictVote returns all conflictVote func (k Keeper) GetAllConflictVote(ctx sdk.Context) (list []types.ConflictVote) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ConflictVoteKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/conflict/keeper/grpc_query_conflict_vote.go b/x/conflict/keeper/grpc_query_conflict_vote.go index 567d4e7728..798e72118c 100644 --- a/x/conflict/keeper/grpc_query_conflict_vote.go +++ b/x/conflict/keeper/grpc_query_conflict_vote.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/lavanet/lava/v4/x/conflict/types" diff --git a/x/conflict/keeper/grpc_query_conflict_vote_test.go b/x/conflict/keeper/grpc_query_conflict_vote_test.go index 6ba799af4c..11b218be96 100644 --- a/x/conflict/keeper/grpc_query_conflict_vote_test.go +++ b/x/conflict/keeper/grpc_query_conflict_vote_test.go @@ -4,7 +4,6 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -20,7 +19,7 @@ var _ = strconv.IntSize func TestConflictVoteQuerySingle(t *testing.T) { keeper, ctx := keepertest.ConflictKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNConflictVote(keeper, ctx, 2) for _, tc := range []struct { desc string @@ -71,7 +70,7 @@ func TestConflictVoteQuerySingle(t *testing.T) { func TestConflictVoteQueryPaginated(t *testing.T) { keeper, ctx := keepertest.ConflictKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNConflictVote(keeper, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllConflictVoteRequest { diff --git a/x/conflict/keeper/grpc_query_consumer_conflicts_test.go b/x/conflict/keeper/grpc_query_consumer_conflicts_test.go index 4767b28bf8..99b4bde542 100644 --- a/x/conflict/keeper/grpc_query_consumer_conflicts_test.go +++ b/x/conflict/keeper/grpc_query_consumer_conflicts_test.go @@ -4,7 +4,6 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" @@ -15,7 +14,7 @@ var _ = strconv.IntSize func TestConsumerConflicts(t *testing.T) { keeper, ctx := keepertest.ConflictKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNConflictVote(keeper, ctx, 10) for i, msg := range msgs { msg.ClientAddress = "client" + strconv.Itoa(i%2) diff --git a/x/conflict/keeper/grpc_query_params_test.go b/x/conflict/keeper/grpc_query_params_test.go index 68ab699adc..0bb6a88a28 100644 --- a/x/conflict/keeper/grpc_query_params_test.go +++ b/x/conflict/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.ConflictKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/conflict/keeper/grpc_query_provider_conflicts_test.go b/x/conflict/keeper/grpc_query_provider_conflicts_test.go index db60ff297b..de9ed7c9f9 100644 --- a/x/conflict/keeper/grpc_query_provider_conflicts_test.go +++ b/x/conflict/keeper/grpc_query_provider_conflicts_test.go @@ -4,7 +4,6 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" keepertest "github.com/lavanet/lava/v4/testutil/keeper" @@ -16,7 +15,7 @@ var _ = strconv.IntSize func TestProviderConflicts(t *testing.T) { keeper, ctx := keepertest.ConflictKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNConflictVote(keeper, ctx, 8) const ( diff --git a/x/conflict/keeper/keeper.go b/x/conflict/keeper/keeper.go index 750d45e542..1a0477c2e9 100644 --- a/x/conflict/keeper/keeper.go +++ b/x/conflict/keeper/keeper.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/conflict/keeper/msg_server_detection_test.go b/x/conflict/keeper/msg_server_detection_test.go index c2348d0271..1376253563 100644 --- a/x/conflict/keeper/msg_server_detection_test.go +++ b/x/conflict/keeper/msg_server_detection_test.go @@ -4,7 +4,6 @@ import ( "testing" "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/common" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/utils/lavaslices" @@ -87,19 +86,19 @@ func TestDetection(t *testing.T) { ReplyData []byte Valid bool }{ - {"HappyFlow", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 0, 100, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), true}, - {"CuSumChange", ts.consumer, ts.providers[0], ts.providers[2], "", "", 0, "", []byte{}, 0, 0, 100, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), true}, - {"RelayNumChange", ts.consumer, ts.providers[0], ts.providers[3], "", "", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), true}, - {"SessionIDChange", ts.consumer, ts.providers[0], ts.providers[4], "", "", 0, "", []byte{}, 0, 0, 0, 1, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), true}, + {"HappyFlow", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 0, 100, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), true}, + {"CuSumChange", ts.consumer, ts.providers[0], ts.providers[2], "", "", 0, "", []byte{}, 0, 0, 100, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), true}, + {"RelayNumChange", ts.consumer, ts.providers[0], ts.providers[3], "", "", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), true}, + {"SessionIDChange", ts.consumer, ts.providers[0], ts.providers[4], "", "", 0, "", []byte{}, 0, 0, 0, 1, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), true}, {"QoSNil", ts.consumer, ts.providers[2], ts.providers[3], "", "", 0, "", []byte{}, 0, 0, 0, 0, nil, []byte("DIFF"), true}, - {"BadCreator", ts.providers[4], ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"BadConnectionType", ts.consumer, ts.providers[0], ts.providers[1], "DIFF", "", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"BadURL", ts.consumer, ts.providers[0], ts.providers[1], "", "DIFF", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"BadBlockHeight", ts.consumer, ts.providers[0], ts.providers[1], "", "", 10, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"BadChainID", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "DIFF", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"BadData", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte("DIFF"), 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"BadRequestBlock", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 10, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte("DIFF"), false}, - {"SameReplyData", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 10, 0, 0, 0, &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, []byte{}, false}, + {"BadCreator", ts.providers[4], ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"BadConnectionType", ts.consumer, ts.providers[0], ts.providers[1], "DIFF", "", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"BadURL", ts.consumer, ts.providers[0], ts.providers[1], "", "DIFF", 0, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"BadBlockHeight", ts.consumer, ts.providers[0], ts.providers[1], "", "", 10, "", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"BadChainID", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "DIFF", []byte{}, 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"BadData", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte("DIFF"), 0, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"BadRequestBlock", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 10, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte("DIFF"), false}, + {"SameReplyData", ts.consumer, ts.providers[0], ts.providers[1], "", "", 0, "", []byte{}, 10, 0, 0, 0, &types.QualityOfServiceReport{Latency: math.LegacyOneDec(), Availability: math.LegacyOneDec(), Sync: math.LegacyOneDec()}, []byte{}, false}, } for _, tt := range tests { diff --git a/x/conflict/keeper/msg_server_test.go b/x/conflict/keeper/msg_server_test.go index 3daa9219fb..62f095ea7a 100644 --- a/x/conflict/keeper/msg_server_test.go +++ b/x/conflict/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/conflict/keeper" "github.com/lavanet/lava/v4/x/conflict/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.ConflictKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/conflict/keeper/params.go b/x/conflict/keeper/params.go index 4cec8831ee..750791ee57 100644 --- a/x/conflict/keeper/params.go +++ b/x/conflict/keeper/params.go @@ -1,6 +1,7 @@ package keeper import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/conflict/types" ) @@ -21,7 +22,7 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { } // MajorityPercent returns the MajorityPercent param -func (k Keeper) MajorityPercent(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) MajorityPercent(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyMajorityPercent, &res) return } diff --git a/x/conflict/keeper/vote.go b/x/conflict/keeper/vote.go index 528a0909fa..493ed58fd3 100644 --- a/x/conflict/keeper/vote.go +++ b/x/conflict/keeper/vote.go @@ -16,7 +16,7 @@ const ( MajorityDiv = 2 // 50% - Can't be 0! ) -var SlashStakePercent = sdk.NewDecWithPrec(5, 2) // 0.05 +var SlashStakePercent = math.LegacyNewDecWithPrec(5, 2) // 0.05 func (k Keeper) AllocateNewConflictVote(ctx sdk.Context, key string) bool { _, found := k.GetConflictVote(ctx, key) @@ -52,12 +52,16 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV // if strong majority punish wrong providers - jail from start of memory to end + slash 100%stake // reward pool is the slashed amount from all punished providers // reward to stake - client 50%, the original provider 10%, 20% the voters - totalVotes := sdk.ZeroInt() - firstProviderVotes := sdk.ZeroInt() - secondProviderVotes := sdk.ZeroInt() - noneProviderVotes := sdk.ZeroInt() + totalVotes := math.ZeroInt() + firstProviderVotes := math.ZeroInt() + secondProviderVotes := math.ZeroInt() + noneProviderVotes := math.ZeroInt() var providersWithoutVote []string - rewardPool := sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return + } + rewardPool := sdk.NewCoin(bondDenom, math.ZeroInt()) rewardCount := math.ZeroInt() votersStake := map[string]math.Int{} // this is needed in order to give rewards for each voter according to their stake(so we dont take this data twice from the keeper) ConsensusVote := true @@ -113,8 +117,8 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV // punish providers that didnt vote providersWithoutVote = append(providersWithoutVote, vote.Address) bail := stake - bail.Quo(sdk.NewIntFromUint64(BailStakeDiv)) - err = k.pairingKeeper.JailEntry(ctx, vote.Address, conflictVote.ChainID, conflictVote.VoteStartBlock, blocksToSave, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), bail)) + bail.Quo(math.NewIntFromUint64(BailStakeDiv)) + err = k.pairingKeeper.JailEntry(ctx, vote.Address, conflictVote.ChainID, conflictVote.VoteStartBlock, blocksToSave, sdk.NewCoin(bondDenom, bail)) if err != nil { utils.LavaFormatWarning("jailing failed at vote conflict", err) // not skipping to continue to slash @@ -134,7 +138,7 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV eventData = append(eventData, utils.Attribute{Key: "SecondProviderVotes", Value: secondProviderVotes}) eventData = append(eventData, utils.Attribute{Key: "NoneProviderVotes", Value: noneProviderVotes}) - halfTotalVotes := totalVotes.Quo(sdk.NewIntFromUint64(MajorityDiv)) + halfTotalVotes := totalVotes.Quo(math.NewIntFromUint64(MajorityDiv)) majorityMet = firstProviderVotes.GT(halfTotalVotes) || secondProviderVotes.GT(halfTotalVotes) || noneProviderVotes.GT(halfTotalVotes) if majorityMet { eventName = types.ConflictVoteResolvedEventName @@ -162,14 +166,14 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV return } eventData = append(eventData, utils.Attribute{Key: "winner", Value: winnersAddr}) - eventData = append(eventData, utils.Attribute{Key: "winnerVotes%", Value: sdk.NewDecFromInt(winnerVotersStake).QuoInt(totalVotes)}) + eventData = append(eventData, utils.Attribute{Key: "winnerVotes%", Value: math.LegacyNewDecFromInt(winnerVotersStake).QuoInt(totalVotes)}) // punish the frauds(the provider that was found lying and all the voters that voted for him) and fill the reward pool // we need to finish the punishment before rewarding to fill up the reward pool - if ConsensusVote && sdk.NewDecFromInt(winnerVotersStake).QuoInt(totalVotes).GTE(k.MajorityPercent(ctx)) { + if ConsensusVote && math.LegacyNewDecFromInt(winnerVotersStake).QuoInt(totalVotes).GTE(k.MajorityPercent(ctx)) { for _, vote := range conflictVote.Votes { if vote.Result != winner && !slices.Contains(providersWithoutVote, vote.Address) { // punish those who voted wrong, voters that didnt vote already got punished - slashed, err := k.pairingKeeper.SlashEntry(ctx, vote.Address, conflictVote.ChainID, sdk.NewDecWithPrec(1, 0)) + slashed, err := k.pairingKeeper.SlashEntry(ctx, vote.Address, conflictVote.ChainID, math.LegacyNewDecWithPrec(1, 0)) rewardPool = rewardPool.Add(slashed) if err != nil { utils.LavaFormatWarning("slashing failed at vote conflict", err) @@ -218,7 +222,7 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV utils.Attribute{Key: "voteAddress", Value: winnersAddr}, ) } else { - ok, err := k.pairingKeeper.CreditStakeEntry(ctx, conflictVote.ChainID, accWinnerAddress, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), winnerReward.TruncateInt())) + ok, err := k.pairingKeeper.CreditStakeEntry(ctx, conflictVote.ChainID, accWinnerAddress, sdk.NewCoin(bondDenom, winnerReward.TruncateInt())) if !ok { utils.LavaFormatWarning("failed to credit client", err) } @@ -254,7 +258,7 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV ) continue } - ok, err := k.pairingKeeper.CreditStakeEntry(ctx, conflictVote.ChainID, accAddress, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), rewardVoter.TruncateInt())) + ok, err := k.pairingKeeper.CreditStakeEntry(ctx, conflictVote.ChainID, accAddress, sdk.NewCoin(bondDenom, rewardVoter.TruncateInt())) if !ok { details := map[string]string{} if err != nil { diff --git a/x/conflict/migrations/v5/migrations.go b/x/conflict/migrations/v5/migrations.go index fcc5f87818..77f10101a5 100644 --- a/x/conflict/migrations/v5/migrations.go +++ b/x/conflict/migrations/v5/migrations.go @@ -3,9 +3,9 @@ package v4 // migrations.go import ( "log" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/pairing/types" ) @@ -18,7 +18,7 @@ func DeleteOpenConflicts(ctx sdk.Context, storeKey storetypes.StoreKey, cdc code store := ctx.KVStore(storeKey) log.Println("@@@ REMOVING OLD STORAGE KEYS @@@") oldStore := prefix.NewStore(store, types.KeyPrefix(ConflictVoteKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(oldStore, []byte{}) + iterator := storetypes.KVStorePrefixIterator(oldStore, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { log.Printf("@@@ Key: %s @@@", string(iterator.Key())) diff --git a/x/conflict/module.go b/x/conflict/module.go index c63e49ecd0..a4b4962589 100644 --- a/x/conflict/module.go +++ b/x/conflict/module.go @@ -154,12 +154,20 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx) +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.BeginBlock(sdkCtx) + return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ sdk.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/conflict/module_simulation.go b/x/conflict/module_simulation.go index 43fea0d140..3aaf6fdb90 100644 --- a/x/conflict/module_simulation.go +++ b/x/conflict/module_simulation.go @@ -73,15 +73,18 @@ func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedPropo // } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) var weightMsgDetection int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDetection, &weightMsgDetection, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgDetection, + &weightMsgDetection, + simState.Rand, + func(r *rand.Rand) { weightMsgDetection = defaultWeightMsgDetection }, ) @@ -91,8 +94,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgConflictVoteCommit int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConflictVoteCommit, &weightMsgConflictVoteCommit, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgConflictVoteCommit, + &weightMsgConflictVoteCommit, + simState.Rand, + func(r *rand.Rand) { weightMsgConflictVoteCommit = defaultWeightMsgConflictVoteCommit }, ) @@ -102,8 +108,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgConflictVoteReveal int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConflictVoteReveal, &weightMsgConflictVoteReveal, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgConflictVoteReveal, + &weightMsgConflictVoteReveal, + simState.Rand, + func(r *rand.Rand) { weightMsgConflictVoteReveal = defaultWeightMsgConflictVoteReveal }, ) diff --git a/x/conflict/types/expected_keepers.go b/x/conflict/types/expected_keepers.go index 7190ebc54c..ef06bb6f94 100644 --- a/x/conflict/types/expected_keepers.go +++ b/x/conflict/types/expected_keepers.go @@ -1,8 +1,10 @@ package types import ( + context "context" + + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" projectstypes "github.com/lavanet/lava/v4/x/projects/types" spectypes "github.com/lavanet/lava/v4/x/spec/types" @@ -15,7 +17,7 @@ type PairingKeeper interface { VerifyPairingData(ctx sdk.Context, chainID string, block uint64) (epoch uint64, providersType spectypes.Spec_ProvidersTypes, errorRet error) JailEntry(ctx sdk.Context, address string, chainID string, jailStartBlock, jailBlocks uint64, bail sdk.Coin) error BailEntry(ctx sdk.Context, address string, chainID string, bail sdk.Coin) error - SlashEntry(ctx sdk.Context, address string, chainID string, percentage sdk.Dec) (sdk.Coin, error) + SlashEntry(ctx sdk.Context, address string, chainID string, percentage math.LegacyDec) (sdk.Coin, error) GetProjectData(ctx sdk.Context, developerKey sdk.AccAddress, chainID string, blockHeight uint64) (proj projectstypes.Project, errRet error) ValidatePairingForClient(ctx sdk.Context, chainID string, providerAddress sdk.AccAddress, reqEpoch uint64, project projectstypes.Project) (isValidPairing bool, allowedCU uint64, pairedProviders []epochstoragetypes.StakeEntry, errorRet error) } @@ -41,16 +43,16 @@ type SpecKeeper interface { // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } type StakingKeeper interface { - BondDenom(ctx sdk.Context) string + BondDenom(ctx context.Context) (string, error) } diff --git a/x/conflict/types/message_conflict_vote_commit.go b/x/conflict/types/message_conflict_vote_commit.go index cd9b235055..949ac10be8 100644 --- a/x/conflict/types/message_conflict_vote_commit.go +++ b/x/conflict/types/message_conflict_vote_commit.go @@ -26,19 +26,6 @@ func (msg *MsgConflictVoteCommit) Type() string { return TypeMsgConflictVoteCommit } -func (msg *MsgConflictVoteCommit) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgConflictVoteCommit) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgConflictVoteCommit) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/conflict/types/message_conflict_vote_reveal.go b/x/conflict/types/message_conflict_vote_reveal.go index 05c28db90b..2572e487b4 100644 --- a/x/conflict/types/message_conflict_vote_reveal.go +++ b/x/conflict/types/message_conflict_vote_reveal.go @@ -27,19 +27,6 @@ func (msg *MsgConflictVoteReveal) Type() string { return TypeMsgConflictVoteReveal } -func (msg *MsgConflictVoteReveal) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgConflictVoteReveal) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgConflictVoteReveal) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/conflict/types/message_detection.go b/x/conflict/types/message_detection.go index f3869223f6..fef250c2c7 100644 --- a/x/conflict/types/message_detection.go +++ b/x/conflict/types/message_detection.go @@ -36,19 +36,6 @@ func (msg *MsgDetection) Type() string { return TypeMsgDetection } -func (msg *MsgDetection) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgDetection) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgDetection) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/conflict/types/params.go b/x/conflict/types/params.go index 176be90821..a66aa92161 100644 --- a/x/conflict/types/params.go +++ b/x/conflict/types/params.go @@ -3,7 +3,7 @@ package types import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) @@ -11,8 +11,8 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) var ( - KeyMajorityPercent = []byte("MajorityPercent") - DefaultMajorityPercent sdk.Dec = sdk.NewDecWithPrec(95, 2) + KeyMajorityPercent = []byte("MajorityPercent") + DefaultMajorityPercent math.LegacyDec = math.LegacyNewDecWithPrec(95, 2) ) var ( @@ -27,7 +27,7 @@ var ( var ( KeyRewards = []byte("WinnerRewardPercent") - DefaultRewards Rewards = Rewards{WinnerRewardPercent: sdk.NewDecWithPrec(15, 2), ClientRewardPercent: sdk.NewDecWithPrec(10, 2), VotersRewardPercent: sdk.NewDecWithPrec(15, 2)} + DefaultRewards Rewards = Rewards{WinnerRewardPercent: math.LegacyNewDecWithPrec(15, 2), ClientRewardPercent: math.LegacyNewDecWithPrec(10, 2), VotersRewardPercent: math.LegacyNewDecWithPrec(15, 2)} ) // ParamKeyTable the param key table for launch module @@ -37,7 +37,7 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams( - majorityPercent sdk.Dec, voteStartSpan, votePeriod uint64, rewards Rewards, + majorityPercent math.LegacyDec, voteStartSpan, votePeriod uint64, rewards Rewards, ) Params { return Params{ MajorityPercent: majorityPercent, @@ -96,12 +96,12 @@ func (p Params) String() string { // validateMajorityPercent validates the majorityPercent param func validateMajorityPercent(v interface{}) error { - majorityPercent, ok := v.(sdk.Dec) + majorityPercent, ok := v.(math.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", v) } - if majorityPercent.GT(sdk.OneDec()) || majorityPercent.LT(sdk.ZeroDec()) { + if majorityPercent.GT(math.LegacyOneDec()) || majorityPercent.LT(math.LegacyZeroDec()) { return fmt.Errorf("invalid parameter majorityPercent") } @@ -142,19 +142,19 @@ func validateRewards(v interface{}) error { return fmt.Errorf("invalid parameter type: %T", v) } - if rewards.ClientRewardPercent.GT(sdk.OneDec()) || rewards.ClientRewardPercent.LT(sdk.ZeroDec()) { + if rewards.ClientRewardPercent.GT(math.LegacyOneDec()) || rewards.ClientRewardPercent.LT(math.LegacyZeroDec()) { return fmt.Errorf("invalid parameter ClientRewardPercent") } - if rewards.VotersRewardPercent.GT(sdk.OneDec()) || rewards.VotersRewardPercent.LT(sdk.ZeroDec()) { + if rewards.VotersRewardPercent.GT(math.LegacyOneDec()) || rewards.VotersRewardPercent.LT(math.LegacyZeroDec()) { return fmt.Errorf("invalid parameter VotersRewardPercent") } - if rewards.WinnerRewardPercent.GT(sdk.OneDec()) || rewards.WinnerRewardPercent.LT(sdk.ZeroDec()) { + if rewards.WinnerRewardPercent.GT(math.LegacyOneDec()) || rewards.WinnerRewardPercent.LT(math.LegacyZeroDec()) { return fmt.Errorf("invalid parameter WinnerRewardPercent") } - if rewards.ClientRewardPercent.Add(rewards.VotersRewardPercent).Add(rewards.WinnerRewardPercent).GT(sdk.OneDec()) { + if rewards.ClientRewardPercent.Add(rewards.VotersRewardPercent).Add(rewards.WinnerRewardPercent).GT(math.LegacyOneDec()) { return fmt.Errorf("sum of all rewards is bigger than 100 percent") } diff --git a/x/conflict/types/params.pb.go b/x/conflict/types/params.pb.go index 141808cbf3..19d6b75131 100644 --- a/x/conflict/types/params.pb.go +++ b/x/conflict/types/params.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -26,10 +26,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - MajorityPercent github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=majorityPercent,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"majorityPercent" yaml:"majority_percent"` - VoteStartSpan uint64 `protobuf:"varint,2,opt,name=voteStartSpan,proto3" json:"voteStartSpan,omitempty"` - VotePeriod uint64 `protobuf:"varint,3,opt,name=votePeriod,proto3" json:"votePeriod,omitempty"` - Rewards Rewards `protobuf:"bytes,4,opt,name=Rewards,proto3" json:"Rewards"` + MajorityPercent cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=majorityPercent,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"majorityPercent" yaml:"majority_percent"` + VoteStartSpan uint64 `protobuf:"varint,2,opt,name=voteStartSpan,proto3" json:"voteStartSpan,omitempty"` + VotePeriod uint64 `protobuf:"varint,3,opt,name=votePeriod,proto3" json:"votePeriod,omitempty"` + Rewards Rewards `protobuf:"bytes,4,opt,name=Rewards,proto3" json:"Rewards"` } func (m *Params) Reset() { *m = Params{} } @@ -86,9 +86,9 @@ func (m *Params) GetRewards() Rewards { } type Rewards struct { - WinnerRewardPercent github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=winnerRewardPercent,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"winnerRewardPercent" yaml:"winner_reward_percent"` - ClientRewardPercent github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=clientRewardPercent,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"clientRewardPercent" yaml:"client_reward_percent"` - VotersRewardPercent github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=votersRewardPercent,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"votersRewardPercent" yaml:"voters_reward_percent"` + WinnerRewardPercent cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=winnerRewardPercent,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"winnerRewardPercent" yaml:"winner_reward_percent"` + ClientRewardPercent cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=clientRewardPercent,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"clientRewardPercent" yaml:"client_reward_percent"` + VotersRewardPercent cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=votersRewardPercent,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"votersRewardPercent" yaml:"voters_reward_percent"` } func (m *Rewards) Reset() { *m = Rewards{} } @@ -134,32 +134,32 @@ func init() { } var fileDescriptor_a921a7b735ec6ed8 = []byte{ - // 388 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc9, 0xf9, 0x79, 0x69, 0x39, 0x99, 0xc9, 0x25, 0xfa, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xa2, 0x50, 0x35, - 0x7a, 0x20, 0x5a, 0x0f, 0xa6, 0x46, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xac, 0x42, 0x1f, 0xc4, - 0x82, 0x28, 0x56, 0xea, 0x64, 0xe2, 0x62, 0x0b, 0x00, 0xeb, 0x16, 0x2a, 0xe6, 0xe2, 0xcf, 0x4d, - 0xcc, 0xca, 0x2f, 0xca, 0x2c, 0xa9, 0x0c, 0x48, 0x2d, 0x4a, 0x4e, 0xcd, 0x2b, 0x91, 0x60, 0x54, - 0x60, 0xd4, 0xe0, 0x74, 0xf2, 0x3c, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, 0x3d, 0x79, 0xb5, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xe4, 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0x28, - 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0xac, 0xe7, 0x92, 0x9a, 0xfc, 0xe9, - 0x9e, 0xbc, 0x78, 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0xcc, 0xb8, 0xf8, 0x02, 0x88, 0x79, 0x4a, - 0x41, 0xe8, 0x36, 0x08, 0xa9, 0x70, 0xf1, 0x96, 0xe5, 0x97, 0xa4, 0x06, 0x97, 0x24, 0x16, 0x95, - 0x04, 0x17, 0x24, 0xe6, 0x49, 0x30, 0x29, 0x30, 0x6a, 0xb0, 0x04, 0xa1, 0x0a, 0x0a, 0xc9, 0x71, - 0x71, 0x81, 0x04, 0x02, 0x52, 0x8b, 0x32, 0xf3, 0x53, 0x24, 0x98, 0xc1, 0x4a, 0x90, 0x44, 0x84, - 0xec, 0xb8, 0xd8, 0x83, 0x52, 0xcb, 0x13, 0x8b, 0x52, 0x8a, 0x25, 0x58, 0x14, 0x18, 0x35, 0xb8, - 0x8d, 0xe4, 0xf4, 0xb0, 0x06, 0x82, 0x1e, 0x54, 0x95, 0x13, 0x0b, 0xc8, 0x4b, 0x41, 0x30, 0x4d, - 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x28, 0x4d, 0x62, 0x86, 0x1b, 0x23, 0xd4, 0xc0, 0xc8, 0x25, - 0x5c, 0x9e, 0x99, 0x97, 0x97, 0x5a, 0x04, 0x11, 0x41, 0x0d, 0x11, 0x3f, 0x92, 0x43, 0x44, 0x06, - 0x12, 0x22, 0x10, 0x23, 0xe3, 0x8b, 0xc0, 0x66, 0x22, 0x82, 0x05, 0x9b, 0x55, 0x60, 0x27, 0x24, - 0xe7, 0x64, 0xa6, 0xe6, 0x95, 0xa0, 0x3a, 0x81, 0x89, 0x32, 0x27, 0x40, 0x8c, 0xc4, 0x74, 0x02, - 0x16, 0xab, 0xc0, 0x4e, 0x00, 0x05, 0x73, 0x51, 0x31, 0xaa, 0x13, 0x98, 0x29, 0x73, 0x02, 0xc4, - 0x48, 0x4c, 0x27, 0x60, 0xb1, 0xca, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, - 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, - 0x18, 0xa2, 0xb4, 0x91, 0xac, 0x45, 0xc9, 0x16, 0x65, 0x26, 0xfa, 0x15, 0x88, 0xbc, 0x01, 0xb6, - 0x3f, 0x89, 0x0d, 0x9c, 0xdc, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x23, 0x44, 0xe2, - 0x41, 0x03, 0x00, 0x00, + // 389 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x6b, 0xe3, 0x30, + 0x18, 0x86, 0xad, 0xc4, 0xe4, 0x38, 0x1d, 0xc7, 0x81, 0xef, 0x8e, 0x33, 0x77, 0x87, 0x1c, 0x4c, + 0x87, 0x40, 0x41, 0x86, 0xb6, 0x53, 0x86, 0x0c, 0x69, 0xbb, 0x75, 0x08, 0xce, 0xd6, 0x25, 0x28, + 0x8a, 0xea, 0xb8, 0xb5, 0x2d, 0x23, 0x2b, 0x49, 0xfd, 0x2f, 0x3a, 0x76, 0xec, 0xcf, 0xc9, 0x98, + 0xb1, 0x74, 0x08, 0x25, 0xd9, 0x3b, 0xf4, 0x07, 0x94, 0x22, 0x3b, 0x69, 0xea, 0xc6, 0x43, 0xc9, + 0x24, 0xf1, 0xf1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 0xfd, 0x54, 0x79, 0xc3, 0x18, 0x23, + 0xf8, 0x73, 0xe2, 0x47, 0x11, 0x13, 0xf9, 0xa0, 0xd8, 0xc2, 0xf1, 0xe7, 0x5a, 0xf8, 0x9f, 0xb7, + 0x90, 0x73, 0x7a, 0x22, 0x03, 0x6d, 0xaa, 0x28, 0xe3, 0x2b, 0x2d, 0x0d, 0x7c, 0x16, 0xc9, 0xa2, + 0xb6, 0xb2, 0x83, 0x36, 0xe7, 0x6c, 0x6b, 0x4b, 0xf8, 0x4a, 0xab, 0xda, 0x14, 0x49, 0x51, 0x5b, + 0xdd, 0x41, 0x9b, 0x73, 0xb6, 0xb5, 0x25, 0xfc, 0xf6, 0xe9, 0x74, 0x81, 0xc0, 0x6c, 0x81, 0xc0, + 0xe3, 0x02, 0x81, 0x9b, 0x25, 0xd2, 0x66, 0x4b, 0xa4, 0xdd, 0x2f, 0x91, 0x76, 0xbe, 0xef, 0xf9, + 0x72, 0x38, 0xea, 0x63, 0xca, 0x43, 0xa7, 0xb0, 0xe7, 0xe3, 0x23, 0xe7, 0x7a, 0xb3, 0xec, 0x32, + 0x8d, 0x59, 0xd2, 0xaf, 0x65, 0xfb, 0x7b, 0xf8, 0x1a, 0x00, 0x00, 0xff, 0xff, 0x50, 0x07, 0x3f, + 0xa8, 0x12, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/conflict/types/query.pb.go b/x/conflict/types/query.pb.go index e3392bfeb3..45137f3615 100644 --- a/x/conflict/types/query.pb.go +++ b/x/conflict/types/query.pb.go @@ -756,6 +756,7 @@ func _Query_ProviderConflicts_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.conflict.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/conflict/types/tx.pb.go b/x/conflict/types/tx.pb.go index b2f90f875e..f3ecd102ba 100644 --- a/x/conflict/types/tx.pb.go +++ b/x/conflict/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -372,39 +373,40 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/conflict/tx.proto", fileDescriptor_8d098f1e58e895a1) } var fileDescriptor_8d098f1e58e895a1 = []byte{ - // 502 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0x8e, 0x63, 0x37, 0xa4, 0x47, 0x87, 0xf4, 0x94, 0x14, 0x2b, 0x08, 0x13, 0x85, 0x81, 0x40, - 0x90, 0x4f, 0x2d, 0x9d, 0x3a, 0xb6, 0x05, 0x41, 0xa4, 0x2c, 0x1e, 0x3a, 0x20, 0xa1, 0xea, 0x6c, - 0x2e, 0x8e, 0xa5, 0xf8, 0x5e, 0xe4, 0x3b, 0xac, 0xc0, 0xc2, 0xce, 0xc4, 0xc2, 0xc4, 0x3f, 0xc1, - 0x9f, 0xc1, 0xd8, 0xb1, 0x23, 0x4a, 0x06, 0xfe, 0x0d, 0xe4, 0x1f, 0xe7, 0xba, 0xc4, 0x41, 0x81, - 0x25, 0xf7, 0xee, 0xbd, 0x2f, 0xdf, 0xf7, 0xdd, 0x7b, 0xd6, 0x43, 0xd6, 0x8c, 0xc6, 0x94, 0x33, - 0x49, 0x92, 0x93, 0x78, 0xc0, 0x27, 0xb3, 0xc0, 0x93, 0x44, 0x2e, 0xec, 0x79, 0x04, 0x12, 0x70, - 0x27, 0xaf, 0xdb, 0xc9, 0x69, 0xab, 0x7a, 0x77, 0x9f, 0x86, 0x01, 0x07, 0x92, 0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 0x00, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xb0, - 0xfd, 0x79, 0xe6, 0x04, 0x00, 0x00, + // 520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0x8e, 0x13, 0x27, 0xa4, 0x47, 0x87, 0xf4, 0x94, 0x14, 0x2b, 0x08, 0x13, 0xa5, 0x03, 0xa1, + 0xa9, 0x7c, 0x4a, 0xe9, 0xd4, 0xb1, 0x2d, 0x08, 0x22, 0x65, 0xf1, 0xd0, 0x01, 0x09, 0x55, 0x67, + 0x73, 0x71, 0x2c, 0xc5, 0x77, 0x91, 0xef, 0xb0, 0x02, 0x23, 0x23, 0x2c, 0xfc, 0x05, 0x26, 0xd6, + 0xfe, 0x0c, 0xc6, 0x8e, 0x1d, 0x51, 0x32, 0xf4, 0x6f, 0x20, 0xdb, 0x77, 0xae, 0xdb, 0x38, 0x28, + 0x65, 0xf1, 0xbd, 0x7b, 0xef, 0xf3, 0xfb, 0xbe, 0xef, 0xdd, 0xe9, 0x80, 0x39, 0xc5, 0x11, 0xa6, + 0x44, 0xa0, 0x78, 0x45, 0x2e, 0xa3, 0xe3, 0xa9, 0xef, 0x0a, 0x24, 0xe6, 0xd6, 0x2c, 0x64, 0x82, + 0xc1, 0x96, 0xac, 0x5b, 0xf1, 0x6a, 0xa9, 0x7a, 0x7b, 0x07, 0x07, 0x3e, 0x65, 0x28, 0xf9, 0xa6, + 0xc8, 0xf6, 0x13, 0x97, 0xf1, 0x80, 0x71, 0x14, 0x70, 0x0f, 0x45, 0x83, 0x78, 0x91, 0x05, 0x53, + 0x16, 0x1c, 0xcc, 0x09, 0x8a, 0x06, 0x0e, 0x11, 0x78, 0x80, 0x5c, 0xe6, 0x53, 0x59, 0x6f, 0x7a, + 0xcc, 0x63, 0x49, 0x88, 0xe2, 0x48, 0x66, 0x5f, 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xeb, 0x6d, 0xdb, + 0x49, 0x7c, 0x7c, 0x70, 0x5f, 0xfa, 0xd3, 0x4c, 0xfa, 0x2a, 0x67, 0xf7, 0x39, 0x78, 0x56, 0x28, + 0x26, 0x93, 0xfb, 0x73, 0x55, 0xae, 0x4d, 0x22, 0x82, 0xa7, 0xff, 0x21, 0xb7, 0x09, 0xaa, 0x94, + 0x51, 0x97, 0x24, 0x7a, 0x2b, 0x76, 0xba, 0xc9, 0x4c, 0xe8, 0x0f, 0x37, 0x91, 0x2a, 0x29, 0x30, + 0x91, 0x16, 0x94, 0x89, 0xc3, 0xeb, 0x32, 0xa8, 0x8c, 0xb8, 0x07, 0x3f, 0x80, 0xad, 0xdb, 0x9b, + 0xbb, 0xb7, 0xe6, 0x82, 0xe4, 0x4f, 0xad, 0xdd, 0xdf, 0x00, 0xa4, 0x68, 0xe0, 0x1c, 0xc0, 0x82, + 0x63, 0x3d, 0x58, 0xdf, 0x62, 0x15, 0xdd, 0x3e, 0x7a, 0x08, 0x7a, 0x1d, 0xb3, 0x3c, 0xa1, 0x0d, + 0x99, 0x53, 0xf4, 0xa6, 0xcc, 0x77, 0x47, 0x7b, 0xf2, 0xfa, 0xf7, 0xc2, 0xd4, 0xae, 0x16, 0xa6, + 0xf6, 0x67, 0x61, 0x6a, 0x3f, 0x96, 0x66, 0xe9, 0x6a, 0x69, 0x96, 0xae, 0x97, 0x66, 0xe9, 0x7d, + 0xdf, 0xf3, 0xc5, 0xe4, 0x93, 0x63, 0xb9, 0x2c, 0x40, 0x77, 0x1e, 0x98, 0xe8, 0x08, 0xcd, 0x73, + 0xcf, 0xdf, 0xe7, 0x19, 0xe1, 0x4e, 0x2d, 0x79, 0x5e, 0x5e, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, + 0xb9, 0xfd, 0x30, 0x92, 0x24, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -538,6 +540,7 @@ func _Msg_ConflictVoteReveal_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.conflict.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/downtime/keeper/keeper.go b/x/downtime/keeper/keeper.go index 096953e034..27eed8a2e2 100644 --- a/x/downtime/keeper/keeper.go +++ b/x/downtime/keeper/keeper.go @@ -4,7 +4,7 @@ import ( "math" "time" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/downtime/keeper/query_server_test.go b/x/downtime/keeper/query_server_test.go index f137dc2fb0..283b5cf67a 100644 --- a/x/downtime/keeper/query_server_test.go +++ b/x/downtime/keeper/query_server_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/app" "github.com/lavanet/lava/v4/x/downtime/keeper" v1 "github.com/lavanet/lava/v4/x/downtime/v1" @@ -41,7 +40,7 @@ func TestQueryServer_QueryDowntime(t *testing.T) { dk.SetDowntime(ctx, downtime.Block, downtime.Duration) t.Run("ok", func(t *testing.T) { - resp, err := qs.QueryDowntime(sdk.WrapSDKContext(ctx), &v1.QueryDowntimeRequest{ + resp, err := qs.QueryDowntime(ctx, &v1.QueryDowntimeRequest{ EpochStartBlock: uint64(1), }) require.NoError(t, err) @@ -59,7 +58,7 @@ func TestQueryServer_QueryParams(t *testing.T) { wantParams := v1.DefaultParams() dk.SetParams(ctx, wantParams) - resp, err := qs.QueryParams(sdk.WrapSDKContext(ctx), &v1.QueryParamsRequest{}) + resp, err := qs.QueryParams(ctx, &v1.QueryParamsRequest{}) require.NoError(t, err) require.Equal(t, &v1.QueryParamsResponse{Params: &wantParams}, resp) } diff --git a/x/downtime/module.go b/x/downtime/module.go index 67657f655b..5f3424d395 100644 --- a/x/downtime/module.go +++ b/x/downtime/module.go @@ -101,6 +101,14 @@ func (a AppModule) RegisterServices(configurator module.Configurator) { func (a AppModule) ConsensusVersion() uint64 { return ConsensusVersion } -func (a AppModule) BeginBlock(context sdk.Context, _ abci.RequestBeginBlock) { - a.k.BeginBlock(context) +func (a AppModule) BeginBlock(context context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(context) + a.k.BeginBlock(sdkCtx) + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/downtime/v1/query.pb.go b/x/downtime/v1/query.pb.go index f54cfb7e20..9b0f18f686 100644 --- a/x/downtime/v1/query.pb.go +++ b/x/downtime/v1/query.pb.go @@ -344,6 +344,7 @@ func _Query_QueryDowntime_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.downtime.v1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/dualstaking/ante/disable_redelegation_hooks_test.go b/x/dualstaking/ante/disable_redelegation_hooks_test.go index dee3f2f0f2..cd24d83b7e 100644 --- a/x/dualstaking/ante/disable_redelegation_hooks_test.go +++ b/x/dualstaking/ante/disable_redelegation_hooks_test.go @@ -1,8 +1,10 @@ package ante_test import ( + "fmt" "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -10,6 +12,7 @@ import ( commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/lavanet/lava/v4/x/dualstaking/ante" "github.com/stretchr/testify/require" + protov2 "google.golang.org/protobuf/proto" ) // TestDisableRedelegationHooks verifies that the DisableRedelegationHooks works as expected, i.e. disables @@ -39,26 +42,26 @@ func TestDisableRedelegationHooks(t *testing.T) { func newStakingRedelegateMsg() *stakingtypes.MsgBeginRedelegate { return stakingtypes.NewMsgBeginRedelegate( - sdk.AccAddress("del1"), - sdk.ValAddress("val1"), - sdk.ValAddress("val2"), - sdk.NewCoin(commontypes.TokenDenom, sdk.OneInt()), + sdk.AccAddress("del1").String(), + sdk.ValAddress("val1").String(), + sdk.ValAddress("val2").String(), + sdk.NewCoin(commontypes.TokenDenom, math.OneInt()), ) } func newStakingDelegateMsg() *stakingtypes.MsgDelegate { return stakingtypes.NewMsgDelegate( - sdk.AccAddress("del1"), - sdk.ValAddress("val1"), - sdk.NewCoin(commontypes.TokenDenom, sdk.OneInt()), + sdk.AccAddress("del1").String(), + sdk.ValAddress("val1").String(), + sdk.NewCoin(commontypes.TokenDenom, math.OneInt()), ) } func newStakingUndelegateMsg() *stakingtypes.MsgUndelegate { return stakingtypes.NewMsgUndelegate( - sdk.AccAddress("del1"), - sdk.ValAddress("val1"), - sdk.NewCoin(commontypes.TokenDenom, sdk.OneInt()), + sdk.AccAddress("del1").String(), + sdk.ValAddress("val1").String(), + sdk.NewCoin(commontypes.TokenDenom, math.OneInt()), ) } @@ -78,3 +81,15 @@ func (tmock TxMock) GetMsgs() []sdk.Msg { func (tmock TxMock) ValidateBasic() error { return nil } + +func (tmock TxMock) GetMsgsV2() ([]protov2.Message, error) { + msgs := make([]protov2.Message, len(tmock.msgs)) + for i, msg := range tmock.msgs { + protoMsg, ok := msg.(protov2.Message) + if !ok { + return nil, fmt.Errorf("message %T does not implement protov2.Message", msg) + } + msgs[i] = protoMsg + } + return msgs, nil +} diff --git a/x/dualstaking/handler.go b/x/dualstaking/handler.go deleted file mode 100644 index 0146f5a5b6..0000000000 --- a/x/dualstaking/handler.go +++ /dev/null @@ -1,39 +0,0 @@ -package dualstaking - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/dualstaking/keeper" - "github.com/lavanet/lava/v4/x/dualstaking/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - _ = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgDelegate: - res, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRedelegate: - res, err := msgServer.Redelegate(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUnbond: - res, err := msgServer.Unbond(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgClaimRewards: - res, err := msgServer.ClaimRewards(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/dualstaking/keeper/balance.go b/x/dualstaking/keeper/balance.go index 236a61978e..dd509df17c 100644 --- a/x/dualstaking/keeper/balance.go +++ b/x/dualstaking/keeper/balance.go @@ -12,19 +12,23 @@ func (k Keeper) BalanceDelegator(ctx sdk.Context, delegator sdk.AccAddress) (int return providers, err } + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return providers, err + } // if diff is zero, do nothing, this is a redelegate if diff.IsZero() { return providers, nil } else if diff.IsPositive() { // less provider delegations,a delegation operation was done, delegate to empty provider err = k.Delegate(ctx, delegator.String(), commontypes.EMPTY_PROVIDER, - sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), diff), false) + sdk.NewCoin(bondDenom, diff), false) if err != nil { return providers, err } } else if diff.IsNegative() { // more provider delegation, unbond operation was done, unbond from providers - err = k.UnbondUniformProviders(ctx, delegator.String(), sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), diff.Neg())) + err = k.UnbondUniformProviders(ctx, delegator.String(), sdk.NewCoin(bondDenom, diff.Neg())) if err != nil { return providers, err } diff --git a/x/dualstaking/keeper/delegate.go b/x/dualstaking/keeper/delegate.go index dfa1057876..dfb735109a 100644 --- a/x/dualstaking/keeper/delegate.go +++ b/x/dualstaking/keeper/delegate.go @@ -33,11 +33,15 @@ import ( // given chain. It updates the fixation stores for both delegations and delegators, // and updates the (epochstorage) stake-entry. func (k Keeper) increaseDelegation(ctx sdk.Context, delegator, provider string, amount sdk.Coin, stake bool) error { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } // get, update the delegation entry delegation, err := k.delegations.Get(ctx, types.DelegationKey(provider, delegator)) if err != nil { // new delegation (i.e. not increase of existing one) - delegation = types.NewDelegation(delegator, provider, ctx.BlockTime(), k.stakingKeeper.BondDenom(ctx)) + delegation = types.NewDelegation(delegator, provider, ctx.BlockTime(), bondDenom) } delegation.AddAmount(amount) @@ -93,6 +97,10 @@ func (k Keeper) decreaseDelegation(ctx sdk.Context, delegator, provider string, // this method is called after a delegation is called and redistributes the delegations among the stake entries of the provider. // 'stake' arg needs to be true if the code reached here from pairing stake/unstake tx (this means the 'stake' field is already set) func (k Keeper) AfterDelegationModified(ctx sdk.Context, delegator, provider string, amount sdk.Coin, increase, stake bool) (err error) { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } // get all entries metadata, err := k.epochstorageKeeper.GetMetadata(ctx, provider) if err != nil { @@ -105,7 +113,7 @@ func (k Keeper) AfterDelegationModified(ctx sdk.Context, delegator, provider str } // get all entries - TotalSelfDelegation := sdk.ZeroInt() + TotalSelfDelegation := math.ZeroInt() entries := []*epochstoragetypes.StakeEntry{} for _, chain := range metadata.Chains { entry, found := k.epochstorageKeeper.GetStakeEntryCurrent(ctx, chain, provider) @@ -160,7 +168,7 @@ func (k Keeper) AfterDelegationModified(ctx sdk.Context, delegator, provider str for _, entry := range entries { details[entry.Chain] = entry.Chain - entry.DelegateTotal = sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), metadata.TotalDelegations.Amount.Mul(entry.Stake.Amount).Quo(TotalSelfDelegation)) + entry.DelegateTotal = sdk.NewCoin(bondDenom, metadata.TotalDelegations.Amount.Mul(entry.Stake.Amount).Quo(TotalSelfDelegation)) if entry.TotalStake().LT(k.specKeeper.GetMinStake(ctx, entry.Chain).Amount) { details["min_spec_stake"] = k.specKeeper.GetMinStake(ctx, entry.Chain).String() details["stake"] = entry.TotalStake().String() @@ -192,7 +200,11 @@ func (k Keeper) Delegate(ctx sdk.Context, delegator, provider string, amount sdk } } - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), amount, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if err := utils.ValidateCoins(ctx, bondDenom, amount, false); err != nil { return utils.LavaFormatWarning("failed to delegate: coin validation failed", err, utils.Attribute{Key: "delegator", Value: delegator}, utils.Attribute{Key: "provider", Value: provider}, @@ -237,14 +249,18 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to string, amount s } } - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), amount, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if err := utils.ValidateCoins(ctx, bondDenom, amount, false); err != nil { return utils.LavaFormatWarning("failed to redelegate: coin validation failed", err, utils.Attribute{Key: "delegator", Value: delegator}, utils.Attribute{Key: "provider", Value: to}, ) } - err := k.increaseDelegation(ctx, delegator, to, amount, stake) + err = k.increaseDelegation(ctx, delegator, to, amount, stake) if err != nil { return utils.LavaFormatWarning("failed to increase delegation", err, utils.Attribute{Key: "delegator", Value: delegator}, @@ -288,14 +304,18 @@ func (k Keeper) unbond(ctx sdk.Context, delegator, provider string, amount sdk.C } } - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), amount, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if err := utils.ValidateCoins(ctx, bondDenom, amount, false); err != nil { return utils.LavaFormatWarning("failed to unbond: coin validation failed", err, utils.Attribute{Key: "delegator", Value: delegator}, utils.Attribute{Key: "provider", Value: provider}, ) } - err := k.decreaseDelegation(ctx, delegator, provider, amount, stake) + err = k.decreaseDelegation(ctx, delegator, provider, amount, stake) if err != nil { return utils.LavaFormatWarning("failed to decrease delegation", err, utils.Attribute{Key: "delegator", Value: delegator}, @@ -406,8 +426,11 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount } } - slices.SortFunc(delegations, func(i, j types.Delegation) bool { - return i.Amount.IsLT(j.Amount) + slices.SortFunc(delegations, func(i, j types.Delegation) int { + if i.Amount.IsLTE(j.Amount) { + return -1 + } + return 1 }) unbondAmount := map[string]sdk.Coin{} @@ -417,7 +440,7 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount if delegations[i].Amount.Amount.LT(amountToDeduct) { unbondAmount[delegations[i].Provider] = delegations[i].Amount amount = amount.Sub(delegations[i].Amount) - delegations[i].Amount.Amount = sdk.ZeroInt() + delegations[i].Amount.Amount = math.ZeroInt() } else { coinToDeduct := sdk.NewCoin(delegations[i].Amount.Denom, amountToDeduct) unbondAmount[delegations[i].Provider] = coinToDeduct @@ -460,7 +483,7 @@ func (k Keeper) VerifyDelegatorBalance(ctx sdk.Context, delAddr sdk.AccAddress) return math.ZeroInt(), 0, err } - sumProviderDelegations := sdk.ZeroInt() + sumProviderDelegations := math.ZeroInt() for _, p := range providers { d, found := k.GetDelegation(ctx, p, delAddr.String()) if found { @@ -468,11 +491,18 @@ func (k Keeper) VerifyDelegatorBalance(ctx sdk.Context, delAddr sdk.AccAddress) } } - sumValidatorDelegations := sdk.ZeroInt() - delegations := k.stakingKeeper.GetAllDelegatorDelegations(ctx, delAddr) + sumValidatorDelegations := math.ZeroInt() + delegations, err := k.stakingKeeper.GetAllDelegatorDelegations(ctx, delAddr) + if err != nil { + return math.ZeroInt(), 0, err + } for _, d := range delegations { - v, found := k.stakingKeeper.GetValidator(ctx, d.GetValidatorAddr()) - if found { + valaddr, err := sdk.ValAddressFromBech32(d.GetValidatorAddr()) + if err != nil { + continue + } + v, err := k.stakingKeeper.GetValidator(ctx, valaddr) + if err == nil { sumValidatorDelegations = sumValidatorDelegations.Add(v.TokensFromSharesRoundUp(d.Shares).Ceil().TruncateInt()) } } diff --git a/x/dualstaking/keeper/delegate_test.go b/x/dualstaking/keeper/delegate_test.go index eed57be7d6..4b2392718c 100644 --- a/x/dualstaking/keeper/delegate_test.go +++ b/x/dualstaking/keeper/delegate_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -var zeroCoin = sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) +var zeroCoin = sdk.NewCoin(commontypes.TokenDenom, math.ZeroInt()) func TestDelegateFail(t *testing.T) { ts := newTester(t) @@ -69,8 +69,8 @@ func TestDelegateFail(t *testing.T) { for _, tt := range template { t.Run(tt.name, func(t *testing.T) { - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) - amount.Amount = amount.Amount.Add(sdk.NewInt(tt.amount)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.ZeroInt()) + amount.Amount = amount.Amount.Add(math.NewInt(tt.amount)) _, err := ts.TxDualstakingDelegate(tt.delegator, tt.provider, amount) require.Error(t, err, tt.name) }) @@ -89,7 +89,7 @@ func TestDelegate(t *testing.T) { delegated := zeroCoin // delegate once - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(10000)) _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) // not yet in effect @@ -135,7 +135,7 @@ func TestRedelegateFail(t *testing.T) { _, provider4Addr := ts.GetAccount(common.PROVIDER, 3) // delegate once for setup - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(10000)) _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) @@ -207,8 +207,8 @@ func TestRedelegateFail(t *testing.T) { for _, tt := range template { t.Run(tt.name, func(t *testing.T) { - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) - amount.Amount = amount.Amount.Add(sdk.NewInt(tt.amount)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.ZeroInt()) + amount.Amount = amount.Amount.Add(math.NewInt(tt.amount)) _, err := ts.TxDualstakingRedelegate( tt.delegator, tt.provider1, tt.provider2, amount) require.Error(t, err, tt.name) @@ -230,7 +230,7 @@ func TestRedelegate(t *testing.T) { delegated2 := zeroCoin // delegate once - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(10000)) _, err := ts.TxDualstakingDelegate( client1Addr, provider1Addr, amount) require.NoError(t, err) @@ -245,7 +245,7 @@ func TestRedelegate(t *testing.T) { require.True(t, delegated2.IsEqual(stakeEntry2.DelegateTotal)) // redelegate once - amount = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(5000)) + amount = sdk.NewCoin(commontypes.TokenDenom, math.NewInt(5000)) _, err = ts.TxDualstakingRedelegate( client1Addr, provider1Addr, provider2Addr, amount) require.NoError(t, err) @@ -267,7 +267,7 @@ func TestRedelegate(t *testing.T) { require.NoError(t, err) // redelegate from unstaking provider - amount = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(5000)) + amount = sdk.NewCoin(commontypes.TokenDenom, math.NewInt(5000)) _, err = ts.TxDualstakingRedelegate(client1Addr, provider1Addr, provider2Addr, amount) require.NoError(t, err) // advance epoch to digest the delegate @@ -291,7 +291,7 @@ func TestUnbondFail(t *testing.T) { _, provider2Addr := ts.GetAccount(common.PROVIDER, 1) // delegate once for setup - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(10000)) _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) @@ -341,8 +341,8 @@ func TestUnbondFail(t *testing.T) { for _, tt := range template { t.Run(tt.name, func(t *testing.T) { - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) - amount.Amount = amount.Amount.Add(sdk.NewInt(tt.amount)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.ZeroInt()) + amount.Amount = amount.Amount.Add(math.NewInt(tt.amount)) _, err := ts.TxDualstakingUnbond(tt.delegator, tt.provider, amount) require.Error(t, err, tt.name) }) @@ -368,7 +368,7 @@ func TestUnbond(t *testing.T) { delegated := zeroCoin // delegate once - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(10000)) _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) @@ -387,7 +387,7 @@ func TestUnbond(t *testing.T) { require.Len(t, res.Delegations, 1) // unbond once - amount = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(1000)) + amount = sdk.NewCoin(commontypes.TokenDenom, math.NewInt(1000)) _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, amount) require.NoError(t, err) @@ -462,7 +462,7 @@ func TestBondUnbondBond(t *testing.T) { delegated := zeroCoin // delegate once - amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) + amount := sdk.NewCoin(commontypes.TokenDenom, math.NewInt(10000)) _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) @@ -503,7 +503,7 @@ func TestDualstakingUnbondStakeIsLowerThanMinStakeCausesFreeze(t *testing.T) { provider1Acct, provider := ts.GetAccount(common.PROVIDER, 0) - staked := sdk.NewCoin("ulava", sdk.NewInt(testStake)) + staked := sdk.NewCoin("ulava", math.NewInt(testStake)) minSelfDelegation := ts.Keepers.Dualstaking.MinSelfDelegation(ts.Ctx) amountToUnbond := staked.Sub(minSelfDelegation.AddAmount(math.OneInt())) @@ -531,7 +531,7 @@ func TestDualstakingUnbondStakeIsLowerThanMinSelfDelegationCausesError(t *testin provider1Acct, provider := ts.GetAccount(common.PROVIDER, 0) - staked := sdk.NewCoin("ulava", sdk.NewInt(testStake)) + staked := sdk.NewCoin("ulava", math.NewInt(testStake)) amountToUnbond := staked.SubAmount(math.OneInt()) // unbond once (not unstaking completely but still below min stake) @@ -547,10 +547,10 @@ func TestDualstakingBondStakeIsGreaterThanMinStakeCausesUnFreeze(t *testing.T) { provider1Acct, provider1Addr := ts.GetAccount(common.PROVIDER, 0) - staked := sdk.NewCoin("ulava", sdk.NewInt(testStake)) + staked := sdk.NewCoin("ulava", math.NewInt(testStake)) // delegate once - amount := sdk.NewCoin("ulava", sdk.NewInt(10000)) + amount := sdk.NewCoin("ulava", math.NewInt(10000)) _, err := ts.TxDualstakingDelegate(provider1Acct.GetVaultAddr(), provider1Addr, amount) require.NoError(t, err) @@ -572,7 +572,7 @@ func TestDualstakingRedelegateFreezeOneUnFreezeOther(t *testing.T) { provider1Acct, provider1Addr := ts.GetAccount(common.PROVIDER, 0) provider2Acct, provider2Addr := ts.GetAccount(common.PROVIDER, 1) - stake := sdk.NewCoin("ulava", sdk.NewInt(testStake)) + stake := sdk.NewCoin("ulava", math.NewInt(testStake)) // redelegate once minSelfDelegation := ts.Keepers.Dualstaking.MinSelfDelegation(ts.Ctx) @@ -621,7 +621,7 @@ func TestStakingUnbondStakeIsLowerThanMinStakeCausesFreeze(t *testing.T) { provider1Acct, _ := ts.GetAccount(common.PROVIDER, 0) validator1Acct, _ := ts.GetAccount(common.VALIDATOR, 0) - stakeInt := sdk.NewInt(testStake) + stakeInt := math.NewInt(testStake) stake := sdk.NewCoin("ulava", stakeInt) stakeEntry := ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) diff --git a/x/dualstaking/keeper/delegator_reward.go b/x/dualstaking/keeper/delegator_reward.go index ae0259db70..ee7b9c9a23 100644 --- a/x/dualstaking/keeper/delegator_reward.go +++ b/x/dualstaking/keeper/delegator_reward.go @@ -76,7 +76,7 @@ func (k Keeper) CalcRewards(ctx sdk.Context, totalReward sdk.Coins, totalDelegat providerReward = totalReward.MulInt(selfDelegation.Amount.Amount).QuoInt(totalDelegationsWithSelf) if !totalDelegations.IsZero() && commission != 0 { rawDelegatorsReward := totalReward.MulInt(totalDelegations).QuoInt(totalDelegationsWithSelf) - providerCommission := rawDelegatorsReward.MulInt(sdk.NewIntFromUint64(commission)).QuoInt(sdk.NewInt(100)) + providerCommission := rawDelegatorsReward.MulInt(math.NewIntFromUint64(commission)).QuoInt(math.NewInt(100)) providerReward = providerReward.Add(providerCommission...) } @@ -94,7 +94,7 @@ func (k Keeper) CalcDelegatorReward(ctx sdk.Context, delegatorsReward sdk.Coins, } func (k Keeper) ClaimRewards(ctx sdk.Context, delegator string, provider string) (sdk.Coins, error) { - goCtx := sdk.WrapSDKContext(ctx) + goCtx := ctx delegatorAcc, err := sdk.AccAddressFromBech32(delegator) if err != nil { @@ -157,10 +157,10 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c } // make sure this is post boost when rewards pool is introduced contributorAddresses, contributorPart := k.specKeeper.GetContributorReward(ctx, chainID) - contributorsNum := sdk.NewInt(int64(len(contributorAddresses))) + contributorsNum := math.NewInt(int64(len(contributorAddresses))) contributorReward := zeroCoins if !contributorsNum.IsZero() && contributorPart.GT(math.LegacyZeroDec()) { - contributorReward = totalReward.MulInt(contributorPart.MulInt64(spectypes.ContributorPrecision).RoundInt()).QuoInt(sdk.NewInt(spectypes.ContributorPrecision)) + contributorReward = totalReward.MulInt(contributorPart.MulInt64(spectypes.ContributorPrecision).RoundInt()).QuoInt(math.NewInt(spectypes.ContributorPrecision)) // make sure to round it down for the integers division contributorReward = contributorReward.QuoInt(contributorsNum).MulInt(contributorsNum) if !calcOnlyContributor { @@ -172,7 +172,7 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c } relevantDelegations := []types.Delegation{} - totalDelegations := sdk.ZeroInt() + totalDelegations := math.ZeroInt() var selfdelegation types.Delegation // fetch relevant delegations (those who are passed the first week of delegation), self delegation and sum the total delegations for _, d := range delegations { @@ -199,7 +199,11 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c // updateDelegatorsReward updates the delegator rewards map func (k Keeper) updateDelegatorsReward(ctx sdk.Context, totalDelegations math.Int, delegations []types.Delegation, delegatorsReward sdk.Coins, senderModule string, calcOnly bool) (leftoverRewards sdk.Coins) { - usedDelegatorRewards := sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), math.ZeroInt())) // the delegator rewards are calculated using int division, so there might be leftovers + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return leftoverRewards + } + usedDelegatorRewards := sdk.NewCoins(sdk.NewCoin(bondDenom, math.ZeroInt())) // the delegator rewards are calculated using int division, so there might be leftovers for _, delegation := range delegations { delegatorReward := k.CalcDelegatorReward(ctx, delegatorsReward, totalDelegations, delegation) @@ -238,7 +242,7 @@ func (k Keeper) PayContributors(ctx sdk.Context, senderModule string, contributo utils.LavaFormatError("contributor addresses for pay are empty", nil) return nil } - rewardCoins := contributorReward.QuoInt(sdk.NewInt(int64(len(contributorAddresses)))) + rewardCoins := contributorReward.QuoInt(math.NewInt(int64(len(contributorAddresses)))) details := map[string]string{ "total_reward_coins": contributorReward.String(), "reward_coins_per_contributor": rewardCoins.String(), diff --git a/x/dualstaking/keeper/grpc_query_delegator_providers_test.go b/x/dualstaking/keeper/grpc_query_delegator_providers_test.go index 26a3074e3b..dc95dbec47 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_providers_test.go +++ b/x/dualstaking/keeper/grpc_query_delegator_providers_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/common" "github.com/lavanet/lava/v4/x/dualstaking/types" @@ -18,7 +19,7 @@ func TestQueryWithUnbonding(t *testing.T) { _, provider := ts.GetAccount(common.PROVIDER, 0) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) // delegate and query _, err := ts.TxDualstakingDelegate(delegator, provider, amount) @@ -34,7 +35,7 @@ func TestQueryWithUnbonding(t *testing.T) { require.True(t, delegation.Equal(&delegationRes)) // partially unbond and query - unbondAmount := amount.Sub(sdk.NewCoin(ts.TokenDenom(), sdk.OneInt())) + unbondAmount := amount.Sub(sdk.NewCoin(ts.TokenDenom(), math.OneInt())) _, err = ts.TxDualstakingUnbond(delegator, provider, unbondAmount) require.NoError(t, err) ts.AdvanceEpoch() @@ -67,7 +68,7 @@ func TestQueryDelegations(t *testing.T) { _, provider := ts.GetAccount(common.PROVIDER, 0) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) delegation1 := types.NewDelegation(delegator1, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation1.Amount = amount @@ -126,7 +127,7 @@ func TestQueryProviderMultipleDelegators(t *testing.T) { require.NoError(t, err) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) delegations := []types.Delegation{} for i := 0; i < len(delegators); i++ { @@ -162,7 +163,7 @@ func TestQueryDelegatorMultipleProviders(t *testing.T) { providers := []string{provider1, provider2, provider3} amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) delegations := map[string]types.Delegation{} for i := 0; i < len(providers); i++ { @@ -196,7 +197,7 @@ func TestQueryDelegatorUnstakedProvider(t *testing.T) { _, unstakingProvider := ts.GetAccount(common.PROVIDER, 1) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) // shouldn't be able to delegate to unstaked provider _, err := ts.TxDualstakingDelegate(delegator, unstakedProvider, amount) diff --git a/x/dualstaking/keeper/grpc_query_provider_delegators_test.go b/x/dualstaking/keeper/grpc_query_provider_delegators_test.go index 2b62abb9e3..fa623bf7ae 100644 --- a/x/dualstaking/keeper/grpc_query_provider_delegators_test.go +++ b/x/dualstaking/keeper/grpc_query_provider_delegators_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/common" "github.com/lavanet/lava/v4/x/dualstaking/types" @@ -18,7 +19,7 @@ func TestQueryProviderDelegatorsWithUnbonding(t *testing.T) { _, provider := ts.GetAccount(common.PROVIDER, 0) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) // delegate and query _, err := ts.TxDualstakingDelegate(delegator, provider, amount) @@ -40,7 +41,7 @@ func TestQueryProviderDelegatorsWithUnbonding(t *testing.T) { require.True(t, delegation.Equal(&delegationRes)) // partially unbond and query - unbondAmount := amount.Sub(sdk.NewCoin(ts.TokenDenom(), sdk.OneInt())) + unbondAmount := amount.Sub(sdk.NewCoin(ts.TokenDenom(), math.OneInt())) _, err = ts.TxDualstakingUnbond(delegator, provider, unbondAmount) require.NoError(t, err) ts.AdvanceEpoch() @@ -78,7 +79,7 @@ func TestQueryProviderDelegators(t *testing.T) { _, provider := ts.GetAccount(common.PROVIDER, 0) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) delegation1 := types.NewDelegation(delegator1, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation1.Amount = amount @@ -157,7 +158,7 @@ func TestQueryProviderDelegatorsProviderMultipleDelegators(t *testing.T) { require.NoError(t, err) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) delegations := []types.Delegation{} for i := 0; i < len(delegators); i++ { @@ -195,7 +196,7 @@ func TestQueryProviderDelegatorsDelegatorMultipleProviders(t *testing.T) { providers := []string{provider1, provider2, provider3} amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) delegations := []types.Delegation{} for i := 0; i < len(providers); i++ { @@ -233,7 +234,7 @@ func TestQueryProviderDelegatorsDelegatorUnstakedProvider(t *testing.T) { _, unstakingProvider := ts.GetAccount(common.PROVIDER, 1) amountUint64 := uint64(100) - amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) + amount := sdk.NewCoin(ts.TokenDenom(), math.NewIntFromUint64(amountUint64)) // shouldn't be able to delegate to unstaked provider _, err := ts.TxDualstakingDelegate(delegator, unstakedProvider, amount) diff --git a/x/dualstaking/keeper/hooks.go b/x/dualstaking/keeper/hooks.go index 4a556cd39c..516167de65 100644 --- a/x/dualstaking/keeper/hooks.go +++ b/x/dualstaking/keeper/hooks.go @@ -1,9 +1,12 @@ package keeper import ( + "context" "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/lavanet/lava/v4/utils" @@ -25,74 +28,77 @@ func (k Keeper) Hooks() *Hooks { } // initialize validator distribution record -func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error { return nil } // AfterValidatorRemoved performs clean up after a validator is removed -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorRemoved(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error { return nil } // increment period -func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { return nil } // withdraw delegation rewards (which also increments period) -func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h Hooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { return nil } // create new delegation period record // add description -func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { - originalGasMeter := ctx.GasMeter() - ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) +func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + originalGasMeter := sdkCtx.GasMeter() + sdkCtx = sdkCtx.WithGasMeter(storetypes.NewInfiniteGasMeter()) providers := 0 defer func() { - consumedGas := ctx.GasMeter().GasConsumed() - ctx = ctx.WithGasMeter(originalGasMeter) + consumedGas := sdkCtx.GasMeter().GasConsumed() + sdkCtx = sdkCtx.WithGasMeter(originalGasMeter) if providers >= PROVIDERS_NUM_GAS_REFUND { - ctx.GasMeter().ConsumeGas(consumedGas, "consume hooks gas") + sdkCtx.GasMeter().ConsumeGas(consumedGas, "consume hooks gas") } }() - if h.k.GetDisableDualstakingHook(ctx) { + if h.k.GetDisableDualstakingHook(sdkCtx) { return nil } var err error - providers, err = h.k.BalanceDelegator(ctx, delAddr) + providers, err = h.k.BalanceDelegator(sdkCtx, delAddr) return err } -func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { - slashedValidators := h.k.GetSlashedValidators(ctx) +func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + slashedValidators := h.k.GetSlashedValidators(sdkCtx) slashedValidators = append(slashedValidators, valAddr.String()) - h.k.SetSlashedValidators(ctx, slashedValidators) + h.k.SetSlashedValidators(sdkCtx, slashedValidators) return nil } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { +func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { - if h.k.GetDisableDualstakingHook(ctx) { +func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if h.k.GetDisableDualstakingHook(sdkCtx) { return nil } - delegation, found := h.k.stakingKeeper.GetDelegation(ctx, delAddr, valAddr) - if !found { + delegation, err := h.k.stakingKeeper.GetDelegation(ctx, delAddr, valAddr) + if err != nil { return fmt.Errorf("could not find delegation for dualstaking hook") } validator, err := h.k.stakingKeeper.GetDelegatorValidator(ctx, delAddr, valAddr) @@ -103,7 +109,11 @@ func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, ) } amount := validator.TokensFromSharesRoundUp(delegation.Shares).Ceil().TruncateInt() - err = h.k.UnbondUniformProviders(ctx, delAddr.String(), sdk.NewCoin(h.k.stakingKeeper.BondDenom(ctx), amount)) + bondDenom, err := h.k.stakingKeeper.BondDenom(sdkCtx) + if err != nil { + return err + } + err = h.k.UnbondUniformProviders(sdkCtx, delAddr.String(), sdk.NewCoin(bondDenom, amount)) if err != nil { return utils.LavaFormatError("delegation removed hook failed", err, utils.Attribute{Key: "validator_address", Value: valAddr.String()}, @@ -115,7 +125,7 @@ func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, return nil } -func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { +func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error { return nil } diff --git a/x/dualstaking/keeper/hooks_test.go b/x/dualstaking/keeper/hooks_test.go index 0c837219a2..f357f29175 100644 --- a/x/dualstaking/keeper/hooks_test.go +++ b/x/dualstaking/keeper/hooks_test.go @@ -13,7 +13,7 @@ import ( "github.com/lavanet/lava/v4/utils" commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/lavanet/lava/v4/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" "golang.org/x/exp/slices" ) @@ -25,7 +25,7 @@ func TestCreateValidator(t *testing.T) { validator, _ := ts.GetAccount(common.VALIDATOR, 0) - amount := sdk.NewIntFromUint64(100) + amount := math.NewIntFromUint64(100) ts.TxCreateValidator(validator, amount) res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) @@ -40,7 +40,7 @@ func TestDelegateToValidator(t *testing.T) { validator, _ := ts.GetAccount(common.VALIDATOR, 0) - amount := sdk.NewIntFromUint64(100) + amount := math.NewIntFromUint64(100) ts.TxCreateValidator(validator, amount) res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) @@ -67,7 +67,7 @@ func TestReDelegateToValidator(t *testing.T) { validator1, _ := ts.GetAccount(common.VALIDATOR, 0) validator2, _ := ts.GetAccount(common.VALIDATOR, 1) - amount := sdk.NewIntFromUint64(100) + amount := math.NewIntFromUint64(100) ts.TxCreateValidator(validator1, amount) ts.TxCreateValidator(validator2, amount) @@ -110,7 +110,7 @@ func TestReDelegateToProvider(t *testing.T) { ts.addClients(1) validator, _ := ts.GetAccount(common.VALIDATOR, 0) - amount := sdk.NewIntFromUint64(10000) + amount := math.NewIntFromUint64(10000) ts.TxCreateValidator(validator, amount) acc, provider := ts.GetAccount(common.PROVIDER, 0) @@ -171,7 +171,7 @@ func TestUnbondUniformProviders(t *testing.T) { // create validator and providers validator, _ := ts.GetAccount(common.VALIDATOR, 0) - amount := sdk.NewIntFromUint64(10000) + amount := math.NewIntFromUint64(10000) ts.TxCreateValidator(validator, amount) for i := 0; i < 5; i++ { @@ -184,16 +184,16 @@ func TestUnbondUniformProviders(t *testing.T) { // delegate to validator (automatically delegates to empty provider) delegatorAcc, delegator := ts.GetAccount(common.CONSUMER, 0) - _, err = ts.TxDelegateValidator(delegatorAcc, validator, sdk.NewInt(210)) + _, err = ts.TxDelegateValidator(delegatorAcc, validator, math.NewInt(210)) require.NoError(t, err) // redelegate from empty provider to all providers with fixed amounts redelegateAmts := []math.Int{ - sdk.NewInt(10), - sdk.NewInt(20), - sdk.NewInt(50), - sdk.NewInt(60), - sdk.NewInt(70), + math.NewInt(10), + math.NewInt(20), + math.NewInt(50), + math.NewInt(60), + math.NewInt(70), } var providers []string for i := 0; i < 5; i++ { @@ -207,7 +207,7 @@ func TestUnbondUniformProviders(t *testing.T) { } // unbond 25*5 tokens from validator - _, err = ts.TxUnbondValidator(delegatorAcc, validator, sdk.NewInt(25*5)) + _, err = ts.TxUnbondValidator(delegatorAcc, validator, math.NewInt(25*5)) require.NoError(t, err) res, err := ts.QueryDualstakingDelegatorProviders(delegator) @@ -234,7 +234,7 @@ func TestUnbondUniformProviders(t *testing.T) { func TestValidatorSlash(t *testing.T) { ts := newTester(t) _, _ = ts.AddAccount(common.VALIDATOR, 0, testBalance*1000000000) - amount := sdk.NewIntFromUint64(1000000000) + amount := math.NewIntFromUint64(1000000000) // create valAcc and providers valAcc, _ := ts.GetAccount(common.VALIDATOR, 0) @@ -252,7 +252,7 @@ func TestValidatorSlash(t *testing.T) { require.Equal(t, amount, resQ.Delegations[0].Amount.Amount) // slash 0.6*ConsensusPowerTokens = 0.6*100000 from the validator and check balance - expectedTokensToBurn := ts.SlashValidator(valAcc, sdk.NewDecWithPrec(6, 1), 1, ts.Ctx.BlockHeight()) // fraction = 0.6 + expectedTokensToBurn := ts.SlashValidator(valAcc, math.LegacyNewDecWithPrec(6, 1), 1, ts.Ctx.BlockHeight()) // fraction = 0.6 // sanity check: validator should have 0.6*ConsensusPowerTokens = 0.6*100000 val = ts.GetValidator(valAcc.Addr) @@ -306,7 +306,8 @@ func TestValidatorAndProvidersSlash(t *testing.T) { delegatorAcc, delegator := ts.GetAccount(common.CONSUMER, 0) _, err = ts.TxDelegateValidator(delegatorAcc, valAcc, consensusPowerTokens.MulRaw(250)) require.NoError(t, err) - delegatorValDelegations := ts.Keepers.StakingKeeper.GetAllDelegatorDelegations(ts.Ctx, delegatorAcc.Addr) + delegatorValDelegations, err := ts.Keepers.StakingKeeper.GetAllDelegatorDelegations(ts.Ctx, delegatorAcc.Addr) + require.NoError(t, err) require.Equal(t, 1, len(delegatorValDelegations)) val = ts.GetValidator(valAcc.Addr) require.Equal(t, consensusPowerTokens.MulRaw(250), val.TokensFromShares(delegatorValDelegations[0].Shares).TruncateInt()) @@ -371,31 +372,34 @@ func TestValidatorAndProvidersSlash(t *testing.T) { res, err := ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) delegationsBeforeSlash := res.Delegations - slices.SortFunc(delegationsBeforeSlash, func(i, j dualstakingtypes.Delegation) bool { - return i.Amount.IsLT(j.Amount) + slices.SortFunc(delegationsBeforeSlash, func(i, j types.Delegation) int { + if i.Amount.IsLTE(j.Amount) { + return -1 + } + return 1 }) // slash consensusPowerTokens*0.6 tokens from the validator and check balance - expectedTokensSlashed := ts.SlashValidator(valAcc, sdk.NewDecWithPrec(6, 1), power, ts.Ctx.BlockHeight()) // fraction = 0.6 + expectedTokensSlashed := ts.SlashValidator(valAcc, math.LegacyNewDecWithPrec(6, 1), power, ts.Ctx.BlockHeight()) // fraction = 0.6 expectedValidatorTokens = expectedValidatorTokens.Sub(expectedTokensSlashed) val = ts.GetValidator(valAcc.Addr) require.Equal(t, expectedValidatorTokens, val.Tokens) // hard coded effective fraction of slash - fraction := sdk.MustNewDecFromStr("0.001967213114754099") + fraction := math.LegacyMustNewDecFromStr("0.001967213114754099") // both the validator and providers have a single delegation that was created by their // self delegation. Check that the new amount after slash is (1-fraction) * old_amount res, err = ts.QueryDualstakingDelegatorProviders(valAcc.Addr.String()) require.NoError(t, err) require.Len(t, res.Delegations, 1) - require.Equal(t, sdk.OneDec().Sub(fraction).MulInt(stake).RoundInt(), res.Delegations[0].Amount.Amount) + require.Equal(t, math.LegacyOneDec().Sub(fraction).MulInt(stake).RoundInt(), res.Delegations[0].Amount.Amount) for _, p := range providersAccs { res, err = ts.QueryDualstakingDelegatorProviders(p.GetVaultAddr()) require.NoError(t, err) require.Len(t, res.Delegations, 1) - require.Equal(t, sdk.OneDec().Sub(fraction).MulInt(stake).RoundInt(), res.Delegations[0].Amount.Amount) + require.Equal(t, math.LegacyOneDec().Sub(fraction).MulInt(stake).RoundInt(), res.Delegations[0].Amount.Amount) } // the total token to deduct from the delegator's provider delegations is: @@ -407,7 +411,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { for _, d := range res.Delegations { totalDelegations = totalDelegations.Add(d.Amount.Amount) } - require.Equal(t, sdk.OneDec().Sub(fraction).MulInt(consensusPowerTokens.MulRaw(245)).RoundInt(), totalDelegations) + require.Equal(t, math.LegacyOneDec().Sub(fraction).MulInt(consensusPowerTokens.MulRaw(245)).RoundInt(), totalDelegations) // verify once again that the delegator's delegations balance is preserved diff, _, err = ts.Keepers.Dualstaking.VerifyDelegatorBalance(ts.Ctx, delegatorAcc.Addr) @@ -421,7 +425,7 @@ func TestCancelUnbond(t *testing.T) { ts := newTester(t) ts.addValidators(1) ts.addClients(1) - amount := sdk.NewIntFromUint64(10000) + amount := math.NewIntFromUint64(10000) // create validator and providers validator, _ := ts.GetAccount(common.VALIDATOR, 0) @@ -431,11 +435,11 @@ func TestCancelUnbond(t *testing.T) { // delegate to validator (automatically delegates to empty provider) delegator, _ := ts.GetAccount(common.CONSUMER, 0) - _, err := ts.TxDelegateValidator(delegator, validator, sdk.NewInt(250)) + _, err := ts.TxDelegateValidator(delegator, validator, math.NewInt(250)) require.NoError(t, err) // unbond and advance blocks - _, err = ts.TxUnbondValidator(delegator, validator, sdk.NewInt(250)) + _, err = ts.TxUnbondValidator(delegator, validator, math.NewInt(250)) require.NoError(t, err) ts.verifyDelegatorsBalance() @@ -443,7 +447,7 @@ func TestCancelUnbond(t *testing.T) { ts.AdvanceEpoch() // cancel the unbond TX and check for balances - _, err = ts.TxCancelUnbondValidator(delegator, validator, unbondBlock, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(50))) + _, err = ts.TxCancelUnbondValidator(delegator, validator, unbondBlock, sdk.NewCoin(ts.TokenDenom(), math.NewInt(50))) require.NoError(t, err) diff, _, err := ts.Keepers.Dualstaking.VerifyDelegatorBalance(ts.Ctx, delegator.Addr) @@ -459,7 +463,7 @@ func TestHooksRandomDelegations(t *testing.T) { _, _ = ts.AddAccount(common.VALIDATOR, 0, testBalance*1000000000) _, _ = ts.AddAccount(common.PROVIDER, 0, testBalance*1000000000) _, _ = ts.AddAccount(common.CONSUMER, 0, testBalance*1000000000) - amount := sdk.NewIntFromUint64(1000) + amount := math.NewIntFromUint64(1000) // create validatorAcc and providers validatorAcc, _ := ts.GetAccount(common.VALIDATOR, 0) @@ -485,14 +489,14 @@ func TestHooksRandomDelegations(t *testing.T) { delegatorAcc = prevDelegatorAcc delegator = prevDelegator } - _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(int64(d)))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(int64(d)))) require.NoError(t, err) - _, found := ts.Keepers.StakingKeeper.GetDelegation(ts.Ctx, delegatorAcc.Addr, sdk.ValAddress(validatorAcc.Addr)) - require.True(t, found) + _, err = ts.Keepers.StakingKeeper.GetDelegation(ts.Ctx, delegatorAcc.Addr, sdk.ValAddress(validatorAcc.Addr)) + require.NoError(t, err) valConsAddr := sdk.GetConsAddress(validatorAcc.ConsKey.PubKey()) - ts.Keepers.SlashingKeeper.Slash(ts.Ctx, valConsAddr, sdk.NewDecWithPrec(1, 1), 1, ts.Ctx.BlockHeight()) + ts.Keepers.SlashingKeeper.Slash(ts.Ctx, valConsAddr, math.LegacyNewDecWithPrec(1, 1), 1, ts.Ctx.BlockHeight()) } } @@ -503,25 +507,25 @@ func TestNotRoundedShares(t *testing.T) { _, _ = ts.AddAccount(common.VALIDATOR, 0, testBalance*10000000000) _, _ = ts.AddAccount(common.PROVIDER, 0, testBalance*10000000000) _, _ = ts.AddAccount(common.CONSUMER, 0, testBalance*10000000000) - delAmount := sdk.NewIntFromUint64(1000000000000) + delAmount := math.NewIntFromUint64(1000000000000) delegatorAcc, delegator := ts.GetAccount(common.CONSUMER, 0) validatorAcc, _ := ts.GetAccount(common.VALIDATOR, 0) ts.TxCreateValidator(validatorAcc, math.NewIntFromUint64(4495000000001)) - val, found := ts.Keepers.StakingKeeper.GetValidator(ts.Ctx, sdk.ValAddress(validatorAcc.Addr)) - require.True(t, found) - val.DelegatorShares = sdk.MustNewDecFromStr("4540404040405.050505050505050505") + val, err := ts.Keepers.StakingKeeper.GetValidator(ts.Ctx, sdk.ValAddress(validatorAcc.Addr)) + require.NoError(t, err) + val.DelegatorShares = math.LegacyMustNewDecFromStr("4540404040405.050505050505050505") ts.Keepers.StakingKeeper.SetValidator(ts.Ctx, val) providerAcc, provider := ts.GetAccount(common.PROVIDER, 0) - err := ts.StakeProvider(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), ts.spec, delAmount.Int64()) + err = ts.StakeProvider(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), ts.spec, delAmount.Int64()) require.NoError(t, err) - shares := sdk.MustNewDecFromStr("1010101010101.010101010101010101") + shares := math.LegacyMustNewDecFromStr("1010101010101.010101010101010101") require.NoError(t, err) - ts.Keepers.StakingKeeper.SetDelegation(ts.Ctx, stakingtypes.NewDelegation(delegatorAcc.Addr, sdk.ValAddress(validatorAcc.Addr), shares)) + ts.Keepers.StakingKeeper.SetDelegation(ts.Ctx, stakingtypes.NewDelegation(delegatorAcc.Addr.String(), sdk.ValAddress(validatorAcc.Addr).String(), shares)) _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), delAmount)) require.NoError(t, err) @@ -536,31 +540,31 @@ func TestUnbondValidatorButNotRemoveStakeEntry(t *testing.T) { // create validator and providers validator, _ := ts.GetAccount(common.VALIDATOR, 0) - amount := sdk.NewIntFromUint64(9999) + amount := math.NewIntFromUint64(9999) ts.TxCreateValidator(validator, amount) validator2, _ := ts.GetAccount(common.VALIDATOR, 1) - amount2 := sdk.NewIntFromUint64(9998) + amount2 := math.NewIntFromUint64(9998) ts.TxCreateValidator(validator2, amount2) delegatorAcc1, _ := ts.GetAccount(common.CONSUMER, 0) - _, err = ts.TxDelegateValidator(delegatorAcc1, validator, sdk.NewInt(9999)) + _, err = ts.TxDelegateValidator(delegatorAcc1, validator, math.NewInt(9999)) require.NoError(t, err) delegatorAcc2, _ := ts.GetAccount(common.CONSUMER, 0) - _, err = ts.TxDelegateValidator(delegatorAcc2, validator, sdk.NewInt(9998)) + _, err = ts.TxDelegateValidator(delegatorAcc2, validator, math.NewInt(9998)) require.NoError(t, err) for i := 0; i < 5; i++ { provider, _ := ts.GetAccount(common.PROVIDER, i) - err := ts.StakeProvider(provider.GetVaultAddr(), provider.Addr.String(), ts.spec, sdk.NewIntFromUint64(9999).Int64()) + err := ts.StakeProvider(provider.GetVaultAddr(), provider.Addr.String(), ts.spec, math.NewIntFromUint64(9999).Int64()) require.NoError(t, err) } providerAcct, _ := ts.GetAccount(common.PROVIDER, 0) // provider completely unbond from validator, delegation is removed - _, err = ts.TxUnbondValidator(*providerAcct.Vault, validator, sdk.NewInt(9999)) + _, err = ts.TxUnbondValidator(*providerAcct.Vault, validator, math.NewInt(9999)) require.Error(t, err) } @@ -575,19 +579,19 @@ func TestUndelegateProvider(t *testing.T) { // create validator and providers validator, _ := ts.GetAccount(common.VALIDATOR, 0) - amount := sdk.NewIntFromUint64(9999) + amount := math.NewIntFromUint64(9999) ts.TxCreateValidator(validator, amount) validator2, _ := ts.GetAccount(common.VALIDATOR, 1) - amount2 := sdk.NewIntFromUint64(9998) + amount2 := math.NewIntFromUint64(9998) ts.TxCreateValidator(validator2, amount2) delegatorAcc1, _ := ts.GetAccount(common.CONSUMER, 0) - _, err = ts.TxDelegateValidator(delegatorAcc1, validator, sdk.NewInt(9999)) + _, err = ts.TxDelegateValidator(delegatorAcc1, validator, math.NewInt(9999)) require.NoError(t, err) delegatorAcc2, _ := ts.GetAccount(common.CONSUMER, 1) - _, err = ts.TxDelegateValidator(delegatorAcc2, validator, sdk.NewInt(9998)) + _, err = ts.TxDelegateValidator(delegatorAcc2, validator, math.NewInt(9998)) require.NoError(t, err) for i := 0; i < 5; i++ { @@ -608,7 +612,7 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) + sdk.NewCoin(ts.TokenDenom(), math.NewInt(9999))) require.NoError(t, err) ts.AdvanceEpoch() @@ -632,7 +636,7 @@ func TestUndelegateProvider(t *testing.T) { ts.AdvanceEpochUntilStale() // stake provider again - err = ts.StakeProvider(providerAcct.GetVaultAddr(), providerAcct.Addr.String(), ts.spec, sdk.NewIntFromUint64(1000).Int64()) + err = ts.StakeProvider(providerAcct.GetVaultAddr(), providerAcct.Addr.String(), ts.spec, math.NewIntFromUint64(1000).Int64()) require.NoError(t, err) entry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) @@ -643,7 +647,7 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, commontypes.EMPTY_PROVIDER, - sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1))) + sdk.NewCoin(ts.TokenDenom(), math.NewInt(1))) require.NoError(t, err) _, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) @@ -654,7 +658,7 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc2.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9998))) + sdk.NewCoin(ts.TokenDenom(), math.NewInt(9998))) require.NoError(t, err) // delegator 1 can only redelegate 9998 to Empty Provider @@ -663,12 +667,12 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, commontypes.EMPTY_PROVIDER, - sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) + sdk.NewCoin(ts.TokenDenom(), math.NewInt(9999))) require.Error(t, err) _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, commontypes.EMPTY_PROVIDER, - sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9998))) + sdk.NewCoin(ts.TokenDenom(), math.NewInt(9998))) require.NoError(t, err) } diff --git a/x/dualstaking/keeper/keeper.go b/x/dualstaking/keeper/keeper.go index 2010449bed..cf15570432 100644 --- a/x/dualstaking/keeper/keeper.go +++ b/x/dualstaking/keeper/keeper.go @@ -4,10 +4,9 @@ import ( "fmt" "cosmossdk.io/collections" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -96,6 +95,6 @@ func (k Keeper) ChangeDelegationTimestampForTesting(ctx sdk.Context, provider, d return k.SetDelegation(ctx, d) } -func (k Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +func (k Keeper) BeginBlock(ctx sdk.Context) { k.HandleSlashedValidators(ctx) } diff --git a/x/dualstaking/keeper/migrations.go b/x/dualstaking/keeper/migrations.go index 8966235507..2cfca3db2b 100644 --- a/x/dualstaking/keeper/migrations.go +++ b/x/dualstaking/keeper/migrations.go @@ -3,7 +3,8 @@ package keeper import ( _ "embed" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/dualstaking/types" fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" @@ -50,7 +51,7 @@ func (m Migrator) MigrateVersion5To6(ctx sdk.Context) error { // set rewards store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(DelegatorRewardKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -69,7 +70,7 @@ func (m Migrator) MigrateVersion5To6(ctx sdk.Context) error { // now delete the stores deleteStore := func(prefixString string) { store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(prefixString)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/dualstaking/keeper/msg_server_delegate.go b/x/dualstaking/keeper/msg_server_delegate.go index fdb823e4d2..73174beeda 100644 --- a/x/dualstaking/keeper/msg_server_delegate.go +++ b/x/dualstaking/keeper/msg_server_delegate.go @@ -3,6 +3,7 @@ package keeper import ( "context" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/lavanet/lava/v4/utils" @@ -22,8 +23,8 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string return valErr } - validatorType, found := k.stakingKeeper.GetValidator(ctx, valAddr) - if !found { + validatorType, err := k.stakingKeeper.GetValidator(ctx, valAddr) + if err != nil { return stakingtypes.ErrNoValidatorFound } @@ -36,12 +37,16 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string return err } - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), amount, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if err := utils.ValidateCoins(ctx, bondDenom, amount, false); err != nil { return err } delegation, found := k.GetDelegation(ctx, commontypes.EMPTY_PROVIDER, delegator) - amountBefore := sdk.ZeroInt() + amountBefore := math.ZeroInt() if found { amountBefore = delegation.Amount.Amount } diff --git a/x/dualstaking/keeper/msg_server_redelegate.go b/x/dualstaking/keeper/msg_server_redelegate.go index 0c850104f2..52c600293a 100644 --- a/x/dualstaking/keeper/msg_server_redelegate.go +++ b/x/dualstaking/keeper/msg_server_redelegate.go @@ -11,7 +11,11 @@ import ( func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) (*types.MsgRedelegateResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), msg.Amount, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return &types.MsgRedelegateResponse{}, err + } + if err := utils.ValidateCoins(ctx, bondDenom, msg.Amount, false); err != nil { return &types.MsgRedelegateResponse{}, err } @@ -19,7 +23,7 @@ func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) ( return &types.MsgRedelegateResponse{}, err } - err := k.Keeper.Redelegate( + err = k.Keeper.Redelegate( ctx, msg.Creator, msg.FromProvider, diff --git a/x/dualstaking/keeper/msg_server_test.go b/x/dualstaking/keeper/msg_server_test.go index a411106799..64dd32b6f4 100644 --- a/x/dualstaking/keeper/msg_server_test.go +++ b/x/dualstaking/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/dualstaking/keeper" "github.com/lavanet/lava/v4/x/dualstaking/types" @@ -13,7 +12,7 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.DualstakingKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } func TestMsgServer(t *testing.T) { diff --git a/x/dualstaking/keeper/msg_server_unbond.go b/x/dualstaking/keeper/msg_server_unbond.go index 190dab7ae5..dcbead3fa2 100644 --- a/x/dualstaking/keeper/msg_server_unbond.go +++ b/x/dualstaking/keeper/msg_server_unbond.go @@ -35,7 +35,11 @@ func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, return err } - err = utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), amount, false) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + err = utils.ValidateCoins(ctx, bondDenom, amount, false) if err != nil { return err } @@ -51,7 +55,7 @@ func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, if err != nil { return err } - _, err = k.stakingKeeper.Undelegate(ctx, delegatorAddress, addr, shares) + _, _, err = k.stakingKeeper.Undelegate(ctx, delegatorAddress, addr, shares) if err != nil { return err } diff --git a/x/dualstaking/keeper/query_params_test.go b/x/dualstaking/keeper/query_params_test.go index 6f029ce46e..234f35cff3 100644 --- a/x/dualstaking/keeper/query_params_test.go +++ b/x/dualstaking/keeper/query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.DualstakingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/dualstaking/keeper/slashing.go b/x/dualstaking/keeper/slashing.go index 3f5d35c330..0c9d99f22c 100644 --- a/x/dualstaking/keeper/slashing.go +++ b/x/dualstaking/keeper/slashing.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/dualstaking/types" @@ -23,9 +23,17 @@ func (k Keeper) BalanceValidatorsDelegators(ctx sdk.Context, validator string) { return } - delegators := k.stakingKeeper.GetValidatorDelegations(ctx, valAcc) + delegators, err := k.stakingKeeper.GetValidatorDelegations(ctx, valAcc) + if err != nil { + utils.LavaFormatError("failed to get validator delegators", err, utils.LogAttr("validator", validator)) + return + } for _, delegator := range delegators { - delAddr := delegator.GetDelegatorAddr() + delAddr, err := sdk.AccAddressFromBech32(delegator.GetDelegatorAddr()) + if err != nil { + utils.LavaFormatError("failed to get delegator address", err, utils.LogAttr("delegator", delegator.GetDelegatorAddr())) + continue + } k.BalanceDelegator(ctx, delAddr) } } diff --git a/x/dualstaking/module.go b/x/dualstaking/module.go index aecd7dda6a..2bfa23ccfd 100644 --- a/x/dualstaking/module.go +++ b/x/dualstaking/module.go @@ -149,11 +149,19 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 6 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx, req) +func (am AppModule) BeginBlock(ctx sdk.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.BeginBlock(sdkCtx) + return nil } // EndBlock contains the logic that is automatically triggered at the end of each block -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ sdk.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/dualstaking/module_simulation.go b/x/dualstaking/module_simulation.go index beaddac229..0bc0d9a4a3 100644 --- a/x/dualstaking/module_simulation.go +++ b/x/dualstaking/module_simulation.go @@ -4,7 +4,6 @@ import ( "math/rand" "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -56,7 +55,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // ProposalContents doesn't return any content functions for governance proposals. func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { @@ -68,8 +67,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp operations := make([]simtypes.WeightedOperation, 0) var weightMsgDelegate int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDelegate, &weightMsgDelegate, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgDelegate, + &weightMsgDelegate, + simState.Rand, + func(r *rand.Rand) { weightMsgDelegate = defaultWeightMsgDelegate }, ) @@ -79,8 +81,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgRedelegate int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgRedelegate, &weightMsgRedelegate, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgRedelegate, + &weightMsgRedelegate, + simState.Rand, + func(r *rand.Rand) { weightMsgRedelegate = defaultWeightMsgRedelegate }, ) @@ -90,8 +95,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgUnbond int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnbond, &weightMsgUnbond, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgUnbond, + &weightMsgUnbond, + simState.Rand, + func(r *rand.Rand) { weightMsgUnbond = defaultWeightMsgUnbond }, ) @@ -101,8 +109,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgClaimRewards int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgClaimRewards, &weightMsgClaimRewards, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgClaimRewards, + &weightMsgClaimRewards, + simState.Rand, + func(r *rand.Rand) { weightMsgClaimRewards = defaultWeightMsgClaimRewards }, ) diff --git a/x/dualstaking/types/delegate.go b/x/dualstaking/types/delegate.go index fe2b82e405..d94d13a5d0 100644 --- a/x/dualstaking/types/delegate.go +++ b/x/dualstaking/types/delegate.go @@ -5,6 +5,7 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/collections/indexes" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils/lavaslices" ) @@ -32,7 +33,7 @@ func NewDelegation(delegator, provider string, blockTime time.Time, tokenDenom s return Delegation{ Delegator: delegator, Provider: provider, - Amount: sdk.NewCoin(tokenDenom, sdk.ZeroInt()), + Amount: sdk.NewCoin(tokenDenom, math.ZeroInt()), Timestamp: blockTime.AddDate(0, 0, 7).UTC().Unix(), } } diff --git a/x/dualstaking/types/expected_keepers.go b/x/dualstaking/types/expected_keepers.go index 07ea58ebae..50a82034b7 100644 --- a/x/dualstaking/types/expected_keepers.go +++ b/x/dualstaking/types/expected_keepers.go @@ -1,12 +1,12 @@ package types import ( + context "context" "time" "cosmossdk.io/math" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" @@ -16,18 +16,18 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error + BurnCoins(ctx context.Context, name string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + MintCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt sdk.Coins) error // Methods imported from bank should be defined here } @@ -52,19 +52,19 @@ type SpecKeeper interface { } type StakingKeeper interface { - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI - UnbondingTime(ctx sdk.Context) time.Duration - GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation - GetDelegatorValidator(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (validator stakingtypes.Validator, err error) - GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) - GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) - GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []stakingtypes.Delegation) - BondDenom(ctx sdk.Context) string - ValidateUnbondAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int) (shares sdk.Dec, err error) - Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (time.Time, error) - Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt math.Int, tokenSrc stakingtypes.BondStatus, validator stakingtypes.Validator, subtractAccount bool) (newShares sdk.Dec, err error) - GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator - GetAllValidators(ctx sdk.Context) (validators []stakingtypes.Validator) + ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) + UnbondingTime(ctx context.Context) (time.Duration, error) + GetAllDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress) ([]stakingtypes.Delegation, error) + GetDelegatorValidator(ctx context.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (validator stakingtypes.Validator, err error) + GetDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.Delegation, error) + GetValidator(ctx context.Context, addr sdk.ValAddress) (stakingtypes.Validator, error) + GetValidatorDelegations(ctx context.Context, valAddr sdk.ValAddress) ([]stakingtypes.Delegation, error) + BondDenom(ctx context.Context) (string, error) + ValidateUnbondAmount(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int) (shares math.LegacyDec, err error) + Undelegate(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount math.LegacyDec) (time.Time, math.Int, error) + Delegate(ctx context.Context, delAddr sdk.AccAddress, bondAmt math.Int, tokenSrc stakingtypes.BondStatus, validator stakingtypes.Validator, subtractAccount bool) (newShares math.LegacyDec, err error) + GetBondedValidatorsByPower(ctx context.Context) ([]stakingtypes.Validator, error) + GetAllValidators(ctx context.Context) ([]stakingtypes.Validator, error) } type FixationStoreKeeper interface { diff --git a/x/dualstaking/types/message_claim_rewards.go b/x/dualstaking/types/message_claim_rewards.go index e84df5b8a8..f7677ff384 100644 --- a/x/dualstaking/types/message_claim_rewards.go +++ b/x/dualstaking/types/message_claim_rewards.go @@ -26,19 +26,6 @@ func (msg *MsgClaimRewards) Type() string { return TypeMsgClaimRewards } -func (msg *MsgClaimRewards) GetSigners() []sdk.AccAddress { - delegator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{delegator} -} - -func (msg *MsgClaimRewards) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgClaimRewards) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/dualstaking/types/message_delegate.go b/x/dualstaking/types/message_delegate.go index 49d599d613..63668de0db 100644 --- a/x/dualstaking/types/message_delegate.go +++ b/x/dualstaking/types/message_delegate.go @@ -29,19 +29,6 @@ func (msg *MsgDelegate) Type() string { return TypeMsgDelegate } -func (msg *MsgDelegate) GetSigners() []sdk.AccAddress { - delegator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{delegator} -} - -func (msg *MsgDelegate) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgDelegate) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/dualstaking/types/message_delegate_test.go b/x/dualstaking/types/message_delegate_test.go index f93768ef04..3ca4b0599c 100644 --- a/x/dualstaking/types/message_delegate_test.go +++ b/x/dualstaking/types/message_delegate_test.go @@ -3,6 +3,7 @@ package types import ( "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/lavanet/lava/v4/testutil/sample" @@ -10,7 +11,7 @@ import ( ) func TestMsgDelegate_ValidateBasic(t *testing.T) { - oneCoin := sdk.NewCoin("utest", sdk.NewInt(1)) + oneCoin := sdk.NewCoin("utest", math.NewInt(1)) validator := sample.ValAddress() tests := []struct { @@ -55,7 +56,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { msg: MsgDelegate{ Creator: sample.AccAddress(), Provider: sample.AccAddress(), - Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, + Amount: sdk.Coin{Denom: "utest", Amount: math.NewInt(-1)}, Validator: validator, ChainID: "", }, diff --git a/x/dualstaking/types/message_redelegate.go b/x/dualstaking/types/message_redelegate.go index 798c945eb8..f27c83f7ca 100644 --- a/x/dualstaking/types/message_redelegate.go +++ b/x/dualstaking/types/message_redelegate.go @@ -30,19 +30,6 @@ func (msg *MsgRedelegate) Type() string { return TypeMsgRedelegate } -func (msg *MsgRedelegate) GetSigners() []sdk.AccAddress { - delegator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{delegator} -} - -func (msg *MsgRedelegate) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgRedelegate) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/dualstaking/types/message_redelegate_test.go b/x/dualstaking/types/message_redelegate_test.go index bade24e0c1..a2ceafa497 100644 --- a/x/dualstaking/types/message_redelegate_test.go +++ b/x/dualstaking/types/message_redelegate_test.go @@ -3,6 +3,7 @@ package types import ( "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/lavanet/lava/v4/testutil/sample" @@ -10,7 +11,7 @@ import ( ) func TestMsgRedelegate_ValidateBasic(t *testing.T) { - oneCoin := sdk.NewCoin("utest", sdk.NewInt(1)) + oneCoin := sdk.NewCoin("utest", math.NewInt(1)) tests := []struct { name string @@ -55,7 +56,7 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { Creator: sample.AccAddress(), FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), - Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, + Amount: sdk.Coin{Denom: "utest", Amount: math.NewInt(-1)}, FromChainID: "", ToChainID: "", }, diff --git a/x/dualstaking/types/message_unbond.go b/x/dualstaking/types/message_unbond.go index 76f7213b6a..52ce2e3c09 100644 --- a/x/dualstaking/types/message_unbond.go +++ b/x/dualstaking/types/message_unbond.go @@ -29,19 +29,6 @@ func (msg *MsgUnbond) Type() string { return TypeMsgUnbond } -func (msg *MsgUnbond) GetSigners() []sdk.AccAddress { - delegator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{delegator} -} - -func (msg *MsgUnbond) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgUnbond) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/dualstaking/types/message_unbond_test.go b/x/dualstaking/types/message_unbond_test.go index 9da5662f4a..0fb2742a34 100644 --- a/x/dualstaking/types/message_unbond_test.go +++ b/x/dualstaking/types/message_unbond_test.go @@ -3,6 +3,7 @@ package types import ( "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/lavanet/lava/v4/testutil/sample" @@ -10,7 +11,7 @@ import ( ) func TestMsgUnbond_ValidateBasic(t *testing.T) { - oneCoin := sdk.NewCoin("utest", sdk.NewInt(1)) + oneCoin := sdk.NewCoin("utest", math.NewInt(1)) validator := sample.ValAddress() tests := []struct { @@ -66,7 +67,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { msg: MsgUnbond{ Creator: sample.AccAddress(), Provider: sample.AccAddress(), - Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, + Amount: sdk.Coin{Denom: "utest", Amount: math.NewInt(-1)}, Validator: validator, ChainID: "", }, diff --git a/x/dualstaking/types/params.go b/x/dualstaking/types/params.go index 57628469f0..148b91caf4 100644 --- a/x/dualstaking/types/params.go +++ b/x/dualstaking/types/params.go @@ -3,6 +3,7 @@ package types import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" commontypes "github.com/lavanet/lava/v4/utils/common/types" @@ -13,7 +14,7 @@ var _ paramtypes.ParamSet = (*Params)(nil) var ( KeyMinSelfDelegation = []byte("MinSelfDelegation") - DefaultMinSelfDelegation sdk.Coin = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(100000000)) // 100 lava = 100,000,000 ulava + DefaultMinSelfDelegation sdk.Coin = sdk.NewCoin(commontypes.TokenDenom, math.NewInt(100000000)) // 100 lava = 100,000,000 ulava ) // ParamKeyTable the param key table for launch module diff --git a/x/dualstaking/types/query.pb.go b/x/dualstaking/types/query.pb.go index 2c9bacbfb7..a2be901337 100644 --- a/x/dualstaking/types/query.pb.go +++ b/x/dualstaking/types/query.pb.go @@ -733,6 +733,7 @@ func _Query_DelegatorRewardsList_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.dualstaking.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/dualstaking/types/tx.pb.go b/x/dualstaking/types/tx.pb.go index bd41c1de95..69aa47e3c6 100644 --- a/x/dualstaking/types/tx.pb.go +++ b/x/dualstaking/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -476,43 +477,44 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/dualstaking/tx.proto", fileDescriptor_29c4c178d368211c) } var fileDescriptor_29c4c178d368211c = []byte{ - // 562 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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b, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x39, 0x90, 0x0d, 0xe9, 0x05, - 0x00, 0x00, + // 583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x95, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0xe3, 0x26, 0x84, 0xe6, 0xa5, 0x15, 0xaa, 0xdb, 0x12, 0xd7, 0x80, 0xdb, 0x3a, 0xaa, + 0x5a, 0x0a, 0xdc, 0x29, 0x05, 0x09, 0xa9, 0x63, 0xd3, 0x01, 0x86, 0x48, 0x28, 0x12, 0x4b, 0x97, + 0x72, 0x89, 0xaf, 0x57, 0x0b, 0xdb, 0x17, 0xf9, 0x2e, 0xa6, 0xac, 0x8c, 0x4c, 0x48, 0x4c, 0xfc, + 0x17, 0xfd, 0x33, 0x3a, 0x76, 0x03, 0x09, 0x09, 0xa1, 0x64, 0xe8, 0xbf, 0x81, 0xfc, 0x33, 0x8e, + 0x11, 0x21, 0x8c, 0x2c, 0x39, 0xdf, 0x7b, 0xdf, 0x77, 0xf7, 0x3e, 0xdf, 0x9c, 0x7d, 0xb0, 0xed, + 0x90, 0x80, 0x78, 0x54, 0xe2, 0x70, 0xc4, 0xd6, 0x90, 0x38, 0x42, 0x92, 0xb7, 0xb6, 0xc7, 0xb0, + 0xbc, 0x40, 0x03, 0x9f, 0x4b, 0xae, 0x6a, 0x89, 0x04, 0x85, 0x23, 0xca, 0x49, 0xf4, 0x15, 0xe2, + 0xda, 0x1e, 0xc7, 0xd1, 0x6f, 0x2c, 0xd6, 0x8d, 0x3e, 0x17, 0x2e, 0x17, 0xb8, 0x47, 0x04, 0xc5, + 0x41, 0xab, 0x47, 0x25, 0x69, 0xe1, 0x3e, 0xb7, 0xbd, 0x24, 0xbf, 0xc6, 0x38, 0xe3, 0xd1, 0x23, + 0x0e, 0x9f, 0x92, 0x68, 0x23, 0xa9, 0x72, 0x05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a7, 0xb1, 0x51, 0xba, 0x1e, 0x1b, 0xa5, 0x6f, 0x63, 0xa3, 0x74, 0x82, 0x98, + 0x2d, 0xcf, 0x87, 0x3d, 0xd4, 0xe7, 0x2e, 0x9e, 0xba, 0x04, 0x82, 0x67, 0xf8, 0x62, 0xfa, 0x26, + 0x78, 0x3f, 0xa0, 0xa2, 0x57, 0x8d, 0xbe, 0xc8, 0x4f, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xdf, + 0x1c, 0x04, 0x31, 0x32, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -678,6 +680,7 @@ func _Msg_ClaimRewards_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.dualstaking.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/epochstorage/handler.go b/x/epochstorage/handler.go deleted file mode 100644 index 1baa17ab30..0000000000 --- a/x/epochstorage/handler.go +++ /dev/null @@ -1,27 +0,0 @@ -package epochstorage - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/epochstorage/keeper" - "github.com/lavanet/lava/v4/x/epochstorage/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - // ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/epochstorage/keeper/epoch_details.go b/x/epochstorage/keeper/epoch_details.go index 62d1c2c0d1..f86e66eb34 100644 --- a/x/epochstorage/keeper/epoch_details.go +++ b/x/epochstorage/keeper/epoch_details.go @@ -3,7 +3,7 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/epochstorage/types" diff --git a/x/epochstorage/keeper/fixated_params.go b/x/epochstorage/keeper/fixated_params.go index 3b8673a2c1..03874e11a7 100644 --- a/x/epochstorage/keeper/fixated_params.go +++ b/x/epochstorage/keeper/fixated_params.go @@ -5,7 +5,8 @@ import ( "fmt" "strconv" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -55,7 +56,7 @@ func (k Keeper) RemoveFixatedParams( // GetAllFixatedParams returns all fixatedParams func (k Keeper) GetAllFixatedParams(ctx sdk.Context) (list []types.FixatedParams) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.FixatedParamsKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/epochstorage/keeper/grpc_query_epoch_details_test.go b/x/epochstorage/keeper/grpc_query_epoch_details_test.go index 9af0bf9be7..2957743eb8 100644 --- a/x/epochstorage/keeper/grpc_query_epoch_details_test.go +++ b/x/epochstorage/keeper/grpc_query_epoch_details_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -15,7 +14,7 @@ import ( func TestEpochDetailsQuery(t *testing.T) { keeper, ctx := keepertest.EpochstorageKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx item := createTestEpochDetails(keeper, ctx) for _, tc := range []struct { desc string diff --git a/x/epochstorage/keeper/grpc_query_fixated_params.go b/x/epochstorage/keeper/grpc_query_fixated_params.go index b40af3ff43..68f5702a0a 100644 --- a/x/epochstorage/keeper/grpc_query_fixated_params.go +++ b/x/epochstorage/keeper/grpc_query_fixated_params.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/lavanet/lava/v4/x/epochstorage/types" diff --git a/x/epochstorage/keeper/grpc_query_fixated_params_test.go b/x/epochstorage/keeper/grpc_query_fixated_params_test.go index 61bbcac28a..4e7a953e25 100644 --- a/x/epochstorage/keeper/grpc_query_fixated_params_test.go +++ b/x/epochstorage/keeper/grpc_query_fixated_params_test.go @@ -4,7 +4,6 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -20,7 +19,7 @@ var _ = strconv.IntSize func TestFixatedParamsQuerySingle(t *testing.T) { keeper, ctx := keepertest.EpochstorageKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNFixatedParams(keeper, ctx, 2) for _, tc := range []struct { desc string @@ -71,7 +70,7 @@ func TestFixatedParamsQuerySingle(t *testing.T) { func TestFixatedParamsQueryPaginated(t *testing.T) { keeper, ctx := keepertest.EpochstorageKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNFixatedParams(keeper, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllFixatedParamsRequest { diff --git a/x/epochstorage/keeper/grpc_query_params_test.go b/x/epochstorage/keeper/grpc_query_params_test.go index 5779e85022..8b0f0dde40 100644 --- a/x/epochstorage/keeper/grpc_query_params_test.go +++ b/x/epochstorage/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.EpochstorageKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/epochstorage/keeper/grpc_query_stake_storage_test.go b/x/epochstorage/keeper/grpc_query_stake_storage_test.go index 6f3fc0f158..b6cd8e5843 100644 --- a/x/epochstorage/keeper/grpc_query_stake_storage_test.go +++ b/x/epochstorage/keeper/grpc_query_stake_storage_test.go @@ -31,7 +31,7 @@ func createNStakeStorage(k *keeper.Keeper, ctx sdk.Context, n int) []types.Stake func TestStakeStorageQuerySingle(t *testing.T) { keeper, ctx := keepertest.EpochstorageKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNStakeStorage(keeper, ctx, 2) for _, tc := range []struct { desc string diff --git a/x/epochstorage/keeper/keeper.go b/x/epochstorage/keeper/keeper.go index cfd32a1b52..6e5be42409 100644 --- a/x/epochstorage/keeper/keeper.go +++ b/x/epochstorage/keeper/keeper.go @@ -4,9 +4,9 @@ import ( "fmt" "cosmossdk.io/collections" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/epochstorage/keeper/migrations.go b/x/epochstorage/keeper/migrations.go index b6871ef26f..6357725a7b 100644 --- a/x/epochstorage/keeper/migrations.go +++ b/x/epochstorage/keeper/migrations.go @@ -7,7 +7,8 @@ import ( "unicode" "cosmossdk.io/collections" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -28,7 +29,7 @@ func (m Migrator) Migrate5to6(ctx sdk.Context) error { utils.LavaFormatDebug("migrate: epochstorage to include provider and vault addresses") store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(v3.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -51,7 +52,7 @@ func (m Migrator) Migrate6to7(ctx sdk.Context) error { utils.LavaFormatDebug("migrate: epochstorage to include detailed description") store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(v3.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -79,7 +80,7 @@ func (m Migrator) Migrate7to8(ctx sdk.Context) error { k := m.keeper store := prefix.NewStore(ctx.KVStore(k.storeKey), v3.KeyPrefix(v3.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/epochstorage/keeper/msg_server_test.go b/x/epochstorage/keeper/msg_server_test.go index bb72301025..e9ffa265a6 100644 --- a/x/epochstorage/keeper/msg_server_test.go +++ b/x/epochstorage/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/epochstorage/keeper" "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.EpochstorageKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/epochstorage/module.go b/x/epochstorage/module.go index 6e6cba0642..bbc19b9634 100644 --- a/x/epochstorage/module.go +++ b/x/epochstorage/module.go @@ -174,12 +174,20 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 8 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx) +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.BeginBlock(sdkCtx) + return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(ctx context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/epochstorage/module_simulation.go b/x/epochstorage/module_simulation.go index 59cc07cb51..4273b4eeff 100644 --- a/x/epochstorage/module_simulation.go +++ b/x/epochstorage/module_simulation.go @@ -72,7 +72,7 @@ func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedPropo // } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/epochstorage/types/expected_keepers.go b/x/epochstorage/types/expected_keepers.go index a6fa9a5c1e..ea21a49e69 100644 --- a/x/epochstorage/types/expected_keepers.go +++ b/x/epochstorage/types/expected_keepers.go @@ -1,8 +1,9 @@ package types import ( + context "context" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" spectypes "github.com/lavanet/lava/v4/x/spec/types" ) @@ -14,19 +15,19 @@ type SpecKeeper interface { // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(moduleName string) sdk.AccAddress // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error // Methods imported from bank should be defined here } type StakingKeeper interface { - BondDenom(ctx sdk.Context) string + BondDenom(ctx context.Context) (string, error) } diff --git a/x/epochstorage/types/query.pb.go b/x/epochstorage/types/query.pb.go index 53bd8ba747..f048bb487b 100644 --- a/x/epochstorage/types/query.pb.go +++ b/x/epochstorage/types/query.pb.go @@ -999,6 +999,7 @@ func _Query_ProviderMetaData_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.epochstorage.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/epochstorage/types/tx.pb.go b/x/epochstorage/types/tx.pb.go index 037a995829..03855d79de 100644 --- a/x/epochstorage/types/tx.pb.go +++ b/x/epochstorage/types/tx.pb.go @@ -74,6 +74,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.epochstorage.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/fixationstore/keeper/keeper.go b/x/fixationstore/keeper/keeper.go index 601464f9ab..6844ab44ec 100644 --- a/x/fixationstore/keeper/keeper.go +++ b/x/fixationstore/keeper/keeper.go @@ -1,8 +1,8 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/fixationstore/types" timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" diff --git a/x/fixationstore/module.go b/x/fixationstore/module.go index 7f85acaa57..2c5f8e83fc 100644 --- a/x/fixationstore/module.go +++ b/x/fixationstore/module.go @@ -1,11 +1,11 @@ package fixationstore import ( - abci "github.com/cometbft/cometbft/abci/types" + "context" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/lavanet/lava/v4/x/fixationstore/client/cli" @@ -59,10 +59,16 @@ type AppModule struct { func (a AppModule) ConsensusVersion() uint64 { return ConsensusVersion } -func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (a AppModule) BeginBlock(_ context.Context) error { return nil } // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.k) } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/fixationstore/types/fixationstore.go b/x/fixationstore/types/fixationstore.go index 6047cd3627..1b516f1239 100644 --- a/x/fixationstore/types/fixationstore.go +++ b/x/fixationstore/types/fixationstore.go @@ -5,9 +5,9 @@ import ( "fmt" "math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/lavanet/lava/v4/utils" @@ -510,7 +510,7 @@ func (fs *FixationStore) deleteMarkedEntry(ctx sdk.Context, safeIndex SafeIndex, func (fs *FixationStore) deleteStaleEntries(ctx sdk.Context, safeIndex SafeIndex, _ uint64) { store := fs.getEntryStore(ctx, safeIndex) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() // "stale" entry versions are ones that reached refcount zero at least @@ -589,7 +589,7 @@ func (fs *FixationStore) deleteStaleEntries(ctx sdk.Context, safeIndex SafeIndex func (fs *FixationStore) trimFutureEntries(ctx sdk.Context, lastEntry Entry) { store := fs.getEntryStore(ctx, lastEntry.SafeIndex()) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) + iterator := storetypes.KVStoreReversePrefixIterator(store, []byte{}) defer iterator.Close() // first collect all the candidates, and later remove them (as the iterator @@ -655,7 +655,7 @@ func (fs *FixationStore) FindRawEntry(ctx sdk.Context, index string, block uint6 } store := fs.getEntryStore(ctx, safeIndex) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) + iterator := storetypes.KVStoreReversePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var entry Entry @@ -675,7 +675,7 @@ func (fs *FixationStore) getUnmarshaledEntryForBlock(ctx sdk.Context, safeIndex store := fs.getEntryStore(ctx, safeIndex) ctxBlock := uint64(ctx.BlockHeight()) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) + iterator := storetypes.KVStoreReversePrefixIterator(store, []byte{}) defer iterator.Close() // iterate over entries in reverse order of version (block), and return the @@ -972,7 +972,7 @@ func (fs *FixationStore) putFutureEntry(ctx sdk.Context, safeIndex SafeIndex, bl store := fs.getEntryStore(ctx, safeIndex) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() if !iterator.Valid() { @@ -991,7 +991,7 @@ func (fs *FixationStore) getEntryVersionsFilter(ctx sdk.Context, index string, b store := fs.getEntryStore(ctx, safeIndex) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) + iterator := storetypes.KVStoreReversePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -1166,7 +1166,7 @@ func (fs FixationStore) isEntryIndexLive(ctx sdk.Context, safeIndex SafeIndex) b func (fs FixationStore) AllEntryIndicesFilter(ctx sdk.Context, prefix string, filter func(k, v []byte) bool) []string { store := fs.getEntryIndexStore(ctx) entryPrefix := KeyPrefix(prefix) - iterator := sdk.KVStorePrefixIterator(store, entryPrefix) + iterator := storetypes.KVStorePrefixIterator(store, entryPrefix) defer iterator.Close() // iterate over the store's values and save the indices in a list diff --git a/x/fixationstore/types/fixationstore_test.go b/x/fixationstore/types/fixationstore_test.go index 3c5080f797..9354bfad77 100644 --- a/x/fixationstore/types/fixationstore_test.go +++ b/x/fixationstore/types/fixationstore_test.go @@ -5,13 +5,15 @@ import ( "strconv" "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/math" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/stretchr/testify/require" @@ -64,7 +66,7 @@ func runPlaybook(t *testing.T, ctx sdk.Context, fs []*FixationStore, playbook [] var dummy sdk.Coin for i := 0; i < countObj; i++ { - coins = append(coins, sdk.NewCoin("utest", sdk.NewInt(int64(i+1)))) + coins = append(coins, sdk.NewCoin("utest", math.NewInt(int64(i+1)))) } for _, play := range playbook { @@ -735,8 +737,8 @@ func TestGetAllEntries(t *testing.T) { } func initCtx(t *testing.T) (sdk.Context, *codec.ProtoCodec) { - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) @@ -746,12 +748,12 @@ func initCtx(t *testing.T) (sdk.Context, *codec.ProtoCodec) { require.NoError(t, stateStore.LoadLatestVersion()) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.TestingLogger()) + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewTestLogger(t)) return ctx, cdc } var ( - mockStoreKey = sdk.NewKVStoreKey("storeKey") + mockStoreKey = storetypes.NewKVStoreKey("storeKey") mockMemStoreKey = storetypes.NewMemoryStoreKey("storeMemKey") ) diff --git a/x/fixationstore/types/genesis_test.go b/x/fixationstore/types/genesis_test.go index f9ac33c679..9d5cc0d744 100644 --- a/x/fixationstore/types/genesis_test.go +++ b/x/fixationstore/types/genesis_test.go @@ -3,8 +3,8 @@ package types import ( "testing" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" ) @@ -43,13 +43,13 @@ func TestGenesis(t *testing.T) { store1 := prefix.NewStore( ctx.KVStore(fs.storeKey), KeyPrefix(fs.prefix)) - iterator1 := sdk.KVStorePrefixIterator(store1, []byte{}) + iterator1 := storetypes.KVStorePrefixIterator(store1, []byte{}) defer iterator1.Close() store2 := prefix.NewStore( emptyCtx.KVStore(fs.storeKey), KeyPrefix(fs.prefix)) - iterator2 := sdk.KVStorePrefixIterator(store2, []byte{}) + iterator2 := storetypes.KVStorePrefixIterator(store2, []byte{}) defer iterator2.Close() for ; iterator1.Valid(); iterator1.Next() { diff --git a/x/fixationstore/types/query.pb.go b/x/fixationstore/types/query.pb.go index 232853364e..7cbd3a12fc 100644 --- a/x/fixationstore/types/query.pb.go +++ b/x/fixationstore/types/query.pb.go @@ -728,6 +728,7 @@ func _Query_Entry_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.fixationstore.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/pairing/client/cli/tx_distribute_provider_stake.go b/x/pairing/client/cli/tx_distribute_provider_stake.go index f8808b5275..51c2442f74 100644 --- a/x/pairing/client/cli/tx_distribute_provider_stake.go +++ b/x/pairing/client/cli/tx_distribute_provider_stake.go @@ -58,7 +58,7 @@ func CmdDistributeProviderStake() *cobra.Command { type data struct { chain string original math.Int - percent sdk.Dec + percent math.LegacyDec target math.Int diff math.Int } @@ -69,11 +69,11 @@ func CalculateDistbiruitions(provider string, entries []epochstoragetypes.StakeE return nil, fmt.Errorf("args must: chain,percent,chain,percent") } - totalStake := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) - totalP := sdk.ZeroDec() + totalStake := sdk.NewCoin(commontypes.TokenDenom, math.ZeroInt()) + totalP := math.LegacyZeroDec() distributions := []data{} for i := 0; i < len(splitedArgs); i += 2 { - p, err := sdk.NewDecFromStr(splitedArgs[i+1]) + p, err := math.LegacyNewDecFromStr(splitedArgs[i+1]) if err != nil { return nil, err } @@ -89,7 +89,7 @@ func CalculateDistbiruitions(provider string, entries []epochstoragetypes.StakeE if len(distributions) != len(entries) { return nil, fmt.Errorf("must specify percentages for all chains the provider is staked on") } - if !totalP.Equal(sdk.NewDec(100)) { + if !totalP.Equal(math.LegacyNewDec(100)) { return nil, fmt.Errorf("total percentages must be 100") } diff --git a/x/pairing/client/cli/tx_simulate_relay_payment.go b/x/pairing/client/cli/tx_simulate_relay_payment.go index 3d9d5986ad..87b11f8763 100644 --- a/x/pairing/client/cli/tx_simulate_relay_payment.go +++ b/x/pairing/client/cli/tx_simulate_relay_payment.go @@ -5,10 +5,10 @@ import ( "strconv" "time" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/utils/sigs" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -164,17 +164,17 @@ func extractQoSFlag(qosValues []string) (qosReport *types.QualityOfServiceReport return nil, utils.LavaFormatError("expected 3 values for QoSValuesFlag", nil, utils.Attribute{Key: "QoSValues", Value: qosValues}) } // Convert string values to Dec - latency, err := sdk.NewDecFromStr(qosValues[0]) + latency, err := math.LegacyNewDecFromStr(qosValues[0]) if err != nil { return nil, utils.LavaFormatError("invalid latency value", err) } - availability, err := sdk.NewDecFromStr(qosValues[1]) + availability, err := math.LegacyNewDecFromStr(qosValues[1]) if err != nil { return nil, utils.LavaFormatError("invalid availability value", err) } - syncScore, err := sdk.NewDecFromStr(qosValues[2]) + syncScore, err := math.LegacyNewDecFromStr(qosValues[2]) if err != nil { return nil, utils.LavaFormatError("invalid sync score value", err) } diff --git a/x/pairing/client/cli/tx_stake_provider.go b/x/pairing/client/cli/tx_stake_provider.go index 7c377f03b2..5d98561f3a 100644 --- a/x/pairing/client/cli/tx_stake_provider.go +++ b/x/pairing/client/cli/tx_stake_provider.go @@ -7,11 +7,11 @@ import ( "strconv" "strings" + "cosmossdk.io/x/feegrant" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/lavanet/lava/v4/utils" conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" @@ -456,10 +456,5 @@ func CreateGrantFeeMsg(granter string, grantee string) (*feegrant.MsgGrantAllowa ) } - err = msg.ValidateBasic() - if err != nil { - return nil, err - } - return msg, nil } diff --git a/x/pairing/client/cli/tx_unstake_provider.go b/x/pairing/client/cli/tx_unstake_provider.go index c5f380a063..4d13c7de98 100644 --- a/x/pairing/client/cli/tx_unstake_provider.go +++ b/x/pairing/client/cli/tx_unstake_provider.go @@ -6,11 +6,11 @@ import ( "strconv" "strings" + "cosmossdk.io/x/feegrant" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/lavanet/lava/v4/utils" dualstakingclient "github.com/lavanet/lava/v4/x/dualstaking/client/cli" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" diff --git a/x/pairing/handler.go b/x/pairing/handler.go deleted file mode 100644 index b8ebc5684d..0000000000 --- a/x/pairing/handler.go +++ /dev/null @@ -1,45 +0,0 @@ -package pairing - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/pairing/keeper" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgStakeProvider: - res, err := msgServer.StakeProvider(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUnstakeProvider: - res, err := msgServer.UnstakeProvider(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRelayPayment: - res, err := msgServer.RelayPayment(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgFreezeProvider: - res, err := msgServer.FreezeProvider(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUnfreezeProvider: - res, err := msgServer.UnfreezeProvider(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgMoveProviderStake: - res, err := msgServer.MoveProviderStake(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/pairing/keeper/badge_used_cu.go b/x/pairing/keeper/badge_used_cu.go index 2ba9434267..f36449e525 100644 --- a/x/pairing/keeper/badge_used_cu.go +++ b/x/pairing/keeper/badge_used_cu.go @@ -3,7 +3,8 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/pairing/types" @@ -57,7 +58,7 @@ func (k Keeper) RemoveBadgeUsedCu( // GetAllBadgeUsedCu returns all badgeUsedCu func (k Keeper) GetAllBadgeUsedCu(ctx sdk.Context) (list []types.BadgeUsedCu) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BadgeUsedCuKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { diff --git a/x/pairing/keeper/cu_tracker_test.go b/x/pairing/keeper/cu_tracker_test.go index 46ba860cb8..6d8c37e470 100644 --- a/x/pairing/keeper/cu_tracker_test.go +++ b/x/pairing/keeper/cu_tracker_test.go @@ -154,7 +154,7 @@ func TestTrackedCuWithDelegations(t *testing.T) { // delegate testStake/2 (with commission=0) -> provider should get 66% of the reward _, delegator := ts.AddAccount(common.CONSUMER, 1, testBalance) - _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake/2))) require.NoError(t, err) ts.AdvanceEpoch() @@ -183,18 +183,18 @@ func TestTrackedCuWithQos(t *testing.T) { require.NoError(t, err) badQoS := &types.QualityOfServiceReport{ - Latency: sdk.ZeroDec(), - Availability: sdk.ZeroDec(), - Sync: sdk.ZeroDec(), + Latency: math.LegacyZeroDec(), + Availability: math.LegacyZeroDec(), + Sync: math.LegacyZeroDec(), } goodQos := &types.QualityOfServiceReport{ - Latency: sdk.OneDec(), - Availability: sdk.OneDec(), - Sync: sdk.OneDec(), + Latency: math.LegacyOneDec(), + Availability: math.LegacyOneDec(), + Sync: math.LegacyOneDec(), } // Simulate QosWeight to be 0.5 - the default value at the time of this writing - initQos := sdk.NewDecWithPrec(5, 1) + initQos := math.LegacyNewDecWithPrec(5, 1) initQosBytes, _ := initQos.MarshalJSON() initQosStr := string(initQosBytes) @@ -493,7 +493,7 @@ func TestProviderMonthlyPayoutQuery(t *testing.T) { // delegate testStake/2 (with commission=0) -> provider should get 66% of the reward _, delegator := ts.AddAccount(common.CONSUMER, 1, testBalance) - _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake/2))) require.NoError(t, err) ts.AdvanceEpoch() ts.AdvanceMonths(1).AdvanceEpoch() // advance first month of delegation so it'll apply @@ -612,7 +612,7 @@ func TestProviderMonthlyPayoutQueryWithContributor(t *testing.T) { // delegate testStake/2 (with commission=0) -> provider should get 66% of the reward _, delegator := ts.AddAccount(common.CONSUMER, 1, testBalance) - _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake/2))) require.NoError(t, err) delegationTime := ts.BlockTime() ts.AdvanceEpoch() diff --git a/x/pairing/keeper/delegator_rewards_test.go b/x/pairing/keeper/delegator_rewards_test.go index e7038f9285..aaed40a7bd 100644 --- a/x/pairing/keeper/delegator_rewards_test.go +++ b/x/pairing/keeper/delegator_rewards_test.go @@ -67,14 +67,14 @@ func TestProviderDelegatorsRewards(t *testing.T) { delegationAmount := testStake // delegate - amount1 := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(tt.d1Amount*delegationAmount/100)) + amount1 := sdk.NewCoin(ts.TokenDenom(), math.NewInt(tt.d1Amount*delegationAmount/100)) if amount1.IsZero() { - amount1.Amount = sdk.OneInt() + amount1.Amount = math.OneInt() } _, err = ts.TxDualstakingDelegate(delegator1, provider, amount1) require.NoError(t, err) - amount2 := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(tt.d2Amount*delegationAmount/100)) + amount2 := sdk.NewCoin(ts.TokenDenom(), math.NewInt(tt.d2Amount*delegationAmount/100)) _, err = ts.TxDualstakingDelegate(delegator2, provider, amount2) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -95,7 +95,7 @@ func TestProviderDelegatorsRewards(t *testing.T) { require.Equal(t, 3, len(res.Delegations)) // calc useful consts - totalReward := sdk.NewDec(int64(relayCuSum)) + totalReward := math.LegacyNewDec(int64(relayCuSum)) // send relay and check provider balance according to expected providerRewardPerc (done inside payAndVerifyBalance) relayPaymentMessage = sendRelay(ts, provider, clientAcc, []string{ts.spec.Index}) @@ -186,7 +186,7 @@ func TestProviderRewardWithCommission(t *testing.T) { ts.AdvanceEpoch() // to apply pairing - delegationAmount1 := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) + delegationAmount1 := sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake)) _, err = ts.TxDualstakingDelegate(delegator1, provider, delegationAmount1) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -210,7 +210,7 @@ func TestProviderRewardWithCommission(t *testing.T) { totalReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.NewInt(int64(relayCuSum)))) relevantDelegations := []dualstakingtypes.Delegation{} - totalDelegations := sdk.ZeroInt() + totalDelegations := math.ZeroInt() var selfdelegation dualstakingtypes.Delegation for _, d := range res.Delegations { if d.Delegator != stakeEntry.Vault { @@ -223,7 +223,7 @@ func TestProviderRewardWithCommission(t *testing.T) { providerReward, _ := ts.Keepers.Dualstaking.CalcRewards(ts.Ctx, totalReward, totalDelegations, selfdelegation, relevantDelegations, stakeEntry.DelegateCommission) - require.True(t, totalReward.IsEqual(providerReward)) + require.True(t, totalReward.Equal(providerReward)) // check that the expected reward equals to the provider's new balance minus old balance relayPaymentMessage := sendRelay(ts, provider, clientAcc, []string{ts.spec.Index}) @@ -316,7 +316,7 @@ func TestQueryDelegatorRewards(t *testing.T) { makeProviderCommissionZero(ts, provider1) makeProviderCommissionZero(ts, provider2) - delegationAmount := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) + delegationAmount := sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake)) _, err = ts.TxDualstakingDelegate(delegator1, provider1, delegationAmount) require.NoError(t, err) _, err = ts.TxDualstakingDelegate(delegator1, provider1, delegationAmount) @@ -442,7 +442,7 @@ func TestDelegationTimestamp(t *testing.T) { // delegate and check the timestamp is equal to current time + month currentTimeAfterMonth := ts.BlockTime().AddDate(0, 0, 7).UTC().Unix() - _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -458,8 +458,8 @@ func TestDelegationTimestamp(t *testing.T) { // advance time and delegate again to verify that the timestamp hasn't changed ts.AdvanceMonths(1) - expectedDelegation := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(2*testStake)) - _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + expectedDelegation := sdk.NewCoin(ts.TokenDenom(), math.NewInt(2*testStake)) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -493,7 +493,7 @@ func TestDelegationFirstMonthPairing(t *testing.T) { // delegate and check the delegation's timestamp is equal than nowPlusWeekTime nowPlusWeekTime := ts.BlockTime().AddDate(0, 0, 7).UTC().Unix() - _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -535,7 +535,7 @@ func TestDelegationFirstMonthReward(t *testing.T) { // delegate and check the delegation's timestamp is equal to nowPlusWeekTime nowPlusWeekTime := ts.BlockTime().AddDate(0, 0, 7).UTC().Unix() - _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -552,11 +552,11 @@ func TestDelegationFirstMonthReward(t *testing.T) { // the delegation will already mature enough to be part of the reward process. To go around // this, we'll call the reward calculation function directly with a fabricated reward just to // verify that the delegator gets nothing from the total reward - fakeReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + fakeReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) providerReward, err := ts.Keepers.Dualstaking.RewardProvidersAndDelegators(ts.Ctx, provider, ts.spec.Index, fakeReward, subscriptiontypes.ModuleName, true, true, true) require.NoError(t, err) - require.True(t, fakeReward.IsEqual(providerReward)) // if the delegator got anything, this would fail + require.True(t, fakeReward.Equal(providerReward)) // if the delegator got anything, this would fail // verify again that the delegator has no unclaimed rewards resRewards, err := ts.QueryDualstakingDelegatorRewards(delegator, provider, ts.spec.Index) @@ -590,7 +590,7 @@ func TestRedelegationFirstMonthReward(t *testing.T) { // delegate and check the delegation's timestamp is equal to nowPlusWeekTime nowPlusWeekTime := ts.BlockTime().AddDate(0, 0, 7).UTC().Unix() - _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -614,15 +614,15 @@ func TestRedelegationFirstMonthReward(t *testing.T) { // this, we'll call the reward calculation function directly with a fabricated reward just to // verify that the delegator gets nothing from the total reward from provider1 but does get // reward from provider - fakeReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + fakeReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) provider1Reward, err := ts.Keepers.Dualstaking.RewardProvidersAndDelegators(ts.Ctx, provider1, ts.spec.Index, fakeReward, subscriptiontypes.ModuleName, true, false, true) require.NoError(t, err) - require.True(t, fakeReward.IsEqual(provider1Reward)) // if the delegator got anything, this would fail + require.True(t, fakeReward.Equal(provider1Reward)) // if the delegator got anything, this would fail providerReward, err := ts.Keepers.Dualstaking.RewardProvidersAndDelegators(ts.Ctx, provider, ts.spec.Index, fakeReward, subscriptiontypes.ModuleName, true, false, true) require.NoError(t, err) - require.False(t, fakeReward.IsEqual(providerReward)) // the delegator should have rewards + require.False(t, fakeReward.Equal(providerReward)) // the delegator should have rewards // verify again that the delegator has no unclaimed rewards with provider1 but has some with provider resRewards, err := ts.QueryDualstakingDelegatorRewards(delegator, provider1, ts.spec.Index) @@ -644,7 +644,7 @@ func TestDelegatorRewardProviderAddingChain(t *testing.T) { clientAcc, client := ts.AddAccount(common.CONSUMER, 0, testBalance) makeProviderCommissionZero(ts, provider) - _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), math.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -699,7 +699,7 @@ func TestDelegatorRewardProviderAddingChain(t *testing.T) { _, err = ts.TxPairingRelayPayment(relayPaymentMessage.Creator, relayPaymentMessage.Relays...) require.Nil(ts.T, err) - err = ts.Keepers.Pairing.MoveProviderStake(ts.Ctx, provider, ts.spec.Index, spec1.Index, sdk.NewCoin(ts.BondDenom(), sdk.NewInt(testStake/10))) + err = ts.Keepers.Pairing.MoveProviderStake(ts.Ctx, provider, ts.spec.Index, spec1.Index, sdk.NewCoin(ts.BondDenom(), math.NewInt(testStake/10))) require.Nil(ts.T, err) // advance month + blocksToSave + 1 to trigger the provider monthly payment diff --git a/x/pairing/keeper/discipline.go b/x/pairing/keeper/discipline.go index aa0f8d732a..24f40864c3 100644 --- a/x/pairing/keeper/discipline.go +++ b/x/pairing/keeper/discipline.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" ) @@ -23,10 +24,14 @@ func (k Keeper) BailEntry(ctx sdk.Context, address string, chainID string, bail return nil } -func (k Keeper) SlashEntry(ctx sdk.Context, address string, chainID string, percentage sdk.Dec) (sdk.Coin, error) { +func (k Keeper) SlashEntry(ctx sdk.Context, address string, chainID string, percentage math.LegacyDec) (sdk.Coin, error) { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return sdk.NewCoin(bondDenom, math.ZeroInt()), err + } // TODO: jail user, and count problems if !utils.IsBech32Address(address) { - return sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()), fmt.Errorf("invalid address") + return sdk.NewCoin(bondDenom, math.ZeroInt()), fmt.Errorf("invalid address") } - return sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()), nil + return sdk.NewCoin(bondDenom, math.ZeroInt()), nil } diff --git a/x/pairing/keeper/epoch_cu.go b/x/pairing/keeper/epoch_cu.go index a7763b27db..1256d3018f 100644 --- a/x/pairing/keeper/epoch_cu.go +++ b/x/pairing/keeper/epoch_cu.go @@ -1,8 +1,9 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/cachekv" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/cachekv" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/pairing/types" @@ -36,7 +37,7 @@ func (k Keeper) IsUniqueEpochSessionExists(ctx sdk.Context, epoch uint64, provid // RemoveAllUniqueEpochSession removes all the UniqueEpochSession objects from the store for a specific epoch func (k Keeper) RemoveAllUniqueEpochSession(ctx sdk.Context, epoch uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) + iterator := storetypes.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { store.Delete(iterator.Key()) @@ -47,7 +48,7 @@ func (k Keeper) RemoveAllUniqueEpochSession(ctx sdk.Context, epoch uint64) { func (k Keeper) GetAllUniqueEpochSessionForEpoch(ctx sdk.Context, epoch uint64) []string { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) // Get an iterator with no prefix to iterate over all keys + iterator := storetypes.KVStorePrefixIterator(store, utils.Serialize(epoch)) // Get an iterator with no prefix to iterate over all keys defer iterator.Close() var keys []string @@ -62,7 +63,7 @@ func (k Keeper) GetAllUniqueEpochSessionForEpoch(ctx sdk.Context, epoch uint64) func (k Keeper) GetAllUniqueEpochSessionStore(ctx sdk.Context) []types.UniqueEpochSessionGenesis { info := []types.UniqueEpochSessionGenesis{} store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.UniqueEpochSessionPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys defer iterator.Close() for ; iterator.Valid(); iterator.Next() { epoch, provider, chainID, project, sessionID, err := types.DecodeUniqueEpochSessionKey(string(iterator.Key())) @@ -105,7 +106,7 @@ func (k Keeper) GetProviderEpochCu(ctx sdk.Context, epoch uint64, provider strin // RemoveProviderEpochCu removes a ProviderEpochCu from the store func (k Keeper) RemoveAllProviderEpochCu(ctx sdk.Context, epoch uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) + iterator := storetypes.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { store.Delete(iterator.Key()) @@ -116,7 +117,7 @@ func (k Keeper) RemoveAllProviderEpochCu(ctx sdk.Context, epoch uint64) { func (k Keeper) GetAllProviderEpochCuStore(ctx sdk.Context) []types.ProviderEpochCuGenesis { info := []types.ProviderEpochCuGenesis{} store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys defer iterator.Close() for ; iterator.Valid(); iterator.Next() { epoch, provider, chainID, err := types.DecodeProviderEpochCuKey(string(iterator.Key())) @@ -167,7 +168,7 @@ func (k Keeper) RemoveProviderEpochComplainerCu(ctx sdk.Context, epoch uint64, p // RemoveProviderEpochComplainerCu removes a ProviderEpochCu from the store func (k Keeper) RemoveAllProviderEpochComplainerCu(ctx sdk.Context, epoch uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) + iterator := storetypes.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { store.Delete(iterator.Key()) @@ -178,7 +179,7 @@ func (k Keeper) RemoveAllProviderEpochComplainerCu(ctx sdk.Context, epoch uint64 func (k Keeper) GetAllProviderEpochComplainerCuStore(ctx sdk.Context) []types.ProviderEpochComplainerCuGenesis { info := []types.ProviderEpochComplainerCuGenesis{} store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys defer iterator.Close() for ; iterator.Valid(); iterator.Next() { epoch, provider, chainID, err := types.DecodeProviderEpochCuKey(string(iterator.Key())) @@ -230,7 +231,7 @@ func (k Keeper) RemoveProviderConsumerEpochCu(ctx sdk.Context, epoch uint64, pro func (k Keeper) GetAllProviderConsumerEpochCu(ctx sdk.Context, epoch uint64) []types.ProviderConsumerEpochCuGenesis { providerConsumerEpochCus := []types.ProviderConsumerEpochCuGenesis{} store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) + iterator := storetypes.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { epoch, provider, project, chainID, err := types.DecodeProviderConsumerEpochCuKey(string(iterator.Key())) @@ -256,7 +257,7 @@ func (k Keeper) GetAllProviderConsumerEpochCu(ctx sdk.Context, epoch uint64) []t func (k Keeper) GetAllProviderConsumerEpochCuStore(ctx sdk.Context) []types.ProviderConsumerEpochCuGenesis { info := []types.ProviderConsumerEpochCuGenesis{} store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.ProviderConsumerEpochCuPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) // Get an iterator with no prefix to iterate over all keys defer iterator.Close() for ; iterator.Valid(); iterator.Next() { epoch, provider, project, chainID, err := types.DecodeProviderConsumerEpochCuKey(string(iterator.Key())) diff --git a/x/pairing/keeper/grpc_query_params_test.go b/x/pairing/keeper/grpc_query_params_test.go index be349519c9..01cc54f928 100644 --- a/x/pairing/keeper/grpc_query_params_test.go +++ b/x/pairing/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.PairingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/pairing/keeper/grpc_query_provider_monthly_payout.go b/x/pairing/keeper/grpc_query_provider_monthly_payout.go index 15c25fde77..47218f0863 100644 --- a/x/pairing/keeper/grpc_query_provider_monthly_payout.go +++ b/x/pairing/keeper/grpc_query_provider_monthly_payout.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/pairing/types" @@ -60,17 +61,20 @@ func (k Keeper) ProviderMonthlyPayout(goCtx context.Context, req *types.QueryPro ) } - if plan.Price.Amount.Quo(sdk.NewIntFromUint64(totalCuTracked)).GT(sdk.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU)) { - totalTokenAmount = sdk.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU * totalCuTracked) + if plan.Price.Amount.Quo(math.NewIntFromUint64(totalCuTracked)).GT(math.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU)) { + totalTokenAmount = math.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU * totalCuTracked) } totalMonthlyReward := k.subscriptionKeeper.CalcTotalMonthlyReward(ctx, totalTokenAmount, providerCu, totalCuTracked) - denom := k.stakingKeeper.BondDenom(ctx) + denom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } validatorsFee, communityFee, err := k.subscriptionKeeper.CalculateParticipationFees(ctx, sdk.NewCoin(denom, totalMonthlyReward)) if err != nil { return nil, err } - providerRewardAfterFees := sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), totalMonthlyReward.Sub(validatorsFee.AmountOf(denom)).Sub(communityFee.AmountOf(denom)))) + providerRewardAfterFees := sdk.NewCoins(sdk.NewCoin(denom, totalMonthlyReward.Sub(validatorsFee.AmountOf(denom)).Sub(communityFee.AmountOf(denom)))) // calculate only the provider reward providerReward, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, req.Provider, chainID, providerRewardAfterFees, subsciptiontypes.ModuleName, true, true, true) @@ -81,9 +85,9 @@ func (k Keeper) ProviderMonthlyPayout(goCtx context.Context, req *types.QueryPro details = append(details, &types.SubscriptionPayout{ Subscription: sub, ChainId: chainID, - Amount: providerReward.AmountOf(k.stakingKeeper.BondDenom(ctx)).Uint64(), + Amount: providerReward.AmountOf(denom).Uint64(), }) - total += providerReward.AmountOf(k.stakingKeeper.BondDenom(ctx)).Uint64() + total += providerReward.AmountOf(denom).Uint64() } } diff --git a/x/pairing/keeper/grpc_query_subscription_monthly_payout.go b/x/pairing/keeper/grpc_query_subscription_monthly_payout.go index 7d9d0eeab4..dccaf9e7ac 100644 --- a/x/pairing/keeper/grpc_query_subscription_monthly_payout.go +++ b/x/pairing/keeper/grpc_query_subscription_monthly_payout.go @@ -5,6 +5,7 @@ import ( "fmt" "sort" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/pairing/types" @@ -57,8 +58,8 @@ func (k Keeper) SubscriptionMonthlyPayout(goCtx context.Context, req *types.Quer ) } - if plan.Price.Amount.Quo(sdk.NewIntFromUint64(totalCuTracked)).GT(sdk.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU)) { - totalTokenAmount = sdk.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU * totalCuTracked) + if plan.Price.Amount.Quo(math.NewIntFromUint64(totalCuTracked)).GT(math.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU)) { + totalTokenAmount = math.NewIntFromUint64(subsciption.LIMIT_TOKEN_PER_CU * totalCuTracked) } totalMonthlyReward := k.subscriptionKeeper.CalcTotalMonthlyReward(ctx, totalTokenAmount, providerCu, totalCuTracked) diff --git a/x/pairing/keeper/helpers_test.go b/x/pairing/keeper/helpers_test.go index ed1d64adcb..bcc3f7741e 100644 --- a/x/pairing/keeper/helpers_test.go +++ b/x/pairing/keeper/helpers_test.go @@ -31,12 +31,12 @@ func newTester(t *testing.T) *tester { err := ts.Keepers.BankKeeper.SetBalance(ts.Ctx, ts.Keepers.AccountKeeper.GetModuleAddress(string(rewardstypes.ValidatorsRewardsAllocationPoolName)), - sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), sdk.ZeroInt()))) + sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.ZeroInt()))) require.Nil(ts.T, err) err = ts.Keepers.BankKeeper.SetBalance(ts.Ctx, ts.Keepers.AccountKeeper.GetModuleAddress(string(rewardstypes.ProvidersRewardsAllocationPool)), - sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), sdk.ZeroInt()))) + sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.ZeroInt()))) require.Nil(ts.T, err) ts.DisableParticipationFees() @@ -127,12 +127,12 @@ func (ts *tester) addProviderExtra( func (ts *tester) setupForPayments(providersCount, clientsCount, providersToPair int) *tester { err := ts.Keepers.BankKeeper.SetBalance(ts.Ctx, testutil.GetModuleAddress(string(rewardstypes.ValidatorsRewardsAllocationPoolName)), - sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), sdk.ZeroInt()))) + sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.ZeroInt()))) require.Nil(ts.T, err) err = ts.Keepers.BankKeeper.SetBalance(ts.Ctx, testutil.GetModuleAddress(string(rewardstypes.ProvidersRewardsAllocationPool)), - sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), sdk.ZeroInt()))) + sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.ZeroInt()))) require.Nil(ts.T, err) ts.addValidators(1) @@ -198,7 +198,7 @@ func (ts *tester) payAndVerifyBalance( var totalPaid uint64 qosWeight := ts.Keepers.Pairing.QoSWeight(ts.Ctx) - qosWeightComplement := sdk.OneDec().Sub(qosWeight) + qosWeightComplement := math.LegacyOneDec().Sub(qosWeight) for _, relay := range relayPayment.Relays { cuUsed := relay.CuSum @@ -237,7 +237,7 @@ func (ts *tester) payAndVerifyBalance( // verify provider's balance credit := sub.Sub.Credit.Amount.QuoRaw(int64(sub.Sub.DurationLeft)) - want := sdk.ZeroInt() + want := math.ZeroInt() if totalCuUsed != 0 { want = credit.MulRaw(int64(providerReward)).QuoRaw(int64(totalCuUsed)) } diff --git a/x/pairing/keeper/keeper.go b/x/pairing/keeper/keeper.go index 62050236aa..cad2d96e7b 100644 --- a/x/pairing/keeper/keeper.go +++ b/x/pairing/keeper/keeper.go @@ -3,10 +3,10 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/pairing/keeper/migrations.go b/x/pairing/keeper/migrations.go index da8dafc7e7..d4f4cd4fce 100644 --- a/x/pairing/keeper/migrations.go +++ b/x/pairing/keeper/migrations.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/lavanet/lava/v4/utils/lavaslices" @@ -71,8 +72,11 @@ func (m Migrator) MigrateVersion4To5(ctx sdk.Context) error { if err != nil { return err } - - metadata.TotalDelegations = sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()) + bondDenom, err := m.keeper.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + metadata.TotalDelegations = sdk.NewCoin(bondDenom, math.ZeroInt()) for _, d := range delegations { if d.Delegator != metadata.Vault { metadata.TotalDelegations = metadata.TotalDelegations.Add(d.Amount) @@ -81,12 +85,12 @@ func (m Migrator) MigrateVersion4To5(ctx sdk.Context) error { // fix entries with different vaults // count self delegations - TotalSelfDelegation := sdk.ZeroInt() + TotalSelfDelegation := math.ZeroInt() for _, e := range entries { if e.Vault != metadata.Vault { fmt.Println(address) - biggestVault.Stake = biggestVault.Stake.SubAmount(sdk.NewInt(1)) - e.Stake.Amount = sdk.OneInt() + biggestVault.Stake = biggestVault.Stake.SubAmount(math.NewInt(1)) + e.Stake.Amount = math.OneInt() e.Vault = metadata.Vault } else { TotalSelfDelegation = TotalSelfDelegation.Add(e.Stake.Amount) @@ -96,7 +100,7 @@ func (m Migrator) MigrateVersion4To5(ctx sdk.Context) error { // calculate delegate total and update the entry for _, entry := range entries { metadata.Chains = lavaslices.AddUnique(metadata.Chains, entry.Chain) - entry.DelegateTotal = sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), metadata.TotalDelegations.Amount.Mul(entry.Stake.Amount).Quo(TotalSelfDelegation)) + entry.DelegateTotal = sdk.NewCoin(bondDenom, metadata.TotalDelegations.Amount.Mul(entry.Stake.Amount).Quo(TotalSelfDelegation)) entry.Description = types1.Description{} m.keeper.epochStorageKeeper.SetStakeEntryCurrent(ctx, *entry) } diff --git a/x/pairing/keeper/msg_server_move_provider_stake.go b/x/pairing/keeper/msg_server_move_provider_stake.go index 7c9fb9b3d5..54725cce4b 100644 --- a/x/pairing/keeper/msg_server_move_provider_stake.go +++ b/x/pairing/keeper/msg_server_move_provider_stake.go @@ -3,6 +3,7 @@ package keeper import ( "context" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/pairing/types" @@ -45,5 +46,10 @@ func (k Keeper) MoveProviderStake(ctx sdk.Context, creator, srcChain, dstChain s k.epochStorageKeeper.SetStakeEntryCurrent(ctx, srcEntry) k.epochStorageKeeper.SetStakeEntryCurrent(ctx, dstEntry) - return k.dualstakingKeeper.AfterDelegationModified(ctx, srcEntry.Vault, srcEntry.Address, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()), false, true) + + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + return k.dualstakingKeeper.AfterDelegationModified(ctx, srcEntry.Vault, srcEntry.Address, sdk.NewCoin(bondDenom, math.ZeroInt()), false, true) } diff --git a/x/pairing/keeper/msg_server_relay_payment.go b/x/pairing/keeper/msg_server_relay_payment.go index a1ec9c0f3f..41d6d45e65 100644 --- a/x/pairing/keeper/msg_server_relay_payment.go +++ b/x/pairing/keeper/msg_server_relay_payment.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" commontypes "github.com/lavanet/lava/v4/utils/common/types" @@ -216,7 +217,7 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen } // pairing is valid, we can pay provider for work - rewardedCUDec := sdk.NewDecFromInt(sdk.NewIntFromUint64(rewardedCU)) + rewardedCUDec := math.LegacyNewDecFromInt(math.NewIntFromUint64(rewardedCU)) if len(msg.DescriptionString) > 20 { msg.DescriptionString = msg.DescriptionString[:20] @@ -246,7 +247,7 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen details["QoSSync"] = relay.QosReport.Sync.String() details["QoSScore"] = QoS.String() - rewardedCUDec = rewardedCUDec.Mul(QoS.Mul(k.QoSWeight(ctx)).Add(sdk.OneDec().Sub(k.QoSWeight(ctx)))) // reward*QOSScore*QOSWeight + reward*(1-QOSWeight) = reward*(QOSScore*QOSWeight + (1-QOSWeight)) + rewardedCUDec = rewardedCUDec.Mul(QoS.Mul(k.QoSWeight(ctx)).Add(math.LegacyOneDec().Sub(k.QoSWeight(ctx)))) // reward*QOSScore*QOSWeight + reward*(1-QOSWeight) = reward*(QOSScore*QOSWeight + (1-QOSWeight)) } if relay.QosExcellenceReport != nil { diff --git a/x/pairing/keeper/msg_server_relay_payment_gov_test.go b/x/pairing/keeper/msg_server_relay_payment_gov_test.go index 3370fdab89..8abfb9b79b 100644 --- a/x/pairing/keeper/msg_server_relay_payment_gov_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_gov_test.go @@ -4,7 +4,7 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" "github.com/lavanet/lava/v4/testutil/common" "github.com/lavanet/lava/v4/utils/lavaslices" "github.com/lavanet/lava/v4/utils/sigs" @@ -27,18 +27,18 @@ func TestRelayPaymentGovQosWeightChange(t *testing.T) { // Create badQos: to see the effect of changing QosWeight, the provider need to // provide bad service (here, his score is 0%) badQoS := &pairingtypes.QualityOfServiceReport{ - Latency: sdk.ZeroDec(), - Availability: sdk.ZeroDec(), - Sync: sdk.ZeroDec(), + Latency: math.LegacyZeroDec(), + Availability: math.LegacyZeroDec(), + Sync: math.LegacyZeroDec(), } goodQoS := &pairingtypes.QualityOfServiceReport{ - Latency: sdk.OneDec(), - Availability: sdk.OneDec(), - Sync: sdk.OneDec(), + Latency: math.LegacyOneDec(), + Availability: math.LegacyOneDec(), + Sync: math.LegacyOneDec(), } // Simulate QosWeight to be 0.5 - the default value at the time of this writing - initQos := sdk.NewDecWithPrec(5, 1) + initQos := math.LegacyNewDecWithPrec(5, 1) initQosBytes, _ := initQos.MarshalJSON() initQosStr := string(initQosBytes) @@ -53,7 +53,7 @@ func TestRelayPaymentGovQosWeightChange(t *testing.T) { epochQosWeightFiftyPercent := ts.EpochStart() // Create new QosWeight value (=0.7) for SimulateParamChange() for testing - newQos := sdk.NewDecWithPrec(7, 1) + newQos := math.LegacyNewDecWithPrec(7, 1) newQosBytes, _ := newQos.MarshalJSON() newQosStr := string(newQosBytes) diff --git a/x/pairing/keeper/msg_server_relay_payment_test.go b/x/pairing/keeper/msg_server_relay_payment_test.go index 2103c22bcb..0f62ba44e8 100644 --- a/x/pairing/keeper/msg_server_relay_payment_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/common" commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" @@ -397,17 +398,17 @@ func TestRelayPaymentOldEpochs(t *testing.T) { func TestRelayPaymentQoS(t *testing.T) { tests := []struct { name string - availability sdk.Dec - latency sdk.Dec - sync sdk.Dec + availability math.LegacyDec + latency math.LegacyDec + sync math.LegacyDec valid bool }{ - {"InvalidLatency", sdk.NewDecWithPrec(2, 0), sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(1, 0), false}, - {"InvalidAvailability", sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(2, 0), sdk.NewDecWithPrec(1, 0), false}, - {"Invalidsync", sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(2, 0), false}, - {"PerfectScore", sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(1, 0), true}, - {"MediumScore", sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(1, 0), sdk.NewDecWithPrec(1, 0), true}, - {"ZeroScore", sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), true}, + {"InvalidLatency", math.LegacyNewDecWithPrec(2, 0), math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(1, 0), false}, + {"InvalidAvailability", math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(2, 0), math.LegacyNewDecWithPrec(1, 0), false}, + {"Invalidsync", math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(2, 0), false}, + {"PerfectScore", math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(1, 0), true}, + {"MediumScore", math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(1, 0), math.LegacyNewDecWithPrec(1, 0), true}, + {"ZeroScore", math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec(), true}, } for _, tt := range tests { @@ -452,9 +453,9 @@ func TestVaultProviderRelayPayment(t *testing.T) { providerAcc, provider := ts.GetAccount(common.PROVIDER, 0) vault := providerAcc.GetVaultAddr() qos := &types.QualityOfServiceReport{ - Latency: sdk.OneDec(), - Availability: sdk.OneDec(), - Sync: sdk.OneDec(), + Latency: math.LegacyOneDec(), + Availability: math.LegacyOneDec(), + Sync: math.LegacyOneDec(), } tests := []struct { @@ -561,9 +562,9 @@ func TestCuUsageInProjectsAndSubscription(t *testing.T) { ts.AdvanceEpoch() qos := types.QualityOfServiceReport{ - Latency: sdk.OneDec(), - Availability: sdk.OneDec(), - Sync: sdk.OneDec(), + Latency: math.LegacyOneDec(), + Availability: math.LegacyOneDec(), + Sync: math.LegacyOneDec(), } relaySession := ts.newRelaySession(providerAddr, 0, 1, ts.BlockHeight(), 0) @@ -601,9 +602,9 @@ func TestBadgeValidation(t *testing.T) { badgeAcct, _ := ts.AddAccount("badge", 0, testBalance) qos := &types.QualityOfServiceReport{ - Latency: sdk.NewDecWithPrec(1, 0), - Availability: sdk.NewDecWithPrec(1, 0), - Sync: sdk.NewDecWithPrec(1, 0), + Latency: math.LegacyNewDecWithPrec(1, 0), + Availability: math.LegacyNewDecWithPrec(1, 0), + Sync: math.LegacyNewDecWithPrec(1, 0), } epochStart := ts.EpochStart() @@ -692,9 +693,9 @@ func TestAddressEpochBadgeMap(t *testing.T) { var relays []*types.RelaySession for i := 0; i < 5; i++ { qos := &types.QualityOfServiceReport{ - Latency: sdk.NewDecWithPrec(1, 0), - Availability: sdk.NewDecWithPrec(1, 0), - Sync: sdk.NewDecWithPrec(1, 0), + Latency: math.LegacyNewDecWithPrec(1, 0), + Availability: math.LegacyNewDecWithPrec(1, 0), + Sync: math.LegacyNewDecWithPrec(1, 0), } // vary session ID to avoid double spending @@ -742,9 +743,9 @@ func TestBadgeCuAllocationEnforcement(t *testing.T) { badge.ProjectSig = sig qos := &types.QualityOfServiceReport{ - Latency: sdk.NewDecWithPrec(1, 0), - Availability: sdk.NewDecWithPrec(1, 0), - Sync: sdk.NewDecWithPrec(1, 0), + Latency: math.LegacyNewDecWithPrec(1, 0), + Availability: math.LegacyNewDecWithPrec(1, 0), + Sync: math.LegacyNewDecWithPrec(1, 0), } tests := []struct { @@ -816,9 +817,9 @@ func TestBadgeUsedCuMapTimeout(t *testing.T) { badge.ProjectSig = sig qos := &types.QualityOfServiceReport{ - Latency: sdk.NewDecWithPrec(1, 0), - Availability: sdk.NewDecWithPrec(1, 0), - Sync: sdk.NewDecWithPrec(1, 0), + Latency: math.LegacyNewDecWithPrec(1, 0), + Availability: math.LegacyNewDecWithPrec(1, 0), + Sync: math.LegacyNewDecWithPrec(1, 0), } relayNum := 5 @@ -896,9 +897,9 @@ func TestBadgeDifferentProvidersCuAllocation(t *testing.T) { badge.ProjectSig = sig qos := &types.QualityOfServiceReport{ - Latency: sdk.NewDecWithPrec(1, 0), - Availability: sdk.NewDecWithPrec(1, 0), - Sync: sdk.NewDecWithPrec(1, 0), + Latency: math.LegacyNewDecWithPrec(1, 0), + Availability: math.LegacyNewDecWithPrec(1, 0), + Sync: math.LegacyNewDecWithPrec(1, 0), } cuSum := badgeCuAllocation @@ -952,7 +953,7 @@ func TestIntOverflow(t *testing.T) { Description: "whale", Type: "rpc", Block: ts.BlockHeight(), - Price: sdk.NewCoin(commonconsts.TestTokenDenom, sdk.NewInt(1000)), + Price: sdk.NewCoin(commonconsts.TestTokenDenom, math.NewInt(1000)), AllowOveruse: true, OveruseRate: 10, AnnualDiscountPercentage: 20, @@ -965,7 +966,7 @@ func TestIntOverflow(t *testing.T) { Description: "whale2", Type: "rpc", Block: ts.BlockHeight(), - Price: sdk.NewCoin(commonconsts.TestTokenDenom, sdk.NewInt(1001)), + Price: sdk.NewCoin(commonconsts.TestTokenDenom, math.NewInt(1001)), AllowOveruse: true, OveruseRate: 10, AnnualDiscountPercentage: 20, diff --git a/x/pairing/keeper/msg_server_stake_provider.go b/x/pairing/keeper/msg_server_stake_provider.go index fbc049a17b..9d8455cf60 100644 --- a/x/pairing/keeper/msg_server_stake_provider.go +++ b/x/pairing/keeper/msg_server_stake_provider.go @@ -11,7 +11,12 @@ import ( func (k msgServer) StakeProvider(goCtx context.Context, msg *types.MsgStakeProvider) (*types.MsgStakeProviderResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), msg.Amount, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return &types.MsgStakeProviderResponse{}, err + } + + if err := utils.ValidateCoins(ctx, bondDenom, msg.Amount, false); err != nil { return &types.MsgStakeProviderResponse{}, err } diff --git a/x/pairing/keeper/msg_server_stake_provider_test.go b/x/pairing/keeper/msg_server_stake_provider_test.go index ccacd1be01..0666b9dd29 100644 --- a/x/pairing/keeper/msg_server_stake_provider_test.go +++ b/x/pairing/keeper/msg_server_stake_provider_test.go @@ -653,7 +653,7 @@ func TestStakeEndpoints(t *testing.T) { }, } - amount := common.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), testStake) + amount := common.NewCoin(ts.BondDenom(), testStake) for _, play := range playbook { t.Run(play.name, func(t *testing.T) { diff --git a/x/pairing/keeper/msg_server_test.go b/x/pairing/keeper/msg_server_test.go index e0ae4603a0..13fa657acf 100644 --- a/x/pairing/keeper/msg_server_test.go +++ b/x/pairing/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/pairing/keeper" "github.com/lavanet/lava/v4/x/pairing/types" @@ -13,5 +12,5 @@ import ( // TODO: use or delete this function func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.PairingKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/pairing/keeper/pairing_cache.go b/x/pairing/keeper/pairing_cache.go index dbaeef2933..d8454abda8 100644 --- a/x/pairing/keeper/pairing_cache.go +++ b/x/pairing/keeper/pairing_cache.go @@ -1,7 +1,8 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/lavanet/lava/v4/x/pairing/types" @@ -30,7 +31,7 @@ func (k Keeper) GetPairingRelayCache(ctx sdk.Context, project string, chainID st // will be deleted before it's written to the state func (k Keeper) ResetPairingRelayCache(ctx sdk.Context) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PairingRelayCachePrefix) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/pairing/keeper/pairing_next_epoch_time_block.go b/x/pairing/keeper/pairing_next_epoch_time_block.go index 881876704e..88f664a872 100644 --- a/x/pairing/keeper/pairing_next_epoch_time_block.go +++ b/x/pairing/keeper/pairing_next_epoch_time_block.go @@ -2,13 +2,8 @@ package keeper import ( "fmt" - "math" - "time" - "github.com/cometbft/cometbft/rpc/core" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v4/utils" - pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( @@ -22,10 +17,7 @@ func (k Keeper) calculateNextEpochTimeAndBlock(ctx sdk.Context) (uint64, uint64, currentEpoch := k.epochStorageKeeper.GetEpochStart(ctx) // Calculate the average block time (i.e., how much time it takes to create a new block, in average) - averageBlockTime, err := k.calculateAverageBlockTime(ctx, currentEpoch) - if err != nil { - return 0, 0, fmt.Errorf("could not calculate average block time, err: %s", err) - } + averageBlockTime := k.downtimeKeeper.GetParams(ctx).DowntimeDuration // Get the next epoch nextEpochStart, err := k.epochStorageKeeper.GetNextEpoch(ctx, currentEpoch) @@ -43,106 +35,7 @@ func (k Keeper) calculateNextEpochTimeAndBlock(ctx sdk.Context) (uint64, uint64, blocksUntilNewEpoch := nextPairingBlock - uint64(ctx.BlockHeight()) // Calculate the time left for the next pairing in seconds (blocks left * avg block time) - timeLeftToNextEpoch := blocksUntilNewEpoch * averageBlockTime + timeLeftToNextEpoch := blocksUntilNewEpoch * uint64(averageBlockTime.Seconds()) return timeLeftToNextEpoch, nextPairingBlock, nil } - -// Function to calculate the average block time (i.e., how much time it takes to create a new block, in average) -func (k Keeper) calculateAverageBlockTime(ctx sdk.Context, epoch uint64) (uint64, error) { - // Get epochBlocks (the number of blocks in an epoch) - epochBlocks, err := k.epochStorageKeeper.EpochBlocks(ctx, epoch) - if err != nil { - return 0, fmt.Errorf("could not get epochBlocks, err: %s", err) - } - - // Define sample step. Determines which timestamps will be taken in the average block time calculation. - // if epochBlock < EPOCH_BLOCK_DIVIDER -> sampleStep = MIN_SAMPLE_STEP. - // else sampleStep will be epochBlocks/EPOCH_BLOCK_DIVIDER - if MIN_SAMPLE_STEP > epochBlocks { - return 0, fmt.Errorf("invalid MIN_SAMPLE_STEP value since it's larger than epochBlocks. MIN_SAMPLE_STEP: %v, epochBlocks: %v", MIN_SAMPLE_STEP, epochBlocks) - } - sampleStep := MIN_SAMPLE_STEP - if epochBlocks > EPOCH_BLOCK_DIVIDER { - sampleStep = epochBlocks / EPOCH_BLOCK_DIVIDER - } - - // Get a list of the previous epoch's blocks timestamp and height - prevEpochTimestampAndHeightList, err := k.getPreviousEpochTimestampsByHeight(ctx, epoch, sampleStep) - if pairingtypes.NoPreviousEpochForAverageBlockTimeCalculationError.Is(err) || pairingtypes.PreviousEpochStartIsBlockZeroError.Is(err) { - // if the errors indicate that we're on the first epoch / after a fork or previous epoch start is 0, we return averageBlockTime=0 without an error - return 0, nil - } - if err != nil { - return 0, fmt.Errorf("couldn't get prevEpochTimestampAndHeightList. err: %v", err) - } - - // Calculate the average block time from prevEpochTimestampAndHeightList - averageBlockTime, err := calculateAverageBlockTimeFromList(prevEpochTimestampAndHeightList, sampleStep) - if pairingtypes.NotEnoughBlocksToCalculateAverageBlockTimeError.Is(err) || pairingtypes.AverageBlockTimeIsLessOrEqualToZeroError.Is(err) { - // we shouldn't fail the get-pairing query because the average block time calculation failed (to indicate the fail, we return 0) - return 0, nil - } - if err != nil { - return 0, fmt.Errorf("couldn't calculate average block time. err: %v", err) - } - - return averageBlockTime, nil -} - -type blockHeightAndTime struct { - blockHeight uint64 - blockTime time.Time -} - -// Function to get a list of the timestamps of the blocks in the previous epoch of the input (so it'll be deterministic) -func (k Keeper) getPreviousEpochTimestampsByHeight(ctx sdk.Context, epoch, sampleStep uint64) ([]blockHeightAndTime, error) { - // Check for special cases: - // 1. no previous epoch - we're on the first epoch / after a fork. Since there is no previous epoch to calculate average time on, return an empty slice and no error - // 2. start of previous epoch is block 0 - we're on the second epoch. To get the block's header using the "core" module, the block height can't be zero (causes panic). In this case, we also return an empty slice and no error - prevEpoch, err := k.epochStorageKeeper.GetPreviousEpochStartForBlock(ctx, epoch) - if err != nil { - return nil, pairingtypes.NoPreviousEpochForAverageBlockTimeCalculationError - } else if prevEpoch == 0 { - return nil, pairingtypes.PreviousEpochStartIsBlockZeroError - } - - // Get previous epoch timestamps, in sampleStep steps - prevEpochTimestampAndHeightList := []blockHeightAndTime{} - for block := prevEpoch; block <= epoch; block += sampleStep { - // Get current block's height and timestamp - blockInt64 := int64(block) - blockCore, err := core.Block(nil, &blockInt64) - if err != nil { - return nil, fmt.Errorf("could not get current block header, block: %v, err: %s", blockInt64, err) - } - currentBlockTimestamp := blockCore.Block.Header.Time.UTC() - blockHeightAndTimeStruct := blockHeightAndTime{blockHeight: block, blockTime: currentBlockTimestamp} - - // Append the timestamp to the timestamp list - prevEpochTimestampAndHeightList = append(prevEpochTimestampAndHeightList, blockHeightAndTimeStruct) - } - - return prevEpochTimestampAndHeightList, nil -} - -func calculateAverageBlockTimeFromList(blockHeightAndTimeList []blockHeightAndTime, sampleStep uint64) (uint64, error) { - if len(blockHeightAndTimeList) <= 1 { - return 0, utils.LavaFormatError("There isn't enough blockHeight structs in the previous epoch to calculate average block time", pairingtypes.NotEnoughBlocksToCalculateAverageBlockTimeError) - } - - averageBlockTime := time.Duration(math.MaxInt64) - for i := 1; i < len(blockHeightAndTimeList); i++ { - // Calculate the average block time creation over sampleStep blocks - currentAverageBlockTime := blockHeightAndTimeList[i].blockTime.Sub(blockHeightAndTimeList[i-1].blockTime) / time.Duration(sampleStep) - if currentAverageBlockTime <= 0 { - return 0, utils.LavaFormatError("calculated average block time is less than or equal to zero", pairingtypes.AverageBlockTimeIsLessOrEqualToZeroError, []utils.Attribute{{Key: "block", Value: blockHeightAndTimeList[i].blockHeight}, {Key: "block timestamp", Value: blockHeightAndTimeList[i].blockTime}, {Key: "prevBlock", Value: blockHeightAndTimeList[i-1].blockHeight}, {Key: "prevBlock timestamp", Value: blockHeightAndTimeList[i-1].blockTime}}...) - } - // save the minimal average block time - if averageBlockTime > currentAverageBlockTime { - averageBlockTime = currentAverageBlockTime - } - } - - return uint64(averageBlockTime.Seconds()), nil -} diff --git a/x/pairing/keeper/pairing_test.go b/x/pairing/keeper/pairing_test.go index c312411f1e..e69b1b4f20 100644 --- a/x/pairing/keeper/pairing_test.go +++ b/x/pairing/keeper/pairing_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + cosmosmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/common" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" @@ -1040,7 +1041,7 @@ func TestGeolocationPairingScores(t *testing.T) { freePlan := planstypes.Plan{ Index: "free", Block: ts.BlockHeight(), - Price: sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1)), + Price: sdk.NewCoin(ts.TokenDenom(), cosmosmath.NewInt(1)), ProjectsLimit: 3, PlanPolicy: freePlanPolicy, } @@ -1048,7 +1049,7 @@ func TestGeolocationPairingScores(t *testing.T) { basicPlan := planstypes.Plan{ Index: "basic", Block: ts.BlockHeight(), - Price: sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1)), + Price: sdk.NewCoin(ts.TokenDenom(), cosmosmath.NewInt(1)), ProjectsLimit: 5, PlanPolicy: basicPlanPolicy, } @@ -1056,7 +1057,7 @@ func TestGeolocationPairingScores(t *testing.T) { premiumPlan := planstypes.Plan{ Index: "premium", Block: ts.BlockHeight(), - Price: sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1)), + Price: sdk.NewCoin(ts.TokenDenom(), cosmosmath.NewInt(1)), ProjectsLimit: 7, PlanPolicy: premiumPlanPolicy, } @@ -1248,7 +1249,7 @@ func TestDuplicateProviders(t *testing.T) { basicPlan := planstypes.Plan{ Index: "basic", Block: ts.BlockHeight(), - Price: sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1)), + Price: sdk.NewCoin(ts.TokenDenom(), cosmosmath.NewInt(1)), ProjectsLimit: 5, PlanPolicy: basicPlanPolicy, } @@ -1300,7 +1301,7 @@ func TestNoRequiredGeo(t *testing.T) { freePlan := planstypes.Plan{ Index: "free", Block: ts.BlockHeight(), - Price: sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1)), + Price: sdk.NewCoin(ts.TokenDenom(), cosmosmath.NewInt(1)), ProjectsLimit: 3, PlanPolicy: freePlanPolicy, } diff --git a/x/pairing/keeper/params.go b/x/pairing/keeper/params.go index 2fd3570c43..63351c790c 100644 --- a/x/pairing/keeper/params.go +++ b/x/pairing/keeper/params.go @@ -3,6 +3,7 @@ package keeper import ( "strconv" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/pairing/types" @@ -42,7 +43,7 @@ func (k Keeper) EpochBlocksOverlap(ctx sdk.Context) uint64 { return res } -func (k Keeper) QoSWeight(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) QoSWeight(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyQoSWeight, &res) return } diff --git a/x/pairing/keeper/scores/geo_req.go b/x/pairing/keeper/scores/geo_req.go index df4aa2f43f..9c1f77c91c 100644 --- a/x/pairing/keeper/scores/geo_req.go +++ b/x/pairing/keeper/scores/geo_req.go @@ -4,7 +4,6 @@ import ( "fmt" "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" planstypes "github.com/lavanet/lava/v4/x/plans/types" ) @@ -100,7 +99,7 @@ func calculateCostFromLatency(latency uint64) math.Uint { utils.LavaFormatWarning("got latency 0 when calculating geo req score", fmt.Errorf("invalid geo req score")) return math.OneUint() } - return sdk.NewUint(maxGeoLatency / latency) + return math.NewUint(maxGeoLatency / latency) } // GEO_LATENCY_MAP is a map of lists of GeoLatency that defines the cost of geo mismatch diff --git a/x/pairing/keeper/scores/score.go b/x/pairing/keeper/scores/score.go index e411f7f42b..b5a3dbae62 100644 --- a/x/pairing/keeper/scores/score.go +++ b/x/pairing/keeper/scores/score.go @@ -154,7 +154,7 @@ func CalcPairingScore(scores []*PairingScore, strategy ScoreStrategy, diffSlot P utils.Attribute{Key: "provider", Value: score.Provider.Address}, ) } - newScoreCompDec := sdk.NewDecFromInt(math.Int(newScoreComp)) + newScoreCompDec := math.LegacyNewDecFromInt(math.Int(newScoreComp)) newScoreCompDec = newScoreCompDec.Power(weight) newScoreComp = math.Uint(newScoreCompDec.TruncateInt()) diff --git a/x/pairing/keeper/scores/stake_req.go b/x/pairing/keeper/scores/stake_req.go index d186f75dd5..87d921b236 100644 --- a/x/pairing/keeper/scores/stake_req.go +++ b/x/pairing/keeper/scores/stake_req.go @@ -2,7 +2,6 @@ package scores import ( "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" planstypes "github.com/lavanet/lava/v4/x/plans/types" ) @@ -24,7 +23,7 @@ func (sr *StakeReq) Score(score PairingScore) math.Uint { if !effectiveStake.IsPositive() { return math.OneUint() } - return sdk.NewUint(effectiveStake.Uint64()) + return math.NewUint(effectiveStake.Uint64()) } func (sr *StakeReq) GetName() string { diff --git a/x/pairing/keeper/staking.go b/x/pairing/keeper/staking.go index 4e4d8ae221..2cb0d22131 100644 --- a/x/pairing/keeper/staking.go +++ b/x/pairing/keeper/staking.go @@ -5,6 +5,7 @@ import ( "strconv" "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/lavanet/lava/v4/utils" @@ -23,7 +24,10 @@ const ( func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID string, amount sdk.Coin, endpoints []epochstoragetypes.Endpoint, geolocation int32, delegationLimit sdk.Coin, delegationCommission uint64, provider string, description stakingtypes.Description) error { logger := k.Logger(ctx) specChainID := chainID - + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } metadata, err := k.epochStorageKeeper.GetMetadata(ctx, provider) if err != nil { // first provider with this address @@ -31,7 +35,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin Provider: provider, Vault: creator, Chains: []string{chainID}, - TotalDelegations: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()), + TotalDelegations: sdk.NewCoin(bondDenom, math.ZeroInt()), } } else { metadata.Chains = lavaslices.AddUnique(metadata.Chains, chainID) @@ -227,7 +231,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin } // if there are registered delegations to the provider, count them in the delegateTotal - delegateTotal := sdk.ZeroInt() + delegateTotal := math.ZeroInt() nextEpoch, err := k.epochStorageKeeper.GetNextEpoch(ctx, uint64(ctx.BlockHeight())) if err != nil { return utils.LavaFormatWarning("cannot get next epoch to count past delegations", err, @@ -267,7 +271,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin Endpoints: endpointsVerified, Geolocation: geolocation, Chain: chainID, - DelegateTotal: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), delegateTotal), + DelegateTotal: sdk.NewCoin(bondDenom, delegateTotal), Vault: creator, // the stake-provider TX creator is always regarded as the vault address } diff --git a/x/pairing/keeper/unstaking.go b/x/pairing/keeper/unstaking.go index 3adbf00b81..2509e64dd8 100644 --- a/x/pairing/keeper/unstaking.go +++ b/x/pairing/keeper/unstaking.go @@ -5,6 +5,8 @@ import ( "math" "strconv" + cosmosmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -102,6 +104,10 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta } func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDescription string) error { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) if !entryExists { return utils.LavaFormatWarning("can't unstake Entry, stake entry not found for address", fmt.Errorf("stake entry not found"), @@ -118,11 +124,23 @@ func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDes utils.LogAttr("vault", existingEntry.Vault), ) } - delegations := k.stakingKeeper.GetAllDelegatorDelegations(ctx, vaultAcc) + delegations, err := k.stakingKeeper.GetAllDelegatorDelegations(ctx, vaultAcc) + if err != nil { + return utils.LavaFormatError("can't unstake entry, failed to get delegations", err, + utils.LogAttr("delegator", vaultAcc.String()), + ) + } for _, delegation := range delegations { - validator, found := k.stakingKeeper.GetValidator(ctx, delegation.GetValidatorAddr()) - if !found { + validatorAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) + if err != nil { + return utils.LavaFormatError("can't unstake entry, invalid validator address", err, + utils.LogAttr("delegator", vaultAcc.String()), + utils.LogAttr("validator", delegation.GetValidatorAddr()), + ) + } + validator, err := k.stakingKeeper.GetValidator(ctx, validatorAddr) + if err != nil { continue } amount := validator.TokensFromShares(delegation.Shares).TruncateInt() @@ -130,7 +148,7 @@ func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDes amount = totalAmount } totalAmount = totalAmount.Sub(amount) - err = k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator.OperatorAddress, existingEntry.Address, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), amount), true) + err = k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator.OperatorAddress, existingEntry.Address, sdk.NewCoin(bondDenom, amount), true) if err != nil { return utils.LavaFormatWarning("can't unbond self delegation", err, utils.LogAttr("provider", existingEntry.Address), @@ -166,10 +184,13 @@ func (k Keeper) SlashDelegator(ctx sdk.Context, slashingInfo types.DelegatorSlas // this method goes over all unbondings and tries to slash them slashUnbonding := func() { - unbondings := k.stakingKeeper.GetUnbondingDelegations(ctx, delAddr, math.MaxUint16) + unbondings, err := k.stakingKeeper.GetUnbondingDelegations(ctx, delAddr, math.MaxUint16) + if err != nil { + return + } for _, unbonding := range unbondings { - totalBalance := sdk.ZeroInt() + totalBalance := cosmosmath.ZeroInt() for _, entry := range unbonding.Entries { totalBalance = totalBalance.Add(entry.Balance) } @@ -178,9 +199,12 @@ func (k Keeper) SlashDelegator(ctx sdk.Context, slashingInfo types.DelegatorSlas } slashingFactor := total.ToLegacyDec().QuoInt(totalBalance) - slashingFactor = sdk.MinDec(sdk.OneDec(), slashingFactor) - slashedAmount := k.stakingKeeper.SlashUnbondingDelegation(ctx, unbonding, 1, slashingFactor) - slashedAmount = sdk.MinInt(total, slashedAmount) + slashingFactor = cosmosmath.LegacyMinDec(cosmosmath.LegacyOneDec(), slashingFactor) + slashedAmount, err := k.stakingKeeper.SlashUnbondingDelegation(ctx, unbonding, 1, slashingFactor) + if err != nil { + continue + } + slashedAmount = cosmosmath.MinInt(total, slashedAmount) total = total.Sub(slashedAmount) if !total.IsPositive() { @@ -196,15 +220,22 @@ func (k Keeper) SlashDelegator(ctx sdk.Context, slashingInfo types.DelegatorSlas } // we need to unbond from the delegator by force the amount left - delegations := k.stakingKeeper.GetAllDelegatorDelegations(ctx, delAddr) + delegations, err := k.stakingKeeper.GetAllDelegatorDelegations(ctx, delAddr) + if err != nil { + return err + } tokensToUnbond := total for _, delegation := range delegations { - validator, found := k.stakingKeeper.GetValidator(ctx, delegation.GetValidatorAddr()) - if !found { + validatorAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) + if err != nil { + continue + } + validator, err := k.stakingKeeper.GetValidator(ctx, validatorAddr) + if err != nil { continue } amount := validator.TokensFromShares(delegation.Shares).TruncateInt() - amount = sdk.MinInt(tokensToUnbond, amount) + amount = cosmosmath.MinInt(tokensToUnbond, amount) shares, err := validator.SharesFromTokensTruncated(amount) if err != nil { return utils.LavaFormatWarning("failed to get delegators shares", err, @@ -213,7 +244,7 @@ func (k Keeper) SlashDelegator(ctx sdk.Context, slashingInfo types.DelegatorSlas ) } - _, err = k.stakingKeeper.Undelegate(ctx, delAddr, validator.GetOperator(), shares) + _, _, err = k.stakingKeeper.Undelegate(ctx, delAddr, validatorAddr, shares) if err != nil { return utils.LavaFormatWarning("can't unbond self delegation for slashing", err, utils.Attribute{Key: "address", Value: delAddr}, diff --git a/x/pairing/keeper/unstaking_test.go b/x/pairing/keeper/unstaking_test.go index 4ca0642f1b..09469d72fb 100644 --- a/x/pairing/keeper/unstaking_test.go +++ b/x/pairing/keeper/unstaking_test.go @@ -23,10 +23,10 @@ func TestUnstakeAndSlashProposal(t *testing.T) { beforeSlashDelegation := map[string]math.Int{} for i := 0; i < delegators; i++ { _, delegator := ts.GetAccount(common.CONSUMER, i) - beforeSlashDelegation[delegator] = sdk.NewInt(1000 * int64(i+1)) + beforeSlashDelegation[delegator] = math.NewInt(1000 * int64(i+1)) _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.BondDenom(), beforeSlashDelegation[delegator])) require.NoError(t, err) - delegatorsSlashing = append(delegatorsSlashing, types.DelegatorSlashing{Delegator: delegator, SlashingAmount: sdk.NewCoin(ts.BondDenom(), sdk.NewInt(1000/3*int64(i+1)))}) + delegatorsSlashing = append(delegatorsSlashing, types.DelegatorSlashing{Delegator: delegator, SlashingAmount: sdk.NewCoin(ts.BondDenom(), math.NewInt(1000/3*int64(i+1)))}) } ts.AdvanceEpoch() diff --git a/x/pairing/migrations/v2/epoch_payments.go b/x/pairing/migrations/v2/epoch_payments.go index 93c6c75faa..23d41805ab 100644 --- a/x/pairing/migrations/v2/epoch_payments.go +++ b/x/pairing/migrations/v2/epoch_payments.go @@ -1,8 +1,8 @@ package v2 import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/pairing/types" ) @@ -10,7 +10,7 @@ import ( // RemoveAllEpochPayments removes all epochPayments func RemoveAllEpochPayments(ctx sdk.Context, storeKey storetypes.StoreKey) { store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(EpochPaymentsKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -22,7 +22,7 @@ func RemoveAllEpochPayments(ctx sdk.Context, storeKey storetypes.StoreKey) { // RemoveAllProviderPaymentStorage removes all providerPaymentStorage func RemoveAllProviderPaymentStorage(ctx sdk.Context, storeKey storetypes.StoreKey) { store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(ProviderPaymentStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -34,7 +34,7 @@ func RemoveAllProviderPaymentStorage(ctx sdk.Context, storeKey storetypes.StoreK // RemoveAllUniquePaymentStorageClientProvider removes all uniquePaymentStorageClientProvider func RemoveAllUniquePaymentStorageClientProvider(ctx sdk.Context, storeKey storetypes.StoreKey) { store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(UniquePaymentStorageClientProviderKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/pairing/module.go b/x/pairing/module.go index fdb1b7bbe3..5ee9e2a131 100644 --- a/x/pairing/module.go +++ b/x/pairing/module.go @@ -168,13 +168,21 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 5 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx) +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.BeginBlock(sdkCtx) + return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context) error { am.keeper.EndBlock(ctx) - return []abci.ValidatorUpdate{} + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/pairing/module_simulation.go b/x/pairing/module_simulation.go index 2d2e31c970..84d4176e08 100644 --- a/x/pairing/module_simulation.go +++ b/x/pairing/module_simulation.go @@ -103,15 +103,18 @@ func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedPropo // } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) var weightMsgStakeProvider int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgStakeProvider, &weightMsgStakeProvider, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgStakeProvider, + &weightMsgStakeProvider, + simState.Rand, + func(r *rand.Rand) { weightMsgStakeProvider = defaultWeightMsgStakeProvider }, ) @@ -121,15 +124,21 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgStakeClient int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgStakeClient, &weightMsgStakeClient, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgStakeClient, + &weightMsgStakeClient, + simState.Rand, + func(r *rand.Rand) { weightMsgStakeClient = defaultWeightMsgStakeClient }, ) var weightMsgUnstakeProvider int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnstakeProvider, &weightMsgUnstakeProvider, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgUnstakeProvider, + &weightMsgUnstakeProvider, + simState.Rand, + func(r *rand.Rand) { weightMsgUnstakeProvider = defaultWeightMsgUnstakeProvider }, ) @@ -139,15 +148,21 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgUnstakeClient int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnstakeClient, &weightMsgUnstakeClient, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgUnstakeClient, + &weightMsgUnstakeClient, + simState.Rand, + func(r *rand.Rand) { weightMsgUnstakeClient = defaultWeightMsgUnstakeClient }, ) var weightMsgRelayPayment int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgRelayPayment, &weightMsgRelayPayment, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgRelayPayment, + &weightMsgRelayPayment, + simState.Rand, + func(r *rand.Rand) { weightMsgRelayPayment = defaultWeightMsgRelayPayment }, ) @@ -157,8 +172,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgFreeze int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgFreeze, &weightMsgFreeze, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgFreeze, + &weightMsgFreeze, + simState.Rand, + func(r *rand.Rand) { weightMsgFreeze = defaultWeightMsgFreeze }, ) @@ -168,8 +186,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgUnfreeze int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnfreeze, &weightMsgUnfreeze, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgUnfreeze, + &weightMsgUnfreeze, + simState.Rand, + func(r *rand.Rand) { weightMsgUnfreeze = defaultWeightMsgUnfreeze }, ) diff --git a/x/pairing/types/QualityOfServiceReport.go b/x/pairing/types/QualityOfServiceReport.go index d5bb0b4836..a5e2ff4ad5 100644 --- a/x/pairing/types/QualityOfServiceReport.go +++ b/x/pairing/types/QualityOfServiceReport.go @@ -3,24 +3,24 @@ package types import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) -func (qos *QualityOfServiceReport) ComputeQoS() (sdk.Dec, error) { - if qos.Availability.GT(sdk.OneDec()) || qos.Availability.LT(sdk.ZeroDec()) || - qos.Latency.GT(sdk.OneDec()) || qos.Latency.LT(sdk.ZeroDec()) || - qos.Sync.GT(sdk.OneDec()) || qos.Sync.LT(sdk.ZeroDec()) { - return sdk.ZeroDec(), fmt.Errorf("QoS scores is not between 0-1") +func (qos *QualityOfServiceReport) ComputeQoS() (math.LegacyDec, error) { + if qos.Availability.GT(math.LegacyOneDec()) || qos.Availability.LT(math.LegacyZeroDec()) || + qos.Latency.GT(math.LegacyOneDec()) || qos.Latency.LT(math.LegacyZeroDec()) || + qos.Sync.GT(math.LegacyOneDec()) || qos.Sync.LT(math.LegacyZeroDec()) { + return math.LegacyZeroDec(), fmt.Errorf("QoS scores is not between 0-1") } return qos.Availability.Mul(qos.Sync).Mul(qos.Latency).ApproxRoot(3) } -func (qos *QualityOfServiceReport) ComputeQoSExcellence() (sdk.Dec, error) { - if qos.Availability.LTE(sdk.ZeroDec()) || - qos.Latency.LTE(sdk.ZeroDec()) || - qos.Sync.LTE(sdk.ZeroDec()) { - return sdk.ZeroDec(), fmt.Errorf("QoS excellence scores is below 0") +func (qos *QualityOfServiceReport) ComputeQoSExcellence() (math.LegacyDec, error) { + if qos.Availability.LTE(math.LegacyZeroDec()) || + qos.Latency.LTE(math.LegacyZeroDec()) || + qos.Sync.LTE(math.LegacyZeroDec()) { + return math.LegacyZeroDec(), fmt.Errorf("QoS excellence scores is below 0") } return qos.Availability.Quo(qos.Sync).Quo(qos.Latency).ApproxRoot(3) } diff --git a/x/pairing/types/QualityOfServiceReport_test.go b/x/pairing/types/QualityOfServiceReport_test.go index 83a15ce6d6..c9f8719274 100644 --- a/x/pairing/types/QualityOfServiceReport_test.go +++ b/x/pairing/types/QualityOfServiceReport_test.go @@ -3,30 +3,30 @@ package types import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" "github.com/stretchr/testify/require" ) func TestQosReport(t *testing.T) { qos1 := &QualityOfServiceReport{ - Latency: sdk.MustNewDecFromStr("1.5"), - Availability: sdk.MustNewDecFromStr("1"), - Sync: sdk.MustNewDecFromStr("0.1"), + Latency: math.LegacyMustNewDecFromStr("1.5"), + Availability: math.LegacyMustNewDecFromStr("1"), + Sync: math.LegacyMustNewDecFromStr("0.1"), } qos2 := &QualityOfServiceReport{ - Latency: sdk.MustNewDecFromStr("0.2"), - Availability: sdk.MustNewDecFromStr("1"), - Sync: sdk.MustNewDecFromStr("0.1"), + Latency: math.LegacyMustNewDecFromStr("0.2"), + Availability: math.LegacyMustNewDecFromStr("1"), + Sync: math.LegacyMustNewDecFromStr("0.1"), } qos3 := &QualityOfServiceReport{ - Latency: sdk.MustNewDecFromStr("0.1"), - Availability: sdk.MustNewDecFromStr("1"), - Sync: sdk.MustNewDecFromStr("0.5"), + Latency: math.LegacyMustNewDecFromStr("0.1"), + Availability: math.LegacyMustNewDecFromStr("1"), + Sync: math.LegacyMustNewDecFromStr("0.5"), } qos4 := &QualityOfServiceReport{ - Latency: sdk.MustNewDecFromStr("0.1"), - Availability: sdk.MustNewDecFromStr("0.5"), - Sync: sdk.MustNewDecFromStr("0.5"), + Latency: math.LegacyMustNewDecFromStr("0.1"), + Availability: math.LegacyMustNewDecFromStr("0.5"), + Sync: math.LegacyMustNewDecFromStr("0.5"), } qos1Res, errQos1 := qos1.ComputeQoSExcellence() diff --git a/x/pairing/types/badges.pb.go b/x/pairing/types/badges.pb.go index 21dcef0610..8b40b6e1fc 100644 --- a/x/pairing/types/badges.pb.go +++ b/x/pairing/types/badges.pb.go @@ -265,6 +265,7 @@ func _BadgeGenerator_GenerateBadge_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +var BadgeGenerator_serviceDesc = _BadgeGenerator_serviceDesc var _BadgeGenerator_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.pairing.BadgeGenerator", HandlerType: (*BadgeGeneratorServer)(nil), diff --git a/x/pairing/types/expected_keepers.go b/x/pairing/types/expected_keepers.go index 076c7b0562..09fe355cbd 100644 --- a/x/pairing/types/expected_keepers.go +++ b/x/pairing/types/expected_keepers.go @@ -1,12 +1,12 @@ package types import ( + "context" "time" "cosmossdk.io/math" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" v1 "github.com/lavanet/lava/v4/x/downtime/v1" dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" @@ -58,18 +58,18 @@ type EpochstorageKeeper interface { } type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(moduleName string) sdk.AccAddress // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error // Methods imported from bank should be defined here } @@ -122,10 +122,10 @@ type TimerStoreKeeper interface { } type StakingKeeper interface { - GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation - GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) - BondDenom(ctx sdk.Context) string - GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []stakingtypes.UnbondingDelegation) - SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation stakingtypes.UnbondingDelegation, infractionHeight int64, slashFactor sdk.Dec) (totalSlashAmount math.Int) - Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (time.Time, error) + GetAllDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress) ([]stakingtypes.Delegation, error) + GetValidator(ctx context.Context, addr sdk.ValAddress) (stakingtypes.Validator, error) + BondDenom(ctx context.Context) (string, error) + GetUnbondingDelegations(ctx context.Context, delegator sdk.AccAddress, maxRetrieve uint16) ([]stakingtypes.UnbondingDelegation, error) + SlashUnbondingDelegation(ctx context.Context, unbondingDelegation stakingtypes.UnbondingDelegation, infractionHeight int64, slashFactor math.LegacyDec) (totalSlashAmount math.Int, err error) + Undelegate(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount math.LegacyDec) (time.Time, math.Int, error) } diff --git a/x/pairing/types/message_freeze.go b/x/pairing/types/message_freeze.go index baab7324f2..2ed0f51bad 100644 --- a/x/pairing/types/message_freeze.go +++ b/x/pairing/types/message_freeze.go @@ -30,19 +30,6 @@ func (msg *MsgFreezeProvider) Type() string { return TypeMsgFreeze } -func (msg *MsgFreezeProvider) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgFreezeProvider) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgFreezeProvider) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/pairing/types/message_move_provider_stake.go b/x/pairing/types/message_move_provider_stake.go index 442085c265..b047445d6b 100644 --- a/x/pairing/types/message_move_provider_stake.go +++ b/x/pairing/types/message_move_provider_stake.go @@ -27,19 +27,6 @@ func (msg *MsgMoveProviderStake) Type() string { return TypeMsgMoveProviderStake } -func (msg *MsgMoveProviderStake) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgMoveProviderStake) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgMoveProviderStake) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/pairing/types/message_relay_payment.go b/x/pairing/types/message_relay_payment.go index 10dab1741e..d7f4d0bc61 100644 --- a/x/pairing/types/message_relay_payment.go +++ b/x/pairing/types/message_relay_payment.go @@ -27,19 +27,6 @@ func (msg *MsgRelayPayment) Type() string { return TypeMsgRelayPayment } -func (msg *MsgRelayPayment) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgRelayPayment) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgRelayPayment) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/pairing/types/message_stake_provider.go b/x/pairing/types/message_stake_provider.go index 5193c828e3..c652f63043 100644 --- a/x/pairing/types/message_stake_provider.go +++ b/x/pairing/types/message_stake_provider.go @@ -35,19 +35,6 @@ func (msg *MsgStakeProvider) Type() string { return TypeMsgStakeProvider } -func (msg *MsgStakeProvider) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgStakeProvider) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgStakeProvider) ValidateBasic() error { if _, err := sdk.ValAddressFromBech32(msg.Validator); err != nil { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "Invalid validator address (%s) %s", err.Error(), msg.Validator) diff --git a/x/pairing/types/message_stake_provider_test.go b/x/pairing/types/message_stake_provider_test.go index e5ecfe532a..3e8a708463 100644 --- a/x/pairing/types/message_stake_provider_test.go +++ b/x/pairing/types/message_stake_provider_test.go @@ -24,7 +24,7 @@ func TestMsgStakeProvider_ValidateBasic(t *testing.T) { msg: MsgStakeProvider{ Creator: "invalid_address", Description: d, - DelegateLimit: types.NewCoin(commontypes.TokenDenom, types.ZeroInt()), + DelegateLimit: types.NewCoin(commontypes.TokenDenom, math.ZeroInt()), DelegateCommission: 100, Validator: sample.ValAddress(), Amount: types.NewCoin(commontypes.TokenDenom, math.OneInt()), @@ -37,7 +37,7 @@ func TestMsgStakeProvider_ValidateBasic(t *testing.T) { msg: MsgStakeProvider{ Creator: sample.AccAddress(), Description: d, - DelegateLimit: types.NewCoin(commontypes.TokenDenom, types.ZeroInt()), + DelegateLimit: types.NewCoin(commontypes.TokenDenom, math.ZeroInt()), DelegateCommission: 100, Validator: sample.ValAddress(), Amount: types.NewCoin(commontypes.TokenDenom, math.OneInt()), @@ -50,7 +50,7 @@ func TestMsgStakeProvider_ValidateBasic(t *testing.T) { msg: MsgStakeProvider{ Creator: sample.AccAddress(), Description: d, - DelegateLimit: types.NewCoin(commontypes.TokenDenom, types.ZeroInt()), + DelegateLimit: types.NewCoin(commontypes.TokenDenom, math.ZeroInt()), DelegateCommission: 100, Validator: "invalid_address", Amount: types.NewCoin(commontypes.TokenDenom, math.OneInt()), @@ -63,7 +63,7 @@ func TestMsgStakeProvider_ValidateBasic(t *testing.T) { msg: MsgStakeProvider{ Creator: sample.AccAddress(), Description: d, - DelegateLimit: types.NewCoin(commontypes.TokenDenom, types.ZeroInt()), + DelegateLimit: types.NewCoin(commontypes.TokenDenom, math.ZeroInt()), DelegateCommission: 100, Validator: sample.ValAddress(), Address: sample.AccAddress(), @@ -75,7 +75,7 @@ func TestMsgStakeProvider_ValidateBasic(t *testing.T) { msg: MsgStakeProvider{ Creator: sample.AccAddress(), Description: d, - DelegateLimit: types.NewCoin(commontypes.TokenDenom, types.ZeroInt()), + DelegateLimit: types.NewCoin(commontypes.TokenDenom, math.ZeroInt()), DelegateCommission: 100, Validator: sample.ValAddress(), Amount: types.NewCoin(commontypes.TokenDenom, math.OneInt()), diff --git a/x/pairing/types/message_unfreeze.go b/x/pairing/types/message_unfreeze.go index a62d5431ed..6192dc260f 100644 --- a/x/pairing/types/message_unfreeze.go +++ b/x/pairing/types/message_unfreeze.go @@ -25,19 +25,6 @@ func (msg *MsgUnfreezeProvider) Type() string { return TypeMsgUnfreeze } -func (msg *MsgUnfreezeProvider) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUnfreezeProvider) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgUnfreezeProvider) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/pairing/types/message_unstake_provider.go b/x/pairing/types/message_unstake_provider.go index e794d1370b..547e25808d 100644 --- a/x/pairing/types/message_unstake_provider.go +++ b/x/pairing/types/message_unstake_provider.go @@ -26,19 +26,6 @@ func (msg *MsgUnstakeProvider) Type() string { return TypeMsgUnstakeProvider } -func (msg *MsgUnstakeProvider) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUnstakeProvider) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgUnstakeProvider) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/pairing/types/params.go b/x/pairing/types/params.go index f0d86f06f5..e02119b59b 100644 --- a/x/pairing/types/params.go +++ b/x/pairing/types/params.go @@ -3,7 +3,7 @@ package types import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) @@ -17,8 +17,8 @@ var ( ) var ( - KeyQoSWeight = []byte("QoSWeight") - DefaultQoSWeight sdk.Dec = sdk.NewDecWithPrec(5, 1) // 0.5 + KeyQoSWeight = []byte("QoSWeight") + DefaultQoSWeight math.LegacyDec = math.LegacyNewDecWithPrec(5, 1) // 0.5 ) var ( @@ -34,7 +34,7 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams( epochBlocksOverlap uint64, - qoSWeight sdk.Dec, + qoSWeight math.LegacyDec, recommendedEpochNumToCollectPayment uint64, ) Params { return Params{ @@ -95,12 +95,12 @@ func validateEpochBlocksOverlap(v interface{}) error { // validateDataReliabilityReward validates the param func validateQoSWeight(v interface{}) error { - QoSWeight, ok := v.(sdk.Dec) + QoSWeight, ok := v.(math.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", v) } - if QoSWeight.GT(sdk.OneDec()) || QoSWeight.LT(sdk.ZeroDec()) { + if QoSWeight.GT(math.LegacyOneDec()) || QoSWeight.LT(math.LegacyZeroDec()) { return fmt.Errorf("invalid parameter QoSWeight") } diff --git a/x/pairing/types/params.pb.go b/x/pairing/types/params.pb.go index e41f25f268..91ec2f43ee 100644 --- a/x/pairing/types/params.pb.go +++ b/x/pairing/types/params.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -26,9 +26,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - EpochBlocksOverlap uint64 `protobuf:"varint,8,opt,name=epochBlocksOverlap,proto3" json:"epochBlocksOverlap,omitempty" yaml:"epoch_blocks_overlap"` - QoSWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=QoSWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"QoSWeight" yaml:"data_reliability_reward"` - RecommendedEpochNumToCollectPayment uint64 `protobuf:"varint,14,opt,name=recommendedEpochNumToCollectPayment,proto3" json:"recommendedEpochNumToCollectPayment,omitempty" yaml:"recommended_epoch_num_to_collect_payment"` + EpochBlocksOverlap uint64 `protobuf:"varint,8,opt,name=epochBlocksOverlap,proto3" json:"epochBlocksOverlap,omitempty" yaml:"epoch_blocks_overlap"` + QoSWeight cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=QoSWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"QoSWeight" yaml:"data_reliability_reward"` + RecommendedEpochNumToCollectPayment uint64 `protobuf:"varint,14,opt,name=recommendedEpochNumToCollectPayment,proto3" json:"recommendedEpochNumToCollectPayment,omitempty" yaml:"recommended_epoch_num_to_collect_payment"` } func (m *Params) Reset() { *m = Params{} } @@ -84,34 +84,34 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/params.proto", fileDescriptor_fc338fce33b3b67a) } var fileDescriptor_fc338fce33b3b67a = []byte{ - // 417 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x6f, 0xd4, 0x30, - 0x14, 0xc7, 0x93, 0x9e, 0x7b, 0xf5, 0xa5, 0x2d, 0xb2, 0xa2, 0x0e, 0x27, 0x90, 0x92, 0x12, 0x24, - 0x54, 0x21, 0x11, 0x0f, 0x65, 0xea, 0x18, 0xca, 0xe2, 0x81, 0x1e, 0x07, 0x12, 0x12, 0x8b, 0xe5, - 0x38, 0x56, 0x2e, 0xaa, 0x1d, 0x47, 0x8e, 0xef, 0x20, 0x1f, 0x80, 0x9d, 0x11, 0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 0x43, 0x8d, 0xf8, 0xc8, 0x4c, 0x16, 0xcd, 0xff, 0xb6, 0xf0, 0x3f, 0xbb, 0xde, 0x13, 0x23, - 0xb8, 0x56, 0x4a, 0x94, 0x99, 0xc8, 0x5e, 0x75, 0x7f, 0xf4, 0x7a, 0xa9, 0xde, 0xe9, 0x97, 0x5a, - 0x4a, 0xc1, 0xed, 0x8c, 0x35, 0x4a, 0x94, 0x76, 0xfa, 0xa0, 0x1f, 0xe9, 0x7c, 0xdb, 0x86, 0x78, - 0x28, 0x7e, 0x47, 0xa2, 0xc3, 0x78, 0xe5, 0x52, 0x51, 0xab, 0x29, 0x1f, 0x44, 0x5a, 0x0d, 0x66, - 0x34, 0xbf, 0x4f, 0xfd, 0x0b, 0xf0, 0xf5, 0x7b, 0xe8, 0x10, 0x00, 0x5d, 0xb4, 0x47, 0x00, 0xdc, - 0x43, 0x23, 0x02, 0xe0, 0x08, 0x01, 0x02, 0x20, 0x40, 0xfb, 0x04, 0xc0, 0x7d, 0x34, 0x26, 0x00, - 0x8e, 0xd1, 0x01, 0x01, 0xf0, 0x00, 0x41, 0x02, 0xe0, 0x04, 0x79, 0x04, 0x40, 0x0f, 0x1d, 0x12, - 0x00, 0x0f, 0xd1, 0x11, 0x01, 0xf0, 0x08, 0x1d, 0x27, 0x97, 0x37, 0xeb, 0xc0, 0xbd, 0x5d, 0x07, - 0xee, 0xaf, 0x75, 0xe0, 0x7e, 0xd9, 0x04, 0xce, 0xed, 0x26, 0x70, 0x7e, 0x6c, 0x02, 0xe7, 0xc3, - 0xb3, 0x3b, 0xeb, 0xfb, 0xe7, 0x1e, 0x56, 0x2f, 0xf0, 0xa7, 0x3f, 0x47, 0xd1, 0xaf, 0x31, 0x1d, - 0xf7, 0x0f, 0x7d, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xb6, 0xaf, 0xf3, 0x39, 0x02, 0x00, - 0x00, + // 419 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0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0x57, 0x91, 0xff, + 0x65, 0x1d, 0x79, 0x77, 0xeb, 0xc8, 0xfb, 0xbe, 0x8e, 0xbc, 0xf7, 0xcf, 0x0a, 0xe5, 0xe6, 0x8b, + 0x59, 0x2a, 0xc0, 0x64, 0xff, 0x94, 0x60, 0xf9, 0x3c, 0xfb, 0xf8, 0xbb, 0x09, 0xae, 0xa9, 0x64, + 0x3d, 0x1b, 0x76, 0xbf, 0x7b, 0xf6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x56, 0xd3, 0xde, 0x2e, + 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/query.pb.go b/x/pairing/types/query.pb.go index f69bba8484..d3350d0ddd 100644 --- a/x/pairing/types/query.pb.go +++ b/x/pairing/types/query.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -645,7 +645,7 @@ func (m *QueryProviderPairingChanceRequest) GetCluster() string { } type QueryProviderPairingChanceResponse struct { - Chance github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=chance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"chance"` + Chance cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=chance,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"chance"` } func (m *QueryProviderPairingChanceResponse) Reset() { *m = QueryProviderPairingChanceResponse{} } @@ -1579,119 +1579,119 @@ func init() { proto.RegisterFile("lavanet/lava/pairing/query.proto", fileDescrip var fileDescriptor_9e149ce9d21da0d8 = []byte{ // 1807 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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x73, 0x99, 0xa2, 0x13, 0x7d, 0x38, 0xc4, - 0xa9, 0x67, 0xa9, 0xe7, 0xf2, 0xc3, 0xeb, 0x03, 0x85, 0x83, 0x27, 0xcc, 0xc1, 0x9f, 0xa1, 0xcf, - 0xf2, 0x73, 0x27, 0x72, 0x51, 0xe3, 0x72, 0x36, 0xe5, 0x56, 0xd7, 0xe9, 0x84, 0xf0, 0x66, 0x21, - 0x60, 0x42, 0xbb, 0x83, 0xbe, 0x94, 0x60, 0x22, 0x16, 0xa5, 0xb9, 0x15, 0xda, 0xab, 0x8e, 0x73, - 0x2b, 0xf4, 0x8a, 0xce, 0x1d, 0x94, 0x60, 0x81, 0x1f, 0xbe, 0xcb, 0x84, 0x88, 0xcc, 0x52, 0xf8, - 0x8b, 0x04, 0x6f, 0x64, 0xa8, 0x50, 0xf4, 0x20, 0x87, 0x43, 0x7f, 0xc9, 0x5b, 0xfe, 0xe0, 0xba, - 0x30, 0xe1, 0xc4, 0xc7, 0xcc, 0x89, 0x0f, 0xd1, 0x83, 0x6c, 0x27, 0x7c, 0x06, 0xed, 0xbe, 0xbd, - 0x69, 0xb6, 0xe5, 0xd3, 0x84, 0x17, 0x7f, 0x96, 0xe0, 0x66, 0x8f, 0x10, 0x45, 0x1b, 0x39, 0x54, - 0xb2, 0x85, 0x70, 0xb9, 0x7e, 0x1d, 0x88, 0x60, 0xbe, 0xcd, 0x98, 0x6f, 0xa1, 0xcd, 0x6c, 0xe6, - 0x38, 0x82, 0x09, 0x45, 0xab, 0x5c, 0x46, 0x37, 0x72, 0x47, 0xb9, 0xe4, 0x5a, 0xba, 0x83, 0xfe, - 0x96, 0x28, 0x8e, 0xd4, 0x9d, 0x3c, 0x54, 0x71, 0x64, 0x49, 0x81, 0xa1, 0x8a, 0x23, 0xf3, 0xfa, - 0x97, 0xbf, 0xcf, 0x1c, 0xda, 0x44, 0x0f, 0x07, 0x14, 0x47, 0x8b, 0xa3, 0x35, 0xae, 0x52, 0x12, - 0xc5, 0x81, 0xfe, 0x25, 0xc1, 0x42, 0x5f, 0x99, 0x81, 0x3e, 0xca, 0x4b, 0x91, 0x01, 0x0a, 0xa7, - 0xbc, 0xf5, 0x6a, 0x60, 0xe1, 0xda, 0x2e, 0x73, 0xed, 0x11, 0xda, 0xea, 0x93, 0x65, 0x89, 0x05, - 0xae, 0xb8, 0x17, 0x1f, 0x1b, 0xfa, 0x9d, 0x04, 0xd0, 0x7d, 0xbb, 0x78, 0x8d, 0xb7, 0xc7, 0xd5, - 0x57, 0x16, 0x79, 0x95, 0x31, 0x5e, 0x46, 0x77, 0xfb, 0x30, 0x36, 0xcf, 0xa2, 0x26, 0x85, 0xbe, - 0x92, 0xe0, 0x56, 0xaf, 0x7a, 0x42, 0xf5, 0x61, 0x2e, 0xfb, 0xb4, 0x14, 0x2b, 0xbf, 0x7f, 0x2d, - 0x8c, 0x20, 0xfa, 0x1e, 0x23, 0xba, 0x86, 0x56, 0x06, 0xe8, 0x04, 0xfe, 0x59, 0x45, 0x33, 0x82, - 0xed, 0xdd, 0xaf, 0x5f, 0x54, 0xa4, 0xe7, 0x2f, 0x2a, 0xd2, 0xbf, 0x5f, 0x54, 0xa4, 0xdf, 0xbc, - 0xac, 0x8c, 0x3c, 0x7f, 0x59, 0x19, 0xf9, 0xc7, 0xcb, 0xca, 0xc8, 0x67, 0x6b, 0x89, 0xcf, 0x0c, - 0xa9, 0xd5, 0xda, 0xf7, 0x95, 0xf3, 0x78, 0x49, 0xf6, 0xb9, 0xe1, 0xa4, 0xc4, 0x3e, 0xf9, 0xbe, - 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0xf0, 0x40, 0x83, 0x97, 0x17, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0xdb, 0xc8, + 0x15, 0x37, 0x65, 0x59, 0xb1, 0x9f, 0xff, 0x24, 0x98, 0xb5, 0x13,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xea, 0x93, 0x65, 0xb1, 0x0d, 0x2e, 0xb9, 0x17, 0x5d, 0x1b, 0xfa, + 0x9d, 0x04, 0xd0, 0xfd, 0xba, 0x78, 0x87, 0xaf, 0xc7, 0xe5, 0x4f, 0x16, 0x79, 0x95, 0x31, 0x5e, + 0x46, 0xb7, 0xfb, 0x30, 0x36, 0x4f, 0xc3, 0x26, 0x85, 0x9e, 0x49, 0x70, 0xa3, 0x57, 0x3d, 0xa1, + 0xea, 0x30, 0x8f, 0x7d, 0x52, 0x8a, 0x15, 0x3f, 0xb9, 0x12, 0x46, 0x10, 0xfd, 0x98, 0x11, 0x5d, + 0x43, 0x2b, 0x03, 0x74, 0x02, 0xff, 0x5b, 0x8a, 0x66, 0xf8, 0xdb, 0xbb, 0xcf, 0x5f, 0x95, 0xa4, + 0x17, 0xaf, 0x4a, 0xd2, 0xbf, 0x5f, 0x95, 0xa4, 0xdf, 0xbc, 0x2e, 0x8d, 0xbc, 0x78, 0x5d, 0x1a, + 0xf9, 0xc7, 0xeb, 0xd2, 0xc8, 0x97, 0x6b, 0x75, 0x8b, 0x36, 0xfc, 0x93, 0x8a, 0x41, 0x5a, 0xc9, + 0xdd, 0xda, 0x77, 0x95, 0xb3, 0x68, 0x4b, 0x7a, 0xee, 0x60, 0xef, 0xa4, 0xc0, 0xfe, 0xce, 0xfb, + 0xc9, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xf5, 0xcc, 0x51, 0x8c, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2171,6 +2171,7 @@ func _Query_ProvidersEpochCu_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.pairing.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/pairing/types/relay.pb.go b/x/pairing/types/relay.pb.go index 49f66b8769..cb81a8a0ed 100644 --- a/x/pairing/types/relay.pb.go +++ b/x/pairing/types/relay.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -765,9 +765,9 @@ func (m *RelayReply) GetMetadata() []Metadata { } type QualityOfServiceReport struct { - Latency github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=latency,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"latency" yaml:"Latency"` - Availability github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=availability,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"availability" yaml:"availability"` - Sync github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=sync,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"sync" yaml:"sync"` + Latency cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=latency,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"latency" yaml:"Latency"` + Availability cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=availability,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"availability" yaml:"availability"` + Sync cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=sync,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"sync" yaml:"sync"` } func (m *QualityOfServiceReport) Reset() { *m = QualityOfServiceReport{} } @@ -872,88 +872,88 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/relay.proto", fileDescriptor_a61d253b10eeeb9e) } var fileDescriptor_a61d253b10eeeb9e = []byte{ - // 1286 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e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0x1d, 0x86, 0x9e, 0xa1, - 0x5f, 0xca, 0xaa, 0xc1, 0xdf, 0x17, 0xad, 0x5f, 0x0e, 0xd9, 0x4d, 0xc8, 0x2a, 0x2c, 0xc5, 0x65, - 0xa4, 0xca, 0x81, 0x73, 0xb9, 0x16, 0x97, 0xfb, 0xe5, 0x80, 0xac, 0xc1, 0x72, 0x21, 0xc5, 0x90, - 0x27, 0x4c, 0x1a, 0x2f, 0x1b, 0xe1, 0x64, 0x4f, 0xae, 0x40, 0xc3, 0xa4, 0x5c, 0x94, 0x97, 0x83, - 0xd6, 0x92, 0xf9, 0x6b, 0xd9, 0x00, 0x5f, 0x96, 0x03, 0xf2, 0x39, 0xc0, 0x91, 0x50, 0x91, 0x64, - 0x85, 0x90, 0xba, 0x55, 0xdf, 0xf0, 0xb6, 0x9a, 0xdb, 0x6f, 0x77, 0x4e, 0xca, 0xca, 0xce, 0xdd, - 0x92, 0x66, 0x5c, 0x8f, 0xee, 0x1c, 0xec, 0x33, 0x39, 0xe4, 0x31, 0x86, 0x4d, 0x48, 0x1d, 0x36, - 0x8e, 0x84, 0xb2, 0x4b, 0x72, 0x11, 0x6a, 0x96, 0xce, 0x65, 0x13, 0x27, 0xbb, 0x21, 0xdf, 0xc0, - 0xa5, 0x32, 0x97, 0x4c, 0x15, 0x22, 0x57, 0x7c, 0xc8, 0xa2, 0xb1, 0x63, 0xaa, 0xd5, 0xd8, 0x58, - 0xdc, 0x6a, 0x6e, 0x6f, 0x9e, 0x6c, 0xce, 0xea, 0x64, 0xc9, 0x9e, 0x13, 0x0f, 0x57, 0x67, 0xb5, - 0x8c, 0x51, 0x45, 0x02, 0x38, 0x63, 0x22, 0x15, 0x1f, 0x52, 0x6e, 0x38, 0x03, 0x73, 0xff, 0x26, - 0x82, 0x37, 0x11, 0xdb, 0x4d, 0xc8, 0x39, 0x58, 0x54, 0x3c, 0x6d, 0x35, 0x0d, 0xdd, 0xb8, 0x24, - 0xef, 0x41, 0xad, 0x4f, 0x93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 0xbf, 0x67, 0xe9, 0x35, 0x19, 0x73, 0x93, - 0xc6, 0x87, 0x8c, 0xec, 0x40, 0x1d, 0x27, 0x2b, 0xce, 0xb0, 0x30, 0x31, 0x20, 0x6f, 0xcc, 0x07, - 0x64, 0x76, 0x12, 0xeb, 0xec, 0xe3, 0x24, 0xb6, 0x83, 0x83, 0x98, 0x8b, 0xcb, 0xf8, 0x5f, 0x8c, - 0x3b, 0x3e, 0x08, 0x0f, 0x59, 0x12, 0xc5, 0xa5, 0xab, 0xe0, 0x86, 0x43, 0x6e, 0x96, 0xdb, 0xdf, - 0x57, 0xa0, 0x6e, 0x8c, 0x32, 0x49, 0xee, 0x40, 0xcd, 0x2c, 0xc9, 0xeb, 0x4a, 0xc7, 0x55, 0xdd, - 0xda, 0xc6, 0x6b, 0x65, 0x8a, 0x6c, 0x14, 0x2c, 0x90, 0x7b, 0xb0, 0x62, 0xcb, 0xad, 0xec, 0xab, - 0x58, 0xf2, 0x3e, 0xfb, 0xaf, 0x34, 0xbf, 0xeb, 0xa1, 0xb3, 0x66, 0x0c, 0x7c, 0x95, 0xca, 0xd9, - 0x31, 0xf4, 0x55, 0x2a, 0xa7, 0x73, 0x64, 0xb0, 0xd0, 0xbb, 0xf5, 0xe4, 0x79, 0xdb, 0x7b, 0xfa, - 0xbc, 0xed, 0xfd, 0xfe, 0xbc, 0xed, 0xfd, 0xf8, 0xa2, 0xbd, 0xf0, 0xf4, 0x45, 0x7b, 0xe1, 0x97, - 0x17, 0xed, 0x85, 0x7b, 0xd7, 0x66, 0x62, 0x3b, 0x37, 0x0c, 0x0f, 0xaf, 0x77, 0x1f, 0x4d, 0x06, - 0x74, 0x13, 0xe3, 0xfe, 0x92, 0x99, 0x83, 0xdf, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x16, - 0xdd, 0xd8, 0xc5, 0x0b, 0x00, 0x00, + // 1290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdf, 0x72, 0x1b, 0x35, + 0x17, 0xcf, 0x3a, 0x76, 0x1c, 0x1f, 0x6f, 0xd3, 0x56, 0x6d, 0x5a, 0x4f, 0x3a, 0x9f, 0x93, 0xee, + 0x37, 0x5f, 0xbf, 0x4c, 0x61, 0x6c, 0x08, 0x85, 0x8b, 0x5e, 0x81, 0xdb, 0x00, 0x81, 0x42, 0xc3, + 0x06, 0x6e, 0x3a, 0x03, 0x5b, 0x79, 0x57, 0x59, 0x8b, 0xae, 0x57, 0x1b, 0x49, 0xeb, 0xd6, 0xbc, + 0x00, 0x57, 0xcc, 0xc0, 0x3b, 0xf0, 0x2c, 0x9d, 0x5e, 0xf6, 0x92, 0x61, 0x86, 0x0e, 0xd3, 0xbe, + 0x01, 0xc3, 0x03, 0x30, 0x47, 0x92, 0xff, 0x35, 0x69, 0x29, 0x7f, 0xae, 0x56, 0xfa, 0xed, 0xd1, + 0xd1, 0xd1, 0xef, 0x9c, 0xf3, 0x93, 0x60, 0x2b, 0xa3, 0x23, 0x9a, 0x33, 0xdd, 0xc5, 0x6f, 0xb7, + 0xa0, 0x5c, 0xf2, 0x3c, 0xed, 0x4a, 0x96, 0xd1, 0x71, 0xa7, 0x90, 0x42, 0x0b, 0x72, 0xde, 0x59, + 0x74, 0xf0, 0xdb, 0x71, 0x16, 0x1b, 0xe7, 0x53, 0x91, 0x0a, 0x63, 0xd0, 0xc5, 0x91, 0xb5, 0xdd, + 0x68, 0xa7, 0x42, 0xa4, 0x19, 0xeb, 0x9a, 0x59, 0xbf, 0x3c, 0xec, 0xde, 0x97, 0xb4, 0x28, 0x98, + 0x54, 0xee, 0xff, 0xe6, 0xf3, 0xff, 0x35, 0x1f, 0x32, 0xa5, 0xe9, 0xb0, 0x70, 0x06, 0xaf, 0x2d, + 0x84, 0xc3, 0x0a, 0x11, 0x0f, 0x94, 0x16, 0x92, 0xa6, 0xac, 0xab, 0x34, 0xbd, 0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, 0x8b, 0x5c, 0xb3, 0x5c, 0x9b, 0x18, 0xcd, 0x79, 0xfc, 0xb0, 0xe9, 0x30, 0x8c, 0x0c, + 0xe3, 0x52, 0xd6, 0x0d, 0x2e, 0x5f, 0xb6, 0x71, 0x39, 0x64, 0x2f, 0x21, 0xeb, 0xb0, 0x12, 0x97, + 0x91, 0x2a, 0x87, 0x2e, 0xe4, 0x5a, 0x5c, 0x1e, 0x94, 0x43, 0xb2, 0x01, 0xab, 0x85, 0x14, 0x23, + 0x9e, 0x30, 0x69, 0xa2, 0x6c, 0x84, 0xd3, 0x39, 0xb9, 0x04, 0x0d, 0x53, 0x72, 0x51, 0x5e, 0x0e, + 0x5b, 0x2b, 0x66, 0xd5, 0xaa, 0x01, 0x3e, 0x2d, 0x87, 0xe4, 0x63, 0x80, 0x23, 0xa1, 0x22, 0xc9, + 0x0a, 0x21, 0x75, 0xab, 0xbe, 0xe5, 0x6d, 0x37, 0x77, 0x5e, 0xef, 0x9c, 0x54, 0x95, 0x9d, 0xcf, + 0x4a, 0x9a, 0x71, 0x3d, 0xbe, 0x7d, 0x78, 0xc0, 0xe4, 0x88, 0xc7, 0x98, 0x36, 0x21, 0x75, 0xd8, + 0x38, 0x12, 0xca, 0x0e, 0xc9, 0x79, 0xa8, 0x59, 0x3a, 0x57, 0x4d, 0x9e, 0xec, 0x84, 0x7c, 0x09, + 0x17, 0xca, 0x5c, 0x32, 0x55, 0x88, 0x5c, 0xf1, 0x11, 0x8b, 0x26, 0x81, 0xa9, 0x56, 0x63, 0x6b, + 0x79, 0xbb, 0xb9, 0x73, 0xe5, 0xe4, 0xed, 0xac, 0x4f, 0x96, 0xec, 0x3b, 0xf3, 0x70, 0x7d, 0xde, + 0xcb, 0x04, 0x55, 0x24, 0x80, 0x53, 0x26, 0x53, 0xf1, 0x80, 0x72, 0xc3, 0x19, 0x98, 0xf3, 0x37, + 0x11, 0xbc, 0x81, 0xd8, 0x5e, 0x42, 0xce, 0xc0, 0xb2, 0xe2,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d9, 0xb7, 0x77, 0x5f, 0xa4, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1113,6 +1113,7 @@ func _Relayer_Probe_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +var Relayer_serviceDesc = _Relayer_serviceDesc var _Relayer_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.pairing.Relayer", HandlerType: (*RelayerServer)(nil), diff --git a/x/pairing/types/relayCache.pb.go b/x/pairing/types/relayCache.pb.go index d8d3cb13a2..faf5f7cffe 100644 --- a/x/pairing/types/relayCache.pb.go +++ b/x/pairing/types/relayCache.pb.go @@ -681,6 +681,7 @@ func _RelayerCache_Health_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var RelayerCache_serviceDesc = _RelayerCache_serviceDesc var _RelayerCache_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.pairing.RelayerCache", HandlerType: (*RelayerCacheServer)(nil), diff --git a/x/pairing/types/tx.pb.go b/x/pairing/types/tx.pb.go index ba3636a161..3d7d74f38f 100644 --- a/x/pairing/types/tx.pb.go +++ b/x/pairing/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" types2 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" @@ -751,68 +752,69 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/tx.proto", fileDescriptor_07b85a84d2198a91) } var fileDescriptor_07b85a84d2198a91 = []byte{ - // 970 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0x5b, 0x37, 0x4d, 0x5e, 0x76, 0xdb, 0x64, 0x9a, 0xa5, 0xae, 0xdb, 0x0d, 0xc1, 0x0b, - 0x34, 0x54, 0x60, 0xd3, 0x82, 0x84, 0x94, 0x63, 0x5a, 0x16, 0xed, 0x6a, 0x23, 0x2a, 0x57, 0x1c, - 0xe0, 0x12, 0x4d, 0xec, 0xc1, 0xf5, 0x36, 0xf1, 0x58, 0x9e, 0xd9, 0x68, 0xcb, 0x99, 0x13, 0x17, - 0xe0, 0xc2, 0x6f, 0xe0, 0xb8, 0xff, 0x81, 0xcb, 0x1e, 0xf7, 0xc8, 0x09, 0xa1, 0xf6, 0xb0, 0x7f, - 0x03, 0xcd, 0x78, 0xec, 0x24, 0x4e, 0x5a, 0x05, 0xc1, 0x25, 0xf6, 0xcc, 0xfb, 0xe6, 0x7d, 0xdf, - 0x7c, 0xf3, 0xde, 0xc4, 0xf0, 0x70, 0x88, 0xc7, 0x38, 0x22, 0xdc, 0x11, 0x4f, 0x27, 0xc6, 0x61, - 0x12, 0x46, 0x81, 0xc3, 0x5f, 0xda, 0x71, 0x42, 0x39, 0x45, 0x0d, 0x15, 0xb6, 0xc5, 0xd3, 0x56, - 0x61, 0xb3, 0xe9, 0x51, 0x36, 0xa2, 0xcc, 0x19, 0x60, 0x46, 0x9c, 0xf1, 0xd1, 0x80, 0x70, 0x7c, - 0xe4, 0x78, 0x34, 0x8c, 0xd2, 0x55, 0x66, 0x23, 0xa0, 0x01, 0x95, 0xaf, 0x8e, 0x78, 0x53, 0xb3, - 0xed, 0x19, 0x2a, 0x12, 0x53, 0xef, 0x82, 0x71, 0x9a, 0xe0, 0x80, 0x38, 0x24, 0xf2, 0x63, 0x1a, - 0x46, 0x5c, 0x21, 0x5b, 0x0b, 0x45, 0x25, 0x64, 0x88, 0xaf, 0x14, 0xe2, 0x7d, 0xa5, 0x80, 0x71, - 0x7c, 0x29, 0x62, 0x99, 0x08, 0x35, 0x56, 0xa8, 0x3a, 0x1e, 0x85, 0x11, 0x75, 0xe4, 0x6f, 0x3a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 0x1e, 0x1d, 0x39, 0x33, 0x9f, 0x64, 0xe3, 0xcf, 0x9d, 0x97, - 0x93, 0x8f, 0xc5, 0xab, 0x98, 0xb0, 0x41, 0x49, 0x7e, 0x5f, 0x7d, 0xf6, 0x4f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xf3, 0x9b, 0xc2, 0x3d, 0x51, 0x0a, 0x00, 0x00, + // 988 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x31, 0x6f, 0xdb, 0x46, + 0x14, 0x36, 0x6d, 0xda, 0x96, 0x9e, 0x12, 0x5b, 0x62, 0xd4, 0x9a, 0xa6, 0x1d, 0x45, 0x61, 0x9a, + 0x58, 0x15, 0x5a, 0xb2, 0x76, 0x0b, 0x14, 0xd0, 0x28, 0xbb, 0x29, 0x12, 0x44, 0xa8, 0x41, 0xa3, + 0x43, 0xbb, 0x08, 0x27, 0xf2, 0x4a, 0x33, 0x16, 0x79, 0x04, 0xef, 0x22, 0xc4, 0x1d, 0x33, 0x76, + 0xca, 0xd4, 0xa5, 0xe8, 0xde, 0xd1, 0x3f, 0x23, 0x5b, 0x33, 0x76, 0x2a, 0x0a, 0x7b, 0xf0, 0xdf, + 0x28, 0xee, 0x78, 0xa4, 0x24, 0x4a, 0x36, 0x54, 0x34, 0x8b, 0xc8, 0x77, 0xef, 0x7b, 0xef, 0x7d, + 0xf7, 0xdd, 0x7b, 0x27, 0xc2, 0xfd, 0x21, 0x1a, 0xa1, 0x08, 0x33, 0x9b, 0x3f, 0xed, 0x18, 0x05, + 0x49, 0x10, 0xf9, 0x36, 0x7b, 0x6d, 0xc5, 0x09, 0x61, 0x44, 0xab, 0x4b, 0xb7, 0xc5, 0x9f, 0x96, + 0x74, 0x1b, 0x0d, 0x97, 0xd0, 0x90, 0x50, 0x7b, 0x80, 0x28, 0xb6, 0x47, 0xfb, 0x03, 0xcc, 0xd0, + 0xbe, 0xed, 0x92, 0x20, 0x4a, 0xa3, 0x8c, 0xba, 0x4f, 0x7c, 0x22, 0x5e, 0x6d, 0xfe, 0x26, 0x57, + 0x5b, 0x53, 0xa5, 0x70, 0x4c, 0xdc, 0x53, 0xca, 0x48, 0x82, 0x7c, 0x6c, 0xe3, 0xc8, 0x8b, 0x49, + 0x10, 0x31, 0x89, 0x6c, 0xce, 0x25, 0x95, 0xe0, 0x21, 0x3a, 0x97, 0x88, 0x4f, 0x24, 0x03, 0xca, + 0xd0, 0x19, 0xf7, 0x65, 0x24, 0xa4, 0x2d, 0x51, 0x35, 0x14, 0x06, 0x11, 0xb1, 0xc5, 0xaf, 0x5c, + 0xda, 0x92, 0x81, 0x21, 0xe5, 0x41, 0xfc, 0x91, 0x3a, 0xcc, 0xdf, 0x54, 0xa8, 0xf6, 0xa8, 0x7f, + 0xc2, 0xd0, 0x19, 0x3e, 0x4e, 0xc8, 0x28, 0xf0, 0x70, 0xa2, 0xe9, 0xb0, 0xee, 0x26, 0x18, 0x31, + 0x92, 0xe8, 0x4a, 0x53, 0x69, 0x95, 0x9d, 0xcc, 0x14, 0x9e, 0x53, 0x14, 0x44, 0xcf, 0x8e, 0xf4, + 0x65, 0xe9, 0x49, 0x4d, 0xed, 0x6b, 0x58, 0x43, 0x21, 0x79, 0x15, 0x31, 0x7d, 0xa5, 0xa9, 0xb4, + 0x2a, 0x07, 0xdb, 0x56, 0x5a, 0xd2, 0xe2, 0x6a, 0x59, 0x92, 0xa8, 0x75, 0x48, 0x82, 0xa8, 0xab, + 0xbe, 0xfb, 0xfb, 0xc1, 0x92, 0x23, 0xe1, 0xda, 0xb7, 0x50, 0xce, 0x74, 0xa0, 0xba, 0xda, 0x5c, + 0x69, 0x55, 0x0e, 0x1e, 0x59, 0x53, 0xfa, 0x4f, 0x6a, 0x66, 0x7d, 0x23, 0xb1, 0x32, 0xcb, 0x38, + 0x56, 0x6b, 0x42, 0xc5, 0xc7, 0x64, 0x48, 0x5c, 0xc4,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51, 0x18, 0xb2, 0xbd, 0x1b, 0x13, + 0x4c, 0x03, 0x0d, 0x7b, 0x41, 0x60, 0x5e, 0x2b, 0x86, 0xea, 0xcc, 0xbc, 0x7c, 0x7a, 0x8b, 0x2e, + 0xd3, 0x50, 0x63, 0x7f, 0x61, 0x68, 0x5e, 0x91, 0x42, 0x6d, 0x76, 0x22, 0xda, 0x37, 0xe6, 0x99, + 0xc1, 0x1a, 0x07, 0x8b, 0x63, 0xb3, 0xa2, 0xdd, 0xa3, 0x77, 0x97, 0x0d, 0xe5, 0xfd, 0x65, 0x43, + 0xf9, 0xe7, 0xb2, 0xa1, 0xbc, 0xbd, 0x6a, 0x2c, 0xbd, 0xbf, 0x6a, 0x2c, 0xfd, 0x75, 0xd5, 0x58, + 0xfa, 0xb1, 0xed, 0x07, 0xec, 0xf4, 0xd5, 0xc0, 0x72, 0x49, 0x68, 0x4f, 0x7d, 0xf4, 0x8d, 0xbe, + 0xb2, 0x5f, 0x8f, 0x3f, 0x47, 0xcf, 0x63, 0x4c, 0x07, 0x6b, 0xe2, 0x43, 0xed, 0xcb, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xbe, 0x45, 0x74, 0x94, 0xb3, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1042,6 +1044,7 @@ func _Msg_MoveProviderStake_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.pairing.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/plans/handler.go b/x/plans/handler.go deleted file mode 100644 index 1cc8037873..0000000000 --- a/x/plans/handler.go +++ /dev/null @@ -1,27 +0,0 @@ -package plans - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/plans/keeper" - "github.com/lavanet/lava/v4/x/plans/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - // ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/plans/keeper/grpc_query_params_test.go b/x/plans/keeper/grpc_query_params_test.go index 2e98a3a51c..a0174389ad 100644 --- a/x/plans/keeper/grpc_query_params_test.go +++ b/x/plans/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.PlanKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/plans/keeper/keeper.go b/x/plans/keeper/keeper.go index 92897b1120..51ed2d9a16 100644 --- a/x/plans/keeper/keeper.go +++ b/x/plans/keeper/keeper.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/plans/keeper/msg_server_test.go b/x/plans/keeper/msg_server_test.go index 8b4a011f5a..e6b35c07d5 100644 --- a/x/plans/keeper/msg_server_test.go +++ b/x/plans/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/plans/keeper" "github.com/lavanet/lava/v4/x/plans/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.PlanKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/plans/keeper/plan.go b/x/plans/keeper/plan.go index cab1565eda..356ce19a7b 100644 --- a/x/plans/keeper/plan.go +++ b/x/plans/keeper/plan.go @@ -98,7 +98,11 @@ func (k Keeper) GetAllPlanIndices(ctx sdk.Context) (val []string) { } func (k Keeper) ValidatePlanFields(ctx sdk.Context, planToAdd *types.Plan) error { - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), planToAdd.Price, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if err := utils.ValidateCoins(ctx, bondDenom, planToAdd.Price, false); err != nil { return utils.LavaFormatError("plan price is invalid", err) } diff --git a/x/plans/keeper/plan_test.go b/x/plans/keeper/plan_test.go index 0d509e424b..828875dc4a 100644 --- a/x/plans/keeper/plan_test.go +++ b/x/plans/keeper/plan_test.go @@ -57,7 +57,7 @@ func (ts *tester) createTestPlans(count int, withSameIndex bool, startIndex int) Description: "plan to test", Type: "rpc", Block: 100, - Price: common.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), 1), + Price: common.NewCoin(ts.BondDenom(), 1), PlanPolicy: policy, AllowOveruse: true, OveruseRate: overuseRate, @@ -153,7 +153,7 @@ func TestAddInvalidPlan(t *testing.T) { switch tt.fieldIndex { case PRICE_FIELD: - plans[0].Price = common.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), 0) + plans[0].Price = common.NewCoin(ts.BondDenom(), 0) case OVERUSE_FIELDS: plans[0].AllowOveruse = true plans[0].OveruseRate = 0 diff --git a/x/plans/module.go b/x/plans/module.go index 51e5b60028..ff28b21936 100644 --- a/x/plans/module.go +++ b/x/plans/module.go @@ -182,10 +182,16 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 8 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ context.Context) error { return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/plans/module_simulation.go b/x/plans/module_simulation.go index 229fc02022..53890424fd 100644 --- a/x/plans/module_simulation.go +++ b/x/plans/module_simulation.go @@ -3,7 +3,6 @@ package plans import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -44,7 +43,7 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/plans/types/expected_keepers.go b/x/plans/types/expected_keepers.go index e3435e2942..466c8629ab 100644 --- a/x/plans/types/expected_keepers.go +++ b/x/plans/types/expected_keepers.go @@ -1,7 +1,9 @@ package types import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" + context "context" + + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" @@ -21,5 +23,5 @@ type FixationStoreKeeper interface { } type StakingKeeper interface { - BondDenom(ctx sdk.Context) string + BondDenom(ctx context.Context) (string, error) } diff --git a/x/plans/types/plan.go b/x/plans/types/plan.go index 342b2e548a..f67bd70ab9 100644 --- a/x/plans/types/plan.go +++ b/x/plans/types/plan.go @@ -6,7 +6,7 @@ import ( "reflect" sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) // Function to validate a plan object fields @@ -55,7 +55,7 @@ func (p Plan) ValidatePlan() error { // PriceDecodeHookFunc helps the decoder to correctly unmarshal the price field's amount (type math.Int) func PriceDecodeHookFunc(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { - if t == reflect.TypeOf(sdk.NewInt(0)) { + if t == reflect.TypeOf(math.NewInt(0)) { amountStr, ok := data.(string) if !ok { return nil, fmt.Errorf("unexpected data type for amount field") @@ -66,7 +66,7 @@ func PriceDecodeHookFunc(f reflect.Type, t reflect.Type, data interface{}) (inte if !ok { return nil, fmt.Errorf("failed to convert amount to math.Int") } - return sdk.NewIntFromBigInt(amount), nil + return math.NewIntFromBigInt(amount), nil } return data, nil diff --git a/x/plans/types/plan_decode_test.go b/x/plans/types/plan_decode_test.go index 5e892702a0..1fea8b0ac7 100644 --- a/x/plans/types/plan_decode_test.go +++ b/x/plans/types/plan_decode_test.go @@ -3,6 +3,7 @@ package types import ( "testing" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/types" commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/lavanet/lava/v4/utils/decoder" @@ -56,7 +57,7 @@ func TestDecodeJsonPlan(t *testing.T) { Index: "to_delete_plan", Description: "This plan has no restrictions", Type: "rpc", - Price: types.NewCoin(commontypes.TokenDenom, types.NewIntFromUint64(100000)), + Price: types.NewCoin(commontypes.TokenDenom, math.NewIntFromUint64(100000)), AnnualDiscountPercentage: 20, AllowOveruse: true, OveruseRate: 2, @@ -133,7 +134,7 @@ func TestDecodePlanAddProposal(t *testing.T) { Index: "to_delete_plan", Description: "This plan has no restrictions", Type: "rpc", - Price: types.NewCoin(commontypes.TokenDenom, types.NewIntFromUint64(100000)), + Price: types.NewCoin(commontypes.TokenDenom, math.NewIntFromUint64(100000)), AnnualDiscountPercentage: 20, AllowOveruse: true, OveruseRate: 2, @@ -155,7 +156,7 @@ func TestDecodePlanAddProposal(t *testing.T) { Index: "to_delete_plan_2", Description: "This plan has no restrictions", Type: "rpc", - Price: types.NewCoin(commontypes.TokenDenom, types.NewIntFromUint64(100000)), + Price: types.NewCoin(commontypes.TokenDenom, math.NewIntFromUint64(100000)), AnnualDiscountPercentage: 20, AllowOveruse: true, OveruseRate: 2, diff --git a/x/plans/types/query.pb.go b/x/plans/types/query.pb.go index 1927f6f0ef..6eb695b044 100644 --- a/x/plans/types/query.pb.go +++ b/x/plans/types/query.pb.go @@ -529,6 +529,7 @@ func _Query_Info_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.plans.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/plans/types/tx.pb.go b/x/plans/types/tx.pb.go index 13e0e65001..4c598ee985 100644 --- a/x/plans/types/tx.pb.go +++ b/x/plans/types/tx.pb.go @@ -71,6 +71,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.plans.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/projects/handler.go b/x/projects/handler.go deleted file mode 100644 index 300c2f9ee9..0000000000 --- a/x/projects/handler.go +++ /dev/null @@ -1,39 +0,0 @@ -package projects - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/projects/keeper" - "github.com/lavanet/lava/v4/x/projects/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - _ = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgAddKeys: - res, err := msgServer.AddKeys(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDelKeys: - res, err := msgServer.DelKeys(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgSetPolicy: - res, err := msgServer.SetPolicy(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgSetSubscriptionPolicy: - res, err := msgServer.SetSubscriptionPolicy(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/projects/keeper/grpc_query_params_test.go b/x/projects/keeper/grpc_query_params_test.go index 984bef36a3..c73180118a 100644 --- a/x/projects/keeper/grpc_query_params_test.go +++ b/x/projects/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.ProjectsKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/projects/keeper/keeper.go b/x/projects/keeper/keeper.go index d5bb2753f3..8e5246ae4d 100644 --- a/x/projects/keeper/keeper.go +++ b/x/projects/keeper/keeper.go @@ -3,8 +3,8 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/projects/keeper/msg_server_test.go b/x/projects/keeper/msg_server_test.go index 48d64b9702..3acd5dd91b 100644 --- a/x/projects/keeper/msg_server_test.go +++ b/x/projects/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/projects/keeper" "github.com/lavanet/lava/v4/x/projects/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.ProjectsKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/projects/keeper/project_test.go b/x/projects/keeper/project_test.go index 73c7bc28a5..fdde2b657a 100644 --- a/x/projects/keeper/project_test.go +++ b/x/projects/keeper/project_test.go @@ -5,6 +5,7 @@ import ( "strings" "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/common" @@ -1095,11 +1096,15 @@ func TestSetPolicyByGeolocation(t *testing.T) { EU := planstypes.Geolocation_value["EU"] USE_EU := USE + EU + bondDenom, err := keepers.StakingKeeper.BondDenom(ctx) + if err != nil { + return + } // propose all plans freePlan := planstypes.Plan{ Index: "free", Block: uint64(ctx.BlockHeight()), - Price: sdk.NewCoin(keepers.StakingKeeper.BondDenom(ctx), sdk.NewInt(1)), + Price: sdk.NewCoin(bondDenom, math.NewInt(1)), ProjectsLimit: 3, PlanPolicy: planstypes.Policy{ GeolocationProfile: 4, // USE @@ -1112,7 +1117,7 @@ func TestSetPolicyByGeolocation(t *testing.T) { basicPlan := planstypes.Plan{ Index: "basic", Block: uint64(ctx.BlockHeight()), - Price: sdk.NewCoin(keepers.StakingKeeper.BondDenom(ctx), sdk.NewInt(1)), + Price: sdk.NewCoin(bondDenom, math.NewInt(1)), ProjectsLimit: 5, PlanPolicy: planstypes.Policy{ GeolocationProfile: 0, // GLS @@ -1125,7 +1130,7 @@ func TestSetPolicyByGeolocation(t *testing.T) { premiumPlan := planstypes.Plan{ Index: "premium", Block: uint64(ctx.BlockHeight()), - Price: sdk.NewCoin(keepers.StakingKeeper.BondDenom(ctx), sdk.NewInt(1)), + Price: sdk.NewCoin(bondDenom, math.NewInt(1)), ProjectsLimit: 10, PlanPolicy: planstypes.Policy{ GeolocationProfile: 65535, // GL @@ -1136,7 +1141,7 @@ func TestSetPolicyByGeolocation(t *testing.T) { } plans := []planstypes.Plan{freePlan, basicPlan, premiumPlan} - err := testkeeper.SimulatePlansAddProposal(ctx, keepers.Plans, plans, false) + err = testkeeper.SimulatePlansAddProposal(ctx, keepers.Plans, plans, false) require.NoError(t, err) freeUser := common.CreateNewAccount(_ctx, *keepers, 10000) diff --git a/x/projects/module.go b/x/projects/module.go index 2e78ef4414..58db48a473 100644 --- a/x/projects/module.go +++ b/x/projects/module.go @@ -179,10 +179,16 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 7 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ context.Context) error { return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/projects/module_simulation.go b/x/projects/module_simulation.go index b2039803ff..c9391e2393 100644 --- a/x/projects/module_simulation.go +++ b/x/projects/module_simulation.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -63,15 +62,18 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) var weightMsgAddKeys int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAddKeys, &weightMsgAddKeys, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgAddKeys, + &weightMsgAddKeys, + simState.Rand, + func(r *rand.Rand) { weightMsgAddKeys = defaultWeightMsgAddKeys }, ) @@ -81,8 +83,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgDelKeys int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDelKeys, &weightMsgDelKeys, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgDelKeys, + &weightMsgDelKeys, + simState.Rand, + func(r *rand.Rand) { weightMsgDelKeys = defaultWeightMsgDelKeys }, ) @@ -92,8 +97,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgSetPolicy int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSetPolicy, &weightMsgSetPolicy, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgSetPolicy, + &weightMsgSetPolicy, + simState.Rand, + func(r *rand.Rand) { weightMsgSetPolicy = defaultWeightMsgSetPolicy }, ) @@ -103,8 +111,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgSetSubscriptionPolicy int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSetSubscriptionPolicy, &weightMsgSetSubscriptionPolicy, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgSetSubscriptionPolicy, + &weightMsgSetSubscriptionPolicy, + simState.Rand, + func(r *rand.Rand) { weightMsgSetSubscriptionPolicy = defaultWeightMsgSetSubscriptionPolicy }, ) diff --git a/x/projects/types/expected_keepers.go b/x/projects/types/expected_keepers.go index 3c932ad2f5..11423668b2 100644 --- a/x/projects/types/expected_keepers.go +++ b/x/projects/types/expected_keepers.go @@ -1,7 +1,7 @@ package types import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" ) diff --git a/x/projects/types/message_add_keys.go b/x/projects/types/message_add_keys.go index 4a5bcdab76..539c5ae594 100644 --- a/x/projects/types/message_add_keys.go +++ b/x/projects/types/message_add_keys.go @@ -26,19 +26,6 @@ func (msg *MsgAddKeys) Type() string { return TypeMsgAddKeys } -func (msg *MsgAddKeys) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgAddKeys) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgAddKeys) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/projects/types/message_del_keys.go b/x/projects/types/message_del_keys.go index 942a07ee10..bc5d8dbfca 100644 --- a/x/projects/types/message_del_keys.go +++ b/x/projects/types/message_del_keys.go @@ -26,19 +26,6 @@ func (msg *MsgDelKeys) Type() string { return TypeMsgDelKeys } -func (msg *MsgDelKeys) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgDelKeys) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgDelKeys) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/projects/types/message_set_admin_policy.go b/x/projects/types/message_set_admin_policy.go index d06f47ef00..dd79f006aa 100644 --- a/x/projects/types/message_set_admin_policy.go +++ b/x/projects/types/message_set_admin_policy.go @@ -27,19 +27,6 @@ func (msg *MsgSetPolicy) Type() string { return TypeMsgSetPolicy } -func (msg *MsgSetPolicy) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgSetPolicy) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgSetPolicy) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/projects/types/message_set_subscription_policy.go b/x/projects/types/message_set_subscription_policy.go index 2feda77e0f..3ee450350e 100644 --- a/x/projects/types/message_set_subscription_policy.go +++ b/x/projects/types/message_set_subscription_policy.go @@ -27,19 +27,6 @@ func (msg *MsgSetSubscriptionPolicy) Type() string { return TypeMsgSetSubscriptionPolicy } -func (msg *MsgSetSubscriptionPolicy) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgSetSubscriptionPolicy) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgSetSubscriptionPolicy) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/projects/types/query.pb.go b/x/projects/types/query.pb.go index f47d340e8b..286c8254b5 100644 --- a/x/projects/types/query.pb.go +++ b/x/projects/types/query.pb.go @@ -485,6 +485,7 @@ func _Query_Developer_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.projects.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/projects/types/tx.pb.go b/x/projects/types/tx.pb.go index 37ffc128c0..181e6f687e 100644 --- a/x/projects/types/tx.pb.go +++ b/x/projects/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -428,38 +429,39 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/projects/tx.proto", fileDescriptor_a4f8e20515314f9d) } var fileDescriptor_a4f8e20515314f9d = []byte{ - // 488 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94,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 0x87, 0xd7, 0x4a, 0xf4, 0x01, 0xd2, 0x58, 0x8f, 0xe4, 0x12, - 0x63, 0x25, 0x59, 0x66, 0x7c, 0x69, 0x66, 0xec, 0x37, 0xd0, 0x9c, 0xce, 0x4b, 0x77, 0xf1, 0x3e, - 0x23, 0x72, 0xb7, 0xff, 0x41, 0x64, 0xec, 0x3f, 0x22, 0xe8, 0xcc, 0xef, 0x32, 0x59, 0x6a, 0x73, - 0x75, 0x83, 0xfb, 0xf4, 0x3f, 0x37, 0x68, 0x86, 0xdd, 0x17, 0x67, 0x63, 0x8c, 0xce, 0xc7, 0x18, - 0xfd, 0x1e, 0x63, 0xf4, 0x65, 0x82, 0x1b, 0xe7, 0x13, 0xdc, 0xf8, 0x39, 0xc1, 0x8d, 0xd7, 0xdb, - 0x49, 0x2a, 0xde, 0x1d, 0x0f, 0x83, 0x98, 0x1d, 0x91, 0x0b, 0x4f, 0xdd, 0xc9, 0x13, 0x72, 0x3a, - 0xf3, 0xbc, 0x96, 0x39, 0xe5, 0xc3, 0xf5, 0xea, 0x71, 0x7b, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, - 0x05, 0x2b, 0x35, 0x75, 0x84, 0x05, 0x00, 0x00, + // 511 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0xcd, 0xd5, 0xa8, 0x25, 0x5f, 0x3a, 0x80, 0x95, 0x82, 0xe5, 0xe1, 0xea, 0x3a, 0x4b, 0x68, + 0x25, 0x9f, 0x08, 0x48, 0x48, 0xdd, 0xa8, 0x60, 0xa1, 0x8a, 0x54, 0xb9, 0x03, 0x12, 0x12, 0x42, + 0x8e, 0x7b, 0x32, 0x86, 0xc4, 0x67, 0xf9, 0xae, 0x51, 0x3d, 0xc2, 0xc8, 0xc4, 0x0c, 0x3f, 0x82, + 0x2e, 0xfc, 0x87, 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 0x7f, 0xe3, 0x64, 0x29, 0xcd, 0xd5, 0x0d, 0xf6, 0xb3, 0xff, 0xdc, 0xa0, 0x34, 0xec, 0xbd, + 0x3c, 0x1b, 0x61, 0x74, 0x3e, 0xc2, 0xe8, 0xcf, 0x08, 0xa3, 0xaf, 0x63, 0x5c, 0x3b, 0x1f, 0xe3, + 0xda, 0xaf, 0x31, 0xae, 0xbd, 0xd9, 0x89, 0x62, 0xf1, 0xfe, 0xb8, 0xe7, 0x85, 0x6c, 0x40, 0x2e, + 0xdd, 0x99, 0xc3, 0xa7, 0xe4, 0x64, 0xe6, 0x9e, 0xce, 0x53, 0xca, 0x7b, 0xab, 0x93, 0xcb, 0xf0, + 0xc9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x78, 0x8e, 0xa4, 0xcd, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -625,6 +627,7 @@ func _Msg_SetSubscriptionPolicy_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.projects.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/protocol/handler.go b/x/protocol/handler.go deleted file mode 100644 index c8646de7ef..0000000000 --- a/x/protocol/handler.go +++ /dev/null @@ -1,27 +0,0 @@ -package protocol - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/protocol/keeper" - "github.com/lavanet/lava/v4/x/protocol/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - _ = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/protocol/keeper/grpc_query_params_test.go b/x/protocol/keeper/grpc_query_params_test.go index b83d7e521b..6b78d154f3 100644 --- a/x/protocol/keeper/grpc_query_params_test.go +++ b/x/protocol/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/protocol/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.ProtocolKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/protocol/keeper/keeper.go b/x/protocol/keeper/keeper.go index 32778a600a..592324971c 100644 --- a/x/protocol/keeper/keeper.go +++ b/x/protocol/keeper/keeper.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/protocol/keeper/msg_server_test.go b/x/protocol/keeper/msg_server_test.go index f047c5f4f7..dede87cf9e 100644 --- a/x/protocol/keeper/msg_server_test.go +++ b/x/protocol/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/protocol/keeper" "github.com/lavanet/lava/v4/x/protocol/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.ProtocolKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/protocol/module.go b/x/protocol/module.go index 456c0e0e58..5d52bf679b 100644 --- a/x/protocol/module.go +++ b/x/protocol/module.go @@ -252,10 +252,16 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ context.Context) error { return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/protocol/module_simulation.go b/x/protocol/module_simulation.go index 60a67b4d0f..87035ec289 100644 --- a/x/protocol/module_simulation.go +++ b/x/protocol/module_simulation.go @@ -67,7 +67,7 @@ func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedPropo // } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/protocol/types/message_set_version.go b/x/protocol/types/message_set_version.go index ebb1bc4b94..3a455d03ea 100644 --- a/x/protocol/types/message_set_version.go +++ b/x/protocol/types/message_set_version.go @@ -24,16 +24,6 @@ func (msg *MsgSetVersion) Type() string { return TypeMsgSetVersion } -func (msg *MsgSetVersion) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - -func (msg *MsgSetVersion) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgSetVersion) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { return sdkerrors.Wrap(err, "invalid authority address") diff --git a/x/protocol/types/query.pb.go b/x/protocol/types/query.pb.go index ae969e1df5..e1d7336ddc 100644 --- a/x/protocol/types/query.pb.go +++ b/x/protocol/types/query.pb.go @@ -212,6 +212,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.protocol.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/protocol/types/tx.pb.go b/x/protocol/types/tx.pb.go index b0343b8e56..0e443a48b7 100644 --- a/x/protocol/types/tx.pb.go +++ b/x/protocol/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -125,24 +126,25 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/protocol/tx.proto", fileDescriptor_96fb5a36c35e2c61) } var fileDescriptor_96fb5a36c35e2c61 = []byte{ - // 258 bytes of a gzipped FileDescriptorProto + // 282 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0xc9, 0xf9, 0x39, 0xfa, 0x25, 0x15, 0x7a, 0x60, 0xb6, 0x90, 0x28, 0x54, 0x5e, 0x0f, 0x44, 0xeb, 0xc1, 0xe4, 0xa5, 0x04, - 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x54, 0x4a, 0x09, 0xbb, 0x49, 0x05, 0x89, - 0x45, 0x89, 0xb9, 0xc5, 0x10, 0x35, 0x4a, 0x2d, 0x8c, 0x5c, 0xbc, 0xbe, 0xc5, 0xe9, 0xc1, 0xa9, - 0x25, 0x61, 0xa9, 0x45, 0xc5, 0x99, 0xf9, 0x79, 0x42, 0x32, 0x5c, 0x9c, 0x89, 0xa5, 0x25, 0x19, - 0xf9, 0x45, 0x99, 0x25, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x08, 0x01, 0x21, 0x0b, - 0x2e, 0xf6, 0x32, 0x88, 0x42, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x39, 0x3d, 0xac, 0xee, - 0xd1, 0x83, 0x1a, 0x17, 0x04, 0x53, 0x6e, 0x25, 0xdd, 0xf5, 0x7c, 0x83, 0x96, 0x18, 0xdc, 0x15, - 0x28, 0x96, 0x2a, 0x89, 0x73, 0x89, 0xa2, 0x08, 0x04, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, - 0x1a, 0xa5, 0x73, 0x31, 0xfb, 0x16, 0xa7, 0x0b, 0x25, 0x70, 0x71, 0x21, 0x39, 0x51, 0x05, 0x87, - 0x9d, 0x28, 0x46, 0x48, 0xe9, 0x10, 0xa3, 0x0a, 0x66, 0x91, 0x93, 0xeb, 0x89, 0x47, 0x72, 0x8c, - 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, - 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, - 0xe7, 0xea, 0xa3, 0x84, 0x68, 0x99, 0x89, 0x7e, 0x05, 0x52, 0x04, 0x55, 0x16, 0xa4, 0x16, 0x27, - 0xb1, 0x81, 0xf9, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xc9, 0x83, 0x4c, 0xc6, 0x01, - 0x00, 0x00, + 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x54, 0x4a, 0x3c, 0x39, 0xbf, 0x38, 0x37, + 0xbf, 0x58, 0x3f, 0xb7, 0x38, 0x5d, 0xbf, 0xcc, 0x10, 0x44, 0x41, 0x25, 0x94, 0xb0, 0x5b, 0x51, + 0x90, 0x58, 0x94, 0x98, 0x5b, 0x0c, 0x51, 0xa3, 0x34, 0x89, 0x91, 0x8b, 0xd7, 0xb7, 0x38, 0x3d, + 0x38, 0xb5, 0x24, 0x2c, 0xb5, 0xa8, 0x38, 0x33, 0x3f, 0x4f, 0x48, 0x86, 0x8b, 0x33, 0xb1, 0xb4, + 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0x52, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0x21, 0x20, + 0x64, 0xc1, 0xc5, 0x5e, 0x06, 0x51, 0x28, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa7, 0x87, + 0xd5, 0xa1, 0x7a, 0x50, 0xe3, 0x82, 0x60, 0xca, 0xad, 0x34, 0x9b, 0x9e, 0x6f, 0xd0, 0x42, 0x98, + 0xd4, 0xf5, 0x7c, 0x83, 0x96, 0x18, 0xdc, 0x4d, 0x28, 0x4e, 0x50, 0x12, 0xe7, 0x12, 0x45, 0x11, + 0x08, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x4a, 0xe7, 0x62, 0xf6, 0x2d, 0x4e, 0x17, + 0x4a, 0xe0, 0xe2, 0x42, 0x72, 0xb0, 0x0a, 0x0e, 0x17, 0xa0, 0x18, 0x21, 0xa5, 0x43, 0x8c, 0x2a, + 0x98, 0x45, 0x4e, 0xae, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, + 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9d, + 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0x12, 0xbe, 0x65, 0x26, 0xfa, + 0x15, 0x48, 0xf1, 0x58, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xe6, 0x1b, 0x03, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x9d, 0x58, 0x27, 0xd7, 0xed, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -212,6 +214,7 @@ func _Msg_SetVersion_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.protocol.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/rewards/handler.go b/x/rewards/handler.go deleted file mode 100644 index 144a63eae9..0000000000 --- a/x/rewards/handler.go +++ /dev/null @@ -1,32 +0,0 @@ -package rewards - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/rewards/keeper" - "github.com/lavanet/lava/v4/x/rewards/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer - - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - _ = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgFundIprpc: - res, err := msgServer.FundIprpc(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/rewards/keeper/base_pay.go b/x/rewards/keeper/base_pay.go index 144b82c0b7..decd8efd40 100644 --- a/x/rewards/keeper/base_pay.go +++ b/x/rewards/keeper/base_pay.go @@ -1,7 +1,8 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/rewards/types" ) @@ -32,7 +33,7 @@ func (k Keeper) getBasePay( // GetAllBasePay returns all BasePay func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -58,7 +59,7 @@ func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayWithIndex) { func (k Keeper) getAllBasePayForChain(ctx sdk.Context, chainID string, provider string) (list []types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte(types.BasePayWithIndex{ChainId: chainID, Provider: provider}.Index())) + iterator := storetypes.KVStorePrefixIterator(store, []byte(types.BasePayWithIndex{ChainId: chainID, Provider: provider}.Index())) defer iterator.Close() @@ -75,7 +76,7 @@ func (k Keeper) getAllBasePayForChain(ctx sdk.Context, chainID string, provider func (k Keeper) popAllBasePayForChain(ctx sdk.Context, chainID string) (list []types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte(chainID)) + iterator := storetypes.KVStorePrefixIterator(store, []byte(chainID)) defer iterator.Close() @@ -95,7 +96,7 @@ func (k Keeper) popAllBasePayForChain(ctx sdk.Context, chainID string) (list []t func (k Keeper) removeAllBasePay(ctx sdk.Context) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/rewards/keeper/grpc_query_block_reward.go b/x/rewards/keeper/grpc_query_block_reward.go index af52c115c8..8bcfee28b9 100644 --- a/x/rewards/keeper/grpc_query_block_reward.go +++ b/x/rewards/keeper/grpc_query_block_reward.go @@ -24,7 +24,11 @@ func (k Keeper) BlockReward(goCtx context.Context, req *types.QueryBlockRewardRe // get validator block pool balance coins := k.TotalPoolTokens(ctx, types.ValidatorsRewardsDistributionPoolName) - blockPoolBalance := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + blockPoolBalance := coins.AmountOf(bondDenom) if blocksToNextTimerExpiry == 0 { return nil, utils.LavaFormatWarning("blocksToNextTimerExpiry is zero", fmt.Errorf("critical: Attempt to divide by zero"), utils.LogAttr("blocksToNextTimerExpiry", blocksToNextTimerExpiry), @@ -34,7 +38,7 @@ func (k Keeper) BlockReward(goCtx context.Context, req *types.QueryBlockRewardRe // validators bonus rewards = (blockPoolBalance * bondedTargetFactor) / blocksToNextTimerExpiry validatorsRewards := bondedTargetFactor.MulInt(blockPoolBalance).QuoInt64(blocksToNextTimerExpiry).TruncateInt() - reward := sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), validatorsRewards) + reward := sdk.NewCoin(bondDenom, validatorsRewards) return &types.QueryBlockRewardResponse{Reward: reward}, nil } diff --git a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go index 561c01b71f..d40ce2904a 100644 --- a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go +++ b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" @@ -46,11 +47,11 @@ func (k Keeper) IprpcProviderRewardEstimation(goCtx context.Context, req *types. } // get the provider's relative reward by CU - providerFund, isValid := specFund.Fund.SafeMulInt(sdk.NewIntFromUint64(providerIprpcCu)) + providerFund, isValid := specFund.Fund.SafeMulInt(math.NewIntFromUint64(providerIprpcCu)) if !isValid { continue } - providerFund, isValid = providerFund.SafeQuoInt(sdk.NewIntFromUint64(totalIprpcCu)) + providerFund, isValid = providerFund.SafeQuoInt(math.NewIntFromUint64(totalIprpcCu)) if !isValid { continue } diff --git a/x/rewards/keeper/grpc_query_params_test.go b/x/rewards/keeper/grpc_query_params_test.go index 17cce90dd0..2bd26e0adb 100644 --- a/x/rewards/keeper/grpc_query_params_test.go +++ b/x/rewards/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/rewards/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.RewardsKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/rewards/keeper/helpers_test.go b/x/rewards/keeper/helpers_test.go index 06a836f119..0177d4474a 100644 --- a/x/rewards/keeper/helpers_test.go +++ b/x/rewards/keeper/helpers_test.go @@ -29,10 +29,10 @@ const ( var ( ibcDenom string = "uibc" - minIprpcCost sdk.Coin = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(100)) + minIprpcCost sdk.Coin = sdk.NewCoin(commontypes.TokenDenom, math.NewInt(100)) iprpcFunds sdk.Coins = sdk.NewCoins( - sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(1100)), - sdk.NewCoin(ibcDenom, sdk.NewInt(500)), + sdk.NewCoin(commontypes.TokenDenom, math.NewInt(1100)), + sdk.NewCoin(ibcDenom, math.NewInt(500)), ) mockSpec2 string = "mockspec2" ) @@ -125,17 +125,17 @@ func (ts *tester) setupForIprpcTests(fundIprpcPool bool) { // reset time to the start of the month startOfMonth := time.Date(ts.Ctx.BlockTime().Year(), ts.Ctx.BlockTime().Month(), 1, 0, 0, 0, 0, ts.Ctx.BlockTime().Location()) ts.Ctx = ts.Ctx.WithBlockTime(startOfMonth) - ts.GoCtx = sdk.WrapSDKContext(ts.Ctx) + ts.GoCtx = ts.Ctx if fundIprpcPool { duration := uint64(1) - err = ts.Keepers.BankKeeper.AddToBalance(consumerAcc.Addr, iprpcFunds.MulInt(sdk.NewIntFromUint64(duration))) + err = ts.Keepers.BankKeeper.AddToBalance(consumerAcc.Addr, iprpcFunds.MulInt(math.NewIntFromUint64(duration))) require.NoError(ts.T, err) balanceBeforeFund := ts.GetBalances(consumerAcc.Addr) _, err = ts.TxRewardsFundIprpc(consumer, mockSpec2, duration, iprpcFunds) require.NoError(ts.T, err) expectedBalanceAfterFund := balanceBeforeFund.Sub(iprpcFunds.MulInt(math.NewIntFromUint64(duration))...) - require.True(ts.T, ts.GetBalances(consumerAcc.Addr).IsEqual(expectedBalanceAfterFund)) + require.True(ts.T, ts.GetBalances(consumerAcc.Addr).Equal(expectedBalanceAfterFund)) ts.AdvanceMonths(1).AdvanceEpoch() // fund only fund for next month, so advance a month } } @@ -192,8 +192,9 @@ func (ts *tester) getConsumersForIprpcSubTest(mode int) (sigs.Account, sigs.Acco // 1. validators was created using addValidators(1) and TxCreateValidator // 2. TxCreateValidator was used with init funds of 30000000000000/3 func (ts *tester) makeBondedRatioNonZero() { - bondedRatio := ts.Keepers.StakingKeeper.BondedRatio(ts.Ctx) - if bondedRatio.Equal(sdk.NewDecWithPrec(25, 2)) { + bondedRatio, err := ts.Keepers.StakingKeeper.BondedRatio(ts.Ctx) + require.NoError(ts.T, err) + if bondedRatio.Equal(math.LegacyNewDecWithPrec(25, 2)) { return } @@ -203,11 +204,12 @@ func (ts *tester) makeBondedRatioNonZero() { stakingBondedPool := ts.Keepers.StakingKeeper.GetBondedPool(ts.Ctx) bondedPoolBalance := ts.Keepers.BankKeeper.GetBalance(ts.Ctx, testkeeper.GetModuleAddress(stakingtypes.BondedPoolName), ts.TokenDenom()) require.False(ts.T, bondedPoolBalance.IsZero()) - err := ts.Keepers.BankKeeper.SendCoinsFromModuleToAccount(ts.Ctx, stakingtypes.BondedPoolName, stakingBondedPool.GetAddress(), sdk.NewCoins(bondedPoolBalance)) + err = ts.Keepers.BankKeeper.SendCoinsFromModuleToAccount(ts.Ctx, stakingtypes.BondedPoolName, stakingBondedPool.GetAddress(), sdk.NewCoins(bondedPoolBalance)) require.Nil(ts.T, err) stakingBondedPoolBalance := ts.Keepers.BankKeeper.GetBalance(ts.Ctx, stakingBondedPool.GetAddress(), ts.TokenDenom()) require.False(ts.T, stakingBondedPoolBalance.IsZero()) - bondedRatio = ts.Keepers.StakingKeeper.BondedRatio(ts.Ctx) - require.True(ts.T, bondedRatio.Equal(sdk.NewDecWithPrec(25, 2))) // according to "valInitBalance", bondedRatio should be 0.25 + bondedRatio, err = ts.Keepers.StakingKeeper.BondedRatio(ts.Ctx) + require.NoError(ts.T, err) + require.True(ts.T, bondedRatio.Equal(math.LegacyNewDecWithPrec(25, 2))) // according to "valInitBalance", bondedRatio should be 0.25 } diff --git a/x/rewards/keeper/iprpc.go b/x/rewards/keeper/iprpc.go index e8ce4cd503..b6c3ca45ab 100644 --- a/x/rewards/keeper/iprpc.go +++ b/x/rewards/keeper/iprpc.go @@ -19,11 +19,15 @@ func (k Keeper) FundIprpc(ctx sdk.Context, creator string, duration uint64, fund // check fund consists of minimum amount of ulava (min_iprpc_cost) minIprpcFundCost := k.GetMinIprpcCost(ctx) - if fund.AmountOf(k.stakingKeeper.BondDenom(ctx)).LT(minIprpcFundCost.Amount) { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if fund.AmountOf(bondDenom).LT(minIprpcFundCost.Amount) { return utils.LavaFormatWarning("insufficient ulava tokens in fund. should be at least min iprpc cost * duration", types.ErrFundIprpc, utils.LogAttr("min_iprpc_cost", k.GetMinIprpcCost(ctx).String()), utils.LogAttr("duration", strconv.FormatUint(duration, 10)), - utils.LogAttr("fund_ulava_amount", fund.AmountOf(k.stakingKeeper.BondDenom(ctx))), + utils.LogAttr("fund_ulava_amount", fund.AmountOf(bondDenom)), ) } @@ -34,7 +38,7 @@ func (k Keeper) FundIprpc(ctx sdk.Context, creator string, duration uint64, fund } // send the minimum cost to the validators allocation pool (and subtract them from the fund) - minIprpcFundCostCoins := sdk.NewCoins(minIprpcFundCost).MulInt(sdk.NewIntFromUint64(duration)) + minIprpcFundCostCoins := sdk.NewCoins(minIprpcFundCost).MulInt(math.NewIntFromUint64(duration)) err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, string(types.ValidatorsRewardsAllocationPoolName), minIprpcFundCostCoins) if err != nil { return utils.LavaFormatError(types.ErrFundIprpc.Error()+"for funding validator allocation pool", err, @@ -174,7 +178,7 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR continue } // calculate provider IPRPC reward - providerIprpcReward := specFund.Fund.MulInt(sdk.NewIntFromUint64(providerCU.CU)).QuoInt(sdk.NewIntFromUint64(specCu.TotalCu)) + providerIprpcReward := specFund.Fund.MulInt(math.NewIntFromUint64(providerCU.CU)).QuoInt(math.NewIntFromUint64(specCu.TotalCu)) UsedRewardTemp := UsedReward.Add(providerIprpcReward...) if UsedReward.IsAnyGT(specFund.Fund) { diff --git a/x/rewards/keeper/iprpc_data.go b/x/rewards/keeper/iprpc_data.go index f29071fc9f..f57064564e 100644 --- a/x/rewards/keeper/iprpc_data.go +++ b/x/rewards/keeper/iprpc_data.go @@ -3,17 +3,22 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/rewards/types" ) func (k Keeper) SetIprpcData(ctx sdk.Context, cost sdk.Coin, subs []string) error { - if cost.Denom != k.stakingKeeper.BondDenom(ctx) { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if cost.Denom != bondDenom { return utils.LavaFormatWarning("min iprpc cost must be in acceptable denom", fmt.Errorf("invalid cost"), utils.LogAttr("cost", cost.String()), - utils.LogAttr("acceptable_denom", k.stakingKeeper.BondDenom(ctx)), + utils.LogAttr("acceptable_denom", bondDenom), ) } k.SetMinIprpcCost(ctx, cost) @@ -67,7 +72,7 @@ func (k Keeper) RemoveIprpcSubscription(ctx sdk.Context, address string) { // GetAllIprpcSubscription returns all subscription from the IprpcSubscription store func (k Keeper) GetAllIprpcSubscription(ctx sdk.Context) []string { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IprpcSubscriptionPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/rewards/keeper/iprpc_reward.go b/x/rewards/keeper/iprpc_reward.go index 82138786da..a6a5d6345b 100644 --- a/x/rewards/keeper/iprpc_reward.go +++ b/x/rewards/keeper/iprpc_reward.go @@ -3,7 +3,8 @@ package keeper import ( "encoding/binary" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/rewards/types" ) @@ -59,7 +60,7 @@ func (k Keeper) RemoveIprpcReward(ctx sdk.Context, id uint64) { // GetAllIprpcReward returns all IprpcReward func (k Keeper) GetAllIprpcReward(ctx sdk.Context) (list []types.IprpcReward) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IprpcRewardPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/rewards/keeper/iprpc_test.go b/x/rewards/keeper/iprpc_test.go index a1fba6cb94..a34672d2a6 100644 --- a/x/rewards/keeper/iprpc_test.go +++ b/x/rewards/keeper/iprpc_test.go @@ -75,7 +75,7 @@ func TestFundIprpcTX(t *testing.T) { sdk.NewCoin(ts.BondDenom(), math.NewInt(400)), sdk.NewCoin(ibcDenom, math.NewInt(1970)), ) - require.True(t, expectedIprpcTotalBalance.IsEqual(iprpcTotalBalance)) + require.True(t, expectedIprpcTotalBalance.Equal(iprpcTotalBalance)) // Expected IPRPC rewards (by months, first month is skipped): // 1. mockspec: 10ulava + 180uibc(=50+130), mockspec2: 100ulava(=10+90) + 150uibc(=30+120) @@ -156,7 +156,8 @@ func TestFundIprpcTX(t *testing.T) { func TestIprpcProviderRewardQuery(t *testing.T) { ts := newTester(t, true) ts.setupForIprpcTests(true) // setup funds IPRPC for mock2 spec - ts.Keepers.Distribution.SetParams(ts.Ctx, distributiontypes.Params{CommunityTax: sdk.OneDec().QuoInt64(2)}) + err := ts.Keepers.Distribution.Params.Set(ts.Ctx, distributiontypes.Params{CommunityTax: math.LegacyOneDec().QuoInt64(2)}) + require.NoError(ts.T, err) // get consumers and providers (note, only c1 is IPRPC eligible) c1Acc, _ := ts.GetAccount(common.CONSUMER, 0) @@ -190,10 +191,10 @@ func TestIprpcProviderRewardQuery(t *testing.T) { provider string fund sdk.Coins } - tax := sdk.NewInt(100).SubRaw(10).SubRaw(45) // tax is 10% validators and 45% community + tax := math.NewInt(100).SubRaw(10).SubRaw(45) // tax is 10% validators and 45% community expectedProviderRewards := []providerRewards{ - {provider: p1, fund: iprpcFunds.Sub(minIprpcCost).QuoInt(sdk.NewInt(5))}, - {provider: p2, fund: iprpcFunds.Sub(minIprpcCost).MulInt(sdk.NewInt(4)).QuoInt(sdk.NewInt(5))}, + {provider: p1, fund: iprpcFunds.Sub(minIprpcCost).QuoInt(math.NewInt(5))}, + {provider: p2, fund: iprpcFunds.Sub(minIprpcCost).MulInt(math.NewInt(4)).QuoInt(math.NewInt(5))}, } for _, expectedProviderReward := range expectedProviderRewards { res, err := ts.QueryRewardsIprpcProviderRewardEstimation(expectedProviderReward.provider) @@ -209,7 +210,7 @@ func TestIprpcProviderRewardQuery(t *testing.T) { for i, expectedProviderReward := range expectedProviderRewards { res2, err := ts.QueryDualstakingDelegatorRewards(providerAccs[i].GetVaultAddr(), expectedProviderReward.provider, ts.specs[1].Index) require.NoError(t, err) - require.True(t, res2.Rewards[0].Amount.IsEqual(expectedProviderReward.fund.MulInt(tax).QuoInt(sdk.NewInt(100)))) // taking 0 index because there are no delegators + require.True(t, res2.Rewards[0].Amount.Equal(expectedProviderReward.fund.MulInt(tax).QuoInt(math.NewInt(100)))) // taking 0 index because there are no delegators } } @@ -256,36 +257,36 @@ func TestIprpcSpecRewardQuery(t *testing.T) { // second + third month: mock2 - 2000ulava, mockspec - 100000ulava duration := int64(3) _, err := ts.TxRewardsFundIprpc(consumer, ts.specs[0].Index, uint64(duration), - sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000).Add(minIprpcCost.Amount)))) + sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000).Add(minIprpcCost.Amount)))) require.NoError(ts.T, err) _, err = ts.TxRewardsFundIprpc(consumer, ts.specs[1].Index, uint64(duration), - sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(2000).Add(minIprpcCost.Amount)))) + sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(2000).Add(minIprpcCost.Amount)))) require.NoError(ts.T, err) expectedResults := []rewardstypes.IprpcReward{ { Id: 1, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ibcDenom, sdk.NewInt(500)), - sdk.NewCoin(ts.BondDenom(), sdk.NewInt(1000)))}, + {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ibcDenom, math.NewInt(500)), + sdk.NewCoin(ts.BondDenom(), math.NewInt(1000)))}, }, }, { Id: 2, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, - {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(2000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, + {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(2000)))}, }, }, { Id: 3, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, - {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(2000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, + {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(2000)))}, }, }, { Id: 4, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, - {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(2000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, + {Spec: ts.specs[1].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(2000)))}, }, }, } @@ -299,17 +300,17 @@ func TestIprpcSpecRewardQuery(t *testing.T) { mockspecExpectedResults := []rewardstypes.IprpcReward{ { Id: 2, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, }, }, { Id: 3, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, }, }, { Id: 4, SpecFunds: []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, }, }, } @@ -324,10 +325,10 @@ func TestIprpcSpecRewardQuery(t *testing.T) { afterMonthExpectedResults := expectedResults[1:] afterMonthExpectedResults[0].SpecFunds = []rewardstypes.Specfund{ - {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), sdk.NewInt(100000)))}, + {Spec: ts.specs[0].Index, Fund: sdk.NewCoins(sdk.NewCoin(ts.BondDenom(), math.NewInt(100000)))}, {Spec: ts.specs[1].Index, Fund: sdk.NewCoins( - sdk.NewCoin(ts.BondDenom(), sdk.NewInt(3000)), - sdk.NewCoin(ibcDenom, sdk.NewInt(500)), + sdk.NewCoin(ts.BondDenom(), math.NewInt(3000)), + sdk.NewCoin(ibcDenom, math.NewInt(500)), )}, } res, err = ts.QueryRewardsIprpcSpecReward("") @@ -385,7 +386,7 @@ func TestIprpcRewardObjectsUpdate(t *testing.T) { require.Equal(t, uint64(0), res.CurrentMonthId) for i := range res.IprpcRewards { require.Equal(t, uint64(i+1), res.IprpcRewards[i].Id) - require.True(t, iprpcFunds.Sub(minIprpcCost).IsEqual(res.IprpcRewards[i].SpecFunds[0].Fund)) + require.True(t, iprpcFunds.Sub(minIprpcCost).Equal(res.IprpcRewards[i].SpecFunds[0].Fund)) } // advance month to reach the first iprpc reward (first object is with id=1) @@ -400,7 +401,7 @@ func TestIprpcRewardObjectsUpdate(t *testing.T) { require.Equal(t, uint64(1), res.CurrentMonthId) for i := range res.IprpcRewards { require.Equal(t, uint64(i+1), res.IprpcRewards[i].Id) - require.True(t, iprpcFunds.Sub(minIprpcCost).IsEqual(res.IprpcRewards[i].SpecFunds[0].Fund)) + require.True(t, iprpcFunds.Sub(minIprpcCost).Equal(res.IprpcRewards[i].SpecFunds[0].Fund)) } // advance month without any provider service, there should be one IPRPC object with combined reward @@ -412,7 +413,7 @@ func TestIprpcRewardObjectsUpdate(t *testing.T) { require.NoError(t, err) require.Len(t, res.IprpcRewards, 1) require.Equal(t, uint64(2), res.CurrentMonthId) - require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(sdk.NewInt(2)).IsEqual(res.IprpcRewards[0].SpecFunds[0].Fund)) + require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(math.NewInt(2)).Equal(res.IprpcRewards[0].SpecFunds[0].Fund)) // make a provider service an IPRPC eligible consumer and advance a month // there should be no iprpc rewards objects @@ -436,15 +437,16 @@ func TestIprpcRewardObjectsUpdate(t *testing.T) { func TestFundIprpcTwice(t *testing.T) { ts := newTester(t, true) ts.setupForIprpcTests(false) - ts.Keepers.Distribution.SetParams(ts.Ctx, distributiontypes.Params{CommunityTax: sdk.OneDec().QuoInt64(2)}) - validatorTax := sdk.NewInt(10) - tax := sdk.NewInt(100).Sub(validatorTax).SubRaw(45) // tax is 10% validators and 45% community + err := ts.Keepers.Distribution.Params.Set(ts.Ctx, distributiontypes.Params{CommunityTax: math.LegacyOneDec().QuoInt64(2)}) + require.NoError(ts.T, err) + validatorTax := math.NewInt(10) + tax := math.NewInt(100).Sub(validatorTax).SubRaw(45) // tax is 10% validators and 45% community consumerAcc, consumer := ts.GetAccount(common.CONSUMER, 0) p1Acc, p1 := ts.GetAccount(common.PROVIDER, 0) // fund iprpc pool - err := ts.Keepers.BankKeeper.AddToBalance(consumerAcc.Addr, iprpcFunds.MulInt(math.NewInt(2))) + err = ts.Keepers.BankKeeper.AddToBalance(consumerAcc.Addr, iprpcFunds.MulInt(math.NewInt(2))) require.NoError(ts.T, err) _, err = ts.TxRewardsFundIprpc(consumer, mockSpec2, 2, iprpcFunds) require.NoError(ts.T, err) @@ -466,9 +468,9 @@ func TestFundIprpcTwice(t *testing.T) { // check rewards - should be only from first funding (=iprpcFunds) res, err := ts.QueryDualstakingDelegatorRewards(p1Acc.GetVaultAddr(), p1, mockSpec2) require.NoError(t, err) - require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(tax).QuoInt(sdk.NewInt(100)).IsEqual(res.Rewards[0].Amount)) + require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(tax).QuoInt(math.NewInt(100)).Equal(res.Rewards[0].Amount)) - taxed := iprpcFunds.Sub(minIprpcCost).MulInt(validatorTax).QuoInt(sdk.NewInt(100)) + taxed := iprpcFunds.Sub(minIprpcCost).MulInt(validatorTax).QuoInt(math.NewInt(100)) validatorDistributionPoolTokens := ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, rewardstypes.ValidatorsRewardsDistributionPoolName) require.Equal(t, validatorDistributionPoolTokens.AmountOf(ibcDenom), taxed.AmountOf(ibcDenom)) @@ -482,7 +484,7 @@ func TestFundIprpcTwice(t *testing.T) { // check rewards - should be only from first + second funding (=iprpcFunds*3) res, err = ts.QueryDualstakingDelegatorRewards(p1Acc.GetVaultAddr(), p1, mockSpec2) require.NoError(t, err) - require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(math.NewInt(3)).MulInt(tax).QuoInt(sdk.NewInt(100)).IsEqual(res.Rewards[0].Amount)) + require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(math.NewInt(3)).MulInt(tax).QuoInt(math.NewInt(100)).Equal(res.Rewards[0].Amount)) } // TestIprpcMinCost tests that a fund TX fails if it doesn't have enough tokens to cover for the minimum IPRPC costs @@ -495,7 +497,7 @@ func TestIprpcMinCost(t *testing.T) { ts := newTester(t, true) ts.setupForIprpcTests(false) consumerAcc, consumer := ts.GetAccount(common.CONSUMER, 0) - err := ts.Keepers.BankKeeper.AddToBalance(consumerAcc.Addr, sdk.NewCoins(sdk.NewCoin(ibcDenom, sdk.NewInt(500)))) + err := ts.Keepers.BankKeeper.AddToBalance(consumerAcc.Addr, sdk.NewCoins(sdk.NewCoin(ibcDenom, math.NewInt(500)))) _, poorConsumer := ts.AddAccount(common.CONSUMER, 1, minIprpcCost.Amount.Int64()-10) @@ -508,13 +510,13 @@ func TestIprpcMinCost(t *testing.T) { { name: "Happy flow - creator with enough funds and above min iprpc cost", creator: consumer, - fund: sdk.NewCoins(minIprpcCost.AddAmount(sdk.NewInt(10))), + fund: sdk.NewCoins(minIprpcCost.AddAmount(math.NewInt(10))), success: true, }, { name: "fund without min iprpc cost", creator: consumer, - fund: sdk.NewCoins(minIprpcCost.SubAmount(sdk.NewInt(10))), + fund: sdk.NewCoins(minIprpcCost.SubAmount(math.NewInt(10))), success: false, }, { @@ -526,7 +528,7 @@ func TestIprpcMinCost(t *testing.T) { { name: "insufficient balance for fund", creator: poorConsumer, - fund: sdk.NewCoins(minIprpcCost.AddAmount(sdk.NewInt(10))), + fund: sdk.NewCoins(minIprpcCost.AddAmount(math.NewInt(10))), success: false, }, } @@ -587,11 +589,11 @@ func TestIprpcEligibleSubscriptions(t *testing.T) { require.NoError(t, err) res2, err := ts.QueryRewardsIprpcProviderRewardEstimation(p2) require.NoError(t, err) - require.True(t, res1.SpecFunds[0].Fund.IsEqual(res2.SpecFunds[0].Fund)) - require.True(t, iprpcFunds.Sub(minIprpcCost).QuoInt(sdk.NewInt(2)).IsEqual(res1.SpecFunds[0].Fund)) + require.True(t, res1.SpecFunds[0].Fund.Equal(res2.SpecFunds[0].Fund)) + require.True(t, iprpcFunds.Sub(minIprpcCost).QuoInt(math.NewInt(2)).Equal(res1.SpecFunds[0].Fund)) // fund the pool again (advance month to apply) - _, err = ts.TxRewardsFundIprpc(c1Acc.Addr.String(), mockSpec2, 1, sdk.NewCoins(minIprpcCost.AddAmount(sdk.NewInt(10)))) + _, err = ts.TxRewardsFundIprpc(c1Acc.Addr.String(), mockSpec2, 1, sdk.NewCoins(minIprpcCost.AddAmount(math.NewInt(10)))) require.NoError(ts.T, err) ts.AdvanceMonths(1).AdvanceEpoch() @@ -648,13 +650,13 @@ func TestMultipleIprpcSpec(t *testing.T) { // fund iprpc pool for mock2 spec for 1 months duration := uint64(1) - mock2Fund := sdk.NewCoin(ts.BondDenom(), sdk.NewInt(1700)) + mock2Fund := sdk.NewCoin(ts.BondDenom(), math.NewInt(1700)) _, err = ts.TxRewardsFundIprpc(c1, mockSpec2, duration, sdk.NewCoins(mock2Fund.Add(minIprpcCost))) require.NoError(t, err) // fund iprpc pool for mock3 spec for 3 months duration = uint64(3) - mock3Fund := sdk.NewCoin(ts.BondDenom(), sdk.NewInt(400)) + mock3Fund := sdk.NewCoin(ts.BondDenom(), math.NewInt(400)) _, err = ts.TxRewardsFundIprpc(c1, mockSpec3, duration, sdk.NewCoins(mock3Fund.Add(minIprpcCost))) require.NoError(t, err) @@ -695,11 +697,11 @@ func TestMultipleIprpcSpec(t *testing.T) { for _, sf := range res.SpecFunds { switch sf.Spec { case mockSpec2: - expectedReward := sdk.NewCoins(mock2Fund).QuoInt(sdk.NewInt(2)) - require.True(t, expectedReward.IsEqual(sf.Fund)) + expectedReward := sdk.NewCoins(mock2Fund).QuoInt(math.NewInt(2)) + require.True(t, expectedReward.Equal(sf.Fund)) case mockSpec3: - expectedReward := sdk.NewCoins(mock3Fund).QuoInt(sdk.NewInt(2)) - require.True(t, expectedReward.IsEqual(sf.Fund)) + expectedReward := sdk.NewCoins(mock3Fund).QuoInt(math.NewInt(2)) + require.True(t, expectedReward.Equal(sf.Fund)) } } } @@ -720,8 +722,8 @@ func TestIprpcRewardWithZeroSubRewards(t *testing.T) { // make community participation percentage to be 100% to make the provider not get rewarded for its service later distParams := distributiontypes.DefaultParams() - distParams.CommunityTax = sdk.OneDec() - err := ts.Keepers.Distribution.SetParams(ts.Ctx, distParams) + distParams.CommunityTax = math.LegacyOneDec() + err := ts.Keepers.Distribution.Params.Set(ts.Ctx, distParams) require.NoError(t, err) // make providers service the IPRPC eligible consumer diff --git a/x/rewards/keeper/keeper.go b/x/rewards/keeper/keeper.go index a74ef74d80..c966569b66 100644 --- a/x/rewards/keeper/keeper.go +++ b/x/rewards/keeper/keeper.go @@ -4,10 +4,10 @@ import ( "fmt" "cosmossdk.io/collections" + "cosmossdk.io/log" cosmosMath "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" collcompat "github.com/lavanet/lava/v4/utils/collcompat" @@ -129,7 +129,11 @@ func (k Keeper) BondedTargetFactor(ctx sdk.Context) cosmosMath.LegacyDec { minBonded := params.MinBondedTarget maxBonded := params.MaxBondedTarget lowFactor := params.LowFactor - bonded := k.stakingKeeper.BondedRatio(ctx) + bonded, err := k.stakingKeeper.BondedRatio(ctx) + if err != nil { + // TODO: handle error YAROM + return cosmosMath.LegacyDec{} + } if bonded.GT(maxBonded) { return lowFactor diff --git a/x/rewards/keeper/migrations.go b/x/rewards/keeper/migrations.go index 80f6d3486e..8710e12b9a 100644 --- a/x/rewards/keeper/migrations.go +++ b/x/rewards/keeper/migrations.go @@ -1,6 +1,7 @@ package keeper import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -14,5 +15,9 @@ func NewMigrator(keeper Keeper) Migrator { // MigrateVersion1To2 sets the min IPRPC cost to be 100LAVA = 100,000,000ulava func (m Migrator) MigrateVersion1To2(ctx sdk.Context) error { - return m.keeper.SetIprpcData(ctx, sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), sdk.NewInt(100000000)), []string{}) + bondDenom, err := m.keeper.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + return m.keeper.SetIprpcData(ctx, sdk.NewCoin(bondDenom, math.NewInt(100000000)), []string{}) } diff --git a/x/rewards/keeper/msg_server_test.go b/x/rewards/keeper/msg_server_test.go index da58116073..8ee81aaa59 100644 --- a/x/rewards/keeper/msg_server_test.go +++ b/x/rewards/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/rewards/keeper" "github.com/lavanet/lava/v4/x/rewards/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.RewardsKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/rewards/keeper/params.go b/x/rewards/keeper/params.go index bb829422fd..4fe3479aa4 100644 --- a/x/rewards/keeper/params.go +++ b/x/rewards/keeper/params.go @@ -1,6 +1,7 @@ package keeper import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/rewards/types" ) @@ -23,25 +24,25 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { } // MinBondedTarget returns the MinBondedTarget param -func (k Keeper) MinBondedTarget(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) MinBondedTarget(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyMinBondedTarget, &res) return } // MaxBondedTarget returns the MaxBondedTarget param -func (k Keeper) MaxBondedTarget(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) MaxBondedTarget(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyMaxBondedTarget, &res) return } // LowFactor returns the LowFactor param -func (k Keeper) LowFactor(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) LowFactor(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyLowFactor, &res) return } // LeftoverBurnRate returns the LeftoverBurnRate param -func (k Keeper) LeftoverBurnRate(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) LeftoverBurnRate(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyLeftoverBurnRate, &res) return } @@ -53,7 +54,7 @@ func (k Keeper) MaxRewardBoost(ctx sdk.Context) (res uint64) { } // ValidatorsSubscriptionParticipation returns the ValidatorsSubscriptionParticipation param -func (k Keeper) ValidatorsSubscriptionParticipation(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) ValidatorsSubscriptionParticipation(ctx sdk.Context) (res math.LegacyDec) { k.paramstore.Get(ctx, types.KeyValidatorsSubscriptionParticipation, &res) return } diff --git a/x/rewards/keeper/pool_test.go b/x/rewards/keeper/pool_test.go index 2516c47a26..cb73a66254 100644 --- a/x/rewards/keeper/pool_test.go +++ b/x/rewards/keeper/pool_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distribution "github.com/cosmos/cosmos-sdk/x/distribution" "github.com/lavanet/lava/v4/testutil/common" @@ -96,7 +96,7 @@ func TestBurnRateParam(t *testing.T) { // change the burn rate param to be zero paramKey := string(types.KeyLeftoverBurnRate) - zeroBurnRate, err := sdk.ZeroDec().MarshalJSON() + zeroBurnRate, err := math.LegacyZeroDec().MarshalJSON() require.NoError(t, err) paramVal := string(zeroBurnRate) err = ts.TxProposalChangeParam(types.ModuleName, paramKey, paramVal) @@ -189,7 +189,8 @@ func TestValidatorBlockRewards(t *testing.T) { ts := newTester(t, false) // create validator - stakingSupply := ts.Keepers.StakingKeeper.StakingTokenSupply(ts.Ctx) + stakingSupply, err := ts.Keepers.StakingKeeper.StakingTokenSupply(ts.Ctx) + require.NoError(ts.T, err) valInitBalance := stakingSupply.QuoRaw(3) // specifically picked to make staking module's BondedRatio to be 0.25 ts.AddAccount(common.VALIDATOR, 0, valInitBalance.Int64()) validator, _ := ts.GetAccount(common.VALIDATOR, 0) @@ -198,16 +199,16 @@ func TestValidatorBlockRewards(t *testing.T) { // by default, BondedRatio staking module param is smaller than MinBonded rewards module param // so bondedTargetFactor = 1. We change MinBonded to zero to change bondedTargetFactor params := types.DefaultParams() - params.MinBondedTarget = sdk.ZeroDec() - params.MaxBondedTarget = sdk.NewDecWithPrec(8, 1) // 0.8 - params.LowFactor = sdk.NewDecWithPrec(5, 1) // 0.5 - params.LeftoverBurnRate = sdk.OneDec() + params.MinBondedTarget = math.LegacyZeroDec() + params.MaxBondedTarget = math.LegacyNewDecWithPrec(8, 1) // 0.8 + params.LowFactor = math.LegacyNewDecWithPrec(5, 1) // 0.5 + params.LeftoverBurnRate = math.LegacyOneDec() ts.Keepers.Rewards.SetParams(ts.Ctx, params) // calc the expected BondedTargetFactor with its formula. with the values defined above, // and bondedRatio = 0.25, should be (0.8 - 0.25) / 0.8 + 0.5 * (0.25/0.8) = 0.84375 // compare the new block reward to refBlockReward - expectedBondedTargetFactor := sdk.NewDecWithPrec(84375, 5).TruncateInt() // 0.84375 + expectedBondedTargetFactor := math.LegacyNewDecWithPrec(84375, 5).TruncateInt() // 0.84375 // verify that the current reward amount is as expected by checking the bondedTargetFactor alone res, err := ts.QueryRewardsBlockReward() @@ -215,7 +216,7 @@ func TestValidatorBlockRewards(t *testing.T) { blockReward := res.Reward.Amount distPoolBalance := ts.getPoolBalance(types.ValidatorsRewardsDistributionPoolName, ts.BondDenom()) blocksToNextExpiry := ts.Keepers.Rewards.BlocksToNextTimerExpiry(ts.Ctx) - bondedTargetFactor := sdk.OneDec().MulInt(blockReward).MulInt64(blocksToNextExpiry).QuoInt(distPoolBalance).TruncateInt() + bondedTargetFactor := math.LegacyOneDec().MulInt(blockReward).MulInt64(blocksToNextExpiry).QuoInt(distPoolBalance).TruncateInt() require.True(t, bondedTargetFactor.Equal(expectedBondedTargetFactor)) // return the params to default values @@ -322,9 +323,9 @@ func TestBondedTargetFactorEdgeCases(t *testing.T) { for _, tt := range playbook { t.Run(tt.name, func(t *testing.T) { params := types.Params{ - MinBondedTarget: sdk.MustNewDecFromStr(tt.minBonded), - MaxBondedTarget: sdk.MustNewDecFromStr(tt.maxBonded), - LowFactor: sdk.MustNewDecFromStr(tt.lowFactor), + MinBondedTarget: math.LegacyMustNewDecFromStr(tt.minBonded), + MaxBondedTarget: math.LegacyMustNewDecFromStr(tt.maxBonded), + LowFactor: math.LegacyMustNewDecFromStr(tt.lowFactor), LeftoverBurnRate: types.DefaultLeftOverBurnRate, MaxRewardBoost: types.DefaultMaxRewardBoost, ValidatorsSubscriptionParticipation: types.DefaultValidatorsSubscriptionParticipation, @@ -332,7 +333,8 @@ func TestBondedTargetFactorEdgeCases(t *testing.T) { ts.Keepers.Rewards.SetParams(ts.Ctx, params) if tt.unzeroBondedRatio { - stakingSupply := ts.Keepers.StakingKeeper.StakingTokenSupply(ts.Ctx) + stakingSupply, err := ts.Keepers.StakingKeeper.StakingTokenSupply(ts.Ctx) + require.NoError(ts.T, err) valInitBalance := stakingSupply.QuoRaw(3) // specifically picked to make staking module's BondedRatio to be 0.25 ts.AddAccount(common.VALIDATOR, 0, valInitBalance.Int64()) validator, _ := ts.GetAccount(common.VALIDATOR, 0) @@ -340,7 +342,7 @@ func TestBondedTargetFactorEdgeCases(t *testing.T) { } bondedTargetFactor := ts.Keepers.Rewards.BondedTargetFactor(ts.Ctx) - require.Equal(t, sdk.MustNewDecFromStr(tt.expectedBondedTargetFactor), bondedTargetFactor) + require.Equal(t, math.LegacyMustNewDecFromStr(tt.expectedBondedTargetFactor), bondedTargetFactor) }) } } @@ -395,7 +397,7 @@ func TestBlockRewardsWith2Tokens(t *testing.T) { startTokens = ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, types.ValidatorsRewardsDistributionPoolName) ts.AdvanceBlock() - distribution.BeginBlocker(ts.Ctx, abci.RequestBeginBlock{}, ts.Keepers.Distribution) + distribution.BeginBlocker(ts.Ctx, ts.Keepers.Distribution) currentTokens := ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, types.ValidatorsRewardsDistributionPoolName) require.Equal(t, currentTokens.AmountOf(ibcDenom), currentTokens.AmountOf(ts.BondDenom())) diff --git a/x/rewards/keeper/providers.go b/x/rewards/keeper/providers.go index 4ad9b0befd..35b130c6df 100644 --- a/x/rewards/keeper/providers.go +++ b/x/rewards/keeper/providers.go @@ -31,12 +31,12 @@ func (k Keeper) AggregateCU(ctx sdk.Context, subscription, provider string, chai k.setBasePay(ctx, bp) } -func (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment sdk.Dec, rewards math.Int) { +func (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment math.LegacyDec, rewards math.Int) { bp := types.BasePayWithIndex{Provider: provider, ChainId: chainid} var found bool bp.BasePay, found = k.getBasePay(ctx, bp) adjustedPay := adjustment.MulInt(rewards) - adjustedPay = sdk.MinDec(adjustedPay, sdk.NewDecFromInt(rewards)) + adjustedPay = math.LegacyMinDec(adjustedPay, math.LegacyNewDecFromInt(rewards)) if !found { bp.BasePay = types.BasePay{Total: rewards, TotalAdjusted: adjustedPay} } else { @@ -50,8 +50,13 @@ func (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adju // Distribute bonus rewards to providers across all chains based on performance func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context) { coins := k.TotalPoolTokens(ctx, types.ProviderRewardsDistributionPool) - total := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) - totalRewarded := sdk.ZeroInt() + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + utils.LavaFormatError("failed to distribute monthly bonus rewards", err, utils.LogAttr("bond_denom", bondDenom)) + return + } + total := coins.AmountOf(bondDenom) + totalRewarded := math.ZeroInt() // specs emissions from the total reward pool base on stake specs := k.SpecEmissionParts(ctx) @@ -71,7 +76,7 @@ func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context) { // calculate the maximum rewards for the spec specTotalPayout := math.LegacyZeroDec() if !totalbasepay.IsZero() { - specTotalPayout = k.SpecTotalPayout(ctx, total, sdk.NewDecFromInt(totalbasepay), spec) + specTotalPayout = k.SpecTotalPayout(ctx, total, math.LegacyNewDecFromInt(totalbasepay), spec) } details := map[string]string{} // distribute the rewards to all providers @@ -88,7 +93,7 @@ func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context) { return } // now give the reward the provider contributor and delegators - providerOnlyReward, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, basepay.Provider, basepay.ChainId, sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), reward)), string(types.ProviderRewardsDistributionPool), false, false, false) + providerOnlyReward, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, basepay.Provider, basepay.ChainId, sdk.NewCoins(sdk.NewCoin(bondDenom, reward)), string(types.ProviderRewardsDistributionPool), false, false, false) if err != nil { utils.LavaFormatError("failed to send bonus rewards to provider", err, utils.LogAttr("provider", basepay.Provider)) } @@ -101,7 +106,7 @@ func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context) { details["block"] = strconv.FormatInt(ctx.BlockHeight(), 10) details["chainid"] = spec.ChainID - details["total_rewards"] = sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), totalbasepay).String() + details["total_rewards"] = sdk.NewCoin(bondDenom, totalbasepay).String() details["total_cu"] = totalbasepay.String() utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProvidersBonusRewardsEventName, details, "provider bonus rewards distributed") } @@ -121,17 +126,17 @@ func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context) { // specPayoutAllocation: maximum rewards that the spec can have // rewardBoost: bonus based on the total rewards providers got factored by maxboost // diminishingRewards: makes sure to diminish the bonuses in case there are enough consumers on the chain -func (k Keeper) SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards sdk.Dec, spec types.SpecEmissionPart) math.LegacyDec { +func (k Keeper) SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards math.LegacyDec, spec types.SpecEmissionPart) math.LegacyDec { specPayoutAllocation := spec.Emission.MulInt(totalMonthlyPayout) rewardBoost := totalProvidersBaseRewards.MulInt64(int64(k.MaxRewardBoost(ctx))) - diminishingRewards := sdk.MaxDec(sdk.ZeroDec(), (sdk.NewDecWithPrec(15, 1).Mul(specPayoutAllocation)).Sub(sdk.NewDecWithPrec(5, 1).Mul(totalProvidersBaseRewards))) - return sdk.MinDec(sdk.MinDec(specPayoutAllocation, rewardBoost), diminishingRewards) + diminishingRewards := math.LegacyMaxDec(math.LegacyZeroDec(), (math.LegacyNewDecWithPrec(15, 1).Mul(specPayoutAllocation)).Sub(math.LegacyNewDecWithPrec(5, 1).Mul(totalProvidersBaseRewards))) + return math.LegacyMinDec(math.LegacyMinDec(specPayoutAllocation, rewardBoost), diminishingRewards) } func (k Keeper) SpecEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissionPart) { chainIDs := k.specKeeper.GetAllChainIDs(ctx) - totalStake := sdk.ZeroDec() - chainStake := map[string]sdk.Dec{} + totalStake := math.LegacyZeroDec() + chainStake := map[string]math.LegacyDec{} for _, chainID := range chainIDs { spec, found := k.specKeeper.GetSpec(ctx, chainID) if !found { @@ -143,9 +148,9 @@ func (k Keeper) SpecEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissi } stakeEntries := k.epochstorage.GetAllStakeEntriesCurrentForChainId(ctx, chainID) - chainStake[chainID] = sdk.ZeroDec() + chainStake[chainID] = math.LegacyZeroDec() for _, entry := range stakeEntries { - chainStake[chainID] = chainStake[chainID].Add(sdk.NewDecFromInt(entry.TotalStake())) + chainStake[chainID] = chainStake[chainID].Add(math.LegacyNewDecFromInt(entry.TotalStake())) } chainStake[chainID] = chainStake[chainID].MulInt64(int64(spec.Shares)) @@ -245,7 +250,7 @@ func (k Keeper) CalculateValidatorsAndCommunityParticipationRewards(ctx sdk.Cont return zeroCoins, zeroCoins, err } - if communityParticipation.Equal(sdk.OneDec()) { + if communityParticipation.Equal(math.LegacyOneDec()) { return zeroCoins, sdk.NewCoins(reward), nil } @@ -264,16 +269,19 @@ func (k Keeper) CalculateValidatorsAndCommunityParticipationRewards(ctx sdk.Cont // CalculateContributionPercentages calculates the providers' rewards participation to the validators and community pool func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.Int) (validatorsParticipation math.LegacyDec, communityParticipation math.LegacyDec, err error) { - communityTax := k.GetCommunityTax(ctx) - if communityTax.Equal(sdk.OneDec()) { - return sdk.ZeroDec(), sdk.OneDec(), nil + communityTax, err := k.GetCommunityTax(ctx) + if err != nil { + return math.LegacyZeroDec(), math.LegacyZeroDec(), err + } + if communityTax.Equal(math.LegacyOneDec()) { + return math.LegacyZeroDec(), math.LegacyOneDec(), nil } // validators_participation = validators_participation_param / (1-community_tax) validatorsParticipationParam := k.GetParams(ctx).ValidatorsSubscriptionParticipation - validatorsParticipation = validatorsParticipationParam.Quo(sdk.OneDec().Sub(communityTax)) - if validatorsParticipation.GT(sdk.OneDec()) { - return sdk.ZeroDec(), sdk.ZeroDec(), utils.LavaFormatError("validators participation bigger than 100%", fmt.Errorf("validators participation calc failed"), + validatorsParticipation = validatorsParticipationParam.Quo(math.LegacyOneDec().Sub(communityTax)) + if validatorsParticipation.GT(math.LegacyOneDec()) { + return math.LegacyZeroDec(), math.LegacyZeroDec(), utils.LavaFormatError("validators participation bigger than 100%", fmt.Errorf("validators participation calc failed"), utils.Attribute{Key: "validators_participation", Value: validatorsParticipation.String()}, utils.Attribute{Key: "validators_subscription_participation_param", Value: validatorsParticipationParam.String()}, utils.Attribute{Key: "community_tax", Value: communityTax.String()}, @@ -282,8 +290,8 @@ func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.In // community_participation = (community_tax + validators_participation_param) - validators_participation communityParticipation = communityTax.Add(validatorsParticipationParam).Sub(validatorsParticipation) - if communityParticipation.IsNegative() || communityParticipation.GT(sdk.OneDec()) { - return sdk.ZeroDec(), sdk.ZeroDec(), utils.LavaFormatError("community participation is negative or bigger than 100%", fmt.Errorf("community participation calc failed"), + if communityParticipation.IsNegative() || communityParticipation.GT(math.LegacyOneDec()) { + return math.LegacyZeroDec(), math.LegacyZeroDec(), utils.LavaFormatError("community participation is negative or bigger than 100%", fmt.Errorf("community participation calc failed"), utils.Attribute{Key: "community_participation", Value: communityParticipation.String()}, utils.Attribute{Key: "validators_participation", Value: validatorsParticipation.String()}, utils.Attribute{Key: "validators_subscription_participation_param", Value: validatorsParticipationParam.String()}, @@ -292,8 +300,8 @@ func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.In } // check the participation rewards are not more than 100% - if validatorsParticipation.Add(communityParticipation).GT(sdk.OneDec()) { - return sdk.ZeroDec(), sdk.ZeroDec(), utils.LavaFormatError("validators and community participation parts are bigger than 100%", fmt.Errorf("validators and community participation aborted"), + if validatorsParticipation.Add(communityParticipation).GT(math.LegacyOneDec()) { + return math.LegacyZeroDec(), math.LegacyZeroDec(), utils.LavaFormatError("validators and community participation parts are bigger than 100%", fmt.Errorf("validators and community participation aborted"), utils.Attribute{Key: "community_participation", Value: communityParticipation.String()}, utils.Attribute{Key: "validators_participation", Value: validatorsParticipation.String()}, ) @@ -307,11 +315,13 @@ func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, amount sdk.Coins, s return err } - feePool := k.distributionKeeper.GetFeePool(ctx) + feePool, err := k.distributionKeeper.GetFeePool(ctx) + if err != nil { + return err + } feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount...)...) - k.distributionKeeper.SetFeePool(ctx, feePool) - return nil + return k.distributionKeeper.SetFeePool(ctx, feePool) } // isEndOfMonth checks that we're close to next timer expiry by at least 24 hours @@ -326,6 +336,7 @@ func (k Keeper) isEndOfMonth(ctx sdk.Context) bool { return ctx.BlockTime().UTC().Unix()+DAY_SECONDS > NextExpiery } -func (k Keeper) GetCommunityTax(ctx sdk.Context) math.LegacyDec { - return k.distributionKeeper.GetParams(ctx).CommunityTax +func (k Keeper) GetCommunityTax(ctx sdk.Context) (math.LegacyDec, error) { + params, err := k.distributionKeeper.GetParams(ctx) + return params.CommunityTax, err } diff --git a/x/rewards/keeper/providers_test.go b/x/rewards/keeper/providers_test.go index 56b01aafdb..3b4ccdd3c4 100644 --- a/x/rewards/keeper/providers_test.go +++ b/x/rewards/keeper/providers_test.go @@ -74,7 +74,7 @@ func TestBasicBoostProvidersRewards(t *testing.T) { res, err := ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") require.NoError(t, err) require.Len(t, res.Rewards, 1) - expectedReward, _, _ := ts.DeductParticipationFees(sdk.NewIntFromUint64(baserewards * subscription.LIMIT_TOKEN_PER_CU)) + expectedReward, _, _ := ts.DeductParticipationFees(math.NewIntFromUint64(baserewards * subscription.LIMIT_TOKEN_PER_CU)) require.Equal(t, expectedReward, res.Rewards[0].Amount.AmountOf(ts.BondDenom())) _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String()) require.NoError(t, err) @@ -86,7 +86,7 @@ func TestBasicBoostProvidersRewards(t *testing.T) { res, err = ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") require.NoError(t, err) require.Len(t, res.Rewards, 1) - require.Equal(t, res.Rewards[0].Amount.AmountOf(ts.BondDenom()), sdk.NewIntFromUint64(baserewards*subscription.LIMIT_TOKEN_PER_CU)) + require.Equal(t, res.Rewards[0].Amount.AmountOf(ts.BondDenom()), math.NewIntFromUint64(baserewards*subscription.LIMIT_TOKEN_PER_CU)) _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String()) require.NoError(t, err) } @@ -179,7 +179,7 @@ func TestProvidersDiminishingRewards(t *testing.T) { require.NoError(t, err) require.Len(t, res.Rewards, 1) - require.Equal(t, sdk.NewDecWithPrec(15, 1).MulInt(distBalance).Sub(sdk.NewDecWithPrec(5, 1).MulInt(ts.plan.Price.Amount.MulRaw(7))).TruncateInt().QuoRaw(int64(ts.Keepers.Rewards.MaxRewardBoost(ts.Ctx))), res.Rewards[0].Amount.AmountOf(ts.BondDenom())) + require.Equal(t, math.LegacyNewDecWithPrec(15, 1).MulInt(distBalance).Sub(math.LegacyNewDecWithPrec(5, 1).MulInt(ts.plan.Price.Amount.MulRaw(7))).TruncateInt().QuoRaw(int64(ts.Keepers.Rewards.MaxRewardBoost(ts.Ctx))), res.Rewards[0].Amount.AmountOf(ts.BondDenom())) _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String()) require.NoError(t, err) } @@ -464,12 +464,12 @@ func TestValidatorsAndCommunityParticipation(t *testing.T) { // communityTax = 50% // validatorsSubscriptionParticipation = 10% distParams := distributiontypes.DefaultParams() - distParams.CommunityTax = sdk.NewDecWithPrec(5, 1) // 0.5 - err := ts.Keepers.Distribution.SetParams(ts.Ctx, distParams) + distParams.CommunityTax = math.LegacyNewDecWithPrec(5, 1) // 0.5 + err := ts.Keepers.Distribution.Params.Set(ts.Ctx, distParams) require.NoError(t, err) paramKey := string(types.KeyValidatorsSubscriptionParticipation) - newDecParam, err := sdk.NewDecWithPrec(1, 1).MarshalJSON() // 0.1 + newDecParam, err := math.LegacyNewDecWithPrec(1, 1).MarshalJSON() // 0.1 require.Nil(ts.T, err) paramVal := string(newDecParam) err = ts.TxProposalChangeParam(types.ModuleName, paramKey, paramVal) @@ -497,7 +497,7 @@ func TestValidatorsAndCommunityParticipation(t *testing.T) { ts.AdvanceEpoch() ts.AdvanceBlocks(ts.BlocksToSave() + 1) - expectedReward := sdk.NewIntFromUint64(baserewards * subscription.LIMIT_TOKEN_PER_CU) + expectedReward := math.NewIntFromUint64(baserewards * subscription.LIMIT_TOKEN_PER_CU) res, err := ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") require.NoError(t, err) require.Len(t, res.Rewards, 1) @@ -514,8 +514,9 @@ func TestValidatorsAndCommunityParticipation(t *testing.T) { // check actual balance of the commuinty pool // community pool should have 40% of expected reward - communityCoins := ts.Keepers.Distribution.GetFeePoolCommunityCoins(ts.Ctx) - communityBalance := communityCoins.AmountOf(ts.TokenDenom()).TruncateInt() + communityPool, err := ts.Keepers.Distribution.FeePool.Get(ts.Ctx) + require.NoError(t, err) + communityBalance := communityPool.CommunityPool.AmountOf(ts.TokenDenom()).TruncateInt() require.True(t, expectedReward.Mul(communityPerc).QuoRaw(100).Equal(communityBalance)) } @@ -708,12 +709,12 @@ func TestCommunityTaxOne(t *testing.T) { // communityTax = 100% // validatorsSubscriptionParticipation = 10% distParams := distributiontypes.DefaultParams() - distParams.CommunityTax = sdk.OneDec() - err := ts.Keepers.Distribution.SetParams(ts.Ctx, distParams) + distParams.CommunityTax = math.LegacyOneDec() + err := ts.Keepers.Distribution.Params.Set(ts.Ctx, distParams) require.NoError(t, err) paramKey := string(types.KeyValidatorsSubscriptionParticipation) - newDecParam, err := sdk.NewDecWithPrec(1, 1).MarshalJSON() // 0.1 + newDecParam, err := math.LegacyNewDecWithPrec(1, 1).MarshalJSON() // 0.1 require.Nil(ts.T, err) paramVal := string(newDecParam) err = ts.TxProposalChangeParam(types.ModuleName, paramKey, paramVal) @@ -741,7 +742,7 @@ func TestCommunityTaxOne(t *testing.T) { ts.AdvanceEpoch() ts.AdvanceBlocks(ts.BlocksToSave() + 1) - expectedReward := sdk.NewIntFromUint64(baserewards * subscription.LIMIT_TOKEN_PER_CU) + expectedReward := math.NewIntFromUint64(baserewards * subscription.LIMIT_TOKEN_PER_CU) res, err := ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") require.NoError(t, err) require.Len(t, res.Rewards, 0) @@ -751,8 +752,9 @@ func TestCommunityTaxOne(t *testing.T) { // check actual balance of the commuinty pool // community pool should have 100% of expected reward - communityCoins := ts.Keepers.Distribution.GetFeePoolCommunityCoins(ts.Ctx) - communityBalance := communityCoins.AmountOf(ts.TokenDenom()).TruncateInt() + communityPool, err := ts.Keepers.Distribution.FeePool.Get(ts.Ctx) + require.NoError(t, err) + communityBalance := communityPool.CommunityPool.AmountOf(ts.TokenDenom()).TruncateInt() require.Equal(t, expectedReward, communityBalance) } @@ -817,17 +819,17 @@ func TestEstimateRewardsQuery(t *testing.T) { // subscription expected rewards (for two specs) if tt.mode == Delegation { - trackedCuFactor := sdk.OneDec().Add(sdk.NewDec(testStake / 2).QuoInt64(tt.denom)) + trackedCuFactor := math.LegacyOneDec().Add(math.LegacyNewDec(testStake / 2).QuoInt64(tt.denom)) cu = trackedCuFactor.MulInt64(cu).TruncateInt64() } - expectedSubSpec0 := sdk.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) + expectedSubSpec0 := math.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) expectedSubSpec0AfterTax, _, _ := ts.DeductParticipationFees(expectedSubSpec0) - expectedSubSpec1 := sdk.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) + expectedSubSpec1 := math.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) expectedSubSpec1AfterTax, _, _ := ts.DeductParticipationFees(expectedSubSpec1) // providers bonus expected rewards (basic bonus of single provider are the same as sub rewards but without tax) - expectedBonusSpec0 := sdk.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) - expectedBonusSpec1 := sdk.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) + expectedBonusSpec0 := math.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) + expectedBonusSpec1 := math.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) // iprpc expected rewards expectedIprpc := iprpcFunds.AmountOf(ts.BondDenom()).Sub(minIprpcCost.Amount) diff --git a/x/rewards/keeper/rewards.go b/x/rewards/keeper/rewards.go index c4d0fdc080..023b63bd9a 100644 --- a/x/rewards/keeper/rewards.go +++ b/x/rewards/keeper/rewards.go @@ -6,7 +6,7 @@ import ( "math" "strconv" - sdkmath "cosmossdk.io/math" + cosmosmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" @@ -30,7 +30,7 @@ func (k Keeper) DistributeBlockReward(ctx sdk.Context) { } // validators bonus rewards = (distributionPoolBalance * bondedTargetFactor) / blocksToNextTimerExpiry - validatorsRewards, _ := sdk.NewDecCoinsFromCoins(distributionPoolBalance...).MulDec(bondedTargetFactor).QuoDecTruncate(sdk.NewDec(blocksToNextTimerExpiry)).TruncateDecimal() + validatorsRewards, _ := sdk.NewDecCoinsFromCoins(distributionPoolBalance...).MulDec(bondedTargetFactor).QuoDecTruncate(cosmosmath.LegacyNewDec(blocksToNextTimerExpiry)).TruncateDecimal() if !validatorsRewards.IsZero() { // distribute rewards to validators (same as Cosmos mint module) err := k.addCollectedFees(ctx, validatorsRewards) @@ -67,7 +67,7 @@ func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte) { burnRate := k.GetParams(ctx).LeftoverBurnRate k.refillDistributionPool(ctx, monthsLeft, types.ValidatorsRewardsAllocationPoolName, types.ValidatorsRewardsDistributionPoolName, burnRate) - k.refillDistributionPool(ctx, monthsLeft, types.ProvidersRewardsAllocationPool, types.ProviderRewardsDistributionPool, sdk.OneDec()) + k.refillDistributionPool(ctx, monthsLeft, types.ProvidersRewardsAllocationPool, types.ProviderRewardsDistributionPool, cosmosmath.LegacyOneDec()) k.MovePoolToPool(ctx, types.ValidatorsRewardsLeftOverPoolName, types.ValidatorsRewardsDistributionPoolName) if monthsLeft > 1 { @@ -82,10 +82,15 @@ func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte) { nextMonth := utils.NextMonth(ctx.BlockTime()).UTC() k.refillRewardsPoolTS.AddTimerByBlockTime(ctx, uint64(nextMonth.Unix()), []byte(types.RefillRewardsPoolTimerName), monthsLeftBytes) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + // TODO yarom + return + } coins := k.TotalPoolTokens(ctx, types.ValidatorsRewardsDistributionPoolName) - valDistPoolBalance := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)).Int64() + valDistPoolBalance := coins.AmountOf(bondDenom).Int64() coins = k.TotalPoolTokens(ctx, types.ProviderRewardsDistributionPool) - providerDistPoolBalance := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)).Int64() + providerDistPoolBalance := coins.AmountOf(bondDenom).Int64() nextRefillBlock := k.blocksToNextTimerExpiry(ctx, nextMonth.Unix()-ctx.BlockTime().UTC().Unix()) + ctx.BlockHeight() details := map[string]string{ "allocation_pool_remaining_lifetime": strconv.FormatUint(monthsLeft, 10), @@ -115,12 +120,17 @@ func (k Keeper) MovePoolToPool(ctx sdk.Context, from types.Pool, to types.Pool) } } -func (k Keeper) refillDistributionPool(ctx sdk.Context, monthsLeft uint64, allocationPool types.Pool, distributionPool types.Pool, burnRate sdkmath.LegacyDec) { +func (k Keeper) refillDistributionPool(ctx sdk.Context, monthsLeft uint64, allocationPool types.Pool, distributionPool types.Pool, burnRate cosmosmath.LegacyDec) { // burn remaining tokens in the distribution pool coins := k.TotalPoolTokens(ctx, distributionPool) - distPoolBalance := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + utils.LavaFormatError("failed to get bond denom", err, utils.LogAttr("distribution_pool", string(distributionPool))) + return + } + distPoolBalance := coins.AmountOf(bondDenom) tokensToBurn := burnRate.MulInt(distPoolBalance).TruncateInt() - err := k.BurnPoolTokens(ctx, distributionPool, tokensToBurn, k.stakingKeeper.BondDenom(ctx)) + err = k.BurnPoolTokens(ctx, distributionPool, tokensToBurn, bondDenom) if err != nil { utils.LavaFormatError("critical - could not burn distribution pool tokens", err, utils.Attribute{Key: "distribution_pool", Value: string(distributionPool)}, @@ -130,9 +140,9 @@ func (k Keeper) refillDistributionPool(ctx sdk.Context, monthsLeft uint64, alloc // transfer the new monthly quota (if allocation pool is expired, rewards=0) coins = k.TotalPoolTokens(ctx, allocationPool) - allocPoolBalance := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) + allocPoolBalance := coins.AmountOf(bondDenom) if monthsLeft != 0 && !allocPoolBalance.IsZero() { - monthlyQuota := sdk.Coin{Denom: k.stakingKeeper.BondDenom(ctx), Amount: allocPoolBalance.QuoRaw(int64(monthsLeft))} + monthlyQuota := sdk.Coin{Denom: bondDenom, Amount: allocPoolBalance.QuoRaw(int64(monthsLeft))} err = k.bankKeeper.SendCoinsFromModuleToModule( ctx, @@ -160,7 +170,7 @@ func (k Keeper) blocksToNextTimerExpiry(ctx sdk.Context, timeToNextTimerExpiry i return 30 } - effectiveTimeToNextTimerExpiry := sdkmath.LegacyNewDec(timeToNextTimerExpiry) + effectiveTimeToNextTimerExpiry := cosmosmath.LegacyNewDec(timeToNextTimerExpiry) if timeToNextTimerExpiry != math.MaxInt64 { effectiveTimeToNextTimerExpiry = types.BlocksToTimerExpirySlackFactor.MulInt64(timeToNextTimerExpiry) } diff --git a/x/rewards/module.go b/x/rewards/module.go index 7ff6796541..e3d36e06f6 100644 --- a/x/rewards/module.go +++ b/x/rewards/module.go @@ -162,12 +162,20 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - BeginBlocker(ctx, am.keeper) +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + BeginBlocker(sdkCtx, am.keeper) + return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/rewards/module_simulation.go b/x/rewards/module_simulation.go index a5f6613792..6396e4e03d 100644 --- a/x/rewards/module_simulation.go +++ b/x/rewards/module_simulation.go @@ -3,7 +3,6 @@ package rewards import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -44,7 +43,7 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/rewards/types/base_pay.pb.go b/x/rewards/types/base_pay.pb.go index edcf9b9100..109c47d69d 100644 --- a/x/rewards/types/base_pay.pb.go +++ b/x/rewards/types/base_pay.pb.go @@ -4,10 +4,10 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -29,9 +29,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // aggregated rewards for the provider through out the month type BasePay struct { - Total github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=total,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total"` - TotalAdjusted github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=totalAdjusted,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"totalAdjusted"` - IprpcCu uint64 `protobuf:"varint,3,opt,name=iprpc_cu,json=iprpcCu,proto3" json:"iprpc_cu,omitempty"` + Total cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.Int" json:"total"` + TotalAdjusted cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=totalAdjusted,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"totalAdjusted"` + IprpcCu uint64 `protobuf:"varint,3,opt,name=iprpc_cu,json=iprpcCu,proto3" json:"iprpc_cu,omitempty"` } func (m *BasePay) Reset() { *m = BasePay{} } @@ -145,31 +145,31 @@ func init() { } var fileDescriptor_a2fb0eb917a4ee4e = []byte{ - // 375 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xc1, 0x4a, 0xeb, 0x40, - 0x14, 0xcd, 0xbc, 0xd7, 0xf7, 0x52, 0x47, 0x04, 0x0d, 0x5d, 0xb4, 0x05, 0xd3, 0x52, 0x41, 0x8a, - 0xd0, 0x19, 0xaa, 0x2e, 0x45, 0xb0, 0x76, 0x93, 0x9d, 0x04, 0x41, 0x70, 0x13, 0x26, 0xc9, 0xd0, - 0x8e, 0xb6, 0x99, 0x90, 0x4c, 0x62, 0xfb, 0x09, 0xee, 0xfc, 0x18, 0x3f, 0xa2, 0x2b, 0x29, 0xae, - 0xc4, 0x45, 0x91, 0xf6, 0x47, 0x24, 0x33, 0x63, 0xb1, 0xe0, 0xc6, 0x4d, 0xee, 0x3d, 0xf7, 0xde, - 0x9c, 0x3b, 0x87, 0x73, 0xe1, 0xc1, 0x88, 0xe4, 0x24, 0xa2, 0x02, 0x17, 0x11, 0x27, 0xf4, 0x81, - 0x24, 0x61, 0x8a, 0x7d, 0x92, 0x52, 0x2f, 0x26, 0x53, 0x14, 0x27, 0x5c, 0x70, 0xab, 0xa2, 0x87, - 0x50, 0x11, 0x91, 0x1e, 0xaa, 0xef, 0x91, 0x31, 0x8b, 0x38, 0x96, 0x5f, 0x35, 0x58, 0xb7, 0x03, - 0x9e, 0x8e, 0xb9, 0xfa, 0x1f, 0xe7, 0x5d, 0x9f, 0x0a, 0xd2, 0xc5, 0x01, 0x67, 0x91, 0xee, 0xd7, - 0x54, 0xdf, 0x93, 0x08, 0x2b, 0xa0, 0x5b, 0x95, 0x01, 0x1f, 0x70, 0x55, 0x2f, 0x32, 0x55, 0x6d, - 0xbd, 0x00, 0x68, 0xf6, 0x48, 0x4a, 0xaf, 0xc8, 0xd4, 0x72, 0xe1, 0x3f, 0xc1, 0x05, 0x19, 0x55, - 0x41, 0x13, 0xb4, 0xb7, 0x7a, 0x67, 0xb3, 0x45, 0xc3, 0x78, 0x5f, 0x34, 0x0e, 0x07, 0x4c, 0x0c, - 0x33, 0x1f, 0x05, 0x7c, 0xac, 0x19, 0x75, 0xe8, 0xa4, 0xe1, 0x3d, 0x16, 0xd3, 0x98, 0xa6, 0xc8, - 0x89, 0xc4, 0xeb, 0x73, 0x07, 0xea, 0x85, 0x4e, 0x24, 0x5c, 0x45, 0x65, 0x5d, 0xc3, 0x1d, 0x99, - 0x5c, 0x84, 0x77, 0x59, 0x2a, 0x68, 0x58, 0xfd, 0x23, 0xb9, 0xd1, 0x2f, 0xb8, 0xfb, 0x34, 0x70, - 0x37, 0x49, 0xac, 0x1a, 0x2c, 0xb3, 0x38, 0x89, 0x03, 0x2f, 0xc8, 0xaa, 0x7f, 0x9b, 0xa0, 0x5d, - 0x72, 0x4d, 0x89, 0x2f, 0xb3, 0xd6, 0x23, 0x80, 0xbb, 0x5a, 0xd0, 0x0d, 0x13, 0x43, 0x27, 0x0a, - 0xe9, 0xc4, 0xaa, 0xc3, 0x72, 0x9c, 0xf0, 0x9c, 0x85, 0x34, 0x51, 0xe2, 0xdc, 0x35, 0x2e, 0xb8, - 0x82, 0x21, 0x61, 0x91, 0xc7, 0xf4, 0xe3, 0x5c, 0x53, 0x62, 0x27, 0xb4, 0xce, 0x61, 0xf9, 0xcb, - 0x28, 0xb9, 0x66, 0xfb, 0x78, 0x1f, 0xfd, 0xe4, 0x14, 0xd2, 0x0b, 0x7b, 0xa5, 0x42, 0x96, 0x6b, - 0xfa, 0x1a, 0xf6, 0x67, 0x4b, 0x1b, 0xcc, 0x97, 0x36, 0xf8, 0x58, 0xda, 0xe0, 0x69, 0x65, 0x1b, - 0xf3, 0x95, 0x6d, 0xbc, 0xad, 0x6c, 0xe3, 0xf6, 0xe8, 0x9b, 0xee, 0x8d, 0x03, 0xc9, 0x4f, 0xf1, - 0x64, 0x7d, 0x25, 0x52, 0xbf, 0xff, 0x5f, 0x3a, 0x75, 0xf2, 0x19, 0x00, 0x00, 0xff, 0xff, 0xf1, - 0x0b, 0xba, 0x2d, 0x4a, 0x02, 0x00, 0x00, + // 383 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x4f, 0x8b, 0xd3, 0x40, + 0x14, 0xcf, 0x68, 0x35, 0x75, 0x44, 0xd0, 0x50, 0xa1, 0xad, 0x98, 0x96, 0xf6, 0x52, 0x14, 0x67, + 0xa8, 0x7a, 0x16, 0x5a, 0x7b, 0x09, 0x78, 0x90, 0x5c, 0x04, 0x2f, 0x61, 0x32, 0x19, 0x92, 0xd1, + 0x26, 0x13, 0x92, 0x49, 0x6c, 0x3e, 0x82, 0x37, 0x3f, 0x8b, 0xec, 0x87, 0xe8, 0xb1, 0xec, 0x69, + 0xd9, 0x43, 0x59, 0xda, 0x2f, 0xb2, 0x64, 0x66, 0xb6, 0x50, 0x76, 0x2f, 0x33, 0xef, 0xf7, 0xfe, + 0xfc, 0xde, 0x7b, 0xfc, 0x1e, 0x9c, 0xae, 0x49, 0x4d, 0x32, 0x26, 0x71, 0xfb, 0xe3, 0x82, 0xfd, + 0x21, 0x45, 0x54, 0xe2, 0x90, 0x94, 0x2c, 0xc8, 0x49, 0x83, 0xf2, 0x42, 0x48, 0xe1, 0xf4, 0x4c, + 0x12, 0x6a, 0x7f, 0x64, 0x92, 0x86, 0xaf, 0x48, 0xca, 0x33, 0x81, 0xd5, 0xab, 0x13, 0x87, 0x2e, + 0x15, 0x65, 0x2a, 0x74, 0x3d, 0xae, 0xe7, 0x21, 0x93, 0x64, 0x8e, 0xa9, 0xe0, 0x99, 0x89, 0x0f, + 0x74, 0x3c, 0x50, 0x08, 0x6b, 0x60, 0x42, 0xbd, 0x58, 0xc4, 0x42, 0xfb, 0x5b, 0x4b, 0x7b, 0x27, + 0xff, 0x01, 0xb4, 0x97, 0xa4, 0x64, 0xdf, 0x49, 0xe3, 0x2c, 0xe0, 0x13, 0x29, 0x24, 0x59, 0xf7, + 0xc1, 0x18, 0xcc, 0x9e, 0x2d, 0xdf, 0x6f, 0xf7, 0x23, 0xeb, 0x7a, 0x3f, 0x7a, 0xad, 0x69,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0x00, 0xff, 0xff, 0x9a, 0x7e, 0x68, 0x23, 0x2e, 0x02, 0x00, 0x00, } func (m *BasePay) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/expected_keepers.go b/x/rewards/types/expected_keepers.go index a59877db44..9c43f9f64a 100644 --- a/x/rewards/types/expected_keepers.go +++ b/x/rewards/types/expected_keepers.go @@ -1,9 +1,12 @@ package types import ( + "context" + "cosmossdk.io/math" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + distribution "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" v1 "github.com/lavanet/lava/v4/x/downtime/v1" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -19,11 +22,11 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + BurnCoins(ctx context.Context, name string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt sdk.Coins) error + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } @@ -48,8 +51,8 @@ type DowntimeKeeper interface { } type StakingKeeper interface { - BondedRatio(ctx sdk.Context) math.LegacyDec - BondDenom(ctx sdk.Context) string + BondedRatio(ctx context.Context) (math.LegacyDec, error) + BondDenom(ctx context.Context) (string, error) // Methods imported from bank should be defined here } @@ -59,8 +62,24 @@ type DualStakingKeeper interface { } type DistributionKeeper interface { - GetParams(ctx sdk.Context) (params distributiontypes.Params) - GetFeePool(ctx sdk.Context) (feePool distributiontypes.FeePool) - SetFeePool(ctx sdk.Context, feePool distributiontypes.FeePool) + GetParams(ctx sdk.Context) (distributiontypes.Params, error) + GetFeePool(ctx sdk.Context) (distributiontypes.FeePool, error) + SetFeePool(ctx sdk.Context, feePool distributiontypes.FeePool) error // Methods imported from bank should be defined here } + +type DistributionKeeperWrapper struct { + Keeper *distribution.Keeper +} + +func (dkw *DistributionKeeperWrapper) GetParams(ctx sdk.Context) (distributiontypes.Params, error) { + return dkw.Keeper.Params.Get(ctx) +} + +func (dkw *DistributionKeeperWrapper) GetFeePool(ctx sdk.Context) (distributiontypes.FeePool, error) { + return dkw.Keeper.FeePool.Get(ctx) +} + +func (dkw *DistributionKeeperWrapper) SetFeePool(ctx sdk.Context, feePool distributiontypes.FeePool) error { + return dkw.Keeper.FeePool.Set(ctx, feePool) +} diff --git a/x/rewards/types/genesis.go b/x/rewards/types/genesis.go index 05a215b45e..e6f88b7f06 100644 --- a/x/rewards/types/genesis.go +++ b/x/rewards/types/genesis.go @@ -3,6 +3,7 @@ package types import ( fmt "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/lavanet/lava/v4/x/timerstore/types" @@ -21,7 +22,7 @@ func DefaultGenesis() *GenesisState { RefillRewardsTS: *types.DefaultGenesis(), BasePays: []BasePayWithIndex{}, IprpcSubscriptions: []string{}, - MinIprpcCost: sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()), + MinIprpcCost: sdk.NewCoin(commontypes.TokenDenom, math.ZeroInt()), IprpcRewards: []IprpcReward{}, IprpcRewardsCurrent: 0, } diff --git a/x/rewards/types/message_fund_iprpc.go b/x/rewards/types/message_fund_iprpc.go index dbbd57e667..d33e48481d 100644 --- a/x/rewards/types/message_fund_iprpc.go +++ b/x/rewards/types/message_fund_iprpc.go @@ -29,19 +29,6 @@ func (msg *MsgFundIprpc) Type() string { return TypeMsgFundIprpc } -func (msg *MsgFundIprpc) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgFundIprpc) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgFundIprpc) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/rewards/types/message_set_iprpc_data.go b/x/rewards/types/message_set_iprpc_data.go index d7c0cc75ac..46b76b1b8c 100644 --- a/x/rewards/types/message_set_iprpc_data.go +++ b/x/rewards/types/message_set_iprpc_data.go @@ -27,16 +27,6 @@ func (msg *MsgSetIprpcData) Type() string { return TypeMsgSetIprpcData } -func (msg *MsgSetIprpcData) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - -func (msg *MsgSetIprpcData) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgSetIprpcData) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { return sdkerrors.Wrap(err, "invalid authority address") diff --git a/x/rewards/types/params.go b/x/rewards/types/params.go index c085a97409..c690cbc0b6 100644 --- a/x/rewards/types/params.go +++ b/x/rewards/types/params.go @@ -3,7 +3,7 @@ package types import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) @@ -11,23 +11,23 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) var ( - KeyMinBondedTarget = []byte("MinBondedTarget") - DefaultMinBondedTarget sdk.Dec = sdk.NewDecWithPrec(6, 1) // 0.6 + KeyMinBondedTarget = []byte("MinBondedTarget") + DefaultMinBondedTarget math.LegacyDec = math.LegacyNewDecWithPrec(6, 1) // 0.6 ) var ( - KeyMaxBondedTarget = []byte("MaxBondedTarget") - DefaultMaxBondedTarget sdk.Dec = sdk.NewDecWithPrec(8, 1) // 0.8 + KeyMaxBondedTarget = []byte("MaxBondedTarget") + DefaultMaxBondedTarget math.LegacyDec = math.LegacyNewDecWithPrec(8, 1) // 0.8 ) var ( - KeyLowFactor = []byte("LowFactor") - DefaultLowFactor sdk.Dec = sdk.NewDecWithPrec(5, 1) // 0.5 + KeyLowFactor = []byte("LowFactor") + DefaultLowFactor math.LegacyDec = math.LegacyNewDecWithPrec(5, 1) // 0.5 ) var ( - KeyLeftoverBurnRate = []byte("LeftoverBurnRate") - DefaultLeftOverBurnRate sdk.Dec = sdk.OneDec() + KeyLeftoverBurnRate = []byte("LeftoverBurnRate") + DefaultLeftOverBurnRate math.LegacyDec = math.LegacyOneDec() ) var ( @@ -36,8 +36,8 @@ var ( ) var ( - KeyValidatorsSubscriptionParticipation = []byte("ValidatorsSubscriptionParticipation") - DefaultValidatorsSubscriptionParticipation sdk.Dec = sdk.NewDecWithPrec(5, 2) // 0.05 + KeyValidatorsSubscriptionParticipation = []byte("ValidatorsSubscriptionParticipation") + DefaultValidatorsSubscriptionParticipation math.LegacyDec = math.LegacyNewDecWithPrec(5, 2) // 0.05 ) // ParamKeyTable the param key table for launch module @@ -47,12 +47,12 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams( - minBondedTarget sdk.Dec, - maxBondedTarget sdk.Dec, - lowFactor sdk.Dec, - leftoverBurnRate sdk.Dec, + minBondedTarget math.LegacyDec, + maxBondedTarget math.LegacyDec, + lowFactor math.LegacyDec, + leftoverBurnRate math.LegacyDec, maxRewardBoost uint64, - validatorsSubscriptionParticipation sdk.Dec, + validatorsSubscriptionParticipation math.LegacyDec, ) Params { return Params{ MinBondedTarget: minBondedTarget, @@ -129,12 +129,12 @@ func (p Params) String() string { // validateDec validates the Dec param is between 0 and 1 func validateDec(v interface{}) error { - param, ok := v.(sdk.Dec) + param, ok := v.(math.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", v) } - if param.GT(sdk.OneDec()) || param.LT(sdk.ZeroDec()) { + if param.GT(math.LegacyOneDec()) || param.LT(math.LegacyZeroDec()) { return fmt.Errorf("invalid dec parameter") } diff --git a/x/rewards/types/params.pb.go b/x/rewards/types/params.pb.go index 1e53f187a4..76ee6b6beb 100644 --- a/x/rewards/types/params.pb.go +++ b/x/rewards/types/params.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -26,12 +26,12 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - MinBondedTarget github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=min_bonded_target,json=minBondedTarget,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_bonded_target" yaml:"min_bonded_target"` - MaxBondedTarget github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_bonded_target,json=maxBondedTarget,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_bonded_target" yaml:"max_bonded_target"` - LowFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=low_factor,json=lowFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"low_factor" yaml:"low_factor"` - LeftoverBurnRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=leftover_burn_rate,json=leftoverBurnRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"leftover_burn_rate" yaml:"leftover_burn_rate"` - MaxRewardBoost uint64 `protobuf:"varint,5,opt,name=max_reward_boost,json=maxRewardBoost,proto3" json:"max_reward_boost,omitempty"` - ValidatorsSubscriptionParticipation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=validators_subscription_participation,json=validatorsSubscriptionParticipation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"validators_subscription_participation" yaml:"validators_subscription_participation"` + MinBondedTarget cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=min_bonded_target,json=minBondedTarget,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_bonded_target" yaml:"min_bonded_target"` + MaxBondedTarget cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=max_bonded_target,json=maxBondedTarget,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_bonded_target" yaml:"max_bonded_target"` + LowFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=low_factor,json=lowFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"low_factor" yaml:"low_factor"` + LeftoverBurnRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=leftover_burn_rate,json=leftoverBurnRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"leftover_burn_rate" yaml:"leftover_burn_rate"` + MaxRewardBoost uint64 `protobuf:"varint,5,opt,name=max_reward_boost,json=maxRewardBoost,proto3" json:"max_reward_boost,omitempty"` + ValidatorsSubscriptionParticipation cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=validators_subscription_participation,json=validatorsSubscriptionParticipation,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"validators_subscription_participation" yaml:"validators_subscription_participation"` } func (m *Params) Reset() { *m = Params{} } @@ -80,34 +80,34 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/params.proto", fileDescriptor_12687c5fbcde5c39) } var fileDescriptor_12687c5fbcde5c39 = []byte{ - // 422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xbf, 0x8e, 0x94, 0x50, - 0x14, 0xc6, 0x41, 0x67, 0x27, 0xd9, 0x5b, 0xe8, 0x2e, 0xd9, 0x02, 0x2d, 0x60, 0xc5, 0x68, 0x26, - 0x46, 0xa1, 0xd0, 0x6a, 0x4b, 0xdc, 0x58, 0x68, 0xb3, 0x41, 0x2b, 0x0b, 0x6f, 0x0e, 0x70, 0x17, - 0x6f, 0x04, 0x0e, 0xb9, 0xf7, 0xc2, 0x30, 0x6f, 0x61, 0x69, 0xe9, 0x33, 0x58, 0xfb, 0x00, 0x5b, - 0x6e, 0x69, 0x2c, 0x26, 0x66, 0xe6, 0x0d, 0x7c, 0x02, 0xc3, 0x05, 0x9d, 0x7f, 0x8d, 0x93, 0xad, - 0xce, 0xe1, 0xcb, 0xc7, 0xf7, 0xfb, 0x02, 0x39, 0xe4, 0x41, 0x0e, 0x0d, 0x94, 0x4c, 0x05, 0xdd, - 0x0c, 0x04, 0x9b, 0x82, 0x48, 0x65, 0x50, 0x81, 0x80, 0x42, 0xfa, 0x95, 0x40, 0x85, 0xd6, 0xc9, - 0x60, 0xf1, 0xbb, 0xe9, 0x0f, 0x96, 0xfb, 0x27, 0x19, 0x66, 0xa8, 0x0d, 0x41, 0xb7, 0xf5, 0x5e, - 0xef, 0xfb, 0x01, 0x19, 0x5f, 0xe8, 0x97, 0xad, 0x86, 0x1c, 0x17, 0xbc, 0xa4, 0x31, 0x96, 0x29, - 0x4b, 0xa9, 0x02, 0x91, 0x31, 0x65, 0x9b, 0xa7, 0xe6, 0xe4, 0x30, 0x7c, 0x7d, 0x35, 0x77, 0x8d, - 0x9f, 0x73, 0xf7, 0x71, 0xc6, 0xd5, 0xc7, 0x3a, 0xf6, 0x13, 0x2c, 0x82, 0x04, 0x65, 0x81, 0x72, - 0x18, 0xcf, 0x64, 0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ce, 0x46, 0x5f, 0xbe, 0xba, 0x46, 0x78, 0x7e, - 0xb5, 0x70, 0xcc, 0xeb, 0x85, 0x63, 0xfe, 0x5a, 0x38, 0xe6, 0xe7, 0xa5, 0x63, 0x5c, 0x2f, 0x1d, - 0xe3, 0xc7, 0xd2, 0x31, 0xde, 0x3f, 0x59, 0x2b, 0xb7, 0x71, 0x32, 0xcd, 0x8b, 0xa0, 0xfd, 0x77, - 0x37, 0xba, 0x64, 0x3c, 0xd6, 0xb7, 0xf0, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0xf3, - 0x58, 0x18, 0x5c, 0x03, 0x00, 0x00, + // 427 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xbf, 0x6e, 0xd4, 0x40, + 0x10, 0xc6, 0x6d, 0xb8, 0x9c, 0x94, 0x2d, 0x20, 0xb1, 0x52, 0x18, 0x90, 0x7c, 0xc1, 0x08, 0xe9, + 0x84, 0x90, 0x5d, 0x40, 0x81, 0xd2, 0x80, 0xac, 0x88, 0x8a, 0x22, 0x72, 0x90, 0x90, 0x68, 0x56, + 0x63, 0x7b, 0xe3, 0xac, 0xe2, 0xdd, 0xb1, 0x76, 0xf7, 0x7c, 0xbe, 0x07, 0xa0, 0xa7, 0xa4, 0xa4, + 0xe3, 0x55, 0x52, 0xa6, 0x44, 0x14, 0x27, 0x74, 0xf7, 0x06, 0x3c, 0x01, 0xf2, 0xfa, 0x20, 0xff, + 0x1a, 0x2b, 0xd5, 0x8c, 0x3f, 0x7d, 0xf3, 0xfd, 0xc6, 0xf2, 0x98, 0x3c, 0xad, 0xa0, 0x01, 0xc9, + 0x4c, 0xdc, 0xd5, 0x58, 0xb1, 0x39, 0xa8, 0x42, 0xc7, 0x35, 0x28, 0x10, 0x3a, 0xaa, 0x15, 0x1a, + 0xf4, 0xf6, 0x36, 0x96, 0xa8, 0xab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, 0x40, 0x40, 0x9b, + 0x5a, 0x39, 0xe9, 0x54, 0xef, 0x87, 0x4b, 0x9e, 0x37, 0x50, 0xf1, 0x02, 0x0c, 0x2a, 0x4d, 0xf5, + 0x2c, 0xd3, 0xb9, 0xe2, 0xb5, 0xe1, 0x28, 0x69, 0x0d, 0xca, 0xf0, 0x9c, 0xd7, 0xd0, 0x3d, 0xf9, + 0x63, 0xbb, 0xed, 0xf1, 0xb0, 0x6d, 0x5f, 0xf6, 0xdb, 0x0e, 0x4a, 0x0e, 0xd3, 0x67, 0x97, 0xbe, + 0xe3, 0x2b, 0xb6, 0xa3, 0xab, 0xae, 0x83, 0xd1, 0xb7, 0xef, 0x13, 0x27, 0x39, 0x3c, 0x5f, 0x05, + 0xee, 0xc5, 0x2a, 0x70, 0x7f, 0xaf, 0x02, 0xf7, 0xeb, 0x3a, 0x70, 0x2e, 0xd6, 0x81, 0xf3, 0x73, + 0x1d, 0x38, 0x9f, 0x5f, 0x94, 0xdc, 0x9c, 0xce, 0xb2, 0x28, 0x47, 0x11, 0x5f, 0xbb, 0xfd, 0xe6, + 0x75, 0xdc, 0xfe, 0xff, 0x01, 0xcc, 0xa2, 0x66, 0x3a, 0x1b, 0xdb, 0xa3, 0x7e, 0xf5, 0x37, 0x00, + 0x00, 0xff, 0xff, 0x19, 0x54, 0x26, 0xa9, 0x25, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/query.pb.go b/x/rewards/types/query.pb.go index f60ebd819b..e5e4291a32 100644 --- a/x/rewards/types/query.pb.go +++ b/x/rewards/types/query.pb.go @@ -1104,6 +1104,7 @@ func _Query_IprpcSpecReward_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.rewards.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/rewards/types/spec_emmision.go b/x/rewards/types/spec_emmision.go index a107da5034..4f8b208624 100644 --- a/x/rewards/types/spec_emmision.go +++ b/x/rewards/types/spec_emmision.go @@ -1,8 +1,8 @@ package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import "cosmossdk.io/math" type SpecEmissionPart struct { ChainID string - Emission sdk.Dec + Emission math.LegacyDec } diff --git a/x/rewards/types/tx.pb.go b/x/rewards/types/tx.pb.go index d3d4236e3c..49c15c14df 100644 --- a/x/rewards/types/tx.pb.go +++ b/x/rewards/types/tx.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -241,37 +242,39 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/tx.proto", fileDescriptor_6a4c66e189226d78) } var fileDescriptor_6a4c66e189226d78 = []byte{ - // 479 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, - 0x14, 0x6f, 0x68, 0xc5, 0xa8, 0xa9, 0x40, 0x98, 0x8a, 0xa5, 0xd1, 0xc8, 0xaa, 0x48, 0x48, 0x55, - 0xa5, 0xd9, 0x6c, 0x70, 0xda, 0x71, 0x1b, 0x48, 0x1c, 0x7a, 0xc9, 0x6e, 0x70, 0x98, 0x9c, 0xc4, - 0xca, 0x2c, 0x88, 0x1d, 0xe5, 0x39, 0x65, 0xfb, 0x0a, 0x9c, 0xf8, 0x1c, 0x9c, 0xf8, 0x12, 0x48, - 0x3d, 0xee, 0x88, 0x38, 0x00, 0x6a, 0x0f, 0x7c, 0x0d, 0x64, 0x27, 0x69, 0xbb, 0x8a, 0x3f,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, 0x75, 0xe1, 0xb7, 0x5e, 0x8f, 0xd7, 0xd6, - 0x7b, 0xed, 0x15, 0x4d, 0x9f, 0xd3, 0x8b, 0xd5, 0x53, 0x32, 0x6b, 0x8e, 0x6e, 0xdb, 0xfb, 0xfe, - 0xec, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c, 0xd9, 0xff, 0x59, 0x6f, 0x03, 0x00, 0x00, + // 499 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6f, 0xd3, 0x30, + 0x14, 0x6e, 0x68, 0xc5, 0xa8, 0xa9, 0x40, 0x98, 0x8a, 0x76, 0x15, 0x64, 0x55, 0xa4, 0x49, 0x55, + 0xa4, 0xd9, 0x74, 0x70, 0xda, 0x71, 0x1b, 0x48, 0x1c, 0x7a, 0xc9, 0x6e, 0x70, 0x98, 0x9c, 0xc4, + 0xca, 0x2c, 0x88, 0x1d, 0xe5, 0x39, 0x65, 0xbb, 0x72, 0xe4, 0xc4, 0xdf, 0xc1, 0x69, 0x7f, 0x46, + 0x8f, 0x93, 0xb8, 0x70, 0x02, 0xd4, 0x4a, 0xec, 0xdf, 0x40, 0x76, 0x92, 0xb6, 0xab, 0xf8, 0x75, + 0xc9, 0xb3, 0xfd, 0x3d, 0xbf, 0xf7, 0x7d, 0x9f, 0xf3, 0xd0, 0x93, 0x77, 0x6c, 0xca, 0x24, 0xd7, + 0xd4, 0x44, 0x9a, 0xf3, 0xf7, 0x2c, 0x8f, 0x81, 0xea, 0x73, 0x92, 0xe5, 0x4a, 0x2b, 0xdc, 0xad, + 0x60, 0x62, 0x22, 0xa9, 0xe0, 0xc1, 0x03, 0x96, 0x0a, 0xa9, 0xa8, 0xfd, 0x96, 0x89, 0x03, 0x37, + 0x52, 0x90, 0x2a, 0xa0, 0x21, 0x03, 0x4e, 0xa7, 0xe3, 0x90, 0x6b, 0x36, 0xa6,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0xd5, 0xd8, 0x0a, 0x96, 0x7b, 0xcc, 0xd1, 0x16, 0x4b, 0x55, 0x21, 0x75, 0x49, + 0xf9, 0xaf, 0xf2, 0x9f, 0x1a, 0xf9, 0x9f, 0xbf, 0xef, 0x8c, 0x12, 0xa1, 0xcf, 0x8a, 0x90, 0x44, + 0x2a, 0xa5, 0xd5, 0x7b, 0x94, 0x61, 0x0f, 0xe2, 0xb7, 0x54, 0x5f, 0x64, 0x1c, 0xec, 0x05, 0x08, + 0xea, 0xda, 0x18, 0xa3, 0x16, 0x64, 0x3c, 0xea, 0xb7, 0x2c, 0x33, 0xbb, 0x3e, 0xd8, 0x35, 0x46, + 0xd4, 0x24, 0x8d, 0x0d, 0xdd, 0x35, 0x1b, 0x96, 0xba, 0xbc, 0x47, 0xa8, 0xbb, 0xbe, 0xaf, 0x0d, + 0xd8, 0x9f, 0x39, 0xa8, 0x39, 0x81, 0x04, 0xc7, 0xa8, 0x73, 0xe3, 0xd5, 0x77, 0xc9, 0xef, 0x7e, + 0x41, 0xb2, 0xe1, 0xe3, 0x60, 0xef, 0xbf, 0xd2, 0xea, 0x6e, 0xf8, 0x0d, 0x6a, 0xaf, 0xac, 0xf6, + 0xfe, 0x78, 0x77, 0x99, 0x33, 0xf0, 0xff, 0x9d, 0x53, 0x17, 0x3f, 0x3c, 0x9e, 0xcd, 0x5d, 0xe7, + 0x6a, 0xee, 0x3a, 0x3f, 0xe6, 0xae, 0xf3, 0x69, 0xe1, 0x36, 0xae, 0x16, 0x6e, 0xe3, 0xeb, 0xc2, + 0x6d, 0xbc, 0xf6, 0xd7, 0xac, 0xbe, 0x31, 0x78, 0xd3, 0xe7, 0xf4, 0x7c, 0x35, 0x7d, 0xc6, 0xf2, + 0xf0, 0xb6, 0x9d, 0x84, 0x67, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x29, 0x9f, 0x1d, 0xa2, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -373,6 +376,7 @@ func _Msg_FundIprpc_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.rewards.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/rewards/types/types.go b/x/rewards/types/types.go index 8485f37371..856737beff 100644 --- a/x/rewards/types/types.go +++ b/x/rewards/types/types.go @@ -2,7 +2,6 @@ package types import ( "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" ) type Pool string @@ -38,7 +37,7 @@ const ( // next timer expiry which determine the validators block rewards. // since the time/blocks conversion can be errornous, we multiply our calculated number // of blocks by this error margin, so we'll won't have a case of having too few blocks -var BlocksToTimerExpirySlackFactor math.LegacyDec = sdk.NewDecWithPrec(105, 2) // 1.05 +var BlocksToTimerExpirySlackFactor math.LegacyDec = math.LegacyNewDecWithPrec(105, 2) // 1.05 // Refill reward pools time stores constants: // This timer store is used to trigger the refill mechanism of the distribution diff --git a/x/spec/ante/ante_test.go b/x/spec/ante/ante_test.go index bc90cce63c..d27701a23c 100644 --- a/x/spec/ante/ante_test.go +++ b/x/spec/ante/ante_test.go @@ -3,6 +3,7 @@ package ante_test import ( "testing" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -38,7 +39,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { []sdk.Msg{ &banktypes.MsgSend{}, }, - sdk.NewCoins(sdk.NewCoin("lava", sdk.NewInt(100))), + sdk.NewCoins(sdk.NewCoin("lava", math.NewInt(100))), "cosmos1qypqxpq9qcrsszgjx3ysxf7j8xq9q9qyq9q9q9", "metadata", "title", @@ -58,7 +59,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { []sdk.Msg{ &subsciptiontypes.MsgAutoRenewal{}, }, - sdk.NewCoins(sdk.NewCoin("lava", sdk.NewInt(100))), + sdk.NewCoins(sdk.NewCoin("lava", math.NewInt(100))), "cosmos1qypqxpq9qcrsszgjx3ysxf7j8xq9q9qyq9q9q9", "metadata", "title", @@ -78,7 +79,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { []sdk.Msg{ &banktypes.MsgSend{}, }, - sdk.NewCoins(sdk.NewCoin("lava", sdk.NewInt(100))), + sdk.NewCoins(sdk.NewCoin("lava", math.NewInt(100))), "cosmos1qypqxpq9qcrsszgjx3ysxf7j8xq9q9qyq9q9q9", "metadata", "title", @@ -103,7 +104,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { []sdk.Msg{ &subsciptiontypes.MsgAutoRenewal{}, }, - sdk.NewCoins(sdk.NewCoin("lava", sdk.NewInt(100))), + sdk.NewCoins(sdk.NewCoin("lava", math.NewInt(100))), "cosmos1qypqxpq9qcrsszgjx3ysxf7j8xq9q9qyq9q9q9", "metadata", "title", @@ -135,7 +136,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { []sdk.Msg{ submitProposal, }, - sdk.NewCoins(sdk.NewCoin("lava", sdk.NewInt(100))), + sdk.NewCoins(sdk.NewCoin("lava", math.NewInt(100))), "cosmos1qypqxpq9qcrsszgjx3ysxf7j8xq9q9qyq9q9q9", "metadata", "title", @@ -162,7 +163,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { []sdk.Msg{ submitProposal, }, - sdk.NewCoins(sdk.NewCoin("lava", sdk.NewInt(100))), + sdk.NewCoins(sdk.NewCoin("lava", math.NewInt(100))), "cosmos1qypqxpq9qcrsszgjx3ysxf7j8xq9q9qyq9q9q9", "metadata", "title", diff --git a/x/spec/handler.go b/x/spec/handler.go deleted file mode 100644 index 71a327bbcd..0000000000 --- a/x/spec/handler.go +++ /dev/null @@ -1,27 +0,0 @@ -package spec - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/spec/keeper" - "github.com/lavanet/lava/v4/x/spec/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - // ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/spec/keeper/grpc_query_params_test.go b/x/spec/keeper/grpc_query_params_test.go index 693334f54b..93727bccc7 100644 --- a/x/spec/keeper/grpc_query_params_test.go +++ b/x/spec/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" specutils "github.com/lavanet/lava/v4/utils/keeper" "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := specutils.SpecKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/spec/keeper/grpc_query_spec.go b/x/spec/keeper/grpc_query_spec.go index 4d72f0295a..5ca8ec6256 100644 --- a/x/spec/keeper/grpc_query_spec.go +++ b/x/spec/keeper/grpc_query_spec.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/lavanet/lava/v4/x/spec/types" diff --git a/x/spec/keeper/grpc_query_spec_test.go b/x/spec/keeper/grpc_query_spec_test.go index 7df8aadefe..3fa7863587 100644 --- a/x/spec/keeper/grpc_query_spec_test.go +++ b/x/spec/keeper/grpc_query_spec_test.go @@ -4,7 +4,6 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -20,7 +19,7 @@ var _ = strconv.IntSize func TestSpecQuerySingle(t *testing.T) { keeper, ctx := specutils.SpecKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNSpec(keeper, ctx, 2) for _, tc := range []struct { desc string @@ -71,7 +70,7 @@ func TestSpecQuerySingle(t *testing.T) { func TestSpecQuerySingleRaw(t *testing.T) { keeper, ctx := specutils.SpecKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNSpec(keeper, ctx, 2) msgs[0].ApiCollections = []*types.ApiCollection{{CollectionData: types.CollectionData{ApiInterface: "stub"}}} @@ -99,7 +98,7 @@ func TestSpecQuerySingleRaw(t *testing.T) { func TestSpecQueryPaginated(t *testing.T) { keeper, ctx := specutils.SpecKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx msgs := createNSpec(keeper, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSpecRequest { diff --git a/x/spec/keeper/keeper.go b/x/spec/keeper/keeper.go index 86efa041f9..dbbfa5de7e 100644 --- a/x/spec/keeper/keeper.go +++ b/x/spec/keeper/keeper.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/spec/keeper/migrations.go b/x/spec/keeper/migrations.go index f39fdc02f5..eee4a4b3b9 100644 --- a/x/spec/keeper/migrations.go +++ b/x/spec/keeper/migrations.go @@ -3,10 +3,7 @@ package keeper import ( "strings" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v4/x/spec/types" - typesv1 "github.com/lavanet/lava/v4/x/spec/types/migrations/v1" ) type Migrator struct { @@ -25,28 +22,3 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { } return nil } - -func (m Migrator) Migrate3to4(ctx sdk.Context) error { - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(types.SpecKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var specV1 typesv1.Spec - m.keeper.cdc.MustUnmarshal(iterator.Value(), &specV1) - - var spec types.Spec - m.keeper.cdc.MustUnmarshal(iterator.Value(), &spec) - - for acIndex, apiCollection := range specV1.ApiCollections { - for eIndex, extension := range apiCollection.Extensions { - spec.ApiCollections[acIndex].Extensions[eIndex].CuMultiplier = uint64(extension.CuMultiplier) - } - } - - m.keeper.SetSpec(ctx, spec) - } - - return nil -} diff --git a/x/spec/keeper/msg_server_test.go b/x/spec/keeper/msg_server_test.go index a75a189906..2bcabafef4 100644 --- a/x/spec/keeper/msg_server_test.go +++ b/x/spec/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" specutils "github.com/lavanet/lava/v4/utils/keeper" "github.com/lavanet/lava/v4/x/spec/keeper" "github.com/lavanet/lava/v4/x/spec/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := specutils.SpecKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/spec/keeper/spec.go b/x/spec/keeper/spec.go index fade6be0ef..9d4c827b33 100644 --- a/x/spec/keeper/spec.go +++ b/x/spec/keeper/spec.go @@ -7,7 +7,8 @@ import ( "strings" "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/utils/sigs" @@ -56,7 +57,7 @@ func (k Keeper) RemoveSpec( // GetAllSpec returns all Spec func (k Keeper) GetAllSpec(ctx sdk.Context) (list []types.Spec) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SpecKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -229,7 +230,11 @@ func (k Keeper) ValidateSpec(ctx sdk.Context, spec types.Spec) (map[string]strin return details, err } - if err := utils.ValidateCoins(ctx, k.stakingKeeper.BondDenom(ctx), spec.MinStakeProvider, false); err != nil { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + if err := utils.ValidateCoins(ctx, bondDenom, spec.MinStakeProvider, false); err != nil { details := map[string]string{ "spec": spec.Name, "status": strconv.FormatBool(spec.Enabled), diff --git a/x/spec/keeper/spec_test.go b/x/spec/keeper/spec_test.go index 1fda3f3e03..f3bdfce3bf 100644 --- a/x/spec/keeper/spec_test.go +++ b/x/spec/keeper/spec_test.go @@ -9,7 +9,6 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v4/cmd/lavad/cmd" "github.com/lavanet/lava/v4/testutil/common" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/testutil/nullify" @@ -228,7 +227,6 @@ func TestSpecRemove(t *testing.T) { func TestMain(m *testing.M) { // This code will run once before any test cases are executed. - cmd.InitSDKConfig() // Run the actual tests exitCode := m.Run() os.Exit(exitCode) diff --git a/x/spec/module.go b/x/spec/module.go index 7fbe7731ce..1556d17ac0 100644 --- a/x/spec/module.go +++ b/x/spec/module.go @@ -137,10 +137,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) - } + // if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { + // // panic:ok: at start up, migration cannot proceed anyhow + // panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) + // } } // RegisterInvariants registers the capability module's invariants. @@ -168,12 +168,20 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 4 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx) +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.BeginBlock(sdkCtx) + return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/spec/module_simulation.go b/x/spec/module_simulation.go index 63eb972e93..85c6830ad0 100644 --- a/x/spec/module_simulation.go +++ b/x/spec/module_simulation.go @@ -3,7 +3,6 @@ package spec import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -43,7 +42,7 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/spec/types/expected_keepers.go b/x/spec/types/expected_keepers.go index eba5da4250..4de969257c 100644 --- a/x/spec/types/expected_keepers.go +++ b/x/spec/types/expected_keepers.go @@ -1,22 +1,24 @@ package types import ( + context "context" + + "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) types.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } type StakingKeeper interface { - BondDenom(ctx sdk.Context) string + BondDenom(ctx context.Context) (string, error) } diff --git a/x/spec/types/migrations/v1/api_collection.pb.go b/x/spec/types/migrations/v1/api_collection.pb.go deleted file mode 100644 index 9d67dd9f16..0000000000 --- a/x/spec/types/migrations/v1/api_collection.pb.go +++ /dev/null @@ -1,4287 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/spec/api_collection.proto - -package v1 - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EXTENSION int32 - -const ( - EXTENSION_NONE EXTENSION = 0 - EXTENSION_ARCHIVE EXTENSION = 1 -) - -var EXTENSION_name = map[int32]string{ - 0: "NONE", - 1: "ARCHIVE", -} - -var EXTENSION_value = map[string]int32{ - "NONE": 0, - "ARCHIVE": 1, -} - -func (x EXTENSION) String() string { - return proto.EnumName(EXTENSION_name, int32(x)) -} - -func (EXTENSION) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{0} -} - -type FUNCTION_TAG int32 - -const ( - FUNCTION_TAG_DISABLED FUNCTION_TAG = 0 - FUNCTION_TAG_GET_BLOCKNUM FUNCTION_TAG = 1 - FUNCTION_TAG_GET_BLOCK_BY_NUM FUNCTION_TAG = 2 - FUNCTION_TAG_SET_LATEST_IN_METADATA FUNCTION_TAG = 3 - FUNCTION_TAG_SET_LATEST_IN_BODY FUNCTION_TAG = 4 - FUNCTION_TAG_VERIFICATION FUNCTION_TAG = 5 - FUNCTION_TAG_GET_EARLIEST_BLOCK FUNCTION_TAG = 6 -) - -var FUNCTION_TAG_name = map[int32]string{ - 0: "DISABLED", - 1: "GET_BLOCKNUM", - 2: "GET_BLOCK_BY_NUM", - 3: "SET_LATEST_IN_METADATA", - 4: "SET_LATEST_IN_BODY", - 5: "VERIFICATION", - 6: "GET_EARLIEST_BLOCK", -} - -var FUNCTION_TAG_value = map[string]int32{ - "DISABLED": 0, - "GET_BLOCKNUM": 1, - "GET_BLOCK_BY_NUM": 2, - "SET_LATEST_IN_METADATA": 3, - "SET_LATEST_IN_BODY": 4, - "VERIFICATION": 5, - "GET_EARLIEST_BLOCK": 6, -} - -func (x FUNCTION_TAG) String() string { - return proto.EnumName(FUNCTION_TAG_name, int32(x)) -} - -func (FUNCTION_TAG) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{1} -} - -type PARSER_FUNC int32 - -const ( - PARSER_FUNC_EMPTY PARSER_FUNC = 0 - PARSER_FUNC_PARSE_BY_ARG PARSER_FUNC = 1 - PARSER_FUNC_PARSE_CANONICAL PARSER_FUNC = 2 - PARSER_FUNC_PARSE_DICTIONARY PARSER_FUNC = 3 - PARSER_FUNC_PARSE_DICTIONARY_OR_ORDERED PARSER_FUNC = 4 - // reserved - PARSER_FUNC_DEFAULT PARSER_FUNC = 6 -) - -var PARSER_FUNC_name = map[int32]string{ - 0: "EMPTY", - 1: "PARSE_BY_ARG", - 2: "PARSE_CANONICAL", - 3: "PARSE_DICTIONARY", - 4: "PARSE_DICTIONARY_OR_ORDERED", - 6: "DEFAULT", -} - -var PARSER_FUNC_value = map[string]int32{ - "EMPTY": 0, - "PARSE_BY_ARG": 1, - "PARSE_CANONICAL": 2, - "PARSE_DICTIONARY": 3, - "PARSE_DICTIONARY_OR_ORDERED": 4, - "DEFAULT": 6, -} - -func (x PARSER_FUNC) String() string { - return proto.EnumName(PARSER_FUNC_name, int32(x)) -} - -func (PARSER_FUNC) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{2} -} - -type ParseValue_VerificationSeverity int32 - -const ( - ParseValue_Fail ParseValue_VerificationSeverity = 0 - ParseValue_Warning ParseValue_VerificationSeverity = 1 -) - -var ParseValue_VerificationSeverity_name = map[int32]string{ - 0: "Fail", - 1: "Warning", -} - -var ParseValue_VerificationSeverity_value = map[string]int32{ - "Fail": 0, - "Warning": 1, -} - -func (x ParseValue_VerificationSeverity) String() string { - return proto.EnumName(ParseValue_VerificationSeverity_name, int32(x)) -} - -func (ParseValue_VerificationSeverity) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{4, 0} -} - -type Header_HeaderType int32 - -const ( - Header_pass_send Header_HeaderType = 0 - Header_pass_reply Header_HeaderType = 1 - Header_pass_both Header_HeaderType = 2 - Header_pass_ignore Header_HeaderType = 3 -) - -var Header_HeaderType_name = map[int32]string{ - 0: "pass_send", - 1: "pass_reply", - 2: "pass_both", - 3: "pass_ignore", -} - -var Header_HeaderType_value = map[string]int32{ - "pass_send": 0, - "pass_reply": 1, - "pass_both": 2, - "pass_ignore": 3, -} - -func (x Header_HeaderType) String() string { - return proto.EnumName(Header_HeaderType_name, int32(x)) -} - -func (Header_HeaderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{6, 0} -} - -type ApiCollection struct { - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - CollectionData CollectionData `protobuf:"bytes,2,opt,name=collection_data,json=collectionData,proto3" json:"collection_data"` - Apis []*Api `protobuf:"bytes,3,rep,name=apis,proto3" json:"apis,omitempty"` - Headers []*Header `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty"` - InheritanceApis []*CollectionData `protobuf:"bytes,5,rep,name=inheritance_apis,json=inheritanceApis,proto3" json:"inheritance_apis,omitempty"` - ParseDirectives []*ParseDirective `protobuf:"bytes,6,rep,name=parse_directives,json=parseDirectives,proto3" json:"parse_directives,omitempty"` - Extensions []*Extension `protobuf:"bytes,7,rep,name=extensions,proto3" json:"extensions,omitempty"` - Verifications []*Verification `protobuf:"bytes,8,rep,name=verifications,proto3" json:"verifications,omitempty"` -} - -func (m *ApiCollection) Reset() { *m = ApiCollection{} } -func (m *ApiCollection) String() string { return proto.CompactTextString(m) } -func (*ApiCollection) ProtoMessage() {} -func (*ApiCollection) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{0} -} -func (m *ApiCollection) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ApiCollection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ApiCollection.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 *ApiCollection) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApiCollection.Merge(m, src) -} -func (m *ApiCollection) XXX_Size() int { - return m.Size() -} -func (m *ApiCollection) XXX_DiscardUnknown() { - xxx_messageInfo_ApiCollection.DiscardUnknown(m) -} - -var xxx_messageInfo_ApiCollection proto.InternalMessageInfo - -func (m *ApiCollection) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *ApiCollection) GetCollectionData() CollectionData { - if m != nil { - return m.CollectionData - } - return CollectionData{} -} - -func (m *ApiCollection) GetApis() []*Api { - if m != nil { - return m.Apis - } - return nil -} - -func (m *ApiCollection) GetHeaders() []*Header { - if m != nil { - return m.Headers - } - return nil -} - -func (m *ApiCollection) GetInheritanceApis() []*CollectionData { - if m != nil { - return m.InheritanceApis - } - return nil -} - -func (m *ApiCollection) GetParseDirectives() []*ParseDirective { - if m != nil { - return m.ParseDirectives - } - return nil -} - -func (m *ApiCollection) GetExtensions() []*Extension { - if m != nil { - return m.Extensions - } - return nil -} - -func (m *ApiCollection) GetVerifications() []*Verification { - if m != nil { - return m.Verifications - } - return nil -} - -type Extension struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - CuMultiplier float32 `protobuf:"fixed32,2,opt,name=cu_multiplier,json=cuMultiplier,proto3" json:"cu_multiplier,omitempty"` - Rule *Rule `protobuf:"bytes,3,opt,name=rule,proto3" json:"rule,omitempty"` -} - -func (m *Extension) Reset() { *m = Extension{} } -func (m *Extension) String() string { return proto.CompactTextString(m) } -func (*Extension) ProtoMessage() {} -func (*Extension) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{1} -} -func (m *Extension) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Extension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Extension.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 *Extension) XXX_Merge(src proto.Message) { - xxx_messageInfo_Extension.Merge(m, src) -} -func (m *Extension) XXX_Size() int { - return m.Size() -} -func (m *Extension) XXX_DiscardUnknown() { - xxx_messageInfo_Extension.DiscardUnknown(m) -} - -var xxx_messageInfo_Extension proto.InternalMessageInfo - -func (m *Extension) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Extension) GetCuMultiplier() float32 { - if m != nil { - return m.CuMultiplier - } - return 0 -} - -func (m *Extension) GetRule() *Rule { - if m != nil { - return m.Rule - } - return nil -} - -type Rule struct { - Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` -} - -func (m *Rule) Reset() { *m = Rule{} } -func (m *Rule) String() string { return proto.CompactTextString(m) } -func (*Rule) ProtoMessage() {} -func (*Rule) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{2} -} -func (m *Rule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Rule.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 *Rule) XXX_Merge(src proto.Message) { - xxx_messageInfo_Rule.Merge(m, src) -} -func (m *Rule) XXX_Size() int { - return m.Size() -} -func (m *Rule) XXX_DiscardUnknown() { - xxx_messageInfo_Rule.DiscardUnknown(m) -} - -var xxx_messageInfo_Rule proto.InternalMessageInfo - -func (m *Rule) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -type Verification struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ParseDirective *ParseDirective `protobuf:"bytes,2,opt,name=parse_directive,json=parseDirective,proto3" json:"parse_directive,omitempty"` - Values []*ParseValue `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` -} - -func (m *Verification) Reset() { *m = Verification{} } -func (m *Verification) String() string { return proto.CompactTextString(m) } -func (*Verification) ProtoMessage() {} -func (*Verification) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{3} -} -func (m *Verification) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Verification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Verification.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 *Verification) XXX_Merge(src proto.Message) { - xxx_messageInfo_Verification.Merge(m, src) -} -func (m *Verification) XXX_Size() int { - return m.Size() -} -func (m *Verification) XXX_DiscardUnknown() { - xxx_messageInfo_Verification.DiscardUnknown(m) -} - -var xxx_messageInfo_Verification proto.InternalMessageInfo - -func (m *Verification) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Verification) GetParseDirective() *ParseDirective { - if m != nil { - return m.ParseDirective - } - return nil -} - -func (m *Verification) GetValues() []*ParseValue { - if m != nil { - return m.Values - } - return nil -} - -type ParseValue struct { - Extension string `protobuf:"bytes,1,opt,name=extension,proto3" json:"extension,omitempty"` - ExpectedValue string `protobuf:"bytes,2,opt,name=expected_value,json=expectedValue,proto3" json:"expected_value,omitempty"` - LatestDistance uint64 `protobuf:"varint,3,opt,name=latest_distance,json=latestDistance,proto3" json:"latest_distance,omitempty"` - Severity ParseValue_VerificationSeverity `protobuf:"varint,4,opt,name=severity,proto3,enum=lavanet.lava.spec.ParseValue_VerificationSeverity" json:"severity,omitempty"` -} - -func (m *ParseValue) Reset() { *m = ParseValue{} } -func (m *ParseValue) String() string { return proto.CompactTextString(m) } -func (*ParseValue) ProtoMessage() {} -func (*ParseValue) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{4} -} -func (m *ParseValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParseValue.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 *ParseValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParseValue.Merge(m, src) -} -func (m *ParseValue) XXX_Size() int { - return m.Size() -} -func (m *ParseValue) XXX_DiscardUnknown() { - xxx_messageInfo_ParseValue.DiscardUnknown(m) -} - -var xxx_messageInfo_ParseValue proto.InternalMessageInfo - -func (m *ParseValue) GetExtension() string { - if m != nil { - return m.Extension - } - return "" -} - -func (m *ParseValue) GetExpectedValue() string { - if m != nil { - return m.ExpectedValue - } - return "" -} - -func (m *ParseValue) GetLatestDistance() uint64 { - if m != nil { - return m.LatestDistance - } - return 0 -} - -func (m *ParseValue) GetSeverity() ParseValue_VerificationSeverity { - if m != nil { - return m.Severity - } - return ParseValue_Fail -} - -type CollectionData struct { - ApiInterface string `protobuf:"bytes,1,opt,name=api_interface,json=apiInterface,proto3" json:"api_interface" mapstructure:"api_interface"` - InternalPath string `protobuf:"bytes,2,opt,name=internal_path,json=internalPath,proto3" json:"internal_path" mapstructure:"internal_path"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type" mapstructure:"type"` - AddOn string `protobuf:"bytes,4,opt,name=add_on,json=addOn,proto3" json:"add_on" mapstructure:"add_on"` -} - -func (m *CollectionData) Reset() { *m = CollectionData{} } -func (m *CollectionData) String() string { return proto.CompactTextString(m) } -func (*CollectionData) ProtoMessage() {} -func (*CollectionData) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{5} -} -func (m *CollectionData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CollectionData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CollectionData.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 *CollectionData) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionData.Merge(m, src) -} -func (m *CollectionData) XXX_Size() int { - return m.Size() -} -func (m *CollectionData) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionData.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionData proto.InternalMessageInfo - -func (m *CollectionData) GetApiInterface() string { - if m != nil { - return m.ApiInterface - } - return "" -} - -func (m *CollectionData) GetInternalPath() string { - if m != nil { - return m.InternalPath - } - return "" -} - -func (m *CollectionData) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *CollectionData) GetAddOn() string { - if m != nil { - return m.AddOn - } - return "" -} - -type Header struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Kind Header_HeaderType `protobuf:"varint,2,opt,name=kind,proto3,enum=lavanet.lava.spec.Header_HeaderType" json:"kind,omitempty"` - FunctionTag FUNCTION_TAG `protobuf:"varint,3,opt,name=function_tag,json=functionTag,proto3,enum=lavanet.lava.spec.FUNCTION_TAG" json:"function_tag,omitempty"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{6} -} -func (m *Header) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Header.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 *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return m.Size() -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo - -func (m *Header) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Header) GetKind() Header_HeaderType { - if m != nil { - return m.Kind - } - return Header_pass_send -} - -func (m *Header) GetFunctionTag() FUNCTION_TAG { - if m != nil { - return m.FunctionTag - } - return FUNCTION_TAG_DISABLED -} - -type Api struct { - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - ComputeUnits uint64 `protobuf:"varint,3,opt,name=compute_units,json=computeUnits,proto3" json:"compute_units,omitempty"` - ExtraComputeUnits uint64 `protobuf:"varint,4,opt,name=extra_compute_units,json=extraComputeUnits,proto3" json:"extra_compute_units,omitempty"` - Category SpecCategory `protobuf:"bytes,6,opt,name=category,proto3" json:"category"` - BlockParsing BlockParser `protobuf:"bytes,7,opt,name=block_parsing,json=blockParsing,proto3" json:"block_parsing"` - TimeoutMs uint64 `protobuf:"varint,8,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"` -} - -func (m *Api) Reset() { *m = Api{} } -func (m *Api) String() string { return proto.CompactTextString(m) } -func (*Api) ProtoMessage() {} -func (*Api) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{7} -} -func (m *Api) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Api.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 *Api) XXX_Merge(src proto.Message) { - xxx_messageInfo_Api.Merge(m, src) -} -func (m *Api) XXX_Size() int { - return m.Size() -} -func (m *Api) XXX_DiscardUnknown() { - xxx_messageInfo_Api.DiscardUnknown(m) -} - -var xxx_messageInfo_Api proto.InternalMessageInfo - -func (m *Api) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Api) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Api) GetComputeUnits() uint64 { - if m != nil { - return m.ComputeUnits - } - return 0 -} - -func (m *Api) GetExtraComputeUnits() uint64 { - if m != nil { - return m.ExtraComputeUnits - } - return 0 -} - -func (m *Api) GetCategory() SpecCategory { - if m != nil { - return m.Category - } - return SpecCategory{} -} - -func (m *Api) GetBlockParsing() BlockParser { - if m != nil { - return m.BlockParsing - } - return BlockParser{} -} - -func (m *Api) GetTimeoutMs() uint64 { - if m != nil { - return m.TimeoutMs - } - return 0 -} - -type ParseDirective struct { - FunctionTag FUNCTION_TAG `protobuf:"varint,1,opt,name=function_tag,json=functionTag,proto3,enum=lavanet.lava.spec.FUNCTION_TAG" json:"function_tag,omitempty"` - FunctionTemplate string `protobuf:"bytes,2,opt,name=function_template,json=functionTemplate,proto3" json:"function_template,omitempty"` - ResultParsing BlockParser `protobuf:"bytes,3,opt,name=result_parsing,json=resultParsing,proto3" json:"result_parsing"` - ApiName string `protobuf:"bytes,4,opt,name=api_name,json=apiName,proto3" json:"api_name,omitempty"` -} - -func (m *ParseDirective) Reset() { *m = ParseDirective{} } -func (m *ParseDirective) String() string { return proto.CompactTextString(m) } -func (*ParseDirective) ProtoMessage() {} -func (*ParseDirective) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{8} -} -func (m *ParseDirective) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParseDirective) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParseDirective.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 *ParseDirective) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParseDirective.Merge(m, src) -} -func (m *ParseDirective) XXX_Size() int { - return m.Size() -} -func (m *ParseDirective) XXX_DiscardUnknown() { - xxx_messageInfo_ParseDirective.DiscardUnknown(m) -} - -var xxx_messageInfo_ParseDirective proto.InternalMessageInfo - -func (m *ParseDirective) GetFunctionTag() FUNCTION_TAG { - if m != nil { - return m.FunctionTag - } - return FUNCTION_TAG_DISABLED -} - -func (m *ParseDirective) GetFunctionTemplate() string { - if m != nil { - return m.FunctionTemplate - } - return "" -} - -func (m *ParseDirective) GetResultParsing() BlockParser { - if m != nil { - return m.ResultParsing - } - return BlockParser{} -} - -func (m *ParseDirective) GetApiName() string { - if m != nil { - return m.ApiName - } - return "" -} - -type BlockParser struct { - ParserArg []string `protobuf:"bytes,1,rep,name=parser_arg,json=parserArg,proto3" json:"parser_arg,omitempty"` - ParserFunc PARSER_FUNC `protobuf:"varint,2,opt,name=parser_func,json=parserFunc,proto3,enum=lavanet.lava.spec.PARSER_FUNC" json:"parser_func,omitempty"` - DefaultValue string `protobuf:"bytes,3,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Encoding string `protobuf:"bytes,4,opt,name=encoding,proto3" json:"encoding,omitempty"` -} - -func (m *BlockParser) Reset() { *m = BlockParser{} } -func (m *BlockParser) String() string { return proto.CompactTextString(m) } -func (*BlockParser) ProtoMessage() {} -func (*BlockParser) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{9} -} -func (m *BlockParser) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockParser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockParser.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 *BlockParser) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockParser.Merge(m, src) -} -func (m *BlockParser) XXX_Size() int { - return m.Size() -} -func (m *BlockParser) XXX_DiscardUnknown() { - xxx_messageInfo_BlockParser.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockParser proto.InternalMessageInfo - -func (m *BlockParser) GetParserArg() []string { - if m != nil { - return m.ParserArg - } - return nil -} - -func (m *BlockParser) GetParserFunc() PARSER_FUNC { - if m != nil { - return m.ParserFunc - } - return PARSER_FUNC_EMPTY -} - -func (m *BlockParser) GetDefaultValue() string { - if m != nil { - return m.DefaultValue - } - return "" -} - -func (m *BlockParser) GetEncoding() string { - if m != nil { - return m.Encoding - } - return "" -} - -type SpecCategory struct { - Deterministic bool `protobuf:"varint,1,opt,name=deterministic,proto3" json:"deterministic,omitempty"` - Local bool `protobuf:"varint,2,opt,name=local,proto3" json:"local,omitempty"` - Subscription bool `protobuf:"varint,3,opt,name=subscription,proto3" json:"subscription,omitempty"` - Stateful uint32 `protobuf:"varint,4,opt,name=stateful,proto3" json:"stateful,omitempty"` - HangingApi bool `protobuf:"varint,5,opt,name=hanging_api,json=hangingApi,proto3" json:"hanging_api,omitempty"` -} - -func (m *SpecCategory) Reset() { *m = SpecCategory{} } -func (m *SpecCategory) String() string { return proto.CompactTextString(m) } -func (*SpecCategory) ProtoMessage() {} -func (*SpecCategory) Descriptor() ([]byte, []int) { - return fileDescriptor_c9f7567a181f534f, []int{10} -} -func (m *SpecCategory) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SpecCategory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SpecCategory.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 *SpecCategory) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpecCategory.Merge(m, src) -} -func (m *SpecCategory) XXX_Size() int { - return m.Size() -} -func (m *SpecCategory) XXX_DiscardUnknown() { - xxx_messageInfo_SpecCategory.DiscardUnknown(m) -} - -var xxx_messageInfo_SpecCategory proto.InternalMessageInfo - -func (m *SpecCategory) GetDeterministic() bool { - if m != nil { - return m.Deterministic - } - return false -} - -func (m *SpecCategory) GetLocal() bool { - if m != nil { - return m.Local - } - return false -} - -func (m *SpecCategory) GetSubscription() bool { - if m != nil { - return m.Subscription - } - return false -} - -func (m *SpecCategory) GetStateful() uint32 { - if m != nil { - return m.Stateful - } - return 0 -} - -func (m *SpecCategory) GetHangingApi() bool { - if m != nil { - return m.HangingApi - } - return false -} - -func init() { -} - -func init() { - -} - -var fileDescriptor_c9f7567a181f534f = []byte{ - // 1417 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x6f, 0xdb, 0xc6, - 0x12, 0x37, 0x25, 0x5a, 0x96, 0x46, 0x7f, 0xcc, 0x6c, 0xfc, 0xf2, 0x94, 0x3c, 0x47, 0xf2, 0x63, - 0xf2, 0x5e, 0x0d, 0x07, 0xb5, 0x51, 0x07, 0x05, 0x8a, 0xa0, 0x40, 0x41, 0x49, 0x74, 0xa2, 0x44, - 0x96, 0x8c, 0xb5, 0xec, 0xd6, 0xbd, 0x10, 0x6b, 0x6a, 0x2d, 0x2f, 0x42, 0x91, 0x2c, 0xb9, 0x34, - 0xec, 0x73, 0xbf, 0x40, 0x3f, 0x43, 0x4f, 0x05, 0x0a, 0x14, 0xe8, 0xa1, 0xdf, 0x21, 0xc7, 0x1c, - 0x7b, 0x12, 0x0a, 0xe7, 0x50, 0x34, 0xc7, 0xdc, 0x7a, 0x28, 0x50, 0xec, 0x92, 0x92, 0x45, 0x47, - 0x49, 0x91, 0x93, 0x34, 0xbf, 0xf9, 0xed, 0x6f, 0x67, 0x67, 0x66, 0x67, 0x09, 0xff, 0x77, 0xc8, - 0x19, 0x71, 0x29, 0xdf, 0x12, 0xbf, 0x5b, 0xa1, 0x4f, 0xed, 0x2d, 0xe2, 0x33, 0xcb, 0xf6, 0x1c, - 0x87, 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x00, 0x00, 0xff, - 0xff, 0xb6, 0xa4, 0x86, 0xcc, 0xc8, 0x0b, 0x00, 0x00, -} - -func (this *ApiCollection) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ApiCollection) - if !ok { - that2, ok := that.(ApiCollection) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if !this.CollectionData.Equal(&that1.CollectionData) { - return false - } - if len(this.Apis) != len(that1.Apis) { - return false - } - for i := range this.Apis { - if !this.Apis[i].Equal(that1.Apis[i]) { - return false - } - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - if len(this.InheritanceApis) != len(that1.InheritanceApis) { - return false - } - for i := range this.InheritanceApis { - if !this.InheritanceApis[i].Equal(that1.InheritanceApis[i]) { - return false - } - } - if len(this.ParseDirectives) != len(that1.ParseDirectives) { - return false - } - for i := range this.ParseDirectives { - if !this.ParseDirectives[i].Equal(that1.ParseDirectives[i]) { - return false - } - } - if len(this.Extensions) != len(that1.Extensions) { - return false - } - for i := range this.Extensions { - if !this.Extensions[i].Equal(that1.Extensions[i]) { - return false - } - } - if len(this.Verifications) != len(that1.Verifications) { - return false - } - for i := range this.Verifications { - if !this.Verifications[i].Equal(that1.Verifications[i]) { - return false - } - } - return true -} -func (this *Extension) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Extension) - if !ok { - that2, ok := that.(Extension) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.CuMultiplier != that1.CuMultiplier { - return false - } - if !this.Rule.Equal(that1.Rule) { - return false - } - return true -} -func (this *Rule) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Rule) - if !ok { - that2, ok := that.(Rule) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Block != that1.Block { - return false - } - return true -} -func (this *Verification) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Verification) - if !ok { - that2, ok := that.(Verification) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if !this.ParseDirective.Equal(that1.ParseDirective) { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if !this.Values[i].Equal(that1.Values[i]) { - return false - } - } - return true -} -func (this *ParseValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ParseValue) - if !ok { - that2, ok := that.(ParseValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Extension != that1.Extension { - return false - } - if this.ExpectedValue != that1.ExpectedValue { - return false - } - if this.LatestDistance != that1.LatestDistance { - return false - } - if this.Severity != that1.Severity { - return false - } - return true -} -func (this *CollectionData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CollectionData) - if !ok { - that2, ok := that.(CollectionData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ApiInterface != that1.ApiInterface { - return false - } - if this.InternalPath != that1.InternalPath { - return false - } - if this.Type != that1.Type { - return false - } - if this.AddOn != that1.AddOn { - return false - } - return true -} -func (this *Header) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Header) - if !ok { - that2, ok := that.(Header) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Kind != that1.Kind { - return false - } - if this.FunctionTag != that1.FunctionTag { - return false - } - return true -} -func (this *Api) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Api) - if !ok { - that2, ok := that.(Api) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if this.Name != that1.Name { - return false - } - if this.ComputeUnits != that1.ComputeUnits { - return false - } - if this.ExtraComputeUnits != that1.ExtraComputeUnits { - return false - } - if !this.Category.Equal(&that1.Category) { - return false - } - if !this.BlockParsing.Equal(&that1.BlockParsing) { - return false - } - if this.TimeoutMs != that1.TimeoutMs { - return false - } - return true -} -func (this *ParseDirective) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ParseDirective) - if !ok { - that2, ok := that.(ParseDirective) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.FunctionTag != that1.FunctionTag { - return false - } - if this.FunctionTemplate != that1.FunctionTemplate { - return false - } - if !this.ResultParsing.Equal(&that1.ResultParsing) { - return false - } - if this.ApiName != that1.ApiName { - return false - } - return true -} -func (this *BlockParser) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*BlockParser) - if !ok { - that2, ok := that.(BlockParser) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ParserArg) != len(that1.ParserArg) { - return false - } - for i := range this.ParserArg { - if this.ParserArg[i] != that1.ParserArg[i] { - return false - } - } - if this.ParserFunc != that1.ParserFunc { - return false - } - if this.DefaultValue != that1.DefaultValue { - return false - } - if this.Encoding != that1.Encoding { - return false - } - return true -} -func (this *SpecCategory) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SpecCategory) - if !ok { - that2, ok := that.(SpecCategory) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Deterministic != that1.Deterministic { - return false - } - if this.Local != that1.Local { - return false - } - if this.Subscription != that1.Subscription { - return false - } - if this.Stateful != that1.Stateful { - return false - } - if this.HangingApi != that1.HangingApi { - return false - } - return true -} -func (m *ApiCollection) 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 *ApiCollection) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ApiCollection) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Verifications) > 0 { - for iNdEx := len(m.Verifications) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Verifications[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Extensions) > 0 { - for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Extensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.ParseDirectives) > 0 { - for iNdEx := len(m.ParseDirectives) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ParseDirectives[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.InheritanceApis) > 0 { - for iNdEx := len(m.InheritanceApis) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InheritanceApis[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Apis) > 0 { - for iNdEx := len(m.Apis) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Apis[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.CollectionData.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Extension) 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 *Extension) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Rule != nil { - { - size, err := m.Rule.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CuMultiplier != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CuMultiplier)))) - i-- - dAtA[i] = 0x15 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Rule) 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 *Rule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Rule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Block != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Verification) 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 *Verification) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Values[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ParseDirective != nil { - { - size, err := m.ParseDirective.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ParseValue) 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 *ParseValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParseValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Severity != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.Severity)) - i-- - dAtA[i] = 0x20 - } - if m.LatestDistance != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.LatestDistance)) - i-- - dAtA[i] = 0x18 - } - if len(m.ExpectedValue) > 0 { - i -= len(m.ExpectedValue) - copy(dAtA[i:], m.ExpectedValue) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.ExpectedValue))) - i-- - dAtA[i] = 0x12 - } - if len(m.Extension) > 0 { - i -= len(m.Extension) - copy(dAtA[i:], m.Extension) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Extension))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CollectionData) 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 *CollectionData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CollectionData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AddOn) > 0 { - i -= len(m.AddOn) - copy(dAtA[i:], m.AddOn) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.AddOn))) - i-- - dAtA[i] = 0x22 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x1a - } - if len(m.InternalPath) > 0 { - i -= len(m.InternalPath) - copy(dAtA[i:], m.InternalPath) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.InternalPath))) - i-- - dAtA[i] = 0x12 - } - if len(m.ApiInterface) > 0 { - i -= len(m.ApiInterface) - copy(dAtA[i:], m.ApiInterface) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.ApiInterface))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Header) 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 *Header) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.FunctionTag != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.FunctionTag)) - i-- - dAtA[i] = 0x18 - } - if m.Kind != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.Kind)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Api) 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 *Api) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Api) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TimeoutMs != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.TimeoutMs)) - i-- - dAtA[i] = 0x40 - } - { - size, err := m.BlockParsing.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.Category.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if m.ExtraComputeUnits != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.ExtraComputeUnits)) - i-- - dAtA[i] = 0x20 - } - if m.ComputeUnits != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.ComputeUnits)) - i-- - dAtA[i] = 0x18 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ParseDirective) 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 *ParseDirective) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParseDirective) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ApiName) > 0 { - i -= len(m.ApiName) - copy(dAtA[i:], m.ApiName) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.ApiName))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.ResultParsing.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApiCollection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.FunctionTemplate) > 0 { - i -= len(m.FunctionTemplate) - copy(dAtA[i:], m.FunctionTemplate) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.FunctionTemplate))) - i-- - dAtA[i] = 0x12 - } - if m.FunctionTag != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.FunctionTag)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BlockParser) 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 *BlockParser) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockParser) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Encoding) > 0 { - i -= len(m.Encoding) - copy(dAtA[i:], m.Encoding) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Encoding))) - i-- - dAtA[i] = 0x22 - } - if len(m.DefaultValue) > 0 { - i -= len(m.DefaultValue) - copy(dAtA[i:], m.DefaultValue) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.DefaultValue))) - i-- - dAtA[i] = 0x1a - } - if m.ParserFunc != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.ParserFunc)) - i-- - dAtA[i] = 0x10 - } - if len(m.ParserArg) > 0 { - for iNdEx := len(m.ParserArg) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ParserArg[iNdEx]) - copy(dAtA[i:], m.ParserArg[iNdEx]) - i = encodeVarintApiCollection(dAtA, i, uint64(len(m.ParserArg[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SpecCategory) 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 *SpecCategory) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SpecCategory) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HangingApi { - i-- - if m.HangingApi { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.Stateful != 0 { - i = encodeVarintApiCollection(dAtA, i, uint64(m.Stateful)) - i-- - dAtA[i] = 0x20 - } - if m.Subscription { - i-- - if m.Subscription { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.Local { - i-- - if m.Local { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Deterministic { - i-- - if m.Deterministic { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintApiCollection(dAtA []byte, offset int, v uint64) int { - offset -= sovApiCollection(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ApiCollection) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Enabled { - n += 2 - } - l = m.CollectionData.Size() - n += 1 + l + sovApiCollection(uint64(l)) - if len(m.Apis) > 0 { - for _, e := range m.Apis { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - if len(m.InheritanceApis) > 0 { - for _, e := range m.InheritanceApis { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - if len(m.ParseDirectives) > 0 { - for _, e := range m.ParseDirectives { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - if len(m.Extensions) > 0 { - for _, e := range m.Extensions { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - if len(m.Verifications) > 0 { - for _, e := range m.Verifications { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - return n -} - -func (m *Extension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - if m.CuMultiplier != 0 { - n += 5 - } - if m.Rule != nil { - l = m.Rule.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - return n -} - -func (m *Rule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != 0 { - n += 1 + sovApiCollection(uint64(m.Block)) - } - return n -} - -func (m *Verification) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - if m.ParseDirective != nil { - l = m.ParseDirective.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - if len(m.Values) > 0 { - for _, e := range m.Values { - l = e.Size() - n += 1 + l + sovApiCollection(uint64(l)) - } - } - return n -} - -func (m *ParseValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Extension) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - l = len(m.ExpectedValue) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - if m.LatestDistance != 0 { - n += 1 + sovApiCollection(uint64(m.LatestDistance)) - } - if m.Severity != 0 { - n += 1 + sovApiCollection(uint64(m.Severity)) - } - return n -} - -func (m *CollectionData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ApiInterface) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - l = len(m.InternalPath) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - l = len(m.AddOn) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - return n -} - -func (m *Header) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - if m.Kind != 0 { - n += 1 + sovApiCollection(uint64(m.Kind)) - } - if m.FunctionTag != 0 { - n += 1 + sovApiCollection(uint64(m.FunctionTag)) - } - return n -} - -func (m *Api) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Enabled { - n += 2 - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - if m.ComputeUnits != 0 { - n += 1 + sovApiCollection(uint64(m.ComputeUnits)) - } - if m.ExtraComputeUnits != 0 { - n += 1 + sovApiCollection(uint64(m.ExtraComputeUnits)) - } - l = m.Category.Size() - n += 1 + l + sovApiCollection(uint64(l)) - l = m.BlockParsing.Size() - n += 1 + l + sovApiCollection(uint64(l)) - if m.TimeoutMs != 0 { - n += 1 + sovApiCollection(uint64(m.TimeoutMs)) - } - return n -} - -func (m *ParseDirective) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.FunctionTag != 0 { - n += 1 + sovApiCollection(uint64(m.FunctionTag)) - } - l = len(m.FunctionTemplate) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - l = m.ResultParsing.Size() - n += 1 + l + sovApiCollection(uint64(l)) - l = len(m.ApiName) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - return n -} - -func (m *BlockParser) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ParserArg) > 0 { - for _, s := range m.ParserArg { - l = len(s) - n += 1 + l + sovApiCollection(uint64(l)) - } - } - if m.ParserFunc != 0 { - n += 1 + sovApiCollection(uint64(m.ParserFunc)) - } - l = len(m.DefaultValue) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - l = len(m.Encoding) - if l > 0 { - n += 1 + l + sovApiCollection(uint64(l)) - } - return n -} - -func (m *SpecCategory) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Deterministic { - n += 2 - } - if m.Local { - n += 2 - } - if m.Subscription { - n += 2 - } - if m.Stateful != 0 { - n += 1 + sovApiCollection(uint64(m.Stateful)) - } - if m.HangingApi { - n += 2 - } - return n -} - -func sovApiCollection(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozApiCollection(x uint64) (n int) { - return sovApiCollection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ApiCollection) 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 ErrIntOverflowApiCollection - } - 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: ApiCollection: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ApiCollection: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollectionData", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CollectionData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apis", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apis = append(m.Apis, &Api{}) - if err := m.Apis[len(m.Apis)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, &Header{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InheritanceApis", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InheritanceApis = append(m.InheritanceApis, &CollectionData{}) - if err := m.InheritanceApis[len(m.InheritanceApis)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParseDirectives", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParseDirectives = append(m.ParseDirectives, &ParseDirective{}) - if err := m.ParseDirectives[len(m.ParseDirectives)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extensions = append(m.Extensions, &Extension{}) - if err := m.Extensions[len(m.Extensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Verifications", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Verifications = append(m.Verifications, &Verification{}) - if err := m.Verifications[len(m.Verifications)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Extension) 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 ErrIntOverflowApiCollection - } - 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: Extension: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Extension: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field CuMultiplier", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.CuMultiplier = float32(math.Float32frombits(v)) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Rule == nil { - m.Rule = &Rule{} - } - if err := m.Rule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Rule) 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 ErrIntOverflowApiCollection - } - 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: Rule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Rule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Verification) 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 ErrIntOverflowApiCollection - } - 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: Verification: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Verification: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParseDirective", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParseDirective == nil { - m.ParseDirective = &ParseDirective{} - } - if err := m.ParseDirective.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, &ParseValue{}) - if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParseValue) 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 ErrIntOverflowApiCollection - } - 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: ParseValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParseValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extension = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExpectedValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestDistance", wireType) - } - m.LatestDistance = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LatestDistance |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Severity", wireType) - } - m.Severity = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Severity |= ParseValue_VerificationSeverity(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CollectionData) 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 ErrIntOverflowApiCollection - } - 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: CollectionData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CollectionData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApiInterface", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApiInterface = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InternalPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InternalPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddOn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AddOn = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Header) 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 ErrIntOverflowApiCollection - } - 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: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - m.Kind = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Kind |= Header_HeaderType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FunctionTag", wireType) - } - m.FunctionTag = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FunctionTag |= FUNCTION_TAG(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Api) 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 ErrIntOverflowApiCollection - } - 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: Api: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Api: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnits", wireType) - } - m.ComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtraComputeUnits", wireType) - } - m.ExtraComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExtraComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Category.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockParsing", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockParsing.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutMs", wireType) - } - m.TimeoutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutMs |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParseDirective) 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 ErrIntOverflowApiCollection - } - 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: ParseDirective: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParseDirective: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FunctionTag", wireType) - } - m.FunctionTag = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FunctionTag |= FUNCTION_TAG(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FunctionTemplate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FunctionTemplate = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultParsing", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ResultParsing.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApiName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApiName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockParser) 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 ErrIntOverflowApiCollection - } - 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: BlockParser: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockParser: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParserArg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParserArg = append(m.ParserArg, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ParserFunc", wireType) - } - m.ParserFunc = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ParserFunc |= PARSER_FUNC(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApiCollection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApiCollection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Encoding = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SpecCategory) 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 ErrIntOverflowApiCollection - } - 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: SpecCategory: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpecCategory: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Deterministic", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Deterministic = bool(v != 0) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Local", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Local = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Subscription = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Stateful", wireType) - } - m.Stateful = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Stateful |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HangingApi", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiCollection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.HangingApi = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipApiCollection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApiCollection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipApiCollection(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApiCollection - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApiCollection - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApiCollection - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthApiCollection - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupApiCollection - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthApiCollection - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthApiCollection = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowApiCollection = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupApiCollection = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/spec/types/migrations/v1/spec.pb.go b/x/spec/types/migrations/v1/spec.pb.go deleted file mode 100644 index 84ba1b5396..0000000000 --- a/x/spec/types/migrations/v1/spec.pb.go +++ /dev/null @@ -1,1165 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/spec/spec.proto - -package v1 - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Spec_ProvidersTypes int32 - -const ( - Spec_dynamic Spec_ProvidersTypes = 0 - Spec_static Spec_ProvidersTypes = 1 -) - -var Spec_ProvidersTypes_name = map[int32]string{ - 0: "dynamic", - 1: "static", -} - -var Spec_ProvidersTypes_value = map[string]int32{ - "dynamic": 0, - "static": 1, -} - -func (x Spec_ProvidersTypes) String() string { - return proto.EnumName(Spec_ProvidersTypes_name, int32(x)) -} - -func (Spec_ProvidersTypes) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_789140b95c48dfce, []int{0, 0} -} - -type Spec struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - ReliabilityThreshold uint32 `protobuf:"varint,5,opt,name=reliability_threshold,json=reliabilityThreshold,proto3" json:"reliability_threshold,omitempty"` - DataReliabilityEnabled bool `protobuf:"varint,6,opt,name=data_reliability_enabled,json=dataReliabilityEnabled,proto3" json:"data_reliability_enabled,omitempty"` - BlockDistanceForFinalizedData uint32 `protobuf:"varint,7,opt,name=block_distance_for_finalized_data,json=blockDistanceForFinalizedData,proto3" json:"block_distance_for_finalized_data,omitempty"` - BlocksInFinalizationProof uint32 `protobuf:"varint,8,opt,name=blocks_in_finalization_proof,json=blocksInFinalizationProof,proto3" json:"blocks_in_finalization_proof,omitempty"` - AverageBlockTime int64 `protobuf:"varint,9,opt,name=average_block_time,json=averageBlockTime,proto3" json:"average_block_time,omitempty"` - AllowedBlockLagForQosSync int64 `protobuf:"varint,10,opt,name=allowed_block_lag_for_qos_sync,json=allowedBlockLagForQosSync,proto3" json:"allowed_block_lag_for_qos_sync,omitempty"` - BlockLastUpdated uint64 `protobuf:"varint,11,opt,name=block_last_updated,json=blockLastUpdated,proto3" json:"block_last_updated,omitempty"` - MinStakeProvider types.Coin `protobuf:"bytes,12,opt,name=min_stake_provider,json=minStakeProvider,proto3" json:"min_stake_provider"` - ProvidersTypes Spec_ProvidersTypes `protobuf:"varint,14,opt,name=providers_types,json=providersTypes,proto3,enum=lavanet.lava.spec.Spec_ProvidersTypes" json:"providers_types,omitempty"` - Imports []string `protobuf:"bytes,15,rep,name=imports,proto3" json:"imports,omitempty"` - ApiCollections []*ApiCollection `protobuf:"bytes,16,rep,name=api_collections,json=apiCollections,proto3" json:"api_collections,omitempty"` - Contributor []string `protobuf:"bytes,17,rep,name=contributor,proto3" json:"contributor,omitempty"` - ContributorPercentage *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=contributor_percentage,json=contributorPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"contributor_percentage,omitempty"` - Shares uint64 `protobuf:"varint,19,opt,name=shares,proto3" json:"shares,omitempty"` -} - -func (m *Spec) Reset() { *m = Spec{} } -func (m *Spec) String() string { return proto.CompactTextString(m) } -func (*Spec) ProtoMessage() {} -func (*Spec) Descriptor() ([]byte, []int) { - return fileDescriptor_789140b95c48dfce, []int{0} -} -func (m *Spec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Spec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Spec.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 *Spec) XXX_Merge(src proto.Message) { - xxx_messageInfo_Spec.Merge(m, src) -} -func (m *Spec) XXX_Size() int { - return m.Size() -} -func (m *Spec) XXX_DiscardUnknown() { - xxx_messageInfo_Spec.DiscardUnknown(m) -} - -var xxx_messageInfo_Spec proto.InternalMessageInfo - -func (m *Spec) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Spec) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Spec) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Spec) GetReliabilityThreshold() uint32 { - if m != nil { - return m.ReliabilityThreshold - } - return 0 -} - -func (m *Spec) GetDataReliabilityEnabled() bool { - if m != nil { - return m.DataReliabilityEnabled - } - return false -} - -func (m *Spec) GetBlockDistanceForFinalizedData() uint32 { - if m != nil { - return m.BlockDistanceForFinalizedData - } - return 0 -} - -func (m *Spec) GetBlocksInFinalizationProof() uint32 { - if m != nil { - return m.BlocksInFinalizationProof - } - return 0 -} - -func (m *Spec) GetAverageBlockTime() int64 { - if m != nil { - return m.AverageBlockTime - } - return 0 -} - -func (m *Spec) GetAllowedBlockLagForQosSync() int64 { - if m != nil { - return m.AllowedBlockLagForQosSync - } - return 0 -} - -func (m *Spec) GetBlockLastUpdated() uint64 { - if m != nil { - return m.BlockLastUpdated - } - return 0 -} - -func (m *Spec) GetMinStakeProvider() types.Coin { - if m != nil { - return m.MinStakeProvider - } - return types.Coin{} -} - -func (m *Spec) GetProvidersTypes() Spec_ProvidersTypes { - if m != nil { - return m.ProvidersTypes - } - return Spec_dynamic -} - -func (m *Spec) GetImports() []string { - if m != nil { - return m.Imports - } - return nil -} - -func (m *Spec) GetApiCollections() []*ApiCollection { - if m != nil { - return m.ApiCollections - } - return nil -} - -func (m *Spec) GetContributor() []string { - if m != nil { - return m.Contributor - } - return nil -} - -func (m *Spec) GetShares() uint64 { - if m != nil { - return m.Shares - } - return 0 -} - -func init() { -} - -func init() { } - -var fileDescriptor_789140b95c48dfce = []byte{ - // 702 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcf, 0x4e, 0xfb, 0x36, - 0x1c, 0x6f, 0xd6, 0xfc, 0xda, 0xe2, 0xee, 0x57, 0x82, 0x07, 0xc8, 0x20, 0x16, 0x32, 0x34, 0xa1, - 0x6c, 0xda, 0x12, 0x01, 0x97, 0xdd, 0x26, 0x0a, 0xab, 0x06, 0xda, 0x34, 0x16, 0xd8, 0x65, 0x97, - 0xc8, 0x71, 0x4c, 0x6b, 0x91, 0xd8, 0x59, 0x6c, 0x3a, 0xba, 0xa7, 0xd8, 0x63, 0xec, 0x21, 0xf6, - 0x00, 0x1c, 0x39, 0x4e, 0x3b, 0xa0, 0xa9, 0xbc, 0xc8, 0x64, 0x27, 0x61, 0xa9, 0xd8, 0xa5, 0xf6, - 0xd7, 0x9f, 0x3f, 0xdf, 0x6f, 0xdd, 0x4f, 0x0d, 0xf6, 0x32, 0x3c, 0xc7, 0x9c, 0xaa, 0x50, 0xaf, - 0xa1, 0x2c, 0x28, 0x31, 0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, 0xae, 0xf5, 0xb8, 0x74, 0xad, 0xa7, 0xa5, 0x6b, 0xfd, - 0xb3, 0x74, 0xad, 0xdf, 0x5f, 0xdc, 0xce, 0xd3, 0x8b, 0xdb, 0xf9, 0xeb, 0xc5, 0xed, 0xfc, 0xfc, - 0x69, 0x6b, 0xd6, 0x95, 0xf7, 0xe2, 0xa1, 0x7a, 0x31, 0xcc, 0xb4, 0x49, 0xcf, 0xbc, 0x04, 0x27, - 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x67, 0xe7, 0xdf, 0x36, 0x9a, 0x04, 0x00, 0x00, -} - -func (this *Spec) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Spec) - if !ok { - that2, ok := that.(Spec) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Name != that1.Name { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if this.ReliabilityThreshold != that1.ReliabilityThreshold { - return false - } - if this.DataReliabilityEnabled != that1.DataReliabilityEnabled { - return false - } - if this.BlockDistanceForFinalizedData != that1.BlockDistanceForFinalizedData { - return false - } - if this.BlocksInFinalizationProof != that1.BlocksInFinalizationProof { - return false - } - if this.AverageBlockTime != that1.AverageBlockTime { - return false - } - if this.AllowedBlockLagForQosSync != that1.AllowedBlockLagForQosSync { - return false - } - if this.BlockLastUpdated != that1.BlockLastUpdated { - return false - } - if !this.MinStakeProvider.Equal(&that1.MinStakeProvider) { - return false - } - if this.ProvidersTypes != that1.ProvidersTypes { - return false - } - if len(this.Imports) != len(that1.Imports) { - return false - } - for i := range this.Imports { - if this.Imports[i] != that1.Imports[i] { - return false - } - } - if len(this.ApiCollections) != len(that1.ApiCollections) { - return false - } - for i := range this.ApiCollections { - if !this.ApiCollections[i].Equal(that1.ApiCollections[i]) { - return false - } - } - if len(this.Contributor) != len(that1.Contributor) { - return false - } - for i := range this.Contributor { - if this.Contributor[i] != that1.Contributor[i] { - return false - } - } - if that1.ContributorPercentage == nil { - if this.ContributorPercentage != nil { - return false - } - } else if !this.ContributorPercentage.Equal(*that1.ContributorPercentage) { - return false - } - if this.Shares != that1.Shares { - return false - } - return true -} -func (m *Spec) 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 *Spec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Spec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Shares != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.Shares)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 - } - if m.ContributorPercentage != nil { - { - size := m.ContributorPercentage.Size() - i -= size - if _, err := m.ContributorPercentage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - if len(m.Contributor) > 0 { - for iNdEx := len(m.Contributor) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Contributor[iNdEx]) - copy(dAtA[i:], m.Contributor[iNdEx]) - i = encodeVarintSpec(dAtA, i, uint64(len(m.Contributor[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - } - if len(m.ApiCollections) > 0 { - for iNdEx := len(m.ApiCollections) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ApiCollections[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - } - if len(m.Imports) > 0 { - for iNdEx := len(m.Imports) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Imports[iNdEx]) - copy(dAtA[i:], m.Imports[iNdEx]) - i = encodeVarintSpec(dAtA, i, uint64(len(m.Imports[iNdEx]))) - i-- - dAtA[i] = 0x7a - } - } - if m.ProvidersTypes != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.ProvidersTypes)) - i-- - dAtA[i] = 0x70 - } - { - size, err := m.MinStakeProvider.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - if m.BlockLastUpdated != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.BlockLastUpdated)) - i-- - dAtA[i] = 0x58 - } - if m.AllowedBlockLagForQosSync != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.AllowedBlockLagForQosSync)) - i-- - dAtA[i] = 0x50 - } - if m.AverageBlockTime != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.AverageBlockTime)) - i-- - dAtA[i] = 0x48 - } - if m.BlocksInFinalizationProof != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.BlocksInFinalizationProof)) - i-- - dAtA[i] = 0x40 - } - if m.BlockDistanceForFinalizedData != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.BlockDistanceForFinalizedData)) - i-- - dAtA[i] = 0x38 - } - if m.DataReliabilityEnabled { - i-- - if m.DataReliabilityEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.ReliabilityThreshold != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.ReliabilityThreshold)) - i-- - dAtA[i] = 0x28 - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSpec(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintSpec(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSpec(dAtA []byte, offset int, v uint64) int { - offset -= sovSpec(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Spec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovSpec(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSpec(uint64(l)) - } - if m.Enabled { - n += 2 - } - if m.ReliabilityThreshold != 0 { - n += 1 + sovSpec(uint64(m.ReliabilityThreshold)) - } - if m.DataReliabilityEnabled { - n += 2 - } - if m.BlockDistanceForFinalizedData != 0 { - n += 1 + sovSpec(uint64(m.BlockDistanceForFinalizedData)) - } - if m.BlocksInFinalizationProof != 0 { - n += 1 + sovSpec(uint64(m.BlocksInFinalizationProof)) - } - if m.AverageBlockTime != 0 { - n += 1 + sovSpec(uint64(m.AverageBlockTime)) - } - if m.AllowedBlockLagForQosSync != 0 { - n += 1 + sovSpec(uint64(m.AllowedBlockLagForQosSync)) - } - if m.BlockLastUpdated != 0 { - n += 1 + sovSpec(uint64(m.BlockLastUpdated)) - } - l = m.MinStakeProvider.Size() - n += 1 + l + sovSpec(uint64(l)) - if m.ProvidersTypes != 0 { - n += 1 + sovSpec(uint64(m.ProvidersTypes)) - } - if len(m.Imports) > 0 { - for _, s := range m.Imports { - l = len(s) - n += 1 + l + sovSpec(uint64(l)) - } - } - if len(m.ApiCollections) > 0 { - for _, e := range m.ApiCollections { - l = e.Size() - n += 2 + l + sovSpec(uint64(l)) - } - } - if len(m.Contributor) > 0 { - for _, s := range m.Contributor { - l = len(s) - n += 2 + l + sovSpec(uint64(l)) - } - } - if m.ContributorPercentage != nil { - l = m.ContributorPercentage.Size() - n += 2 + l + sovSpec(uint64(l)) - } - if m.Shares != 0 { - n += 2 + sovSpec(uint64(m.Shares)) - } - return n -} - -func sovSpec(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSpec(x uint64) (n int) { - return sovSpec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Spec) 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 ErrIntOverflowSpec - } - 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: Spec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Spec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReliabilityThreshold", wireType) - } - m.ReliabilityThreshold = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ReliabilityThreshold |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DataReliabilityEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DataReliabilityEnabled = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockDistanceForFinalizedData", wireType) - } - m.BlockDistanceForFinalizedData = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockDistanceForFinalizedData |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksInFinalizationProof", wireType) - } - m.BlocksInFinalizationProof = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlocksInFinalizationProof |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AverageBlockTime", wireType) - } - m.AverageBlockTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AverageBlockTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowedBlockLagForQosSync", wireType) - } - m.AllowedBlockLagForQosSync = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AllowedBlockLagForQosSync |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockLastUpdated", wireType) - } - m.BlockLastUpdated = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockLastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStakeProvider", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MinStakeProvider.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProvidersTypes", wireType) - } - m.ProvidersTypes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProvidersTypes |= Spec_ProvidersTypes(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Imports", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Imports = append(m.Imports, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApiCollections", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApiCollections = append(m.ApiCollections, &ApiCollection{}) - if err := m.ApiCollections[len(m.ApiCollections)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contributor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contributor = append(m.Contributor, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContributorPercentage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.ContributorPercentage = &v - if err := m.ContributorPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) - } - m.Shares = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Shares |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpec(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSpec(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpec - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpec - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpec - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSpec - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSpec - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSpec - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSpec = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSpec = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSpec = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/spec/types/query.pb.go b/x/spec/types/query.pb.go index 3fa12f818d..b0aa9e382a 100644 --- a/x/spec/types/query.pb.go +++ b/x/spec/types/query.pb.go @@ -965,6 +965,7 @@ func _Query_ShowChainInfo_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.spec.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/spec/types/spec.pb.go b/x/spec/types/spec.pb.go index fd3de514df..16014b14a6 100644 --- a/x/spec/types/spec.pb.go +++ b/x/spec/types/spec.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -51,24 +51,24 @@ func (Spec_ProvidersTypes) EnumDescriptor() ([]byte, []int) { } type Spec struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - ReliabilityThreshold uint32 `protobuf:"varint,5,opt,name=reliability_threshold,json=reliabilityThreshold,proto3" json:"reliability_threshold,omitempty"` - DataReliabilityEnabled bool `protobuf:"varint,6,opt,name=data_reliability_enabled,json=dataReliabilityEnabled,proto3" json:"data_reliability_enabled,omitempty"` - BlockDistanceForFinalizedData uint32 `protobuf:"varint,7,opt,name=block_distance_for_finalized_data,json=blockDistanceForFinalizedData,proto3" json:"block_distance_for_finalized_data,omitempty"` - BlocksInFinalizationProof uint32 `protobuf:"varint,8,opt,name=blocks_in_finalization_proof,json=blocksInFinalizationProof,proto3" json:"blocks_in_finalization_proof,omitempty"` - AverageBlockTime int64 `protobuf:"varint,9,opt,name=average_block_time,json=averageBlockTime,proto3" json:"average_block_time,omitempty"` - AllowedBlockLagForQosSync int64 `protobuf:"varint,10,opt,name=allowed_block_lag_for_qos_sync,json=allowedBlockLagForQosSync,proto3" json:"allowed_block_lag_for_qos_sync,omitempty"` - BlockLastUpdated uint64 `protobuf:"varint,11,opt,name=block_last_updated,json=blockLastUpdated,proto3" json:"block_last_updated,omitempty"` - MinStakeProvider types.Coin `protobuf:"bytes,12,opt,name=min_stake_provider,json=minStakeProvider,proto3" json:"min_stake_provider"` - ProvidersTypes Spec_ProvidersTypes `protobuf:"varint,14,opt,name=providers_types,json=providersTypes,proto3,enum=lavanet.lava.spec.Spec_ProvidersTypes" json:"providers_types,omitempty"` - Imports []string `protobuf:"bytes,15,rep,name=imports,proto3" json:"imports,omitempty"` - ApiCollections []*ApiCollection `protobuf:"bytes,16,rep,name=api_collections,json=apiCollections,proto3" json:"api_collections,omitempty"` - Contributor []string `protobuf:"bytes,17,rep,name=contributor,proto3" json:"contributor,omitempty"` - ContributorPercentage *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=contributor_percentage,json=contributorPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"contributor_percentage,omitempty"` - Shares uint64 `protobuf:"varint,19,opt,name=shares,proto3" json:"shares,omitempty"` - Identity string `protobuf:"bytes,20,opt,name=identity,proto3" json:"identity,omitempty"` + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + ReliabilityThreshold uint32 `protobuf:"varint,5,opt,name=reliability_threshold,json=reliabilityThreshold,proto3" json:"reliability_threshold,omitempty"` + DataReliabilityEnabled bool `protobuf:"varint,6,opt,name=data_reliability_enabled,json=dataReliabilityEnabled,proto3" json:"data_reliability_enabled,omitempty"` + BlockDistanceForFinalizedData uint32 `protobuf:"varint,7,opt,name=block_distance_for_finalized_data,json=blockDistanceForFinalizedData,proto3" json:"block_distance_for_finalized_data,omitempty"` + BlocksInFinalizationProof uint32 `protobuf:"varint,8,opt,name=blocks_in_finalization_proof,json=blocksInFinalizationProof,proto3" json:"blocks_in_finalization_proof,omitempty"` + AverageBlockTime int64 `protobuf:"varint,9,opt,name=average_block_time,json=averageBlockTime,proto3" json:"average_block_time,omitempty"` + AllowedBlockLagForQosSync int64 `protobuf:"varint,10,opt,name=allowed_block_lag_for_qos_sync,json=allowedBlockLagForQosSync,proto3" json:"allowed_block_lag_for_qos_sync,omitempty"` + BlockLastUpdated uint64 `protobuf:"varint,11,opt,name=block_last_updated,json=blockLastUpdated,proto3" json:"block_last_updated,omitempty"` + MinStakeProvider types.Coin `protobuf:"bytes,12,opt,name=min_stake_provider,json=minStakeProvider,proto3" json:"min_stake_provider"` + ProvidersTypes Spec_ProvidersTypes `protobuf:"varint,14,opt,name=providers_types,json=providersTypes,proto3,enum=lavanet.lava.spec.Spec_ProvidersTypes" json:"providers_types,omitempty"` + Imports []string `protobuf:"bytes,15,rep,name=imports,proto3" json:"imports,omitempty"` + ApiCollections []*ApiCollection `protobuf:"bytes,16,rep,name=api_collections,json=apiCollections,proto3" json:"api_collections,omitempty"` + Contributor []string `protobuf:"bytes,17,rep,name=contributor,proto3" json:"contributor,omitempty"` + ContributorPercentage *cosmossdk_io_math.LegacyDec `protobuf:"bytes,18,opt,name=contributor_percentage,json=contributorPercentage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"contributor_percentage,omitempty"` + Shares uint64 `protobuf:"varint,19,opt,name=shares,proto3" json:"shares,omitempty"` + Identity string `protobuf:"bytes,20,opt,name=identity,proto3" json:"identity,omitempty"` } func (m *Spec) Reset() { *m = Spec{} } @@ -231,52 +231,53 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/spec/spec.proto", fileDescriptor_789140b95c48dfce) } var fileDescriptor_789140b95c48dfce = []byte{ - // 719 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcf, 0x72, 0xe3, 0x34, - 0x18, 0x8f, 0x89, 0x37, 0x49, 0x15, 0x36, 0xf5, 0x8a, 0x6c, 0x47, 0xed, 0x2c, 0x5e, 0xb3, 0x87, - 0x62, 0x18, 0xb0, 0xa7, 0x2d, 0x07, 0x6e, 0x4c, 0xd3, 0x36, 0x43, 0x3b, 0x30, 0x14, 0xb7, 0x5c, - 0xb8, 0x78, 0x64, 0x59, 0x4d, 0x34, 0xb5, 0x25, 0x63, 0xa9, 0xa1, 0xe1, 0x29, 0x78, 0x0c, 0x1e, - 0xa5, 0xc7, 0x1e, 0x3b, 0x1c, 0x3a, 0x4c, 0xfa, 0x22, 0x8c, 0x64, 0xbb, 0x38, 0x53, 0x2e, 0x91, - 0x3f, 0xfd, 0xfe, 0x7c, 0x92, 0xf2, 0x93, 0xc0, 0xbb, 0x0c, 0x2f, 0x30, 0xa7, 0x2a, 0xd4, 0x63, - 0x28, 0x0b, 0x4a, 0xcc, 0x4f, 0x50, 0x94, 0x42, 0x09, 0xf8, 0xa6, 0x46, 0x03, 0x3d, 0x06, 0x1a, - 0xd8, 0x19, 0xcf, 0xc4, 0x4c, 0x18, 0x34, 0xd4, 0x5f, 0x15, 0x71, 0x67, 0xf7, 0xa5, 0x0d, 0x2e, - 0x58, 0x4c, 0x44, 0x96, 0x51, 0xa2, 0x98, 0xe0, 0x35, 0xcf, 0x25, 0x42, 0xe6, 0x42, 0x86, 0x09, - 0x96, 0x34, 0x5c, 0xec, 0x25, 0x54, 0xe1, 0xbd, 0x90, 0x08, 0x56, 0xe3, 0x1f, 0x1e, 0xfa, 0xc0, - 0xbe, 0x28, 0x28, 0x81, 0x63, 0xf0, 0x8a, 0xf1, 0x94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 0xf7, 0x5f, 0x91, 0xb9, 0x04, 0x00, 0x00, + // 725 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0x51, 0x6f, 0xeb, 0x34, + 0x18, 0x6d, 0x68, 0x6e, 0xdb, 0xb9, 0xdc, 0x2e, 0xd7, 0xf4, 0x4e, 0xde, 0xb8, 0x64, 0xe1, 0x3e, + 0x5c, 0x82, 0x84, 0x12, 0xdd, 0x8d, 0x07, 0xde, 0xd0, 0xba, 0xad, 0x62, 0xd3, 0x10, 0x23, 0x1b, + 0x3c, 0xf0, 0x12, 0x39, 0x8e, 0x97, 0x5a, 0x4b, 0xec, 0x10, 0x7b, 0x65, 0xe5, 0x57, 0xf0, 0x33, + 0xf8, 0x29, 0x7b, 0x41, 0xda, 0x23, 0xe2, 0x61, 0x42, 0xdd, 0x1f, 0x41, 0x76, 0x92, 0xd1, 0x6a, + 0xf7, 0xa5, 0xf6, 0xf1, 0x39, 0xe7, 0xfb, 0x5c, 0xfb, 0xc4, 0xe0, 0x4d, 0x8e, 0xe7, 0x98, 0x53, + 0x15, 0xea, 0x31, 0x94, 0x25, 0x25, 0xe6, 0x27, 0x28, 0x2b, 0xa1, 0x04, 0x7c, 0xd5, 0xb0, 0x81, + 0x1e, 0x03, 0x4d, 0xec, 0x8c, 0x33, 0x91, 0x09, 0xc3, 0x86, 0x7a, 0x56, 0x0b, 0x77, 0xde, 0x3d, + 0x2f, 0x83, 0x4b, 0x16, 0x13, 0x91, 0xe7, 0x94, 0x28, 0x26, 0x78, 0xa3, 0x73, 0x89, 0x90, 0x85, + 0x90, 0x61, 0x82, 0x25, 0x0d, 0xe7, 0xef, 0x13, 0xaa, 0xf0, 0xfb, 0x90, 0x08, 0xd6, 0xf0, 0x6f, + 0xff, 0xea, 0x03, 0xfb, 0xa2, 0xa4, 0x04, 0x8e, 0xc1, 0x0b, 0xc6, 0x53, 0x7a, 0x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0xae, 0x04, 0x00, 0x00, } func (this *Spec) Equal(that interface{}) bool { @@ -1060,7 +1061,7 @@ func (m *Spec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.ContributorPercentage = &v if err := m.ContributorPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/spec/types/tx.pb.go b/x/spec/types/tx.pb.go index ae8b731bc8..24aa4e6ba7 100644 --- a/x/spec/types/tx.pb.go +++ b/x/spec/types/tx.pb.go @@ -71,6 +71,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.spec.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/subscription/handler.go b/x/subscription/handler.go deleted file mode 100644 index 71203e5475..0000000000 --- a/x/subscription/handler.go +++ /dev/null @@ -1,39 +0,0 @@ -package subscription - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v4/x/subscription/keeper" - "github.com/lavanet/lava/v4/x/subscription/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - _ = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgBuy: - res, err := msgServer.Buy(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgAddProject: - res, err := msgServer.AddProject(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDelProject: - res, err := msgServer.DelProject(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgAutoRenewal: - res, err := msgServer.AutoRenewal(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(legacyerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/subscription/keeper/adjustment.go b/x/subscription/keeper/adjustment.go index b2b32d27a9..bc13e0067b 100644 --- a/x/subscription/keeper/adjustment.go +++ b/x/subscription/keeper/adjustment.go @@ -4,7 +4,9 @@ import ( "fmt" "strings" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/subscription/types" @@ -44,7 +46,7 @@ func (k Keeper) RemoveAdjustment( // GetAllAdjustment returns all Adjustment func (k Keeper) GetAllAdjustment(ctx sdk.Context) (list []types.Adjustment) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AdjustmentKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -132,7 +134,7 @@ func (k Keeper) AppendAdjustment(ctx sdk.Context, consumer string, provider stri func (k Keeper) GetConsumerAdjustments(ctx sdk.Context, consumer string) (list []types.Adjustment) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AdjustmentKeyPrefix)) // set consumer prefix - iterator := sdk.KVStorePrefixIterator(store, []byte(consumer)) + iterator := storetypes.KVStorePrefixIterator(store, []byte(consumer)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -147,7 +149,7 @@ func (k Keeper) GetConsumerAdjustments(ctx sdk.Context, consumer string) (list [ func (k Keeper) RemoveConsumerAdjustments(ctx sdk.Context, consumer string) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AdjustmentKeyPrefix)) // set consumer prefix - iterator := sdk.KVStorePrefixIterator(store, []byte(consumer)) + iterator := storetypes.KVStorePrefixIterator(store, []byte(consumer)) defer iterator.Close() keysToDelete := []string{} @@ -159,7 +161,7 @@ func (k Keeper) RemoveConsumerAdjustments(ctx sdk.Context, consumer string) { } } -func (k Keeper) GetAdjustmentFactorProvider(ctx sdk.Context, adjustments []types.Adjustment) map[string]sdk.Dec { +func (k Keeper) GetAdjustmentFactorProvider(ctx sdk.Context, adjustments []types.Adjustment) map[string]math.LegacyDec { type usage struct { total int64 adjusted int64 @@ -179,7 +181,7 @@ func (k Keeper) GetAdjustmentFactorProvider(ctx sdk.Context, adjustments []types providers = append(providers, provider) } - providerAdjustment := map[string]sdk.Dec{} + providerAdjustment := map[string]math.LegacyDec{} // we use providers list to iterate deterministically for _, provider := range providers { if _, ok := providerAdjustment[provider]; !ok { @@ -189,7 +191,7 @@ func (k Keeper) GetAdjustmentFactorProvider(ctx sdk.Context, adjustments []types if totalUsage == 0 { continue } - providerAdjustment[provider] = sdk.NewDec(totalAdjustedUsage).QuoInt64(totalUsage) + providerAdjustment[provider] = math.LegacyNewDec(totalAdjustedUsage).QuoInt64(totalUsage) } } return providerAdjustment diff --git a/x/subscription/keeper/cu_tracker.go b/x/subscription/keeper/cu_tracker.go index 79817c614c..92223d74aa 100644 --- a/x/subscription/keeper/cu_tracker.go +++ b/x/subscription/keeper/cu_tracker.go @@ -165,8 +165,8 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes block := trackedCuList[0].Block totalTokenAmount := timerData.Credit.Amount - if totalTokenAmount.Quo(sdk.NewIntFromUint64(totalCuTracked)).GT(sdk.NewIntFromUint64(LIMIT_TOKEN_PER_CU)) { - totalTokenAmount = sdk.NewIntFromUint64(LIMIT_TOKEN_PER_CU * totalCuTracked) + if totalTokenAmount.Quo(math.NewIntFromUint64(totalCuTracked)).GT(math.NewIntFromUint64(LIMIT_TOKEN_PER_CU)) { + totalTokenAmount = math.NewIntFromUint64(LIMIT_TOKEN_PER_CU * totalCuTracked) } // get the adjustment factor, and delete the entries @@ -176,7 +176,7 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes details := map[string]string{} - totalTokenRewarded := sdk.ZeroInt() + totalTokenRewarded := math.ZeroInt() for _, trackedCuInfo := range trackedCuList { trackedCu := trackedCuInfo.TrackedCu provider := trackedCuInfo.Provider @@ -204,13 +204,17 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes ) return } - providerAdjustment = sdk.OneDec().Quo(sdk.NewDecFromInt(sdk.NewIntFromUint64(maxRewardBoost))) + providerAdjustment = math.LegacyOneDec().Quo(math.LegacyNewDecFromInt(math.NewIntFromUint64(maxRewardBoost))) } // calculate the provider reward (smaller than totalMonthlyReward // because it's shared with delegators) totalMonthlyRewardAmount := k.CalcTotalMonthlyReward(ctx, totalTokenAmount, trackedCu, totalCuTracked) - creditToSub := sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), totalMonthlyRewardAmount) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return + } + creditToSub := sdk.NewCoin(bondDenom, totalMonthlyRewardAmount) totalTokenRewarded = totalTokenRewarded.Add(totalMonthlyRewardAmount) k.rewardsKeeper.AggregateRewards(ctx, provider, chainID, providerAdjustment, totalMonthlyRewardAmount) @@ -259,7 +263,7 @@ func (k Keeper) CalcTotalMonthlyReward(ctx sdk.Context, totalAmount math.Int, tr return math.ZeroInt() } - totalMonthlyReward := totalAmount.Mul(sdk.NewIntFromUint64(trackedCu)).Quo(sdk.NewIntFromUint64(totalCuUsedBySub)) + totalMonthlyReward := totalAmount.Mul(math.NewIntFromUint64(trackedCu)).Quo(math.NewIntFromUint64(totalCuUsedBySub)) return totalMonthlyReward } @@ -273,7 +277,11 @@ func (k Keeper) returnCreditToSub(ctx sdk.Context, sub string, credit math.Int) } else { // sub expired (no need to update credit), send rewards remainder to the validators pool := rewardstypes.ValidatorsRewardsDistributionPoolName - err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, string(pool), sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), credit))) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return sdk.Coin{} + } + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, string(pool), sdk.NewCoins(sdk.NewCoin(bondDenom, credit))) if err != nil { utils.LavaFormatError("failed sending remainder of rewards to the community pool", err, utils.Attribute{Key: "rewards_remainder", Value: credit.String()}, @@ -281,7 +289,7 @@ func (k Keeper) returnCreditToSub(ctx sdk.Context, sub string, credit math.Int) } } - return sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), math.ZeroInt()) + return sdk.Coin{} } // wrapper function for calculating the validators and community participation fees diff --git a/x/subscription/keeper/grpc_query_estimated_rewards.go b/x/subscription/keeper/grpc_query_estimated_rewards.go index 2c39590579..a18e0bfbe5 100644 --- a/x/subscription/keeper/grpc_query_estimated_rewards.go +++ b/x/subscription/keeper/grpc_query_estimated_rewards.go @@ -6,6 +6,7 @@ import ( "sort" "strings" + "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/testutil/sample" @@ -33,7 +34,7 @@ func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.Query // parse the delegator/delegation optional argument (delegate if needed) delegator := req.AmountDelegator - trackedCuFactor := sdk.ZeroDec() + trackedCuFactor := math.LegacyZeroDec() if req.AmountDelegator != "" { details = append(details, utils.LogAttr("delegator_amount", req.AmountDelegator)) delegation, err := sdk.ParseCoinNormalized(req.AmountDelegator) @@ -51,7 +52,7 @@ func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.Query return nil, utils.LavaFormatWarning("cannot estimate rewards for delegator/delegation, cannot get delegator", err, details...) } - totalDelegations := sdk.ZeroInt() + totalDelegations := math.ZeroInt() md, err := k.epochstorageKeeper.GetMetadata(ctx, req.Provider) if err != nil { return nil, utils.LavaFormatWarning("cannot estimate rewards for delegator/delegation, cannot get provider metadata", err, details...) @@ -124,7 +125,7 @@ func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.Query // get detailed info for providers only if req.AmountDelegator == "" { info, total := k.getRewardsInfoFromEvents(ctx, req.Provider) - if !total.IsEqual(res.Total) { + if !total.Equal(res.Total) { // total amount sanity check return nil, utils.LavaFormatError("cannot estimate rewards, info sanity check failed", fmt.Errorf("total rewards from info is different than total claimable rewards difference"), @@ -156,7 +157,7 @@ func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.Query // helper function that returns a map of provider->rewards func (k Keeper) getClaimableRewards(ctx sdk.Context, provider string, delegator string) (rewards sdk.Coins, err error) { var qRes *dualstakingtypes.QueryDelegatorRewardsResponse - goCtx := sdk.WrapSDKContext(ctx) + goCtx := ctx // get delegator rewards if delegator == "" { diff --git a/x/subscription/keeper/grpc_query_estimated_validator_rewards.go b/x/subscription/keeper/grpc_query_estimated_validator_rewards.go index 988072d3bc..ad1b31598d 100644 --- a/x/subscription/keeper/grpc_query_estimated_validator_rewards.go +++ b/x/subscription/keeper/grpc_query_estimated_validator_rewards.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" "github.com/lavanet/lava/v4/x/subscription/types" @@ -24,18 +25,18 @@ func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.Quer return nil, err } - val, found := k.stakingKeeper.GetValidator(ctx, valAddress) - if !found { + val, err := k.stakingKeeper.GetValidator(ctx, valAddress) + if err != nil { return nil, fmt.Errorf("validator not found") } - var delegatorPart sdk.Dec + var delegatorPart math.LegacyDec delAddress := sdk.AccAddress(valAddress) - totalStakedTokens := sdk.ZeroInt() + totalStakedTokens := math.ZeroInt() // self delegation if req.AmountDelegator == "" { - del, found := k.stakingKeeper.GetDelegation(ctx, delAddress, valAddress) - if !found { + del, err := k.stakingKeeper.GetDelegation(ctx, delAddress, valAddress) + if err != nil { return nil, fmt.Errorf("self delegation not found") } delegatorPart = del.Shares.Add(val.DelegatorShares.Sub(del.Shares).Mul(val.Commission.Rate)).Quo(val.DelegatorShares) @@ -43,11 +44,11 @@ func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.Quer delAddress, err := sdk.AccAddressFromBech32(req.AmountDelegator) // existing delegator if err == nil { - del, found := k.stakingKeeper.GetDelegation(ctx, delAddress, valAddress) - if !found { + del, err := k.stakingKeeper.GetDelegation(ctx, delAddress, valAddress) + if err != nil { return nil, fmt.Errorf("delegation not found") } - delegatorPart = del.Shares.Quo(val.DelegatorShares).Mul(sdk.OneDec().Sub(val.Commission.Rate)) + delegatorPart = del.Shares.Quo(val.DelegatorShares).Mul(math.LegacyOneDec().Sub(val.Commission.Rate)) } else { // potential delegator coins, err := sdk.ParseCoinsNormalized(req.AmountDelegator) if err != nil { @@ -55,13 +56,16 @@ func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.Quer } totalStakedTokens = coins[0].Amount - var shares sdk.Dec + var shares math.LegacyDec val, shares = val.AddTokensFromDel(coins[0].Amount) - delegatorPart = shares.Quo(val.DelegatorShares).Mul(sdk.OneDec().Sub(val.Commission.Rate)) + delegatorPart = shares.Quo(val.DelegatorShares).Mul(math.LegacyOneDec().Sub(val.Commission.Rate)) } } - validators := k.stakingKeeper.GetBondedValidatorsByPower(ctx) + validators, err := k.stakingKeeper.GetBondedValidatorsByPower(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get bonded validators by power", err) + } for _, v := range validators { totalStakedTokens = totalStakedTokens.Add(v.Tokens) @@ -73,7 +77,7 @@ func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.Quer for _, subIndex := range subsIndices { sub, found := k.GetSubscription(ctx, subIndex) if found { - sub.Credit.Amount = sub.Credit.Amount.Quo(sdk.NewIntFromUint64(sub.DurationLeft)) + sub.Credit.Amount = sub.Credit.Amount.Quo(math.NewIntFromUint64(sub.DurationLeft)) totalSubsRewards = totalSubsRewards.Add(sub.Credit) } } @@ -85,9 +89,12 @@ func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.Quer monthsLeft := k.rewardsKeeper.AllocationPoolMonthsLeft(ctx) allocationPool := k.rewardsKeeper.TotalPoolTokens(ctx, rewardstypes.ValidatorsRewardsAllocationPoolName) - blockRewards := sdk.NewDecCoinsFromCoins(allocationPool...).QuoDec(sdk.NewDec(monthsLeft)) - communityTax := k.rewardsKeeper.GetCommunityTax(ctx) - blockRewards = blockRewards.MulDec(sdk.OneDec().Sub(communityTax)) + blockRewards := sdk.NewDecCoinsFromCoins(allocationPool...).QuoDec(math.LegacyNewDec(monthsLeft)) + communityTax, err := k.rewardsKeeper.GetCommunityTax(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get community tax") + } + blockRewards = blockRewards.MulDec(math.LegacyOneDec().Sub(communityTax)) iprpcReward, found := k.rewardsKeeper.GetIprpcReward(ctx, k.rewardsKeeper.GetIprpcRewardsCurrentId(ctx)) if found { diff --git a/x/subscription/keeper/grpc_query_params_test.go b/x/subscription/keeper/grpc_query_params_test.go index cffb744309..e92b741ac6 100644 --- a/x/subscription/keeper/grpc_query_params_test.go +++ b/x/subscription/keeper/grpc_query_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" @@ -11,7 +10,7 @@ import ( func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.SubscriptionKeeper(t) - wctx := sdk.WrapSDKContext(ctx) + wctx := ctx params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/subscription/keeper/keeper.go b/x/subscription/keeper/keeper.go index 037da90286..38f4c91ad8 100644 --- a/x/subscription/keeper/keeper.go +++ b/x/subscription/keeper/keeper.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/subscription/keeper/migrations.go b/x/subscription/keeper/migrations.go index 22aebf0452..86ca963a08 100644 --- a/x/subscription/keeper/migrations.go +++ b/x/subscription/keeper/migrations.go @@ -4,7 +4,8 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" v2 "github.com/lavanet/lava/v4/x/subscription/migrations/v2" @@ -34,7 +35,7 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { v2.KeyPrefix(v2.SubscriptionKeyPrefix), ) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -189,6 +190,11 @@ func (m Migrator) Migrate6to7(ctx sdk.Context) error { func (m Migrator) Migrate7to8(ctx sdk.Context) error { utils.LavaFormatDebug("migrate 7->8: subscriptions") + bondDenom, err := m.keeper.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + for _, index := range m.keeper.subsFS.GetAllEntryIndices(ctx) { for _, block := range m.keeper.subsFS.GetAllEntryVersions(ctx, index) { // read current subscription from fixation to new subscription struct @@ -207,7 +213,7 @@ func (m Migrator) Migrate7to8(ctx sdk.Context) error { continue } creditAmount := plan.Price.Amount.MulRaw(int64(s8.DurationLeft)) - credit := sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), creditAmount) + credit := sdk.NewCoin(bondDenom, creditAmount) // calculate future sub's credit if s8.FutureSubscription != nil { @@ -223,7 +229,7 @@ func (m Migrator) Migrate7to8(ctx sdk.Context) error { } futureCreditAmount := futurePlan.Price.Amount.MulRaw(int64(s8.FutureSubscription.DurationBought)) - futureCredit := sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), futureCreditAmount) + futureCredit := sdk.NewCoin(bondDenom, futureCreditAmount) s8.FutureSubscription.Credit = futureCredit } diff --git a/x/subscription/keeper/msg_server_test.go b/x/subscription/keeper/msg_server_test.go index b537768e68..8e07adcdcb 100644 --- a/x/subscription/keeper/msg_server_test.go +++ b/x/subscription/keeper/msg_server_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" keepertest "github.com/lavanet/lava/v4/testutil/keeper" "github.com/lavanet/lava/v4/x/subscription/keeper" "github.com/lavanet/lava/v4/x/subscription/types" @@ -12,5 +11,5 @@ import ( func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { k, ctx := keepertest.SubscriptionKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + return keeper.NewMsgServerImpl(*k), ctx } diff --git a/x/subscription/keeper/subscription.go b/x/subscription/keeper/subscription.go index 9a873a0d0a..29e9f5bf91 100644 --- a/x/subscription/keeper/subscription.go +++ b/x/subscription/keeper/subscription.go @@ -201,6 +201,11 @@ func (k Keeper) createNewSubscription(ctx sdk.Context, plan *planstypes.Plan, cr autoRenewalNextPlan = plan.Index } + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return types.Subscription{}, err + } + sub := types.Subscription{ Creator: creator, Consumer: consumer, @@ -209,7 +214,7 @@ func (k Keeper) createNewSubscription(ctx sdk.Context, plan *planstypes.Plan, cr PlanBlock: plan.Block, DurationTotal: 0, AutoRenewalNextPlan: autoRenewalNextPlan, - Credit: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), math.ZeroInt()), + Credit: sdk.NewCoin(bondDenom, math.ZeroInt()), } sub.MonthCuTotal = plan.PlanPolicy.GetTotalCuLimit() @@ -217,7 +222,7 @@ func (k Keeper) createNewSubscription(ctx sdk.Context, plan *planstypes.Plan, cr sub.Cluster = types.GetClusterKey(sub) // new subscription needs a default project - err := k.projectsKeeper.CreateAdminProject(ctx, consumer, *plan) + err = k.projectsKeeper.CreateAdminProject(ctx, consumer, *plan) if err != nil { return types.Subscription{}, utils.LavaFormatWarning("failed to create default project", err) } @@ -346,8 +351,11 @@ func (k Keeper) renewSubscription(ctx sdk.Context, sub *types.Subscription) erro utils.Attribute{Key: "consumer", Value: sub.Creator}, ) } - - if k.bankKeeper.GetBalance(ctx, creatorAcct, k.stakingKeeper.BondDenom(ctx)).IsLT(price) { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + if k.bankKeeper.GetBalance(ctx, creatorAcct, bondDenom).IsLT(price) { return utils.LavaFormatWarning("renew subscription failed", legacyerrors.ErrInsufficientFunds, utils.LogAttr("creator", sub.Creator), utils.LogAttr("price", price), @@ -483,9 +491,17 @@ func (k Keeper) addCuTrackerTimerForSubscription(ctx sdk.Context, block uint64, creditReward := sub.Credit.Amount.QuoRaw(int64(sub.DurationLeft)) sub.Credit = sub.Credit.SubAmount(creditReward) + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + utils.LavaFormatError("critical: failed assigning CU tracker callback, skipping", err, + utils.Attribute{Key: "block", Value: block}, + ) + return + } + timerData := types.CuTrackerTimerData{ Block: sub.Block, - Credit: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), creditReward), + Credit: sdk.NewCoin(bondDenom, creditReward), } marshaledTimerData, err := k.cdc.Marshal(&timerData) if err != nil { @@ -572,14 +588,19 @@ func (k Keeper) applyPlanDiscountIfEligible(duration uint64, plan *planstypes.Pl } func (k Keeper) chargeFromCreatorAccountToModule(ctx sdk.Context, creator sdk.AccAddress, price sdk.Coin) error { - if k.bankKeeper.GetBalance(ctx, creator, k.stakingKeeper.BondDenom(ctx)).IsLT(price) { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + + if k.bankKeeper.GetBalance(ctx, creator, bondDenom).IsLT(price) { return utils.LavaFormatWarning("create subscription failed", legacyerrors.ErrInsufficientFunds, utils.LogAttr("creator", creator), utils.LogAttr("price", price), ) } - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, creator, types.ModuleName, []sdk.Coin{price}) + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, creator, types.ModuleName, []sdk.Coin{price}) if err != nil { return utils.LavaFormatError("create subscription failed. funds transfer failed", err, utils.LogAttr("creator", creator), diff --git a/x/subscription/migrations/v5/query.pb.go b/x/subscription/migrations/v5/query.pb.go index 9ba62c4de3..6ea06d081d 100644 --- a/x/subscription/migrations/v5/query.pb.go +++ b/x/subscription/migrations/v5/query.pb.go @@ -490,7 +490,7 @@ func init() { } func init() { - proto.RegisterFile("lavanet/lava/subscription/query.proto", fileDescriptor_e870698c9d8ccc09) + // proto.RegisterFile("lavanet/lava/subscription/query.proto", fileDescriptor_e870698c9d8ccc09) } var fileDescriptor_e870698c9d8ccc09 = []byte{ diff --git a/x/subscription/module.go b/x/subscription/module.go index 6a8f4fbdbe..1990a7912e 100644 --- a/x/subscription/module.go +++ b/x/subscription/module.go @@ -193,10 +193,18 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 8 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/subscription/module_simulation.go b/x/subscription/module_simulation.go index c8047e4039..a3d8f57502 100644 --- a/x/subscription/module_simulation.go +++ b/x/subscription/module_simulation.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -63,15 +62,18 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) var weightMsgBuy int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgBuy, &weightMsgBuy, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgBuy, + &weightMsgBuy, + simState.Rand, + func(r *rand.Rand) { weightMsgBuy = defaultWeightMsgBuy }, ) @@ -81,8 +83,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgAddProject int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAddProject, &weightMsgAddProject, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgAddProject, + &weightMsgAddProject, + simState.Rand, + func(r *rand.Rand) { weightMsgAddProject = defaultWeightMsgAddProject }, ) @@ -92,8 +97,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgDelProject int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDelProject, &weightMsgDelProject, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgDelProject, + &weightMsgDelProject, + simState.Rand, + func(r *rand.Rand) { weightMsgDelProject = defaultWeightMsgDelProject }, ) @@ -103,8 +111,11 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp )) var weightMsgAutoRenewal int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAutoRenewal, &weightMsgAutoRenewal, nil, - func(_ *rand.Rand) { + simState.AppParams.GetOrGenerate( + opWeightMsgAutoRenewal, + &weightMsgAutoRenewal, + simState.Rand, + func(r *rand.Rand) { weightMsgAutoRenewal = defaultWeightMsgAutoRenewal }, ) diff --git a/x/subscription/types/expected_keepers.go b/x/subscription/types/expected_keepers.go index 2169e5b817..801ad3b2fa 100644 --- a/x/subscription/types/expected_keepers.go +++ b/x/subscription/types/expected_keepers.go @@ -4,9 +4,8 @@ import ( context "context" "cosmossdk.io/math" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" @@ -19,15 +18,15 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt sdk.Coins) error // Methods imported from bank should be defined here } @@ -79,7 +78,7 @@ type DualStakingKeeper interface { } type RewardsKeeper interface { - AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment sdk.Dec, rewards math.Int) + AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment math.LegacyDec, rewards math.Int) MaxRewardBoost(ctx sdk.Context) (res uint64) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward sdk.Coin, senderModule string) (updatedReward sdk.Coin, err error) FundCommunityPoolFromModule(ctx sdk.Context, amount sdk.Coins, senderModule string) error @@ -88,20 +87,20 @@ type RewardsKeeper interface { CalculateValidatorsAndCommunityParticipationRewards(ctx sdk.Context, reward sdk.Coin) (validatorsCoins sdk.Coins, communityCoins sdk.Coins, err error) TotalPoolTokens(ctx sdk.Context, pool rewardstypes.Pool) sdk.Coins SpecEmissionParts(ctx sdk.Context) (emissions []rewardstypes.SpecEmissionPart) - SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards sdk.Dec, spec rewardstypes.SpecEmissionPart) math.LegacyDec + SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards math.LegacyDec, spec rewardstypes.SpecEmissionPart) math.LegacyDec GetIprpcRewardsCurrentId(ctx sdk.Context) uint64 GetIprpcReward(ctx sdk.Context, id uint64) (val rewardstypes.IprpcReward, found bool) AllocationPoolMonthsLeft(ctx sdk.Context) int64 - GetCommunityTax(ctx sdk.Context) math.LegacyDec + GetCommunityTax(ctx sdk.Context) (math.LegacyDec, error) DistributeMonthlyBonusRewards(ctx sdk.Context) GetLastRewardsBlock(ctx sdk.Context) (rewardsDistributionBlock uint64, after24HoursBlock uint64, err error) } type StakingKeeper interface { - BondDenom(ctx sdk.Context) string - GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) - GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) - GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator + BondDenom(ctx context.Context) (string, error) + GetValidator(ctx context.Context, addr sdk.ValAddress) (stakingtypes.Validator, error) + GetDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.Delegation, error) + GetBondedValidatorsByPower(ctx context.Context) ([]stakingtypes.Validator, error) } type SpecKeeper interface { diff --git a/x/subscription/types/message_add_project.go b/x/subscription/types/message_add_project.go index cb6359c596..7b258325ea 100644 --- a/x/subscription/types/message_add_project.go +++ b/x/subscription/types/message_add_project.go @@ -26,19 +26,6 @@ func (msg *MsgAddProject) Type() string { return TypeMsgAddProject } -func (msg *MsgAddProject) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgAddProject) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgAddProject) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/subscription/types/message_auto_renewal.go b/x/subscription/types/message_auto_renewal.go index 5d92cda6c0..a9d5373b0b 100644 --- a/x/subscription/types/message_auto_renewal.go +++ b/x/subscription/types/message_auto_renewal.go @@ -29,19 +29,6 @@ func (msg *MsgAutoRenewal) Type() string { return TypeMsgAutoRenewal } -func (msg *MsgAutoRenewal) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgAutoRenewal) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgAutoRenewal) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/subscription/types/message_buy.go b/x/subscription/types/message_buy.go index e308f247a9..3ee477be5d 100644 --- a/x/subscription/types/message_buy.go +++ b/x/subscription/types/message_buy.go @@ -31,19 +31,6 @@ func (msg *MsgBuy) Type() string { return TypeMsgBuy } -func (msg *MsgBuy) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgBuy) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgBuy) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/subscription/types/message_del_project.go b/x/subscription/types/message_del_project.go index 54c712bf39..94bc0a3ee8 100644 --- a/x/subscription/types/message_del_project.go +++ b/x/subscription/types/message_del_project.go @@ -25,19 +25,6 @@ func (msg *MsgDelProject) Type() string { return TypeMsgDelProject } -func (msg *MsgDelProject) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgDelProject) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgDelProject) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { diff --git a/x/subscription/types/query.pb.go b/x/subscription/types/query.pb.go index d4341cca75..b1a903469b 100644 --- a/x/subscription/types/query.pb.go +++ b/x/subscription/types/query.pb.go @@ -1537,6 +1537,7 @@ func _Query_EstimatedValidatorRewards_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.subscription.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/subscription/types/tx.pb.go b/x/subscription/types/tx.pb.go index d631e3339a..91144afe23 100644 --- a/x/subscription/types/tx.pb.go +++ b/x/subscription/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -446,42 +447,43 @@ func init() { } var fileDescriptor_b1bb075a6865b817 = []byte{ - // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4f, 0x6f, 0xd3, 0x30, - 0x14, 0xaf, 0x69, 0x96, 0x15, 0x77, 0x40, 0xb1, 0xf6, 0x27, 0x44, 0x10, 0xb6, 0x70, 0xe9, 0x38, - 0x24, 0x30, 0x38, 0xf5, 0xb6, 0x6a, 0x17, 0x40, 0x95, 0xa6, 0x70, 0x83, 0x43, 0xe5, 0x26, 0x56, - 0x1a, 0x68, 0xed, 0x28, 0x76, 0x4a, 0xfb, 0x15, 0x38, 0x21, 0xc1, 0x8d, 0x2f, 0xc1, 0xc7, 0xd8, - 0x71, 0x47, 0x24, 0x24, 0x84, 0xda, 0x03, 0x5f, 0x03, 0xc5, 0x49, 0x9a, 0x04, 0xe8, 0xb2, 0x4b, - 0xfc, 0xde, 0xf3, 0xcf, 0xef, 0xf7, 0xf3, 0x7b, 0x2f, 0x86, 0xe6, 0x04, 0xcf, 0x30, 0x25, 0xc2, - 0x4e, 0x56, 0x9b, 0xc7, 0x23, 0xee, 0x46, 0x41, 0x28, 0x02, 0x46, 0x6d, 0x31, 0xb7, 0xc2, 0x88, - 0x09, 0x86, 0xee, 0x65, 0x18, 0x2b, 0x59, 0xad, 0x32, 0x46,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x6b, 0x43, 0x73, 0xb2, 0xfe, 0x8b, 0x8b, 0xa5, 0x01, - 0x2e, 0x97, 0x06, 0xf8, 0xb5, 0x34, 0xc0, 0xa7, 0x95, 0xd1, 0xb8, 0x5c, 0x19, 0x8d, 0xef, 0x2b, - 0xa3, 0xf1, 0xc6, 0xf6, 0x03, 0x31, 0x8e, 0x47, 0x96, 0xcb, 0xa6, 0x76, 0xe5, 0x0d, 0x9b, 0x3d, - 0xb7, 0xe7, 0x7f, 0x3d, 0x8d, 0x8b, 0x90, 0xf0, 0x91, 0x2a, 0x5f, 0xad, 0x67, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x9a, 0x98, 0x2b, 0x5b, 0x44, 0x05, 0x00, 0x00, + // 573 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x31, 0x73, 0xd3, 0x30, + 0x14, 0xc7, 0x63, 0xe2, 0xa6, 0x41, 0x29, 0x10, 0x7c, 0xa5, 0x31, 0x1e, 0x4c, 0x62, 0x96, 0xa4, + 0x83, 0x4d, 0x0b, 0x53, 0xb6, 0xe6, 0xba, 0x00, 0x97, 0xbb, 0x9e, 0xd9, 0x58, 0x72, 0x8a, 0xad, + 0x73, 0x02, 0xb1, 0xe4, 0xb3, 0xe4, 0x90, 0xac, 0x8c, 0x4c, 0xec, 0x0c, 0xf0, 0x11, 0xfa, 0x31, + 0x3a, 0x76, 0x64, 0xe2, 0xb8, 0x64, 0xc8, 0xd7, 0xe0, 0x2c, 0xcb, 0xb1, 0x1d, 0x2e, 0x75, 0x97, + 0x48, 0xef, 0xe9, 0x6f, 0xe9, 0xa7, 0xff, 0x7b, 0x11, 0x30, 0x66, 0x70, 0x0e, 0x31, 0x62, 0x56, + 0x3c, 0x5a, 0x34, 0x1a, 0x53, 0x27, 0x9c, 0x06, 0x6c, 0x4a, 0xb0, 0xc5, 0x16, 0x66, 0x10, 0x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ed, 0xd5, 0x7d, 0x95, + 0xf9, 0x93, 0x72, 0x1d, 0x50, 0x72, 0x52, 0xa6, 0x2c, 0x3b, 0xe9, 0xff, 0x62, 0x2b, 0x9f, 0x41, + 0x23, 0x5f, 0xe8, 0x12, 0x37, 0x72, 0x52, 0xed, 0xec, 0xde, 0xd2, 0xf4, 0xb0, 0xc1, 0xdb, 0x9b, + 0x95, 0x2e, 0xdd, 0xae, 0x74, 0xe9, 0xef, 0x4a, 0x97, 0xbe, 0xaf, 0xf5, 0xca, 0xed, 0x5a, 0xaf, + 0xfc, 0x5e, 0xeb, 0x95, 0x8f, 0x96, 0x37, 0x65, 0x93, 0x68, 0x6c, 0x3a, 0xc4, 0xb7, 0x0a, 0x8f, + 0xe1, 0xfc, 0x8d, 0xb5, 0xd8, 0x79, 0x63, 0x97, 0x01, 0xa2, 0xe3, 0x1a, 0x7f, 0xe5, 0x5e, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0xff, 0x85, 0xd4, 0x31, 0xf5, 0x8d, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -647,6 +649,7 @@ func _Msg_AutoRenewal_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.subscription.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/timerstore/keeper/keeper.go b/x/timerstore/keeper/keeper.go index 925d267083..d0a8a903f0 100644 --- a/x/timerstore/keeper/keeper.go +++ b/x/timerstore/keeper/keeper.go @@ -1,8 +1,8 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) diff --git a/x/timerstore/module.go b/x/timerstore/module.go index 24b6d590d5..f355fcb72b 100644 --- a/x/timerstore/module.go +++ b/x/timerstore/module.go @@ -1,7 +1,8 @@ package timerstore import ( - abci "github.com/cometbft/cometbft/abci/types" + "context" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -59,15 +60,18 @@ type AppModule struct { func (a AppModule) ConsensusVersion() uint64 { return ConsensusVersion } -func (a AppModule) BeginBlock(context sdk.Context, _ abci.RequestBeginBlock) { - a.k.BeginBlock(context) +func (a AppModule) BeginBlock(context context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(context) + a.k.BeginBlock(sdkCtx) + return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (a AppModule) EndBlock(context sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - a.k.EndBlock(context) - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(context context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(context) + a.k.EndBlock(sdkCtx) + return nil } // RegisterServices registers a GRPC query service to respond to the @@ -75,3 +79,9 @@ func (a AppModule) EndBlock(context sdk.Context, _ abci.RequestEndBlock) []abci. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.k) } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/timerstore/types/genesis_test.go b/x/timerstore/types/genesis_test.go index 1ecbead63b..a9caa3ce30 100644 --- a/x/timerstore/types/genesis_test.go +++ b/x/timerstore/types/genesis_test.go @@ -3,8 +3,8 @@ package types import ( "testing" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" ) @@ -22,13 +22,13 @@ func TestGenesis(t *testing.T) { store1 := prefix.NewStore( ctx.KVStore(ts.storeKey), KeyPrefix(ts.prefix)) - iterator1 := sdk.KVStorePrefixIterator(store1, []byte{}) + iterator1 := storetypes.KVStorePrefixIterator(store1, []byte{}) defer iterator1.Close() store2 := prefix.NewStore( emptyCtx.KVStore(ts.storeKey), KeyPrefix(ts.prefix)) - iterator2 := sdk.KVStorePrefixIterator(store2, []byte{}) + iterator2 := storetypes.KVStorePrefixIterator(store2, []byte{}) defer iterator2.Close() for ; iterator1.Valid(); iterator1.Next() { diff --git a/x/timerstore/types/query.pb.go b/x/timerstore/types/query.pb.go index 146b095c03..4682547d5c 100644 --- a/x/timerstore/types/query.pb.go +++ b/x/timerstore/types/query.pb.go @@ -680,6 +680,7 @@ func _Query_Next_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.timerstore.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/timerstore/types/timer.go b/x/timerstore/types/timer.go index 99b84910f8..355573c36d 100644 --- a/x/timerstore/types/timer.go +++ b/x/timerstore/types/timer.go @@ -4,9 +4,9 @@ import ( "fmt" "math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" commontypes "github.com/lavanet/lava/v4/utils/common/types" ) @@ -152,7 +152,7 @@ func (tstore *TimerStore) Export(ctx sdk.Context) (gs GenesisState) { // get all time timers (measured in block time) store := tstore.getStoreTimer(ctx, BlockTime) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) for ; iterator.Valid(); iterator.Next() { value, key := DecodeBlockAndKey(iterator.Key()) gs.TimeEntries = append(gs.TimeEntries, GenesisTimerEntry{ @@ -166,7 +166,7 @@ func (tstore *TimerStore) Export(ctx sdk.Context) (gs GenesisState) { // get all block timers (measured in block height) store = tstore.getStoreTimer(ctx, BlockHeight) - iterator = sdk.KVStorePrefixIterator(store, []byte{}) + iterator = storetypes.KVStorePrefixIterator(store, []byte{}) for ; iterator.Valid(); iterator.Next() { value, key := DecodeBlockAndKey(iterator.Key()) gs.BlockEntries = append(gs.BlockEntries, GenesisTimerEntry{ @@ -339,7 +339,7 @@ func (tstore *TimerStore) DelTimerByBlockTime(ctx sdk.Context, timestamp uint64, func (tstore *TimerStore) DumpAllTimers(ctx sdk.Context, which TimerType) []*TimerInfo { store := tstore.getStoreTimer(ctx, which) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() timers := []*TimerInfo{} @@ -369,7 +369,7 @@ func (tstore *TimerStore) getFrontTimer(ctx sdk.Context, which TimerType) (uint6 // because the key is block height/timestamp, the iterator yields entries // ordered by height/timestamp. so the front (earliest) one is the first. - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() if !iterator.Valid() { @@ -408,7 +408,7 @@ func (tstore *TimerStore) GetFrontTimers(ctx sdk.Context, which TimerType) (keys store := tstore.getStoreTimer(ctx, which) nextTimeoutValue := tstore.getNextTimeout(ctx, which) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -470,7 +470,7 @@ func timerMigrate1to2(ctx sdk.Context, tstore *TimerStore) error { for _, which := range []TimerType{BlockHeight, BlockTime} { store := tstore.getStoreTimer(ctx, which) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { diff --git a/x/timerstore/types/timer_test.go b/x/timerstore/types/timer_test.go index 15cab56990..9422b70ba2 100644 --- a/x/timerstore/types/timer_test.go +++ b/x/timerstore/types/timer_test.go @@ -6,13 +6,14 @@ import ( "testing" "time" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" ) @@ -257,14 +258,14 @@ func TestTimerEarlyExpiry(t *testing.T) { } var ( - mockStoreKey = sdk.NewKVStoreKey("storeKey") + mockStoreKey = storetypes.NewKVStoreKey("storeKey") mockMemStoreKey = storetypes.NewMemoryStoreKey("storeMemKey") ) // Helper function to init a mock keeper and context func initCtx(t *testing.T) (sdk.Context, *codec.ProtoCodec) { - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) @@ -274,7 +275,7 @@ func initCtx(t *testing.T) (sdk.Context, *codec.ProtoCodec) { require.NoError(t, stateStore.LoadLatestVersion()) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.TestingLogger()) + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) return ctx, cdc }