diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 932e04cecb..9de92e14ca 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,14 +12,14 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v5 with: go-version: 1.20.5 - - name: Checkout code - uses: actions/checkout@v4 - - name: Lint uses: golangci/golangci-lint-action@v4 with: diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index ad9c6f12c3..95cc07032a 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -23,15 +23,15 @@ jobs: # with: # input: "proto" - break-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.38.0 - - uses: bufbuild/buf-breaking-action@v1 - with: - input: "proto" - against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto" + # break-check: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: bufbuild/buf-setup-action@v1.38.0 + # - uses: bufbuild/buf-breaking-action@v1 + # with: + # input: "proto" + # against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto" validate-check: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6cb7c483a5..1a095f78dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Publish Lava Release on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)?' + - 'v[0-9]+.[0-9]+.[0-9]+*' workflow_dispatch: inputs: release_tag: diff --git a/Makefile b/Makefile index 2380521d62..0d813507a1 100644 --- a/Makefile +++ b/Makefile @@ -193,10 +193,10 @@ ifeq (static,$(findstring static,$(LAVA_BUILD_OPTIONS))) endif ifeq (mask_consumer_logs,$(findstring mask_consumer_logs,$(LAVA_BUILD_OPTIONS))) - ldflags += -X github.com/lavanet/lava/v3/protocol/common.ReturnMaskedErrors=true + ldflags += -X github.com/lavanet/lava/v4/protocol/common.ReturnMaskedErrors=true endif ifeq (debug_mutex,$(findstring debug_mutex,$(LAVA_BUILD_OPTIONS))) - ldflags += -X github.com/lavanet/lava/v3/utils.TimeoutMutex=true + ldflags += -X github.com/lavanet/lava/v4/utils.TimeoutMutex=true endif ifeq (cleveldb,$(findstring cleveldb,$(LAVA_BUILD_OPTIONS))) @@ -207,12 +207,12 @@ endif ifeq (release,$(findstring release,$(LAVA_BUILD_OPTIONS))) $(info Building With Production Flag) - ldflags += -X github.com/lavanet/lava/v3/utils.ExtendedLogLevel=production + ldflags += -X github.com/lavanet/lava/v4/utils.ExtendedLogLevel=production endif ifeq (debug_payment_e2e,$(findstring debug_payment_e2e,$(LAVA_BUILD_OPTIONS))) $(info Building With Debug Payment E2E Flag. Making a month 2 minutes) - ldflags += -X github.com/lavanet/lava/v3/utils.DebugPaymentE2E=debug_payment_e2e + ldflags += -X github.com/lavanet/lava/v4/utils.DebugPaymentE2E=debug_payment_e2e endif ifeq (,$(findstring nostrip,$(LAVA_BUILD_OPTIONS))) diff --git a/app/ante.go b/app/ante.go index 4d8d1933b2..3291f11c59 100644 --- a/app/ante.go +++ b/app/ante.go @@ -5,10 +5,10 @@ import ( "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/v3/x/dualstaking/ante" - dualstakingkeeper "github.com/lavanet/lava/v3/x/dualstaking/keeper" - specante "github.com/lavanet/lava/v3/x/spec/ante" - "github.com/lavanet/lava/v3/x/spec/keeper" + dualstakingante "github.com/lavanet/lava/v4/x/dualstaking/ante" + dualstakingkeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" + specante "github.com/lavanet/lava/v4/x/spec/ante" + "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 { diff --git a/app/app.go b/app/app.go index 7297ef3b99..e9d1484547 100644 --- a/app/app.go +++ b/app/app.go @@ -15,13 +15,13 @@ import ( 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" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/fixationstore" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/timerstore" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/fixationstore" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/timerstore" + 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" @@ -113,48 +113,48 @@ import ( 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/lavanet/lava/v3/app/keepers" - appparams "github.com/lavanet/lava/v3/app/params" - "github.com/lavanet/lava/v3/app/upgrades" - "github.com/lavanet/lava/v3/docs" - conflictmodule "github.com/lavanet/lava/v3/x/conflict" - conflictmodulekeeper "github.com/lavanet/lava/v3/x/conflict/keeper" - conflictmoduletypes "github.com/lavanet/lava/v3/x/conflict/types" - downtimemodule "github.com/lavanet/lava/v3/x/downtime" - downtimemodulekeeper "github.com/lavanet/lava/v3/x/downtime/keeper" - downtimemoduletypes "github.com/lavanet/lava/v3/x/downtime/types" - dualstakingmodule "github.com/lavanet/lava/v3/x/dualstaking" - dualstakingmodulekeeper "github.com/lavanet/lava/v3/x/dualstaking/keeper" - dualstakingmoduletypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragemodule "github.com/lavanet/lava/v3/x/epochstorage" - epochstoragemodulekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - epochstoragemoduletypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingmodule "github.com/lavanet/lava/v3/x/pairing" - pairingmoduleclient "github.com/lavanet/lava/v3/x/pairing/client" - pairingmodulekeeper "github.com/lavanet/lava/v3/x/pairing/keeper" - pairingmoduletypes "github.com/lavanet/lava/v3/x/pairing/types" - plansmodule "github.com/lavanet/lava/v3/x/plans" - plansmoduleclient "github.com/lavanet/lava/v3/x/plans/client" - plansmodulekeeper "github.com/lavanet/lava/v3/x/plans/keeper" - plansmoduletypes "github.com/lavanet/lava/v3/x/plans/types" - projectsmodule "github.com/lavanet/lava/v3/x/projects" - projectsmodulekeeper "github.com/lavanet/lava/v3/x/projects/keeper" - projectsmoduletypes "github.com/lavanet/lava/v3/x/projects/types" - protocolmodule "github.com/lavanet/lava/v3/x/protocol" - protocolmoduleclient "github.com/lavanet/lava/v3/x/protocol/client/cli" - protocolmodulekeeper "github.com/lavanet/lava/v3/x/protocol/keeper" - protocolmoduletypes "github.com/lavanet/lava/v3/x/protocol/types" - rewardsmodule "github.com/lavanet/lava/v3/x/rewards" - rewardsmoduleclient "github.com/lavanet/lava/v3/x/rewards/client/cli" - rewardsmodulekeeper "github.com/lavanet/lava/v3/x/rewards/keeper" - rewardsmoduletypes "github.com/lavanet/lava/v3/x/rewards/types" - specmodule "github.com/lavanet/lava/v3/x/spec" - specmoduleclient "github.com/lavanet/lava/v3/x/spec/client" - specmodulekeeper "github.com/lavanet/lava/v3/x/spec/keeper" - specmoduletypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptionmodule "github.com/lavanet/lava/v3/x/subscription" - subscriptionmodulekeeper "github.com/lavanet/lava/v3/x/subscription/keeper" - subscriptionmoduletypes "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/app/keepers" + appparams "github.com/lavanet/lava/v4/app/params" + "github.com/lavanet/lava/v4/app/upgrades" + "github.com/lavanet/lava/v4/docs" + conflictmodule "github.com/lavanet/lava/v4/x/conflict" + conflictmodulekeeper "github.com/lavanet/lava/v4/x/conflict/keeper" + conflictmoduletypes "github.com/lavanet/lava/v4/x/conflict/types" + downtimemodule "github.com/lavanet/lava/v4/x/downtime" + downtimemodulekeeper "github.com/lavanet/lava/v4/x/downtime/keeper" + downtimemoduletypes "github.com/lavanet/lava/v4/x/downtime/types" + dualstakingmodule "github.com/lavanet/lava/v4/x/dualstaking" + dualstakingmodulekeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" + dualstakingmoduletypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragemodule "github.com/lavanet/lava/v4/x/epochstorage" + epochstoragemodulekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + epochstoragemoduletypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingmodule "github.com/lavanet/lava/v4/x/pairing" + pairingmoduleclient "github.com/lavanet/lava/v4/x/pairing/client" + pairingmodulekeeper "github.com/lavanet/lava/v4/x/pairing/keeper" + pairingmoduletypes "github.com/lavanet/lava/v4/x/pairing/types" + plansmodule "github.com/lavanet/lava/v4/x/plans" + plansmoduleclient "github.com/lavanet/lava/v4/x/plans/client" + plansmodulekeeper "github.com/lavanet/lava/v4/x/plans/keeper" + plansmoduletypes "github.com/lavanet/lava/v4/x/plans/types" + projectsmodule "github.com/lavanet/lava/v4/x/projects" + projectsmodulekeeper "github.com/lavanet/lava/v4/x/projects/keeper" + projectsmoduletypes "github.com/lavanet/lava/v4/x/projects/types" + protocolmodule "github.com/lavanet/lava/v4/x/protocol" + protocolmoduleclient "github.com/lavanet/lava/v4/x/protocol/client/cli" + protocolmodulekeeper "github.com/lavanet/lava/v4/x/protocol/keeper" + protocolmoduletypes "github.com/lavanet/lava/v4/x/protocol/types" + rewardsmodule "github.com/lavanet/lava/v4/x/rewards" + rewardsmoduleclient "github.com/lavanet/lava/v4/x/rewards/client/cli" + rewardsmodulekeeper "github.com/lavanet/lava/v4/x/rewards/keeper" + rewardsmoduletypes "github.com/lavanet/lava/v4/x/rewards/types" + specmodule "github.com/lavanet/lava/v4/x/spec" + specmoduleclient "github.com/lavanet/lava/v4/x/spec/client" + specmodulekeeper "github.com/lavanet/lava/v4/x/spec/keeper" + specmoduletypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptionmodule "github.com/lavanet/lava/v4/x/subscription" + subscriptionmodulekeeper "github.com/lavanet/lava/v4/x/subscription/keeper" + subscriptionmoduletypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cast" // this line is used by starport scaffolding # stargate/app/moduleImport ) @@ -166,43 +166,8 @@ const ( // Upgrades add here future upgrades (upgrades.Upgrade) var Upgrades = []upgrades.Upgrade{ - upgrades.Upgrade_0_22_0, - upgrades.Upgrade_0_23_0, - upgrades.Upgrade_0_23_2, - upgrades.Upgrade_0_23_4, - upgrades.Upgrade_0_23_5, - upgrades.Upgrade_0_24_0, - upgrades.Upgrade_0_25_0, - upgrades.Upgrade_0_25_1, - upgrades.Upgrade_0_25_2, - upgrades.Upgrade_0_26_0, - upgrades.Upgrade_0_26_1, - upgrades.Upgrade_0_26_2, - upgrades.Upgrade_0_27_0, - upgrades.Upgrade_0_30_0, - upgrades.Upgrade_0_30_1, - upgrades.Upgrade_0_30_2, - upgrades.Upgrade_0_31_0, - upgrades.Upgrade_0_31_1, - upgrades.Upgrade_0_32_0, - upgrades.Upgrade_0_32_3, - upgrades.Upgrade_0_33_0, - upgrades.Upgrade_0_34_0, - upgrades.Upgrade_0_35_0, - upgrades.Upgrade_1_0_0, - upgrades.Upgrade_1_0_1, - upgrades.Upgrade_1_1_0, - upgrades.Upgrade_1_2_0, - upgrades.Upgrade_2_0_0, - upgrades.Upgrade_2_1_0, - upgrades.Upgrade_2_1_1, - upgrades.Upgrade_2_1_3, - upgrades.Upgrade_2_2_0, - upgrades.Upgrade_2_4_0, - upgrades.Upgrade_2_5_0, - upgrades.Upgrade_3_0_0, - upgrades.Upgrade_3_0_1, upgrades.Upgrade_3_1_0, + upgrades.Upgrade_4_0_0, } // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals diff --git a/app/encoding.go b/app/encoding.go index efbddbc411..2e2d4ef0a5 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/x/auth/tx" - "github.com/lavanet/lava/v3/app/params" + "github.com/lavanet/lava/v4/app/params" ) // makeEncodingConfig creates an EncodingConfig for an amino based test configuration. diff --git a/app/keepers/lavaKeepers.go b/app/keepers/lavaKeepers.go index 32a47e57e5..e9e7ff3123 100644 --- a/app/keepers/lavaKeepers.go +++ b/app/keepers/lavaKeepers.go @@ -20,19 +20,19 @@ import ( 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" - conflictmodulekeeper "github.com/lavanet/lava/v3/x/conflict/keeper" - downtimemodulekeeper "github.com/lavanet/lava/v3/x/downtime/keeper" - dualstakingmodulekeeper "github.com/lavanet/lava/v3/x/dualstaking/keeper" - epochstoragemodulekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - pairingmodulekeeper "github.com/lavanet/lava/v3/x/pairing/keeper" - plansmodulekeeper "github.com/lavanet/lava/v3/x/plans/keeper" - projectsmodulekeeper "github.com/lavanet/lava/v3/x/projects/keeper" - protocolmodulekeeper "github.com/lavanet/lava/v3/x/protocol/keeper" - rewardsmodulekeeper "github.com/lavanet/lava/v3/x/rewards/keeper" - specmodulekeeper "github.com/lavanet/lava/v3/x/spec/keeper" - subscriptionmodulekeeper "github.com/lavanet/lava/v3/x/subscription/keeper" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/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" + epochstoragemodulekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + pairingmodulekeeper "github.com/lavanet/lava/v4/x/pairing/keeper" + plansmodulekeeper "github.com/lavanet/lava/v4/x/plans/keeper" + projectsmodulekeeper "github.com/lavanet/lava/v4/x/projects/keeper" + protocolmodulekeeper "github.com/lavanet/lava/v4/x/protocol/keeper" + rewardsmodulekeeper "github.com/lavanet/lava/v4/x/rewards/keeper" + specmodulekeeper "github.com/lavanet/lava/v4/x/spec/keeper" + subscriptionmodulekeeper "github.com/lavanet/lava/v4/x/subscription/keeper" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" // this line is used by starport scaffolding # stargate/app/moduleImport ) diff --git a/app/simulation_test.go b/app/simulation_test.go index 8d7e60fb77..73fb5dc02f 100644 --- a/app/simulation_test.go +++ b/app/simulation_test.go @@ -13,7 +13,7 @@ import ( "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/v3/app" + "github.com/lavanet/lava/v4/app" "github.com/stretchr/testify/require" ) diff --git a/app/upgrades/empty_upgrades.go b/app/upgrades/empty_upgrades.go index 348fd31622..0a4ad8ec05 100644 --- a/app/upgrades/empty_upgrades.go +++ b/app/upgrades/empty_upgrades.go @@ -4,19 +4,8 @@ import ( store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - "github.com/cosmos/cosmos-sdk/x/group" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/lavanet/lava/v3/app/keepers" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/app/keepers" ) func defaultUpgradeHandler( @@ -45,258 +34,20 @@ func defaultUpgradeHandler( // }, // } -var Upgrade_0_22_0 = Upgrade{ - UpgradeName: "v0.22.0", - CreateUpgradeHandler: v0_22_0_UpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -func v0_22_0_UpgradeHandler( - m *module.Manager, - c module.Configurator, - bapm BaseAppParamManager, - lk *keepers.LavaKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - lk.DowntimeKeeper.SetParams(ctx, v1.DefaultParams()) - lk.ProtocolKeeper.SetParams(ctx, protocoltypes.DefaultParams()) - return m.RunMigrations(ctx, c, vm) - } -} - -var Upgrade_0_23_0 = Upgrade{ - UpgradeName: "v0.23.0", - CreateUpgradeHandler: v0_23_0_UpgradeHandler, - StoreUpgrades: store.StoreUpgrades{Added: []string{dualstakingtypes.StoreKey}}, -} - -func v0_23_0_UpgradeHandler( - m *module.Manager, - c module.Configurator, - bapm BaseAppParamManager, - lk *keepers.LavaKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - lk.PairingKeeper.InitProviderQoS(ctx, *fixationtypes.DefaultGenesis()) - return m.RunMigrations(ctx, c, vm) - } -} - -var Upgrade_0_23_2 = Upgrade{ - UpgradeName: "v0.23.2", // upgrade name - CreateUpgradeHandler: defaultUpgradeHandler, // upgrade handler (default) - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_23_4 = Upgrade{ - UpgradeName: "v0.23.4", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_23_5 = Upgrade{ - UpgradeName: "v0.23.5", - CreateUpgradeHandler: v0_23_0_UpgradeHandler, - StoreUpgrades: store.StoreUpgrades{Added: []string{dualstakingtypes.StoreKey}}, -} - -var Upgrade_0_24_0 = Upgrade{ - UpgradeName: "v0.24.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_25_0 = Upgrade{ - UpgradeName: "v0.25.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_25_1 = Upgrade{ - UpgradeName: "v0.25.1", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_25_2 = Upgrade{ - UpgradeName: "v0.25.2", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_26_0 = Upgrade{ - UpgradeName: "v0.26.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_26_1 = Upgrade{ - UpgradeName: "v0.26.1", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_26_2 = Upgrade{ - UpgradeName: "v0.26.2", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_27_0 = Upgrade{ - UpgradeName: "v0.27.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_30_0 = Upgrade{ - UpgradeName: "v0.30.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_30_1 = Upgrade{ - UpgradeName: "v0.30.1", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_30_2 = Upgrade{ - UpgradeName: "v0.30.2", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_31_0 = Upgrade{ - UpgradeName: "v0.31.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_31_1 = Upgrade{ - UpgradeName: "v0.31.1", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_32_0 = Upgrade{ - UpgradeName: "v0.32.0", - CreateUpgradeHandler: v0_32_0_UpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{rewardstypes.StoreKey}, - Deleted: []string{minttypes.StoreKey}, - }, -} - -var Upgrade_0_32_3 = Upgrade{ - UpgradeName: "v0.32.3", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_33_0 = Upgrade{ - UpgradeName: "v0.33.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_0_34_0 = Upgrade{ - UpgradeName: "v0.34.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{icahosttypes.StoreKey, icacontrollertypes.StoreKey}, - }, -} - -var Upgrade_0_35_0 = Upgrade{ - UpgradeName: "v0.35.0", - CreateUpgradeHandler: v_35_0, - StoreUpgrades: store.StoreUpgrades{Added: []string{authzkeeper.StoreKey, group.StoreKey}}, -} - -var Upgrade_1_0_0 = Upgrade{ - UpgradeName: "v1.0.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_1_0_1 = Upgrade{ - UpgradeName: "v1.0.1", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_1_1_0 = Upgrade{ - UpgradeName: "v1.1.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_1_2_0 = Upgrade{ - UpgradeName: "v1.2.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_2_0_0 = Upgrade{ - UpgradeName: "v2.0.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{packetforwardtypes.StoreKey}, - }, -} - -var Upgrade_2_1_0 = Upgrade{ - UpgradeName: "v2.1.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_2_1_1 = Upgrade{ - UpgradeName: "v2.1.1", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_2_1_3 = Upgrade{ - UpgradeName: "v2.1.3", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_2_2_0 = Upgrade{ - UpgradeName: "v2.2.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{packetforwardtypes.StoreKey}, - }, -} - -var Upgrade_2_4_0 = Upgrade{ - UpgradeName: "v2.4.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_2_5_0 = Upgrade{ - UpgradeName: "v2.5.0", - CreateUpgradeHandler: defaultUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} - -var Upgrade_3_0_0 = Upgrade{ - UpgradeName: "v3.0.0", +var Upgrade_3_1_0 = Upgrade{ + UpgradeName: "v3.1.0", CreateUpgradeHandler: defaultUpgradeHandler, StoreUpgrades: store.StoreUpgrades{}, } -var Upgrade_3_0_1 = Upgrade{ - UpgradeName: "v3.0.1", +var Upgrade_3_2_0 = Upgrade{ + UpgradeName: "v3.2.0", CreateUpgradeHandler: defaultUpgradeHandler, StoreUpgrades: store.StoreUpgrades{}, } -var Upgrade_3_1_0 = Upgrade{ - UpgradeName: "v3.1.0", +var Upgrade_4_0_0 = Upgrade{ + UpgradeName: "v4.0.0", CreateUpgradeHandler: defaultUpgradeHandler, StoreUpgrades: store.StoreUpgrades{}, } diff --git a/app/upgrades/types.go b/app/upgrades/types.go index ae8bea3dbf..3120ddc6c8 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -6,7 +6,7 @@ import ( 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/v3/app/keepers" + "github.com/lavanet/lava/v4/app/keepers" ) type BaseAppParamManager interface { diff --git a/app/upgrades/upgrade_0_32_0.go b/app/upgrades/upgrade_0_32_0.go deleted file mode 100644 index 79eb7971c8..0000000000 --- a/app/upgrades/upgrade_0_32_0.go +++ /dev/null @@ -1,69 +0,0 @@ -package upgrades - -import ( - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/bank/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/lavanet/lava/v3/app/keepers" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" -) - -func v0_32_0_UpgradeHandler( - m *module.Manager, - c module.Configurator, - bapm BaseAppParamManager, - lk *keepers.LavaKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - // rewards pool - totalSupply, err := lk.BankKeeper.TotalSupply(ctx, &types.QueryTotalSupplyRequest{}) - if err != nil { - return nil, err - } - allocate := totalSupply.Supply.QuoInt(sdk.NewIntFromUint64(33)) - err = lk.BankKeeper.MintCoins(ctx, string(rewardstypes.ValidatorsRewardsAllocationPoolName), allocate) - if err != nil { - return nil, err - } - err = lk.BankKeeper.MintCoins(ctx, string(rewardstypes.ProvidersRewardsAllocationPool), allocate) - if err != nil { - return nil, err - } - - rewards := lk.DualstakingKeeper.GetAllDelegatorReward(ctx) - for _, reward := range rewards { - lk.DualstakingKeeper.RemoveDelegatorReward(ctx, dualstakingtypes.DelegationKey(reward.Provider, reward.Delegator, reward.ChainId)) - } - rewards = lk.DualstakingKeeper.GetAllDelegatorReward(ctx) - if len(rewards) != 0 { - return nil, fmt.Errorf("v0.32.0 UpgradeHandler: did not delete all rewards") - } - - // expedited proposal - // deposit - params := lk.GovKeeper.GetParams(ctx) - params.ExpeditedMinDeposit = append(params.ExpeditedMinDeposit, params.MinDeposit[0].AddAmount(sdk.NewIntFromUint64(1000))) - - // tally - params.ExpeditedThreshold = "0.75" - - // voting - seconds := params.VotingPeriod.Nanoseconds() - duration := time.Duration(seconds/10) * time.Nanosecond - params.ExpeditedVotingPeriod = &duration - - if err = params.ValidateBasic(); err != nil { - return nil, err - } - - if err := lk.GovKeeper.SetParams(ctx, params); err != nil { - return nil, err - } - return m.RunMigrations(ctx, c, vm) - } -} diff --git a/app/upgrades/upgrade_0_35_0.go b/app/upgrades/upgrade_0_35_0.go index c468fe9c27..76ebe64cf6 100644 --- a/app/upgrades/upgrade_0_35_0.go +++ b/app/upgrades/upgrade_0_35_0.go @@ -6,9 +6,9 @@ import ( 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" - "github.com/lavanet/lava/v3/app/keepers" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/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" ) func v_35_0( diff --git a/cmd/common/warning_log_command_wrapper.go b/cmd/common/warning_log_command_wrapper.go index 277bc107c9..2598fca776 100644 --- a/cmd/common/warning_log_command_wrapper.go +++ b/cmd/common/warning_log_command_wrapper.go @@ -1,7 +1,7 @@ package common import ( - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/spf13/cobra" ) diff --git a/cmd/lavad/cmd/config.go b/cmd/lavad/cmd/config.go index 2e01650e2f..fadda3af4a 100644 --- a/cmd/lavad/cmd/config.go +++ b/cmd/lavad/cmd/config.go @@ -3,7 +3,7 @@ package cmd import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/app" + "github.com/lavanet/lava/v4/app" ) func InitSDKConfig() { diff --git a/cmd/lavad/cmd/root.go b/cmd/lavad/cmd/root.go index c24111464d..24845d6302 100644 --- a/cmd/lavad/cmd/root.go +++ b/cmd/lavad/cmd/root.go @@ -34,17 +34,17 @@ import ( 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" - cmdcommon "github.com/lavanet/lava/v3/cmd/common" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + cmdcommon "github.com/lavanet/lava/v4/cmd/common" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/pflag" // this line is used by starport scaffolding # root/moduleImport - "github.com/lavanet/lava/v3/app" - appparams "github.com/lavanet/lava/v3/app/params" + "github.com/lavanet/lava/v4/app" + appparams "github.com/lavanet/lava/v4/app/params" ) // NewRootCmd creates a new root command for a Cosmos SDK application diff --git a/cmd/lavad/main.go b/cmd/lavad/main.go index a1c3488b60..922fc26361 100644 --- a/cmd/lavad/main.go +++ b/cmd/lavad/main.go @@ -8,14 +8,14 @@ import ( "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/v3/app" - cmdcommon "github.com/lavanet/lava/v3/cmd/common" - "github.com/lavanet/lava/v3/cmd/lavad/cmd" - "github.com/lavanet/lava/v3/protocol/badgegenerator" - "github.com/lavanet/lava/v3/protocol/rpcconsumer" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/protocol/statetracker" - utilscli "github.com/lavanet/lava/v3/utils/cli" + "github.com/lavanet/lava/v4/app" + cmdcommon "github.com/lavanet/lava/v4/cmd/common" + "github.com/lavanet/lava/v4/cmd/lavad/cmd" + "github.com/lavanet/lava/v4/protocol/badgegenerator" + "github.com/lavanet/lava/v4/protocol/rpcconsumer" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/protocol/statetracker" + utilscli "github.com/lavanet/lava/v4/utils/cli" "github.com/spf13/cobra" ) diff --git a/cmd/lavap/main.go b/cmd/lavap/main.go index c6eaaba8e0..03feb9efda 100644 --- a/cmd/lavap/main.go +++ b/cmd/lavap/main.go @@ -9,19 +9,19 @@ import ( "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/v3/app" - "github.com/lavanet/lava/v3/cmd/lavad/cmd" - "github.com/lavanet/lava/v3/ecosystem/cache" - "github.com/lavanet/lava/v3/protocol/badgegenerator" - "github.com/lavanet/lava/v3/protocol/badgeserver" - "github.com/lavanet/lava/v3/protocol/loadtest" - "github.com/lavanet/lava/v3/protocol/monitoring" - "github.com/lavanet/lava/v3/protocol/performance/connection" - validators "github.com/lavanet/lava/v3/protocol/performance/validators" - "github.com/lavanet/lava/v3/protocol/rpcconsumer" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/protocol/statetracker" - "github.com/lavanet/lava/v3/protocol/upgrade" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/cmd/lavad/cmd" + "github.com/lavanet/lava/v4/ecosystem/cache" + "github.com/lavanet/lava/v4/protocol/badgegenerator" + "github.com/lavanet/lava/v4/protocol/badgeserver" + "github.com/lavanet/lava/v4/protocol/loadtest" + "github.com/lavanet/lava/v4/protocol/monitoring" + "github.com/lavanet/lava/v4/protocol/performance/connection" + validators "github.com/lavanet/lava/v4/protocol/performance/validators" + "github.com/lavanet/lava/v4/protocol/rpcconsumer" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/protocol/statetracker" + "github.com/lavanet/lava/v4/protocol/upgrade" "github.com/spf13/cobra" ) diff --git a/cmd/lavavisor/main.go b/cmd/lavavisor/main.go index ff18141ac2..93895f0b72 100644 --- a/cmd/lavavisor/main.go +++ b/cmd/lavavisor/main.go @@ -6,10 +6,10 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/cmd/lavad/cmd" - lvcmd "github.com/lavanet/lava/v3/ecosystem/lavavisor/cmd" - "github.com/lavanet/lava/v3/protocol/upgrade" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/cmd/lavad/cmd" + lvcmd "github.com/lavanet/lava/v4/ecosystem/lavavisor/cmd" + "github.com/lavanet/lava/v4/protocol/upgrade" "github.com/spf13/cobra" ) diff --git a/cookbook/specs/ethereum.json b/cookbook/specs/ethereum.json index c16b30a64a..f64a71046b 100644 --- a/cookbook/specs/ethereum.json +++ b/cookbook/specs/ethereum.json @@ -1501,6 +1501,7 @@ "blocks_in_finalization_proof": 3, "average_block_time": 13000, "allowed_block_lag_for_qos_sync": 2, + "shares": 1, "min_stake_provider": { "denom": "ulava", "amount": "47500000000" @@ -1544,6 +1545,7 @@ "blocks_in_finalization_proof": 3, "average_block_time": 13000, "allowed_block_lag_for_qos_sync": 2, + "shares": 1, "min_stake_provider": { "denom": "ulava", "amount": "47500000000" diff --git a/cookbook/specs/lava.json b/cookbook/specs/lava.json index f127039ea4..a833151b52 100644 --- a/cookbook/specs/lava.json +++ b/cookbook/specs/lava.json @@ -1456,6 +1456,42 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/estimated_provider_rewards/{provider}/{amount_delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/epochstorage/provider_metadata/{provider}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], @@ -2888,6 +2924,42 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.epochstorage.Query/ProviderMetaData", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/EstimatedProviderRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], diff --git a/cookbook/specs/lava_mainnet.json b/cookbook/specs/lava_mainnet.json index 403bb183d9..465c52cba3 100644 --- a/cookbook/specs/lava_mainnet.json +++ b/cookbook/specs/lava_mainnet.json @@ -1438,6 +1438,42 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/epochstorage/provider_metadata/{provider}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/estimated_provider_rewards/{provider}/{amount_delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], @@ -2852,6 +2888,42 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/EstimatedProviderRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.epochstorage.Query/ProviderMetaData", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], diff --git a/ecosystem/cache/cache_test.go b/ecosystem/cache/cache_test.go index f65ccbfee2..e274628c16 100644 --- a/ecosystem/cache/cache_test.go +++ b/ecosystem/cache/cache_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/ecosystem/cache" - "github.com/lavanet/lava/v3/ecosystem/cache/format" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/ecosystem/cache" + "github.com/lavanet/lava/v4/ecosystem/cache/format" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" "github.com/tidwall/gjson" ) diff --git a/ecosystem/cache/command.go b/ecosystem/cache/command.go index ae95ff35dc..5742d8ec0e 100644 --- a/ecosystem/cache/command.go +++ b/ecosystem/cache/command.go @@ -3,7 +3,7 @@ package cache import ( "context" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/rs/zerolog" "github.com/spf13/cobra" ) diff --git a/ecosystem/cache/format/formatter.go b/ecosystem/cache/format/formatter.go index ec84b0281c..9689ad2bb7 100644 --- a/ecosystem/cache/format/formatter.go +++ b/ecosystem/cache/format/formatter.go @@ -1,7 +1,7 @@ package format import ( - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) // input formatter works on the input data diff --git a/ecosystem/cache/format/formatter_test.go b/ecosystem/cache/format/formatter_test.go index 8672a5e412..5877a54662 100644 --- a/ecosystem/cache/format/formatter_test.go +++ b/ecosystem/cache/format/formatter_test.go @@ -3,7 +3,7 @@ package format import ( "testing" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/ecosystem/cache/format/jsonrpc.go b/ecosystem/cache/format/jsonrpc.go index f01a363ba9..4d22c8f01c 100644 --- a/ecosystem/cache/format/jsonrpc.go +++ b/ecosystem/cache/format/jsonrpc.go @@ -3,7 +3,7 @@ package format import ( "encoding/json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/tidwall/gjson" "github.com/tidwall/sjson" ) diff --git a/ecosystem/cache/handlers.go b/ecosystem/cache/handlers.go index c3f09ab260..248225c168 100644 --- a/ecosystem/cache/handlers.go +++ b/ecosystem/cache/handlers.go @@ -13,12 +13,12 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" emptypb "google.golang.org/protobuf/types/known/emptypb" ) diff --git a/ecosystem/cache/metrics.go b/ecosystem/cache/metrics.go index 5f716f1536..0effe943ca 100644 --- a/ecosystem/cache/metrics.go +++ b/ecosystem/cache/metrics.go @@ -4,8 +4,8 @@ import ( "net/http" "sync" - "github.com/lavanet/lava/v3/utils" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/ecosystem/cache/server.go b/ecosystem/cache/server.go index fd867b303c..73e9037902 100644 --- a/ecosystem/cache/server.go +++ b/ecosystem/cache/server.go @@ -11,13 +11,13 @@ import ( "syscall" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/utils/lavaslices" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/utils/lavaslices" "github.com/dgraph-io/ristretto" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/pflag" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" diff --git a/ecosystem/lavavisor/cmd/create-service.go b/ecosystem/lavavisor/cmd/create-service.go index b37aa7729a..d72e08a3d0 100644 --- a/ecosystem/lavavisor/cmd/create-service.go +++ b/ecosystem/lavavisor/cmd/create-service.go @@ -9,12 +9,12 @@ import ( "strings" "github.com/cosmos/cosmos-sdk/client/flags" - processmanager "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/process" - lvutil "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" + processmanager "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/process" + lvutil "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/ecosystem/lavavisor/cmd/init.go b/ecosystem/lavavisor/cmd/init.go index 9b245e9552..8c38b669a0 100644 --- a/ecosystem/lavavisor/cmd/init.go +++ b/ecosystem/lavavisor/cmd/init.go @@ -7,11 +7,11 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/app" - processmanager "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/state" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/app" + processmanager "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/state" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/utils" "github.com/spf13/cobra" ) diff --git a/ecosystem/lavavisor/cmd/pod.go b/ecosystem/lavavisor/cmd/pod.go index 0293b5db60..320f0328d3 100644 --- a/ecosystem/lavavisor/cmd/pod.go +++ b/ecosystem/lavavisor/cmd/pod.go @@ -8,12 +8,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/app" - processmanager "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/state" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/app" + processmanager "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/state" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" "github.com/spf13/cobra" ) diff --git a/ecosystem/lavavisor/cmd/start.go b/ecosystem/lavavisor/cmd/start.go index b9f53c498f..7533a24e97 100644 --- a/ecosystem/lavavisor/cmd/start.go +++ b/ecosystem/lavavisor/cmd/start.go @@ -14,16 +14,16 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/app" - processmanager "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/state" - lvutil "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/v3/utils/rand" - - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/app" + processmanager "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/state" + lvutil "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v4/utils/rand" + + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) diff --git a/ecosystem/lavavisor/cmd/wrap.go b/ecosystem/lavavisor/cmd/wrap.go index 3787ede0bb..f817a94d02 100644 --- a/ecosystem/lavavisor/cmd/wrap.go +++ b/ecosystem/lavavisor/cmd/wrap.go @@ -8,12 +8,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/app" - processmanager "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/state" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/app" + processmanager "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/state" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" "github.com/spf13/cobra" "golang.org/x/term" ) diff --git a/ecosystem/lavavisor/pkg/process/fetcher.go b/ecosystem/lavavisor/pkg/process/fetcher.go index c209d2f114..8846f28b09 100644 --- a/ecosystem/lavavisor/pkg/process/fetcher.go +++ b/ecosystem/lavavisor/pkg/process/fetcher.go @@ -10,9 +10,9 @@ import ( "runtime" "strings" - lvutil "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + lvutil "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) type ProtocolBinaryFetcher struct { diff --git a/ecosystem/lavavisor/pkg/process/fetcher_without_build.go b/ecosystem/lavavisor/pkg/process/fetcher_without_build.go index 2b066e968d..3eddc5896c 100644 --- a/ecosystem/lavavisor/pkg/process/fetcher_without_build.go +++ b/ecosystem/lavavisor/pkg/process/fetcher_without_build.go @@ -7,9 +7,9 @@ import ( "os" "path/filepath" - lvutil "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + lvutil "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) type ProtocolBinaryFetcherWithoutBuild struct { diff --git a/ecosystem/lavavisor/pkg/process/linker.go b/ecosystem/lavavisor/pkg/process/linker.go index a456089821..122c3fc809 100644 --- a/ecosystem/lavavisor/pkg/process/linker.go +++ b/ecosystem/lavavisor/pkg/process/linker.go @@ -5,7 +5,7 @@ import ( "os/exec" "strings" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) // TODOs: diff --git a/ecosystem/lavavisor/pkg/process/process_manager.go b/ecosystem/lavavisor/pkg/process/process_manager.go index 59eb3d398f..240f0a7ebf 100644 --- a/ecosystem/lavavisor/pkg/process/process_manager.go +++ b/ecosystem/lavavisor/pkg/process/process_manager.go @@ -7,9 +7,9 @@ import ( "os/user" "strings" - protocolVersion "github.com/lavanet/lava/v3/protocol/upgrade" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + protocolVersion "github.com/lavanet/lava/v4/protocol/upgrade" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) func ReloadDaemon() error { diff --git a/ecosystem/lavavisor/pkg/process/version_monitor.go b/ecosystem/lavavisor/pkg/process/version_monitor.go index dca8941d54..417327925d 100644 --- a/ecosystem/lavavisor/pkg/process/version_monitor.go +++ b/ecosystem/lavavisor/pkg/process/version_monitor.go @@ -12,10 +12,10 @@ import ( "syscall" "time" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) type ProtocolBinaryFetcherInf interface { diff --git a/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go b/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go index 935ca00f4c..b460d47b5e 100644 --- a/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go +++ b/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go @@ -6,12 +6,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/statetracker" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/statetracker" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) // Lava visor doesn't require complicated state tracker, it just needs to periodically fetch the protocol version. diff --git a/ecosystem/lavavisor/pkg/util/common.go b/ecosystem/lavavisor/pkg/util/common.go index bcc0b443ff..3cbc41fae1 100644 --- a/ecosystem/lavavisor/pkg/util/common.go +++ b/ecosystem/lavavisor/pkg/util/common.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) func ExpandTilde(path string) (string, error) { diff --git a/go.mod b/go.mod index 82fc25f95b..0bf47fc345 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/lavanet/lava/v3 +module github.com/lavanet/lava/v4 go 1.20 diff --git a/proto/lavanet/lava/conflict/conflict_data.proto b/proto/lavanet/lava/conflict/conflict_data.proto index a15fba9517..7e8f3a5fb9 100644 --- a/proto/lavanet/lava/conflict/conflict_data.proto +++ b/proto/lavanet/lava/conflict/conflict_data.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.conflict; -option go_package = "github.com/lavanet/lava/v3/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v4/x/conflict/types"; import "gogoproto/gogo.proto"; import "lavanet/lava/pairing/relay.proto"; diff --git a/proto/lavanet/lava/conflict/conflict_vote.proto b/proto/lavanet/lava/conflict/conflict_vote.proto index b8a987b5c7..0ab7e767a6 100644 --- a/proto/lavanet/lava/conflict/conflict_vote.proto +++ b/proto/lavanet/lava/conflict/conflict_vote.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.conflict; -option go_package = "github.com/lavanet/lava/v3/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v4/x/conflict/types"; import "gogoproto/gogo.proto"; message Provider { diff --git a/proto/lavanet/lava/conflict/genesis.proto b/proto/lavanet/lava/conflict/genesis.proto index 8f23c09249..f33663387e 100644 --- a/proto/lavanet/lava/conflict/genesis.proto +++ b/proto/lavanet/lava/conflict/genesis.proto @@ -6,7 +6,7 @@ import "lavanet/lava/conflict/params.proto"; import "lavanet/lava/conflict/conflict_vote.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v4/x/conflict/types"; // GenesisState defines the conflict module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/conflict/params.proto b/proto/lavanet/lava/conflict/params.proto index 1c72ac1f73..3b0193eba2 100644 --- a/proto/lavanet/lava/conflict/params.proto +++ b/proto/lavanet/lava/conflict/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.conflict; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v4/x/conflict/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/conflict/query.proto b/proto/lavanet/lava/conflict/query.proto index 981464852f..be1e7bd62d 100644 --- a/proto/lavanet/lava/conflict/query.proto +++ b/proto/lavanet/lava/conflict/query.proto @@ -8,7 +8,7 @@ import "lavanet/lava/conflict/conflict_vote.proto"; // this line is used by starport scaffolding # 1 import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v4/x/conflict/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/conflict/tx.proto b/proto/lavanet/lava/conflict/tx.proto index 275283d6b3..3fd86dcc8b 100644 --- a/proto/lavanet/lava/conflict/tx.proto +++ b/proto/lavanet/lava/conflict/tx.proto @@ -6,7 +6,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "lavanet/lava/conflict/conflict_data.proto"; -option go_package = "github.com/lavanet/lava/v3/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v4/x/conflict/types"; // Msg defines the Msg service. diff --git a/proto/lavanet/lava/downtime/v1/downtime.proto b/proto/lavanet/lava/downtime/v1/downtime.proto index a38fc4d948..9a1e961f5a 100644 --- a/proto/lavanet/lava/downtime/v1/downtime.proto +++ b/proto/lavanet/lava/downtime/v1/downtime.proto @@ -2,7 +2,7 @@ syntax="proto3"; package lavanet.lava.downtime.v1; -option go_package = "github.com/lavanet/lava/v3/x/downtime/v1"; +option go_package = "github.com/lavanet/lava/v4/x/downtime/v1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/lavanet/lava/downtime/v1/genesis.proto b/proto/lavanet/lava/downtime/v1/genesis.proto index cce5ce9c60..05b665a40e 100644 --- a/proto/lavanet/lava/downtime/v1/genesis.proto +++ b/proto/lavanet/lava/downtime/v1/genesis.proto @@ -2,7 +2,7 @@ syntax="proto3"; package lavanet.lava.downtime.v1; -option go_package = "github.com/lavanet/lava/v3/x/downtime/v1"; +option go_package = "github.com/lavanet/lava/v4/x/downtime/v1"; import "lavanet/lava/downtime/v1/downtime.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/lavanet/lava/downtime/v1/query.proto b/proto/lavanet/lava/downtime/v1/query.proto index a868c1ee9d..f456f2058e 100644 --- a/proto/lavanet/lava/downtime/v1/query.proto +++ b/proto/lavanet/lava/downtime/v1/query.proto @@ -2,7 +2,7 @@ syntax="proto3"; package lavanet.lava.downtime.v1; -option go_package = "github.com/lavanet/lava/v3/x/downtime/v1"; +option go_package = "github.com/lavanet/lava/v4/x/downtime/v1"; import "google/protobuf/duration.proto"; import "lavanet/lava/downtime/v1/downtime.proto"; diff --git a/proto/lavanet/lava/dualstaking/delegate.proto b/proto/lavanet/lava/dualstaking/delegate.proto index ea0d3986f1..70761df8ea 100644 --- a/proto/lavanet/lava/dualstaking/delegate.proto +++ b/proto/lavanet/lava/dualstaking/delegate.proto @@ -1,14 +1,14 @@ syntax = "proto3"; package lavanet.lava.dualstaking; -option go_package = "github.com/lavanet/lava/v3/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; message Delegation { + reserved 2; string provider = 1; // provider receives the delegated funds - string chainID = 2; // chainID to which staking delegate funds string delegator = 3; // delegator that owns the delegated funds cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; int64 timestamp = 5; // Unix timestamp of the delegation (+ month) diff --git a/proto/lavanet/lava/dualstaking/delegator_reward.proto b/proto/lavanet/lava/dualstaking/delegator_reward.proto index 1145cf685e..3d77a8f2c1 100644 --- a/proto/lavanet/lava/dualstaking/delegator_reward.proto +++ b/proto/lavanet/lava/dualstaking/delegator_reward.proto @@ -1,15 +1,15 @@ syntax = "proto3"; package lavanet.lava.dualstaking; -option go_package = "github.com/lavanet/lava/v3/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; message DelegatorReward { + reserved 3; string delegator = 1; string provider = 2; - string chain_id = 3; repeated cosmos.base.v1beta1.Coin amount = 4 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false diff --git a/proto/lavanet/lava/dualstaking/genesis.proto b/proto/lavanet/lava/dualstaking/genesis.proto index b6a97c3491..2498802909 100644 --- a/proto/lavanet/lava/dualstaking/genesis.proto +++ b/proto/lavanet/lava/dualstaking/genesis.proto @@ -3,17 +3,15 @@ package lavanet.lava.dualstaking; import "gogoproto/gogo.proto"; import "lavanet/lava/dualstaking/params.proto"; -import "lavanet/lava/fixationstore/fixation.proto"; -import "lavanet/lava/timerstore/timer.proto"; import "lavanet/lava/dualstaking/delegator_reward.proto"; +import "lavanet/lava/dualstaking/delegate.proto"; -option go_package = "github.com/lavanet/lava/v3/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; // GenesisState defines the dualstaking module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - lavanet.lava.fixationstore.GenesisState delegationsFS = 2 [(gogoproto.nullable) = false]; - lavanet.lava.fixationstore.GenesisState delegatorsFS = 3 [(gogoproto.nullable) = false]; - reserved 4; + reserved 2,3,4; repeated DelegatorReward delegator_reward_list = 5 [(gogoproto.nullable) = false]; + repeated Delegation Delegations = 6 [(gogoproto.nullable) = false]; } diff --git a/proto/lavanet/lava/dualstaking/params.proto b/proto/lavanet/lava/dualstaking/params.proto index e1e1743c2d..3284720e82 100644 --- a/proto/lavanet/lava/dualstaking/params.proto +++ b/proto/lavanet/lava/dualstaking/params.proto @@ -4,7 +4,7 @@ package lavanet.lava.dualstaking; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/lavanet/lava/v3/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/dualstaking/query.proto b/proto/lavanet/lava/dualstaking/query.proto index 3cb0941678..a4ee622253 100644 --- a/proto/lavanet/lava/dualstaking/query.proto +++ b/proto/lavanet/lava/dualstaking/query.proto @@ -8,7 +8,7 @@ import "lavanet/lava/dualstaking/params.proto"; import "lavanet/lava/dualstaking/delegate.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/lavanet/lava/v3/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; // Query defines the gRPC querier service. service Query { @@ -76,8 +76,8 @@ message QueryDelegatorRewardsResponse { } message DelegatorRewardInfo { + reserved 2; string provider = 1; - string chain_id = 2; repeated cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false diff --git a/proto/lavanet/lava/dualstaking/tx.proto b/proto/lavanet/lava/dualstaking/tx.proto index c336515085..cf54420366 100644 --- a/proto/lavanet/lava/dualstaking/tx.proto +++ b/proto/lavanet/lava/dualstaking/tx.proto @@ -5,7 +5,7 @@ import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v4/x/dualstaking/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/epochstorage/endpoint.proto b/proto/lavanet/lava/epochstorage/endpoint.proto index 4becb06744..c388066284 100644 --- a/proto/lavanet/lava/epochstorage/endpoint.proto +++ b/proto/lavanet/lava/epochstorage/endpoint.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; message Endpoint { string iPPORT = 1; diff --git a/proto/lavanet/lava/epochstorage/epoch_details.proto b/proto/lavanet/lava/epochstorage/epoch_details.proto index ce17f3d7b0..84655f4d22 100644 --- a/proto/lavanet/lava/epochstorage/epoch_details.proto +++ b/proto/lavanet/lava/epochstorage/epoch_details.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; message EpochDetails { uint64 startBlock = 1; diff --git a/proto/lavanet/lava/epochstorage/fixated_params.proto b/proto/lavanet/lava/epochstorage/fixated_params.proto index 1219e73588..3b74569998 100644 --- a/proto/lavanet/lava/epochstorage/fixated_params.proto +++ b/proto/lavanet/lava/epochstorage/fixated_params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; import "gogoproto/gogo.proto"; import "lavanet/lava/epochstorage/params.proto"; diff --git a/proto/lavanet/lava/epochstorage/genesis.proto b/proto/lavanet/lava/epochstorage/genesis.proto index 24887b662a..2058ca96db 100644 --- a/proto/lavanet/lava/epochstorage/genesis.proto +++ b/proto/lavanet/lava/epochstorage/genesis.proto @@ -8,7 +8,7 @@ import "lavanet/lava/epochstorage/epoch_details.proto"; import "lavanet/lava/epochstorage/fixated_params.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; // GenesisState defines the epochstorage module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/epochstorage/params.proto b/proto/lavanet/lava/epochstorage/params.proto index ba0125cfe2..35e4d9a6b2 100644 --- a/proto/lavanet/lava/epochstorage/params.proto +++ b/proto/lavanet/lava/epochstorage/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.epochstorage; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/epochstorage/provider_metadata.proto b/proto/lavanet/lava/epochstorage/provider_metadata.proto new file mode 100644 index 0000000000..44c6c1c7b3 --- /dev/null +++ b/proto/lavanet/lava/epochstorage/provider_metadata.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package lavanet.lava.epochstorage; + +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +message ProviderMetadata { + string provider = 1; + string vault = 2; + cosmos.base.v1beta1.Coin total_delegations = 3 [(gogoproto.nullable) = false]; + repeated string chains = 4; + uint64 delegate_commission = 5; // delegation commission (precentage 0-100) + uint64 last_change = 6; + cosmos.staking.v1beta1.Description description = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} \ No newline at end of file diff --git a/proto/lavanet/lava/epochstorage/query.proto b/proto/lavanet/lava/epochstorage/query.proto index 402a498fe3..343f49e013 100644 --- a/proto/lavanet/lava/epochstorage/query.proto +++ b/proto/lavanet/lava/epochstorage/query.proto @@ -7,11 +7,12 @@ import "lavanet/lava/epochstorage/params.proto"; import "lavanet/lava/epochstorage/stake_storage.proto"; import "lavanet/lava/epochstorage/epoch_details.proto"; import "lavanet/lava/epochstorage/fixated_params.proto"; +import "lavanet/lava/epochstorage/provider_metadata.proto"; // this line is used by starport scaffolding # 1 import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; // Query defines the gRPC querier service. service Query { @@ -44,6 +45,11 @@ service Query { option (google.api.http).get = "/lavanet/lava/epochstorage/fixated_params"; } + // Queries provider metadata. + rpc ProviderMetaData(QueryProviderMetaDataRequest) returns (QueryProviderMetaDataResponse) { + option (google.api.http).get = "/lavanet/lava/epochstorage/provider_metadata/{provider}"; + } + // this line is used by starport scaffolding # 2 } @@ -98,4 +104,12 @@ message QueryAllFixatedParamsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryProviderMetaDataRequest { + string provider = 1; +} + +message QueryProviderMetaDataResponse { + repeated ProviderMetadata MetaData = 1 [(gogoproto.nullable) = false]; +} + // this line is used by starport scaffolding # 3 diff --git a/proto/lavanet/lava/epochstorage/stake_entry.proto b/proto/lavanet/lava/epochstorage/stake_entry.proto index 89b832d854..ab3763165f 100644 --- a/proto/lavanet/lava/epochstorage/stake_entry.proto +++ b/proto/lavanet/lava/epochstorage/stake_entry.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; import "lavanet/lava/epochstorage/endpoint.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -9,7 +9,7 @@ import "cosmos/staking/v1beta1/staking.proto"; import "amino/amino.proto"; message StakeEntry { - reserved 7,10; + reserved 7,10,12; cosmos.base.v1beta1.Coin stake = 1 [(gogoproto.nullable) = false]; string address = 2; uint64 stake_applied_block = 3; @@ -19,7 +19,6 @@ message StakeEntry { string moniker = 8; cosmos.base.v1beta1.Coin delegate_total = 9 [(gogoproto.nullable) = false]; // delegation total uint64 delegate_commission = 11; // delegation commission (precentage 0-100) - uint64 last_change = 12; BlockReport block_report = 13; string vault = 14; cosmos.staking.v1beta1.Description description = 15 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; diff --git a/proto/lavanet/lava/epochstorage/stake_storage.proto b/proto/lavanet/lava/epochstorage/stake_storage.proto index df52ff7f15..d9c77adaa3 100644 --- a/proto/lavanet/lava/epochstorage/stake_storage.proto +++ b/proto/lavanet/lava/epochstorage/stake_storage.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; import "lavanet/lava/epochstorage/stake_entry.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/epochstorage/tx.proto b/proto/lavanet/lava/epochstorage/tx.proto index 0ec83063a6..fb68023d26 100644 --- a/proto/lavanet/lava/epochstorage/tx.proto +++ b/proto/lavanet/lava/epochstorage/tx.proto @@ -3,7 +3,7 @@ package lavanet.lava.epochstorage; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/v3/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v4/x/epochstorage/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/fixationstore/fixation.proto b/proto/lavanet/lava/fixationstore/fixation.proto index d818ffcef9..9de50af4d2 100644 --- a/proto/lavanet/lava/fixationstore/fixation.proto +++ b/proto/lavanet/lava/fixationstore/fixation.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.fixationstore; -option go_package = "github.com/lavanet/lava/v3/x/fixationstore/types"; +option go_package = "github.com/lavanet/lava/v4/x/fixationstore/types"; import "gogoproto/gogo.proto"; import "lavanet/lava/timerstore/timer.proto"; diff --git a/proto/lavanet/lava/fixationstore/query.proto b/proto/lavanet/lava/fixationstore/query.proto index ed18f49a1b..9c7d2338a3 100644 --- a/proto/lavanet/lava/fixationstore/query.proto +++ b/proto/lavanet/lava/fixationstore/query.proto @@ -3,7 +3,7 @@ package lavanet.lava.fixationstore; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/lavanet/lava/v3/x/fixationstore/types"; +option go_package = "github.com/lavanet/lava/v4/x/fixationstore/types"; import "lavanet/lava/fixationstore/fixation.proto"; diff --git a/proto/lavanet/lava/pairing/account_info.proto b/proto/lavanet/lava/pairing/account_info.proto index 2167c19f20..5c12bac236 100644 --- a/proto/lavanet/lava/pairing/account_info.proto +++ b/proto/lavanet/lava/pairing/account_info.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/pairing/badges.proto b/proto/lavanet/lava/pairing/badges.proto index 04d1ec5e08..5ae429813e 100644 --- a/proto/lavanet/lava/pairing/badges.proto +++ b/proto/lavanet/lava/pairing/badges.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; import "lavanet/lava/pairing/relay.proto"; import "lavanet/lava/pairing/query.proto"; diff --git a/proto/lavanet/lava/pairing/debug_query.proto b/proto/lavanet/lava/pairing/debug_query.proto index 07cd88fd80..74ee82485b 100644 --- a/proto/lavanet/lava/pairing/debug_query.proto +++ b/proto/lavanet/lava/pairing/debug_query.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/pairing/epoch_cu.proto b/proto/lavanet/lava/pairing/epoch_cu.proto index 300d0009af..827d5b10ec 100644 --- a/proto/lavanet/lava/pairing/epoch_cu.proto +++ b/proto/lavanet/lava/pairing/epoch_cu.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; // UniqueEpochSession is used to detect double spend attacks // It's kept in a epoch-prefixed store with a unique index: provider, project ID, chain ID and session ID diff --git a/proto/lavanet/lava/pairing/genesis.proto b/proto/lavanet/lava/pairing/genesis.proto index f514d7f4d7..5d6ba2868b 100644 --- a/proto/lavanet/lava/pairing/genesis.proto +++ b/proto/lavanet/lava/pairing/genesis.proto @@ -9,7 +9,7 @@ import "lavanet/lava/timerstore/timer.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; message BadgeUsedCu { bytes badge_used_cu_key = 1; diff --git a/proto/lavanet/lava/pairing/params.proto b/proto/lavanet/lava/pairing/params.proto index 2558297ee2..efb0e9c5af 100644 --- a/proto/lavanet/lava/pairing/params.proto +++ b/proto/lavanet/lava/pairing/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.pairing; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/pairing/query.proto b/proto/lavanet/lava/pairing/query.proto index 63f4b897e9..0f806dd49e 100644 --- a/proto/lavanet/lava/pairing/query.proto +++ b/proto/lavanet/lava/pairing/query.proto @@ -15,7 +15,7 @@ import "lavanet/lava/subscription/subscription.proto"; import "lavanet/lava/projects/project.proto"; import "lavanet/lava/downtime/v1/downtime.proto"; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/pairing/relay.proto b/proto/lavanet/lava/pairing/relay.proto index e0a93038a4..a74bd761ee 100644 --- a/proto/lavanet/lava/pairing/relay.proto +++ b/proto/lavanet/lava/pairing/relay.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/pairing/relayCache.proto b/proto/lavanet/lava/pairing/relayCache.proto index 7ac885d2b4..c6f2686f96 100644 --- a/proto/lavanet/lava/pairing/relayCache.proto +++ b/proto/lavanet/lava/pairing/relayCache.proto @@ -4,7 +4,7 @@ import "gogoproto/gogo.proto"; import "lavanet/lava/pairing/relay.proto"; import "google/protobuf/empty.proto"; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; service RelayerCache { rpc GetRelay (RelayCacheGet) returns (CacheRelayReply) {} diff --git a/proto/lavanet/lava/pairing/tx.proto b/proto/lavanet/lava/pairing/tx.proto index 84adcbe410..6392d65ff8 100644 --- a/proto/lavanet/lava/pairing/tx.proto +++ b/proto/lavanet/lava/pairing/tx.proto @@ -8,7 +8,7 @@ import "lavanet/lava/pairing/relay.proto"; import "cosmos/staking/v1beta1/staking.proto"; import "amino/amino.proto"; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; // Msg defines the Msg service. service Msg { @@ -17,6 +17,7 @@ service Msg { rpc RelayPayment(MsgRelayPayment) returns (MsgRelayPaymentResponse); rpc FreezeProvider(MsgFreezeProvider) returns (MsgFreezeProviderResponse); rpc UnfreezeProvider(MsgUnfreezeProvider) returns (MsgUnfreezeProviderResponse); + rpc MoveProviderStake(MsgMoveProviderStake) returns (MsgMoveProviderStakeResponse); // this line is used by starport scaffolding # proto/tx/rpc } @@ -85,4 +86,16 @@ message MsgUnfreezeProvider { message MsgUnfreezeProviderResponse { } + +message MsgMoveProviderStake { + option (amino.name) = "pairing/MoveProviderStake"; + string creator = 1; + string src_chain =2; + string dst_chain =3; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; +} + +message MsgMoveProviderStakeResponse { +} + // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/proto/lavanet/lava/pairing/unstake_proposal.proto b/proto/lavanet/lava/pairing/unstake_proposal.proto index a34c0de8b5..dc72c9d429 100644 --- a/proto/lavanet/lava/pairing/unstake_proposal.proto +++ b/proto/lavanet/lava/pairing/unstake_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/v3/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/plans/genesis.proto b/proto/lavanet/lava/plans/genesis.proto index ef2153d09f..109ddd76bf 100644 --- a/proto/lavanet/lava/plans/genesis.proto +++ b/proto/lavanet/lava/plans/genesis.proto @@ -6,7 +6,7 @@ import "lavanet/lava/plans/params.proto"; import "lavanet/lava/fixationstore/fixation.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; // GenesisState defines the plan module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/plans/params.proto b/proto/lavanet/lava/plans/params.proto index a2af3ed1fd..7d32961307 100644 --- a/proto/lavanet/lava/plans/params.proto +++ b/proto/lavanet/lava/plans/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.plans; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/plans/plan.proto b/proto/lavanet/lava/plans/plan.proto index 41a51bc72a..868ce19be6 100644 --- a/proto/lavanet/lava/plans/plan.proto +++ b/proto/lavanet/lava/plans/plan.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.plans; -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/plans/plans_proposal.proto b/proto/lavanet/lava/plans/plans_proposal.proto index 1d2b0153b0..0e5749c4b4 100644 --- a/proto/lavanet/lava/plans/plans_proposal.proto +++ b/proto/lavanet/lava/plans/plans_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.plans; -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/plans/policy.proto b/proto/lavanet/lava/plans/policy.proto index 9288633c3b..21fc9fe440 100644 --- a/proto/lavanet/lava/plans/policy.proto +++ b/proto/lavanet/lava/plans/policy.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.plans; -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/plans/query.proto b/proto/lavanet/lava/plans/query.proto index e5d9c0c8f0..d4b04085fd 100644 --- a/proto/lavanet/lava/plans/query.proto +++ b/proto/lavanet/lava/plans/query.proto @@ -9,7 +9,7 @@ import "lavanet/lava/plans/params.proto"; import "cosmos/base/v1beta1/coin.proto"; import "lavanet/lava/plans/plan.proto"; -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/plans/tx.proto b/proto/lavanet/lava/plans/tx.proto index 43a079719f..3e8dc0dd31 100644 --- a/proto/lavanet/lava/plans/tx.proto +++ b/proto/lavanet/lava/plans/tx.proto @@ -3,7 +3,7 @@ package lavanet.lava.plans; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/v3/x/plans/types"; +option go_package = "github.com/lavanet/lava/v4/x/plans/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/projects/genesis.proto b/proto/lavanet/lava/projects/genesis.proto index a4098366c1..7b7c629c09 100644 --- a/proto/lavanet/lava/projects/genesis.proto +++ b/proto/lavanet/lava/projects/genesis.proto @@ -6,7 +6,7 @@ import "lavanet/lava/projects/params.proto"; import "lavanet/lava/fixationstore/fixation.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/projects/types"; +option go_package = "github.com/lavanet/lava/v4/x/projects/types"; // GenesisState defines the projects module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/projects/params.proto b/proto/lavanet/lava/projects/params.proto index 6bd65e4228..377df458e6 100644 --- a/proto/lavanet/lava/projects/params.proto +++ b/proto/lavanet/lava/projects/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.projects; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/projects/types"; +option go_package = "github.com/lavanet/lava/v4/x/projects/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/projects/project.proto b/proto/lavanet/lava/projects/project.proto index 36439a0327..509d266b25 100644 --- a/proto/lavanet/lava/projects/project.proto +++ b/proto/lavanet/lava/projects/project.proto @@ -4,7 +4,7 @@ package lavanet.lava.projects; import "gogoproto/gogo.proto"; import "lavanet/lava/plans/policy.proto"; option (gogoproto.equal_all) = true; -option go_package = "github.com/lavanet/lava/v3/x/projects/types"; +option go_package = "github.com/lavanet/lava/v4/x/projects/types"; message Project { string index = 1; // unique id that will be the combination of subscription address and project name, cannot be changed once created diff --git a/proto/lavanet/lava/projects/query.proto b/proto/lavanet/lava/projects/query.proto index ed9612be1c..fd3e6ed45b 100644 --- a/proto/lavanet/lava/projects/query.proto +++ b/proto/lavanet/lava/projects/query.proto @@ -7,7 +7,7 @@ import "lavanet/lava/projects/params.proto"; import "lavanet/lava/projects/project.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/v3/x/projects/types"; +option go_package = "github.com/lavanet/lava/v4/x/projects/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/projects/tx.proto b/proto/lavanet/lava/projects/tx.proto index ae1ec4ac00..e3fec5cb1f 100644 --- a/proto/lavanet/lava/projects/tx.proto +++ b/proto/lavanet/lava/projects/tx.proto @@ -8,7 +8,7 @@ import "gogoproto/gogo.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/v3/x/projects/types"; +option go_package = "github.com/lavanet/lava/v4/x/projects/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/protocol/genesis.proto b/proto/lavanet/lava/protocol/genesis.proto index 635fe4bfc6..d77e54ceec 100644 --- a/proto/lavanet/lava/protocol/genesis.proto +++ b/proto/lavanet/lava/protocol/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "lavanet/lava/protocol/params.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v4/x/protocol/types"; // GenesisState defines the protocol module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/protocol/params.proto b/proto/lavanet/lava/protocol/params.proto index 4ab0f5fb11..31b7d358f2 100644 --- a/proto/lavanet/lava/protocol/params.proto +++ b/proto/lavanet/lava/protocol/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.protocol; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v4/x/protocol/types"; // Params defines the parameters for the module. message Version { diff --git a/proto/lavanet/lava/protocol/query.proto b/proto/lavanet/lava/protocol/query.proto index 169ed783d7..ed4bb864f1 100644 --- a/proto/lavanet/lava/protocol/query.proto +++ b/proto/lavanet/lava/protocol/query.proto @@ -7,7 +7,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "lavanet/lava/protocol/params.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/v3/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v4/x/protocol/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/protocol/tx.proto b/proto/lavanet/lava/protocol/tx.proto index 3f819e92f1..4b0067332a 100644 --- a/proto/lavanet/lava/protocol/tx.proto +++ b/proto/lavanet/lava/protocol/tx.proto @@ -4,7 +4,7 @@ import "amino/amino.proto"; // this line is used by starport scaffolding # proto/tx/import import "lavanet/lava/protocol/params.proto"; -option go_package = "github.com/lavanet/lava/v3/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v4/x/protocol/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/rewards/base_pay.proto b/proto/lavanet/lava/rewards/base_pay.proto index f6d48d7e57..ec07185330 100644 --- a/proto/lavanet/lava/rewards/base_pay.proto +++ b/proto/lavanet/lava/rewards/base_pay.proto @@ -6,7 +6,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; // aggregated rewards for the provider through out the month message BasePay { diff --git a/proto/lavanet/lava/rewards/genesis.proto b/proto/lavanet/lava/rewards/genesis.proto index a03eca36d1..c07b1a7ff4 100644 --- a/proto/lavanet/lava/rewards/genesis.proto +++ b/proto/lavanet/lava/rewards/genesis.proto @@ -9,7 +9,7 @@ import "lavanet/lava/rewards/params.proto"; import "lavanet/lava/timerstore/timer.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; // GenesisState defines the rewards module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/rewards/iprpc.proto b/proto/lavanet/lava/rewards/iprpc.proto index a9e633151c..498ea1f391 100644 --- a/proto/lavanet/lava/rewards/iprpc.proto +++ b/proto/lavanet/lava/rewards/iprpc.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.rewards; -option go_package = "github.com/lavanet/lava/v3/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/rewards/params.proto b/proto/lavanet/lava/rewards/params.proto index a74e5d5820..314184c3d5 100644 --- a/proto/lavanet/lava/rewards/params.proto +++ b/proto/lavanet/lava/rewards/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.rewards; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/rewards/query.proto b/proto/lavanet/lava/rewards/query.proto index feed9a9554..8756e2db2d 100644 --- a/proto/lavanet/lava/rewards/query.proto +++ b/proto/lavanet/lava/rewards/query.proto @@ -10,7 +10,7 @@ import "lavanet/lava/rewards/iprpc.proto"; import "lavanet/lava/rewards/params.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/v3/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/rewards/tx.proto b/proto/lavanet/lava/rewards/tx.proto index 2580267e21..e6930bd1b2 100644 --- a/proto/lavanet/lava/rewards/tx.proto +++ b/proto/lavanet/lava/rewards/tx.proto @@ -6,7 +6,7 @@ import "gogoproto/gogo.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/v3/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v4/x/rewards/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/spec/api_collection.proto b/proto/lavanet/lava/spec/api_collection.proto index 27750346b6..1dc6b74b92 100644 --- a/proto/lavanet/lava/spec/api_collection.proto +++ b/proto/lavanet/lava/spec/api_collection.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.spec; -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/spec/genesis.proto b/proto/lavanet/lava/spec/genesis.proto index 78aa1d3c01..9001cf7029 100644 --- a/proto/lavanet/lava/spec/genesis.proto +++ b/proto/lavanet/lava/spec/genesis.proto @@ -7,7 +7,7 @@ import "lavanet/lava/spec/spec.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; // GenesisState defines the spec module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/spec/params.proto b/proto/lavanet/lava/spec/params.proto index 2b87d017f7..2d51f8344f 100644 --- a/proto/lavanet/lava/spec/params.proto +++ b/proto/lavanet/lava/spec/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.spec; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/spec/query.proto b/proto/lavanet/lava/spec/query.proto index 90c305e69c..55b9f1987b 100644 --- a/proto/lavanet/lava/spec/query.proto +++ b/proto/lavanet/lava/spec/query.proto @@ -8,7 +8,7 @@ import "lavanet/lava/spec/params.proto"; import "lavanet/lava/spec/spec.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/spec/spec.proto b/proto/lavanet/lava/spec/spec.proto index 5f85b1ae77..069ca5374e 100644 --- a/proto/lavanet/lava/spec/spec.proto +++ b/proto/lavanet/lava/spec/spec.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.spec; -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/spec/spec_add_proposal.proto b/proto/lavanet/lava/spec/spec_add_proposal.proto index acb66b2e9b..cdc9358670 100644 --- a/proto/lavanet/lava/spec/spec_add_proposal.proto +++ b/proto/lavanet/lava/spec/spec_add_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.spec; -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/spec/tx.proto b/proto/lavanet/lava/spec/tx.proto index 5b48e3b7b4..c6606c9f08 100644 --- a/proto/lavanet/lava/spec/tx.proto +++ b/proto/lavanet/lava/spec/tx.proto @@ -3,7 +3,7 @@ package lavanet.lava.spec; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/v3/x/spec/types"; +option go_package = "github.com/lavanet/lava/v4/x/spec/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/subscription/adjustment.proto b/proto/lavanet/lava/subscription/adjustment.proto index 18e2596688..1ca7947968 100644 --- a/proto/lavanet/lava/subscription/adjustment.proto +++ b/proto/lavanet/lava/subscription/adjustment.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.subscription; -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; message Adjustment { string index = 1; diff --git a/proto/lavanet/lava/subscription/cu_tracker.proto b/proto/lavanet/lava/subscription/cu_tracker.proto index 311005ed50..2e45639c9d 100644 --- a/proto/lavanet/lava/subscription/cu_tracker.proto +++ b/proto/lavanet/lava/subscription/cu_tracker.proto @@ -4,7 +4,7 @@ package lavanet.lava.subscription; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; message TrackedCu { uint64 cu = 1; // CU counter for CU after QoS consideration diff --git a/proto/lavanet/lava/subscription/genesis.proto b/proto/lavanet/lava/subscription/genesis.proto index d3256e3b20..e2efe85285 100644 --- a/proto/lavanet/lava/subscription/genesis.proto +++ b/proto/lavanet/lava/subscription/genesis.proto @@ -8,7 +8,7 @@ import "lavanet/lava/fixationstore/fixation.proto"; import "lavanet/lava/timerstore/timer.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; // GenesisState defines the subscription module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/subscription/params.proto b/proto/lavanet/lava/subscription/params.proto index 30ce7bd1da..3c1ca20124 100644 --- a/proto/lavanet/lava/subscription/params.proto +++ b/proto/lavanet/lava/subscription/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.subscription; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/subscription/query.proto b/proto/lavanet/lava/subscription/query.proto index ae5d753913..5447bf6571 100644 --- a/proto/lavanet/lava/subscription/query.proto +++ b/proto/lavanet/lava/subscription/query.proto @@ -11,7 +11,7 @@ import "lavanet/lava/subscription/params.proto"; import "lavanet/lava/subscription/subscription.proto"; import "amino/amino.proto"; -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; // Query defines the gRPC querier service. service Query { @@ -45,10 +45,17 @@ service Query { } // Queries a rewards estimation. +// Deprecated: please use EstimatedProviderRewards rpc EstimatedRewards(QueryEstimatedRewardsRequest) returns (QueryEstimatedRewardsResponse) { + option deprecated = true; option (google.api.http).get = "/lavanet/lava/subscription/estimated_rewards/{provider}/{chain_id}/{amount_delegator}"; } +// Queries a rewards estimation. +rpc EstimatedProviderRewards(QueryEstimatedProviderRewardsRequest) returns (QueryEstimatedRewardsResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/estimated_provider_rewards/{provider}/{amount_delegator}"; +} + rpc EstimatedValidatorRewards(QueryEstimatedValidatorRewardsRequest) returns (QueryEstimatedValidatorRewardsResponse) { option (google.api.http).get = "/lavanet/lava/subscription/estimated_validator_rewards/{validator}/{amount_delegator}"; } @@ -125,13 +132,19 @@ message QuerySubscriptionTrackedUsageResponse { } message QueryEstimatedRewardsRequest { + option deprecated = true; string provider = 1; - string chain_id = 2; + string chain_id = 2 [(gogoproto.moretags) = "yaml:\"chain_id\",deprecated:\"true\"", deprecated = true]; string amount_delegator = 3; } +message QueryEstimatedProviderRewardsRequest { + string provider = 1; + string amount_delegator = 2; +} + message EstimatedRewardInfo { - string source =1; + string source = 1; repeated cosmos.base.v1beta1.DecCoin amount = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false, @@ -140,12 +153,15 @@ message EstimatedRewardInfo { } message QueryEstimatedRewardsResponse { - repeated EstimatedRewardInfo info = 1 [(gogoproto.nullable) = true]; + repeated EstimatedRewardInfo info = 1 [(gogoproto.nullable) = false]; repeated cosmos.base.v1beta1.DecCoin total = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + uint64 recommended_block = 3; // if the query is run in the first 24H of the month, recommended_block will be non-zero. + // The IPRPC estimation might be misleading in the first 24H since it's dependent on CU count + // so the user should run the query again using the --height flag with the recommended_block } message QueryEstimatedValidatorRewardsRequest { diff --git a/proto/lavanet/lava/subscription/subscription.proto b/proto/lavanet/lava/subscription/subscription.proto index fb9e3a0f9b..c33f163f75 100644 --- a/proto/lavanet/lava/subscription/subscription.proto +++ b/proto/lavanet/lava/subscription/subscription.proto @@ -4,7 +4,7 @@ package lavanet.lava.subscription; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; message Subscription { string creator = 1; // creator pays for the subscription diff --git a/proto/lavanet/lava/subscription/tx.proto b/proto/lavanet/lava/subscription/tx.proto index d1904ff6fa..b8c445b5bd 100644 --- a/proto/lavanet/lava/subscription/tx.proto +++ b/proto/lavanet/lava/subscription/tx.proto @@ -5,7 +5,7 @@ package lavanet.lava.subscription; import "amino/amino.proto"; import "lavanet/lava/projects/project.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/v3/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v4/x/subscription/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/timerstore/query.proto b/proto/lavanet/lava/timerstore/query.proto index bcca79e9a3..63e4f22365 100644 --- a/proto/lavanet/lava/timerstore/query.proto +++ b/proto/lavanet/lava/timerstore/query.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.timerstore; -option go_package = "github.com/lavanet/lava/v3/x/timerstore/types"; +option go_package = "github.com/lavanet/lava/v4/x/timerstore/types"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/proto/lavanet/lava/timerstore/timer.proto b/proto/lavanet/lava/timerstore/timer.proto index 2e7e8b628d..4cc277177f 100644 --- a/proto/lavanet/lava/timerstore/timer.proto +++ b/proto/lavanet/lava/timerstore/timer.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.timerstore; -option go_package = "github.com/lavanet/lava/v3/x/timerstore/types"; +option go_package = "github.com/lavanet/lava/v4/x/timerstore/types"; import "gogoproto/gogo.proto"; message GenesisState { diff --git a/protocol/badgegenerator/badgeserver.go b/protocol/badgegenerator/badgeserver.go index 55860f638d..15ae681bac 100644 --- a/protocol/badgegenerator/badgeserver.go +++ b/protocol/badgegenerator/badgeserver.go @@ -14,11 +14,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" diff --git a/protocol/badgegenerator/grpc/grpcfetcher.go b/protocol/badgegenerator/grpc/grpcfetcher.go index b96e31d7f1..b5774de438 100644 --- a/protocol/badgegenerator/grpc/grpcfetcher.go +++ b/protocol/badgegenerator/grpc/grpcfetcher.go @@ -8,8 +8,8 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/query" retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" diff --git a/protocol/badgegenerator/ipservice.go b/protocol/badgegenerator/ipservice.go index a24f1a8530..1fdb180be1 100644 --- a/protocol/badgegenerator/ipservice.go +++ b/protocol/badgegenerator/ipservice.go @@ -12,7 +12,7 @@ import ( "github.com/praserx/ipconv" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type IpService struct { diff --git a/protocol/badgegenerator/models.go b/protocol/badgegenerator/models.go index dacf6a25be..e7cb46d635 100644 --- a/protocol/badgegenerator/models.go +++ b/protocol/badgegenerator/models.go @@ -1,6 +1,6 @@ package badgegenerator -import "github.com/lavanet/lava/v3/x/pairing/types" +import "github.com/lavanet/lava/v4/x/pairing/types" type ProjectConfiguration struct { ProjectPublicKey string `json:"project_public_key"` diff --git a/protocol/badgegenerator/server.go b/protocol/badgegenerator/server.go index 9cecaff972..7906b33696 100644 --- a/protocol/badgegenerator/server.go +++ b/protocol/badgegenerator/server.go @@ -12,12 +12,12 @@ import ( "google.golang.org/grpc/metadata" btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" - "github.com/lavanet/lava/v3/protocol/badgegenerator/grpc" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/badgegenerator/grpc" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const dummyApiInterface = "badgeApiInterface" diff --git a/protocol/badgegenerator/tracker.go b/protocol/badgegenerator/tracker.go index e65970f54b..aa82c5f90c 100644 --- a/protocol/badgegenerator/tracker.go +++ b/protocol/badgegenerator/tracker.go @@ -6,11 +6,11 @@ import ( cosmosclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/statetracker" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/statetracker" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" ) // adding 3 blocks delay, to update the epoch. diff --git a/protocol/badgeserver/badgeserver.go b/protocol/badgeserver/badgeserver.go index 0a6db7fa28..61a0dce966 100644 --- a/protocol/badgeserver/badgeserver.go +++ b/protocol/badgeserver/badgeserver.go @@ -15,12 +15,12 @@ import ( "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" diff --git a/protocol/badgeserver/ipservice.go b/protocol/badgeserver/ipservice.go index 912077a142..727b2925ca 100644 --- a/protocol/badgeserver/ipservice.go +++ b/protocol/badgeserver/ipservice.go @@ -12,7 +12,7 @@ import ( "github.com/praserx/ipconv" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type IpService struct { diff --git a/protocol/badgeserver/models.go b/protocol/badgeserver/models.go index 4f073763a7..b85d6ecdf8 100644 --- a/protocol/badgeserver/models.go +++ b/protocol/badgeserver/models.go @@ -1,6 +1,6 @@ package badgeserver -import "github.com/lavanet/lava/v3/x/pairing/types" +import "github.com/lavanet/lava/v4/x/pairing/types" type GelocationToProjectsConfiguration map[string]map[string]*ProjectConfiguration diff --git a/protocol/badgeserver/server.go b/protocol/badgeserver/server.go index c778204473..e09245f944 100644 --- a/protocol/badgeserver/server.go +++ b/protocol/badgeserver/server.go @@ -11,12 +11,12 @@ import ( btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const dummyApiInterface = "badgeApiInterface" diff --git a/protocol/badgeserver/tracker.go b/protocol/badgeserver/tracker.go index fbaf86e624..9b13ddee42 100644 --- a/protocol/badgeserver/tracker.go +++ b/protocol/badgeserver/tracker.go @@ -6,11 +6,11 @@ import ( cosmosclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/statetracker" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/statetracker" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" ) // adding 3 blocks delay, to update the epoch. diff --git a/protocol/chainlib/base_chain_parser.go b/protocol/chainlib/base_chain_parser.go index fb1d5623b8..13da350da2 100644 --- a/protocol/chainlib/base_chain_parser.go +++ b/protocol/chainlib/base_chain_parser.go @@ -8,12 +8,12 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - epochstorage "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" + epochstorage "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type PolicyInf interface { @@ -157,9 +157,7 @@ func (bcp *BaseChainParser) SetPolicyFromAddonAndExtensionMap(policyInformation bcp.extensionParser.SetConfiguredExtensions(configuredExtensions) // manage allowed addons for addon := range bcp.allowedAddons { - if _, ok := policyInformation[addon]; ok { - bcp.allowedAddons[addon] = true - } + _, bcp.allowedAddons[addon] = policyInformation[addon] } } @@ -231,7 +229,7 @@ func (bcp *BaseChainParser) GetVerifications(supported []string) (retVerificatio func (bcp *BaseChainParser) Construct(spec spectypes.Spec, internalPaths map[string]struct{}, taggedApis map[spectypes.FUNCTION_TAG]TaggedContainer, serverApis map[ApiKey]ApiContainer, apiCollections map[CollectionKey]*spectypes.ApiCollection, headers map[ApiKey]*spectypes.Header, - verifications map[VerificationKey][]VerificationContainer, extensionParser extensionslib.ExtensionParser, + verifications map[VerificationKey][]VerificationContainer, ) { bcp.spec = spec bcp.internalPaths = internalPaths @@ -242,16 +240,16 @@ func (bcp *BaseChainParser) Construct(spec spectypes.Spec, internalPaths map[str bcp.verifications = verifications allowedAddons := map[string]bool{} allowedExtensions := map[string]struct{}{} - for _, apoCollection := range apiCollections { - for _, extension := range apoCollection.Extensions { + for _, apiCollection := range apiCollections { + for _, extension := range apiCollection.Extensions { allowedExtensions[extension.Name] = struct{}{} } - allowedAddons[apoCollection.CollectionData.AddOn] = false + // if addon was already existing (happens on spec update), use the existing policy, otherwise set it to false by default + allowedAddons[apiCollection.CollectionData.AddOn] = bcp.allowedAddons[apiCollection.CollectionData.AddOn] } bcp.allowedAddons = allowedAddons - bcp.extensionParser = extensionslib.ExtensionParser{AllowedExtensions: allowedExtensions} - bcp.extensionParser.SetConfiguredExtensions(extensionParser.GetConfiguredExtensions()) + bcp.extensionParser = extensionslib.NewExtensionParser(allowedExtensions, bcp.extensionParser.GetConfiguredExtensions()) } func (bcp *BaseChainParser) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, apiCollection *spectypes.ApiCollection, existed bool) { diff --git a/protocol/chainlib/chain_fetcher.go b/protocol/chainlib/chain_fetcher.go index 9a5d6c421b..a0a8fde139 100644 --- a/protocol/chainlib/chain_fetcher.go +++ b/protocol/chainlib/chain_fetcher.go @@ -9,16 +9,16 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/golang/protobuf/proto" - formatter "github.com/lavanet/lava/v3/ecosystem/cache/format" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/protocol/performance" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + formatter "github.com/lavanet/lava/v4/ecosystem/cache/format" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/protocol/performance" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "golang.org/x/exp/slices" ) diff --git a/protocol/chainlib/chain_fetcher_mock.go b/protocol/chainlib/chain_fetcher_mock.go index 41ee39c660..d65c807e7c 100644 --- a/protocol/chainlib/chain_fetcher_mock.go +++ b/protocol/chainlib/chain_fetcher_mock.go @@ -12,7 +12,7 @@ import ( context "context" reflect "reflect" - lavasession "github.com/lavanet/lava/v3/protocol/lavasession" + lavasession "github.com/lavanet/lava/v4/protocol/lavasession" gomock "go.uber.org/mock/gomock" ) diff --git a/protocol/chainlib/chain_fetcher_test.go b/protocol/chainlib/chain_fetcher_test.go index 87606f6f0f..db8cfca1ec 100644 --- a/protocol/chainlib/chain_fetcher_test.go +++ b/protocol/chainlib/chain_fetcher_test.go @@ -3,7 +3,7 @@ package chainlib import ( "testing" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/chain_message.go b/protocol/chainlib/chain_message.go index 66f89c2555..0cf5f923c2 100644 --- a/protocol/chainlib/chain_message.go +++ b/protocol/chainlib/chain_message.go @@ -4,12 +4,12 @@ import ( "math" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type updatableRPCInput interface { diff --git a/protocol/chainlib/chain_message_queries.go b/protocol/chainlib/chain_message_queries.go index 9f3fb77a3b..c05ef27093 100644 --- a/protocol/chainlib/chain_message_queries.go +++ b/protocol/chainlib/chain_message_queries.go @@ -1,8 +1,8 @@ package chainlib import ( - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/x/spec/types" ) func ShouldSendToAllProviders(chainMessage ChainMessage) bool { diff --git a/protocol/chainlib/chain_router.go b/protocol/chainlib/chain_router.go index 3c958da9f2..4237965d3c 100644 --- a/protocol/chainlib/chain_router.go +++ b/protocol/chainlib/chain_router.go @@ -6,11 +6,11 @@ import ( "strings" "sync" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/protocol/chainlib/chain_router_test.go b/protocol/chainlib/chain_router_test.go index f04831775e..4705f08927 100644 --- a/protocol/chainlib/chain_router_test.go +++ b/protocol/chainlib/chain_router_test.go @@ -14,14 +14,14 @@ import ( "github.com/gofiber/fiber/v2/middleware/compress" "github.com/gofiber/fiber/v2/middleware/favicon" "github.com/gofiber/websocket/v2" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - testcommon "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + testcommon "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/chainlib.go b/protocol/chainlib/chainlib.go index 44b8184405..c443132f00 100644 --- a/protocol/chainlib/chainlib.go +++ b/protocol/chainlib/chainlib.go @@ -5,14 +5,14 @@ import ( "fmt" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) var ( diff --git a/protocol/chainlib/chainlib_mock.go b/protocol/chainlib/chainlib_mock.go index 8ba6c64410..6013afca30 100644 --- a/protocol/chainlib/chainlib_mock.go +++ b/protocol/chainlib/chainlib_mock.go @@ -10,13 +10,13 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - rpcInterfaceMessages "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - rpcclient "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - extensionslib "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - common "github.com/lavanet/lava/v3/protocol/common" - metrics "github.com/lavanet/lava/v3/protocol/metrics" - types "github.com/lavanet/lava/v3/x/pairing/types" - types0 "github.com/lavanet/lava/v3/x/spec/types" + rpcInterfaceMessages "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + rpcclient "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + extensionslib "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + common "github.com/lavanet/lava/v4/protocol/common" + metrics "github.com/lavanet/lava/v4/protocol/metrics" + types "github.com/lavanet/lava/v4/x/pairing/types" + types0 "github.com/lavanet/lava/v4/x/spec/types" ) // MockChainParser is a mock of ChainParser interface. diff --git a/protocol/chainlib/chainproxy/common.go b/protocol/chainlib/chainproxy/common.go index ef410817ca..d0ddf9928e 100644 --- a/protocol/chainlib/chainproxy/common.go +++ b/protocol/chainlib/chainproxy/common.go @@ -5,9 +5,9 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/parser" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/parser" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/chainlib/chainproxy/connector.go b/protocol/chainlib/chainproxy/connector.go index 6f470d4742..c6926a0cb0 100644 --- a/protocol/chainlib/chainproxy/connector.go +++ b/protocol/chainlib/chainproxy/connector.go @@ -18,10 +18,10 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" diff --git a/protocol/chainlib/chainproxy/connector_test.go b/protocol/chainlib/chainproxy/connector_test.go index 651f09e4dd..e408ae2062 100644 --- a/protocol/chainlib/chainproxy/connector_test.go +++ b/protocol/chainlib/chainproxy/connector_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - pb_pkg "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" + pb_pkg "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go index 96a79bc822..fb288637a2 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go @@ -4,9 +4,9 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/parser" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/parser" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) var WontCalculateBatchHash = sdkerrors.New("Wont calculate batch hash", 892, "wont calculate batch message hash") // on batches we just wont calculate hashes, meaning we wont retry. diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go index 4d01346c94..9734f73327 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go @@ -13,12 +13,12 @@ import ( "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "github.com/jhump/protoreflect/grpcreflect" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - dyncodec "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy/dyncodec" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + dyncodec "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy/dyncodec" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" "google.golang.org/grpc/codes" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go index 50da0ae37e..f049e1c793 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go index 6eaa79ca0c..f45a241329 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go @@ -6,11 +6,11 @@ import ( "github.com/goccy/go-json" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" ) var ErrFailedToConvertMessage = sdkerrors.New("RPC error", 1000, "failed to convert a message") diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go index 711b1a119a..f4113932fc 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go index 39eeb7b9aa..1d5c18329a 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go @@ -6,11 +6,11 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" ) type RestMessage struct { diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go index 76d0e3d633..a46073b9d2 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go @@ -6,12 +6,12 @@ import ( tenderminttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils/sigs" ) type TendermintrpcMessage struct { diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go index 756f9d1c70..59c355e506 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go @@ -7,7 +7,7 @@ import ( "testing" tenderminttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/chainproxy/rpcclient/client.go b/protocol/chainlib/chainproxy/rpcclient/client.go index 2950de5b82..c745f82ee2 100644 --- a/protocol/chainlib/chainproxy/rpcclient/client.go +++ b/protocol/chainlib/chainproxy/rpcclient/client.go @@ -29,7 +29,7 @@ import ( "github.com/goccy/go-json" "github.com/ethereum/go-ethereum/log" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) var ( diff --git a/protocol/chainlib/chainproxy/rpcclient/handler.go b/protocol/chainlib/chainproxy/rpcclient/handler.go index 5e9abe2412..b2775326fc 100755 --- a/protocol/chainlib/chainproxy/rpcclient/handler.go +++ b/protocol/chainlib/chainproxy/rpcclient/handler.go @@ -27,7 +27,7 @@ import ( "github.com/goccy/go-json" "github.com/ethereum/go-ethereum/log" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) // handler handles JSON-RPC messages. There is one handler per connection. Note that diff --git a/protocol/chainlib/chainproxy/rpcclient/http.go b/protocol/chainlib/chainproxy/rpcclient/http.go index 95317a7a9b..019882d865 100755 --- a/protocol/chainlib/chainproxy/rpcclient/http.go +++ b/protocol/chainlib/chainproxy/rpcclient/http.go @@ -31,8 +31,8 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) diff --git a/protocol/chainlib/chainproxy/rpcclient/json.go b/protocol/chainlib/chainproxy/rpcclient/json.go index 5984cc368b..6ee84fd4e9 100755 --- a/protocol/chainlib/chainproxy/rpcclient/json.go +++ b/protocol/chainlib/chainproxy/rpcclient/json.go @@ -29,7 +29,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const ( diff --git a/protocol/chainlib/chainproxy/rpcclient/service.go b/protocol/chainlib/chainproxy/rpcclient/service.go index e175e28be0..39be3d4632 100755 --- a/protocol/chainlib/chainproxy/rpcclient/service.go +++ b/protocol/chainlib/chainproxy/rpcclient/service.go @@ -26,7 +26,7 @@ import ( "unicode" "github.com/ethereum/go-ethereum/log" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) var ( diff --git a/protocol/chainlib/chainproxy/rpcclient/subscription.go b/protocol/chainlib/chainproxy/rpcclient/subscription.go index 6c9bf81f10..803ecc171c 100755 --- a/protocol/chainlib/chainproxy/rpcclient/subscription.go +++ b/protocol/chainlib/chainproxy/rpcclient/subscription.go @@ -32,7 +32,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) var ( diff --git a/protocol/chainlib/chainproxy/rpcclient/types.go b/protocol/chainlib/chainproxy/rpcclient/types.go index 21c4dd3374..9d9e2299ec 100755 --- a/protocol/chainlib/chainproxy/rpcclient/types.go +++ b/protocol/chainlib/chainproxy/rpcclient/types.go @@ -27,7 +27,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) // API describes the set of methods offered over the RPC interface diff --git a/protocol/chainlib/chainproxy/rpcclient/utils.go b/protocol/chainlib/chainproxy/rpcclient/utils.go index 67a5ed5aaf..eebed6d9c0 100644 --- a/protocol/chainlib/chainproxy/rpcclient/utils.go +++ b/protocol/chainlib/chainproxy/rpcclient/utils.go @@ -1,7 +1,7 @@ package rpcclient import ( - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils/sigs" ) func CreateHashFromParams(params []byte) string { diff --git a/protocol/chainlib/common.go b/protocol/chainlib/common.go index e2cfb01f80..29a25401e6 100644 --- a/protocol/chainlib/common.go +++ b/protocol/chainlib/common.go @@ -14,11 +14,11 @@ import ( "github.com/gofiber/fiber/v2/middleware/compress" "github.com/gofiber/fiber/v2/middleware/favicon" "github.com/gofiber/websocket/v2" - common "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + common "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/metadata" ) diff --git a/protocol/chainlib/common_test.go b/protocol/chainlib/common_test.go index 1079574a61..7ca79f5d41 100644 --- a/protocol/chainlib/common_test.go +++ b/protocol/chainlib/common_test.go @@ -11,9 +11,9 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" websocket2 "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/common_test_utils.go b/protocol/chainlib/common_test_utils.go index 5d8c833663..88b545a721 100644 --- a/protocol/chainlib/common_test_utils.go +++ b/protocol/chainlib/common_test_utils.go @@ -12,23 +12,23 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" + "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/server/grpc/gogoreflection" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - testcommon "github.com/lavanet/lava/v3/testutil/common" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - specutils "github.com/lavanet/lava/v3/utils/keeper" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + testcommon "github.com/lavanet/lava/v4/testutil/common" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + specutils "github.com/lavanet/lava/v4/utils/keeper" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/protocol/chainlib/consumer_websocket_manager.go b/protocol/chainlib/consumer_websocket_manager.go index 5f47180489..6bf645cf4a 100644 --- a/protocol/chainlib/consumer_websocket_manager.go +++ b/protocol/chainlib/consumer_websocket_manager.go @@ -8,12 +8,12 @@ import ( "github.com/goccy/go-json" "github.com/gofiber/websocket/v2" - formatter "github.com/lavanet/lava/v3/ecosystem/cache/format" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + formatter "github.com/lavanet/lava/v4/ecosystem/cache/format" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/tidwall/gjson" ) diff --git a/protocol/chainlib/consumer_ws_subscription_manager.go b/protocol/chainlib/consumer_ws_subscription_manager.go index 102bd8240a..72ed94e3ee 100644 --- a/protocol/chainlib/consumer_ws_subscription_manager.go +++ b/protocol/chainlib/consumer_ws_subscription_manager.go @@ -7,15 +7,15 @@ import ( "sync" gojson "github.com/goccy/go-json" - rpcclient "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/protocopy" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + rpcclient "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/protocopy" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type unsubscribeRelayData struct { diff --git a/protocol/chainlib/consumer_ws_subscription_manager_test.go b/protocol/chainlib/consumer_ws_subscription_manager_test.go index 48573a3512..08015c239f 100644 --- a/protocol/chainlib/consumer_ws_subscription_manager_test.go +++ b/protocol/chainlib/consumer_ws_subscription_manager_test.go @@ -11,16 +11,16 @@ import ( "time" gomock "github.com/golang/mock/gomock" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" gomockuber "go.uber.org/mock/gomock" @@ -725,7 +725,7 @@ func CreateConsumerSessionManager(chainID, apiInterface, consumerPublicAddress s baseLatency := common.AverageWorldLatency / 2 // we want performance to be half our timeout or better return lavasession.NewConsumerSessionManager( &lavasession.RPCEndpoint{NetworkAddress: "stub", ChainID: chainID, ApiInterface: apiInterface, TLSEnabled: false, HealthCheckPath: "/", Geolocation: 0}, - provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1), + provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1, nil, "dontcare"), nil, nil, consumerPublicAddress, lavasession.NewActiveSubscriptionProvidersStorage(), ) diff --git a/protocol/chainlib/extensionslib/archive_parser_rule.go b/protocol/chainlib/extensionslib/archive_parser_rule.go index 13921346ac..d41964b0a7 100644 --- a/protocol/chainlib/extensionslib/archive_parser_rule.go +++ b/protocol/chainlib/extensionslib/archive_parser_rule.go @@ -1,7 +1,7 @@ package extensionslib import ( - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type ArchiveParserRule struct { diff --git a/protocol/chainlib/extensionslib/extension_parser.go b/protocol/chainlib/extensionslib/extension_parser.go index 47fc08922f..c8fc38db90 100644 --- a/protocol/chainlib/extensionslib/extension_parser.go +++ b/protocol/chainlib/extensionslib/extension_parser.go @@ -1,7 +1,7 @@ package extensionslib import ( - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type ExtensionInfo struct { @@ -27,10 +27,17 @@ type ExtensionParserRule interface { } type ExtensionParser struct { - AllowedExtensions map[string]struct{} + allowedExtensions map[string]struct{} configuredExtensions map[ExtensionKey]*spectypes.Extension } +func NewExtensionParser(allowedExtensions map[string]struct{}, configuredExtensions map[ExtensionKey]*spectypes.Extension) ExtensionParser { + return ExtensionParser{ + allowedExtensions: allowedExtensions, + configuredExtensions: configuredExtensions, + } +} + func (ep *ExtensionParser) GetExtension(extension ExtensionKey) *spectypes.Extension { if extension.Extension == "" { return nil @@ -50,7 +57,7 @@ func (ep *ExtensionParser) AllowedExtension(extension string) bool { if extension == "" { return true } - _, ok := ep.AllowedExtensions[extension] + _, ok := ep.allowedExtensions[extension] return ok } diff --git a/protocol/chainlib/grpc.go b/protocol/chainlib/grpc.go index f2425c12c7..b026e8b9d8 100644 --- a/protocol/chainlib/grpc.go +++ b/protocol/chainlib/grpc.go @@ -14,11 +14,11 @@ import ( "github.com/goccy/go-json" "github.com/gogo/protobuf/jsonpb" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy" - dyncodec "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy/dyncodec" - "github.com/lavanet/lava/v3/protocol/parser" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy" + dyncodec "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy/dyncodec" + "github.com/lavanet/lava/v4/protocol/parser" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -29,15 +29,15 @@ import ( "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "github.com/jhump/protoreflect/grpcreflect" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" reflectionpbo "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/grpc/status" ) @@ -202,7 +202,7 @@ func (apip *GrpcChainParser) SetSpec(spec spectypes.Spec) { // extract server and tagged apis from spec internalPaths, serverApis, taggedApis, apiCollections, headers, verifications := getServiceApis(spec, spectypes.APIInterfaceGrpc) - apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications, apip.BaseChainParser.extensionParser) + apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications) } // DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold) diff --git a/protocol/chainlib/grpc_test.go b/protocol/chainlib/grpc_test.go index 68e5d2ece5..119ba64e84 100644 --- a/protocol/chainlib/grpc_test.go +++ b/protocol/chainlib/grpc_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/parser" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/parser" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/grpcproxy/dyncodec/registry.go b/protocol/chainlib/grpcproxy/dyncodec/registry.go index 63aa527648..810a1c64c8 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/registry.go +++ b/protocol/chainlib/grpcproxy/dyncodec/registry.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" diff --git a/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go b/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go index 2e0e692388..4ec1ef6642 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go +++ b/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "google.golang.org/grpc" "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/protobuf/proto" diff --git a/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go b/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go index 1ece97e57f..f8268cc170 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go +++ b/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go @@ -3,7 +3,7 @@ package dyncodec import ( "context" - "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy" "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go b/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go index 711277c022..c5ca216ad4 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go +++ b/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy/testproto" + "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy/testproto" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/protocol/chainlib/grpcproxy/grpcproxy.go b/protocol/chainlib/grpcproxy/grpcproxy.go index d9e86fa48b..030da061ac 100644 --- a/protocol/chainlib/grpcproxy/grpcproxy.go +++ b/protocol/chainlib/grpcproxy/grpcproxy.go @@ -7,8 +7,8 @@ import ( "github.com/gofiber/fiber/v2" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" diff --git a/protocol/chainlib/grpcproxy/grpcproxy_test.go b/protocol/chainlib/grpcproxy/grpcproxy_test.go index 2f766868bf..76b4ea999b 100644 --- a/protocol/chainlib/grpcproxy/grpcproxy_test.go +++ b/protocol/chainlib/grpcproxy/grpcproxy_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/lavanet/lava/v3/protocol/chainlib/grpcproxy/testproto" - "github.com/lavanet/lava/v3/protocol/common" + "github.com/lavanet/lava/v4/protocol/chainlib/grpcproxy/testproto" + "github.com/lavanet/lava/v4/protocol/common" "github.com/stretchr/testify/require" "google.golang.org/grpc/metadata" ) diff --git a/protocol/chainlib/jsonRPC.go b/protocol/chainlib/jsonRPC.go index da5f256411..99dbe2a116 100644 --- a/protocol/chainlib/jsonRPC.go +++ b/protocol/chainlib/jsonRPC.go @@ -14,18 +14,18 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/parser" - - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/parser" + + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const SEP = "&" @@ -255,7 +255,7 @@ func (apip *JsonRPCChainParser) SetSpec(spec spectypes.Spec) { // extract server and tagged apis from spec internalPaths, serverApis, taggedApis, apiCollections, headers, verifications := getServiceApis(spec, spectypes.APIInterfaceJsonRPC) - apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications, apip.BaseChainParser.extensionParser) + apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications) } func (apip *JsonRPCChainParser) GetInternalPaths() map[string]struct{} { diff --git a/protocol/chainlib/jsonRPC_test.go b/protocol/chainlib/jsonRPC_test.go index 7158e98704..885bf953d2 100644 --- a/protocol/chainlib/jsonRPC_test.go +++ b/protocol/chainlib/jsonRPC_test.go @@ -10,12 +10,12 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - specutils "github.com/lavanet/lava/v3/utils/keeper" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + specutils "github.com/lavanet/lava/v4/utils/keeper" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/node_error_handler.go b/protocol/chainlib/node_error_handler.go index 2946ad17d2..9376d54644 100644 --- a/protocol/chainlib/node_error_handler.go +++ b/protocol/chainlib/node_error_handler.go @@ -11,13 +11,13 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type genericErrorHandler struct{} diff --git a/protocol/chainlib/node_error_handler_test.go b/protocol/chainlib/node_error_handler_test.go index 785c2346fc..ca46152020 100644 --- a/protocol/chainlib/node_error_handler_test.go +++ b/protocol/chainlib/node_error_handler_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/protocol_message.go b/protocol/chainlib/protocol_message.go index fc9b1789d4..a69da9a074 100644 --- a/protocol/chainlib/protocol_message.go +++ b/protocol/chainlib/protocol_message.go @@ -3,8 +3,8 @@ package chainlib import ( "strings" - "github.com/lavanet/lava/v3/protocol/common" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/common" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type UserData struct { diff --git a/protocol/chainlib/provider_node_subscription_manager.go b/protocol/chainlib/provider_node_subscription_manager.go index 21a8f9e8c9..c9802160e7 100644 --- a/protocol/chainlib/provider_node_subscription_manager.go +++ b/protocol/chainlib/provider_node_subscription_manager.go @@ -9,16 +9,16 @@ import ( "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" gojson "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/protocopy" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/protocopy" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const SubscriptionTimeoutDuration = 15 * time.Minute diff --git a/protocol/chainlib/provider_node_subscription_manager_test.go b/protocol/chainlib/provider_node_subscription_manager_test.go index 9a8e24fb67..5a45a32369 100644 --- a/protocol/chainlib/provider_node_subscription_manager_test.go +++ b/protocol/chainlib/provider_node_subscription_manager_test.go @@ -9,11 +9,11 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/rest.go b/protocol/chainlib/rest.go index 919c49374e..47622a9c2c 100644 --- a/protocol/chainlib/rest.go +++ b/protocol/chainlib/rest.go @@ -11,22 +11,22 @@ import ( "strings" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" "google.golang.org/grpc" "google.golang.org/grpc/metadata" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/gofiber/fiber/v2" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/metrics" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/metrics" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type RestChainParser struct { @@ -202,7 +202,7 @@ func (apip *RestChainParser) SetSpec(spec spectypes.Spec) { // extract server and tagged apis from spec internalPaths, serverApis, taggedApis, apiCollections, headers, verifications := getServiceApis(spec, spectypes.APIInterfaceRest) - apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications, apip.BaseChainParser.extensionParser) + apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications) } // DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold) diff --git a/protocol/chainlib/rest_test.go b/protocol/chainlib/rest_test.go index 918888bf1a..1521ac445d 100644 --- a/protocol/chainlib/rest_test.go +++ b/protocol/chainlib/rest_test.go @@ -8,13 +8,13 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/parser" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/parser" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/tendermintRPC.go b/protocol/chainlib/tendermintRPC.go index ae491455f1..be0dae3648 100644 --- a/protocol/chainlib/tendermintRPC.go +++ b/protocol/chainlib/tendermintRPC.go @@ -15,17 +15,17 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -289,7 +289,7 @@ func (apip *TendermintChainParser) SetSpec(spec spectypes.Spec) { // extract server and tagged apis from spec internalPaths, serverApis, taggedApis, apiCollections, headers, verifications := getServiceApis(spec, spectypes.APIInterfaceTendermintRPC) - apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications, apip.BaseChainParser.extensionParser) + apip.BaseChainParser.Construct(spec, internalPaths, taggedApis, serverApis, apiCollections, headers, verifications) } // DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold) diff --git a/protocol/chainlib/tendermintRPC_test.go b/protocol/chainlib/tendermintRPC_test.go index ac98b20902..93e4930146 100644 --- a/protocol/chainlib/tendermintRPC_test.go +++ b/protocol/chainlib/tendermintRPC_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chaintracker/chain_tracker.go b/protocol/chaintracker/chain_tracker.go index 29d6d390d6..02e792dd55 100644 --- a/protocol/chaintracker/chain_tracker.go +++ b/protocol/chaintracker/chain_tracker.go @@ -11,14 +11,14 @@ import ( "sync/atomic" "time" - rand "github.com/lavanet/lava/v3/utils/rand" + rand "github.com/lavanet/lava/v4/utils/rand" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" grpc "google.golang.org/grpc" diff --git a/protocol/chaintracker/chain_tracker_test.go b/protocol/chaintracker/chain_tracker_test.go index 1ebcf62a21..e0ce802685 100644 --- a/protocol/chaintracker/chain_tracker_test.go +++ b/protocol/chaintracker/chain_tracker_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - chaintracker "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - rand "github.com/lavanet/lava/v3/utils/rand" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + chaintracker "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + rand "github.com/lavanet/lava/v4/utils/rand" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/chaintracker/config.go b/protocol/chaintracker/config.go index b5e193cf8c..f226eb6528 100644 --- a/protocol/chaintracker/config.go +++ b/protocol/chaintracker/config.go @@ -3,7 +3,7 @@ package chaintracker import ( "time" - "github.com/lavanet/lava/v3/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/metrics" ) const ( diff --git a/protocol/chaintracker/wanted_block_data.go b/protocol/chaintracker/wanted_block_data.go index e44e87b65f..914bcd44a8 100644 --- a/protocol/chaintracker/wanted_block_data.go +++ b/protocol/chaintracker/wanted_block_data.go @@ -3,7 +3,7 @@ package chaintracker import ( fmt "fmt" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type BlockRange struct { diff --git a/protocol/chaintracker/wanted_block_data_test.go b/protocol/chaintracker/wanted_block_data_test.go index 51eefd4560..49f6bd621d 100644 --- a/protocol/chaintracker/wanted_block_data_test.go +++ b/protocol/chaintracker/wanted_block_data_test.go @@ -4,8 +4,8 @@ import ( fmt "fmt" "testing" - chaintracker "github.com/lavanet/lava/v3/protocol/chaintracker" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + chaintracker "github.com/lavanet/lava/v4/protocol/chaintracker" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/common/cobra_common.go b/protocol/common/cobra_common.go index 7574e9dd23..17a2bef31b 100644 --- a/protocol/common/cobra_common.go +++ b/protocol/common/cobra_common.go @@ -3,7 +3,7 @@ package common import ( "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -39,6 +39,10 @@ const ( SetProviderOptimizerWorstTierPickChance = "set-provider-optimizer-worst-tier-pick-chance" SetProviderOptimizerNumberOfTiersToCreate = "set-provider-optimizer-number-of-tiers-to-create" + // optimizer qos server flags + OptimizerQosServerAddressFlag = "optimizer-qos-server-address" // address of the optimizer qos server to send the qos reports + OptimizerQosServerPushIntervalFlag = "optimizer-qos-push-interval" // interval to push the qos reports to the optimizer qos server + OptimizerQosServerSamplingIntervalFlag = "optimizer-qos-sampling-interval" // interval to sample the qos reports // websocket flags RateLimitWebSocketFlag = "rate-limit-websocket-requests-per-connection" BanDurationForWebsocketRateLimitExceededFlag = "ban-duration-for-websocket-rate-limit-exceeded" diff --git a/protocol/common/collections.go b/protocol/common/collections.go index a1e31e2839..a6e5254ded 100644 --- a/protocol/common/collections.go +++ b/protocol/common/collections.go @@ -1,7 +1,7 @@ package common import ( - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/common/endpoints.go b/protocol/common/endpoints.go index 435fcde26c..26d08ca5a5 100644 --- a/protocol/common/endpoints.go +++ b/protocol/common/endpoints.go @@ -8,10 +8,10 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" ) diff --git a/protocol/common/safe_channel_sender.go b/protocol/common/safe_channel_sender.go index 368ee395c4..4c8c603659 100644 --- a/protocol/common/safe_channel_sender.go +++ b/protocol/common/safe_channel_sender.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const retryAttemptsForChannelWrite = 10 diff --git a/protocol/common/safe_sync_map.go b/protocol/common/safe_sync_map.go index b0e94a421c..47b25cf5ba 100644 --- a/protocol/common/safe_sync_map.go +++ b/protocol/common/safe_sync_map.go @@ -3,7 +3,7 @@ package common import ( "sync" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type SafeSyncMap[K, V any] struct { @@ -46,6 +46,20 @@ func (ssm *SafeSyncMap[K, V]) LoadOrStore(key K, value V) (ret V, loaded bool, e return value, false, nil } -func (ssm *SafeSyncMap[K, V]) Range(f func(key, value any) bool) { - ssm.localMap.Range(f) +func (ssm *SafeSyncMap[K, V]) Range(f func(key K, value V) bool) { + ssm.localMap.Range(func(key, value any) bool { + unboxedKey, ok := key.(K) + if !ok { + utils.LavaFormatError("invalid usage of sync map, could not cast key into a type", nil) + return false + } + + unboxedValue, ok := value.(V) + if !ok { + utils.LavaFormatError("invalid usage of sync map, could not cast value into a type", nil) + return false + } + + return f(unboxedKey, unboxedValue) + }) } diff --git a/protocol/common/tx_parsing.go b/protocol/common/tx_parsing.go index b62f96a837..89e168bd6f 100644 --- a/protocol/common/tx_parsing.go +++ b/protocol/common/tx_parsing.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/spf13/pflag" ) diff --git a/protocol/integration/mocks.go b/protocol/integration/mocks.go index bfb4698acb..ab03f9fa2f 100644 --- a/protocol/integration/mocks.go +++ b/protocol/integration/mocks.go @@ -9,18 +9,18 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) type TxConflictDetectionMock func(context.Context, *conflicttypes.FinalizationConflict, *conflicttypes.ResponseConflict, common.ConflictHandlerInterface) error diff --git a/protocol/integration/protocol_test.go b/protocol/integration/protocol_test.go index cf3a0412d0..ee7823f669 100644 --- a/protocol/integration/protocol_test.go +++ b/protocol/integration/protocol_test.go @@ -16,28 +16,28 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/ecosystem/cache" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/performance" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/protocol/rpcconsumer" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/ecosystem/cache" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/performance" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/protocol/rpcconsumer" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" "github.com/stretchr/testify/require" "google.golang.org/grpc/connectivity" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) var ( @@ -205,7 +205,7 @@ func createRpcConsumer(t *testing.T, ctx context.Context, rpcConsumerOptions rpc finalizationConsensus := finalizationconsensus.NewFinalizationConsensus(rpcEndpoint.ChainID) _, averageBlockTime, _, _ := chainParser.ChainBlockStats() baseLatency := common.AverageWorldLatency / 2 - optimizer := provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, averageBlockTime, baseLatency, 2) + optimizer := provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, averageBlockTime, baseLatency, 2, nil, "dontcare") consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, nil, nil, "test", lavasession.NewActiveSubscriptionProvidersStorage()) consumerSessionManager.UpdateAllProviders(rpcConsumerOptions.epoch, rpcConsumerOptions.pairingList) @@ -219,7 +219,7 @@ func createRpcConsumer(t *testing.T, ctx context.Context, rpcConsumerOptions rpc consumerConsistency := rpcconsumer.NewConsumerConsistency(rpcConsumerOptions.specId) consumerCmdFlags := common.ConsumerCmdFlags{} - rpcconsumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil) + rpcconsumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil, nil) require.NoError(t, err) err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, rpcConsumerOptions.requiredResponses, rpcConsumerOptions.account.SK, rpcConsumerOptions.lavaChainID, cache, rpcconsumerLogs, rpcConsumerOptions.account.Addr, consumerConsistency, nil, consumerCmdFlags, false, nil, nil, nil) require.NoError(t, err) diff --git a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go index bd9ce1440c..fc12c0040b 100644 --- a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go +++ b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go @@ -10,11 +10,11 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type ChainBlockStatsGetter interface { diff --git a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go index a39390979a..194265384c 100644 --- a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go +++ b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go @@ -9,15 +9,15 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/lavasession" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/lavasession" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/lavaprotocol/finalizationverification/finalization_verification.go b/protocol/lavaprotocol/finalizationverification/finalization_verification.go index 9b2ac088b3..1d2d18bd93 100644 --- a/protocol/lavaprotocol/finalizationverification/finalization_verification.go +++ b/protocol/lavaprotocol/finalizationverification/finalization_verification.go @@ -5,15 +5,15 @@ import ( "errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/protocolerrors" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) func VerifyFinalizationData(reply *pairingtypes.RelayReply, relayRequest *pairingtypes.RelayRequest, providerAddr string, consumerAcc sdk.AccAddress, latestSessionBlock, blockDistanceForFinalization, blocksInFinalizationProof int64) (finalizedBlocks map[int64]string, errRet error) { diff --git a/protocol/lavaprotocol/relay_retries_manager.go b/protocol/lavaprotocol/relay_retries_manager.go index 5a1c852189..ca32c577d5 100644 --- a/protocol/lavaprotocol/relay_retries_manager.go +++ b/protocol/lavaprotocol/relay_retries_manager.go @@ -4,7 +4,7 @@ import ( "time" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) // entries ttl duration diff --git a/protocol/lavaprotocol/request_builder.go b/protocol/lavaprotocol/request_builder.go index ed19cab900..1d00942355 100644 --- a/protocol/lavaprotocol/request_builder.go +++ b/protocol/lavaprotocol/request_builder.go @@ -6,14 +6,14 @@ import ( "encoding/binary" "github.com/btcsuite/btcd/btcec/v2" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - conflictconstruct "github.com/lavanet/lava/v3/x/conflict/types/construct" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + conflictconstruct "github.com/lavanet/lava/v4/x/conflict/types/construct" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type HeaderFilterer interface { diff --git a/protocol/lavaprotocol/response_builder.go b/protocol/lavaprotocol/response_builder.go index aade93b90a..6054c1d2d6 100644 --- a/protocol/lavaprotocol/response_builder.go +++ b/protocol/lavaprotocol/response_builder.go @@ -6,12 +6,12 @@ import ( btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/protocolerrors" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) func CraftEmptyRPCResponseFromGenericMessage(message rpcInterfaceMessages.GenericMessage) (*rpcInterfaceMessages.RPCResponse, error) { diff --git a/protocol/lavaprotocol/response_builder_test.go b/protocol/lavaprotocol/response_builder_test.go index 84fa93b0a8..e8d545c706 100644 --- a/protocol/lavaprotocol/response_builder_test.go +++ b/protocol/lavaprotocol/response_builder_test.go @@ -6,11 +6,11 @@ import ( "encoding/json" "testing" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationverification" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationverification" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/lavaprotocol/reuqest_builder_test.go b/protocol/lavaprotocol/reuqest_builder_test.go index 3cd061e6da..8f49fb9add 100644 --- a/protocol/lavaprotocol/reuqest_builder_test.go +++ b/protocol/lavaprotocol/reuqest_builder_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/lavasession/active_subscription_provider_storage.go b/protocol/lavasession/active_subscription_provider_storage.go index 3849b7bbdf..701c57d1ad 100644 --- a/protocol/lavasession/active_subscription_provider_storage.go +++ b/protocol/lavasession/active_subscription_provider_storage.go @@ -3,7 +3,7 @@ package lavasession import ( "sync" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) // stores all providers that are currently used to stream subscriptions. diff --git a/protocol/lavasession/common.go b/protocol/lavasession/common.go index 9d5845a790..dc18f49950 100644 --- a/protocol/lavasession/common.go +++ b/protocol/lavasession/common.go @@ -17,10 +17,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/status" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/keeper/scores" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/keeper/scores" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" diff --git a/protocol/lavasession/common_test.go b/protocol/lavasession/common_test.go index 660ef08069..04ef330d5a 100644 --- a/protocol/lavasession/common_test.go +++ b/protocol/lavasession/common_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/protocol/lavasession/consumer_session_manager.go b/protocol/lavasession/consumer_session_manager.go index 7fef3af42e..8ca37ff6fe 100644 --- a/protocol/lavasession/consumer_session_manager.go +++ b/protocol/lavasession/consumer_session_manager.go @@ -10,13 +10,13 @@ import ( "time" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/v3/protocol/common" - metrics "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + metrics "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -114,7 +114,8 @@ func (csm *ConsumerSessionManager) UpdateAllProviders(epoch uint64, pairingList csm.setValidAddressesToDefaultValue("", nil) // the starting point is that valid addresses are equal to pairing addresses. // reset session related metrics csm.consumerMetricsManager.ResetSessionRelatedMetrics() - csm.providerOptimizer.UpdateWeights(CalcWeightsByStake(pairingList)) + go csm.providerOptimizer.UpdateWeights(CalcWeightsByStake(pairingList), epoch) + utils.LavaFormatDebug("updated providers", utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "spec", Value: csm.rpcEndpoint.Key()}) return nil } @@ -1126,7 +1127,14 @@ func (csm *ConsumerSessionManager) GenerateReconnectCallback(consumerSessionsWit } } -func NewConsumerSessionManager(rpcEndpoint *RPCEndpoint, providerOptimizer ProviderOptimizer, consumerMetricsManager *metrics.ConsumerMetricsManager, reporter metrics.Reporter, consumerPublicAddress string, activeSubscriptionProvidersStorage *ActiveSubscriptionProvidersStorage) *ConsumerSessionManager { +func NewConsumerSessionManager( + rpcEndpoint *RPCEndpoint, + providerOptimizer ProviderOptimizer, + consumerMetricsManager *metrics.ConsumerMetricsManager, + reporter metrics.Reporter, + consumerPublicAddress string, + activeSubscriptionProvidersStorage *ActiveSubscriptionProvidersStorage, +) *ConsumerSessionManager { csm := &ConsumerSessionManager{ reportedProviders: NewReportedProviders(reporter, rpcEndpoint.ChainID), consumerMetricsManager: consumerMetricsManager, diff --git a/protocol/lavasession/consumer_session_manager_test.go b/protocol/lavasession/consumer_session_manager_test.go index b22f0c2e61..7d46c63b16 100644 --- a/protocol/lavasession/consumer_session_manager_test.go +++ b/protocol/lavasession/consumer_session_manager_test.go @@ -12,13 +12,13 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/rand" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/rand" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -162,7 +162,7 @@ func TestEndpointSortingFlow(t *testing.T) { func CreateConsumerSessionManager() *ConsumerSessionManager { rand.InitRandomSeed() baseLatency := common.AverageWorldLatency / 2 // we want performance to be half our timeout or better - return NewConsumerSessionManager(&RPCEndpoint{"stub", "stub", "stub", false, "/", 0}, provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1), nil, nil, "lava@test", NewActiveSubscriptionProvidersStorage()) + return NewConsumerSessionManager(&RPCEndpoint{"stub", "stub", "stub", false, "/", 0}, provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1, nil, "dontcare"), nil, nil, "lava@test", NewActiveSubscriptionProvidersStorage()) } func TestMain(m *testing.M) { diff --git a/protocol/lavasession/consumer_types.go b/protocol/lavasession/consumer_types.go index 67c8b7b259..deb11f7994 100644 --- a/protocol/lavasession/consumer_types.go +++ b/protocol/lavasession/consumer_types.go @@ -8,11 +8,11 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" ) @@ -76,7 +76,7 @@ type ProviderOptimizer interface { ChooseProvider(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64) (addresses []string, tier int) GetExcellenceQoSReportForProvider(string) (*pairingtypes.QualityOfServiceReport, *pairingtypes.QualityOfServiceReport) Strategy() provideroptimizer.Strategy - UpdateWeights(map[string]int64) + UpdateWeights(map[string]int64, uint64) } type ignoredProviders struct { diff --git a/protocol/lavasession/end_to_end_lavasession_test.go b/protocol/lavasession/end_to_end_lavasession_test.go index 0b434855b6..de9fb09186 100644 --- a/protocol/lavasession/end_to_end_lavasession_test.go +++ b/protocol/lavasession/end_to_end_lavasession_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/common" + "github.com/lavanet/lava/v4/protocol/common" "github.com/stretchr/testify/require" ) diff --git a/protocol/lavasession/provider_session_manager.go b/protocol/lavasession/provider_session_manager.go index 2050400202..e2e198a286 100644 --- a/protocol/lavasession/provider_session_manager.go +++ b/protocol/lavasession/provider_session_manager.go @@ -5,9 +5,9 @@ import ( "sync" "sync/atomic" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type ProviderSessionManager struct { diff --git a/protocol/lavasession/provider_session_manager_test.go b/protocol/lavasession/provider_session_manager_test.go index aa53a57114..00d8617e4a 100644 --- a/protocol/lavasession/provider_session_manager_test.go +++ b/protocol/lavasession/provider_session_manager_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/lavasession/provider_types.go b/protocol/lavasession/provider_types.go index a0576f106a..955abe4b3d 100644 --- a/protocol/lavasession/provider_types.go +++ b/protocol/lavasession/provider_types.go @@ -7,9 +7,9 @@ import ( "sync" "sync/atomic" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" ) type ProviderSessionsEpochData struct { diff --git a/protocol/lavasession/reported_providers.go b/protocol/lavasession/reported_providers.go index 5164670d44..6330fca572 100644 --- a/protocol/lavasession/reported_providers.go +++ b/protocol/lavasession/reported_providers.go @@ -4,9 +4,9 @@ import ( "sync" "time" - metrics "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + metrics "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/protocol/lavasession/single_consumer_session.go b/protocol/lavasession/single_consumer_session.go index 7aa0dc1304..4fc8b1b67d 100644 --- a/protocol/lavasession/single_consumer_session.go +++ b/protocol/lavasession/single_consumer_session.go @@ -7,8 +7,8 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type SingleConsumerSession struct { diff --git a/protocol/lavasession/single_provider_session.go b/protocol/lavasession/single_provider_session.go index 3ea299d3c3..cfe62a508b 100644 --- a/protocol/lavasession/single_provider_session.go +++ b/protocol/lavasession/single_provider_session.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const ( diff --git a/protocol/lavasession/used_providers.go b/protocol/lavasession/used_providers.go index dcf95d951e..bcfcd0c2a0 100644 --- a/protocol/lavasession/used_providers.go +++ b/protocol/lavasession/used_providers.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const MaximumNumberOfSelectionLockAttempts = 500 diff --git a/protocol/loadtest/testing.go b/protocol/loadtest/testing.go index f067fc0001..d2fcc0d239 100644 --- a/protocol/loadtest/testing.go +++ b/protocol/loadtest/testing.go @@ -13,7 +13,7 @@ import ( "time" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/protocol/metrics/consumer_optimizer_qos_client.go b/protocol/metrics/consumer_optimizer_qos_client.go new file mode 100644 index 0000000000..f204107e17 --- /dev/null +++ b/protocol/metrics/consumer_optimizer_qos_client.go @@ -0,0 +1,281 @@ +package metrics + +import ( + "context" + "os" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/goccy/go-json" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + "golang.org/x/exp/maps" +) + +var ( + OptimizerQosServerPushInterval time.Duration + OptimizerQosServerSamplingInterval time.Duration +) + +type ConsumerOptimizerQoSClient struct { + consumerOrigin string + queueSender *QueueSender + optimizers map[string]OptimizerInf // keys are chain ids + // keys are chain ids, values are maps with provider addresses as keys + chainIdToProviderToRelaysCount map[string]map[string]uint64 + chainIdToProviderToNodeErrorsCount map[string]map[string]uint64 + chainIdToProviderToEpochToStake map[string]map[string]map[uint64]int64 // third key is epoch + currentEpoch atomic.Uint64 + lock sync.RWMutex +} + +type OptimizerQoSReport struct { + ProviderAddress string + SyncScore float64 + AvailabilityScore float64 + LatencyScore float64 + GenericScore float64 + EntryIndex int +} + +type optimizerQoSReportToSend struct { + Timestamp time.Time `json:"timestamp"` + SyncScore float64 `json:"sync_score"` + AvailabilityScore float64 `json:"availability_score"` + LatencyScore float64 `json:"latency_score"` + GenericScore float64 `json:"generic_score"` + ProviderAddress string `json:"provider"` + ConsumerOrigin string `json:"consumer"` + ChainId string `json:"chain_id"` + NodeErrorRate float64 `json:"node_error_rate"` + Epoch uint64 `json:"epoch"` + ProviderStake int64 `json:"provider_stake"` + EntryIndex int `json:"entry_index"` +} + +func (oqosr optimizerQoSReportToSend) String() string { + bytes, err := json.Marshal(oqosr) + if err != nil { + return "" + } + return string(bytes) +} + +type OptimizerInf interface { + CalculateQoSScoresForMetrics(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64) []*OptimizerQoSReport +} + +func NewConsumerOptimizerQoSClient(endpointAddress string, interval ...time.Duration) *ConsumerOptimizerQoSClient { + hostname, err := os.Hostname() + if err != nil { + utils.LavaFormatWarning("Error while getting hostname for ConsumerOptimizerQoSClient", err) + hostname = "unknown" + strconv.FormatUint(rand.Uint64(), 10) // random seed for different unknowns + } + + return &ConsumerOptimizerQoSClient{ + consumerOrigin: hostname, + queueSender: NewQueueSender(endpointAddress, "ConsumerOptimizerQoS", nil, interval...), + optimizers: map[string]OptimizerInf{}, + chainIdToProviderToRelaysCount: map[string]map[string]uint64{}, + chainIdToProviderToNodeErrorsCount: map[string]map[string]uint64{}, + chainIdToProviderToEpochToStake: map[string]map[string]map[uint64]int64{}, + } +} + +func (coqc *ConsumerOptimizerQoSClient) getProviderChainMapCounterValue(counterStore map[string]map[string]uint64, chainId, providerAddress string) uint64 { + // must be called under read lock + if counterProvidersMap, found := counterStore[chainId]; found { + return counterProvidersMap[providerAddress] + } + return 0 +} + +func (coqc *ConsumerOptimizerQoSClient) getProviderChainRelaysCount(chainId, providerAddress string) uint64 { + // must be called under read lock + return coqc.getProviderChainMapCounterValue(coqc.chainIdToProviderToRelaysCount, chainId, providerAddress) +} + +func (coqc *ConsumerOptimizerQoSClient) getProviderChainNodeErrorsCount(chainId, providerAddress string) uint64 { + // must be called under read lock + return coqc.getProviderChainMapCounterValue(coqc.chainIdToProviderToNodeErrorsCount, chainId, providerAddress) +} + +func (coqc *ConsumerOptimizerQoSClient) getProviderChainStake(chainId, providerAddress string, epoch uint64) int64 { + // must be called under read lock + if providersMap, found := coqc.chainIdToProviderToEpochToStake[chainId]; found { + if epochMap, found := providersMap[providerAddress]; found { + if stake, found := epochMap[epoch]; found { + return stake + } + } + } + return 0 +} + +func (coqc *ConsumerOptimizerQoSClient) calculateNodeErrorRate(chainId, providerAddress string) float64 { + // must be called under read lock + relaysCount := coqc.getProviderChainRelaysCount(chainId, providerAddress) + if relaysCount > 0 { + errorsCount := coqc.getProviderChainNodeErrorsCount(chainId, providerAddress) + return float64(errorsCount) / float64(relaysCount) + } + + return 0 +} + +func (coqc *ConsumerOptimizerQoSClient) appendOptimizerQoSReport(report *OptimizerQoSReport, chainId string, epoch uint64) { + // must be called under read lock + + optimizerQoSReportToSend := optimizerQoSReportToSend{ + Timestamp: time.Now(), + ConsumerOrigin: coqc.consumerOrigin, + SyncScore: report.SyncScore, + AvailabilityScore: report.AvailabilityScore, + LatencyScore: report.LatencyScore, + GenericScore: report.GenericScore, + ProviderAddress: report.ProviderAddress, + EntryIndex: report.EntryIndex, + ChainId: chainId, + Epoch: epoch, + NodeErrorRate: coqc.calculateNodeErrorRate(chainId, report.ProviderAddress), + ProviderStake: coqc.getProviderChainStake(chainId, report.ProviderAddress, epoch), + } + + coqc.queueSender.appendQueue(optimizerQoSReportToSend) +} + +func (coqc *ConsumerOptimizerQoSClient) getReportsFromOptimizers() { + coqc.lock.RLock() // we only read from the maps here + defer coqc.lock.RUnlock() + + ignoredProviders := map[string]struct{}{} + cu := uint64(10) + requestedBlock := spectypes.LATEST_BLOCK + + currentEpoch := coqc.currentEpoch.Load() + + for chainId, optimizer := range coqc.optimizers { + providersMap, ok := coqc.chainIdToProviderToEpochToStake[chainId] + if !ok { + continue + } + + reports := optimizer.CalculateQoSScoresForMetrics(maps.Keys(providersMap), ignoredProviders, cu, requestedBlock) + for _, report := range reports { + coqc.appendOptimizerQoSReport(report, chainId, currentEpoch) + } + } +} + +func (coqc *ConsumerOptimizerQoSClient) StartOptimizersQoSReportsCollecting(ctx context.Context, samplingInterval time.Duration) { + if coqc == nil { + return + } + + utils.LavaFormatTrace("Starting ConsumerOptimizerQoSClient reports collecting") + go func() { + for { + select { + case <-ctx.Done(): + utils.LavaFormatTrace("ConsumerOptimizerQoSClient context done") + return + case <-time.After(samplingInterval): + coqc.getReportsFromOptimizers() + } + } + }() +} + +func (coqc *ConsumerOptimizerQoSClient) RegisterOptimizer(optimizer OptimizerInf, chainId string) { + if coqc == nil { + return + } + + coqc.lock.Lock() + defer coqc.lock.Unlock() + + if _, found := coqc.optimizers[chainId]; found { + utils.LavaFormatWarning("Optimizer already registered for chain", nil, utils.LogAttr("chainId", chainId)) + return + } + + coqc.optimizers[chainId] = optimizer +} + +func (coqc *ConsumerOptimizerQoSClient) incrementStoreCounter(store map[string]map[string]uint64, chainId, providerAddress string) { + // must be called under write lock + if coqc == nil { + return + } + + providersMap, found := store[chainId] + if !found { + store[chainId] = map[string]uint64{providerAddress: 1} + return + } + + count, found := providersMap[providerAddress] + if !found { + store[chainId][providerAddress] = 1 + return + } + + store[chainId][providerAddress] = count + 1 +} + +func (coqc *ConsumerOptimizerQoSClient) SetRelaySentToProvider(providerAddress string, chainId string) { + if coqc == nil { + return + } + + coqc.lock.Lock() + defer coqc.lock.Unlock() + + coqc.incrementStoreCounter(coqc.chainIdToProviderToRelaysCount, chainId, providerAddress) +} + +func (coqc *ConsumerOptimizerQoSClient) SetNodeErrorToProvider(providerAddress string, chainId string) { + if coqc == nil { + return + } + + coqc.lock.Lock() + defer coqc.lock.Unlock() + + coqc.incrementStoreCounter(coqc.chainIdToProviderToNodeErrorsCount, chainId, providerAddress) +} + +func (coqc *ConsumerOptimizerQoSClient) setProviderStake(chainId, providerAddress string, epoch uint64, stake int64) { + // must be called under write lock + coqc.currentEpoch.Store(epoch) + + providersMap, found := coqc.chainIdToProviderToEpochToStake[chainId] + if !found { + coqc.chainIdToProviderToEpochToStake[chainId] = map[string]map[uint64]int64{providerAddress: {epoch: stake}} + return + } + + epochMap, found := providersMap[providerAddress] + if !found { + coqc.chainIdToProviderToEpochToStake[chainId][providerAddress] = map[uint64]int64{epoch: stake} + return + } + + epochMap[epoch] = stake +} + +func (coqc *ConsumerOptimizerQoSClient) UpdatePairingListStake(stakeMap map[string]int64, chainId string, epoch uint64) { + if coqc == nil { + return + } + + coqc.lock.Lock() + defer coqc.lock.Unlock() + + for providerAddr, stake := range stakeMap { + coqc.setProviderStake(chainId, providerAddr, epoch, stake) + } +} diff --git a/protocol/metrics/consumer_referrer_client.go b/protocol/metrics/consumer_referrer_client.go index dffb098a64..13bd0b0cd9 100644 --- a/protocol/metrics/consumer_referrer_client.go +++ b/protocol/metrics/consumer_referrer_client.go @@ -6,7 +6,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const ( diff --git a/protocol/metrics/consumer_relayserver_client.go b/protocol/metrics/consumer_relayserver_client.go index 649270abec..06979988f7 100644 --- a/protocol/metrics/consumer_relayserver_client.go +++ b/protocol/metrics/consumer_relayserver_client.go @@ -10,7 +10,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type ConsumerRelayServerClient struct { diff --git a/protocol/metrics/consumer_reports_client.go b/protocol/metrics/consumer_reports_client.go index 0694b488e1..f13e7c3e3c 100644 --- a/protocol/metrics/consumer_reports_client.go +++ b/protocol/metrics/consumer_reports_client.go @@ -6,8 +6,8 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/protocol/metrics/consumer_reports_client_test.go b/protocol/metrics/consumer_reports_client_test.go index af9da90753..dfbc630290 100644 --- a/protocol/metrics/consumer_reports_client_test.go +++ b/protocol/metrics/consumer_reports_client_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/metrics/health_metrics.go b/protocol/metrics/health_metrics.go index a5d614a913..a84105dcc7 100644 --- a/protocol/metrics/health_metrics.go +++ b/protocol/metrics/health_metrics.go @@ -3,7 +3,7 @@ package metrics import ( "net/http" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/protocol/metrics/metricsService.go b/protocol/metrics/metricsService.go index e5fc41b37a..b7c80f94b2 100644 --- a/protocol/metrics/metricsService.go +++ b/protocol/metrics/metricsService.go @@ -9,7 +9,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type AggregatedMetric struct { diff --git a/protocol/metrics/metrics_consumer_manager.go b/protocol/metrics/metrics_consumer_manager.go index ce88f2145b..b3ac3e910e 100644 --- a/protocol/metrics/metrics_consumer_manager.go +++ b/protocol/metrics/metrics_consumer_manager.go @@ -7,8 +7,8 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/protocol/metrics/metrics_provider.go b/protocol/metrics/metrics_provider.go index b5c3f0761b..e4eadbe4dc 100644 --- a/protocol/metrics/metrics_provider.go +++ b/protocol/metrics/metrics_provider.go @@ -3,7 +3,7 @@ package metrics import ( "sync" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/protocol/metrics/metrics_provider_manager.go b/protocol/metrics/metrics_provider_manager.go index b71b90e664..f6734f69d2 100644 --- a/protocol/metrics/metrics_provider_manager.go +++ b/protocol/metrics/metrics_provider_manager.go @@ -7,8 +7,8 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/utils" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/protocol/metrics/queue_sender.go b/protocol/metrics/queue_sender.go index 8a266112a0..217b40c9e3 100644 --- a/protocol/metrics/queue_sender.go +++ b/protocol/metrics/queue_sender.go @@ -11,7 +11,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type QueueSender struct { @@ -64,7 +64,12 @@ func (crc *QueueSender) sendQueueTick() { crc.lock.Lock() defer crc.lock.Unlock() - if !crc.isSendQueueRunning && len(crc.addQueue) > 0 { + if len(crc.addQueue) == 0 { + utils.LavaFormatDebug(fmt.Sprintf("[QueueSender:%s] sendQueueTick: addQueue is empty", crc.name)) + return + } + + if !crc.isSendQueueRunning { sendQueue := crc.addQueue crc.addQueue = make([]fmt.Stringer, 0) crc.isSendQueueRunning = true diff --git a/protocol/metrics/relays_monitor.go b/protocol/metrics/relays_monitor.go index 542da952cb..ed505c779e 100644 --- a/protocol/metrics/relays_monitor.go +++ b/protocol/metrics/relays_monitor.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type RelaysMonitor struct { diff --git a/protocol/metrics/rpcconsumerlogs.go b/protocol/metrics/rpcconsumerlogs.go index dd5c36a3fd..d09f988716 100644 --- a/protocol/metrics/rpcconsumerlogs.go +++ b/protocol/metrics/rpcconsumerlogs.go @@ -12,9 +12,9 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" "github.com/joho/godotenv" - "github.com/lavanet/lava/v3/protocol/parser" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/protocol/parser" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" "github.com/newrelic/go-agent/v3/newrelic" "google.golang.org/grpc/metadata" ) @@ -29,16 +29,17 @@ const ( ) type RPCConsumerLogs struct { - newRelicApplication *newrelic.Application - MetricService *MetricService - StoreMetricData bool - excludeMetricsReferrers string - excludedUserAgent []string - consumerMetricsManager *ConsumerMetricsManager - consumerRelayServerClient *ConsumerRelayServerClient + newRelicApplication *newrelic.Application + MetricService *MetricService + StoreMetricData bool + excludeMetricsReferrers string + excludedUserAgent []string + consumerMetricsManager *ConsumerMetricsManager + consumerRelayServerClient *ConsumerRelayServerClient + consumerOptimizerQoSClient *ConsumerOptimizerQoSClient } -func NewRPCConsumerLogs(consumerMetricsManager *ConsumerMetricsManager, consumerRelayServerClient *ConsumerRelayServerClient) (*RPCConsumerLogs, error) { +func NewRPCConsumerLogs(consumerMetricsManager *ConsumerMetricsManager, consumerRelayServerClient *ConsumerRelayServerClient, consumerOptimizerQoSClient *ConsumerOptimizerQoSClient) (*RPCConsumerLogs, error) { err := godotenv.Load() if err != nil { utils.LavaFormatInfo("New relic missing environment file") @@ -49,7 +50,11 @@ func NewRPCConsumerLogs(consumerMetricsManager *ConsumerMetricsManager, consumer newRelicLicenseKey := os.Getenv("NEW_RELIC_LICENSE_KEY") if newRelicAppName == "" || newRelicLicenseKey == "" { utils.LavaFormatInfo("New relic missing environment variables") - return &RPCConsumerLogs{consumerMetricsManager: consumerMetricsManager, consumerRelayServerClient: consumerRelayServerClient}, nil + return &RPCConsumerLogs{ + consumerMetricsManager: consumerMetricsManager, + consumerRelayServerClient: consumerRelayServerClient, + consumerOptimizerQoSClient: consumerOptimizerQoSClient, + }, nil } newRelicApplication, err := newrelic.NewApplication( @@ -91,12 +96,19 @@ func (rpccl *RPCConsumerLogs) SetWebSocketConnectionActive(chainId string, apiIn rpccl.consumerMetricsManager.SetWebSocketConnectionActive(chainId, apiInterface, add) } -func (rpccl *RPCConsumerLogs) SetRelaySentToProviderMetric(chainId string, apiInterface string) { +func (rpccl *RPCConsumerLogs) SetRelaySentToProviderMetric(providerAddress, chainId, apiInterface string) { rpccl.consumerMetricsManager.SetRelaySentToProviderMetric(chainId, apiInterface) + rpccl.consumerOptimizerQoSClient.SetRelaySentToProvider(providerAddress, chainId) } -func (rpccl *RPCConsumerLogs) SetRelayNodeErrorMetric(chainId string, apiInterface string) { +func (rpccl *RPCConsumerLogs) SetRelayNodeErrorMetric(providerAddress, chainId, apiInterface string) { + if providerAddress == "" { + // skip if provider address is empty + return + } + rpccl.consumerMetricsManager.SetRelayNodeErrorMetric(chainId, apiInterface) + rpccl.consumerOptimizerQoSClient.SetNodeErrorToProvider(providerAddress, chainId) } func (rpccl *RPCConsumerLogs) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) { diff --git a/protocol/metrics/rpcconsumerlogs_test.go b/protocol/metrics/rpcconsumerlogs_test.go index ae3d96d260..2d09e15c65 100644 --- a/protocol/metrics/rpcconsumerlogs_test.go +++ b/protocol/metrics/rpcconsumerlogs_test.go @@ -9,7 +9,7 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" websocket2 "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/stretchr/testify/assert" ) @@ -23,7 +23,7 @@ type ErrorData struct { } func TestGetUniqueGuidResponseForError(t *testing.T) { - plog, err := NewRPCConsumerLogs(nil, nil) + plog, err := NewRPCConsumerLogs(nil, nil, nil) assert.Nil(t, err) responseError := errors.New("response error") @@ -39,7 +39,7 @@ func TestGetUniqueGuidResponseForError(t *testing.T) { } func TestGetUniqueGuidResponseDeterministic(t *testing.T) { - plog, err := NewRPCConsumerLogs(nil, nil) + plog, err := NewRPCConsumerLogs(nil, nil, nil) assert.Nil(t, err) responseError := errors.New("response error") @@ -58,7 +58,7 @@ func TestAnalyzeWebSocketErrorAndWriteMessage(t *testing.T) { app.Get("/", websocket.New(func(c *websocket.Conn) { mt, _, _ := c.ReadMessage() - plog, _ := NewRPCConsumerLogs(nil, nil) + plog, _ := NewRPCConsumerLogs(nil, nil, nil) responseError := errors.New("response error") formatterMsg := plog.AnalyzeWebSocketErrorAndGetFormattedMessage(c.LocalAddr().String(), responseError, "seed", []byte{}, "rpcType", 1*time.Millisecond) assert.NotNil(t, formatterMsg) diff --git a/protocol/monitoring/alerting.go b/protocol/monitoring/alerting.go index 4ed3c256e4..d5daa8b07a 100644 --- a/protocol/monitoring/alerting.go +++ b/protocol/monitoring/alerting.go @@ -11,8 +11,8 @@ import ( "github.com/goccy/go-json" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" ) const ( diff --git a/protocol/monitoring/health.go b/protocol/monitoring/health.go index e801b9bdf3..b27837c3e8 100644 --- a/protocol/monitoring/health.go +++ b/protocol/monitoring/health.go @@ -11,20 +11,19 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/gogo/status" - lvutil "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/protocolerrors" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + lvutil "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/viper" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -128,7 +127,7 @@ func RunHealth(ctx context.Context, errCh := make(chan error, 1) // get a list of all necessary specs for the test - dualStakingQuerier := dualstakingtypes.NewQueryClient(clientCtx) + epochstorageQuerier := epochstoragetypes.NewQueryClient(clientCtx) if getAllProviders { // var specResp *spectypes.QueryGetSpecResponse var specsResp *spectypes.QueryShowAllChainsResponse @@ -157,28 +156,23 @@ func RunHealth(ctx context.Context, defer wgproviders.Done() var err error for i := 0; i < BasicQueryRetries; i++ { - var response *dualstakingtypes.QueryDelegatorProvidersResponse + var response *epochstoragetypes.QueryProviderMetaDataResponse queryCtx, cancel := context.WithTimeout(ctx, 2*time.Second) - response, err = dualStakingQuerier.DelegatorProviders(queryCtx, &dualstakingtypes.QueryDelegatorProvidersRequest{ - Delegator: providerAddress, - WithPending: false, - }) + response, err = epochstorageQuerier.ProviderMetaData(queryCtx, &epochstoragetypes.QueryProviderMetaDataRequest{Provider: providerAddress}) cancel() if err != nil || response == nil { time.Sleep(QuerySleepTime) continue } - delegations := response.GetDelegations() - for _, delegation := range delegations { - if delegation.Provider == providerAddress { - healthResults.setSpec(&spectypes.Spec{Index: delegation.ChainID}) - for _, apiInterface := range chainIdToApiInterfaces[delegation.ChainID] { - healthResults.SetProviderData(LavaEntity{ - Address: providerAddress, - SpecId: delegation.ChainID, - ApiInterface: apiInterface, - }, ReplyData{}) - } + + for _, chain := range response.MetaData[0].Chains { + healthResults.setSpec(&spectypes.Spec{Index: chain}) + for _, apiInterface := range chainIdToApiInterfaces[chain] { + healthResults.SetProviderData(LavaEntity{ + Address: providerAddress, + SpecId: chain, + ApiInterface: apiInterface, + }, ReplyData{}) } } return diff --git a/protocol/monitoring/health_cmd.go b/protocol/monitoring/health_cmd.go index 6eee354d89..b0c8f9df29 100644 --- a/protocol/monitoring/health_cmd.go +++ b/protocol/monitoring/health_cmd.go @@ -13,12 +13,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/protocol/monitoring/health_results.go b/protocol/monitoring/health_results.go index e6e6671f74..b32d54e42d 100644 --- a/protocol/monitoring/health_results.go +++ b/protocol/monitoring/health_results.go @@ -4,9 +4,9 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils/lavaslices" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils/lavaslices" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type HealthResults struct { diff --git a/protocol/parser/parser.go b/protocol/parser/parser.go index 0eb958704f..8d5622e6a6 100644 --- a/protocol/parser/parser.go +++ b/protocol/parser/parser.go @@ -11,9 +11,9 @@ import ( "github.com/itchyny/gojq" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/parser/parser_test.go b/protocol/parser/parser_test.go index c005804850..dbb06f2ddb 100644 --- a/protocol/parser/parser_test.go +++ b/protocol/parser/parser_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/performance/cache.go b/protocol/performance/cache.go index 0cfc7a2d0d..638644fbff 100644 --- a/protocol/performance/cache.go +++ b/protocol/performance/cache.go @@ -6,9 +6,9 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type relayerCacheClientStore struct { diff --git a/protocol/performance/connection/connection_cmd.go b/protocol/performance/connection/connection_cmd.go index b76b94b83a..d3223922ba 100644 --- a/protocol/performance/connection/connection_cmd.go +++ b/protocol/performance/connection/connection_cmd.go @@ -9,10 +9,10 @@ import ( "time" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" "github.com/spf13/viper" "golang.org/x/net/http2" diff --git a/protocol/performance/connection/prober.go b/protocol/performance/connection/prober.go index e5abadba4c..f2947006cb 100644 --- a/protocol/performance/connection/prober.go +++ b/protocol/performance/connection/prober.go @@ -5,9 +5,9 @@ import ( "fmt" "math/rand" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) diff --git a/protocol/performance/connection/server.go b/protocol/performance/connection/server.go index 4349ebbf9a..9a9b8fec1f 100644 --- a/protocol/performance/connection/server.go +++ b/protocol/performance/connection/server.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type RelayerConnectionServer struct { diff --git a/protocol/performance/pprofServer.go b/protocol/performance/pprofServer.go index 95b786d059..03c283685d 100644 --- a/protocol/performance/pprofServer.go +++ b/protocol/performance/pprofServer.go @@ -5,7 +5,7 @@ import ( "github.com/gofiber/fiber/v2" fiberpprof "github.com/gofiber/fiber/v2/middleware/pprof" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const ( diff --git a/protocol/performance/validators/validators.go b/protocol/performance/validators/validators.go index ba406ec77e..e8329bdc8e 100644 --- a/protocol/performance/validators/validators.go +++ b/protocol/performance/validators/validators.go @@ -21,9 +21,9 @@ import ( "github.com/cosmos/cosmos-sdk/version" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/protocol/provideroptimizer/provider_optimizer.go b/protocol/provideroptimizer/provider_optimizer.go index 806818d970..6f9198a9e9 100644 --- a/protocol/provideroptimizer/provider_optimizer.go +++ b/protocol/provideroptimizer/provider_optimizer.go @@ -8,12 +8,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/score" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/score" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "gonum.org/v1/gonum/mathext" ) @@ -48,6 +49,9 @@ type cacheInf interface { Set(key, value interface{}, cost int64) bool } +type consumerOptimizerQoSClientInf interface { + UpdatePairingListStake(stakeMap map[string]int64, chainId string, epoch uint64) +} type ProviderOptimizer struct { strategy Strategy providersStorage cacheInf @@ -58,6 +62,8 @@ type ProviderOptimizer struct { latestSyncData ConcurrentBlockStore selectionWeighter SelectionWeighter OptimizerNumTiers int + consumerOptimizerQoSClient consumerOptimizerQoSClientInf + chainId string } type Exploration struct { @@ -86,8 +92,13 @@ const ( STRATEGY_DISTRIBUTED ) -func (po *ProviderOptimizer) UpdateWeights(weights map[string]int64) { +func (po *ProviderOptimizer) UpdateWeights(weights map[string]int64, epoch uint64) { po.selectionWeighter.SetWeights(weights) + + // Update the stake map for metrics + if po.consumerOptimizerQoSClient != nil { + po.consumerOptimizerQoSClient.UpdatePairingListStake(weights, po.chainId, epoch) + } } func (po *ProviderOptimizer) AppendRelayFailure(providerAddress string) { @@ -149,30 +160,53 @@ func (po *ProviderOptimizer) AppendProbeRelayData(providerAddress string, latenc ) } -func (po *ProviderOptimizer) CalculateSelectionTiers(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64) (SelectionTier, Exploration) { +func (po *ProviderOptimizer) calcLatencyAndSyncScores(providerData ProviderData, cu uint64, requestedBlock int64) (float64, float64) { + // latency score + latencyScoreCurrent := po.calculateLatencyScore(providerData, cu, requestedBlock) // smaller == better i.e less latency + + // sync score + syncScoreCurrent := float64(0) + if requestedBlock < 0 { + // means user didn't ask for a specific block and we want to give him the best + syncScoreCurrent = po.calculateSyncScore(providerData.Sync) // smaller == better i.e less sync lag + } + + return latencyScoreCurrent, syncScoreCurrent +} + +func (po *ProviderOptimizer) CalculateQoSScoresForMetrics(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64) []*metrics.OptimizerQoSReport { + selectionTier, _, providersScores := po.CalculateSelectionTiers(allAddresses, ignoredProviders, cu, requestedBlock) + reports := []*metrics.OptimizerQoSReport{} + + rawScores := selectionTier.GetRawScores() + for idx, entry := range rawScores { + qosReport := providersScores[entry.Address] + qosReport.EntryIndex = idx + reports = append(reports, qosReport) + } + + return reports +} + +func (po *ProviderOptimizer) CalculateSelectionTiers(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64) (SelectionTier, Exploration, map[string]*metrics.OptimizerQoSReport) { latencyScore := math.MaxFloat64 // smaller = better i.e less latency syncScore := math.MaxFloat64 // smaller = better i.e less sync lag explorationCandidate := Exploration{address: "", time: time.Now().Add(time.Hour)} selectionTier := NewSelectionTier() + providerScores := make(map[string]*metrics.OptimizerQoSReport) for _, providerAddress := range allAddresses { if _, ok := ignoredProviders[providerAddress]; ok { // ignored provider, skip it continue } + providerData, found := po.getProviderData(providerAddress) if !found { utils.LavaFormatTrace("provider data was not found for address", utils.LogAttr("providerAddress", providerAddress)) } - // latency score - latencyScoreCurrent := po.calculateLatencyScore(providerData, cu, requestedBlock) // smaller == better i.e less latency - - // sync score - syncScoreCurrent := float64(0) - if requestedBlock < 0 { - // means user didn't ask for a specific block and we want to give him the best - syncScoreCurrent = po.calculateSyncScore(providerData.Sync) // smaller == better i.e less sync lag - } + + latencyScoreCurrent, syncScoreCurrent := po.calcLatencyAndSyncScores(providerData, cu, requestedBlock) utils.LavaFormatTrace("scores information", utils.LogAttr("providerAddress", providerAddress), @@ -181,7 +215,15 @@ func (po *ProviderOptimizer) CalculateSelectionTiers(allAddresses []string, igno utils.LogAttr("latencyScore", latencyScore), utils.LogAttr("syncScore", syncScore), ) + providerScore := po.calcProviderScore(latencyScoreCurrent, syncScoreCurrent) + providerScores[providerAddress] = &metrics.OptimizerQoSReport{ + ProviderAddress: providerAddress, + SyncScore: syncScoreCurrent, + AvailabilityScore: providerData.Availability.Num / providerData.Availability.Denom, + LatencyScore: latencyScoreCurrent, + GenericScore: providerScore, + } selectionTier.AddScore(providerAddress, providerScore) // check if candidate for exploration @@ -191,12 +233,12 @@ func (po *ProviderOptimizer) CalculateSelectionTiers(allAddresses []string, igno explorationCandidate = Exploration{address: providerAddress, time: updateTime} } } - return selectionTier, explorationCandidate + return selectionTier, explorationCandidate, providerScores } // returns a sub set of selected providers according to their scores, perturbation factor will be added to each score in order to randomly select providers that are not always on top func (po *ProviderOptimizer) ChooseProvider(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64) (addresses []string, tier int) { - selectionTier, explorationCandidate := po.CalculateSelectionTiers(allAddresses, ignoredProviders, cu, requestedBlock) + selectionTier, explorationCandidate, _ := po.CalculateSelectionTiers(allAddresses, ignoredProviders, cu, requestedBlock) if selectionTier.ScoresCount() == 0 { // no providers to choose from return []string{}, -1 @@ -493,7 +535,7 @@ func (po *ProviderOptimizer) getRelayStatsTimes(providerAddress string) []time.T return nil } -func NewProviderOptimizer(strategy Strategy, averageBlockTIme, baseWorldLatency time.Duration, wantedNumProvidersInConcurrency uint) *ProviderOptimizer { +func NewProviderOptimizer(strategy Strategy, averageBlockTIme, baseWorldLatency time.Duration, wantedNumProvidersInConcurrency uint, consumerOptimizerQoSClientInf consumerOptimizerQoSClientInf, chainId string) *ProviderOptimizer { cache, err := ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: CacheMaxCost, BufferItems: 64, IgnoreInternalCost: true}) if err != nil { utils.LavaFormatFatal("failed setting up cache for queries", err) @@ -515,6 +557,8 @@ func NewProviderOptimizer(strategy Strategy, averageBlockTIme, baseWorldLatency wantedNumProvidersInConcurrency: wantedNumProvidersInConcurrency, selectionWeighter: NewSelectionWeighter(), OptimizerNumTiers: OptimizerNumTiers, + consumerOptimizerQoSClient: consumerOptimizerQoSClientInf, + chainId: chainId, } } diff --git a/protocol/provideroptimizer/provider_optimizer_test.go b/protocol/provideroptimizer/provider_optimizer_test.go index 37b770e40e..61e7a9c0e2 100644 --- a/protocol/provideroptimizer/provider_optimizer_test.go +++ b/protocol/provideroptimizer/provider_optimizer_test.go @@ -1,15 +1,20 @@ package provideroptimizer import ( + "context" "fmt" + "net/http" + "net/http/httptest" "strconv" "sync" "testing" "time" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/goccy/go-json" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) @@ -40,7 +45,7 @@ func (posc *providerOptimizerSyncCache) Set(key, value interface{}, cost int64) func setupProviderOptimizer(maxProvidersCount int) *ProviderOptimizer { averageBlockTIme := TEST_AVERAGE_BLOCK_TIME baseWorldLatency := TEST_BASE_WORLD_LATENCY - return NewProviderOptimizer(STRATEGY_BALANCED, averageBlockTIme, baseWorldLatency, uint(maxProvidersCount)) + return NewProviderOptimizer(STRATEGY_BALANCED, averageBlockTIme, baseWorldLatency, uint(maxProvidersCount), nil, "dontcare") } type providersGenerator struct { @@ -288,7 +293,7 @@ func TestProviderOptimizerAvailabilityBlockError(t *testing.T) { providerOptimizer.AppendRelayData(providersGen.providersAddresses[i], TEST_BASE_WORLD_LATENCY, false, requestCU, syncBlock-1) // update that he doesn't have the latest requested block } time.Sleep(4 * time.Millisecond) - selectionTier, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) + selectionTier, _, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) tierChances := selectionTier.ShiftTierChance(OptimizerNumTiers, map[int]float64{0: ATierChance, OptimizerNumTiers - 1: LastTierChance}) require.Greater(t, tierChances[0], 0.7, tierChances) results, tierResults := runChooseManyTimesAndReturnResults(t, providerOptimizer, providersGen.providersAddresses, nil, requestCU, requestBlock, 1000) @@ -431,14 +436,14 @@ func TestProviderOptimizerSyncScore(t *testing.T) { sampleTime = sampleTime.Add(time.Millisecond * 5) } time.Sleep(4 * time.Millisecond) - selectionTier, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) + selectionTier, _, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) tier0 := selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty // we have the best score on the top tier and it's sorted require.Equal(t, providersGen.providersAddresses[chosenIndex], tier0[0].Address) // now choose with a specific block that all providers have - selectionTier, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, int64(syncBlock)) + selectionTier, _, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, int64(syncBlock)) tier0 = selectionTier.GetTier(0, 4, 3) for idx := range tier0 { // sync score doesn't matter now so the tier0 is recalculated and chosenIndex has worst latency @@ -503,7 +508,7 @@ func TestProviderOptimizerStrategiesScoring(t *testing.T) { time.Sleep(4 * time.Millisecond) providerOptimizer.strategy = STRATEGY_BALANCED // a balanced strategy should pick provider 2 because of it's high availability - selectionTier, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) + selectionTier, _, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) tier0 := selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty // we have the best score on the top tier and it's sorted @@ -511,7 +516,7 @@ func TestProviderOptimizerStrategiesScoring(t *testing.T) { providerOptimizer.strategy = STRATEGY_COST // with a cost strategy we expect the same as balanced - selectionTier, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) + selectionTier, _, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) tier0 = selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty // we have the best score on the top tier and it's sorted @@ -519,20 +524,20 @@ func TestProviderOptimizerStrategiesScoring(t *testing.T) { providerOptimizer.strategy = STRATEGY_LATENCY // latency strategy should pick the best latency - selectionTier, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, map[string]struct{}{providersGen.providersAddresses[2]: {}}, requestCU, requestBlock) + selectionTier, _, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, map[string]struct{}{providersGen.providersAddresses[2]: {}}, requestCU, requestBlock) tier0 = selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty require.Equal(t, providersGen.providersAddresses[0], tier0[0].Address) providerOptimizer.strategy = STRATEGY_SYNC_FRESHNESS // freshness strategy should pick the most advanced provider - selectionTier, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, map[string]struct{}{providersGen.providersAddresses[2]: {}}, requestCU, requestBlock) + selectionTier, _, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, map[string]struct{}{providersGen.providersAddresses[2]: {}}, requestCU, requestBlock) tier0 = selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty require.Equal(t, providersGen.providersAddresses[1], tier0[0].Address) // but if we request a past block, then it doesnt matter and we choose by latency: - selectionTier, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, map[string]struct{}{providersGen.providersAddresses[2]: {}}, requestCU, int64(syncBlock)) + selectionTier, _, _ = providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, map[string]struct{}{providersGen.providersAddresses[2]: {}}, requestCU, int64(syncBlock)) tier0 = selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty require.Equal(t, providersGen.providersAddresses[0], tier0[0].Address) @@ -686,7 +691,7 @@ func TestProviderOptimizerWeights(t *testing.T) { improvedLatency := normalLatency - 5*time.Millisecond improvedBlock := syncBlock + 2 - providerOptimizer.UpdateWeights(weights) + providerOptimizer.UpdateWeights(weights, syncBlock) for i := 0; i < 10; i++ { for idx, address := range providersGen.providersAddresses { if idx == 0 { @@ -700,7 +705,7 @@ func TestProviderOptimizerWeights(t *testing.T) { } // verify 0 has the best score - selectionTier, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) + selectionTier, _, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) tier0 := selectionTier.GetTier(0, 4, 3) require.Greater(t, len(tier0), 0) // shouldn't be empty require.Equal(t, providersGen.providersAddresses[0], tier0[0].Address) @@ -739,7 +744,7 @@ func TestProviderOptimizerTiers(t *testing.T) { time.Sleep(4 * time.Millisecond) } } - selectionTier, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) + selectionTier, _, _ := providerOptimizer.CalculateSelectionTiers(providersGen.providersAddresses, nil, requestCU, requestBlock) shiftedChances := selectionTier.ShiftTierChance(4, map[int]float64{0: 0.75}) require.NotZero(t, shiftedChances[3]) // if we pick by sync, provider 0 is in the top tier and should be selected very often @@ -754,6 +759,50 @@ func TestProviderOptimizerTiers(t *testing.T) { } } +func TestProviderOptimizerWithOptimizerQoSClient(t *testing.T) { + rand.InitRandomSeed() + + wg := sync.WaitGroup{} + wg.Add(1) + httpServerHandler := func(w http.ResponseWriter, r *http.Request) { + data := make([]byte, r.ContentLength) + r.Body.Read(data) + + optimizerQoSReport := &[]map[string]interface{}{} + err := json.Unmarshal(data, optimizerQoSReport) + require.NoError(t, err) + require.NotZero(t, len(*optimizerQoSReport)) + w.WriteHeader(http.StatusOK) + wg.Done() + } + + mockHttpServer := httptest.NewServer(http.HandlerFunc(httpServerHandler)) + defer mockHttpServer.Close() + + chainId := "dontcare" + + consumerOptimizerQoSClient := metrics.NewConsumerOptimizerQoSClient(mockHttpServer.URL, 1*time.Second) + consumerOptimizerQoSClient.StartOptimizersQoSReportsCollecting(context.Background(), 900*time.Millisecond) + + providerOptimizer := NewProviderOptimizer(STRATEGY_BALANCED, TEST_AVERAGE_BLOCK_TIME, TEST_BASE_WORLD_LATENCY, 10, consumerOptimizerQoSClient, chainId) + consumerOptimizerQoSClient.RegisterOptimizer(providerOptimizer, chainId) + + syncBlock := uint64(1000) + + providerAddr := "lava@test" + + providerOptimizer.UpdateWeights(map[string]int64{ + providerAddr: 1000000000, + }, syncBlock) + + requestCU := uint64(10) + + normalLatency := TEST_BASE_WORLD_LATENCY * 2 + providerOptimizer.appendRelayData(providerAddr, normalLatency, false, true, requestCU, syncBlock, time.Now()) + + wg.Wait() +} + // TODO: new tests we need: // check 3 providers, one with great stake one with great score // retries: groups getting smaller diff --git a/protocol/provideroptimizer/selection_tier.go b/protocol/provideroptimizer/selection_tier.go index 1a239fdf8b..0da0915653 100644 --- a/protocol/provideroptimizer/selection_tier.go +++ b/protocol/provideroptimizer/selection_tier.go @@ -3,9 +3,9 @@ package provideroptimizer import ( "math" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/rand" ) type Entry struct { @@ -21,6 +21,7 @@ type SelectionTier interface { SelectTierRandomly(numTiers int, tierChances map[int]float64) int ShiftTierChance(numTiers int, initialYierChances map[int]float64) map[int]float64 ScoresCount() int + GetRawScores() []Entry } type SelectionTierInst struct { @@ -31,6 +32,10 @@ func NewSelectionTier() SelectionTier { return &SelectionTierInst{scores: []Entry{}} } +func (st *SelectionTierInst) GetRawScores() []Entry { + return st.scores +} + func (st *SelectionTierInst) ScoresCount() int { return len(st.scores) } diff --git a/protocol/provideroptimizer/selection_tier_test.go b/protocol/provideroptimizer/selection_tier_test.go index 5c4720c442..0d4f5f97e7 100644 --- a/protocol/provideroptimizer/selection_tier_test.go +++ b/protocol/provideroptimizer/selection_tier_test.go @@ -4,7 +4,7 @@ import ( "strconv" "testing" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/utils/rand" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/provideroptimizer/selection_weight.go b/protocol/provideroptimizer/selection_weight.go index 25e9e0c198..e0fdc30f38 100644 --- a/protocol/provideroptimizer/selection_weight.go +++ b/protocol/provideroptimizer/selection_weight.go @@ -3,8 +3,8 @@ package provideroptimizer import ( "sync" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" ) // SelectionWeighter is a utility to select an address based on a weight. diff --git a/protocol/provideroptimizer/selection_weight_test.go b/protocol/provideroptimizer/selection_weight_test.go index 9196920500..4dc06d1769 100644 --- a/protocol/provideroptimizer/selection_weight_test.go +++ b/protocol/provideroptimizer/selection_weight_test.go @@ -3,7 +3,7 @@ package provideroptimizer import ( "testing" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/utils/rand" "github.com/stretchr/testify/assert" ) diff --git a/protocol/rpcconsumer/consumer_consistency.go b/protocol/rpcconsumer/consumer_consistency.go index b1d8ba171f..e2e446a368 100644 --- a/protocol/rpcconsumer/consumer_consistency.go +++ b/protocol/rpcconsumer/consumer_consistency.go @@ -4,8 +4,8 @@ import ( "time" "github.com/dgraph-io/ristretto" - common "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" + common "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" ) // this class handles seen block values in requests diff --git a/protocol/rpcconsumer/consumer_consistency_test.go b/protocol/rpcconsumer/consumer_consistency_test.go index 3fdb3cd9fc..540a5e3ac3 100644 --- a/protocol/rpcconsumer/consumer_consistency_test.go +++ b/protocol/rpcconsumer/consumer_consistency_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - common "github.com/lavanet/lava/v3/protocol/common" + common "github.com/lavanet/lava/v4/protocol/common" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcconsumer/consumer_relay_state_machine.go b/protocol/rpcconsumer/consumer_relay_state_machine.go index b7fd41f683..f4932618a1 100644 --- a/protocol/rpcconsumer/consumer_relay_state_machine.go +++ b/protocol/rpcconsumer/consumer_relay_state_machine.go @@ -4,11 +4,11 @@ import ( context "context" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - common "github.com/lavanet/lava/v3/protocol/common" - lavasession "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/chainlib" + common "github.com/lavanet/lava/v4/protocol/common" + lavasession "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" ) type RelayStateMachine interface { diff --git a/protocol/rpcconsumer/consumer_relay_state_machine_test.go b/protocol/rpcconsumer/consumer_relay_state_machine_test.go index c42d003714..0f35df708d 100644 --- a/protocol/rpcconsumer/consumer_relay_state_machine_test.go +++ b/protocol/rpcconsumer/consumer_relay_state_machine_test.go @@ -7,11 +7,11 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - lavasession "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + lavasession "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcconsumer/consumer_state_tracker_mock.go b/protocol/rpcconsumer/consumer_state_tracker_mock.go index 3e07da7bc5..11663b29e7 100644 --- a/protocol/rpcconsumer/consumer_state_tracker_mock.go +++ b/protocol/rpcconsumer/consumer_state_tracker_mock.go @@ -13,13 +13,13 @@ import ( context "context" reflect "reflect" - common "github.com/lavanet/lava/v3/protocol/common" - finalizationconsensus "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - lavasession "github.com/lavanet/lava/v3/protocol/lavasession" - updaters "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - types "github.com/lavanet/lava/v3/x/conflict/types" - types0 "github.com/lavanet/lava/v3/x/plans/types" - types1 "github.com/lavanet/lava/v3/x/protocol/types" + common "github.com/lavanet/lava/v4/protocol/common" + finalizationconsensus "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + lavasession "github.com/lavanet/lava/v4/protocol/lavasession" + updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + types "github.com/lavanet/lava/v4/x/conflict/types" + types0 "github.com/lavanet/lava/v4/x/plans/types" + types1 "github.com/lavanet/lava/v4/x/protocol/types" gomock "go.uber.org/mock/gomock" ) diff --git a/protocol/rpcconsumer/relay_errors.go b/protocol/rpcconsumer/relay_errors.go index fabe404b72..2f8edbdfbd 100644 --- a/protocol/rpcconsumer/relay_errors.go +++ b/protocol/rpcconsumer/relay_errors.go @@ -6,8 +6,8 @@ import ( "strconv" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" ) type RelayErrors struct { diff --git a/protocol/rpcconsumer/relay_errors_test.go b/protocol/rpcconsumer/relay_errors_test.go index 53bd41e134..5e48db5975 100644 --- a/protocol/rpcconsumer/relay_errors_test.go +++ b/protocol/rpcconsumer/relay_errors_test.go @@ -5,7 +5,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/common" + "github.com/lavanet/lava/v4/protocol/common" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcconsumer/relay_processor.go b/protocol/rpcconsumer/relay_processor.go index 75c408985f..29c6aeeb98 100644 --- a/protocol/rpcconsumer/relay_processor.go +++ b/protocol/rpcconsumer/relay_processor.go @@ -11,10 +11,10 @@ import ( "sync/atomic" sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" ) type Selection int @@ -32,7 +32,7 @@ const ( ) type MetricsInterface interface { - SetRelayNodeErrorMetric(chainId string, apiInterface string) + SetRelayNodeErrorMetric(providerAddress string, chainId string, apiInterface string) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) SetNodeErrorAttemptMetric(chainId string, apiInterface string) } @@ -253,7 +253,8 @@ func (rp *RelayProcessor) handleResponse(response *relayResponse) { nodeError := rp.ResultsManager.SetResponse(response, rp.RelayStateMachine.GetProtocolMessage()) // send relay error metrics only on non stateful queries, as stateful queries always return X-1/X errors. if nodeError != nil && rp.selection != BestResult { - go rp.metricsInf.SetRelayNodeErrorMetric(rp.chainIdAndApiInterfaceGetter.GetChainIdAndApiInterface()) + chainId, apiInterface := rp.chainIdAndApiInterfaceGetter.GetChainIdAndApiInterface() + go rp.metricsInf.SetRelayNodeErrorMetric(response.relayResult.ProviderInfo.ProviderAddress, chainId, apiInterface) utils.LavaFormatInfo("Relay received a node error", utils.LogAttr("Error", nodeError), utils.LogAttr("provider", response.relayResult.ProviderInfo), utils.LogAttr("Request", rp.RelayStateMachine.GetProtocolMessage().GetApi().Name)) } diff --git a/protocol/rpcconsumer/relay_processor_test.go b/protocol/rpcconsumer/relay_processor_test.go index 7bd4f85151..f56ce79651 100644 --- a/protocol/rpcconsumer/relay_processor_test.go +++ b/protocol/rpcconsumer/relay_processor_test.go @@ -7,19 +7,20 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavasession" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavasession" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) type relayProcessorMetricsMock struct{} -func (romm *relayProcessorMetricsMock) SetRelayNodeErrorMetric(chainId string, apiInterface string) {} +func (romm *relayProcessorMetricsMock) SetRelayNodeErrorMetric(providerAddress, chainId, apiInterface string) { +} func (romm *relayProcessorMetricsMock) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) { } diff --git a/protocol/rpcconsumer/relayer_client_mock.go b/protocol/rpcconsumer/relayer_client_mock.go index a40e5f1565..7ab5bed9ac 100644 --- a/protocol/rpcconsumer/relayer_client_mock.go +++ b/protocol/rpcconsumer/relayer_client_mock.go @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - types "github.com/lavanet/lava/v3/x/pairing/types" + types "github.com/lavanet/lava/v4/x/pairing/types" gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" metadata "google.golang.org/grpc/metadata" diff --git a/protocol/rpcconsumer/results_manager.go b/protocol/rpcconsumer/results_manager.go index 6664ba6b35..8711442343 100644 --- a/protocol/rpcconsumer/results_manager.go +++ b/protocol/rpcconsumer/results_manager.go @@ -4,10 +4,10 @@ import ( "fmt" "sync" - "github.com/lavanet/lava/v3/protocol/chainlib" - common "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/utils" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + common "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/utils" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type ResultsManager interface { diff --git a/protocol/rpcconsumer/rpcconsumer.go b/protocol/rpcconsumer/rpcconsumer.go index 3dcbe3e54e..bfd554925e 100644 --- a/protocol/rpcconsumer/rpcconsumer.go +++ b/protocol/rpcconsumer/rpcconsumer.go @@ -16,25 +16,25 @@ import ( "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/v3/app" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/performance" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/protocol/statetracker" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/protocol/upgrade" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/performance" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/protocol/statetracker" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/protocol/upgrade" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -100,29 +100,30 @@ type ConsumerStateTrackerInf interface { GetLatestVirtualEpoch() uint64 } -type AnalyticsServerAddressess struct { +type AnalyticsServerAddresses struct { AddApiMethodCallsMetrics bool MetricsListenAddress string RelayServerAddress string ReportsAddressFlag string + OptimizerQoSAddress string } type RPCConsumer struct { consumerStateTracker ConsumerStateTrackerInf } type rpcConsumerStartOptions struct { - txFactory tx.Factory - clientCtx client.Context - rpcEndpoints []*lavasession.RPCEndpoint - requiredResponses int - cache *performance.Cache - strategy provideroptimizer.Strategy - maxConcurrentProviders uint - analyticsServerAddressess AnalyticsServerAddressess - cmdFlags common.ConsumerCmdFlags - stateShare bool - refererData *chainlib.RefererData - staticProvidersList []*lavasession.RPCProviderEndpoint // define static providers as backup to lava providers + txFactory tx.Factory + clientCtx client.Context + rpcEndpoints []*lavasession.RPCEndpoint + requiredResponses int + cache *performance.Cache + strategy provideroptimizer.Strategy + maxConcurrentProviders uint + analyticsServerAddresses AnalyticsServerAddresses + cmdFlags common.ConsumerCmdFlags + stateShare bool + refererData *chainlib.RefererData + staticProvidersList []*lavasession.RPCProviderEndpoint // define static providers as backup to lava providers } // spawns a new RPCConsumer server with all it's processes and internals ready for communications @@ -131,10 +132,16 @@ func (rpcc *RPCConsumer) Start(ctx context.Context, options *rpcConsumerStartOpt testModeWarn("RPCConsumer running tests") } options.refererData.ReferrerClient = metrics.NewConsumerReferrerClient(options.refererData.Address) - consumerReportsManager := metrics.NewConsumerReportsClient(options.analyticsServerAddressess.ReportsAddressFlag) - consumerMetricsManager := metrics.NewConsumerMetricsManager(metrics.ConsumerMetricsManagerOptions{NetworkAddress: options.analyticsServerAddressess.MetricsListenAddress, AddMethodsApiGauge: options.analyticsServerAddressess.AddApiMethodCallsMetrics}) // start up prometheus metrics - consumerUsageserveManager := metrics.NewConsumerRelayServerClient(options.analyticsServerAddressess.RelayServerAddress) // start up relay server reporting - rpcConsumerMetrics, err := metrics.NewRPCConsumerLogs(consumerMetricsManager, consumerUsageserveManager) + consumerReportsManager := metrics.NewConsumerReportsClient(options.analyticsServerAddresses.ReportsAddressFlag) + consumerMetricsManager := metrics.NewConsumerMetricsManager(metrics.ConsumerMetricsManagerOptions{NetworkAddress: options.analyticsServerAddresses.MetricsListenAddress, AddMethodsApiGauge: options.analyticsServerAddresses.AddApiMethodCallsMetrics}) // start up prometheus metrics + consumerUsageServeManager := metrics.NewConsumerRelayServerClient(options.analyticsServerAddresses.RelayServerAddress) // start up relay server reporting + var consumerOptimizerQoSClient *metrics.ConsumerOptimizerQoSClient + if options.analyticsServerAddresses.OptimizerQoSAddress != "" { + consumerOptimizerQoSClient = metrics.NewConsumerOptimizerQoSClient(options.analyticsServerAddresses.OptimizerQoSAddress, metrics.OptimizerQosServerPushInterval) // start up optimizer qos client + consumerOptimizerQoSClient.StartOptimizersQoSReportsCollecting(ctx, metrics.OptimizerQosServerSamplingInterval) // start up optimizer qos client + } + + rpcConsumerMetrics, err := metrics.NewRPCConsumerLogs(consumerMetricsManager, consumerUsageServeManager, consumerOptimizerQoSClient) if err != nil { utils.LavaFormatFatal("failed creating RPCConsumer logs", err) } @@ -243,12 +250,17 @@ func (rpcc *RPCConsumer) Start(ctx context.Context, options *rpcConsumerStartOpt baseLatency := common.AverageWorldLatency / 2 // we want performance to be half our timeout or better // Create / Use existing optimizer - newOptimizer := provideroptimizer.NewProviderOptimizer(options.strategy, averageBlockTime, baseLatency, options.maxConcurrentProviders) - optimizer, _, err = optimizers.LoadOrStore(chainID, newOptimizer) + newOptimizer := provideroptimizer.NewProviderOptimizer(options.strategy, averageBlockTime, baseLatency, options.maxConcurrentProviders, consumerOptimizerQoSClient, chainID) + optimizer, loaded, err = optimizers.LoadOrStore(chainID, newOptimizer) if err != nil { return utils.LavaFormatError("failed loading optimizer", err, utils.LogAttr("endpoint", rpcEndpoint.Key())) } + if !loaded { + // if this is a new optimizer, register it in the consumerOptimizerQoSClient + consumerOptimizerQoSClient.RegisterOptimizer(optimizer, chainID) + } + // Create / Use existing ConsumerConsistency newConsumerConsistency := NewConsumerConsistency(chainID) consumerConsistency, _, err = consumerConsistencies.LoadOrStore(chainID, newConsumerConsistency) @@ -539,11 +551,12 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 utils.LavaFormatInfo("Working with selection strategy: " + strategyFlag.String()) } - analyticsServerAddressess := AnalyticsServerAddressess{ + analyticsServerAddresses := AnalyticsServerAddresses{ AddApiMethodCallsMetrics: viper.GetBool(metrics.AddApiMethodCallsMetrics), MetricsListenAddress: viper.GetString(metrics.MetricsListenFlagName), RelayServerAddress: viper.GetString(metrics.RelayServerFlagName), ReportsAddressFlag: viper.GetString(reportsSendBEAddress), + OptimizerQoSAddress: viper.GetString(common.OptimizerQosServerAddressFlag), } var refererData *chainlib.RefererData @@ -574,7 +587,20 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 } rpcConsumerSharedState := viper.GetBool(common.SharedStateFlag) - err = rpcConsumer.Start(ctx, &rpcConsumerStartOptions{txFactory, clientCtx, rpcEndpoints, requiredResponses, cache, strategyFlag.Strategy, maxConcurrentProviders, analyticsServerAddressess, consumerPropagatedFlags, rpcConsumerSharedState, refererData, staticProviderEndpoints}) + err = rpcConsumer.Start(ctx, &rpcConsumerStartOptions{ + txFactory, + clientCtx, + rpcEndpoints, + requiredResponses, + cache, + strategyFlag.Strategy, + maxConcurrentProviders, + analyticsServerAddresses, + consumerPropagatedFlags, + rpcConsumerSharedState, + refererData, + staticProviderEndpoints, + }) return err }, } @@ -618,6 +644,10 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 cmdRPCConsumer.Flags().Float64Var(&provideroptimizer.ATierChance, common.SetProviderOptimizerBestTierPickChance, 0.75, "set the chances for picking a provider from the best group, default is 75% -> 0.75") cmdRPCConsumer.Flags().Float64Var(&provideroptimizer.LastTierChance, common.SetProviderOptimizerWorstTierPickChance, 0.0, "set the chances for picking a provider from the worse group, default is 0% -> 0.0") cmdRPCConsumer.Flags().IntVar(&provideroptimizer.OptimizerNumTiers, common.SetProviderOptimizerNumberOfTiersToCreate, 4, "set the number of groups to create, default is 4") + // optimizer qos reports + cmdRPCConsumer.Flags().String(common.OptimizerQosServerAddressFlag, "", "address to send optimizer qos reports to") + cmdRPCConsumer.Flags().DurationVar(&metrics.OptimizerQosServerPushInterval, common.OptimizerQosServerPushIntervalFlag, time.Minute*5, "interval to push optimizer qos reports") + cmdRPCConsumer.Flags().DurationVar(&metrics.OptimizerQosServerSamplingInterval, common.OptimizerQosServerSamplingIntervalFlag, time.Second*1, "interval to sample optimizer qos reports") cmdRPCConsumer.Flags().IntVar(&chainlib.WebSocketRateLimit, common.RateLimitWebSocketFlag, chainlib.WebSocketRateLimit, "rate limit (per second) websocket requests per user connection, default is unlimited") cmdRPCConsumer.Flags().DurationVar(&chainlib.WebSocketBanDuration, common.BanDurationForWebsocketRateLimitExceededFlag, chainlib.WebSocketBanDuration, "once websocket rate limit is reached, user will be banned Xfor a duration, default no ban") common.AddRollingLogConfig(cmdRPCConsumer) diff --git a/protocol/rpcconsumer/rpcconsumer_server.go b/protocol/rpcconsumer/rpcconsumer_server.go index 698cb5b68c..7f8989b509 100644 --- a/protocol/rpcconsumer/rpcconsumer_server.go +++ b/protocol/rpcconsumer/rpcconsumer_server.go @@ -14,25 +14,25 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationverification" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/protocolerrors" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/performance" - "github.com/lavanet/lava/v3/protocol/upgrade" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/protocopy" - "github.com/lavanet/lava/v3/utils/rand" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationverification" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/performance" + "github.com/lavanet/lava/v4/protocol/upgrade" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/protocopy" + "github.com/lavanet/lava/v4/utils/rand" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -658,7 +658,7 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( endpointClient := singleConsumerSession.EndpointConnection.Client // set relay sent metric - go rpccs.rpcConsumerLogs.SetRelaySentToProviderMetric(chainId, apiInterface) + go rpccs.rpcConsumerLogs.SetRelaySentToProviderMetric(providerPublicAddress, chainId, apiInterface) if chainlib.IsFunctionTagOfType(protocolMessage, spectypes.FUNCTION_TAG_SUBSCRIBE) { utils.LavaFormatTrace("inside sendRelayToProvider, relay is subscription", utils.LogAttr("requestData", localRelayRequestData.Data)) diff --git a/protocol/rpcconsumer/rpcconsumer_server_test.go b/protocol/rpcconsumer/rpcconsumer_server_test.go index 639e03cb5d..50ab71858a 100644 --- a/protocol/rpcconsumer/rpcconsumer_server_test.go +++ b/protocol/rpcconsumer/rpcconsumer_server_test.go @@ -7,18 +7,18 @@ import ( btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" @@ -54,7 +54,7 @@ func createRpcConsumer(t *testing.T, ctrl *gomock.Controller, ctx context.Contex finalizationConsensus := finalizationconsensus.NewFinalizationConsensus(rpcEndpoint.ChainID) _, averageBlockTime, _, _ := chainParser.ChainBlockStats() baseLatency := common.AverageWorldLatency / 2 - optimizer := provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, averageBlockTime, baseLatency, 2) + optimizer := provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, averageBlockTime, baseLatency, 2, nil, "dontcare") consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, nil, nil, "test", lavasession.NewActiveSubscriptionProvidersStorage()) consumerSessionManager.UpdateAllProviders(epoch, map[uint64]*lavasession.ConsumerSessionsWithProvider{ epoch: { @@ -68,7 +68,7 @@ func createRpcConsumer(t *testing.T, ctrl *gomock.Controller, ctx context.Contex consumerCmdFlags := common.ConsumerCmdFlags{ RelaysHealthEnableFlag: false, } - rpcsonumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil) + rpcsonumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil, nil) require.NoError(t, err) err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, requiredResponses, consumeSK, lavaChainID, nil, rpcsonumerLogs, consumerAccount, consumerConsistency, nil, consumerCmdFlags, false, nil, nil, nil) require.NoError(t, err) diff --git a/protocol/rpcconsumer/testing.go b/protocol/rpcconsumer/testing.go index 6c3683186e..e2477ae8d5 100644 --- a/protocol/rpcconsumer/testing.go +++ b/protocol/rpcconsumer/testing.go @@ -10,15 +10,15 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chaintracker" - commonlib "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/rpcprovider" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chaintracker" + commonlib "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/rpcprovider" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/protocol/rpcprovider/cors_test.go b/protocol/rpcprovider/cors_test.go index a1dc460c2b..cf9f99f77b 100644 --- a/protocol/rpcprovider/cors_test.go +++ b/protocol/rpcprovider/cors_test.go @@ -16,7 +16,7 @@ import ( "testing" "time" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/provider_listener.go b/protocol/rpcprovider/provider_listener.go index a0f0830523..79388f2beb 100644 --- a/protocol/rpcprovider/provider_listener.go +++ b/protocol/rpcprovider/provider_listener.go @@ -10,12 +10,12 @@ import ( "github.com/gogo/status" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/protocolerrors" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" grpc "google.golang.org/grpc" diff --git a/protocol/rpcprovider/provider_listener_mock.go b/protocol/rpcprovider/provider_listener_mock.go index 504626fd03..2155d778f3 100644 --- a/protocol/rpcprovider/provider_listener_mock.go +++ b/protocol/rpcprovider/provider_listener_mock.go @@ -12,7 +12,7 @@ import ( context "context" reflect "reflect" - types "github.com/lavanet/lava/v3/x/pairing/types" + types "github.com/lavanet/lava/v4/x/pairing/types" gomock "go.uber.org/mock/gomock" ) diff --git a/protocol/rpcprovider/provider_state_machine.go b/protocol/rpcprovider/provider_state_machine.go index 9b386c80f3..38a98e3e7d 100644 --- a/protocol/rpcprovider/provider_state_machine.go +++ b/protocol/rpcprovider/provider_state_machine.go @@ -4,12 +4,12 @@ import ( "context" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) type ProviderRelaySender interface { diff --git a/protocol/rpcprovider/provider_state_machine_test.go b/protocol/rpcprovider/provider_state_machine_test.go index 4649a7426f..e5791e81a6 100644 --- a/protocol/rpcprovider/provider_state_machine_test.go +++ b/protocol/rpcprovider/provider_state_machine_test.go @@ -6,11 +6,11 @@ import ( "time" "github.com/golang/mock/gomock" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - types "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + types "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/reliabilitymanager/reliability_manager.go b/protocol/rpcprovider/reliabilitymanager/reliability_manager.go index 6f6e719c0f..ce225613bc 100644 --- a/protocol/rpcprovider/reliabilitymanager/reliability_manager.go +++ b/protocol/rpcprovider/reliabilitymanager/reliability_manager.go @@ -10,15 +10,15 @@ import ( "github.com/goccy/go-json" terderminttypes "github.com/cometbft/cometbft/abci/types" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "golang.org/x/exp/slices" ) diff --git a/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go b/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go index 87813af9be..29ad44c3f6 100644 --- a/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go +++ b/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go @@ -10,20 +10,20 @@ import ( terderminttypes "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationverification" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/protocol/statetracker" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationverification" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/protocol/statetracker" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/rewardserver/reward_db.go b/protocol/rpcprovider/rewardserver/reward_db.go index 81c4bdcbc5..c53705e812 100644 --- a/protocol/rpcprovider/rewardserver/reward_db.go +++ b/protocol/rpcprovider/rewardserver/reward_db.go @@ -9,8 +9,8 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/protocol/rpcprovider/rewardserver/reward_db_test.go b/protocol/rpcprovider/rewardserver/reward_db_test.go index 9f6b16716d..6c9796bd72 100644 --- a/protocol/rpcprovider/rewardserver/reward_db_test.go +++ b/protocol/rpcprovider/rewardserver/reward_db_test.go @@ -7,9 +7,9 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/rewardserver/reward_server.go b/protocol/rpcprovider/rewardserver/reward_server.go index 76cf7673fb..f2c3ae3fb9 100644 --- a/protocol/rpcprovider/rewardserver/reward_server.go +++ b/protocol/rpcprovider/rewardserver/reward_server.go @@ -11,14 +11,14 @@ import ( terderminttypes "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/protocol/rpcprovider/rewardserver/reward_server_test.go b/protocol/rpcprovider/rewardserver/reward_server_test.go index e3c8bd3fe1..c86d920e45 100644 --- a/protocol/rpcprovider/rewardserver/reward_server_test.go +++ b/protocol/rpcprovider/rewardserver/reward_server_test.go @@ -7,16 +7,16 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" "golang.org/x/net/context" terderminttypes "github.com/cometbft/cometbft/abci/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/rpcprovider.go b/protocol/rpcprovider/rpcprovider.go index 9b860b433b..3c2a379b9e 100644 --- a/protocol/rpcprovider/rpcprovider.go +++ b/protocol/rpcprovider/rpcprovider.go @@ -16,26 +16,26 @@ import ( "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/v3/app" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/performance" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/v3/protocol/statetracker" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/protocol/upgrade" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - epochstorage "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/performance" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v4/protocol/statetracker" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/protocol/upgrade" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + epochstorage "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -779,7 +779,7 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt cmdRPCProvider.Flags().Uint(ShardIDFlagName, DefaultShardID, "shard id") cmdRPCProvider.Flags().Uint(rewardserver.RewardsSnapshotThresholdFlagName, rewardserver.DefaultRewardsSnapshotThreshold, "the number of rewards to wait until making snapshot of the rewards memory") cmdRPCProvider.Flags().Uint(rewardserver.RewardsSnapshotTimeoutSecFlagName, rewardserver.DefaultRewardsSnapshotTimeoutSec, "the seconds to wait until making snapshot of the rewards memory") - cmdRPCProvider.Flags().String(StickinessHeaderName, RPCProviderStickinessHeaderName, "the name of the header to be attacked to requests for stickiness by consumer, used for consistency") + cmdRPCProvider.Flags().String(StickinessHeaderName, RPCProviderStickinessHeaderName, "the name of the header to be attached to requests for stickiness by consumer, used for consistency") cmdRPCProvider.Flags().Uint64Var(&chaintracker.PollingMultiplier, chaintracker.PollingMultiplierFlagName, 1, "when set, forces the chain tracker to poll more often, improving the sync at the cost of more queries") cmdRPCProvider.Flags().DurationVar(&SpecValidationInterval, SpecValidationIntervalFlagName, SpecValidationInterval, "determines the interval of which to run validation on the spec for all connected chains") cmdRPCProvider.Flags().DurationVar(&SpecValidationIntervalDisabledChains, SpecValidationIntervalDisabledChainsFlagName, SpecValidationIntervalDisabledChains, "determines the interval of which to run validation on the spec for all disabled chains, determines recovery time") diff --git a/protocol/rpcprovider/rpcprovider_server.go b/protocol/rpcprovider/rpcprovider_server.go index 539e728165..acd31b9717 100644 --- a/protocol/rpcprovider/rpcprovider_server.go +++ b/protocol/rpcprovider/rpcprovider_server.go @@ -15,24 +15,24 @@ import ( "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/status" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/protocolerrors" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/performance" - "github.com/lavanet/lava/v3/protocol/provideroptimizer" - rewardserver "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/v3/protocol/upgrade" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/protocopy" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/performance" + "github.com/lavanet/lava/v4/protocol/provideroptimizer" + rewardserver "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v4/protocol/upgrade" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/protocopy" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" grpc "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" diff --git a/protocol/rpcprovider/rpcprovider_server_test.go b/protocol/rpcprovider/rpcprovider_server_test.go index 88efa5ca7d..4af6bbc5c3 100644 --- a/protocol/rpcprovider/rpcprovider_server_test.go +++ b/protocol/rpcprovider/rpcprovider_server_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/spec_validator.go b/protocol/rpcprovider/spec_validator.go index a19756d293..7cb0885779 100644 --- a/protocol/rpcprovider/spec_validator.go +++ b/protocol/rpcprovider/spec_validator.go @@ -5,10 +5,10 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/rpcprovider/spec_validator_test.go b/protocol/rpcprovider/spec_validator_test.go index c567266c26..7003b1b4c9 100644 --- a/protocol/rpcprovider/spec_validator_test.go +++ b/protocol/rpcprovider/spec_validator_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/lavasession" - testcommon "github.com/lavanet/lava/v3/testutil/common" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/lavasession" + testcommon "github.com/lavanet/lava/v4/testutil/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) diff --git a/protocol/rpcprovider/testing.go b/protocol/rpcprovider/testing.go index c7921aea24..01535bc2cb 100644 --- a/protocol/rpcprovider/testing.go +++ b/protocol/rpcprovider/testing.go @@ -15,18 +15,18 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" "github.com/gogo/status" - lvutil "github.com/lavanet/lava/v3/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingcli "github.com/lavanet/lava/v3/x/pairing/client/cli" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + lvutil "github.com/lavanet/lava/v4/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingcli "github.com/lavanet/lava/v4/x/pairing/client/cli" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" "github.com/spf13/viper" "golang.org/x/exp/slices" diff --git a/protocol/statetracker/consumer_state_tracker.go b/protocol/statetracker/consumer_state_tracker.go index 1f61a5f616..8ab2bd046e 100644 --- a/protocol/statetracker/consumer_state_tracker.go +++ b/protocol/statetracker/consumer_state_tracker.go @@ -6,16 +6,16 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - updaters "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) type ConsumerTxSenderInf interface { diff --git a/protocol/statetracker/emergency_tracker.go b/protocol/statetracker/emergency_tracker.go index b03f7b458a..1735d4acdb 100644 --- a/protocol/statetracker/emergency_tracker.go +++ b/protocol/statetracker/emergency_tracker.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/utils" - downtimev1 "github.com/lavanet/lava/v3/x/downtime/v1" + "github.com/lavanet/lava/v4/utils" + downtimev1 "github.com/lavanet/lava/v4/x/downtime/v1" ) const maxEpochsToStore = 3 diff --git a/protocol/statetracker/emergency_tracker_test.go b/protocol/statetracker/emergency_tracker_test.go index cc8589067f..c6ead534a5 100644 --- a/protocol/statetracker/emergency_tracker_test.go +++ b/protocol/statetracker/emergency_tracker_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - downtimev1 "github.com/lavanet/lava/v3/x/downtime/v1" + downtimev1 "github.com/lavanet/lava/v4/x/downtime/v1" "github.com/stretchr/testify/require" ) diff --git a/protocol/statetracker/events.go b/protocol/statetracker/events.go index fa1383e9f5..9b41f74842 100644 --- a/protocol/statetracker/events.go +++ b/protocol/statetracker/events.go @@ -21,16 +21,16 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/version" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - updaters "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) @@ -723,23 +723,17 @@ func countTransactionsPerDay(ctx context.Context, clientCtx client.Context, bloc } // Log the transactions per day results - totalTxPerDay.Range(func(key, value interface{}) bool { - utils.LavaFormatInfo("transactions per day results", utils.LogAttr("Day", key), utils.LogAttr("totalTx", value)) + totalTxPerDay.Range(func(day int64, totalTx int) bool { + utils.LavaFormatInfo("transactions per day results", utils.LogAttr("Day", day), utils.LogAttr("totalTx", totalTx)) return true // continue iteration }) // Prepare the JSON data jsonData := make(map[string]int) - totalTxPerDay.Range(func(key, value interface{}) bool { - day, ok := key.(int64) - if ok { - date := time.Now().AddDate(0, 0, -int(day)+1).Format("2006-01-02") - dateKey := fmt.Sprintf("date_%s", date) - val, ok2 := value.(int) - if ok2 { - jsonData[dateKey] = val - } - } + totalTxPerDay.Range(func(day int64, totalTx int) bool { + date := time.Now().AddDate(0, 0, -int(day)+1).Format("2006-01-02") + dateKey := fmt.Sprintf("date_%s", date) + jsonData[dateKey] = totalTx return true }) diff --git a/protocol/statetracker/provider_state_tracker.go b/protocol/statetracker/provider_state_tracker.go index f91041589e..2dc0bbddcb 100644 --- a/protocol/statetracker/provider_state_tracker.go +++ b/protocol/statetracker/provider_state_tracker.go @@ -6,14 +6,14 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/metrics" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - updaters "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/metrics" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) // ProviderStateTracker PST is a class for tracking provider data from the lava blockchain, such as epoch changes. diff --git a/protocol/statetracker/state_tracker.go b/protocol/statetracker/state_tracker.go index 5ff1312702..c50639cb34 100644 --- a/protocol/statetracker/state_tracker.go +++ b/protocol/statetracker/state_tracker.go @@ -7,13 +7,13 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/chaintracker" - "github.com/lavanet/lava/v3/protocol/lavasession" - updaters "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - specutils "github.com/lavanet/lava/v3/utils/keeper" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/chaintracker" + "github.com/lavanet/lava/v4/protocol/lavasession" + updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + specutils "github.com/lavanet/lava/v4/utils/keeper" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/statetracker/tx_sender.go b/protocol/statetracker/tx_sender.go index 95adefddd4..b0e42d5a5d 100644 --- a/protocol/statetracker/tx_sender.go +++ b/protocol/statetracker/tx_sender.go @@ -18,13 +18,13 @@ import ( 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/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - updaters "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + updaters "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/protocol/statetracker/updaters/downtime_params_updater.go b/protocol/statetracker/updaters/downtime_params_updater.go index 7f01da443d..553a0aedf0 100644 --- a/protocol/statetracker/updaters/downtime_params_updater.go +++ b/protocol/statetracker/updaters/downtime_params_updater.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/utils" - downtimev1 "github.com/lavanet/lava/v3/x/downtime/v1" + "github.com/lavanet/lava/v4/utils" + downtimev1 "github.com/lavanet/lava/v4/x/downtime/v1" ) const ( diff --git a/protocol/statetracker/updaters/epoch_updater.go b/protocol/statetracker/updaters/epoch_updater.go index 4f6b5f27b3..74cdd504c0 100644 --- a/protocol/statetracker/updaters/epoch_updater.go +++ b/protocol/statetracker/updaters/epoch_updater.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "golang.org/x/net/context" ) diff --git a/protocol/statetracker/updaters/event_tracker.go b/protocol/statetracker/updaters/event_tracker.go index 7902935fb3..6f442a83af 100644 --- a/protocol/statetracker/updaters/event_tracker.go +++ b/protocol/statetracker/updaters/event_tracker.go @@ -10,12 +10,12 @@ import ( ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/v3/utils" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v4/utils" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/statetracker/updaters/finalization_consensus_updater.go b/protocol/statetracker/updaters/finalization_consensus_updater.go index e038626b4c..d6aa4bb1d6 100644 --- a/protocol/statetracker/updaters/finalization_consensus_updater.go +++ b/protocol/statetracker/updaters/finalization_consensus_updater.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/protocol/lavaprotocol/finalizationconsensus" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v4/utils" ) const ( diff --git a/protocol/statetracker/updaters/pairing_updater.go b/protocol/statetracker/updaters/pairing_updater.go index 36aec826d0..661c2dc9d9 100644 --- a/protocol/statetracker/updaters/pairing_updater.go +++ b/protocol/statetracker/updaters/pairing_updater.go @@ -7,10 +7,10 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "golang.org/x/net/context" ) @@ -120,6 +120,7 @@ func (pu *PairingUpdater) updateInner(latestBlock int64) { } else { nextBlockForUpdateList = append(nextBlockForUpdateList, nextBlockForUpdate) } + for _, consumerSessionManager := range consumerSessionManagerList { // same pairing for all apiInterfaces, they pick the right endpoints from inside using our filter function err = pu.updateConsumerSessionManager(ctx, pairingList, consumerSessionManager, epoch) @@ -247,12 +248,17 @@ func (pu *PairingUpdater) filterPairingListByEndpoint(ctx context.Context, curre pairingEndpoints[idx] = endp } lavasession.SortByGeolocations(pairingEndpoints, currentGeo) + totalStakeAmount := provider.Stake.Amount + if !provider.DelegateTotal.Amount.IsNil() { + totalStakeAmount = totalStakeAmount.Add(provider.DelegateTotal.Amount) + } + totalStakeIncludingDelegation := sdk.Coin{Denom: provider.Stake.Denom, Amount: totalStakeAmount} pairing[uint64(providerIdx)] = lavasession.NewConsumerSessionWithProvider( provider.Address, pairingEndpoints, maxCu, epoch, - provider.Stake, + totalStakeIncludingDelegation, ) } if len(pairing) == 0 { diff --git a/protocol/statetracker/updaters/pairing_updater_test.go b/protocol/statetracker/updaters/pairing_updater_test.go index 8cd5627f61..165eb37d14 100644 --- a/protocol/statetracker/updaters/pairing_updater_test.go +++ b/protocol/statetracker/updaters/pairing_updater_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/lavanet/lava/v3/protocol/common" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils/rand" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/protocol/common" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils/rand" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/statetracker/updaters/payment_updater.go b/protocol/statetracker/updaters/payment_updater.go index d8696d0eb6..ab99feb190 100644 --- a/protocol/statetracker/updaters/payment_updater.go +++ b/protocol/statetracker/updaters/payment_updater.go @@ -3,8 +3,8 @@ package updaters import ( "sync" - "github.com/lavanet/lava/v3/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v4/utils" "golang.org/x/net/context" ) diff --git a/protocol/statetracker/updaters/policy_updater.go b/protocol/statetracker/updaters/policy_updater.go index a204890f50..17518cc082 100644 --- a/protocol/statetracker/updaters/policy_updater.go +++ b/protocol/statetracker/updaters/policy_updater.go @@ -5,10 +5,10 @@ import ( "sync" "time" - chainlib "github.com/lavanet/lava/v3/protocol/chainlib" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - plantypes "github.com/lavanet/lava/v3/x/plans/types" + chainlib "github.com/lavanet/lava/v4/protocol/chainlib" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + plantypes "github.com/lavanet/lava/v4/x/plans/types" ) const ( diff --git a/protocol/statetracker/updaters/spec_updater.go b/protocol/statetracker/updaters/spec_updater.go index 6e1647e645..31c25bf8e3 100644 --- a/protocol/statetracker/updaters/spec_updater.go +++ b/protocol/statetracker/updaters/spec_updater.go @@ -7,9 +7,9 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/utils" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/utils" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( diff --git a/protocol/statetracker/updaters/state_query.go b/protocol/statetracker/updaters/state_query.go index 5dc1973eb6..51cb45ec61 100644 --- a/protocol/statetracker/updaters/state_query.go +++ b/protocol/statetracker/updaters/state_query.go @@ -6,18 +6,18 @@ import ( "strconv" "time" - downtimev1 "github.com/lavanet/lava/v3/x/downtime/v1" + downtimev1 "github.com/lavanet/lava/v4/x/downtime/v1" "github.com/cosmos/cosmos-sdk/client" "github.com/dgraph-io/ristretto" - reliabilitymanager "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/utils" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + reliabilitymanager "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/utils" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) diff --git a/protocol/statetracker/updaters/updaters_mock.go b/protocol/statetracker/updaters/updaters_mock.go index 06d47acd1d..a2afc58a70 100644 --- a/protocol/statetracker/updaters/updaters_mock.go +++ b/protocol/statetracker/updaters/updaters_mock.go @@ -8,8 +8,8 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - lavasession "github.com/lavanet/lava/v3/protocol/lavasession" - types "github.com/lavanet/lava/v3/x/epochstorage/types" + lavasession "github.com/lavanet/lava/v4/protocol/lavasession" + types "github.com/lavanet/lava/v4/x/epochstorage/types" context "golang.org/x/net/context" ) diff --git a/protocol/statetracker/updaters/version_updater.go b/protocol/statetracker/updaters/version_updater.go index e9e1de86e7..642db23408 100644 --- a/protocol/statetracker/updaters/version_updater.go +++ b/protocol/statetracker/updaters/version_updater.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) const ( diff --git a/protocol/statetracker/updaters/vote_updater.go b/protocol/statetracker/updaters/vote_updater.go index a3a25c87a0..03bb445279 100644 --- a/protocol/statetracker/updaters/vote_updater.go +++ b/protocol/statetracker/updaters/vote_updater.go @@ -3,9 +3,9 @@ package updaters import ( "sync" - "github.com/lavanet/lava/v3/protocol/lavasession" - "github.com/lavanet/lava/v3/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/protocol/lavasession" + "github.com/lavanet/lava/v4/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v4/utils" "golang.org/x/net/context" ) diff --git a/protocol/upgrade/protocol_version.go b/protocol/upgrade/protocol_version.go index 34bd0c1346..3f3ac18d03 100644 --- a/protocol/upgrade/protocol_version.go +++ b/protocol/upgrade/protocol_version.go @@ -4,9 +4,9 @@ import ( "strconv" "strings" - "github.com/lavanet/lava/v3/protocol/statetracker/updaters" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/protocol/statetracker/updaters" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" ) type ProtocolVersion struct { diff --git a/scripts/automation_scripts/update_cosmos_spec_from_grpc.py b/scripts/automation_scripts/update_cosmos_spec_from_grpc.py index e8ca25ea03..a145e5990a 100644 --- a/scripts/automation_scripts/update_cosmos_spec_from_grpc.py +++ b/scripts/automation_scripts/update_cosmos_spec_from_grpc.py @@ -39,7 +39,7 @@ def parse_endpoints_from_grpcurl(grpc_url: str) -> dict[str, list[str]]: print("### Parsing endpoints from gRPC service") endpoints: dict[str, list[str]] = {"grpc": [], "rest": []} - content = os.popen(f"grpcurl {grpc_url} describe").read() + content = os.popen(f"grpcurl --plaintext {grpc_url} describe").read() # Regex pattern to find services starting with their corresponding rpc and rest paths grpc_pattern = re.compile( @@ -55,13 +55,15 @@ def parse_endpoints_from_grpcurl(grpc_url: str) -> dict[str, list[str]]: service_name, service_content = service_match.groups() if ( - "cosmos" in service_content - or "cosmwasm" in service_content + "cosmwasm" in service_content or "ibc" in service_content or "grpc.reflection.v1alpha" in service_content ): continue + if "cosmos" in service_content and "evm" not in service_content: + continue + # Extracting all grpc paths for rpc_match in rpc_pattern.finditer(service_content): rpc_method = rpc_match.group(1) diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index dd94d98422..45439434e7 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -33,5 +33,5 @@ done cd .. # move proto files to the right places -cp -r github.com/lavanet/lava/v3/* ./ +cp -r github.com/lavanet/lava/v4/* ./ rm -rf github.com diff --git a/testutil/common/common.go b/testutil/common/common.go index b793e34757..ab88059c23 100644 --- a/testutil/common/common.go +++ b/testutil/common/common.go @@ -7,14 +7,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - conflictconstruct "github.com/lavanet/lava/v3/x/conflict/types/construct" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + conflictconstruct "github.com/lavanet/lava/v4/x/conflict/types/construct" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/common/mock.go b/testutil/common/mock.go index c20db79410..f1ef3441aa 100644 --- a/testutil/common/mock.go +++ b/testutil/common/mock.go @@ -2,9 +2,9 @@ package common import ( sdk "github.com/cosmos/cosmos-sdk/types" - commonconsts "github.com/lavanet/lava/v3/testutil/common/consts" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) func CreateMockSpec() spectypes.Spec { diff --git a/testutil/common/tester.go b/testutil/common/tester.go index 0a13df8d4f..9032bcf281 100644 --- a/testutil/common/tester.go +++ b/testutil/common/tester.go @@ -14,21 +14,21 @@ import ( 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" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - dualstakingante "github.com/lavanet/lava/v3/x/dualstaking/ante" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils" + specutils "github.com/lavanet/lava/v4/utils/keeper" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + dualstakingante "github.com/lavanet/lava/v4/x/dualstaking/ante" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) @@ -161,6 +161,11 @@ func (ts *Tester) StakeProvider(vault string, provider string, spec spectypes.Sp return ts.StakeProviderExtra(vault, provider, spec, amount, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) } +func (ts *Tester) StakeProviderCommision(vault string, provider string, spec spectypes.Spec, amount int64, commission uint64) error { + d := MockDescription() + return ts.StakeProviderFull(vault, provider, spec, amount, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, commission) +} + func (ts *Tester) StakeProviderExtra( vault string, provider string, @@ -173,6 +178,35 @@ func (ts *Tester) StakeProviderExtra( website string, securityContact string, descriptionDetails string, +) error { + return ts.StakeProviderFull(vault, + provider, + spec, + amount, + endpoints, + geoloc, + moniker, + identity, + website, + securityContact, + descriptionDetails, + uint64(100), + ) +} + +func (ts *Tester) StakeProviderFull( + vault string, + provider string, + spec spectypes.Spec, + amount int64, + endpoints []epochstoragetypes.Endpoint, + geoloc int32, + moniker string, + identity string, + website string, + securityContact string, + descriptionDetails string, + commission uint64, ) error { // if geoloc left zero, use default 1 if geoloc == 0 { @@ -199,7 +233,7 @@ func (ts *Tester) StakeProviderExtra( stake := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(amount)) description := stakingtypes.NewDescription(moniker, identity, website, securityContact, descriptionDetails) - _, err := ts.TxPairingStakeProvider(vault, provider, spec.Index, stake, endpoints, geoloc, description) + _, err := ts.TxPairingStakeProvider(vault, provider, spec.Index, stake, endpoints, geoloc, description, commission) return err } @@ -352,9 +386,8 @@ func (ts *Tester) VotePeriod() uint64 { return ts.Keepers.Conflict.VotePeriod(ts.Ctx) } -func (ts *Tester) ChangeDelegationTimestamp(provider, delegator, chainID string, block uint64, timestamp int64) error { - index := dualstakingtypes.DelegationKey(provider, delegator, chainID) - return ts.Keepers.Dualstaking.ChangeDelegationTimestampForTesting(ts.Ctx, index, block, timestamp) +func (ts *Tester) ChangeDelegationTimestamp(provider, delegator string, block uint64, timestamp int64) error { + return ts.Keepers.Dualstaking.ChangeDelegationTimestampForTesting(ts.Ctx, provider, delegator, timestamp) } // proposals, transactions, queries @@ -379,7 +412,6 @@ func (ts *Tester) TxProposalAddSpecs(specs ...spectypes.Spec) error { func (ts *Tester) TxDualstakingDelegate( creator string, provider string, - chainID string, amount sdk.Coin, ) (*dualstakingtypes.MsgDelegateResponse, error) { validator, _ := ts.GetAccount(VALIDATOR, 0) @@ -387,7 +419,6 @@ func (ts *Tester) TxDualstakingDelegate( creator, sdk.ValAddress(validator.Addr).String(), provider, - chainID, amount, ) } @@ -397,14 +428,13 @@ func (ts *Tester) TxDualstakingDelegateValidator( creator string, validator string, provider string, - chainID string, amount sdk.Coin, ) (*dualstakingtypes.MsgDelegateResponse, error) { msg := &dualstakingtypes.MsgDelegate{ Creator: creator, Validator: validator, Provider: provider, - ChainID: chainID, + ChainID: "chainID", Amount: amount, } return ts.Servers.DualstakingServer.Delegate(ts.GoCtx, msg) @@ -415,16 +445,14 @@ func (ts *Tester) TxDualstakingRedelegate( creator string, fromProvider string, toProvider string, - fromChainID string, - toChainID string, amount sdk.Coin, ) (*dualstakingtypes.MsgRedelegateResponse, error) { msg := &dualstakingtypes.MsgRedelegate{ Creator: creator, FromProvider: fromProvider, ToProvider: toProvider, - FromChainID: fromChainID, - ToChainID: toChainID, + FromChainID: "fromChainID", + ToChainID: "toChainID", Amount: amount, } return ts.Servers.DualstakingServer.Redelegate(ts.GoCtx, msg) @@ -434,7 +462,6 @@ func (ts *Tester) TxDualstakingRedelegate( func (ts *Tester) TxDualstakingUnbond( creator string, provider string, - chainID string, amount sdk.Coin, ) (*dualstakingtypes.MsgUnbondResponse, error) { validator, _ := ts.GetAccount(VALIDATOR, 0) @@ -442,7 +469,6 @@ func (ts *Tester) TxDualstakingUnbond( creator, sdk.ValAddress(validator.Addr).String(), provider, - chainID, amount, ) } @@ -452,14 +478,13 @@ func (ts *Tester) TxDualstakingUnbondValidator( creator string, validator string, provider string, - chainID string, amount sdk.Coin, ) (*dualstakingtypes.MsgUnbondResponse, error) { msg := &dualstakingtypes.MsgUnbond{ Creator: creator, Validator: validator, Provider: provider, - ChainID: chainID, + ChainID: "chainID", Amount: amount, } return ts.Servers.DualstakingServer.Unbond(ts.GoCtx, msg) @@ -573,6 +598,7 @@ func (ts *Tester) TxPairingStakeProvider( endpoints []epochstoragetypes.Endpoint, geoloc int32, description stakingtypes.Description, + commission uint64, ) (*pairingtypes.MsgStakeProviderResponse, error) { val, _ := ts.GetAccount(VALIDATOR, 0) msg := &pairingtypes.MsgStakeProvider{ @@ -583,7 +609,7 @@ func (ts *Tester) TxPairingStakeProvider( Geolocation: geoloc, Endpoints: endpoints, DelegateLimit: sdk.NewCoin(ts.Keepers.StakingKeeper.BondDenom(ts.Ctx), sdk.ZeroInt()), - DelegateCommission: 100, + DelegateCommission: commission, Address: provider, Description: description, } @@ -688,6 +714,17 @@ func (ts *Tester) TxPairingUnfreezeProvider(addr, chainID string) (*pairingtypes return ts.Servers.PairingServer.UnfreezeProvider(ts.GoCtx, msg) } +// TxPairingMoveStake: implement 'tx pairing move-provider-stake' +func (ts *Tester) TxPairingMoveStake(provider, src, dst string, amount int64) (*pairingtypes.MsgMoveProviderStakeResponse, error) { + msg := &pairingtypes.MsgMoveProviderStake{ + Creator: provider, + SrcChain: src, + DstChain: dst, + Amount: NewCoin(ts.BondDenom(), amount), + } + return ts.Servers.PairingServer.MoveProviderStake(ts.GoCtx, msg) +} + func (ts *Tester) TxRewardsSetIprpcDataProposal(authority string, cost sdk.Coin, subs []string) (*rewardstypes.MsgSetIprpcDataResponse, error) { msg := rewardstypes.NewMsgSetIprpcData(authority, cost, subs) return ts.Servers.RewardsServer.SetIprpcData(ts.GoCtx, msg) @@ -792,6 +829,15 @@ func (ts *Tester) QuerySubscriptionNextToMonthExpiry() (*subscriptiontypes.Query return ts.Keepers.Subscription.NextToMonthExpiry(ts.GoCtx, msg) } +// QuerySubscriptionEstimateRewards: implement 'q subscription estimate-provider-rewards' +func (ts *Tester) QuerySubscriptionEstimateProviderRewards(provider string, amountDelegator string) (*subscriptiontypes.QueryEstimatedRewardsResponse, error) { + msg := &subscriptiontypes.QueryEstimatedProviderRewardsRequest{ + Provider: provider, + AmountDelegator: amountDelegator, + } + return ts.Keepers.Subscription.EstimatedProviderRewards(ts.GoCtx, msg) +} + // QueryProjectInfo implements 'q project info' func (ts *Tester) QueryProjectInfo(projectID string) (*projectstypes.QueryInfoResponse, error) { msg := &projectstypes.QueryInfoRequest{Project: projectID} @@ -885,19 +931,17 @@ func (ts *Tester) QueryPairingSubscriptionMonthlyPayout(consumer string) (*pairi } // QueryPairingVerifyPairing implements 'q dualstaking delegator-providers' -func (ts *Tester) QueryDualstakingDelegatorProviders(delegator string, withPending bool) (*dualstakingtypes.QueryDelegatorProvidersResponse, error) { +func (ts *Tester) QueryDualstakingDelegatorProviders(delegator string) (*dualstakingtypes.QueryDelegatorProvidersResponse, error) { msg := &dualstakingtypes.QueryDelegatorProvidersRequest{ - Delegator: delegator, - WithPending: withPending, + Delegator: delegator, } return ts.Keepers.Dualstaking.DelegatorProviders(ts.GoCtx, msg) } // QueryDualstakingProviderDelegators implements 'q dualstaking provider-delegators' -func (ts *Tester) QueryDualstakingProviderDelegators(provider string, withPending bool) (*dualstakingtypes.QueryProviderDelegatorsResponse, error) { +func (ts *Tester) QueryDualstakingProviderDelegators(provider string) (*dualstakingtypes.QueryProviderDelegatorsResponse, error) { msg := &dualstakingtypes.QueryProviderDelegatorsRequest{ - Provider: provider, - WithPending: withPending, + Provider: provider, } return ts.Keepers.Dualstaking.ProviderDelegators(ts.GoCtx, msg) } @@ -1228,3 +1272,21 @@ func (ts *Tester) DisableParticipationFees() { require.Nil(ts.T, err) require.True(ts.T, ts.Keepers.Rewards.GetParams(ts.Ctx).ValidatorsSubscriptionParticipation.IsZero()) } + +// deductParticipationFees calculates the validators and community participation +// fees and returns the providers reward after deducting them +func (ts *Tester) DeductParticipationFees(reward math.Int) (updatedReward math.Int, valParticipation math.Int, communityParticipation math.Int) { + valPerc, communityPerc, err := ts.Keepers.Rewards.CalculateContributionPercentages(ts.Ctx, reward) + require.Nil(ts.T, err) + valParticipation = valPerc.MulInt(reward).TruncateInt() + communityParticipation = communityPerc.MulInt(reward).TruncateInt() + return reward.Sub(valParticipation).Sub(communityParticipation), valParticipation, communityParticipation +} + +// EstimateProviderRewards uses the subscription's "estimate-provider-rewards" query and returns +// the estimated rewards in math.Int form +func (ts *Tester) EstimateProviderRewards(provider string, delegatorAmount string) (total math.Int, info []subscriptiontypes.EstimatedRewardInfo) { + res, err := ts.QuerySubscriptionEstimateProviderRewards(provider, delegatorAmount) + require.NoError(ts.T, err) + return res.Total.AmountOf(ts.BondDenom()).TruncateInt(), res.Info +} diff --git a/testutil/e2e/paymentE2E.go b/testutil/e2e/paymentE2E.go index c63d1f1a1e..99bc108d50 100644 --- a/testutil/e2e/paymentE2E.go +++ b/testutil/e2e/paymentE2E.go @@ -13,14 +13,14 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/cmd/lavad/cmd" - commonconsts "github.com/lavanet/lava/v3/testutil/common/consts" - e2esdk "github.com/lavanet/lava/v3/testutil/e2e/sdk" - "github.com/lavanet/lava/v3/utils" - dualstakingTypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochStorageTypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingTypes "github.com/lavanet/lava/v3/x/pairing/types" - subscriptionTypes "github.com/lavanet/lava/v3/x/subscription/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" + dualstakingTypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochStorageTypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingTypes "github.com/lavanet/lava/v4/x/pairing/types" + subscriptionTypes "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) diff --git a/testutil/e2e/protocolE2E.go b/testutil/e2e/protocolE2E.go index 5961e14b03..541eb66a2c 100644 --- a/testutil/e2e/protocolE2E.go +++ b/testutil/e2e/protocolE2E.go @@ -30,14 +30,14 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" "github.com/gorilla/websocket" - commonconsts "github.com/lavanet/lava/v3/testutil/common/consts" - "github.com/lavanet/lava/v3/testutil/e2e/sdk" - "github.com/lavanet/lava/v3/utils" - epochStorageTypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingTypes "github.com/lavanet/lava/v3/x/pairing/types" - planTypes "github.com/lavanet/lava/v3/x/plans/types" - specTypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptionTypes "github.com/lavanet/lava/v3/x/subscription/types" + commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" + "github.com/lavanet/lava/v4/testutil/e2e/sdk" + "github.com/lavanet/lava/v4/utils" + epochStorageTypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingTypes "github.com/lavanet/lava/v4/x/pairing/types" + planTypes "github.com/lavanet/lava/v4/x/plans/types" + specTypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptionTypes "github.com/lavanet/lava/v4/x/subscription/types" "golang.org/x/exp/slices" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/testutil/e2e/proxy/proxy.go b/testutil/e2e/proxy/proxy.go index 0fb68c6e18..9eb9dde326 100644 --- a/testutil/e2e/proxy/proxy.go +++ b/testutil/e2e/proxy/proxy.go @@ -11,8 +11,8 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/v3/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v4/protocol/chainlib/chainproxy/rpcclient" ) // var mockFolder string = "testutil/e2e/proxy/mockMaps/" diff --git a/testutil/e2e/sdk/e2e.go b/testutil/e2e/sdk/e2e.go index c7e5147b44..1f452e737b 100644 --- a/testutil/e2e/sdk/e2e.go +++ b/testutil/e2e/sdk/e2e.go @@ -12,8 +12,8 @@ import ( "strings" "sync" - "github.com/lavanet/lava/v3/utils" - pairingTypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingTypes "github.com/lavanet/lava/v4/x/pairing/types" "golang.org/x/exp/slices" "google.golang.org/grpc" ) diff --git a/testutil/e2e/sdkE2E.go b/testutil/e2e/sdkE2E.go index 0af0bc8321..7492812b0f 100644 --- a/testutil/e2e/sdkE2E.go +++ b/testutil/e2e/sdkE2E.go @@ -10,10 +10,10 @@ import ( "strings" "time" - commonconsts "github.com/lavanet/lava/v3/testutil/common/consts" - "github.com/lavanet/lava/v3/testutil/e2e/sdk" - "github.com/lavanet/lava/v3/utils" - epochStorageTypes "github.com/lavanet/lava/v3/x/epochstorage/types" + commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" + "github.com/lavanet/lava/v4/testutil/e2e/sdk" + "github.com/lavanet/lava/v4/utils" + epochStorageTypes "github.com/lavanet/lava/v4/x/epochstorage/types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) diff --git a/testutil/keeper/conflict.go b/testutil/keeper/conflict.go index fadb72bc0f..beb8636a9b 100644 --- a/testutil/keeper/conflict.go +++ b/testutil/keeper/conflict.go @@ -10,9 +10,9 @@ import ( 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/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/dualstaking.go b/testutil/keeper/dualstaking.go index c1c848ee5f..e6149d6f4b 100644 --- a/testutil/keeper/dualstaking.go +++ b/testutil/keeper/dualstaking.go @@ -12,12 +12,12 @@ import ( 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/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - speckeeper "github.com/lavanet/lava/v3/x/spec/keeper" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + speckeeper "github.com/lavanet/lava/v4/x/spec/keeper" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/epochstorage.go b/testutil/keeper/epochstorage.go index 1b0a0f5a52..7cc584527a 100644 --- a/testutil/keeper/epochstorage.go +++ b/testutil/keeper/epochstorage.go @@ -12,8 +12,8 @@ import ( 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/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/keepers_init.go b/testutil/keeper/keepers_init.go index 03a6f5f336..b9e289b376 100644 --- a/testutil/keeper/keepers_init.go +++ b/testutil/keeper/keepers_init.go @@ -31,38 +31,38 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - commonconsts "github.com/lavanet/lava/v3/testutil/common/consts" - "github.com/lavanet/lava/v3/utils/sigs" - conflictkeeper "github.com/lavanet/lava/v3/x/conflict/keeper" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - downtimekeeper "github.com/lavanet/lava/v3/x/downtime/keeper" - downtimemoduletypes "github.com/lavanet/lava/v3/x/downtime/types" - downtimev1 "github.com/lavanet/lava/v3/x/downtime/v1" - dualstakingkeeper "github.com/lavanet/lava/v3/x/dualstaking/keeper" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/pairing" - pairingkeeper "github.com/lavanet/lava/v3/x/pairing/keeper" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - "github.com/lavanet/lava/v3/x/plans" - planskeeper "github.com/lavanet/lava/v3/x/plans/keeper" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectskeeper "github.com/lavanet/lava/v3/x/projects/keeper" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - protocolkeeper "github.com/lavanet/lava/v3/x/protocol/keeper" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - rewardskeeper "github.com/lavanet/lava/v3/x/rewards/keeper" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - "github.com/lavanet/lava/v3/x/spec" - speckeeper "github.com/lavanet/lava/v3/x/spec/keeper" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptionkeeper "github.com/lavanet/lava/v3/x/subscription/keeper" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" + "github.com/lavanet/lava/v4/utils/sigs" + conflictkeeper "github.com/lavanet/lava/v4/x/conflict/keeper" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + downtimekeeper "github.com/lavanet/lava/v4/x/downtime/keeper" + downtimemoduletypes "github.com/lavanet/lava/v4/x/downtime/types" + downtimev1 "github.com/lavanet/lava/v4/x/downtime/v1" + dualstakingkeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/pairing" + pairingkeeper "github.com/lavanet/lava/v4/x/pairing/keeper" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + "github.com/lavanet/lava/v4/x/plans" + planskeeper "github.com/lavanet/lava/v4/x/plans/keeper" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectskeeper "github.com/lavanet/lava/v4/x/projects/keeper" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + protocolkeeper "github.com/lavanet/lava/v4/x/protocol/keeper" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + rewardskeeper "github.com/lavanet/lava/v4/x/rewards/keeper" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + "github.com/lavanet/lava/v4/x/spec" + speckeeper "github.com/lavanet/lava/v4/x/spec/keeper" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptionkeeper "github.com/lavanet/lava/v4/x/subscription/keeper" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/stretchr/testify/require" ) @@ -335,8 +335,6 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { ctx = ctx.WithBlockTime(fixedDate) } - ks.Dualstaking.InitDelegations(ctx, *fixationtypes.DefaultGenesis()) - ks.Dualstaking.InitDelegators(ctx, *fixationtypes.DefaultGenesis()) ks.Plans.InitPlans(ctx, *fixationtypes.DefaultGenesis()) ks.Subscription.InitSubscriptions(ctx, *fixationtypes.DefaultGenesis()) ks.Subscription.InitSubscriptionsTimers(ctx, *timerstoretypes.DefaultGenesis()) diff --git a/testutil/keeper/pairing.go b/testutil/keeper/pairing.go index 876fb8be5e..5c9a91ba30 100644 --- a/testutil/keeper/pairing.go +++ b/testutil/keeper/pairing.go @@ -12,13 +12,13 @@ import ( 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/v3/x/epochstorage" - epochstoragekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + epochstoragemodule "github.com/lavanet/lava/v4/x/epochstorage" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/plan.go b/testutil/keeper/plan.go index b9ec9e51a7..8a19802050 100644 --- a/testutil/keeper/plan.go +++ b/testutil/keeper/plan.go @@ -12,12 +12,12 @@ import ( 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/v3/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - "github.com/lavanet/lava/v3/x/plans/keeper" - "github.com/lavanet/lava/v3/x/plans/types" - speckeeper "github.com/lavanet/lava/v3/x/spec/keeper" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + "github.com/lavanet/lava/v4/x/plans/keeper" + "github.com/lavanet/lava/v4/x/plans/types" + speckeeper "github.com/lavanet/lava/v4/x/spec/keeper" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/projects.go b/testutil/keeper/projects.go index 2dab70b6f8..ac818e7c55 100644 --- a/testutil/keeper/projects.go +++ b/testutil/keeper/projects.go @@ -12,11 +12,11 @@ import ( 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/v3/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/protocol.go b/testutil/keeper/protocol.go index 5d19affa39..c0dea6a920 100644 --- a/testutil/keeper/protocol.go +++ b/testutil/keeper/protocol.go @@ -14,8 +14,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/v3/x/protocol/keeper" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/keeper" + "github.com/lavanet/lava/v4/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/rewards.go b/testutil/keeper/rewards.go index 8d828b3b1f..4bf2afcc4e 100644 --- a/testutil/keeper/rewards.go +++ b/testutil/keeper/rewards.go @@ -18,13 +18,13 @@ import ( typesparams "github.com/cosmos/cosmos-sdk/x/params/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - downtimekeeper "github.com/lavanet/lava/v3/x/downtime/keeper" - downtimemoduletypes "github.com/lavanet/lava/v3/x/downtime/types" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" - epochstoragekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/rewards/keeper" - "github.com/lavanet/lava/v3/x/rewards/types" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + downtimekeeper "github.com/lavanet/lava/v4/x/downtime/keeper" + downtimemoduletypes "github.com/lavanet/lava/v4/x/downtime/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/rewards/keeper" + "github.com/lavanet/lava/v4/x/rewards/types" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/subscription.go b/testutil/keeper/subscription.go index a1be7f77a0..6d27f976a1 100644 --- a/testutil/keeper/subscription.go +++ b/testutil/keeper/subscription.go @@ -12,14 +12,14 @@ import ( 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/v3/x/dualstaking/keeper" - epochstoragekeeper "github.com/lavanet/lava/v3/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/v3/x/fixationstore/keeper" - planskeeper "github.com/lavanet/lava/v3/x/plans/keeper" - projectskeeper "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + dualstakingkeeper "github.com/lavanet/lava/v4/x/dualstaking/keeper" + epochstoragekeeper "github.com/lavanet/lava/v4/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v4/x/fixationstore/keeper" + planskeeper "github.com/lavanet/lava/v4/x/plans/keeper" + projectskeeper "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/network/network.go b/testutil/network/network.go index c3ff8bcd2f..a1b72c2e92 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -20,7 +20,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/lavanet/lava/v3/app" + "github.com/lavanet/lava/v4/app" ) type ( diff --git a/utils/address.go b/utils/address.go index d284ad818d..8aee26eed4 100644 --- a/utils/address.go +++ b/utils/address.go @@ -3,7 +3,7 @@ package utils import ( "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) func IsBech32Address(addr string) bool { diff --git a/utils/cli/multisend.go b/utils/cli/multisend.go index c69c3aa2f1..6fe0658c91 100644 --- a/utils/cli/multisend.go +++ b/utils/cli/multisend.go @@ -17,7 +17,7 @@ import ( authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/utils/common/types/provider.go b/utils/common/types/provider.go index f83a43d723..7921bbbe1a 100644 --- a/utils/common/types/provider.go +++ b/utils/common/types/provider.go @@ -2,7 +2,5 @@ package types // empty provider consts const ( - EMPTY_PROVIDER = "empty_provider" - EMPTY_PROVIDER_CHAINID = "" - EMPTY_PROVIDER_CHAINID_STAR = "*" + EMPTY_PROVIDER = "empty_provider" ) diff --git a/utils/keeper/spec.go b/utils/keeper/spec.go index 32735b78cb..b31d6d696e 100644 --- a/utils/keeper/spec.go +++ b/utils/keeper/spec.go @@ -17,9 +17,9 @@ import ( 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/v3/x/spec/client/utils" - "github.com/lavanet/lava/v3/x/spec/keeper" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/client/utils" + "github.com/lavanet/lava/v4/x/spec/keeper" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/utils/lavalog_test.go b/utils/lavalog_test.go index ca40e30422..9e46e60f78 100644 --- a/utils/lavalog_test.go +++ b/utils/lavalog_test.go @@ -4,7 +4,7 @@ import ( "testing" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" "github.com/stretchr/testify/require" ) diff --git a/utils/lavaslices/slices.go b/utils/lavaslices/slices.go index 747b5fc3f0..abad07d4f1 100644 --- a/utils/lavaslices/slices.go +++ b/utils/lavaslices/slices.go @@ -146,6 +146,15 @@ func Remove[T comparable](slice []T, elem T) ([]T, bool) { return slice, false } +func AddUnique[T comparable](slice []T, elem T) []T { + for _, e := range slice { + if e == elem { + return slice + } + } + return append(slice, elem) +} + func IsSubset[T comparable](subset, superset []T) bool { subsetMap := make(map[T]bool) commonMap := make(map[T]bool) diff --git a/utils/maps/maps.go b/utils/maps/maps.go index 4658ebf3f3..e6702b46fb 100644 --- a/utils/maps/maps.go +++ b/utils/maps/maps.go @@ -1,8 +1,9 @@ package maps import ( - "github.com/lavanet/lava/v3/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/lavaslices" "golang.org/x/exp/constraints" + "golang.org/x/exp/maps" ) func FindLargestIntValueInMap[K comparable](myMap map[K]int) (K, int) { @@ -22,11 +23,7 @@ func FindLargestIntValueInMap[K comparable](myMap map[K]int) (K, int) { } func StableSortedKeys[T constraints.Ordered, V any](m map[T]V) []T { - keys := make([]T, 0, len(m)) - for k := range m { - keys = append(keys, k) - } - + keys := maps.Keys(m) lavaslices.SortStable(keys) return keys } diff --git a/utils/protocopy/proto_copy.go b/utils/protocopy/proto_copy.go index 5abceb97fa..08c502d7db 100644 --- a/utils/protocopy/proto_copy.go +++ b/utils/protocopy/proto_copy.go @@ -1,7 +1,7 @@ package protocopy import ( - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type protoTypeOut interface { diff --git a/utils/protocopy/proto_copy_test.go b/utils/protocopy/proto_copy_test.go index 823f5b06c8..63712dc9d6 100644 --- a/utils/protocopy/proto_copy_test.go +++ b/utils/protocopy/proto_copy_test.go @@ -3,7 +3,7 @@ package protocopy import ( "testing" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/utils/sigs/sigs.go b/utils/sigs/sigs.go index cb737a5844..a50052502f 100644 --- a/utils/sigs/sigs.go +++ b/utils/sigs/sigs.go @@ -25,7 +25,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) type Account struct { diff --git a/x/conflict/client/cli/query.go b/x/conflict/client/cli/query.go index 2123cc991d..8ea94b196b 100644 --- a/x/conflict/client/cli/query.go +++ b/x/conflict/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/conflict/client/cli/query_conflict_vote.go b/x/conflict/client/cli/query_conflict_vote.go index 85bd0e3333..af4f644d7c 100644 --- a/x/conflict/client/cli/query_conflict_vote.go +++ b/x/conflict/client/cli/query_conflict_vote.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/query_conflict_vote_test.go b/x/conflict/client/cli/query_conflict_vote_test.go index eadc1ff18e..217cf28bb2 100644 --- a/x/conflict/client/cli/query_conflict_vote_test.go +++ b/x/conflict/client/cli/query_conflict_vote_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/v3/testutil/network" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/conflict/client/cli" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/testutil/network" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/conflict/client/cli" + "github.com/lavanet/lava/v4/x/conflict/types" ) // Prevent strconv unused error diff --git a/x/conflict/client/cli/query_consumer_conflicts.go b/x/conflict/client/cli/query_consumer_conflicts.go index 17bcd5d166..b8d3703cc4 100644 --- a/x/conflict/client/cli/query_consumer_conflicts.go +++ b/x/conflict/client/cli/query_consumer_conflicts.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/query_params.go b/x/conflict/client/cli/query_params.go index 54b61b4fd3..e4eb6cd315 100644 --- a/x/conflict/client/cli/query_params.go +++ b/x/conflict/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/query_provider_conflicts.go b/x/conflict/client/cli/query_provider_conflicts.go index c299b9cd6a..a7749083af 100644 --- a/x/conflict/client/cli/query_provider_conflicts.go +++ b/x/conflict/client/cli/query_provider_conflicts.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/tx.go b/x/conflict/client/cli/tx.go index cef4c40147..0d7db53465 100644 --- a/x/conflict/client/cli/tx.go +++ b/x/conflict/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/conflict/client/cli/tx_conflict_vote_commit.go b/x/conflict/client/cli/tx_conflict_vote_commit.go index f66a1feb40..da4ce50b51 100644 --- a/x/conflict/client/cli/tx_conflict_vote_commit.go +++ b/x/conflict/client/cli/tx_conflict_vote_commit.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/tx_conflict_vote_reveal.go b/x/conflict/client/cli/tx_conflict_vote_reveal.go index e035d66dd6..6395d5a8ad 100644 --- a/x/conflict/client/cli/tx_conflict_vote_reveal.go +++ b/x/conflict/client/cli/tx_conflict_vote_reveal.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/tx_detection.go b/x/conflict/client/cli/tx_detection.go index 12e60e8da2..e65a449f94 100644 --- a/x/conflict/client/cli/tx_detection.go +++ b/x/conflict/client/cli/tx_detection.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/genesis.go b/x/conflict/genesis.go index c50527a21f..cdfb45be35 100644 --- a/x/conflict/genesis.go +++ b/x/conflict/genesis.go @@ -2,8 +2,8 @@ package conflict import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/conflict/genesis_test.go b/x/conflict/genesis_test.go index ece34c0eef..80095f53d5 100644 --- a/x/conflict/genesis_test.go +++ b/x/conflict/genesis_test.go @@ -3,10 +3,10 @@ package conflict_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/conflict" - "github.com/lavanet/lava/v3/x/conflict/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/conflict" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/handler.go b/x/conflict/handler.go index 3ca99b0d85..f3043b67a9 100644 --- a/x/conflict/handler.go +++ b/x/conflict/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) // NewHandler ... diff --git a/x/conflict/keeper/conflict.go b/x/conflict/keeper/conflict.go index b1f5c19ae9..d6b6a36c62 100644 --- a/x/conflict/keeper/conflict.go +++ b/x/conflict/keeper/conflict.go @@ -6,13 +6,13 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/maps" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/maps" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) func (k Keeper) ValidateFinalizationConflict(ctx sdk.Context, conflictData *types.FinalizationConflict, clientAddr sdk.AccAddress) error { diff --git a/x/conflict/keeper/conflict_test.go b/x/conflict/keeper/conflict_test.go index adeaf26d63..4cf44e5518 100644 --- a/x/conflict/keeper/conflict_test.go +++ b/x/conflict/keeper/conflict_test.go @@ -4,9 +4,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/conflict_vote.go b/x/conflict/keeper/conflict_vote.go index 810c701b2a..903b5416f1 100644 --- a/x/conflict/keeper/conflict_vote.go +++ b/x/conflict/keeper/conflict_vote.go @@ -3,7 +3,7 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) // SetConflictVote set a specific conflictVote in the store from its index diff --git a/x/conflict/keeper/conflict_vote_test.go b/x/conflict/keeper/conflict_vote_test.go index f8458b6bb5..85a2c9809c 100644 --- a/x/conflict/keeper/conflict_vote_test.go +++ b/x/conflict/keeper/conflict_vote_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/grpc_query.go b/x/conflict/keeper/grpc_query.go index 504ce3baf0..f2c3b0c025 100644 --- a/x/conflict/keeper/grpc_query.go +++ b/x/conflict/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/conflict/keeper/grpc_query_conflict_vote.go b/x/conflict/keeper/grpc_query_conflict_vote.go index c798c27fff..567d4e7728 100644 --- a/x/conflict/keeper/grpc_query_conflict_vote.go +++ b/x/conflict/keeper/grpc_query_conflict_vote.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_conflict_vote_test.go b/x/conflict/keeper/grpc_query_conflict_vote_test.go index 9db99447fb..6ba799af4c 100644 --- a/x/conflict/keeper/grpc_query_conflict_vote_test.go +++ b/x/conflict/keeper/grpc_query_conflict_vote_test.go @@ -10,9 +10,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/conflict/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/conflict/types" ) // Prevent strconv unused error diff --git a/x/conflict/keeper/grpc_query_consumer_conflicts.go b/x/conflict/keeper/grpc_query_consumer_conflicts.go index 33c48909d3..3d87f93b90 100644 --- a/x/conflict/keeper/grpc_query_consumer_conflicts.go +++ b/x/conflict/keeper/grpc_query_consumer_conflicts.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_consumer_conflicts_test.go b/x/conflict/keeper/grpc_query_consumer_conflicts_test.go index 88717d200c..4767b28bf8 100644 --- a/x/conflict/keeper/grpc_query_consumer_conflicts_test.go +++ b/x/conflict/keeper/grpc_query_consumer_conflicts_test.go @@ -5,8 +5,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/grpc_query_params.go b/x/conflict/keeper/grpc_query_params.go index 248457fcbe..3e93809d26 100644 --- a/x/conflict/keeper/grpc_query_params.go +++ b/x/conflict/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_params_test.go b/x/conflict/keeper/grpc_query_params_test.go index 32e5742f40..68ab699adc 100644 --- a/x/conflict/keeper/grpc_query_params_test.go +++ b/x/conflict/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/grpc_query_provider_conflicts.go b/x/conflict/keeper/grpc_query_provider_conflicts.go index f011da5275..4bffb20ecf 100644 --- a/x/conflict/keeper/grpc_query_provider_conflicts.go +++ b/x/conflict/keeper/grpc_query_provider_conflicts.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_provider_conflicts_test.go b/x/conflict/keeper/grpc_query_provider_conflicts_test.go index fc43419fe2..db60ff297b 100644 --- a/x/conflict/keeper/grpc_query_provider_conflicts_test.go +++ b/x/conflict/keeper/grpc_query_provider_conflicts_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) // Prevent strconv unused error diff --git a/x/conflict/keeper/keeper.go b/x/conflict/keeper/keeper.go index 89094670f9..750d45e542 100644 --- a/x/conflict/keeper/keeper.go +++ b/x/conflict/keeper/keeper.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) type ( diff --git a/x/conflict/keeper/migrations.go b/x/conflict/keeper/migrations.go index 5aaf4934cb..62a037bd79 100644 --- a/x/conflict/keeper/migrations.go +++ b/x/conflict/keeper/migrations.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v5 "github.com/lavanet/lava/v3/x/conflict/migrations/v5" + v5 "github.com/lavanet/lava/v4/x/conflict/migrations/v5" ) type Migrator struct { diff --git a/x/conflict/keeper/msg_server.go b/x/conflict/keeper/msg_server.go index 8ac8dbe84f..8fe7ad9863 100644 --- a/x/conflict/keeper/msg_server.go +++ b/x/conflict/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) type msgServer struct { diff --git a/x/conflict/keeper/msg_server_conflict_vote_commit.go b/x/conflict/keeper/msg_server_conflict_vote_commit.go index 4c263230bf..73ec0b1f71 100644 --- a/x/conflict/keeper/msg_server_conflict_vote_commit.go +++ b/x/conflict/keeper/msg_server_conflict_vote_commit.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/conflict/types" ) func (k msgServer) ConflictVoteCommit(goCtx context.Context, msg *types.MsgConflictVoteCommit) (*types.MsgConflictVoteCommitResponse, error) { diff --git a/x/conflict/keeper/msg_server_conflict_vote_reveal.go b/x/conflict/keeper/msg_server_conflict_vote_reveal.go index a27bc4e12c..d6396bd7a1 100644 --- a/x/conflict/keeper/msg_server_conflict_vote_reveal.go +++ b/x/conflict/keeper/msg_server_conflict_vote_reveal.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/conflict/types" ) func (k msgServer) ConflictVoteReveal(goCtx context.Context, msg *types.MsgConflictVoteReveal) (*types.MsgConflictVoteRevealResponse, error) { diff --git a/x/conflict/keeper/msg_server_detection.go b/x/conflict/keeper/msg_server_detection.go index 5a2dbd3727..4429ee2fc8 100644 --- a/x/conflict/keeper/msg_server_detection.go +++ b/x/conflict/keeper/msg_server_detection.go @@ -8,9 +8,9 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/conflict/types" - pairingfilters "github.com/lavanet/lava/v3/x/pairing/keeper/filters" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/conflict/types" + pairingfilters "github.com/lavanet/lava/v4/x/pairing/keeper/filters" "golang.org/x/exp/slices" ) diff --git a/x/conflict/keeper/msg_server_detection_test.go b/x/conflict/keeper/msg_server_detection_test.go index a6709b1211..c2348d0271 100644 --- a/x/conflict/keeper/msg_server_detection_test.go +++ b/x/conflict/keeper/msg_server_detection_test.go @@ -5,15 +5,15 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - conflictconstruct "github.com/lavanet/lava/v3/x/conflict/types/construct" - "github.com/lavanet/lava/v3/x/pairing/types" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + conflictconstruct "github.com/lavanet/lava/v4/x/conflict/types/construct" + "github.com/lavanet/lava/v4/x/pairing/types" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/msg_server_test.go b/x/conflict/keeper/msg_server_test.go index 9b61dd7d83..3daa9219fb 100644 --- a/x/conflict/keeper/msg_server_test.go +++ b/x/conflict/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/conflict/keeper/params.go b/x/conflict/keeper/params.go index 07201b6dd6..4cec8831ee 100644 --- a/x/conflict/keeper/params.go +++ b/x/conflict/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" ) // GetParams get all parameters as types.Params diff --git a/x/conflict/keeper/params_test.go b/x/conflict/keeper/params_test.go index 1ca4277249..f37e879fc7 100644 --- a/x/conflict/keeper/params_test.go +++ b/x/conflict/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/vote.go b/x/conflict/keeper/vote.go index 24179f9429..528a0909fa 100644 --- a/x/conflict/keeper/vote.go +++ b/x/conflict/keeper/vote.go @@ -6,8 +6,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/conflict/types" "golang.org/x/exp/slices" ) diff --git a/x/conflict/keeper/vote_test.go b/x/conflict/keeper/vote_test.go index 4df3650f17..d83c7f99e9 100644 --- a/x/conflict/keeper/vote_test.go +++ b/x/conflict/keeper/vote_test.go @@ -3,12 +3,12 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/migrations/v5/migrations.go b/x/conflict/migrations/v5/migrations.go index d69d539f11..fcc5f87818 100644 --- a/x/conflict/migrations/v5/migrations.go +++ b/x/conflict/migrations/v5/migrations.go @@ -7,7 +7,7 @@ import ( "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/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/x/conflict/module.go b/x/conflict/module.go index 06e533c5b0..c63e49ecd0 100644 --- a/x/conflict/module.go +++ b/x/conflict/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/conflict/client/cli" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/client/cli" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) var ( diff --git a/x/conflict/module_simulation.go b/x/conflict/module_simulation.go index 9cfed97f9a..43fea0d140 100644 --- a/x/conflict/module_simulation.go +++ b/x/conflict/module_simulation.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - conflictsimulation "github.com/lavanet/lava/v3/x/conflict/simulation" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/testutil/sample" + conflictsimulation "github.com/lavanet/lava/v4/x/conflict/simulation" + "github.com/lavanet/lava/v4/x/conflict/types" ) // avoid unused import issue diff --git a/x/conflict/simulation/conflict_vote_commit.go b/x/conflict/simulation/conflict_vote_commit.go index 4b32e498f0..e9bb19a51f 100644 --- a/x/conflict/simulation/conflict_vote_commit.go +++ b/x/conflict/simulation/conflict_vote_commit.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) func SimulateMsgConflictVoteCommit( diff --git a/x/conflict/simulation/conflict_vote_reveal.go b/x/conflict/simulation/conflict_vote_reveal.go index f7261a940d..f77bd6ce77 100644 --- a/x/conflict/simulation/conflict_vote_reveal.go +++ b/x/conflict/simulation/conflict_vote_reveal.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) func SimulateMsgConflictVoteReveal( diff --git a/x/conflict/simulation/detection.go b/x/conflict/simulation/detection.go index 1fc80120b9..6444cd204c 100644 --- a/x/conflict/simulation/detection.go +++ b/x/conflict/simulation/detection.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/conflict/keeper" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/keeper" + "github.com/lavanet/lava/v4/x/conflict/types" ) func SimulateMsgDetection( diff --git a/x/conflict/types/conflict_data.pb.go b/x/conflict/types/conflict_data.pb.go index e46d1c0f96..129bb39487 100644 --- a/x/conflict/types/conflict_data.pb.go +++ b/x/conflict/types/conflict_data.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/pairing/types" + types "github.com/lavanet/lava/v4/x/pairing/types" io "io" math "math" math_bits "math/bits" @@ -348,37 +348,37 @@ var fileDescriptor_db493e54bcd78171 = []byte{ // 521 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0x13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xfe, 0x1b, 0x38, 0x80, 0x50, 0xa9, 0x75, 0x6e, 0xf9, 0xf6, 0xbe, 0x77, + 0x48, 0x5a, 0xcd, 0x27, 0x4e, 0x2b, 0x4c, 0x3d, 0x7d, 0x75, 0x3d, 0xf0, 0xd0, 0xcd, 0xc0, 0x43, + 0xbf, 0x07, 0x1e, 0xfa, 0x36, 0xf4, 0x4a, 0x37, 0x43, 0xaf, 0xf4, 0x6b, 0xe8, 0x95, 0x2e, 0x8e, + 0x12, 0xa1, 0xbb, 0xbd, 0x56, 0x10, 0xab, 0xcb, 0x70, 0xea, 0x15, 0xb9, 0x7a, 0x1a, 0x7e, 0xfe, + 0xfb, 0x44, 0xe9, 0x7e, 0xc6, 0xa1, 0x75, 0xc7, 0x3e, 0x26, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, + 0xff, 0xbe, 0x9b, 0x23, 0x33, 0xc8, 0x04, 0x00, 0x00, } func (m *ResponseConflict) Marshal() (dAtA []byte, err error) { diff --git a/x/conflict/types/conflict_vote.pb.go b/x/conflict/types/conflict_vote.pb.go index f103f79a79..ddd56f793b 100644 --- a/x/conflict/types/conflict_vote.pb.go +++ b/x/conflict/types/conflict_vote.pb.go @@ -281,33 +281,33 @@ var fileDescriptor_a96842d3d7b42db7 = []byte{ // 456 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0x13, 0x31, 0x10, 0xcd, 0x36, 0x9b, 0x34, 0x99, 0xa4, 0x3d, 0x58, 0x05, 0x59, 0x05, 0x6d, 0x57, 0x11, 0x42, - 0x41, 0x48, 0xbb, 0x52, 0x7b, 0xe0, 0x0a, 0x21, 0x48, 0x20, 0x40, 0x42, 0x8b, 0xe0, 0xc0, 0x05, + 0x41, 0x48, 0xbb, 0x52, 0x41, 0xe2, 0x0a, 0x21, 0x48, 0x20, 0x40, 0x42, 0x8b, 0xe0, 0xc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xcc, 0x4c, 0x43, 0xa6, 0x8f, 0xc9, 0x6d, 0x68, 0x17, 0x68, 0xe6, 0x95, 0xa5, 0xcd, 0x34, 0x1a, 0x36, 0x8b, 0x80, 0x06, 0x3f, 0x62, 0xe8, 0x3f, 0x0f, - 0x25, 0x7b, 0xdb, 0x03, 0x68, 0x09, 0x59, 0xe2, 0x79, 0x30, 0xad, 0x01, 0x79, 0x00, 0x7b, 0xbc, + 0x25, 0x7b, 0xdb, 0x03, 0x68, 0x09, 0x59, 0xe2, 0x59, 0x30, 0xad, 0x01, 0xb9, 0x07, 0x7b, 0xbc, 0x12, 0x28, 0xed, 0xb3, 0x70, 0xe4, 0x8e, 0xdf, 0xdd, 0x26, 0xc9, 0x00, 0xfa, 0x6e, 0x2e, 0x63, - 0x64, 0x65, 0x25, 0x24, 0xfa, 0xa3, 0xe2, 0x62, 0x8b, 0x23, 0x0f, 0x61, 0xdf, 0xe1, 0xf7, 0x96, - 0x69, 0x3b, 0xaa, 0x14, 0xff, 0x42, 0x63, 0xaf, 0xba, 0xc1, 0x92, 0xfb, 0xd0, 0x0d, 0x8c, 0x45, - 0xda, 0xf2, 0x35, 0x5f, 0x11, 0xae, 0x79, 0x3e, 0x65, 0x42, 0xbe, 0x1a, 0xd3, 0x76, 0xdd, 0x7c, + 0x64, 0x65, 0x25, 0x24, 0xfa, 0xa3, 0xe2, 0x62, 0x8b, 0x23, 0xf7, 0x61, 0xdf, 0xe1, 0xf7, 0x96, + 0x69, 0x3b, 0xaa, 0x14, 0xff, 0x42, 0x63, 0xaf, 0xba, 0xc6, 0x92, 0xbb, 0xd0, 0x0d, 0x8c, 0x45, + 0xda, 0xf2, 0x35, 0x5f, 0x12, 0xae, 0x79, 0x3e, 0x65, 0x42, 0xbe, 0x1a, 0xd3, 0x76, 0xdd, 0x7c, 0x80, 0xae, 0x51, 0x36, 0x13, 0x1f, 0x74, 0x45, 0x77, 0xfd, 0x46, 0x40, 0x24, 0x85, 0x9e, 0xc6, - 0x6f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, 0xdf, 0x21, 0x85, + 0x34, 0x1a, 0xf6, 0x8e, 0x8f, 0xb2, 0x7f, 0xbe, 0x81, 0x6c, 0x2d, 0x1b, 0xc5, 0xe7, 0xbf, 0x8f, + 0x1a, 0xc5, 0x76, 0x2e, 0x79, 0x0b, 0xfb, 0x06, 0xb9, 0x92, 0xe5, 0xc6, 0xad, 0x77, 0x13, 0xb7, + 0x6b, 0xc9, 0xe4, 0x09, 0xb4, 0xdc, 0x80, 0x0c, 0xed, 0xa7, 0xcd, 0x61, 0xef, 0xf8, 0xce, 0x7f, + 0x5c, 0xdc, 0x2d, 0x07, 0x87, 0x5a, 0x3f, 0x7a, 0x71, 0xbe, 0x4c, 0xa2, 0x8b, 0x65, 0x12, 0xfd, + 0x59, 0x26, 0xd1, 0xcf, 0x55, 0xd2, 0xb8, 0x58, 0x25, 0x8d, 0x5f, 0xab, 0xa4, 0xf1, 0xe9, 0xe1, + 0x44, 0xd8, 0xe9, 0xfc, 0x24, 0xe3, 0xea, 0x6b, 0xbe, 0xf5, 0x21, 0x16, 0x8f, 0xf3, 0xb3, 0xcb, + 0x5f, 0x61, 0xbf, 0xcf, 0xd0, 0x9c, 0xb4, 0xfd, 0x0b, 0x7f, 0xf4, 0x37, 0x00, 0x00, 0xff, 0xff, + 0x8b, 0x13, 0xe1, 0x17, 0x3b, 0x03, 0x00, 0x00, } func (m *Provider) Marshal() (dAtA []byte, err error) { diff --git a/x/conflict/types/construct/types.go b/x/conflict/types/construct/types.go index 51d692cd72..2a04d84700 100644 --- a/x/conflict/types/construct/types.go +++ b/x/conflict/types/construct/types.go @@ -1,9 +1,9 @@ package construct import ( - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/conflict/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) func ConstructReplyMetadata(reply *pairingtypes.RelayReply, req *pairingtypes.RelayRequest) *types.ReplyMetadata { diff --git a/x/conflict/types/expected_keepers.go b/x/conflict/types/expected_keepers.go index 2750df0032..7190ebc54c 100644 --- a/x/conflict/types/expected_keepers.go +++ b/x/conflict/types/expected_keepers.go @@ -3,9 +3,9 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - spectypes "github.com/lavanet/lava/v3/x/spec/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" ) type PairingKeeper interface { diff --git a/x/conflict/types/genesis.pb.go b/x/conflict/types/genesis.pb.go index 84c71a8849..76b85d786b 100644 --- a/x/conflict/types/genesis.pb.go +++ b/x/conflict/types/genesis.pb.go @@ -99,8 +99,8 @@ var fileDescriptor_71a0ca73fa4559da = []byte{ 0xe3, 0x8c, 0xa4, 0x1c, 0x6a, 0x18, 0x86, 0x11, 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, 0xe2, 0xe9, 0x32, 0x63, 0xfd, 0x0a, 0x84, 0xcf, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, - 0xc0, 0x5e, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x70, 0x1d, 0x92, 0x22, 0x95, 0x01, 0x00, + 0x8f, 0xe2, 0xe9, 0x32, 0x13, 0xfd, 0x0a, 0x84, 0xcf, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, + 0xc0, 0x5e, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x56, 0x66, 0x51, 0xfa, 0x95, 0x01, 0x00, 0x00, } diff --git a/x/conflict/types/genesis_test.go b/x/conflict/types/genesis_test.go index a2fbdaaebd..4c76d6900a 100644 --- a/x/conflict/types/genesis_test.go +++ b/x/conflict/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/conflict/types" + "github.com/lavanet/lava/v4/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/message_conflict_vote_commit_test.go b/x/conflict/types/message_conflict_vote_commit_test.go index d145a9c99f..c122a58275 100644 --- a/x/conflict/types/message_conflict_vote_commit_test.go +++ b/x/conflict/types/message_conflict_vote_commit_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/message_conflict_vote_reveal_test.go b/x/conflict/types/message_conflict_vote_reveal_test.go index fc4dd97f6d..b5e0b7f39e 100644 --- a/x/conflict/types/message_conflict_vote_reveal_test.go +++ b/x/conflict/types/message_conflict_vote_reveal_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/message_detection_test.go b/x/conflict/types/message_detection_test.go index 8e364117bf..b35d5809f0 100644 --- a/x/conflict/types/message_detection_test.go +++ b/x/conflict/types/message_detection_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/params.pb.go b/x/conflict/types/params.pb.go index 848ac29daa..141808cbf3 100644 --- a/x/conflict/types/params.pb.go +++ b/x/conflict/types/params.pb.go @@ -157,8 +157,8 @@ var fileDescriptor_a921a7b735ec6ed8 = []byte{ 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, 0xc6, 0xfa, 0x15, 0x88, 0xbc, 0x01, 0xb6, - 0x3f, 0x89, 0x0d, 0x9c, 0xdc, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x58, 0x87, 0x3a, + 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, } diff --git a/x/conflict/types/query.pb.go b/x/conflict/types/query.pb.go index e19022e44b..e3392bfeb3 100644 --- a/x/conflict/types/query.pb.go +++ b/x/conflict/types/query.pb.go @@ -546,9 +546,9 @@ var fileDescriptor_1179eb365bacd460 = []byte{ 0x3c, 0xd0, 0xf2, 0x02, 0x8a, 0x86, 0x41, 0x79, 0x01, 0x85, 0x53, 0xe0, 0xd2, 0x02, 0xd2, 0x81, 0x92, 0x2d, 0x20, 0xb5, 0xf5, 0xf6, 0x9e, 0x9d, 0xf7, 0x35, 0xe5, 0xa2, 0xaf, 0x29, 0xbf, 0xfa, 0x9a, 0xf2, 0x71, 0xa0, 0x55, 0x2e, 0x06, 0x5a, 0xe5, 0xc7, 0x40, 0xab, 0xbc, 0x7e, 0xe8, 0xb8, - 0xfc, 0x6d, 0xa7, 0x65, 0xd8, 0xcc, 0x1f, 0x8f, 0xdc, 0x6d, 0x90, 0x93, 0x51, 0x78, 0x7e, 0x1a, - 0xd2, 0xb8, 0x55, 0x15, 0x7f, 0x8f, 0x8d, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x30, 0xba, - 0xc9, 0x09, 0x08, 0x00, 0x00, + 0xfc, 0x6d, 0xa7, 0x65, 0xd8, 0xcc, 0x1f, 0x8f, 0xdc, 0x6d, 0x92, 0x93, 0x51, 0x78, 0x7e, 0x1a, + 0xd2, 0xb8, 0x55, 0x15, 0x7f, 0x8f, 0x8d, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x4b, 0x79, + 0x11, 0x09, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/conflict/types/relay_finalization.go b/x/conflict/types/relay_finalization.go index 66e75df0f1..b5e9f896e4 100644 --- a/x/conflict/types/relay_finalization.go +++ b/x/conflict/types/relay_finalization.go @@ -6,9 +6,9 @@ import ( tendermintcrypto "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) func NewRelayFinalizationFromReplyMetadataAndRelayRequest(reply ReplyMetadata, req pairingtypes.RelayRequest, consumerAddr sdk.AccAddress) RelayFinalization { diff --git a/x/conflict/types/tx.pb.go b/x/conflict/types/tx.pb.go index 772b6a8a61..b2f90f875e 100644 --- a/x/conflict/types/tx.pb.go +++ b/x/conflict/types/tx.pb.go @@ -375,7 +375,7 @@ 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, 0x6d, 0x99, 0x3a, 0xb6, 0x05, 0x41, 0xa4, 0x2c, 0x1e, 0x3a, 0x20, 0xa1, 0xea, 0x6c, + 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, @@ -399,12 +399,12 @@ var fileDescriptor_8d098f1e58e895a1 = []byte{ 0x58, 0xea, 0x51, 0x77, 0xb2, 0x4b, 0x61, 0xdc, 0xd8, 0xce, 0x78, 0xa6, 0x5e, 0x61, 0x3c, 0x2b, 0x28, 0xe3, 0x47, 0xd7, 0x75, 0xa4, 0x8f, 0x85, 0x8f, 0xdf, 0xa2, 0xdd, 0x9b, 0x8f, 0xf2, 0xd1, 0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, 0xe6, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/conflict/types/types.go b/x/conflict/types/types.go index f6719d9409..8080a019ff 100644 --- a/x/conflict/types/types.go +++ b/x/conflict/types/types.go @@ -2,7 +2,7 @@ package types import ( tendermintcrypto "github.com/cometbft/cometbft/crypto" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils/sigs" ) const ( diff --git a/x/downtime/client/cli/query.go b/x/downtime/client/cli/query.go index 15f51a2052..5a2bf388a6 100644 --- a/x/downtime/client/cli/query.go +++ b/x/downtime/client/cli/query.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/downtime/types" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" + "github.com/lavanet/lava/v4/x/downtime/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" "github.com/spf13/cobra" ) diff --git a/x/downtime/client/cli/tx.go b/x/downtime/client/cli/tx.go index 2a6f528b56..eb0a3a9d27 100644 --- a/x/downtime/client/cli/tx.go +++ b/x/downtime/client/cli/tx.go @@ -3,7 +3,7 @@ package cli import ( "fmt" - "github.com/lavanet/lava/v3/x/downtime/types" + "github.com/lavanet/lava/v4/x/downtime/types" "github.com/spf13/cobra" ) diff --git a/x/downtime/keeper/keeper.go b/x/downtime/keeper/keeper.go index 0682225953..096953e034 100644 --- a/x/downtime/keeper/keeper.go +++ b/x/downtime/keeper/keeper.go @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" gogowellknown "github.com/gogo/protobuf/types" - "github.com/lavanet/lava/v3/x/downtime/types" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" + "github.com/lavanet/lava/v4/x/downtime/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" ) type EpochStorageKeeper interface { diff --git a/x/downtime/keeper/keeper_test.go b/x/downtime/keeper/keeper_test.go index 90e649c447..c44472e8e0 100644 --- a/x/downtime/keeper/keeper_test.go +++ b/x/downtime/keeper/keeper_test.go @@ -5,9 +5,9 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/app" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/app" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/downtime/keeper/query_server.go b/x/downtime/keeper/query_server.go index e13616ae63..a7d7752082 100644 --- a/x/downtime/keeper/query_server.go +++ b/x/downtime/keeper/query_server.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" ) var _ v1.QueryServer = queryServer{} diff --git a/x/downtime/keeper/query_server_test.go b/x/downtime/keeper/query_server_test.go index 0f307451b9..f137dc2fb0 100644 --- a/x/downtime/keeper/query_server_test.go +++ b/x/downtime/keeper/query_server_test.go @@ -6,10 +6,10 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/app" - "github.com/lavanet/lava/v3/x/downtime/keeper" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/app" + "github.com/lavanet/lava/v4/x/downtime/keeper" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/downtime/module.go b/x/downtime/module.go index 847b258dd4..67657f655b 100644 --- a/x/downtime/module.go +++ b/x/downtime/module.go @@ -11,10 +11,10 @@ import ( 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/v3/x/downtime/client/cli" - "github.com/lavanet/lava/v3/x/downtime/keeper" - "github.com/lavanet/lava/v3/x/downtime/types" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" + "github.com/lavanet/lava/v4/x/downtime/client/cli" + "github.com/lavanet/lava/v4/x/downtime/keeper" + "github.com/lavanet/lava/v4/x/downtime/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" "github.com/spf13/cobra" ) diff --git a/x/downtime/v1/downtime.pb.go b/x/downtime/v1/downtime.pb.go index fcc5cf9ef4..dcda87cc00 100644 --- a/x/downtime/v1/downtime.pb.go +++ b/x/downtime/v1/downtime.pb.go @@ -166,8 +166,8 @@ var fileDescriptor_17cbf2f7c6c4bd94 = []byte{ 0x67, 0x83, 0x5d, 0xc7, 0x12, 0x04, 0xe1, 0x08, 0xd9, 0x73, 0x71, 0x90, 0x63, 0x0f, 0x5c, 0x93, 0x93, 0xd3, 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, 0xa4, 0x67, 0x96, - 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x44, 0x65, 0x99, 0xb1, 0x7e, 0x05, 0x72, - 0x7c, 0x26, 0xb1, 0x81, 0xad, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xce, 0xe5, 0xb7, 0x07, + 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x44, 0x65, 0x99, 0x89, 0x7e, 0x05, 0x72, + 0x7c, 0x26, 0xb1, 0x81, 0xad, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x60, 0x7d, 0x0e, 0x71, 0xf2, 0x01, 0x00, 0x00, } diff --git a/x/downtime/v1/genesis.pb.go b/x/downtime/v1/genesis.pb.go index 58347bc009..169702c4ce 100644 --- a/x/downtime/v1/genesis.pb.go +++ b/x/downtime/v1/genesis.pb.go @@ -118,8 +118,8 @@ var fileDescriptor_6fd11efb3f8802bf = []byte{ 0x48, 0x2f, 0x48, 0xd6, 0xc9, 0xe9, 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, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x42, 0xb9, 0xcc, - 0x58, 0xbf, 0x02, 0x39, 0xa8, 0x93, 0xd8, 0xc0, 0x16, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x78, 0x60, 0x60, 0xda, 0xcf, 0x01, 0x00, 0x00, + 0x44, 0xbf, 0x02, 0x39, 0xa8, 0x93, 0xd8, 0xc0, 0x16, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xd6, 0xf8, 0xd9, 0xac, 0xcf, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/downtime/v1/query.pb.go b/x/downtime/v1/query.pb.go index c79bf4074c..f54cfb7e20 100644 --- a/x/downtime/v1/query.pb.go +++ b/x/downtime/v1/query.pb.go @@ -215,34 +215,34 @@ func init() { } var fileDescriptor_b667ee25520f3a08 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x0b, 0xd3, 0x30, - 0x18, 0x86, 0x9b, 0xa1, 0x43, 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0x86, - 0xf6, 0x6d, 0x6f, 0x68, 0xcf, 0xed, 0x20, 0x14, 0xab, 0xc2, 0xc3, 0x3e, 0x8f, 0x4f, 0x69, 0xe5, - 0x8c, 0xbc, 0x3e, 0x46, 0x7a, 0x5d, 0xf9, 0x52, 0x66, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x41, - 0xba, 0xc6, 0x24, 0x7a, 0x03, 0x00, 0x00, + // 425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0xeb, 0xd3, 0x30, + 0x18, 0xc6, 0x9b, 0xa1, 0x43, 0x32, 0x44, 0x8c, 0x13, 0x66, 0x19, 0x5d, 0x29, 0x82, 0x65, 0x68, + 0xe2, 0xa6, 0x07, 0xcf, 0x65, 0x77, 0x75, 0xde, 0xbc, 0x94, 0xb4, 0x8b, 0x5d, 0xb1, 0x6d, 0xba, + 0x36, 0xad, 0x7a, 0xf1, 0xe0, 0x27, 0x10, 0xf4, 0xe0, 0xd9, 0xaf, 0xe2, 0x65, 0xc7, 0x81, 0x17, + 0x4f, 0x2a, 0x9b, 0x1f, 0x44, 0x9a, 0xa6, 0x73, 0x9b, 0xf4, 0xff, 0xdf, 0x29, 0xe1, 0xc9, 0x93, + 0xdf, 0xfb, 0xbc, 0x7d, 0x53, 0x78, 0x37, 0xa2, 0x25, 0x4d, 0x98, 0x20, 0xd5, 0x4a, 0x16, 0xfc, + 0x4d, 0x22, 0xc2, 0x98, 0x91, 0x72, 0x42, 0x56, 0x05, 0xcb, 0xde, 0xe1, 0x34, 0xe3, 0x82, 0xa3, + 0x81, 0x72, 0xe1, 0x6a, 0xc5, 0x8d, 0x0b, 0x97, 0x13, 0xdd, 0x08, 0x38, 0x0f, 0x22, 0x46, 0xa4, + 0xcf, 0x2b, 0x5e, 0x91, 0x45, 0x91, 0x51, 0x11, 0xf2, 0xa4, 0xbe, 0xa9, 0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67, 0xba, 0xeb, 0xc0, 0x96, 0xfd, 0xe1, 0xfb, 0x9f, 0x4f, 0x1d, 0x0b, 0x99, 0xa4, 0xf5, + 0x1d, 0xd4, 0x01, 0xd1, 0x57, 0x00, 0xaf, 0x1f, 0x0d, 0x02, 0xe1, 0x4b, 0x4a, 0x9d, 0x4c, 0x5d, + 0x27, 0x67, 0xfb, 0x55, 0xb8, 0x87, 0x32, 0xdc, 0x18, 0xd9, 0xe4, 0xe2, 0x9f, 0x60, 0x3f, 0x7c, + 0xc7, 0x59, 0x6f, 0x0d, 0xb0, 0xd9, 0x1a, 0xe0, 0xf7, 0xd6, 0x00, 0x1f, 0x77, 0x86, 0xb6, 0xd9, + 0x19, 0xda, 0x8f, 0x9d, 0xa1, 0xbd, 0xb4, 0x83, 0x50, 0x2c, 0x0b, 0x0f, 0xfb, 0x3c, 0x3e, 0xa6, + 0x95, 0x8f, 0xc9, 0xdb, 0x43, 0xa4, 0xd7, 0x95, 0x2f, 0xe5, 0xd1, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xef, 0x22, 0x7f, 0x52, 0x7a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dualstaking/README.md b/x/dualstaking/README.md index 61b0cac937..682b40cc81 100644 --- a/x/dualstaking/README.md +++ b/x/dualstaking/README.md @@ -34,7 +34,7 @@ Dualstaking makes this happen by "duplicating" delegations, for each validator d ### Delegation Dualstaking introduces provider delegations to the Lava network. Provider delegations allow users to delegate their tokens to a specific provider, similar to validators, in order to contribute to their success and claim a portion of the rewards awarded to the provider. -When a provider stakes tokens, they create a self-delegation entry. Whenever a provider receives rewards, all delegators are eligible for a portion of the rewards based on their delegation amount and the commission rate set by the provider. +When a provider stakes tokens, they create a self-delegation entry. Whenever a provider receives rewards, all delegators are eligible for a portion of the rewards based on their delegation amount and the commission rate set by the provider. The delegations for a provider is split between the chains of the provider, distributed according the the providers stakes. ### Empty Provider @@ -123,9 +123,9 @@ The Dualstaking module supports the following transactions: | Transaction | Arguments | What it does | | ---------- | --------------- | ----------------------------------------------| -| `delegate` | validator-addr(string) provider-addr (string) chain-id (string) amount (coin)| delegate to validator and provider the given amount| -| `redelegate` | src-provider-addr (string) src-chain-id (string) dst-provider-addr (string) dst-chain-id (string) amount (coin)| redelegate provider delegation from source provider to destination provider| -| `unbond` | validator-addr (string) provider-addr (string) chain-id (string) amount (coin) | undong from validator and provider the given amount | +| `delegate` | validator-addr(string) provider-addr (string) amount (coin)| delegate to validator and provider the given amount| +| `redelegate` | src-provider-addr (string) dst-provider-addr (string) amount (coin)| redelegate provider delegation from source provider to destination provider| +| `unbond` | validator-addr (string) provider-addr (string) amount (coin) | undong from validator and provider the given amount | | `claim-rewards` | optional: provider-addr (string)| claim the rewards from a given provider or all rewards | diff --git a/x/dualstaking/ante/disable_redelegation_hooks.go b/x/dualstaking/ante/disable_redelegation_hooks.go index b1e51d1cab..a2be62c0fa 100644 --- a/x/dualstaking/ante/disable_redelegation_hooks.go +++ b/x/dualstaking/ante/disable_redelegation_hooks.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" ) // RedelegationFlager sets the dualstaking redelegation flag when needed. diff --git a/x/dualstaking/ante/disable_redelegation_hooks_test.go b/x/dualstaking/ante/disable_redelegation_hooks_test.go index b13da36bf2..dee3f2f0f2 100644 --- a/x/dualstaking/ante/disable_redelegation_hooks_test.go +++ b/x/dualstaking/ante/disable_redelegation_hooks_test.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/testutil/common" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/dualstaking/ante" + "github.com/lavanet/lava/v4/testutil/common" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/dualstaking/ante" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/client/cli/query.go b/x/dualstaking/client/cli/query.go index c6db834104..78ff0ee07f 100644 --- a/x/dualstaking/client/cli/query.go +++ b/x/dualstaking/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/dualstaking/client/cli/query_delegator_providers.go b/x/dualstaking/client/cli/query_delegator_providers.go index 07a1e57411..5ed187d113 100644 --- a/x/dualstaking/client/cli/query_delegator_providers.go +++ b/x/dualstaking/client/cli/query_delegator_providers.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) const WithPendingDelegatorsFlagName = "with-pending" diff --git a/x/dualstaking/client/cli/query_delegator_rewards.go b/x/dualstaking/client/cli/query_delegator_rewards.go index 333418596b..8a02b46528 100644 --- a/x/dualstaking/client/cli/query_delegator_rewards.go +++ b/x/dualstaking/client/cli/query_delegator_rewards.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) const ( diff --git a/x/dualstaking/client/cli/query_params.go b/x/dualstaking/client/cli/query_params.go index 20adbfa204..8557d60189 100644 --- a/x/dualstaking/client/cli/query_params.go +++ b/x/dualstaking/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/dualstaking/client/cli/query_provider_delegators.go b/x/dualstaking/client/cli/query_provider_delegators.go index 84947c84df..adab61c917 100644 --- a/x/dualstaking/client/cli/query_provider_delegators.go +++ b/x/dualstaking/client/cli/query_provider_delegators.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func CmdQueryProviderDelegators() *cobra.Command { diff --git a/x/dualstaking/client/cli/tx.go b/x/dualstaking/client/cli/tx.go index 1caeff6fa5..88df5847ba 100644 --- a/x/dualstaking/client/cli/tx.go +++ b/x/dualstaking/client/cli/tx.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/dualstaking/client/cli/tx_claim_rewards.go b/x/dualstaking/client/cli/tx_claim_rewards.go index da40ad0b0a..f18c9e36a8 100644 --- a/x/dualstaking/client/cli/tx_claim_rewards.go +++ b/x/dualstaking/client/cli/tx_claim_rewards.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/client/cli/tx_delegate.go b/x/dualstaking/client/cli/tx_delegate.go index fd57bd95d2..945a24fbeb 100644 --- a/x/dualstaking/client/cli/tx_delegate.go +++ b/x/dualstaking/client/cli/tx_delegate.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/client/cli/tx_redelegate.go b/x/dualstaking/client/cli/tx_redelegate.go index 109e48030d..458a0d1002 100644 --- a/x/dualstaking/client/cli/tx_redelegate.go +++ b/x/dualstaking/client/cli/tx_redelegate.go @@ -7,8 +7,8 @@ import ( "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/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/client/cli/tx_unbond.go b/x/dualstaking/client/cli/tx_unbond.go index 49c9fe6e55..c4d92e9bb9 100644 --- a/x/dualstaking/client/cli/tx_unbond.go +++ b/x/dualstaking/client/cli/tx_unbond.go @@ -7,8 +7,8 @@ import ( "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/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/genesis.go b/x/dualstaking/genesis.go index 5b6fecf674..3717518a73 100644 --- a/x/dualstaking/genesis.go +++ b/x/dualstaking/genesis.go @@ -2,8 +2,8 @@ package dualstaking import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // InitGenesis initializes the module's state from a provided genesis state. @@ -11,8 +11,12 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) - k.InitDelegations(ctx, genState.DelegationsFS) - k.InitDelegators(ctx, genState.DelegatorsFS) + for _, d := range genState.Delegations { + err := k.SetDelegation(ctx, d) + if err != nil { + panic(err) + } + } // Set all the DelegatorReward for _, elem := range genState.DelegatorRewardList { @@ -25,8 +29,12 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - genesis.DelegationsFS = k.ExportDelegations(ctx) - genesis.DelegatorsFS = k.ExportDelegators(ctx) + var err error + genesis.Delegations, err = k.GetAllDelegations(ctx) + if err != nil { + panic(err) + } + genesis.DelegatorRewardList = k.GetAllDelegatorReward(ctx) // this line is used by starport scaffolding # genesis/module/export diff --git a/x/dualstaking/genesis_test.go b/x/dualstaking/genesis_test.go index 33087b7290..a1c50f5212 100644 --- a/x/dualstaking/genesis_test.go +++ b/x/dualstaking/genesis_test.go @@ -3,10 +3,10 @@ package dualstaking_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/dualstaking" - "github.com/lavanet/lava/v3/x/dualstaking/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/dualstaking" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/handler.go b/x/dualstaking/handler.go index 3e0e9cc374..0146f5a5b6 100644 --- a/x/dualstaking/handler.go +++ b/x/dualstaking/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // NewHandler ... diff --git a/x/dualstaking/keeper/balance.go b/x/dualstaking/keeper/balance.go index 92292835ab..236a61978e 100644 --- a/x/dualstaking/keeper/balance.go +++ b/x/dualstaking/keeper/balance.go @@ -2,8 +2,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) func (k Keeper) BalanceDelegator(ctx sdk.Context, delegator sdk.AccAddress) (int, error) { @@ -17,8 +17,8 @@ func (k Keeper) BalanceDelegator(ctx sdk.Context, delegator sdk.AccAddress) (int 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, commontypes.EMPTY_PROVIDER_CHAINID, - sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), diff)) + err = k.Delegate(ctx, delegator.String(), commontypes.EMPTY_PROVIDER, + sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), diff), false) if err != nil { return providers, err } diff --git a/x/dualstaking/keeper/delegate.go b/x/dualstaking/keeper/delegate.go index 6e164e8c44..dfa1057876 100644 --- a/x/dualstaking/keeper/delegate.go +++ b/x/dualstaking/keeper/delegate.go @@ -18,64 +18,38 @@ package keeper // tracking the list of providers for a delegator, indexed by the delegator. import ( - "fmt" - + "cosmossdk.io/collections" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - lavaslices "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + lavaslices "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "golang.org/x/exp/slices" ) // increaseDelegation increases the delegation of a delegator to a provider for a // 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, chainID string, amount sdk.Coin, nextEpoch uint64) error { - // get, update and append the delegation entry - var delegationEntry types.Delegation - index := types.DelegationKey(provider, delegator, chainID) - found := k.delegationFS.FindEntry(ctx, index, nextEpoch, &delegationEntry) - if !found { +func (k Keeper) increaseDelegation(ctx sdk.Context, delegator, provider string, amount sdk.Coin, stake bool) error { + // 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) - delegationEntry = types.NewDelegation(delegator, provider, chainID, ctx.BlockTime(), k.stakingKeeper.BondDenom(ctx)) + delegation = types.NewDelegation(delegator, provider, ctx.BlockTime(), k.stakingKeeper.BondDenom(ctx)) } - delegationEntry.AddAmount(amount) + delegation.AddAmount(amount) - err := k.delegationFS.AppendEntry(ctx, index, nextEpoch, &delegationEntry) + err = k.delegations.Set(ctx, types.DelegationKey(provider, delegator), delegation) if err != nil { - // append should never fail here - return utils.LavaFormatError("critical: append delegation entry", err, - utils.Attribute{Key: "delegator", Value: delegationEntry.Delegator}, - utils.Attribute{Key: "provider", Value: delegationEntry.Provider}, - utils.Attribute{Key: "chainID", Value: delegationEntry.ChainID}, - ) - } - - // get, update and append the delegator entry - var delegatorEntry types.Delegator - index = types.DelegatorKey(delegator) - _ = k.delegatorFS.FindEntry(ctx, index, nextEpoch, &delegatorEntry) - - contains := delegatorEntry.AddProvider(provider) - if !contains { - err = k.delegatorFS.AppendEntry(ctx, index, nextEpoch, &delegatorEntry) - if err != nil { - // append should never fail here - return utils.LavaFormatError("critical: append delegator entry", err, - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } + return err } if provider != commontypes.EMPTY_PROVIDER { // update the stake entry - return k.modifyStakeEntryDelegation(ctx, delegator, provider, chainID, amount, true) + return k.AfterDelegationModified(ctx, delegator, provider, amount, true, stake) } return nil @@ -84,160 +58,125 @@ func (k Keeper) increaseDelegation(ctx sdk.Context, delegator, provider, chainID // decreaseDelegation decreases the delegation of a delegator to a provider for a // given chain. It updates the fixation stores for both delegations and delegators, // and updates the (epochstorage) stake-entry. -func (k Keeper) decreaseDelegation(ctx sdk.Context, delegator, provider, chainID string, amount sdk.Coin, nextEpoch uint64) error { +func (k Keeper) decreaseDelegation(ctx sdk.Context, delegator, provider string, amount sdk.Coin, stake bool) error { // get, update and append the delegation entry - var delegationEntry types.Delegation - index := types.DelegationKey(provider, delegator, chainID) - found := k.delegationFS.FindEntry(ctx, index, nextEpoch, &delegationEntry) + delegation, found := k.GetDelegation(ctx, provider, delegator) if !found { return types.ErrDelegationNotFound } - if delegationEntry.Amount.IsLT(amount) { + if delegation.Amount.IsLT(amount) { return types.ErrInsufficientDelegation } - delegationEntry.SubAmount(amount) + delegation.SubAmount(amount) - // if delegation now becomes zero, then remove this entry altogether; - // otherwise just append the new version (for next epoch). - if delegationEntry.Amount.IsZero() { - err := k.delegationFS.DelEntry(ctx, index, nextEpoch) + if delegation.Amount.IsZero() { + err := k.RemoveDelegation(ctx, delegation) if err != nil { - // delete should never fail here - return utils.LavaFormatError("critical: delete delegation entry", err, - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) + return err } } else { - err := k.delegationFS.AppendEntry(ctx, index, nextEpoch, &delegationEntry) + err := k.SetDelegation(ctx, delegation) if err != nil { - // append should never fail here - return utils.LavaFormatError("failed to update delegation entry", err, - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } - } - - // get, update and append the delegator entry - var delegatorEntry types.Delegator - index = types.DelegatorKey(delegator) - found = k.delegatorFS.FindEntry(ctx, index, nextEpoch, &delegatorEntry) - if !found { - // we found the delegation above, so the delegator must exist as well - return utils.LavaFormatError("critical: delegator entry for delegation not found", - types.ErrDelegationNotFound, - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } - - // if delegation now becomes zero, then remove this provider from the delegator - // entry; and if the delegator entry becomes entry then remove it altogether. - // otherwise just append the new version (for next epoch). - if delegationEntry.Amount.IsZero() { - if len(k.GetAllProviderDelegatorDelegations(ctx, delegator, provider, nextEpoch)) == 0 { - delegatorEntry.DelProvider(provider) - if delegatorEntry.IsEmpty() { - err := k.delegatorFS.DelEntry(ctx, index, nextEpoch) - if err != nil { - // delete should never fail here - return utils.LavaFormatError("critical: delete delegator entry", err, - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } - } else { - err := k.delegatorFS.AppendEntry(ctx, index, nextEpoch, &delegatorEntry) - if err != nil { - // append should never fail here - return utils.LavaFormatError("failed to update delegator entry", err, - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } - } + return err } } if provider != commontypes.EMPTY_PROVIDER { - return k.modifyStakeEntryDelegation(ctx, delegator, provider, chainID, amount, false) + return k.AfterDelegationModified(ctx, delegator, provider, amount, false, stake) } return nil } -// modifyStakeEntryDelegation modifies the (epochstorage) stake-entry of the provider for a chain based on the action (increase or decrease). -func (k Keeper) modifyStakeEntryDelegation(ctx sdk.Context, delegator, provider, chainID string, amount sdk.Coin, increase bool) (err error) { - stakeEntry, exists := k.epochstorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) - if !exists || provider != stakeEntry.Address { +// 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) { + // get all entries + metadata, err := k.epochstorageKeeper.GetMetadata(ctx, provider) + if err != nil { if increase { - return epochstoragetypes.ErrProviderNotStaked + return err + } else { + // we want to allow decreasing if the provider does not exist + return nil } - // For decrease, if the provider doesn't exist, return without error - return nil } - if delegator == stakeEntry.Vault { - if increase { - stakeEntry.Stake = stakeEntry.Stake.Add(amount) - } else { - stakeEntry.Stake, err = stakeEntry.Stake.SafeSub(amount) - if err != nil { - return fmt.Errorf("invalid or insufficient funds: %w", err) - } + // get all entries + TotalSelfDelegation := sdk.ZeroInt() + entries := []*epochstoragetypes.StakeEntry{} + for _, chain := range metadata.Chains { + entry, found := k.epochstorageKeeper.GetStakeEntryCurrent(ctx, chain, provider) + if !found { + panic("AfterDelegationModified: entry not found") } - } else { - if increase { - stakeEntry.DelegateTotal = stakeEntry.DelegateTotal.Add(amount) - } else { - stakeEntry.DelegateTotal, err = stakeEntry.DelegateTotal.SafeSub(amount) - if err != nil { - return fmt.Errorf("invalid or insufficient funds: %w", err) + + entries = append(entries, &entry) + TotalSelfDelegation = TotalSelfDelegation.Add(entry.Stake.Amount) + } + + // regular delegation + if !amount.IsZero() { + if delegator != metadata.Vault { + if increase { + metadata.TotalDelegations = metadata.TotalDelegations.Add(amount) + } else { + metadata.TotalDelegations, err = metadata.TotalDelegations.SafeSub(amount) + if err != nil { + return err + } + } + } else if !stake { + // distribute self delegations if done through the dualstaking tx + total := amount.Amount + count := int64(len(entries)) + for _, entry := range entries { + part := total.QuoRaw(count) + if increase { + entry.Stake = entry.Stake.AddAmount(part) + TotalSelfDelegation = TotalSelfDelegation.Add(part) + } else { + entry.Stake.Amount, err = entry.Stake.Amount.SafeSub(part) + if err != nil { + return err + } + TotalSelfDelegation = TotalSelfDelegation.Sub(part) + if entry.Stake.IsLT(k.GetParams(ctx).MinSelfDelegation) { + return utils.LavaFormatError("self delegation below minimum, use unstake tx", nil, utils.LogAttr("chainID", entry.Chain)) + } + } + total = total.Sub(part) + count-- } } + k.epochstorageKeeper.SetMetadata(ctx, metadata) } details := map[string]string{ - "provider_vault": stakeEntry.Vault, - "provider_provider": stakeEntry.Address, - "chain_id": stakeEntry.Chain, - "moniker": stakeEntry.Description.Moniker, - "description": stakeEntry.Description.String(), - "stake": stakeEntry.Stake.String(), - "effective_stake": stakeEntry.TotalStake().String() + stakeEntry.Stake.Denom, - } - - if stakeEntry.Stake.IsLT(k.GetParams(ctx).MinSelfDelegation) { - k.epochstorageKeeper.RemoveStakeEntryCurrent(ctx, chainID, stakeEntry.Address) - details["min_self_delegation"] = k.GetParams(ctx).MinSelfDelegation.String() - utils.LogLavaEvent(ctx, k.Logger(ctx), types.UnstakeFromUnbond, details, "unstaking provider due to unbond that lowered its stake below min self delegation") - return nil - } else if stakeEntry.TotalStake().LT(k.specKeeper.GetMinStake(ctx, chainID).Amount) { - details["min_spec_stake"] = k.specKeeper.GetMinStake(ctx, chainID).String() - utils.LogLavaEvent(ctx, k.Logger(ctx), types.FreezeFromUnbond, details, "freezing provider due to stake below min spec stake") - stakeEntry.Freeze() - } else if delegator == stakeEntry.Vault && stakeEntry.IsFrozen() && !stakeEntry.IsJailed(ctx.BlockTime().UTC().Unix()) { - stakeEntry.UnFreeze(k.epochstorageKeeper.GetCurrentNextEpoch(ctx) + 1) - } - - k.epochstorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) + "provider": provider, + } + + 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)) + 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() + utils.LogLavaEvent(ctx, k.Logger(ctx), types.FreezeFromUnbond, details, "freezing provider due to stake below min spec stake") + entry.Freeze() + } else if delegator == entry.Vault && entry.IsFrozen() && !entry.IsJailed(ctx.BlockTime().UTC().Unix()) { + entry.UnFreeze(k.epochstorageKeeper.GetCurrentNextEpoch(ctx) + 1) + } + k.epochstorageKeeper.SetStakeEntryCurrent(ctx, *entry) + } return nil } -// delegate lets a delegator delegate an amount of coins to a provider. -// (effective on next epoch) -func (k Keeper) delegate(ctx sdk.Context, delegator, provider, chainID string, amount sdk.Coin) error { - nextEpoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - +// Delegate lets a delegator Delegate an amount of coins to a provider. +func (k Keeper) Delegate(ctx sdk.Context, delegator, provider string, amount sdk.Coin, stake bool) error { _, err := sdk.AccAddressFromBech32(delegator) if err != nil { return utils.LavaFormatWarning("invalid delegator address", err, @@ -257,17 +196,15 @@ func (k Keeper) delegate(ctx sdk.Context, delegator, provider, chainID string, a return utils.LavaFormatWarning("failed to delegate: coin validation failed", err, utils.Attribute{Key: "delegator", Value: delegator}, utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, ) } - err = k.increaseDelegation(ctx, delegator, provider, chainID, amount, nextEpoch) + err = k.increaseDelegation(ctx, delegator, provider, amount, stake) if err != nil { return utils.LavaFormatWarning("failed to increase delegation", err, utils.Attribute{Key: "delegator", Value: delegator}, utils.Attribute{Key: "provider", Value: provider}, utils.Attribute{Key: "amount", Value: amount.String()}, - utils.Attribute{Key: "chainID", Value: chainID}, ) } @@ -277,19 +214,7 @@ func (k Keeper) delegate(ctx sdk.Context, delegator, provider, chainID string, a // Redelegate lets a delegator transfer its delegation between providers, but // without the funds being subject to unstakeHoldBlocks witholding period. // (effective on next epoch) -func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, toChainID string, amount sdk.Coin) error { - _, foundFrom := k.specKeeper.GetSpec(ctx, fromChainID) - _, foundTo := k.specKeeper.GetSpec(ctx, toChainID) - if (!foundFrom && fromChainID != commontypes.EMPTY_PROVIDER_CHAINID) || - (!foundTo && toChainID != commontypes.EMPTY_PROVIDER_CHAINID) { - return utils.LavaFormatWarning("cannot redelegate with invalid chain IDs", fmt.Errorf("chain ID not found"), - utils.LogAttr("from_chain_id", fromChainID), - utils.LogAttr("to_chain_id", toChainID), - ) - } - - nextEpoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - +func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to string, amount sdk.Coin, stake bool) error { if _, err := sdk.AccAddressFromBech32(delegator); err != nil { return utils.LavaFormatWarning("invalid delegator address", err, utils.Attribute{Key: "delegator", Value: delegator}, @@ -319,7 +244,7 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, to ) } - err := k.increaseDelegation(ctx, delegator, to, toChainID, amount, nextEpoch) + 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}, @@ -328,7 +253,7 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, to ) } - err = k.decreaseDelegation(ctx, delegator, from, fromChainID, amount, nextEpoch) + err = k.decreaseDelegation(ctx, delegator, from, amount, stake) if err != nil { return utils.LavaFormatWarning("failed to decrease delegation", err, utils.Attribute{Key: "delegator", Value: delegator}, @@ -348,15 +273,7 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, to // before released and transferred back to the delegator. The rewards from the // provider will be updated accordingly (or terminate) from the next epoch. // (effective on next epoch) -func (k Keeper) unbond(ctx sdk.Context, delegator, provider, chainID string, amount sdk.Coin) error { - _, found := k.specKeeper.GetSpec(ctx, chainID) - if chainID != commontypes.EMPTY_PROVIDER_CHAINID && !found { - return utils.LavaFormatWarning("cannot unbond with invalid chain ID", fmt.Errorf("chain ID not found"), - utils.LogAttr("chain_id", chainID)) - } - - nextEpoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - +func (k Keeper) unbond(ctx sdk.Context, delegator, provider string, amount sdk.Coin, stake bool) error { if _, err := sdk.AccAddressFromBech32(delegator); err != nil { return utils.LavaFormatWarning("invalid delegator address", err, utils.Attribute{Key: "delegator", Value: delegator}, @@ -378,7 +295,7 @@ func (k Keeper) unbond(ctx sdk.Context, delegator, provider, chainID string, amo ) } - err := k.decreaseDelegation(ctx, delegator, provider, chainID, amount, nextEpoch) + 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}, @@ -391,7 +308,7 @@ func (k Keeper) unbond(ctx sdk.Context, delegator, provider, chainID string, amo } // GetDelegatorProviders gets all the providers the delegator is delegated to -func (k Keeper) GetDelegatorProviders(ctx sdk.Context, delegator string, epoch uint64) (providers []string, err error) { +func (k Keeper) GetDelegatorProviders(ctx sdk.Context, delegator string) (providers []string, err error) { _, err = sdk.AccAddressFromBech32(delegator) if err != nil { return nil, utils.LavaFormatWarning("cannot get delegator's providers", err, @@ -399,14 +316,23 @@ func (k Keeper) GetDelegatorProviders(ctx sdk.Context, delegator string, epoch u ) } - var delegatorEntry types.Delegator - prefix := types.DelegatorKey(delegator) - k.delegatorFS.FindEntry(ctx, prefix, epoch, &delegatorEntry) + iter, err := k.delegations.Indexes.ReverseIndex.MatchExact(ctx, delegator) + if err != nil { + return nil, err + } + + for ; iter.Valid(); iter.Next() { + key, err := iter.PrimaryKey() + if err != nil { + return nil, err + } + providers = append(providers, key.K1()) + } - return delegatorEntry.Providers, nil + return providers, nil } -func (k Keeper) GetProviderDelegators(ctx sdk.Context, provider string, epoch uint64) ([]types.Delegation, error) { +func (k Keeper) GetProviderDelegators(ctx sdk.Context, provider string) ([]types.Delegation, error) { if provider != commontypes.EMPTY_PROVIDER { _, err := sdk.AccAddressFromBech32(provider) if err != nil { @@ -416,76 +342,52 @@ func (k Keeper) GetProviderDelegators(ctx sdk.Context, provider string, epoch ui } } - var delegations []types.Delegation - indices := k.delegationFS.GetAllEntryIndicesWithPrefix(ctx, provider) - for _, ind := range indices { - var delegation types.Delegation - found := k.delegationFS.FindEntry(ctx, ind, epoch, &delegation) - if !found { - provider, delegator, chainID := types.DelegationKeyDecode(ind) - utils.LavaFormatError("delegationFS entry index has no entry", fmt.Errorf("provider delegation not found"), - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - continue - } - delegations = append(delegations, delegation) + iter, err := k.delegations.Iterate(ctx, collections.NewPrefixedPairRange[string, string](provider)) + if err != nil { + return nil, err } - return delegations, nil + return iter.Values() } -func (k Keeper) GetDelegation(ctx sdk.Context, delegator, provider, chainID string, epoch uint64) (types.Delegation, bool) { - var delegationEntry types.Delegation - index := types.DelegationKey(provider, delegator, chainID) - found := k.delegationFS.FindEntry(ctx, index, epoch, &delegationEntry) - - return delegationEntry, found +func (k Keeper) GetDelegation(ctx sdk.Context, provider, delegator string) (types.Delegation, bool) { + delegation, err := k.delegations.Get(ctx, types.DelegationKey(provider, delegator)) + return delegation, err == nil } -func (k Keeper) GetAllProviderDelegatorDelegations(ctx sdk.Context, delegator, provider string, epoch uint64) []types.Delegation { - prefix := types.DelegationKey(provider, delegator, "") - indices := k.delegationFS.GetAllEntryIndicesWithPrefix(ctx, prefix) - - var delegations []types.Delegation - for _, ind := range indices { - var delegation types.Delegation - _, deleted, _, found := k.delegationFS.FindEntryDetailed(ctx, ind, epoch, &delegation) - if !found { - if !deleted { - provider, delegator, chainID := types.DelegationKeyDecode(ind) - utils.LavaFormatError("delegationFS entry index has no entry", fmt.Errorf("provider delegation not found"), - utils.Attribute{Key: "delegator", Value: delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } - continue - } - delegations = append(delegations, delegation) +func (k Keeper) GetAllDelegations(ctx sdk.Context) ([]types.Delegation, error) { + iter, err := k.delegations.Iterate(ctx, nil) + if err != nil { + return nil, err } - return delegations + return iter.Values() +} + +func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation) error { + return k.delegations.Set(ctx, types.DelegationKey(delegation.Provider, delegation.Delegator), delegation) +} + +func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation) error { + return k.delegations.Remove(ctx, types.DelegationKey(delegation.Provider, delegation.Delegator)) } func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount sdk.Coin) error { - epoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - providers, err := k.GetDelegatorProviders(ctx, delegator, epoch) + providers, err := k.GetDelegatorProviders(ctx, delegator) if err != nil { return err } // first remove from the empty provider if lavaslices.Contains[string](providers, commontypes.EMPTY_PROVIDER) { - delegation, found := k.GetDelegation(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, epoch) + delegation, found := k.GetDelegation(ctx, commontypes.EMPTY_PROVIDER, delegator) if found { if delegation.Amount.Amount.GTE(amount.Amount) { // we have enough here, remove all from empty delegator and bail - return k.unbond(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, amount) + return k.unbond(ctx, delegator, commontypes.EMPTY_PROVIDER, amount, false) } else { // we dont have enough in the empty provider, remove everything and continue with the rest - err = k.unbond(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, delegation.Amount) + err = k.unbond(ctx, delegator, commontypes.EMPTY_PROVIDER, delegation.Amount, false) if err != nil { return err } @@ -498,30 +400,27 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount var delegations []types.Delegation for _, provider := range providers { - delegations = append(delegations, k.GetAllProviderDelegatorDelegations(ctx, delegator, provider, epoch)...) + delegation, found := k.GetDelegation(ctx, provider, delegator) + if found { + delegations = append(delegations, delegation) + } } slices.SortFunc(delegations, func(i, j types.Delegation) bool { return i.Amount.IsLT(j.Amount) }) - type delegationKey struct { - provider string - chainID string - } - unbondAmount := map[delegationKey]sdk.Coin{} - + unbondAmount := map[string]sdk.Coin{} // first round of deduction for i := range delegations { - key := delegationKey{provider: delegations[i].Provider, chainID: delegations[i].ChainID} amountToDeduct := amount.Amount.QuoRaw(int64(len(delegations) - i)) if delegations[i].Amount.Amount.LT(amountToDeduct) { - unbondAmount[key] = delegations[i].Amount + unbondAmount[delegations[i].Provider] = delegations[i].Amount amount = amount.Sub(delegations[i].Amount) delegations[i].Amount.Amount = sdk.ZeroInt() } else { coinToDeduct := sdk.NewCoin(delegations[i].Amount.Denom, amountToDeduct) - unbondAmount[key] = coinToDeduct + unbondAmount[delegations[i].Provider] = coinToDeduct amount = amount.Sub(coinToDeduct) delegations[i].Amount = delegations[i].Amount.Sub(coinToDeduct) } @@ -532,7 +431,7 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount if amount.IsZero() { break } - key := delegationKey{provider: delegations[i].Provider, chainID: delegations[i].ChainID} + key := delegations[i].Provider if delegations[i].Amount.Amount.LT(amount.Amount) { unbondAmount[key].Add(delegations[i].Amount) amount = amount.Sub(delegations[i].Amount) @@ -544,8 +443,8 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount // now unbond all for i := range delegations { - key := delegationKey{provider: delegations[i].Provider, chainID: delegations[i].ChainID} - err := k.unbond(ctx, delegator, delegations[i].Provider, delegations[i].ChainID, unbondAmount[key]) + key := delegations[i].Provider + err := k.unbond(ctx, delegator, delegations[i].Provider, unbondAmount[key], false) if err != nil { return err } @@ -556,16 +455,15 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount // returns the difference between validators delegations and provider delegation (validators-providers) func (k Keeper) VerifyDelegatorBalance(ctx sdk.Context, delAddr sdk.AccAddress) (math.Int, int, error) { - nextEpoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - providers, err := k.GetDelegatorProviders(ctx, delAddr.String(), nextEpoch) + providers, err := k.GetDelegatorProviders(ctx, delAddr.String()) if err != nil { return math.ZeroInt(), 0, err } sumProviderDelegations := sdk.ZeroInt() for _, p := range providers { - delegations := k.GetAllProviderDelegatorDelegations(ctx, delAddr.String(), p, nextEpoch) - for _, d := range delegations { + d, found := k.GetDelegation(ctx, p, delAddr.String()) + if found { sumProviderDelegations = sumProviderDelegations.Add(d.Amount.Amount) } } diff --git a/x/dualstaking/keeper/delegate_test.go b/x/dualstaking/keeper/delegate_test.go index 2ef090c060..eed57be7d6 100644 --- a/x/dualstaking/keeper/delegate_test.go +++ b/x/dualstaking/keeper/delegate_test.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/testutil/common" + commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/stretchr/testify/require" ) @@ -44,13 +44,6 @@ func TestDelegateFail(t *testing.T) { chainID: "mockspec", amount: 1, }, - { - name: "bad chainID", - delegator: client1Addr, - provider: provider1Addr, - chainID: "invalid", - amount: 1, - }, { name: "bad amount", delegator: client1Addr, @@ -78,7 +71,7 @@ func TestDelegateFail(t *testing.T) { t.Run(tt.name, func(t *testing.T) { amount := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) amount.Amount = amount.Amount.Add(sdk.NewInt(tt.amount)) - _, err := ts.TxDualstakingDelegate(tt.delegator, tt.provider, tt.chainID, amount) + _, err := ts.TxDualstakingDelegate(tt.delegator, tt.provider, amount) require.Error(t, err, tt.name) }) } @@ -97,7 +90,7 @@ func TestDelegate(t *testing.T) { // delegate once amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) - _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) // not yet in effect @@ -111,10 +104,10 @@ func TestDelegate(t *testing.T) { require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) // delegate twice same block (fail) - _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) - _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) @@ -143,7 +136,7 @@ func TestRedelegateFail(t *testing.T) { // delegate once for setup amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) - _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) template := []struct { @@ -178,14 +171,6 @@ func TestRedelegateFail(t *testing.T) { chainID: "mockspec", amount: 1, }, - { - name: "bad chainID", - delegator: client1Addr, - provider1: provider1Addr, - provider2: provider2Addr, - chainID: "invalid", - amount: 1, - }, { name: "bad amount", delegator: client1Addr, @@ -225,7 +210,7 @@ func TestRedelegateFail(t *testing.T) { amount := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) amount.Amount = amount.Amount.Add(sdk.NewInt(tt.amount)) _, err := ts.TxDualstakingRedelegate( - tt.delegator, tt.provider1, tt.provider2, tt.chainID, tt.chainID, amount) + tt.delegator, tt.provider1, tt.provider2, amount) require.Error(t, err, tt.name) }) } @@ -247,7 +232,7 @@ func TestRedelegate(t *testing.T) { // delegate once amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) _, err := ts.TxDualstakingDelegate( - client1Addr, provider1Addr, ts.spec.Name, amount) + client1Addr, provider1Addr, amount) require.NoError(t, err) // advance epoch to digest the delegate @@ -262,7 +247,7 @@ func TestRedelegate(t *testing.T) { // redelegate once amount = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(5000)) _, err = ts.TxDualstakingRedelegate( - client1Addr, provider1Addr, provider2Addr, ts.spec.Name, ts.spec.Name, amount) + client1Addr, provider1Addr, provider2Addr, amount) require.NoError(t, err) stakeEntry1 = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) stakeEntry2 = ts.getStakeEntry(provider2Acct.Addr.String(), ts.spec.Name) @@ -283,8 +268,7 @@ func TestRedelegate(t *testing.T) { // redelegate from unstaking provider amount = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(5000)) - _, err = ts.TxDualstakingRedelegate( - client1Addr, provider1Addr, provider2Addr, ts.spec.Name, ts.spec.Name, amount) + _, err = ts.TxDualstakingRedelegate(client1Addr, provider1Addr, provider2Addr, amount) require.NoError(t, err) // advance epoch to digest the delegate ts.AdvanceEpoch() @@ -308,7 +292,7 @@ func TestUnbondFail(t *testing.T) { // delegate once for setup amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) - _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) template := []struct { @@ -332,13 +316,6 @@ func TestUnbondFail(t *testing.T) { chainID: "mockspec", amount: 1, }, - { - name: "bad chainID", - delegator: client1Addr, - provider: provider1Addr, - chainID: "invalid", - amount: 1, - }, { name: "bad amount", delegator: client1Addr, @@ -366,7 +343,7 @@ func TestUnbondFail(t *testing.T) { t.Run(tt.name, func(t *testing.T) { amount := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) amount.Amount = amount.Amount.Add(sdk.NewInt(tt.amount)) - _, err := ts.TxDualstakingUnbond(tt.delegator, tt.provider, tt.chainID, amount) + _, err := ts.TxDualstakingUnbond(tt.delegator, tt.provider, amount) require.Error(t, err, tt.name) }) } @@ -392,69 +369,68 @@ func TestUnbond(t *testing.T) { // delegate once amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) - _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) - _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, spec2.Index, amount) + _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) // advance epoch to digest the delegate ts.AdvanceEpoch() // now in effect - delegated = delegated.Add(amount) + delegated = delegated.Add(amount).Add(amount) stakeEntry := ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) + require.True(t, delegated.Amount.QuoRaw(2).Equal(stakeEntry.DelegateTotal.Amount)) - res, err := ts.QueryDualstakingDelegatorProviders(client1Addr, true) + res, err := ts.QueryDualstakingDelegatorProviders(client1Addr) require.NoError(t, err) - require.Len(t, res.Delegations, 2) + require.Len(t, res.Delegations, 1) // unbond once amount = sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(1000)) - _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, amount) require.NoError(t, err) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) - + require.True(t, delegated.Amount.QuoRaw(2).Equal(stakeEntry.DelegateTotal.Amount)) // advance epoch to digest the delegate ts.AdvanceEpoch() // now in effect delegated = delegated.Sub(amount) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) + require.True(t, delegated.Amount.QuoRaw(2).Equal(stakeEntry.DelegateTotal.Amount)) // unbond twice in same block, and then in next block - _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, amount) require.NoError(t, err) // _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, amount) // require.Error(t, err) ts.AdvanceBlock() - _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, amount) require.NoError(t, err) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) + require.True(t, delegated.Amount.QuoRaw(2).Equal(stakeEntry.DelegateTotal.Amount)) // advance epoch to digest the delegate ts.AdvanceEpoch() // now in effect delegated = delegated.Sub(amount).Sub(amount) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) + require.True(t, delegated.Amount.QuoRaw(2).Equal(stakeEntry.DelegateTotal.Amount)) _, err = ts.TxPairingUnstakeProvider(provider1Acct.GetVaultAddr(), ts.spec.Name) require.NoError(t, err) // unbond from unstaking provider - _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, amount) require.NoError(t, err) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) + require.True(t, delegated.Amount.QuoRaw(2).Equal(stakeEntry.DelegateTotal.Amount)) delegated = delegated.Sub(amount) // unbond from unstaking provider everything - _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, delegated) + _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, delegated) require.NoError(t, err) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) @@ -469,10 +445,9 @@ func TestUnbond(t *testing.T) { ts.verifyDelegatorsBalance() - res, err = ts.QueryDualstakingDelegatorProviders(client1Addr, true) + res, err = ts.QueryDualstakingDelegatorProviders(client1Addr) require.NoError(t, err) - require.Len(t, res.Delegations, 1) - require.Equal(t, provider1Addr, res.Delegations[0].Provider) + require.Len(t, res.Delegations, 0) } func TestBondUnbondBond(t *testing.T) { @@ -488,7 +463,7 @@ func TestBondUnbondBond(t *testing.T) { // delegate once amount := sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(10000)) - _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err := ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) // advance epoch to digest the delegate @@ -499,7 +474,7 @@ func TestBondUnbondBond(t *testing.T) { require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) // unbond once - _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingUnbond(client1Addr, provider1Addr, amount) require.NoError(t, err) stakeEntry = ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) @@ -512,7 +487,7 @@ func TestBondUnbondBond(t *testing.T) { require.True(t, delegated.IsEqual(stakeEntry.DelegateTotal)) // delegate second time - _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, ts.spec.Name, amount) + _, err = ts.TxDualstakingDelegate(client1Addr, provider1Addr, amount) require.NoError(t, err) ts.AdvanceEpoch() @@ -533,7 +508,7 @@ func TestDualstakingUnbondStakeIsLowerThanMinStakeCausesFreeze(t *testing.T) { amountToUnbond := staked.Sub(minSelfDelegation.AddAmount(math.OneInt())) // unbond once (not unstaking completely but still below min stake) - _, err := ts.TxDualstakingUnbond(provider1Acct.GetVaultAddr(), provider, ts.spec.Name, amountToUnbond) + _, err := ts.TxDualstakingUnbond(provider1Acct.GetVaultAddr(), provider, amountToUnbond) require.NoError(t, err) stakeEntry := ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) @@ -548,7 +523,7 @@ func TestDualstakingUnbondStakeIsLowerThanMinStakeCausesFreeze(t *testing.T) { require.True(t, stakeEntry.IsFrozen()) } -func TestDualstakingUnbondStakeIsLowerThanMinSelfDelegationCausesUnstake(t *testing.T) { +func TestDualstakingUnbondStakeIsLowerThanMinSelfDelegationCausesError(t *testing.T) { ts := newTester(t) // 0 delegator, 1 provider staked, 0 provider unstaked, 0 provider unstaking @@ -560,16 +535,8 @@ func TestDualstakingUnbondStakeIsLowerThanMinSelfDelegationCausesUnstake(t *test amountToUnbond := staked.SubAmount(math.OneInt()) // unbond once (not unstaking completely but still below min stake) - _, err := ts.TxDualstakingUnbond(provider1Acct.GetVaultAddr(), provider, ts.spec.Name, amountToUnbond) - require.NoError(t, err) - - stakeEntry := ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) - require.True(t, staked.IsEqual(stakeEntry.Stake)) - - // advance epoch to digest the delegate - ts.AdvanceEpoch() - // provider should be unstaked -> getStakeEntry should panic - require.Panics(t, func() { ts.getStakeEntry(provider1Acct.Addr.String(), ts.spec.Name) }) + _, err := ts.TxDualstakingUnbond(provider1Acct.GetVaultAddr(), provider, amountToUnbond) + require.Error(t, err) } func TestDualstakingBondStakeIsGreaterThanMinStakeCausesUnFreeze(t *testing.T) { @@ -584,7 +551,7 @@ func TestDualstakingBondStakeIsGreaterThanMinStakeCausesUnFreeze(t *testing.T) { // delegate once amount := sdk.NewCoin("ulava", sdk.NewInt(10000)) - _, err := ts.TxDualstakingDelegate(provider1Acct.GetVaultAddr(), provider1Addr, ts.spec.Name, amount) + _, err := ts.TxDualstakingDelegate(provider1Acct.GetVaultAddr(), provider1Addr, amount) require.NoError(t, err) // advance epoch to digest the delegate @@ -609,8 +576,8 @@ func TestDualstakingRedelegateFreezeOneUnFreezeOther(t *testing.T) { // redelegate once minSelfDelegation := ts.Keepers.Dualstaking.MinSelfDelegation(ts.Ctx) - amountToUnbond := stake.Sub(stake.Sub(minSelfDelegation.AddAmount(math.OneInt()))) - _, err := ts.TxDualstakingRedelegate(provider1Acct.GetVaultAddr(), provider1Addr, provider2Addr, ts.spec.Name, ts.spec.Name, stake.Sub(amountToUnbond)) + amountToUnbond := minSelfDelegation.AddAmount(math.OneInt()) + _, err := ts.TxDualstakingRedelegate(provider1Acct.GetVaultAddr(), provider1Addr, provider2Addr, stake.Sub(amountToUnbond)) require.NoError(t, err) // advance epoch to digest the delegate @@ -627,7 +594,7 @@ func TestDualstakingRedelegateFreezeOneUnFreezeOther(t *testing.T) { require.False(t, stakeEntry.IsFrozen()) // redelegate again - _, err = ts.TxDualstakingRedelegate(provider2Acct.GetVaultAddr(), provider2Addr, provider1Addr, ts.spec.Name, ts.spec.Name, stake.SubAmount(amountToUnbond.Amount)) + _, err = ts.TxDualstakingRedelegate(provider2Acct.GetVaultAddr(), provider2Addr, provider1Addr, stake.SubAmount(amountToUnbond.Amount)) require.NoError(t, err) // advance epoch to digest the delegate diff --git a/x/dualstaking/keeper/delegator_reward.go b/x/dualstaking/keeper/delegator_reward.go index 5decaf9a7e..ae0259db70 100644 --- a/x/dualstaking/keeper/delegator_reward.go +++ b/x/dualstaking/keeper/delegator_reward.go @@ -1,72 +1,53 @@ package keeper import ( - "fmt" "strconv" "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) // SetDelegatorReward set a specific DelegatorReward in the store from its index func (k Keeper) SetDelegatorReward(ctx sdk.Context, delegatorReward types.DelegatorReward) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DelegatorRewardKeyPrefix)) - index := types.DelegationKey(delegatorReward.Provider, delegatorReward.Delegator, delegatorReward.ChainId) - b := k.cdc.MustMarshal(&delegatorReward) - store.Set(types.DelegatorRewardKey( - index, - ), b) + err := k.rewards.Set(ctx, types.DelegationKey(delegatorReward.Provider, delegatorReward.Delegator), delegatorReward) + if err != nil { + panic(err) + } } // GetDelegatorReward returns a DelegatorReward from its index -func (k Keeper) GetDelegatorReward( - ctx sdk.Context, - index string, -) (val types.DelegatorReward, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DelegatorRewardKeyPrefix)) - - b := store.Get(types.DelegatorRewardKey( - index, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true +func (k Keeper) GetDelegatorReward(ctx sdk.Context, provider, delegator string) (val types.DelegatorReward, found bool) { + val, err := k.rewards.Get(ctx, types.DelegationKey(provider, delegator)) + return val, err == nil } // RemoveDelegatorReward removes a DelegatorReward from the store func (k Keeper) RemoveDelegatorReward( ctx sdk.Context, - index string, + provider, delegator string, ) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DelegatorRewardKeyPrefix)) - store.Delete(types.DelegatorRewardKey( - index, - )) + err := k.rewards.Remove(ctx, types.DelegationKey(provider, delegator)) + if err != nil { + panic(err) + } } // GetAllDelegatorReward returns all DelegatorReward func (k Keeper) GetAllDelegatorReward(ctx sdk.Context) (list []types.DelegatorReward) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DelegatorRewardKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() + iter, err := k.rewards.Iterate(ctx, nil) + if err != nil { + panic(err) + } - for ; iterator.Valid(); iterator.Next() { - var val types.DelegatorReward - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) + list, err = iter.Values() + if err != nil { + panic(err) } - return + return list } // The reward for servicing a consumer is divided between the provider and its delegators. @@ -83,18 +64,19 @@ func (k Keeper) GetAllDelegatorReward(ctx sdk.Context) (list []types.DelegatorRe // CalcRewards calculates the provider reward and the total reward for delegators // providerReward = totalReward * ((effectiveDelegations*commission + providerStake) / effectiveStake) // delegatorsReward = totalReward - providerReward -func (k Keeper) CalcRewards(ctx sdk.Context, stakeEntry epochstoragetypes.StakeEntry, totalReward sdk.Coins, delegations []types.Delegation) (providerReward sdk.Coins, delegatorsReward sdk.Coins) { +func (k Keeper) CalcRewards(ctx sdk.Context, totalReward sdk.Coins, totalDelegations math.Int, selfDelegation types.Delegation, delegations []types.Delegation, commission uint64) (providerReward sdk.Coins, delegatorsReward sdk.Coins) { zeroCoins := sdk.NewCoins() + totalDelegationsWithSelf := totalDelegations.Add(selfDelegation.Amount.Amount) // Sanity check - effectiveStake != 0 - if stakeEntry.DelegateTotal.IsZero() && stakeEntry.Stake.IsZero() { + if totalDelegationsWithSelf.IsZero() { return zeroCoins, zeroCoins } - providerReward = totalReward.MulInt(stakeEntry.Stake.Amount).QuoInt(stakeEntry.TotalStake()) - if !stakeEntry.DelegateTotal.IsZero() && stakeEntry.DelegateCommission != 0 { - rawDelegatorsReward := totalReward.MulInt(stakeEntry.DelegateTotal.Amount).QuoInt(stakeEntry.TotalStake()) - providerCommission := rawDelegatorsReward.MulInt(sdk.NewIntFromUint64(stakeEntry.DelegateCommission)).QuoInt(sdk.NewInt(100)) + 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)) providerReward = providerReward.Add(providerCommission...) } @@ -137,9 +119,7 @@ func (k Keeper) ClaimRewards(ctx sdk.Context, delegator string, provider string) rewardCoins := sdk.NewCoins() for _, reward := range res.Rewards { rewardCoins = rewardCoins.Add(reward.Amount...) - - ind := types.DelegationKey(reward.Provider, delegator, reward.ChainId) - k.RemoveDelegatorReward(ctx, ind) + k.RemoveDelegatorReward(ctx, reward.Provider, delegator) } // not minting new coins because they're minted when the provider @@ -163,24 +143,15 @@ func (k Keeper) ClaimRewards(ctx sdk.Context, delegator string, provider string) func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, err error) { block := uint64(ctx.BlockHeight()) zeroCoins := sdk.NewCoins() - epoch, _, err := k.epochstorageKeeper.GetEpochStartForBlock(ctx, block) + + metadata, err := k.epochstorageKeeper.GetMetadata(ctx, provider) if err != nil { return zeroCoins, utils.LavaFormatError(types.ErrCalculatingProviderReward.Error(), err, utils.Attribute{Key: "block", Value: block}, ) } - stakeEntry, found := k.epochstorageKeeper.GetStakeEntry(ctx, epoch, chainID, provider) - if !found { - return zeroCoins, utils.LavaFormatWarning("RewardProvidersAndDelegators: cannot send rewards to provider and delegators", fmt.Errorf("provider stake entry not found, probably unstaked"), - utils.LogAttr("epoch", epoch), - utils.LogAttr("provider", provider), - utils.LogAttr("chain_id", chainID), - utils.LogAttr("sender_module", senderModule), - utils.LogAttr("reward", totalReward.String()), - ) - } - delegations, err := k.GetProviderDelegators(ctx, provider, epoch) + delegations, err := k.GetProviderDelegators(ctx, provider) if err != nil { return zeroCoins, utils.LavaFormatError("cannot get provider's delegators", err) } @@ -200,21 +171,27 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c } } - // delegators eligible for rewards are delegators that their delegation is at least a week old - relevantDelegations := lavaslices.Filter(delegations, - func(d types.Delegation) bool { - return d.ChainID == chainID && d.IsFirstWeekPassed(ctx.BlockTime().UTC().Unix()) && d.Delegator != stakeEntry.Vault - }) + relevantDelegations := []types.Delegation{} + totalDelegations := sdk.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 { + if d.Delegator == metadata.Vault { + selfdelegation = d + } else if d.IsFirstWeekPassed(ctx.BlockTime().UTC().Unix()) { + relevantDelegations = append(relevantDelegations, d) + totalDelegations = totalDelegations.Add(d.Amount.Amount) + } + } - // calculate the rewards for the providers and delegators (total reward - contributors reward) - providerReward, delegatorsReward := k.CalcRewards(ctx, stakeEntry, totalReward.Sub(contributorReward...), relevantDelegations) + providerReward, delegatorsReward := k.CalcRewards(ctx, totalReward.Sub(contributorReward...), totalDelegations, selfdelegation, relevantDelegations, metadata.DelegateCommission) - leftoverRewards := k.updateDelegatorsReward(ctx, stakeEntry.DelegateTotal.Amount, relevantDelegations, delegatorsReward, senderModule, calcOnlyDelegators) + leftoverRewards := k.updateDelegatorsReward(ctx, totalDelegations, relevantDelegations, delegatorsReward, senderModule, calcOnlyDelegators) fullProviderReward := providerReward.Add(leftoverRewards...) if !calcOnlyProvider { // reward provider's vault - k.rewardDelegator(ctx, types.Delegation{Provider: stakeEntry.Address, ChainID: chainID, Delegator: stakeEntry.Vault}, fullProviderReward, senderModule) + k.rewardDelegator(ctx, types.Delegation{Provider: metadata.Provider, Delegator: metadata.Vault}, fullProviderReward, senderModule) } return fullProviderReward, nil @@ -240,12 +217,10 @@ func (k Keeper) rewardDelegator(ctx sdk.Context, delegation types.Delegation, am return } - rewardMapKey := types.DelegationKey(delegation.Provider, delegation.Delegator, delegation.ChainID) - delegatorReward, found := k.GetDelegatorReward(ctx, rewardMapKey) + delegatorReward, found := k.GetDelegatorReward(ctx, delegation.Provider, delegation.Delegator) if !found { delegatorReward.Provider = delegation.Provider delegatorReward.Delegator = delegation.Delegator - delegatorReward.ChainId = delegation.ChainID delegatorReward.Amount = amount } else { delegatorReward.Amount = delegatorReward.Amount.Add(amount...) diff --git a/x/dualstaking/keeper/delegator_reward_test.go b/x/dualstaking/keeper/delegator_reward_test.go index ca684a3f60..2508283bdd 100644 --- a/x/dualstaking/keeper/delegator_reward_test.go +++ b/x/dualstaking/keeper/delegator_reward_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) @@ -20,7 +20,6 @@ func createNDelegatorReward(keeper *keeper.Keeper, ctx sdk.Context, n int) []typ for i := range items { items[i].Provider = "p" + strconv.Itoa(i) items[i].Delegator = "d" + strconv.Itoa(i) - items[i].ChainId = "c" + strconv.Itoa(i) keeper.SetDelegatorReward(ctx, items[i]) } return items @@ -30,10 +29,8 @@ func TestDelegatorRewardGet(t *testing.T) { keeper, ctx := keepertest.DualstakingKeeper(t) items := createNDelegatorReward(keeper, ctx, 10) for _, item := range items { - index := types.DelegationKey(item.Provider, item.Delegator, item.ChainId) rst, found := keeper.GetDelegatorReward(ctx, - index, - ) + item.Provider, item.Delegator) require.True(t, found) require.Equal(t, nullify.Fill(&item), @@ -46,13 +43,10 @@ func TestDelegatorRewardRemove(t *testing.T) { keeper, ctx := keepertest.DualstakingKeeper(t) items := createNDelegatorReward(keeper, ctx, 10) for _, item := range items { - index := types.DelegationKey(item.Provider, item.Delegator, item.ChainId) keeper.RemoveDelegatorReward(ctx, - index, - ) + item.Provider, item.Delegator) _, found := keeper.GetDelegatorReward(ctx, - index, - ) + item.Provider, item.Delegator) require.False(t, found) } } diff --git a/x/dualstaking/keeper/grpc_query_delegator_providers.go b/x/dualstaking/keeper/grpc_query_delegator_providers.go index 172a6e6d65..724a2d05e5 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_providers.go +++ b/x/dualstaking/keeper/grpc_query_delegator_providers.go @@ -2,11 +2,9 @@ package keeper import ( "context" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -18,30 +16,15 @@ func (k Keeper) DelegatorProviders(goCtx context.Context, req *types.QueryDelega ctx := sdk.UnwrapSDKContext(goCtx) - epoch := uint64(ctx.BlockHeight()) - if req.WithPending { - epoch = k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - } - - providers, err := k.GetDelegatorProviders(ctx, req.Delegator, epoch) + providers, err := k.GetDelegatorProviders(ctx, req.Delegator) if err != nil { return nil, err } var delegations []types.Delegation for _, provider := range providers { - indices := k.delegationFS.GetAllEntryIndicesWithPrefix(ctx, types.DelegationKey(provider, req.Delegator, "")) - for _, ind := range indices { - var delegation types.Delegation - found := k.delegationFS.FindEntry(ctx, ind, epoch, &delegation) - if !found { - utils.LavaFormatError("critical: provider found in delegatorFS but not in delegationFS", fmt.Errorf("provider delegation not found"), - utils.Attribute{Key: "delegator", Value: req.Delegator}, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "chainID", Value: delegation.ChainID}, - ) - continue - } + delegation, found := k.GetDelegation(ctx, provider, req.Delegator) + if found { delegations = append(delegations, delegation) } } diff --git a/x/dualstaking/keeper/grpc_query_delegator_providers_test.go b/x/dualstaking/keeper/grpc_query_delegator_providers_test.go index a8688e6eee..26a3074e3b 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_providers_test.go +++ b/x/dualstaking/keeper/grpc_query_delegator_providers_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) @@ -17,49 +17,47 @@ func TestQueryWithUnbonding(t *testing.T) { _, delegator := ts.GetAccount(common.CONSUMER, 0) _, provider := ts.GetAccount(common.PROVIDER, 0) - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) // delegate and query - _, err := ts.TxDualstakingDelegate(delegator, provider, spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator, provider, amount) require.NoError(t, err) ts.AdvanceEpoch() - delegation := types.NewDelegation(delegator, provider, spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation := types.NewDelegation(delegator, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation.Amount = amount - res, err := ts.QueryDualstakingDelegatorProviders(delegator, false) + res, err := ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) delegationRes := res.Delegations[0] require.True(t, delegation.Equal(&delegationRes)) // partially unbond and query unbondAmount := amount.Sub(sdk.NewCoin(ts.TokenDenom(), sdk.OneInt())) - _, err = ts.TxDualstakingUnbond(delegator, provider, spec.Index, unbondAmount) + _, err = ts.TxDualstakingUnbond(delegator, provider, unbondAmount) require.NoError(t, err) ts.AdvanceEpoch() bondedAmount := amount.Sub(unbondAmount) delegation.Amount = bondedAmount - res, err = ts.QueryDualstakingDelegatorProviders(delegator, false) + res, err = ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) delegationRes = res.Delegations[0] require.True(t, delegation.Equal(&delegationRes)) // unbond completely and query (should not get providers) - _, err = ts.TxDualstakingUnbond(delegator, provider, spec.Index, bondedAmount) + _, err = ts.TxDualstakingUnbond(delegator, provider, bondedAmount) require.NoError(t, err) ts.AdvanceEpoch() - res, err = ts.QueryDualstakingDelegatorProviders(delegator, false) + res, err = ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) require.Equal(t, 0, len(res.Delegations)) } -func TestQueryWithPendingDelegations(t *testing.T) { +func TestQueryDelegations(t *testing.T) { ts := newTester(t) ts.setupForDelegation(2, 1, 0, 0) // 2 delegators, 1 staked provider @@ -68,62 +66,45 @@ func TestQueryWithPendingDelegations(t *testing.T) { _, delegator2 := ts.GetAccount(common.CONSUMER, 1) _, provider := ts.GetAccount(common.PROVIDER, 0) - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) - delegation1 := types.NewDelegation(delegator1, provider, spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation1 := types.NewDelegation(delegator1, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation1.Amount = amount // delegate without advancing an epoch - _, err := ts.TxDualstakingDelegate(delegator1, provider, spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator1, provider, amount) require.NoError(t, err) // query pending delegators - res, err := ts.QueryDualstakingDelegatorProviders(delegator1, true) + res, err := ts.QueryDualstakingDelegatorProviders(delegator1) require.NoError(t, err) require.Equal(t, 1, len(res.Delegations)) delegationRes := res.Delegations[0] require.True(t, delegationRes.Equal(&delegation1)) - // query current delegators - res, err = ts.QueryDualstakingDelegatorProviders(delegator1, false) - require.NoError(t, err) - require.Equal(t, 0, len(res.Delegations)) - // advance epoch, delegator1 should show in both flag values ts.AdvanceEpoch() - res, err = ts.QueryDualstakingDelegatorProviders(delegator1, true) - require.NoError(t, err) - require.Equal(t, 1, len(res.Delegations)) - delegationRes = res.Delegations[0] - require.True(t, delegationRes.Equal(&delegation1)) - - res, err = ts.QueryDualstakingDelegatorProviders(delegator1, false) + res, err = ts.QueryDualstakingDelegatorProviders(delegator1) require.NoError(t, err) require.Equal(t, 1, len(res.Delegations)) delegationRes = res.Delegations[0] require.True(t, delegationRes.Equal(&delegation1)) // delegate delegator2 and query again - delegation2 := types.NewDelegation(delegator2, provider, spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation2 := types.NewDelegation(delegator2, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation2.Amount = amount - _, err = ts.TxDualstakingDelegate(delegator2, provider, spec.Index, amount) + _, err = ts.TxDualstakingDelegate(delegator2, provider, amount) require.NoError(t, err) // delegator2 should show when quering with showPending=true and not show when showPending=false - res, err = ts.QueryDualstakingDelegatorProviders(delegator2, true) + res, err = ts.QueryDualstakingDelegatorProviders(delegator2) require.NoError(t, err) require.Equal(t, 1, len(res.Delegations)) delegationRes = res.Delegations[0] require.True(t, delegationRes.Equal(&delegation2)) - - res, err = ts.QueryDualstakingDelegatorProviders(delegator2, false) - require.NoError(t, err) - require.Equal(t, 0, len(res.Delegations)) } func TestQueryProviderMultipleDelegators(t *testing.T) { @@ -140,7 +121,6 @@ func TestQueryProviderMultipleDelegators(t *testing.T) { delegators := []string{delegator1, delegator2, delegator3} - spec := ts.Spec("mock") spec1 := ts.Spec("mock1") err := ts.StakeProvider(providerAcc.GetVaultAddr(), provider, spec1, testStake) require.NoError(t, err) @@ -150,16 +130,10 @@ func TestQueryProviderMultipleDelegators(t *testing.T) { delegations := []types.Delegation{} for i := 0; i < len(delegators); i++ { - var chainID string - if i == 0 { - chainID = spec.Index - } else { - chainID = spec1.Index - } - _, err := ts.TxDualstakingDelegate(delegators[i], provider, chainID, amount) + _, err := ts.TxDualstakingDelegate(delegators[i], provider, amount) require.NoError(t, err) - delegation := types.NewDelegation(delegators[i], provider, chainID, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation := types.NewDelegation(delegators[i], provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation.Amount = amount delegations = append(delegations, delegation) } @@ -167,7 +141,7 @@ func TestQueryProviderMultipleDelegators(t *testing.T) { ts.AdvanceEpoch() for i := 0; i < len(delegations); i++ { - res, err := ts.QueryDualstakingDelegatorProviders(delegations[i].Delegator, false) + res, err := ts.QueryDualstakingDelegatorProviders(delegations[i].Delegator) require.NoError(t, err) require.Equal(t, 1, len(res.Delegations)) resDelegation := res.Delegations[0] @@ -187,29 +161,28 @@ func TestQueryDelegatorMultipleProviders(t *testing.T) { providers := []string{provider1, provider2, provider3} - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) - delegations := []types.Delegation{} + delegations := map[string]types.Delegation{} for i := 0; i < len(providers); i++ { - _, err := ts.TxDualstakingDelegate(delegator, providers[i], spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator, providers[i], amount) require.NoError(t, err) - delegation := types.NewDelegation(delegator, providers[i], spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation := types.NewDelegation(delegator, providers[i], ts.Ctx.BlockTime(), ts.TokenDenom()) delegation.Amount = amount - delegations = append(delegations, delegation) + delegations[providers[i]] = delegation } ts.AdvanceEpoch() - res, err := ts.QueryDualstakingDelegatorProviders(delegator, false) + res, err := ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) require.Equal(t, 3, len(res.Delegations)) for i := 0; i < len(delegations); i++ { resDelegation := res.Delegations[i] - require.True(t, resDelegation.Equal(&delegations[i])) + delegation := delegations[resDelegation.Provider] + require.True(t, resDelegation.Equal(&delegation)) } } @@ -222,16 +195,14 @@ func TestQueryDelegatorUnstakedProvider(t *testing.T) { _, unstakedProvider := ts.GetAccount(common.PROVIDER, 0) _, unstakingProvider := ts.GetAccount(common.PROVIDER, 1) - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) // shouldn't be able to delegate to unstaked provider - _, err := ts.TxDualstakingDelegate(delegator, unstakedProvider, spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator, unstakedProvider, amount) require.Error(t, err) // shouldn't be able to delegate to unstaking provider (even though it didn't get its funds back, it's still considered unstaked) - _, err = ts.TxDualstakingDelegate(delegator, unstakingProvider, spec.Index, amount) + _, err = ts.TxDualstakingDelegate(delegator, unstakingProvider, amount) require.Error(t, err) } diff --git a/x/dualstaking/keeper/grpc_query_delegator_rewards.go b/x/dualstaking/keeper/grpc_query_delegator_rewards.go index bea3ab4281..01413ccaa9 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_rewards.go +++ b/x/dualstaking/keeper/grpc_query_delegator_rewards.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -23,14 +23,11 @@ func (k Keeper) DelegatorRewards(goCtx context.Context, req *types.QueryDelegato } for _, delegation := range resProviders.Delegations { - if (delegation.ChainID == req.ChainId || req.ChainId == "") && - (delegation.Provider == req.Provider || req.Provider == "") { - ind := types.DelegationKey(delegation.Provider, req.Delegator, delegation.ChainID) - delegatorReward, found := k.GetDelegatorReward(ctx, ind) + if delegation.Provider == req.Provider || req.Provider == "" { + delegatorReward, found := k.GetDelegatorReward(ctx, delegation.Provider, delegation.Delegator) if found { reward := types.DelegatorRewardInfo{ Provider: delegation.Provider, - ChainId: delegation.ChainID, Amount: delegatorReward.Amount, } rewards = append(rewards, reward) diff --git a/x/dualstaking/keeper/grpc_query_provider_delegators.go b/x/dualstaking/keeper/grpc_query_provider_delegators.go index 72085ad045..8f71aa8969 100644 --- a/x/dualstaking/keeper/grpc_query_provider_delegators.go +++ b/x/dualstaking/keeper/grpc_query_provider_delegators.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -16,12 +16,7 @@ func (k Keeper) ProviderDelegators(goCtx context.Context, req *types.QueryProvid ctx := sdk.UnwrapSDKContext(goCtx) - epoch := uint64(ctx.BlockHeight()) - if req.WithPending { - epoch = k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - } - - delegations, err := k.GetProviderDelegators(ctx, req.Provider, epoch) + delegations, err := k.GetProviderDelegators(ctx, req.Provider) if err != nil { return nil, err } diff --git a/x/dualstaking/keeper/grpc_query_provider_delegators_test.go b/x/dualstaking/keeper/grpc_query_provider_delegators_test.go index 4ae641a48e..2b62abb9e3 100644 --- a/x/dualstaking/keeper/grpc_query_provider_delegators_test.go +++ b/x/dualstaking/keeper/grpc_query_provider_delegators_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) @@ -17,20 +17,18 @@ func TestQueryProviderDelegatorsWithUnbonding(t *testing.T) { _, delegator := ts.GetAccount(common.CONSUMER, 0) _, provider := ts.GetAccount(common.PROVIDER, 0) - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) // delegate and query - _, err := ts.TxDualstakingDelegate(delegator, provider, spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator, provider, amount) require.NoError(t, err) ts.AdvanceEpoch() - delegation := types.NewDelegation(delegator, provider, spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation := types.NewDelegation(delegator, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation.Amount = amount - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) var delegationRes types.Delegation @@ -43,14 +41,14 @@ func TestQueryProviderDelegatorsWithUnbonding(t *testing.T) { // partially unbond and query unbondAmount := amount.Sub(sdk.NewCoin(ts.TokenDenom(), sdk.OneInt())) - _, err = ts.TxDualstakingUnbond(delegator, provider, spec.Index, unbondAmount) + _, err = ts.TxDualstakingUnbond(delegator, provider, unbondAmount) require.NoError(t, err) ts.AdvanceEpoch() bondedAmount := amount.Sub(unbondAmount) delegation.Amount = bondedAmount - res, err = ts.QueryDualstakingProviderDelegators(provider, false) + res, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) for _, d := range res.Delegations { @@ -61,16 +59,16 @@ func TestQueryProviderDelegatorsWithUnbonding(t *testing.T) { require.True(t, delegation.Equal(&delegationRes)) // unbond completely and query (should not get providers) - _, err = ts.TxDualstakingUnbond(delegator, provider, spec.Index, bondedAmount) + _, err = ts.TxDualstakingUnbond(delegator, provider, bondedAmount) require.NoError(t, err) ts.AdvanceEpoch() - res, err = ts.QueryDualstakingProviderDelegators(provider, false) + res, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 1, len(res.Delegations)) } -func TestQueryProviderDelegatorsWithPendingDelegations(t *testing.T) { +func TestQueryProviderDelegators(t *testing.T) { ts := newTester(t) ts.setupForDelegation(2, 1, 0, 0) // 2 delegators, 1 staked provider @@ -79,20 +77,18 @@ func TestQueryProviderDelegatorsWithPendingDelegations(t *testing.T) { _, delegator2 := ts.GetAccount(common.CONSUMER, 1) _, provider := ts.GetAccount(common.PROVIDER, 0) - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) - delegation1 := types.NewDelegation(delegator1, provider, spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation1 := types.NewDelegation(delegator1, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation1.Amount = amount // delegate without advancing an epoch - _, err := ts.TxDualstakingDelegate(delegator1, provider, spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator1, provider, amount) require.NoError(t, err) // query pending delegators - res, err := ts.QueryDualstakingProviderDelegators(provider, true) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) var delegationRes types.Delegation @@ -103,15 +99,7 @@ func TestQueryProviderDelegatorsWithPendingDelegations(t *testing.T) { } require.True(t, delegationRes.Equal(&delegation1)) - // query current delegators - res, err = ts.QueryDualstakingProviderDelegators(provider, false) - require.NoError(t, err) - require.Equal(t, 1, len(res.Delegations)) - - // advance epoch, delegator1 should show in both flag values - ts.AdvanceEpoch() - - res, err = ts.QueryDualstakingProviderDelegators(provider, true) + res, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) for _, d := range res.Delegations { @@ -121,7 +109,7 @@ func TestQueryProviderDelegatorsWithPendingDelegations(t *testing.T) { } require.True(t, delegationRes.Equal(&delegation1)) - res, err = ts.QueryDualstakingProviderDelegators(provider, false) + res, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) for _, d := range res.Delegations { @@ -132,13 +120,13 @@ func TestQueryProviderDelegatorsWithPendingDelegations(t *testing.T) { require.True(t, delegationRes.Equal(&delegation1)) // delegate delegator2 and query again - delegation2 := types.NewDelegation(delegator2, provider, spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation2 := types.NewDelegation(delegator2, provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation2.Amount = amount - _, err = ts.TxDualstakingDelegate(delegator2, provider, spec.Index, amount) + _, err = ts.TxDualstakingDelegate(delegator2, provider, amount) require.NoError(t, err) // delegator2 should show when quering with showPending=true and not show when showPending=false - res, err = ts.QueryDualstakingProviderDelegators(provider, true) + res, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 3, len(res.Delegations)) for _, d := range res.Delegations { @@ -148,16 +136,6 @@ func TestQueryProviderDelegatorsWithPendingDelegations(t *testing.T) { require.True(t, d.Equal(&delegation2)) } } - - res, err = ts.QueryDualstakingProviderDelegators(provider, false) - require.NoError(t, err) - require.Equal(t, 2, len(res.Delegations)) - for _, d := range res.Delegations { - if d.Delegator == delegation1.Delegator { - delegationRes = d - } - } - require.True(t, delegationRes.Equal(&delegation1)) } func TestQueryProviderDelegatorsProviderMultipleDelegators(t *testing.T) { @@ -174,7 +152,6 @@ func TestQueryProviderDelegatorsProviderMultipleDelegators(t *testing.T) { delegators := []string{delegator1, delegator2, delegator3} - spec := ts.Spec("mock") spec1 := ts.Spec("mock1") err := ts.StakeProvider(providerAcc.GetVaultAddr(), provider, spec1, testStake) require.NoError(t, err) @@ -184,22 +161,16 @@ func TestQueryProviderDelegatorsProviderMultipleDelegators(t *testing.T) { delegations := []types.Delegation{} for i := 0; i < len(delegators); i++ { - var chainID string - if i == 0 { - chainID = spec.Index - } else { - chainID = spec1.Index - } - _, err := ts.TxDualstakingDelegate(delegators[i], provider, chainID, amount) + _, err := ts.TxDualstakingDelegate(delegators[i], provider, amount) require.NoError(t, err) - delegation := types.NewDelegation(delegators[i], provider, chainID, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation := types.NewDelegation(delegators[i], provider, ts.Ctx.BlockTime(), ts.TokenDenom()) delegation.Amount = amount delegations = append(delegations, delegation) } ts.AdvanceEpoch() - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.Equal(t, 4, len(res.Delegations)) require.NoError(t, err) for _, d := range delegations { @@ -223,17 +194,15 @@ func TestQueryProviderDelegatorsDelegatorMultipleProviders(t *testing.T) { providers := []string{provider1, provider2, provider3} - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) delegations := []types.Delegation{} for i := 0; i < len(providers); i++ { - _, err := ts.TxDualstakingDelegate(delegator, providers[i], spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator, providers[i], amount) require.NoError(t, err) - delegation := types.NewDelegation(delegator, providers[i], spec.Index, ts.Ctx.BlockTime(), ts.TokenDenom()) + delegation := types.NewDelegation(delegator, providers[i], ts.Ctx.BlockTime(), ts.TokenDenom()) delegation.Amount = amount delegations = append(delegations, delegation) } @@ -241,7 +210,7 @@ func TestQueryProviderDelegatorsDelegatorMultipleProviders(t *testing.T) { ts.AdvanceEpoch() for i := 0; i < len(providers); i++ { - res, err := ts.QueryDualstakingProviderDelegators(providers[i], false) + res, err := ts.QueryDualstakingProviderDelegators(providers[i]) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) var delegationRes types.Delegation @@ -263,16 +232,14 @@ func TestQueryProviderDelegatorsDelegatorUnstakedProvider(t *testing.T) { _, unstakedProvider := ts.GetAccount(common.PROVIDER, 0) _, unstakingProvider := ts.GetAccount(common.PROVIDER, 1) - spec := ts.Spec("mock") - amountUint64 := uint64(100) amount := sdk.NewCoin(ts.TokenDenom(), sdk.NewIntFromUint64(amountUint64)) // shouldn't be able to delegate to unstaked provider - _, err := ts.TxDualstakingDelegate(delegator, unstakedProvider, spec.Index, amount) + _, err := ts.TxDualstakingDelegate(delegator, unstakedProvider, amount) require.Error(t, err) // shouldn't be able to delegate to unstaking provider (even though it didn't get its funds back, it's still considered unstaked) - _, err = ts.TxDualstakingDelegate(delegator, unstakingProvider, spec.Index, amount) + _, err = ts.TxDualstakingDelegate(delegator, unstakingProvider, amount) require.Error(t, err) } diff --git a/x/dualstaking/keeper/helpers_test.go b/x/dualstaking/keeper/helpers_test.go index 9982176a50..61e1a6a710 100644 --- a/x/dualstaking/keeper/helpers_test.go +++ b/x/dualstaking/keeper/helpers_test.go @@ -4,10 +4,10 @@ import ( "testing" "cosmossdk.io/math" - "github.com/lavanet/lava/v3/testutil/common" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/common" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/hooks.go b/x/dualstaking/keeper/hooks.go index e693da97f1..4a556cd39c 100644 --- a/x/dualstaking/keeper/hooks.go +++ b/x/dualstaking/keeper/hooks.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // Wrapper struct diff --git a/x/dualstaking/keeper/hooks_test.go b/x/dualstaking/keeper/hooks_test.go index 9a46c24953..0c837219a2 100644 --- a/x/dualstaking/keeper/hooks_test.go +++ b/x/dualstaking/keeper/hooks_test.go @@ -9,11 +9,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/testutil/common" + "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/stretchr/testify/require" "golang.org/x/exp/slices" ) @@ -28,7 +28,7 @@ func TestCreateValidator(t *testing.T) { amount := sdk.NewIntFromUint64(100) ts.TxCreateValidator(validator, amount) - res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) + res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, res.Delegations[0].Delegator, validator.Addr.String()) } @@ -43,7 +43,7 @@ func TestDelegateToValidator(t *testing.T) { amount := sdk.NewIntFromUint64(100) ts.TxCreateValidator(validator, amount) - res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) + res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, res.Delegations[0].Delegator, validator.Addr.String()) @@ -52,7 +52,7 @@ func TestDelegateToValidator(t *testing.T) { _, err = ts.TxDelegateValidator(delegator, validator, amount) require.NoError(t, err) - res, err = ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) + res, err = ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) require.True(t, res.Delegations[0].Delegator == validator.Addr.String() || res.Delegations[0].Delegator == delegator.Addr.String()) @@ -71,7 +71,7 @@ func TestReDelegateToValidator(t *testing.T) { ts.TxCreateValidator(validator1, amount) ts.TxCreateValidator(validator2, amount) - delegatorsRes, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) + delegatorsRes, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, 2, len(delegatorsRes.Delegations)) @@ -80,11 +80,11 @@ func TestReDelegateToValidator(t *testing.T) { _, err = ts.TxDelegateValidator(delegator, validator1, amount) require.NoError(t, err) - delegatorsRes, err = ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) + delegatorsRes, err = ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, 3, len(delegatorsRes.Delegations)) - providersRes, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), true) + providersRes, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String()) require.NoError(t, err) require.Equal(t, 1, len(providersRes.Delegations)) require.Equal(t, delegator.Addr.String(), providersRes.Delegations[0].Delegator) @@ -92,11 +92,11 @@ func TestReDelegateToValidator(t *testing.T) { _, err = ts.TxReDelegateValidator(delegator, validator1, validator2, amount) require.NoError(t, err) - delegatorsRes1, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) + delegatorsRes1, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, delegatorsRes, delegatorsRes1) - providersRes1, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), true) + providersRes1, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String()) require.NoError(t, err) require.Equal(t, providersRes, providersRes1) } @@ -128,7 +128,7 @@ func TestReDelegateToProvider(t *testing.T) { require.True(t, found) require.Equal(t, amount, entry.Stake.Amount) - providersRes, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), true) + providersRes, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String()) require.NoError(t, err) require.Equal(t, 1, len(providersRes.Delegations)) require.Equal(t, commontypes.EMPTY_PROVIDER, providersRes.Delegations[0].Provider) @@ -138,19 +138,12 @@ func TestReDelegateToProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegator.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - commontypes.EMPTY_PROVIDER_CHAINID, - entry.Chain, sdk.NewCoin(ts.TokenDenom(), amount)) require.NoError(t, err) - providersRes1, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), false) + providersRes1, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String()) require.NoError(t, err) - require.Equal(t, providersRes, providersRes1) - - providersRes1, err = ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), true) - require.NoError(t, err) - require.Equal(t, provider, providersRes1.Delegations[0].Provider) ts.AdvanceEpoch() @@ -159,6 +152,7 @@ func TestReDelegateToProvider(t *testing.T) { require.True(t, found) require.Equal(t, amount, entry.DelegateTotal.Amount) require.Equal(t, amount, entry.Stake.Amount) + require.Equal(t, provider, providersRes1.Delegations[0].Provider) } // TestUnbondUniformProviders checks that the uniform unbond of providers (that is triggered by a validator unbond) @@ -208,8 +202,6 @@ func TestUnbondUniformProviders(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - commontypes.EMPTY_PROVIDER_CHAINID, - ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), redelegateAmts[i])) require.NoError(t, err) } @@ -218,7 +210,7 @@ func TestUnbondUniformProviders(t *testing.T) { _, err = ts.TxUnbondValidator(delegatorAcc, validator, sdk.NewInt(25*5)) require.NoError(t, err) - res, err := ts.QueryDualstakingDelegatorProviders(delegator, true) + res, err := ts.QueryDualstakingDelegatorProviders(delegator) require.Len(t, res.Delegations, 3) require.NoError(t, err) for _, d := range res.Delegations { @@ -254,7 +246,7 @@ func TestValidatorSlash(t *testing.T) { require.Equal(t, amount, val.Tokens) // sanity check: empty provider should have delegation of 1000000000 tokens - resQ, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, false) + resQ, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, 1, len(resQ.Delegations)) require.Equal(t, amount, resQ.Delegations[0].Amount.Amount) @@ -268,7 +260,7 @@ func TestValidatorSlash(t *testing.T) { // check: the only delegation should be validator delegated to empty provider // the delegation amount should be original_amount(=1000000000) - expectedTokensToBurn - res, err := ts.QueryDualstakingDelegatorProviders(valAcc.Addr.String(), true) + res, err := ts.QueryDualstakingDelegatorProviders(valAcc.Addr.String()) require.NoError(t, err) require.Equal(t, 1, len(res.Delegations)) // empty provider require.Equal(t, amount.Sub(expectedTokensToBurn), res.Delegations[0].Amount.Amount) @@ -322,7 +314,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { ts.AdvanceEpoch() // advance epoch to apply the empty provider delegation (that happens automatically when delegating to the validator) // sanity check: empty provider should have val_stake(=1000000000) + 250*consensusPowerTokens tokens in two delegations - resQ, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, false) + resQ, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER) require.NoError(t, err) require.Equal(t, 2, len(resQ.Delegations)) require.Equal(t, stake.Add(consensusPowerTokens.MulRaw(250)), resQ.Delegations[0].Amount.Amount.Add(resQ.Delegations[1].Amount.Amount)) @@ -343,14 +335,12 @@ func TestValidatorAndProvidersSlash(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - commontypes.EMPTY_PROVIDER_CHAINID, - ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), redelegateAmts[i])) require.NoError(t, err) ts.AdvanceEpoch() // verify delegation is applied (should be 2 delegations: self delegation + redelegate amount) - resQ, err = ts.QueryDualstakingProviderDelegators(provider, false) + resQ, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(resQ.Delegations)) require.Equal(t, redelegateAmts[i].Add(stake), resQ.Delegations[0].Amount.Amount.Add(resQ.Delegations[1].Amount.Amount)) @@ -361,7 +351,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { ts.AdvanceBlockUntilStale() // sanity check: redelegate from provider0 to provider1 and check delegations balance - _, err = ts.TxDualstakingRedelegate(delegator, providers[0], providers[1], ts.spec.Index, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), consensusPowerTokens.MulRaw(5))) + _, err = ts.TxDualstakingRedelegate(delegator, providers[0], providers[1], sdk.NewCoin(ts.TokenDenom(), consensusPowerTokens.MulRaw(5))) require.NoError(t, err) ts.AdvanceEpoch() // apply redelegation diff, _, err := ts.Keepers.Dualstaking.VerifyDelegatorBalance(ts.Ctx, delegatorAcc.Addr) @@ -369,7 +359,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { require.True(t, diff.IsZero()) // sanity check: unbond some of provider2's funds and check delegations balance - _, err = ts.TxDualstakingUnbond(delegator, providers[2], ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), consensusPowerTokens.MulRaw(5))) + _, err = ts.TxDualstakingUnbond(delegator, providers[2], sdk.NewCoin(ts.TokenDenom(), consensusPowerTokens.MulRaw(5))) require.NoError(t, err) ts.AdvanceEpoch() // apply unbond diff, _, err = ts.Keepers.Dualstaking.VerifyDelegatorBalance(ts.Ctx, delegatorAcc.Addr) @@ -378,7 +368,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { expectedValidatorTokens = expectedValidatorTokens.Sub(consensusPowerTokens.MulRaw(5)) // get the delegator's provider delegations before the slash - res, err := ts.QueryDualstakingDelegatorProviders(delegator, true) + res, err := ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) delegationsBeforeSlash := res.Delegations slices.SortFunc(delegationsBeforeSlash, func(i, j dualstakingtypes.Delegation) bool { @@ -396,13 +386,13 @@ func TestValidatorAndProvidersSlash(t *testing.T) { // 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(), true) + 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) for _, p := range providersAccs { - res, err = ts.QueryDualstakingDelegatorProviders(p.GetVaultAddr(), true) + 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) @@ -410,7 +400,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { // the total token to deduct from the delegator's provider delegations is: // total_providers_delegations * fraction = (245 * consensus_power_tokens) * fraction - res, err = ts.QueryDualstakingDelegatorProviders(delegator, true) + res, err = ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) require.Len(t, res.Delegations, 5) // 5 providers from redelegations totalDelegations := math.ZeroInt() @@ -495,7 +485,7 @@ func TestHooksRandomDelegations(t *testing.T) { delegatorAcc = prevDelegatorAcc delegator = prevDelegator } - _, err := ts.TxDualstakingDelegate(delegator, provider, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(int64(d)))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(int64(d)))) require.NoError(t, err) _, found := ts.Keepers.StakingKeeper.GetDelegation(ts.Ctx, delegatorAcc.Addr, sdk.ValAddress(validatorAcc.Addr)) @@ -533,7 +523,7 @@ func TestNotRoundedShares(t *testing.T) { require.NoError(t, err) ts.Keepers.StakingKeeper.SetDelegation(ts.Ctx, stakingtypes.NewDelegation(delegatorAcc.Addr, sdk.ValAddress(validatorAcc.Addr), shares)) - _, err = ts.TxDualstakingDelegate(delegator, provider, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), delAmount)) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), delAmount)) require.NoError(t, err) } @@ -567,27 +557,11 @@ func TestUnbondValidatorButNotRemoveStakeEntry(t *testing.T) { require.NoError(t, err) } - providerAcct, provider := ts.GetAccount(common.PROVIDER, 0) + providerAcct, _ := ts.GetAccount(common.PROVIDER, 0) // provider completely unbond from validator, delegation is removed _, err = ts.TxUnbondValidator(*providerAcct.Vault, validator, sdk.NewInt(9999)) - require.NoError(t, err) - - // other delegator should not be able to delegate to the provider - _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), - commontypes.EMPTY_PROVIDER, - provider, - commontypes.EMPTY_PROVIDER_CHAINID, - ts.spec.Index, - sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) require.Error(t, err) - - // checking that provider is not found - _, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) - require.False(t, found) - - _, err = ts.QueryDualstakingProviderDelegators(provider, true) - require.NoError(t, err) } // TestUndelegateProvider checks for a bug that when a provider unstakes, its delegations are not @@ -634,14 +608,12 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - commontypes.EMPTY_PROVIDER_CHAINID, - ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) require.NoError(t, err) ts.AdvanceEpoch() - res2, err := ts.QueryDualstakingProviderDelegators(provider, true) + res2, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) fmt.Println("Delegation of Provider before provider is removed", res2) @@ -653,9 +625,9 @@ func TestUndelegateProvider(t *testing.T) { // delegation of the removed provider // the provider is removed but the delegation is still remained - res2, err = ts.QueryDualstakingProviderDelegators(provider, true) + res2, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) - fmt.Println("Delegation of Provider after provider is removed", res2) + require.Equal(t, int64(9999), res2.Delegations[0].Amount.Amount.Int64()) ts.AdvanceEpochUntilStale() @@ -663,30 +635,25 @@ func TestUndelegateProvider(t *testing.T) { err = ts.StakeProvider(providerAcct.GetVaultAddr(), providerAcct.Addr.String(), ts.spec, sdk.NewIntFromUint64(1000).Int64()) require.NoError(t, err) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) + entry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) - fmt.Println("Stake entry of re-staked provider", stakeEntry.String()) + require.Equal(t, int64(9999), entry.DelegateTotal.Amount.Int64()) // delegator1 should be able to redelegate back to the empty provider _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, commontypes.EMPTY_PROVIDER, - ts.spec.Index, - commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1))) require.NoError(t, err) - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) + _, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) - fmt.Println("Stake entry of re-staked provider after del1 9999 redelegation", stakeEntry.String()) // another one delegates to provider // delegator2 delegates 9998 to the provider _, err = ts.TxDualstakingRedelegate(delegatorAcc2.Addr.String(), commontypes.EMPTY_PROVIDER, provider, - commontypes.EMPTY_PROVIDER_CHAINID, - ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9998))) require.NoError(t, err) @@ -696,16 +663,12 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, commontypes.EMPTY_PROVIDER, - ts.spec.Index, - commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) require.Error(t, err) _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, commontypes.EMPTY_PROVIDER, - ts.spec.Index, - commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9998))) require.NoError(t, err) } diff --git a/x/dualstaking/keeper/keeper.go b/x/dualstaking/keeper/keeper.go index 4749bb3082..2010449bed 100644 --- a/x/dualstaking/keeper/keeper.go +++ b/x/dualstaking/keeper/keeper.go @@ -2,17 +2,17 @@ package keeper import ( "fmt" - "strconv" + "cosmossdk.io/collections" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" "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" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + collcompat "github.com/lavanet/lava/v4/utils/collcompat" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) type ( @@ -28,8 +28,9 @@ type ( epochstorageKeeper types.EpochstorageKeeper specKeeper types.SpecKeeper - delegationFS fixationtypes.FixationStore // map proviers/chainID -> delegations - delegatorFS fixationtypes.FixationStore // map delegators -> providers + schema collections.Schema + delegations *collections.IndexedMap[collections.Pair[string, string], types.Delegation, types.DelegationIndexes] // key: [delegator, provider] + rewards collections.Map[collections.Pair[string, string], types.DelegatorReward] // key: [delegator, provider] } ) @@ -50,6 +51,8 @@ func NewKeeper( ps = ps.WithKeyTable(types.ParamKeyTable()) } + sb := collections.NewSchemaBuilder(collcompat.NewKVStoreService(storeKey)) + keeper := &Keeper{ cdc: cdc, storeKey: storeKey, @@ -61,50 +64,36 @@ func NewKeeper( accountKeeper: accountKeeper, epochstorageKeeper: epochstorageKeeper, specKeeper: specKeeper, - } - delegationFS := *fixationStoreKeeper.NewFixationStore(storeKey, types.DelegationPrefix) - delegatorFS := *fixationStoreKeeper.NewFixationStore(storeKey, types.DelegatorPrefix) + delegations: collections.NewIndexedMap(sb, types.DelegationsPrefix, "delegations", + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + collcompat.ProtoValue[types.Delegation](cdc), + types.NewDelegationIndexes(sb)), - keeper.delegationFS = delegationFS - keeper.delegatorFS = delegatorFS + rewards: collections.NewMap(sb, types.RewardPrefix, "rewards", + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + collcompat.ProtoValue[types.DelegatorReward](cdc)), + } + schema, err := sb.Build() + if err != nil { + panic(err) + } + keeper.schema = schema return keeper } -// ExportDelegations exports dualstaking delegations data (for genesis) -func (k Keeper) ExportDelegations(ctx sdk.Context) fixationtypes.GenesisState { - return k.delegationFS.Export(ctx) -} - -// ExportDelegators exports dualstaking delegators data (for genesis) -func (k Keeper) ExportDelegators(ctx sdk.Context) fixationtypes.GenesisState { - return k.delegatorFS.Export(ctx) -} - -// InitDelegations imports dualstaking delegations data (from genesis) -func (k Keeper) InitDelegations(ctx sdk.Context, data fixationtypes.GenesisState) { - k.delegationFS.Init(ctx, data) -} - -// InitDelegators imports dualstaking delegators data (from genesis) -func (k Keeper) InitDelegators(ctx sdk.Context, data fixationtypes.GenesisState) { - k.delegatorFS.Init(ctx, data) -} - func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) ChangeDelegationTimestampForTesting(ctx sdk.Context, index string, block uint64, timestamp int64) error { - var d types.Delegation - entryBlock, _, _, found := k.delegationFS.FindEntryDetailed(ctx, index, block, &d) +func (k Keeper) ChangeDelegationTimestampForTesting(ctx sdk.Context, provider, delegator string, timestamp int64) error { + d, found := k.GetDelegation(ctx, provider, delegator) if !found { - return fmt.Errorf("cannot change delegation timestamp: delegation not found. index: %s, block: %s", index, strconv.FormatUint(block, 10)) + return fmt.Errorf("cannot change delegation timestamp: delegation not found. provider: %s, delegator: %s", provider, delegator) } d.Timestamp = timestamp - k.delegationFS.ModifyEntry(ctx, index, entryBlock, &d) - return nil + return k.SetDelegation(ctx, d) } func (k Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { diff --git a/x/dualstaking/keeper/migrations.go b/x/dualstaking/keeper/migrations.go index 3e8254a8d3..8966235507 100644 --- a/x/dualstaking/keeper/migrations.go +++ b/x/dualstaking/keeper/migrations.go @@ -5,9 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - dualstakingv4 "github.com/lavanet/lava/v3/x/dualstaking/migrations/v4" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) type Migrator struct { @@ -18,36 +18,70 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -// MigrateVersion4To5 change the DelegatorReward object amount's field from sdk.Coin to sdk.Coins -func (m Migrator) MigrateVersion4To5(ctx sdk.Context) error { - delegatorRewards := m.GetAllDelegatorRewardV4(ctx) - for _, dr := range delegatorRewards { - delegatorReward := dualstakingtypes.DelegatorReward{ - Delegator: dr.Delegator, - Provider: dr.Provider, - ChainId: dr.ChainId, - Amount: sdk.NewCoins(dr.Amount), +func (m Migrator) MigrateVersion5To6(ctx sdk.Context) error { + nextEpoch := m.keeper.epochstorageKeeper.GetCurrentNextEpoch(ctx) + + // prefix for the delegations fixation store + const ( + DelegationPrefix = "delegation-fs" + DelegatorPrefix = "delegator-fs" + UnbondingPrefix = "unbonding-ts" + DelegatorRewardKeyPrefix = "DelegatorReward/value/" + ) + + // set delegations + ts := timerstoretypes.NewTimerStore(m.keeper.storeKey, m.keeper.cdc, DelegationPrefix) + delegationFS := fixationtypes.NewFixationStore(m.keeper.storeKey, m.keeper.cdc, DelegationPrefix, ts, nil) + incisec := delegationFS.GetAllEntryIndices(ctx) + for _, index := range incisec { + var oldDelegation types.Delegation + found := delegationFS.FindEntry(ctx, index, nextEpoch, &oldDelegation) + if found { + delegation, found := m.keeper.GetDelegation(ctx, oldDelegation.Provider, oldDelegation.Delegator) + if found { + delegation.Amount = delegation.Amount.Add(oldDelegation.Amount) + } else { + delegation = oldDelegation + } + delegation.Timestamp = ctx.BlockTime().UTC().Unix() + m.keeper.SetDelegation(ctx, delegation) } - m.keeper.RemoveDelegatorReward(ctx, dualstakingtypes.DelegationKey(dr.Provider, dr.Delegator, dr.ChainId)) - m.keeper.SetDelegatorReward(ctx, delegatorReward) } - params := dualstakingtypes.DefaultParams() - m.keeper.SetParams(ctx, params) - return nil -} - -func (m Migrator) GetAllDelegatorRewardV4(ctx sdk.Context) (list []dualstakingv4.DelegatorRewardv4) { - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(dualstakingtypes.DelegatorRewardKeyPrefix)) + // set rewards + store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(DelegatorRewardKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var val dualstakingv4.DelegatorRewardv4 + var val types.DelegatorReward m.keeper.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) + reward, found := m.keeper.GetDelegatorReward(ctx, val.Delegator, val.Delegator) + if found { + reward.Amount = reward.Amount.Add(val.Amount...) + } else { + reward = val + } + m.keeper.SetDelegatorReward(ctx, reward) } - return + // now delete the stores + deleteStore := func(prefixString string) { + store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(prefixString)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } + } + + deleteStore(DelegationPrefix) + deleteStore(DelegatorPrefix) + deleteStore(UnbondingPrefix) + deleteStore(DelegatorRewardKeyPrefix) + + return nil } diff --git a/x/dualstaking/keeper/msg_server.go b/x/dualstaking/keeper/msg_server.go index 0a1fd6bdaa..448d20c622 100644 --- a/x/dualstaking/keeper/msg_server.go +++ b/x/dualstaking/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) type msgServer struct { diff --git a/x/dualstaking/keeper/msg_server_claim_rewards.go b/x/dualstaking/keeper/msg_server_claim_rewards.go index afa529647f..9f38eaea5b 100644 --- a/x/dualstaking/keeper/msg_server_claim_rewards.go +++ b/x/dualstaking/keeper/msg_server_claim_rewards.go @@ -4,9 +4,9 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func (k msgServer) ClaimRewards(goCtx context.Context, msg *types.MsgClaimRewards) (*types.MsgClaimRewardsResponse, error) { diff --git a/x/dualstaking/keeper/msg_server_delegate.go b/x/dualstaking/keeper/msg_server_delegate.go index 0ce56b460a..fdb823e4d2 100644 --- a/x/dualstaking/keeper/msg_server_delegate.go +++ b/x/dualstaking/keeper/msg_server_delegate.go @@ -2,28 +2,21 @@ package keeper import ( "context" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - return &types.MsgDelegateResponse{}, k.Keeper.DelegateFull(ctx, msg.Creator, msg.Validator, msg.Provider, msg.ChainID, msg.Amount) + return &types.MsgDelegateResponse{}, k.Keeper.DelegateFull(ctx, msg.Creator, msg.Validator, msg.Provider, msg.Amount, false) } // DelegateFull uses staking module for to delegate with hooks -func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin) error { - _, found := k.specKeeper.GetSpec(ctx, chainID) - if !found && chainID != commontypes.EMPTY_PROVIDER_CHAINID { - return utils.LavaFormatWarning("invalid chain ID", fmt.Errorf("chain ID not found"), - utils.LogAttr("chain_id", chainID)) - } - +func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, amount sdk.Coin, stake bool) error { valAddr, valErr := sdk.ValAddressFromBech32(validator) if valErr != nil { return valErr @@ -47,9 +40,7 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string return err } - nextEpoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - - delegation, found := k.GetDelegation(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, nextEpoch) + delegation, found := k.GetDelegation(ctx, commontypes.EMPTY_PROVIDER, delegator) amountBefore := sdk.ZeroInt() if found { amountBefore = delegation.Amount.Amount @@ -60,7 +51,7 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string return err } - delegation, _ = k.GetDelegation(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, nextEpoch) + delegation, _ = k.GetDelegation(ctx, commontypes.EMPTY_PROVIDER, delegator) amount.Amount = delegation.Amount.Amount.Sub(amountBefore) @@ -69,9 +60,8 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string delegator, commontypes.EMPTY_PROVIDER, provider, - commontypes.EMPTY_PROVIDER_CHAINID, - chainID, amount, + stake, ) if err == nil { @@ -79,7 +69,6 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string details := map[string]string{ "delegator": delegator, "provider": provider, - "chainID": chainID, "amount": amount.String(), } utils.LogLavaEvent(ctx, logger, types.DelegateEventName, details, "Delegate") diff --git a/x/dualstaking/keeper/msg_server_redelegate.go b/x/dualstaking/keeper/msg_server_redelegate.go index 4e3c112b17..0c850104f2 100644 --- a/x/dualstaking/keeper/msg_server_redelegate.go +++ b/x/dualstaking/keeper/msg_server_redelegate.go @@ -4,9 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) (*types.MsgRedelegateResponse, error) { @@ -20,22 +19,13 @@ func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) ( return &types.MsgRedelegateResponse{}, err } - // allow non empty chainID calls to redelegate form empty provider - if msg.FromChainID == commontypes.EMPTY_PROVIDER_CHAINID_STAR { - msg.FromChainID = commontypes.EMPTY_PROVIDER_CHAINID - } - if msg.ToChainID == commontypes.EMPTY_PROVIDER_CHAINID_STAR { - msg.ToChainID = commontypes.EMPTY_PROVIDER_CHAINID - } - err := k.Keeper.Redelegate( ctx, msg.Creator, msg.FromProvider, msg.ToProvider, - msg.FromChainID, - msg.ToChainID, msg.Amount, + false, ) if err == nil { @@ -44,8 +34,6 @@ func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) ( "delegator": msg.Creator, "from_provider": msg.FromProvider, "to_provider": msg.ToProvider, - "from_chainID": msg.FromChainID, - "to_chainID": msg.ToChainID, "amount": msg.Amount.String(), } utils.LogLavaEvent(ctx, logger, types.RedelegateEventName, details, "Redelegate") diff --git a/x/dualstaking/keeper/msg_server_test.go b/x/dualstaking/keeper/msg_server_test.go index 95e1be4373..a411106799 100644 --- a/x/dualstaking/keeper/msg_server_test.go +++ b/x/dualstaking/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/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" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/msg_server_unbond.go b/x/dualstaking/keeper/msg_server_unbond.go index d195fbf80e..190dab7ae5 100644 --- a/x/dualstaking/keeper/msg_server_unbond.go +++ b/x/dualstaking/keeper/msg_server_unbond.go @@ -4,18 +4,18 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func (k msgServer) Unbond(goCtx context.Context, msg *types.MsgUnbond) (*types.MsgUnbondResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - return &types.MsgUnbondResponse{}, k.Keeper.UnbondFull(ctx, msg.Creator, msg.Validator, msg.Provider, msg.ChainID, msg.Amount, false) + return &types.MsgUnbondResponse{}, k.Keeper.UnbondFull(ctx, msg.Creator, msg.Validator, msg.Provider, msg.Amount, false) } // UnbondFul uses staking module for to unbond with hooks -func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin, unstake bool) error { +func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, provider string, amount sdk.Coin, stake bool) error { // 1.redelegate from the provider to the empty provider // 2.calls staking module to unbond from the validator // 3.calls the hooks to than unbond from the empty provider @@ -45,9 +45,8 @@ func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, delegator, provider, commontypes.EMPTY_PROVIDER, - chainID, - commontypes.EMPTY_PROVIDER_CHAINID, amount, + stake, ) if err != nil { return err @@ -61,7 +60,6 @@ func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, details := map[string]string{ "delegator": delegator, "provider": provider, - "chainID": chainID, "amount": amount.String(), } utils.LogLavaEvent(ctx, logger, types.UnbondingEventName, details, "Unbond") diff --git a/x/dualstaking/keeper/params.go b/x/dualstaking/keeper/params.go index 1fc16bfef7..cf1a1582a1 100644 --- a/x/dualstaking/keeper/params.go +++ b/x/dualstaking/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // GetParams get all parameters as types.Params diff --git a/x/dualstaking/keeper/params_test.go b/x/dualstaking/keeper/params_test.go index d9e4f7c8a4..a0f1623321 100644 --- a/x/dualstaking/keeper/params_test.go +++ b/x/dualstaking/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/query.go b/x/dualstaking/keeper/query.go index 4db2a24f82..6f6f15dc52 100644 --- a/x/dualstaking/keeper/query.go +++ b/x/dualstaking/keeper/query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/dualstaking/keeper/query_params.go b/x/dualstaking/keeper/query_params.go index 8c007c0529..2000b827cf 100644 --- a/x/dualstaking/keeper/query_params.go +++ b/x/dualstaking/keeper/query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/dualstaking/keeper/query_params_test.go b/x/dualstaking/keeper/query_params_test.go index f2d722a7c8..6f029ce46e 100644 --- a/x/dualstaking/keeper/query_params_test.go +++ b/x/dualstaking/keeper/query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/slashing.go b/x/dualstaking/keeper/slashing.go index 00ae89c77f..3f5d35c330 100644 --- a/x/dualstaking/keeper/slashing.go +++ b/x/dualstaking/keeper/slashing.go @@ -3,8 +3,8 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // balance delegators dualstaking after potential validators slashing diff --git a/x/dualstaking/module.go b/x/dualstaking/module.go index 977359096f..aecd7dda6a 100644 --- a/x/dualstaking/module.go +++ b/x/dualstaking/module.go @@ -17,9 +17,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/dualstaking/client/cli" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/client/cli" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) var ( @@ -118,8 +118,8 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v4 -> v5 migration - if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.MigrateVersion4To5); err != nil { + // register v5 -> v6 migration + if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.MigrateVersion5To6); err != nil { // panic:ok: at start up, migration cannot proceed anyhow panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) } @@ -146,7 +146,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 -func (AppModule) ConsensusVersion() uint64 { return 5 } +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) { diff --git a/x/dualstaking/module_simulation.go b/x/dualstaking/module_simulation.go index f191eafb13..beaddac229 100644 --- a/x/dualstaking/module_simulation.go +++ b/x/dualstaking/module_simulation.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - dualstakingsimulation "github.com/lavanet/lava/v3/x/dualstaking/simulation" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/testutil/sample" + dualstakingsimulation "github.com/lavanet/lava/v4/x/dualstaking/simulation" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) // avoid unused import issue diff --git a/x/dualstaking/simulation/claim_rewards.go b/x/dualstaking/simulation/claim_rewards.go index 34dc76ada5..bfbe077299 100644 --- a/x/dualstaking/simulation/claim_rewards.go +++ b/x/dualstaking/simulation/claim_rewards.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func SimulateMsgClaimRewards( diff --git a/x/dualstaking/simulation/delegate.go b/x/dualstaking/simulation/delegate.go index b5cdda6057..bf12e20b40 100644 --- a/x/dualstaking/simulation/delegate.go +++ b/x/dualstaking/simulation/delegate.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/dualstaking/keeper" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/keeper" + "github.com/lavanet/lava/v4/x/dualstaking/types" ) func SimulateMsgDelegate( diff --git a/x/dualstaking/types/delegate.go b/x/dualstaking/types/delegate.go index 420ebc5f70..fe2b82e405 100644 --- a/x/dualstaking/types/delegate.go +++ b/x/dualstaking/types/delegate.go @@ -3,18 +3,37 @@ package types import ( "time" + "cosmossdk.io/collections" + "cosmossdk.io/collections/indexes" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/lavaslices" ) -func NewDelegation(delegator, provider, chainID string, blockTime time.Time, tokenDenom string) Delegation { +var DelegationIndexPrefix = collections.NewPrefix(1) + +type DelegationIndexes struct { + ReverseIndex *indexes.ReversePair[string, string, Delegation] +} + +func (a DelegationIndexes) IndexesList() []collections.Index[collections.Pair[string, string], Delegation] { + return []collections.Index[collections.Pair[string, string], Delegation]{a.ReverseIndex} +} + +func NewDelegationIndexes(sb *collections.SchemaBuilder) DelegationIndexes { + return DelegationIndexes{ + ReverseIndex: indexes.NewReversePair[Delegation]( + sb, DelegationIndexPrefix, "delegation_by_provider_delegator", + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + ), + } +} + +func NewDelegation(delegator, provider string, blockTime time.Time, tokenDenom string) Delegation { return Delegation{ Delegator: delegator, Provider: provider, - ChainID: chainID, Amount: sdk.NewCoin(tokenDenom, sdk.ZeroInt()), - Timestamp: utils.NextMonth(blockTime).UTC().Unix(), + Timestamp: blockTime.AddDate(0, 0, 7).UTC().Unix(), } } @@ -33,7 +52,6 @@ func (delegation *Delegation) IsZero() bool { func (delegation *Delegation) Equal(other *Delegation) bool { if delegation.Delegator != other.Delegator || delegation.Provider != other.Provider || - delegation.ChainID != other.ChainID || !delegation.Amount.IsEqual(other.Amount) { return false } @@ -42,7 +60,7 @@ func (delegation *Delegation) Equal(other *Delegation) bool { func (delegation *Delegation) IsFirstWeekPassed(currentTimestamp int64) bool { // this is a temporary code to reduce the time to 1 week instead of month, will be changed in the gradual delegation increase feature. - return delegation.Timestamp-int64((3*7*24*time.Hour).Seconds()) <= currentTimestamp + return delegation.Timestamp <= currentTimestamp } func NewDelegator(delegator, provider string) Delegator { diff --git a/x/dualstaking/types/delegate.pb.go b/x/dualstaking/types/delegate.pb.go index 3e04209a2b..fbe4c80497 100644 --- a/x/dualstaking/types/delegate.pb.go +++ b/x/dualstaking/types/delegate.pb.go @@ -26,7 +26,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Delegation struct { Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` - ChainID string `protobuf:"bytes,2,opt,name=chainID,proto3" json:"chainID,omitempty"` Delegator string `protobuf:"bytes,3,opt,name=delegator,proto3" json:"delegator,omitempty"` Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` @@ -72,13 +71,6 @@ func (m *Delegation) GetProvider() string { return "" } -func (m *Delegation) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - func (m *Delegation) GetDelegator() string { if m != nil { return m.Delegator @@ -154,27 +146,26 @@ func init() { } var fileDescriptor_547eac7f30bf94d4 = []byte{ - // 306 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x63, 0x5a, 0x0a, 0x31, 0x5b, 0xc4, 0x60, 0xaa, 0xca, 0x44, 0x5d, 0x28, 0x8b, 0xad, - 0xd2, 0x81, 0xbd, 0x74, 0x80, 0xb5, 0x23, 0x9b, 0x93, 0x5a, 0xa9, 0x45, 0xe3, 0x8b, 0x62, 0x37, - 0x82, 0xb7, 0xe0, 0x6d, 0x78, 0x85, 0x8e, 0x1d, 0x99, 0x10, 0x4a, 0x5e, 0x04, 0x39, 0x49, 0x53, - 0x3a, 0x9d, 0xef, 0xff, 0x7f, 0xf9, 0x3e, 0xdd, 0xe1, 0xbb, 0x8d, 0x28, 0x84, 0x96, 0x96, 0xbb, - 0xca, 0x57, 0x5b, 0xb1, 0x31, 0x56, 0xbc, 0x29, 0x9d, 0xf0, 0x95, 0xdc, 0xc8, 0x44, 0x58, 0xc9, - 0xb2, 0x1c, 0x2c, 0x04, 0xa4, 0x0d, 0x32, 0x57, 0xd9, 0xbf, 0xe0, 0xf0, 0x3a, 0x81, 0x04, 0xea, - 0x10, 0x77, 0xaf, 0x26, 0x3f, 0xa4, 0x31, 0x98, 0x14, 0x0c, 0x8f, 0x84, 0x91, 0xbc, 0x98, 0x46, - 0xd2, 0x8a, 0x29, 0x8f, 0x41, 0xe9, 0xc6, 0x1f, 0x7f, 0x21, 0x8c, 0x17, 0xcd, 0x08, 0x05, 0x3a, - 0x18, 0xe2, 0xcb, 0x2c, 0x87, 0x42, 0xad, 0x64, 0x4e, 0x50, 0x88, 0x26, 0xfe, 0xb2, 0xeb, 0x03, - 0x82, 0x2f, 0xe2, 0xb5, 0x50, 0xfa, 0x65, 0x41, 0xce, 0x6a, 0xeb, 0xd0, 0x06, 0x23, 0xec, 0xb7, - 0x98, 0x90, 0x93, 0x5e, 0xed, 0x1d, 0x85, 0xe0, 0x11, 0x0f, 0x44, 0x0a, 0x5b, 0x6d, 0x49, 0x3f, - 0x44, 0x93, 0xab, 0x87, 0x1b, 0xd6, 0x30, 0x31, 0xc7, 0xc4, 0x5a, 0x26, 0xf6, 0x04, 0x4a, 0xcf, - 0xfb, 0xbb, 0x9f, 0x5b, 0x6f, 0xd9, 0xc6, 0xdd, 0xb7, 0x56, 0xa5, 0xd2, 0x58, 0x91, 0x66, 0xe4, - 0x3c, 0x44, 0x93, 0xde, 0xf2, 0x28, 0x8c, 0xef, 0xb1, 0xbf, 0xe8, 0x66, 0x8c, 0xb0, 0x7f, 0xe0, - 0x34, 0x04, 0x85, 0x3d, 0x47, 0xd0, 0x09, 0xf3, 0xe7, 0x5d, 0x49, 0xd1, 0xbe, 0xa4, 0xe8, 0xb7, - 0xa4, 0xe8, 0xb3, 0xa2, 0xde, 0xbe, 0xa2, 0xde, 0x77, 0x45, 0xbd, 0x57, 0x96, 0x28, 0xbb, 0xde, - 0x46, 0x2c, 0x86, 0x94, 0x9f, 0x9c, 0xa0, 0x98, 0xf1, 0xf7, 0x93, 0x3b, 0xd8, 0x8f, 0x4c, 0x9a, - 0x68, 0x50, 0x6f, 0x6d, 0xf6, 0x17, 0x00, 0x00, 0xff, 0xff, 0x90, 0xb7, 0x12, 0x3c, 0xb0, 0x01, - 0x00, 0x00, + // 300 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x4e, 0xf3, 0x30, + 0x14, 0x85, 0xe3, 0x3f, 0xfd, 0xab, 0xc6, 0x2c, 0x28, 0x62, 0x30, 0x55, 0x65, 0xa2, 0x2e, 0x94, + 0xc5, 0x56, 0x01, 0x89, 0xbd, 0x74, 0x40, 0x8c, 0x1d, 0xd9, 0x9c, 0xd6, 0x0a, 0x16, 0x8d, 0x6f, + 0x14, 0x3b, 0x11, 0xbc, 0x05, 0xef, 0xc0, 0xcb, 0x74, 0xec, 0xc8, 0x84, 0x50, 0xf2, 0x22, 0xc8, + 0x49, 0x48, 0xe9, 0x74, 0xed, 0x73, 0x8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, 0x6f, 0x5f, + 0x53, 0xef, 0xb3, 0xa6, 0xde, 0x13, 0x4b, 0x94, 0x7d, 0x2e, 0x62, 0xb6, 0x86, 0x94, 0x1f, 0xd5, + 0x5d, 0xde, 0xf2, 0xd7, 0xa3, 0xce, 0xed, 0x5b, 0x26, 0x4d, 0x3c, 0x6c, 0x1a, 0xba, 0xf9, 0x09, + 0x00, 0x00, 0xff, 0xff, 0x97, 0xd6, 0x5f, 0xd7, 0x9c, 0x01, 0x00, 0x00, } func (m *Delegation) Marshal() (dAtA []byte, err error) { @@ -219,13 +210,6 @@ func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintDelegate(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x12 - } if len(m.Provider) > 0 { i -= len(m.Provider) copy(dAtA[i:], m.Provider) @@ -289,10 +273,6 @@ func (m *Delegation) Size() (n int) { if l > 0 { n += 1 + l + sovDelegate(uint64(l)) } - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovDelegate(uint64(l)) - } l = len(m.Delegator) if l > 0 { n += 1 + l + sovDelegate(uint64(l)) @@ -387,38 +367,6 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { } m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDelegate - } - 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 ErrInvalidLengthDelegate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDelegate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) diff --git a/x/dualstaking/types/delegator_reward.pb.go b/x/dualstaking/types/delegator_reward.pb.go index 3f6469da51..fd056fc316 100644 --- a/x/dualstaking/types/delegator_reward.pb.go +++ b/x/dualstaking/types/delegator_reward.pb.go @@ -28,7 +28,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type DelegatorReward struct { Delegator string `protobuf:"bytes,1,opt,name=delegator,proto3" json:"delegator,omitempty"` Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } @@ -79,13 +78,6 @@ func (m *DelegatorReward) GetProvider() string { return "" } -func (m *DelegatorReward) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - func (m *DelegatorReward) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { return m.Amount @@ -102,26 +94,26 @@ func init() { } var fileDescriptor_c8b6da054bf40d1f = []byte{ - // 301 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x50, 0xbd, 0x4e, 0xf3, 0x30, - 0x14, 0x8d, 0xbf, 0x7e, 0x2a, 0xad, 0x19, 0x90, 0x22, 0x86, 0xb4, 0x42, 0x6e, 0xc5, 0xd4, 0x05, - 0x9b, 0xd2, 0x37, 0x28, 0x0c, 0xb0, 0x76, 0x64, 0xa9, 0x9c, 0xd8, 0x4a, 0xad, 0xb6, 0xbe, 0x95, - 0xed, 0x04, 0x78, 0x0b, 0x9e, 0x83, 0x27, 0xa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 0xa3, 0x1e, 0x57, 0x56, - 0x2c, 0x99, 0x7b, 0xd9, 0x48, 0xeb, 0x09, 0x76, 0xd6, 0x48, 0x4f, 0xef, 0xb7, 0x05, 0x41, 0xbb, - 0x82, 0xa0, 0xef, 0x82, 0xa0, 0xd7, 0x92, 0x04, 0xbb, 0x92, 0x04, 0x1f, 0x25, 0x09, 0x1e, 0xe9, - 0x81, 0xd6, 0x51, 0xe7, 0xf9, 0x84, 0x3d, 0x1f, 0x15, 0xef, 0x75, 0xe3, 0xb6, 0xaf, 0x67, 0xf2, - 0x13, 0x00, 0x00, 0xff, 0xff, 0x46, 0xff, 0xf5, 0xaa, 0xa1, 0x01, 0x00, 0x00, + // 292 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x31, 0x4e, 0xfb, 0x30, + 0x18, 0xc5, 0xe3, 0x7f, 0xa3, 0xaa, 0xcd, 0x7f, 0x00, 0x45, 0x0c, 0x21, 0x42, 0x6e, 0xc5, 0x94, + 0x05, 0x9b, 0x02, 0x27, 0x28, 0x0c, 0x88, 0x31, 0x23, 0x0b, 0x72, 0x12, 0x2b, 0x44, 0x4d, 0xfc, + 0x45, 0xb6, 0x13, 0xe0, 0x16, 0x9c, 0x83, 0x03, 0x70, 0x86, 0x8e, 0x1d, 0x99, 0x00, 0x25, 0x17, + 0x41, 0x71, 0x42, 0x69, 0xa7, 0x67, 0xfb, 0xfb, 0xde, 0xfb, 0x59, 0xcf, 0xa1, 0x39, 0xab, 0x99, + 0xe0, 0xda, 0x28, 0x4d, 0x2a, 0x96, 0x2b, 0xcd, 0x56, 0x99, 0x48, 0x69, 0xc2, 0x73, 0x9e, 0x32, + 0x0d, 0xf2, 0x41, 0xf2, 0x27, 0x26, 0x13, 0x52, 0x4a, 0xd0, 0xe0, 0x7a, 0x83, 0x81, 0x74, 0x4a, + 0x76, 0x0c, 0xfe, 0x51, 0x0a, 0x29, 0x98, 0x25, 0xda, 0x9d, 0xfa, 0x7d, 0x1f, 0xc7, 0xa0, 0x0a, + 0x50, 0x34, 0x62, 0x8a, 0xd3, 0x7a, 0x11, 0x71, 0xcd, 0x16, 0x34, 0x86, 0x4c, 0xf4, 0xf3, 0xd3, + 0x77, 0xe4, 0x1c, 0xdc, 0xfc, 0xa2, 0x42, 0x43, 0x72, 0x4f, 0x9c, 0xe9, 0x96, 0xee, 0xa1, 0x39, + 0x0a, 0xa6, 0xe1, 0xdf, 0x83, 0xeb, 0x3b, 0x93, 0x52, 0x42, 0x9d, 0x25, 0x5c, 0x7a, 0xff, 0xcc, + 0x70, 0x7b, 0x77, 0x63, 0x67, 0xcc, 0x0a, 0xa8, 0x84, 0xf6, 0xec, 0xf9, 0x28, 0xf8, 0x7f, 0x71, + 0x4c, 0x7a, 0x3c, 0xe9, 0xf0, 0x64, 0xc0, 0x93, 0x6b, 0xc8, 0xc4, 0xf2, 0x7c, 0xfd, 0x39, 0xb3, + 0xde, 0xbe, 0x66, 0x41, 0x9a, 0xe9, 0xc7, 0x2a, 0x22, 0x31, 0x14, 0x74, 0xf8, 0x6b, 0x2f, 0x67, + 0x2a, 0x59, 0x51, 0xfd, 0x52, 0x72, 0x65, 0x0c, 0x2a, 0x1c, 0xa2, 0xef, 0xec, 0xc9, 0xe8, 0xd0, + 0x5e, 0xde, 0xae, 0x1b, 0x8c, 0x36, 0x0d, 0x46, 0xdf, 0x0d, 0x46, 0xaf, 0x2d, 0xb6, 0x36, 0x2d, + 0xb6, 0x3e, 0x5a, 0x6c, 0xdd, 0x93, 0x9d, 0xc4, 0xbd, 0x7a, 0xeb, 0x2b, 0xfa, 0xbc, 0xd7, 0xb1, + 0x49, 0x8f, 0xc6, 0xa6, 0x89, 0xcb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x87, 0x8d, 0x96, 0xde, + 0x8c, 0x01, 0x00, 0x00, } func (m *DelegatorReward) Marshal() (dAtA []byte, err error) { @@ -158,13 +150,6 @@ func (m *DelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintDelegatorReward(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x1a - } if len(m.Provider) > 0 { i -= len(m.Provider) copy(dAtA[i:], m.Provider) @@ -207,10 +192,6 @@ func (m *DelegatorReward) Size() (n int) { if l > 0 { n += 1 + l + sovDelegatorReward(uint64(l)) } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovDelegatorReward(uint64(l)) - } if len(m.Amount) > 0 { for _, e := range m.Amount { l = e.Size() @@ -319,38 +300,6 @@ func (m *DelegatorReward) Unmarshal(dAtA []byte) error { } m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDelegatorReward - } - 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 ErrInvalidLengthDelegatorReward - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDelegatorReward - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) diff --git a/x/dualstaking/types/expected_keepers.go b/x/dualstaking/types/expected_keepers.go index cd454a6c2f..07ea58ebae 100644 --- a/x/dualstaking/types/expected_keepers.go +++ b/x/dualstaking/types/expected_keepers.go @@ -8,9 +8,9 @@ import ( 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/v3/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -38,6 +38,8 @@ type EpochstorageKeeper interface { GetCurrentNextEpoch(ctx sdk.Context) (nextEpoch uint64) RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, address string) GetStakeEntry(ctx sdk.Context, epoch uint64, chainID string, provider string) (val epochstoragetypes.StakeEntry, found bool) + GetMetadata(ctx sdk.Context, provider string) (epochstoragetypes.ProviderMetadata, error) + SetMetadata(ctx sdk.Context, metadata epochstoragetypes.ProviderMetadata) // Methods imported from epochstorage should be defined here } diff --git a/x/dualstaking/types/genesis.go b/x/dualstaking/types/genesis.go index aefa38b541..1dc916c630 100644 --- a/x/dualstaking/types/genesis.go +++ b/x/dualstaking/types/genesis.go @@ -2,8 +2,6 @@ package types import ( fmt "fmt" - - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" ) // DefaultIndex is the default global index @@ -15,8 +13,7 @@ func DefaultGenesis() *GenesisState { // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), DelegatorRewardList: []DelegatorReward{}, - DelegationsFS: *fixationstoretypes.DefaultGenesis(), - DelegatorsFS: *fixationstoretypes.DefaultGenesis(), + Delegations: []Delegation{}, } } @@ -27,12 +24,23 @@ func (gs GenesisState) Validate() error { delegatorRewardIndexMap := make(map[string]struct{}) for _, elem := range gs.DelegatorRewardList { - index := DelegationKey(elem.Provider, elem.Delegator, elem.ChainId) + key := DelegationKey(elem.Provider, elem.Delegator) + index := key.K1() + key.K2() if _, ok := delegatorRewardIndexMap[index]; ok { return fmt.Errorf("duplicated index for delegatorReward") } delegatorRewardIndexMap[index] = struct{}{} } + + delegationIndexMap := make(map[string]struct{}) + for _, elem := range gs.Delegations { + key := DelegationKey(elem.Provider, elem.Delegator) + index := key.K1() + key.K2() + if _, ok := delegationIndexMap[index]; ok { + return fmt.Errorf("duplicated index for delegations") + } + delegationIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/dualstaking/types/genesis.pb.go b/x/dualstaking/types/genesis.pb.go index 1c48861d97..5b2538efa9 100644 --- a/x/dualstaking/types/genesis.pb.go +++ b/x/dualstaking/types/genesis.pb.go @@ -7,8 +7,6 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/fixationstore/types" - _ "github.com/lavanet/lava/v3/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -27,10 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the dualstaking module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - DelegationsFS types.GenesisState `protobuf:"bytes,2,opt,name=delegationsFS,proto3" json:"delegationsFS"` - DelegatorsFS types.GenesisState `protobuf:"bytes,3,opt,name=delegatorsFS,proto3" json:"delegatorsFS"` - DelegatorRewardList []DelegatorReward `protobuf:"bytes,5,rep,name=delegator_reward_list,json=delegatorRewardList,proto3" json:"delegator_reward_list"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + DelegatorRewardList []DelegatorReward `protobuf:"bytes,5,rep,name=delegator_reward_list,json=delegatorRewardList,proto3" json:"delegator_reward_list"` + Delegations []Delegation `protobuf:"bytes,6,rep,name=Delegations,proto3" json:"Delegations"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -73,23 +70,16 @@ func (m *GenesisState) GetParams() Params { return Params{} } -func (m *GenesisState) GetDelegationsFS() types.GenesisState { - if m != nil { - return m.DelegationsFS - } - return types.GenesisState{} -} - -func (m *GenesisState) GetDelegatorsFS() types.GenesisState { +func (m *GenesisState) GetDelegatorRewardList() []DelegatorReward { if m != nil { - return m.DelegatorsFS + return m.DelegatorRewardList } - return types.GenesisState{} + return nil } -func (m *GenesisState) GetDelegatorRewardList() []DelegatorReward { +func (m *GenesisState) GetDelegations() []Delegation { if m != nil { - return m.DelegatorRewardList + return m.Delegations } return nil } @@ -103,28 +93,27 @@ func init() { } var fileDescriptor_d5bca863c53f218f = []byte{ - // 336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0x4f, 0x4b, 0xc3, 0x30, - 0x18, 0xc6, 0xdb, 0xfd, 0x43, 0xba, 0x09, 0x52, 0x15, 0xca, 0x0e, 0x75, 0x28, 0xca, 0x76, 0x49, - 0x60, 0xbb, 0x7b, 0x18, 0xa2, 0x22, 0x1e, 0x64, 0xf3, 0xe4, 0x65, 0x64, 0x6b, 0x8c, 0xc1, 0xae, - 0x19, 0xc9, 0xbb, 0x39, 0xbf, 0x85, 0x1f, 0x6b, 0xc7, 0x1d, 0x3d, 0x89, 0xac, 0x5f, 0x44, 0x9a, - 0xc6, 0xb1, 0x08, 0xbd, 0x78, 0x4a, 0x5a, 0x7e, 0xcf, 0x2f, 0x79, 0xf2, 0x7a, 0x17, 0x31, 0x59, - 0x90, 0x84, 0x02, 0xce, 0x56, 0x1c, 0xcd, 0x49, 0xac, 0x80, 0xbc, 0xf2, 0x84, 0x61, 0x46, 0x13, - 0xaa, 0xb8, 0x42, 0x33, 0x29, 0x40, 0xf8, 0x81, 0xe1, 0x50, 0xb6, 0xa2, 0x1d, 0xae, 0x79, 0xc4, - 0x04, 0x13, 0x1a, 0xc2, 0xd9, 0x2e, 0xe7, 0x9b, 0xe7, 0x85, 0xde, 0x19, 0x91, 0x64, 0x6a, 0xb4, - 0xcd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, 0x4b, 0x6b, 0x80, 0xf0, 0x3e, 0xa3, 0x6a, 0x5c, 0xd3, - 0x63, 0xeb, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x08, 0x1d, 0xa0, 0x30, 0xb8, 0x02, 0x00, 0x00, + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcb, 0x49, 0x2c, 0x4b, + 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x29, 0xa5, 0x89, 0x39, 0xc5, 0x25, 0x89, 0xd9, 0x99, + 0x79, 0xe9, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, + 0x42, 0x12, 0x50, 0x75, 0x7a, 0x20, 0x5a, 0x0f, 0x49, 0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, + 0x58, 0x91, 0x3e, 0x88, 0x05, 0x51, 0x2f, 0xa5, 0x8a, 0xd3, 0xdc, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, + 0xa8, 0xb1, 0x52, 0xfa, 0x38, 0x95, 0xa5, 0xa4, 0xe6, 0xa4, 0xa6, 0x27, 0x96, 0xe4, 0x17, 0xc5, + 0x17, 0xa5, 0x96, 0x27, 0x16, 0xa5, 0x40, 0x35, 0xa8, 0x13, 0xd2, 0x90, 0x0a, 0x51, 0xa8, 0x34, + 0x99, 0x89, 0x8b, 0xc7, 0x1d, 0xe2, 0x85, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x3b, 0x2e, 0x36, + 0x88, 0xd5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x0a, 0x7a, 0xb8, 0xbc, 0xa4, 0x17, 0x00, + 0x56, 0xe7, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0x97, 0x50, 0x32, 0x97, 0x28, 0xba, + 0x9b, 0xe2, 0x73, 0x32, 0x8b, 0x4b, 0x24, 0x58, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x34, 0x71, 0x1b, + 0xe7, 0x02, 0xd3, 0x16, 0x04, 0xd6, 0x05, 0x35, 0x57, 0x38, 0x05, 0x55, 0xd8, 0x27, 0xb3, 0xb8, + 0x44, 0xc8, 0x87, 0x8b, 0x1b, 0xaa, 0x3a, 0x33, 0x3f, 0xaf, 0x58, 0x82, 0x0d, 0x6c, 0xb4, 0x0a, + 0x41, 0xa3, 0x33, 0xf3, 0xf3, 0xa0, 0xa6, 0x22, 0x6b, 0xf7, 0x62, 0xe1, 0x60, 0x12, 0x60, 0xf6, + 0x62, 0xe1, 0x60, 0x16, 0x60, 0xf1, 0x62, 0xe1, 0x60, 0x11, 0x60, 0x75, 0xf2, 0x38, 0xf1, 0x48, + 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, + 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, + 0xe4, 0xfc, 0x5c, 0xd4, 0x48, 0x29, 0x33, 0xd1, 0xaf, 0x40, 0x09, 0xe8, 0x92, 0xca, 0x82, 0xd4, + 0xe2, 0x24, 0x36, 0x70, 0x30, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x9e, 0xc7, 0x33, + 0x41, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -147,6 +136,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Delegations) > 0 { + for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } if len(m.DelegatorRewardList) > 0 { for iNdEx := len(m.DelegatorRewardList) - 1; iNdEx >= 0; iNdEx-- { { @@ -161,26 +164,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x2a } } - { - size, err := m.DelegatorsFS.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.DelegationsFS.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -213,16 +196,18 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) - l = m.DelegationsFS.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.DelegatorsFS.Size() - n += 1 + l + sovGenesis(uint64(l)) if len(m.DelegatorRewardList) > 0 { for _, e := range m.DelegatorRewardList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.Delegations) > 0 { + for _, e := range m.Delegations { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -294,42 +279,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegationsFS", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegationsFS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorsFS", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorRewardList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -356,13 +308,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DelegatorsFS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DelegatorRewardList = append(m.DelegatorRewardList, DelegatorReward{}) + if err := m.DelegatorRewardList[len(m.DelegatorRewardList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorRewardList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -389,8 +342,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegatorRewardList = append(m.DelegatorRewardList, DelegatorReward{}) - if err := m.DelegatorRewardList[len(m.DelegatorRewardList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Delegations = append(m.Delegations, Delegation{}) + if err := m.Delegations[len(m.Delegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/dualstaking/types/genesis_test.go b/x/dualstaking/types/genesis_test.go index 48751c24af..2d12e1a4a8 100644 --- a/x/dualstaking/types/genesis_test.go +++ b/x/dualstaking/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/dualstaking/types" "github.com/stretchr/testify/require" ) @@ -25,12 +25,10 @@ func TestGenesisState_Validate(t *testing.T) { { Provider: "p0", Delegator: "d0", - ChainId: "c0", }, { Provider: "p1", Delegator: "d1", - ChainId: "c1", }, }, // this line is used by starport scaffolding # types/genesis/validField @@ -44,12 +42,10 @@ func TestGenesisState_Validate(t *testing.T) { { Provider: "p0", Delegator: "d0", - ChainId: "c0", }, { Provider: "p0", Delegator: "d0", - ChainId: "c0", }, }, }, diff --git a/x/dualstaking/types/key_delegator_reward.go b/x/dualstaking/types/key_delegator_reward.go deleted file mode 100644 index 7bf7db8cb7..0000000000 --- a/x/dualstaking/types/key_delegator_reward.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // DelegatorRewardKeyPrefix is the prefix to retrieve all DelegatorReward - DelegatorRewardKeyPrefix = "DelegatorReward/value/" -) - -// DelegatorRewardKey returns the store key to retrieve a DelegatorReward from the index fields -func DelegatorRewardKey( - index string, -) []byte { - var key []byte - - indexBytes := []byte(index) - key = append(key, indexBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/dualstaking/types/keys.go b/x/dualstaking/types/keys.go index b8aaa80a3e..73c73a8849 100644 --- a/x/dualstaking/types/keys.go +++ b/x/dualstaking/types/keys.go @@ -1,7 +1,7 @@ package types import ( - "strings" + "cosmossdk.io/collections" ) const ( @@ -17,15 +17,6 @@ const ( // MemStoreKey defines the in-memory store key MemStoreKey = "mem_dualstaking" - // prefix for the delegations fixation store - DelegationPrefix = "delegation-fs" - - // prefix for the delegators fixation store - DelegatorPrefix = "delegator-fs" - - // prefix for the unbonding timer store - UnbondingPrefix = "unbonding-ts" - // DisableDualstakingHooks prefix DisableDualstakingHookPrefix = "disable-dualstaking-hooks" @@ -37,24 +28,11 @@ func KeyPrefix(p string) []byte { return []byte(p) } -// DelegationKey returns the key/prefix for the Delegation entry in fixation store. -// Using " " (space) as spearator is safe because Bech32 forbids its use as part of -// the address (and is the only visible character that can be safely used). -// (reference https://en.bitcoin.it/wiki/BIP_0173#Specification) -func DelegationKey(provider, delegator, chainID string) string { - return provider + " " + delegator + " " + chainID -} - -func DelegationKeyDecode(prefix string) (provider, delegator, chainID string) { - split := strings.Split(prefix, " ") - return split[0], split[1], split[2] +func DelegationKey(provider, delegator string) collections.Pair[string, string] { + return collections.Join(provider, delegator) } -// DelegatorKey returns the key/prefix for the Delegator entry in fixation store. -func DelegatorKey(delegator string) string { - return delegator -} - -func DelegatorKeyDecode(prefix string) (delegator string) { - return prefix -} +var ( + DelegationsPrefix = collections.NewPrefix([]byte("Delegations/")) + RewardPrefix = collections.NewPrefix([]byte("Rewards/")) +) diff --git a/x/dualstaking/types/message_claim_rewards.go b/x/dualstaking/types/message_claim_rewards.go index 03317addd6..e84df5b8a8 100644 --- a/x/dualstaking/types/message_claim_rewards.go +++ b/x/dualstaking/types/message_claim_rewards.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const TypeMsgClaimRewards = "claim_rewards" diff --git a/x/dualstaking/types/message_claim_rewards_test.go b/x/dualstaking/types/message_claim_rewards_test.go index 6b5f31f80d..46a287a187 100644 --- a/x/dualstaking/types/message_claim_rewards_test.go +++ b/x/dualstaking/types/message_claim_rewards_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/types/message_delegate.go b/x/dualstaking/types/message_delegate.go index 42de9f6c40..49d599d613 100644 --- a/x/dualstaking/types/message_delegate.go +++ b/x/dualstaking/types/message_delegate.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const TypeMsgDelegate = "delegate" diff --git a/x/dualstaking/types/message_delegate_test.go b/x/dualstaking/types/message_delegate_test.go index c58d392d9d..f93768ef04 100644 --- a/x/dualstaking/types/message_delegate_test.go +++ b/x/dualstaking/types/message_delegate_test.go @@ -5,8 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) @@ -26,7 +25,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, @@ -37,7 +36,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: "invalid_address", Amount: oneCoin, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, @@ -48,7 +47,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, }, { @@ -58,7 +57,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidCoins, }, @@ -69,7 +68,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: "invalid_validator", - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, diff --git a/x/dualstaking/types/message_redelegate.go b/x/dualstaking/types/message_redelegate.go index b354c148a1..798c945eb8 100644 --- a/x/dualstaking/types/message_redelegate.go +++ b/x/dualstaking/types/message_redelegate.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const TypeMsgRedelegate = "redelegate" diff --git a/x/dualstaking/types/message_redelegate_test.go b/x/dualstaking/types/message_redelegate_test.go index 164f97457d..bade24e0c1 100644 --- a/x/dualstaking/types/message_redelegate_test.go +++ b/x/dualstaking/types/message_redelegate_test.go @@ -5,8 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) @@ -25,8 +24,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), Amount: oneCoin, - FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, - ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, + FromChainID: "", + ToChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, { @@ -36,8 +35,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: "invalid_address", ToProvider: sample.AccAddress(), Amount: oneCoin, - FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, - ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, + FromChainID: "", + ToChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, { @@ -47,8 +46,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), Amount: oneCoin, - FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, - ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, + FromChainID: "", + ToChainID: "", }, }, { name: "invalid amount", @@ -57,8 +56,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, - FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, - ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, + FromChainID: "", + ToChainID: "", }, err: legacyerrors.ErrInvalidCoins, }, diff --git a/x/dualstaking/types/message_unbond.go b/x/dualstaking/types/message_unbond.go index 81b3f10e97..76f7213b6a 100644 --- a/x/dualstaking/types/message_unbond.go +++ b/x/dualstaking/types/message_unbond.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const TypeMsgUnbond = "unbond" diff --git a/x/dualstaking/types/message_unbond_test.go b/x/dualstaking/types/message_unbond_test.go index b18ba40cce..9da5662f4a 100644 --- a/x/dualstaking/types/message_unbond_test.go +++ b/x/dualstaking/types/message_unbond_test.go @@ -5,8 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) @@ -26,7 +25,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, @@ -37,7 +36,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: "invalid_address", Amount: oneCoin, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, @@ -48,7 +47,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: "invalid_validator", - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidAddress, }, @@ -59,7 +58,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, }, { @@ -69,7 +68,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, Validator: validator, - ChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ChainID: "", }, err: legacyerrors.ErrInvalidCoins, }, diff --git a/x/dualstaking/types/params.go b/x/dualstaking/types/params.go index 6644bacea6..57628469f0 100644 --- a/x/dualstaking/types/params.go +++ b/x/dualstaking/types/params.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" "gopkg.in/yaml.v2" ) diff --git a/x/dualstaking/types/params.pb.go b/x/dualstaking/types/params.pb.go index 442e098599..8fdc795cb9 100644 --- a/x/dualstaking/types/params.pb.go +++ b/x/dualstaking/types/params.pb.go @@ -123,25 +123,25 @@ func init() { } var fileDescriptor_df864e1276b03c21 = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x3f, 0x4b, 0xc3, 0x40, - 0x18, 0xc6, 0x73, 0x58, 0x0a, 0x9e, 0x53, 0xab, 0x43, 0xed, 0x70, 0x2d, 0x05, 0xa1, 0xd3, 0x1d, - 0x35, 0x9b, 0x63, 0x75, 0x70, 0x53, 0x5a, 0x70, 0x70, 0x09, 0x6f, 0x92, 0x6b, 0x7a, 0x78, 0xb9, - 0x37, 0xe4, 0xae, 0x41, 0xbf, 0x85, 0xa3, 0xa3, 0x1f, 0xa7, 0x63, 0x47, 0x27, 0x91, 0xe4, 0x8b, - 0x48, 0x92, 0x52, 0xda, 0xe9, 0xb9, 0x3f, 0xbf, 0xf7, 0x07, 0xef, 0x43, 0x6f, 0x34, 0x14, 0x60, - 0xa4, 0x13, 0x75, 0x8a, 0x78, 0x03, 0xda, 0x3a, 0x78, 0x53, 0x26, 0x11, 0x19, 0xe4, 0x90, 0x5a, - 0x9e, 0xe5, 0xe8, 0xb0, 0x3f, 0xd8, 0x63, 0xbc, 0x4e, 0x7e, 0x84, 0x0d, 0xaf, 0x12, 0x4c, 0xb0, - 0x81, 0x44, 0x7d, 0x6a, 0xf9, 0x21, 0x8b, 0xd0, 0xa6, 0x68, 0x45, 0x08, 0x56, 0x8a, 0x62, 0x16, - 0x4a, 0x07, 0x33, 0x11, 0xa1, 0x32, 0xed, 0xff, 0x24, 0xa0, 0xdd, 0xe7, 0xc6, 0xdf, 0x7f, 0xa2, - 0x97, 0xa9, 0x32, 0x81, 0x95, 0x7a, 0x15, 0xc4, 0x52, 0xcb, 0x04, 0x9c, 0x42, 0x33, 0x20, 0x63, - 0x32, 0xbd, 0xb8, 0xbd, 0xe6, 0xad, 0x87, 0xd7, 0x1e, 0xbe, 0xf7, 0xf0, 0x7b, 0x54, 0x66, 0xde, - 0xd9, 0xfe, 0x8e, 0xbc, 0x45, 0x2f, 0x55, 0x66, 0x29, 0xf5, 0xea, 0xe1, 0x30, 0x79, 0xd7, 0xf9, - 0xfa, 0x1e, 0x79, 0x13, 0x9f, 0xf6, 0x96, 0x1a, 0xec, 0x5a, 0xc6, 0x2f, 0xa0, 0x55, 0x0c, 0x0e, - 0x73, 0xdb, 0x67, 0x94, 0x16, 0x87, 0xdb, 0x80, 0x8c, 0xcf, 0xa6, 0xe7, 0x8b, 0xa3, 0x97, 0xf9, - 0xe3, 0xb6, 0x64, 0x64, 0x57, 0x32, 0xf2, 0x57, 0x32, 0xf2, 0x59, 0x31, 0x6f, 0x57, 0x31, 0xef, - 0xa7, 0x62, 0xde, 0x2b, 0x4f, 0x94, 0x5b, 0x6f, 0x42, 0x1e, 0x61, 0x2a, 0x4e, 0x1a, 0x2b, 0x7c, - 0xf1, 0x7e, 0x52, 0x9b, 0xfb, 0xc8, 0xa4, 0x0d, 0xbb, 0xcd, 0x9a, 0xfe, 0x7f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x9a, 0xb3, 0x87, 0x76, 0x5f, 0x01, 0x00, 0x00, + // 283 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbd, 0x4e, 0xf3, 0x30, + 0x14, 0x86, 0x63, 0x7d, 0x55, 0xa5, 0xcf, 0x4c, 0x2d, 0x0c, 0xa1, 0x83, 0x5b, 0x55, 0x42, 0xea, + 0x64, 0xab, 0x94, 0x89, 0xb1, 0x30, 0xb0, 0x81, 0x5a, 0x89, 0x81, 0x25, 0x3a, 0x49, 0xdc, 0xd4, + 0xc2, 0xf1, 0x89, 0x62, 0x37, 0x82, 0xbb, 0x60, 0x64, 0xe4, 0x72, 0x3a, 0x76, 0x64, 0x42, 0x28, + 0xb9, 0x11, 0x94, 0xa4, 0xaa, 0xda, 0xe9, 0xf5, 0xcf, 0x73, 0x1e, 0xe9, 0xbc, 0xf4, 0x4a, 0x43, + 0x01, 0x46, 0x3a,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x6e, 0xb3, 0xe6, 0xec, 0x2f, 0x00, + 0x00, 0xff, 0xff, 0x27, 0xba, 0xe1, 0x84, 0x5f, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/dualstaking/types/query.pb.go b/x/dualstaking/types/query.pb.go index e572f9b124..2c9bacbfb7 100644 --- a/x/dualstaking/types/query.pb.go +++ b/x/dualstaking/types/query.pb.go @@ -413,7 +413,6 @@ func (m *QueryDelegatorRewardsResponse) GetRewards() []DelegatorRewardInfo { type DelegatorRewardInfo struct { Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } @@ -457,13 +456,6 @@ func (m *DelegatorRewardInfo) GetProvider() string { return "" } -func (m *DelegatorRewardInfo) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - func (m *DelegatorRewardInfo) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { return m.Amount @@ -488,53 +480,52 @@ func init() { } var fileDescriptor_8393eed0cfbc46b2 = []byte{ - // 722 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0x4f, 0x4f, 0x13, 0x4f, - 0x18, 0xc7, 0x3b, 0xe5, 0xf7, 0x2b, 0x30, 0xf5, 0x60, 0x06, 0x0e, 0xa5, 0xc1, 0xa5, 0x6e, 0x30, - 0x36, 0x46, 0x76, 0x04, 0x12, 0x01, 0x4d, 0xfc, 0x83, 0x1c, 0x24, 0x81, 0x88, 0x4d, 0xb8, 0x78, - 0x69, 0xa6, 0xdd, 0x71, 0x99, 0xd0, 0xce, 0x2c, 0x3b, 0xd3, 0x22, 0x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a2, 0x00, 0x4a, 0xa0, 0x9c, 0x9f, 0x2b, 0x39, 0x69, 0xf7, 0xe4, 0x44, 0x95, 0xcb, 0xff, - 0x1d, 0x1e, 0x4f, 0x65, 0x2a, 0xa6, 0xca, 0x26, 0xd0, 0xd2, 0x6d, 0x57, 0xa2, 0x19, 0x45, 0xb0, - 0x11, 0x88, 0x36, 0x73, 0x69, 0x10, 0x0b, 0xa3, 0x49, 0x38, 0xea, 0xc6, 0x87, 0x5a, 0x64, 0xb4, - 0xf2, 0x27, 0x80, 0x6e, 0xc2, 0x6b, 0xbb, 0x4c, 0x6d, 0x55, 0x7d, 0xca, 0x5d, 0xc6, 0xbd, 0x42, - 0xb6, 0x04, 0xca, 0x23, 0x95, 0x7c, 0x18, 0xdb, 0x88, 0x42, 0xb6, 0x80, 0x53, 0xa9, 0x12, 0x86, - 0x62, 0x0d, 0xe6, 0x4d, 0xcb, 0x70, 0x47, 0x05, 0x50, 0x1a, 0x2a, 0xe7, 0xe7, 0xa6, 0xd3, 0x51, - 0x56, 0x3a, 0xc9, 0x06, 0x27, 0x59, 0x6e, 0x57, 0x0d, 0x53, 0xac, 0xd3, 0x11, 0xee, 0x30, 0x15, - 0xe1, 0x88, 0x6f, 0x0e, 0x0d, 0x52, 0xe7, 0xf7, 0x65, 0x88, 0xce, 0x13, 0xf8, 0x2b, 0x44, 0x12, - 0x4e, 0x76, 0x5f, 0x61, 0x85, 0xee, 0x92, 0xc0, 0x1d, 0x70, 0x47, 0x49, 0xda, 0xec, 0x19, 0xda, - 0x09, 0x38, 0x52, 0xdf, 0x22, 0x8c, 0x57, 0x99, 0x5b, 0x18, 0xd2, 0x67, 0xc3, 0xfa, 0xf7, 0xaa, - 0x6b, 0x73, 0x78, 0x23, 0x45, 0xd4, 0x30, 0xae, 0xc3, 0xe1, 0x20, 0x0a, 0x19, 0xbe, 0x99, 0xbe, - 0x7c, 0x71, 0x93, 0x55, 0xfe, 0x5a, 0x18, 0xd0, 0xb8, 0x87, 0xf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0x7d, - 0x07, 0xf0, 0xfa, 0x59, 0x63, 0xa1, 0xfb, 0x83, 0x5e, 0x70, 0xb7, 0xfd, 0x8b, 0x0b, 0x97, 0xae, - 0x33, 0x1c, 0x9b, 0x9a, 0xe3, 0x05, 0x5a, 0x1f, 0x64, 0x2d, 0xc6, 0xa7, 0xc9, 0xa5, 0x24, 0x88, - 0xf0, 0x7e, 0x6c, 0xc4, 0x03, 0x74, 0x08, 0xe0, 0xf8, 0x59, 0xcd, 0x35, 0x26, 0xd5, 0xbf, 0x07, - 0x7c, 0xac, 0x01, 0x97, 0xd0, 0xc2, 0x15, 0x01, 0x97, 0x9f, 0x1f, 0x9e, 0x58, 0xe0, 0xe8, 0xc4, - 0x02, 0x3f, 0x4f, 0x2c, 0xf0, 0xfe, 0xd4, 0xca, 0x1c, 0x9d, 0x5a, 0x99, 0x6f, 0xa7, 0x56, 0xe6, - 0x95, 0x93, 0x78, 0x2c, 0xba, 0x9a, 0xb7, 0xe7, 0xf1, 0x9b, 0x2e, 0x05, 0xfd, 0x70, 0xd4, 0x72, - 0xfa, 0xbf, 0xfb, 0xfc, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x54, 0x32, 0x8e, 0xef, 0x08, - 0x00, 0x00, + // 720 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0xbb, 0x2d, 0x96, 0x32, 0xf5, 0x40, 0x06, 0x0e, 0xa5, 0xc1, 0xa5, 0x6e, 0x30, 0x36, + 0x46, 0x76, 0x04, 0x8d, 0x80, 0x26, 0xfe, 0x40, 0x0e, 0x62, 0x20, 0x62, 0x13, 0x2e, 0x5e, 0x9a, + 0x69, 0x77, 0x5c, 0x26, 0xb4, 0x33, 0xcb, 0xce, 0xb4, 0x48, 0x08, 0x17, 0xff, 0x01, 0x4d, 0xbc, + 0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 0x17, 0xdc, 0xed, 0xf4, 0xe2, 0xfc, 0x85, 0xeb, 0x34, 0xc7, 0x86, + 0xe2, 0x78, 0x09, 0xd7, 0x06, 0x59, 0x8b, 0xb6, 0x64, 0x7c, 0x29, 0x31, 0x22, 0xb4, 0x17, 0x3d, + 0x19, 0xfb, 0xf0, 0xc0, 0x00, 0xe3, 0xa7, 0x35, 0x57, 0xa9, 0x90, 0xff, 0x1f, 0xf0, 0xb1, 0x02, + 0x5c, 0x84, 0xf3, 0x97, 0x04, 0x5c, 0x7a, 0x7e, 0x70, 0x6c, 0x1a, 0x87, 0xc7, 0xa6, 0xf1, 0xeb, + 0xd8, 0x34, 0x3e, 0x9c, 0x98, 0xa9, 0xc3, 0x13, 0x33, 0xf5, 0xfd, 0xc4, 0x4c, 0xbd, 0xb6, 0x63, + 0x4f, 0x46, 0x57, 0xf3, 0xf6, 0x3d, 0xf4, 0xb6, 0x4b, 0x41, 0x3d, 0x1f, 0xb5, 0xac, 0xfa, 0x47, + 0x7e, 0xf7, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x4e, 0xa6, 0x65, 0xda, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1096,13 +1087,6 @@ func (m *DelegatorRewardInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } if len(m.Provider) > 0 { i -= len(m.Provider) copy(dAtA[i:], m.Provider) @@ -1252,10 +1236,6 @@ func (m *DelegatorRewardInfo) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } if len(m.Amount) > 0 { for _, e := range m.Amount { l = e.Size() @@ -2067,38 +2047,6 @@ func (m *DelegatorRewardInfo) Unmarshal(dAtA []byte) error { } m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) diff --git a/x/dualstaking/types/tx.pb.go b/x/dualstaking/types/tx.pb.go index 4d7cb76748..bd41c1de95 100644 --- a/x/dualstaking/types/tx.pb.go +++ b/x/dualstaking/types/tx.pb.go @@ -479,39 +479,39 @@ var fileDescriptor_29c4c178d368211c = []byte{ // 562 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x94, 0xcf, 0x6e, 0xd3, 0x40, 0x10, 0xc6, 0xe3, 0x26, 0x84, 0x66, 0xd2, 0x0a, 0xd5, 0x6d, 0x89, 0xe3, 0x82, 0x9b, 0xba, 0x42, - 0x14, 0x10, 0xbb, 0x4a, 0x7b, 0x40, 0xea, 0xb1, 0xe9, 0x01, 0x0e, 0x91, 0x50, 0x24, 0x2e, 0xbd, + 0x14, 0x10, 0xbb, 0x4a, 0x41, 0x42, 0xea, 0xb1, 0xe9, 0x01, 0x0e, 0x91, 0x50, 0x24, 0x2e, 0xbd, 0x94, 0x4d, 0xbc, 0x75, 0x2d, 0x6c, 0x4f, 0xe4, 0xdd, 0x84,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xb2, 0xb4, 0x93, 0x7a, 0x0e, 0x90, 0x9b, 0xf8, 0xfb, 0x85, 0xc9, 0x33, 0xa1, 0x4e, 0x97, + 0x14, 0x66, 0x7d, 0x4e, 0xa1, 0x9a, 0x8c, 0xcd, 0x7e, 0x61, 0x6a, 0x2c, 0xd2, 0x1f, 0x2d, 0x21, + 0xca, 0x6a, 0xbb, 0xb0, 0x36, 0xf7, 0x87, 0x3d, 0x28, 0x4c, 0xce, 0x4b, 0xf5, 0xf6, 0xd2, 0xd2, + 0xb4, 0xdb, 0xf1, 0xf3, 0xab, 0x89, 0xa1, 0x5c, 0x4f, 0x0c, 0xe5, 0xc7, 0xc4, 0x50, 0x3e, 0x4e, + 0x8d, 0xd2, 0xf5, 0xd4, 0x28, 0x7d, 0x9b, 0x1a, 0xa5, 0x53, 0x62, 0x3b, 0xf2, 0x62, 0xd4, 0x27, + 0x03, 0xf4, 0xe8, 0xdc, 0xdd, 0x3d, 0x7e, 0x4a, 0x2f, 0xe7, 0x2f, 0xf0, 0x77, 0x43, 0x2e, 0xfa, + 0xd5, 0xe8, 0x86, 0x7d, 0xf2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x39, 0x90, 0x0d, 0xe9, 0x05, 0x00, 0x00, } diff --git a/x/epochstorage/README.md b/x/epochstorage/README.md index cab73a26ac..5a197c3c21 100644 --- a/x/epochstorage/README.md +++ b/x/epochstorage/README.md @@ -13,6 +13,7 @@ Note that the module will make sure that any changes will be applied only in the * [Epoch](#epoch) * [EpochDetails](#epochdetails) * [FixatedParams](#fixatedparams) + * [Metadata](#metadata) * [StakeEntry](#stakeentry) * [StakeEntry Storage](#stakeentry-storage) * [Parameters](#parameters) @@ -63,6 +64,21 @@ type FixatedParams struct { This is done in the [BeginBlock method of the module](keeper/fixated_params.go) +### Metadata + +The metadata struct includes all the data for a provider that is the same accross all chains +```go +type ProviderMetadata struct { + Provider string // provider address + Vault string // vault address + TotalDelegations types.Coin // total delegations by delegators + Chains []string // list of all chain ids the provider is staken on + DelegateCommission uint64 // provider commission from rewards + LastChange uint64 // date of the last commission change + Description types1.Description // string descriptions of the provider entity (moniker, identity, wesite...) +} +``` + ### StakeEntry The stake entry is a struct that contains all the information of a provider. @@ -146,6 +162,7 @@ The epochstorage module supports the following queries: | `show-fixated-params` | chainid | a specific fixated param | | `list-stake-storage` | chainid | list of all stake storages indices | | `show-stake-storage` | chainid | show a specific stake storage | +| `provider-metadata` | provider-address | shows the metadata of a specific provider, if left empty returns metadata for all providers | ## Transactions diff --git a/x/epochstorage/client/cli/query.go b/x/epochstorage/client/cli/query.go index decae416ca..370b4c087c 100644 --- a/x/epochstorage/client/cli/query.go +++ b/x/epochstorage/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // GetQueryCmd returns the cli query commands for this module @@ -30,6 +30,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdShowEpochDetails()) cmd.AddCommand(CmdListFixatedParams()) cmd.AddCommand(CmdShowFixatedParams()) + cmd.AddCommand(CmdProviderMetadata()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/epochstorage/client/cli/query_epoch_details.go b/x/epochstorage/client/cli/query_epoch_details.go index 95be3d3a23..8b66dbc6b9 100644 --- a/x/epochstorage/client/cli/query_epoch_details.go +++ b/x/epochstorage/client/cli/query_epoch_details.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_epoch_details_test.go b/x/epochstorage/client/cli/query_epoch_details_test.go index 5f1c32e820..fd55bafaa4 100644 --- a/x/epochstorage/client/cli/query_epoch_details_test.go +++ b/x/epochstorage/client/cli/query_epoch_details_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc/status" - "github.com/lavanet/lava/v3/testutil/network" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/client/cli" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/testutil/network" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/client/cli" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) func networkWithEpochDetailsObjects(t *testing.T) (*network.Network, types.EpochDetails) { diff --git a/x/epochstorage/client/cli/query_fixated_params.go b/x/epochstorage/client/cli/query_fixated_params.go index 4fdd338cb1..d54281efa0 100644 --- a/x/epochstorage/client/cli/query_fixated_params.go +++ b/x/epochstorage/client/cli/query_fixated_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_fixated_params_test.go b/x/epochstorage/client/cli/query_fixated_params_test.go index d0aee8617b..c7a8c1fe9e 100644 --- a/x/epochstorage/client/cli/query_fixated_params_test.go +++ b/x/epochstorage/client/cli/query_fixated_params_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/v3/testutil/network" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/client/cli" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/testutil/network" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/client/cli" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // Prevent strconv unused error diff --git a/x/epochstorage/client/cli/query_params.go b/x/epochstorage/client/cli/query_params.go index d202be1457..cbb2076a3a 100644 --- a/x/epochstorage/client/cli/query_params.go +++ b/x/epochstorage/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_provider_metadata.go b/x/epochstorage/client/cli/query_provider_metadata.go new file mode 100644 index 0000000000..a2d5b28d64 --- /dev/null +++ b/x/epochstorage/client/cli/query_provider_metadata.go @@ -0,0 +1,44 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/spf13/cobra" +) + +func CmdProviderMetadata() *cobra.Command { + cmd := &cobra.Command{ + Use: "provider-metadata", + Short: "returns the metadata for the provider address, if empty returns the metadata of all providers", + Example: "lavad provider-metadata lava@12345", + Args: cobra.RangeArgs(0, 1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + provider := "" + if len(args) == 1 { + provider = args[0] + } + + res, err := queryClient.ProviderMetaData(context.Background(), &types.QueryProviderMetaDataRequest{Provider: provider}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/epochstorage/client/cli/query_stake_storage.go b/x/epochstorage/client/cli/query_stake_storage.go index 6b8fb7a647..e4937381b6 100644 --- a/x/epochstorage/client/cli/query_stake_storage.go +++ b/x/epochstorage/client/cli/query_stake_storage.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/tx.go b/x/epochstorage/client/cli/tx.go index a5ba2b68f8..1bbe74b2ef 100644 --- a/x/epochstorage/client/cli/tx.go +++ b/x/epochstorage/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/epochstorage/genesis.go b/x/epochstorage/genesis.go index 7b4b99fb71..f1a99ccd83 100644 --- a/x/epochstorage/genesis.go +++ b/x/epochstorage/genesis.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/epochstorage/genesis_test.go b/x/epochstorage/genesis_test.go index 8fa4e0ce0d..aaf6bf99d6 100644 --- a/x/epochstorage/genesis_test.go +++ b/x/epochstorage/genesis_test.go @@ -3,10 +3,10 @@ package epochstorage_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage" - "github.com/lavanet/lava/v3/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/handler.go b/x/epochstorage/handler.go index 594bafaa4b..1baa17ab30 100644 --- a/x/epochstorage/handler.go +++ b/x/epochstorage/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // NewHandler ... diff --git a/x/epochstorage/keeper/epoch_details.go b/x/epochstorage/keeper/epoch_details.go index e1d63a061b..62d1c2c0d1 100644 --- a/x/epochstorage/keeper/epoch_details.go +++ b/x/epochstorage/keeper/epoch_details.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // SetEpochDetails set epochDetails in the store diff --git a/x/epochstorage/keeper/epoch_details_test.go b/x/epochstorage/keeper/epoch_details_test.go index 30fdcfea87..b0721ebd0d 100644 --- a/x/epochstorage/keeper/epoch_details_test.go +++ b/x/epochstorage/keeper/epoch_details_test.go @@ -6,10 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) func createTestEpochDetails(keeper *keeper.Keeper, ctx sdk.Context) types.EpochDetails { diff --git a/x/epochstorage/keeper/epoch_start.go b/x/epochstorage/keeper/epoch_start.go index 0d04bd3466..2b2454aaa9 100644 --- a/x/epochstorage/keeper/epoch_start.go +++ b/x/epochstorage/keeper/epoch_start.go @@ -5,8 +5,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // Function that calls all the functions that are supposed to run in epoch start diff --git a/x/epochstorage/keeper/fixated_params.go b/x/epochstorage/keeper/fixated_params.go index 60524261c3..3b8673a2c1 100644 --- a/x/epochstorage/keeper/fixated_params.go +++ b/x/epochstorage/keeper/fixated_params.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // SetFixatedParams set a specific fixatedParams in the store from its index diff --git a/x/epochstorage/keeper/fixated_params_test.go b/x/epochstorage/keeper/fixated_params_test.go index 26c4dbc0a9..5c41d6db5c 100644 --- a/x/epochstorage/keeper/fixated_params_test.go +++ b/x/epochstorage/keeper/fixated_params_test.go @@ -6,11 +6,11 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - common "github.com/lavanet/lava/v3/testutil/common" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + common "github.com/lavanet/lava/v4/testutil/common" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/keeper/grpc_query.go b/x/epochstorage/keeper/grpc_query.go index ba26ad670f..90fbe19e37 100644 --- a/x/epochstorage/keeper/grpc_query.go +++ b/x/epochstorage/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/epochstorage/keeper/grpc_query_epoch_details.go b/x/epochstorage/keeper/grpc_query_epoch_details.go index 936bdc3b45..a27db8f447 100644 --- a/x/epochstorage/keeper/grpc_query_epoch_details.go +++ b/x/epochstorage/keeper/grpc_query_epoch_details.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_epoch_details_test.go b/x/epochstorage/keeper/grpc_query_epoch_details_test.go index 652f3c78d3..9af0bf9be7 100644 --- a/x/epochstorage/keeper/grpc_query_epoch_details_test.go +++ b/x/epochstorage/keeper/grpc_query_epoch_details_test.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) func TestEpochDetailsQuery(t *testing.T) { diff --git a/x/epochstorage/keeper/grpc_query_fixated_params.go b/x/epochstorage/keeper/grpc_query_fixated_params.go index 1c75d59155..b40af3ff43 100644 --- a/x/epochstorage/keeper/grpc_query_fixated_params.go +++ b/x/epochstorage/keeper/grpc_query_fixated_params.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_fixated_params_test.go b/x/epochstorage/keeper/grpc_query_fixated_params_test.go index 0119d5405d..61bbcac28a 100644 --- a/x/epochstorage/keeper/grpc_query_fixated_params_test.go +++ b/x/epochstorage/keeper/grpc_query_fixated_params_test.go @@ -10,9 +10,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // Prevent strconv unused error diff --git a/x/epochstorage/keeper/grpc_query_params.go b/x/epochstorage/keeper/grpc_query_params.go index 8c55ccc592..1924aeb21a 100644 --- a/x/epochstorage/keeper/grpc_query_params.go +++ b/x/epochstorage/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_params_test.go b/x/epochstorage/keeper/grpc_query_params_test.go index c927a81114..5779e85022 100644 --- a/x/epochstorage/keeper/grpc_query_params_test.go +++ b/x/epochstorage/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/keeper/grpc_query_provider_metadata.go b/x/epochstorage/keeper/grpc_query_provider_metadata.go new file mode 100644 index 0000000000..cadec24b82 --- /dev/null +++ b/x/epochstorage/keeper/grpc_query_provider_metadata.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ProviderMetaData(c context.Context, req *types.QueryProviderMetaDataRequest) (*types.QueryProviderMetaDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + var err error + res := types.QueryProviderMetaDataResponse{} + if req.Provider == "" { + res.MetaData, err = k.GetAllMetadata(ctx) + } else { + var metadata types.ProviderMetadata + metadata, err = k.GetMetadata(ctx, req.Provider) + res.MetaData = append(res.MetaData, metadata) + } + + return &res, err +} diff --git a/x/epochstorage/keeper/grpc_query_stake_storage.go b/x/epochstorage/keeper/grpc_query_stake_storage.go index 4f05a5daf6..2668492852 100644 --- a/x/epochstorage/keeper/grpc_query_stake_storage.go +++ b/x/epochstorage/keeper/grpc_query_stake_storage.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_stake_storage_test.go b/x/epochstorage/keeper/grpc_query_stake_storage_test.go index d37f9d2224..6f3fc0f158 100644 --- a/x/epochstorage/keeper/grpc_query_stake_storage_test.go +++ b/x/epochstorage/keeper/grpc_query_stake_storage_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/x/epochstorage/keeper/keeper.go b/x/epochstorage/keeper/keeper.go index 999f0932e5..cfd32a1b52 100644 --- a/x/epochstorage/keeper/keeper.go +++ b/x/epochstorage/keeper/keeper.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/v3/utils" - collcompat "github.com/lavanet/lava/v3/utils/collcompat" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + collcompat "github.com/lavanet/lava/v4/utils/collcompat" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) type ( @@ -34,6 +34,7 @@ type ( stakeEntries *collections.IndexedMap[collections.Triple[uint64, string, collections.Pair[uint64, string]], types.StakeEntry, types.EpochChainIdProviderIndexes] stakeEntriesCurrent *collections.IndexedMap[collections.Pair[string, string], types.StakeEntry, types.ChainIdVaultIndexes] epochHashes collections.Map[uint64, []byte] + providersMetaData collections.Map[string, types.ProviderMetadata] } ) @@ -77,6 +78,8 @@ func NewKeeper( collcompat.ProtoValue[types.StakeEntry](cdc), types.NewChainIdVaultIndexes(sb)), epochHashes: collections.NewMap(sb, types.EpochHashesPrefix, "epoch_hashes", collections.Uint64Key, collections.BytesValue), + + providersMetaData: collections.NewMap(sb, types.ProviderMetaDataPrefix, "provider_metadata", collections.StringKey, collcompat.ProtoValue[types.ProviderMetadata](cdc)), } keeper.AddFixationRegistry(string(types.KeyEpochBlocks), func(ctx sdk.Context) any { return keeper.EpochBlocksRaw(ctx) }) diff --git a/x/epochstorage/keeper/migrations.go b/x/epochstorage/keeper/migrations.go index 7fd34bbf7a..b6871ef26f 100644 --- a/x/epochstorage/keeper/migrations.go +++ b/x/epochstorage/keeper/migrations.go @@ -9,10 +9,10 @@ import ( "cosmossdk.io/collections" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/epochstorage/types" - v3 "github.com/lavanet/lava/v3/x/epochstorage/types/migrations/v3" - v6 "github.com/lavanet/lava/v3/x/epochstorage/types/migrations/v6" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/epochstorage/types" + v3 "github.com/lavanet/lava/v4/x/epochstorage/types/migrations/v3" + v6 "github.com/lavanet/lava/v4/x/epochstorage/types/migrations/v6" ) type Migrator struct { diff --git a/x/epochstorage/keeper/msg_server.go b/x/epochstorage/keeper/msg_server.go index 90a744de6c..060a14266b 100644 --- a/x/epochstorage/keeper/msg_server.go +++ b/x/epochstorage/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) type msgServer struct { diff --git a/x/epochstorage/keeper/msg_server_test.go b/x/epochstorage/keeper/msg_server_test.go index 8b293afc7d..bb72301025 100644 --- a/x/epochstorage/keeper/msg_server_test.go +++ b/x/epochstorage/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/epochstorage/keeper/params.go b/x/epochstorage/keeper/params.go index 612dc7f960..13dc516a32 100644 --- a/x/epochstorage/keeper/params.go +++ b/x/epochstorage/keeper/params.go @@ -4,8 +4,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // GetParams get all parameters as types.Params diff --git a/x/epochstorage/keeper/params_test.go b/x/epochstorage/keeper/params_test.go index 2c8de2fe27..c7d1a3960b 100644 --- a/x/epochstorage/keeper/params_test.go +++ b/x/epochstorage/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/keeper/provider_metadata.go b/x/epochstorage/keeper/provider_metadata.go new file mode 100644 index 0000000000..cfad8d0a07 --- /dev/null +++ b/x/epochstorage/keeper/provider_metadata.go @@ -0,0 +1,35 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" +) + +func (k Keeper) GetMetadata(ctx sdk.Context, provider string) (types.ProviderMetadata, error) { + return k.providersMetaData.Get(ctx, provider) +} + +func (k Keeper) SetMetadata(ctx sdk.Context, metadata types.ProviderMetadata) { + err := k.providersMetaData.Set(ctx, metadata.Provider, metadata) + if err != nil { + panic(err) + } +} + +func (k Keeper) RemoveMetadata(ctx sdk.Context, provider string) error { + return k.providersMetaData.Remove(ctx, provider) +} + +func (k Keeper) SetAllMetadata(ctx sdk.Context, metadata []types.ProviderMetadata) { + for _, md := range metadata { + k.SetMetadata(ctx, md) + } +} + +func (k Keeper) GetAllMetadata(ctx sdk.Context) ([]types.ProviderMetadata, error) { + iter, err := k.providersMetaData.Iterate(ctx, nil) + if err != nil { + panic(err) + } + return iter.Values() +} diff --git a/x/epochstorage/keeper/stake_entries.go b/x/epochstorage/keeper/stake_entries.go index de35d9d4d4..d99e24ec7f 100644 --- a/x/epochstorage/keeper/stake_entries.go +++ b/x/epochstorage/keeper/stake_entries.go @@ -7,8 +7,9 @@ import ( "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) /* ########## StakeEntry ############ */ @@ -187,6 +188,23 @@ func (k Keeper) RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, provide if err != nil { panic(fmt.Errorf("RemoveStakeEntryCurrent: Failed to remove entry with key %v, error: %w", key, err)) } + + metadata, err := k.GetMetadata(ctx, provider) + if err != nil { + panic(fmt.Errorf("RemoveStakeEntryCurrent: Failed to fetch provider metadata %v, error: %w", provider, err)) + } + var ok bool + metadata.Chains, ok = lavaslices.Remove(metadata.Chains, chainID) + if !ok { + panic(fmt.Errorf("RemoveStakeEntryCurrent: Failed to remove chain from provider metadata %v, error: %w", provider, err)) + } + if len(metadata.Chains) == 0 { + if k.RemoveMetadata(ctx, provider) != nil { + panic(fmt.Errorf("RemoveStakeEntryCurrent: Failed to remove provider metadata %v, error: %w", provider, err)) + } + } else { + k.SetMetadata(ctx, metadata) + } } // GetAllStakeEntriesCurrent gets all the current stake entries diff --git a/x/epochstorage/keeper/stake_entries_test.go b/x/epochstorage/keeper/stake_entries_test.go index 91d40c9420..8ddc2daed6 100644 --- a/x/epochstorage/keeper/stake_entries_test.go +++ b/x/epochstorage/keeper/stake_entries_test.go @@ -6,9 +6,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/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" "github.com/stretchr/testify/require" ) @@ -99,6 +99,12 @@ func createNStakeEntriesCurrent(keeper *keeper.Keeper, ctx sdk.Context, n int) [ Chain: strconv.Itoa(i), } keeper.SetStakeEntryCurrent(ctx, items[i]) + metadata := types.ProviderMetadata{ + Provider: items[i].Address, + Vault: items[i].Vault, + Chains: []string{items[i].Chain}, + } + keeper.SetMetadata(ctx, metadata) } return items } diff --git a/x/epochstorage/module.go b/x/epochstorage/module.go index 8eae4a80a3..6e6cba0642 100644 --- a/x/epochstorage/module.go +++ b/x/epochstorage/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/epochstorage/client/cli" - "github.com/lavanet/lava/v3/x/epochstorage/keeper" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/client/cli" + "github.com/lavanet/lava/v4/x/epochstorage/keeper" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) var ( diff --git a/x/epochstorage/module_simulation.go b/x/epochstorage/module_simulation.go index 3e3bc02ff0..59cc07cb51 100644 --- a/x/epochstorage/module_simulation.go +++ b/x/epochstorage/module_simulation.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - epochstoragesimulation "github.com/lavanet/lava/v3/x/epochstorage/simulation" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/testutil/sample" + epochstoragesimulation "github.com/lavanet/lava/v4/x/epochstorage/simulation" + "github.com/lavanet/lava/v4/x/epochstorage/types" ) // avoid unused import issue diff --git a/x/epochstorage/types/endpoint.pb.go b/x/epochstorage/types/endpoint.pb.go index be42a42533..654f4ce9dc 100644 --- a/x/epochstorage/types/endpoint.pb.go +++ b/x/epochstorage/types/endpoint.pb.go @@ -121,9 +121,9 @@ var fileDescriptor_acb18a6b0d300ae9 = []byte{ 0x2b, 0x4a, 0x52, 0xf3, 0x8a, 0x33, 0x41, 0x46, 0xb0, 0x81, 0x95, 0x20, 0x89, 0x78, 0xb1, 0x70, 0x30, 0x09, 0x30, 0x3b, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, - 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x94, 0x19, - 0xeb, 0x57, 0xa0, 0x06, 0x4d, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x60, 0x8c, 0x01, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x29, 0x1d, 0x0a, 0x96, 0x44, 0x01, 0x00, 0x00, + 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x94, 0x99, + 0xe8, 0x57, 0xa0, 0x06, 0x4d, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x60, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x11, 0xb4, 0x28, 0x23, 0x44, 0x01, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/epoch_details.pb.go b/x/epochstorage/types/epoch_details.pb.go index d34623e6c3..283b23f272 100644 --- a/x/epochstorage/types/epoch_details.pb.go +++ b/x/epochstorage/types/epoch_details.pb.go @@ -103,8 +103,8 @@ var fileDescriptor_5a742d00b5f6efc1 = []byte{ 0x2b, 0x30, 0x83, 0x54, 0xa1, 0x08, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x8a, - 0x57, 0xcb, 0x8c, 0xf5, 0x2b, 0x50, 0xfd, 0x5b, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, - 0xa8, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x59, 0x4f, 0x07, 0x19, 0x01, 0x00, 0x00, + 0x57, 0xcb, 0x4c, 0xf4, 0x2b, 0x50, 0xfd, 0x5b, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, + 0xa8, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xf0, 0x6d, 0xb2, 0x19, 0x01, 0x00, 0x00, } func (m *EpochDetails) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/expected_keepers.go b/x/epochstorage/types/expected_keepers.go index d684d958cd..a6fa9a5c1e 100644 --- a/x/epochstorage/types/expected_keepers.go +++ b/x/epochstorage/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type SpecKeeper interface { diff --git a/x/epochstorage/types/fixated_params.pb.go b/x/epochstorage/types/fixated_params.pb.go index 59f7b6bff9..ee7d94ac9c 100644 --- a/x/epochstorage/types/fixated_params.pb.go +++ b/x/epochstorage/types/fixated_params.pb.go @@ -105,8 +105,8 @@ var fileDescriptor_fa13bd82b46f86d2 = []byte{ 0xce, 0x96, 0x60, 0x56, 0x60, 0xd4, 0x60, 0x09, 0x42, 0x15, 0x74, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0x7d, 0x14, 0x77, 0x97, 0x19, 0xeb, 0x57, 0xa0, 0x3a, 0xbe, 0xa4, 0xb2, 0x20, 0xb5, - 0x38, 0x89, 0x0d, 0xec, 0x78, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x96, 0xce, 0x7a, 0x27, + 0xfc, 0x5c, 0x7d, 0x14, 0x77, 0x97, 0x99, 0xe8, 0x57, 0xa0, 0x3a, 0xbe, 0xa4, 0xb2, 0x20, 0xb5, + 0x38, 0x89, 0x0d, 0xec, 0x78, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x67, 0x58, 0x92, 0x47, 0x01, 0x00, 0x00, } diff --git a/x/epochstorage/types/genesis.pb.go b/x/epochstorage/types/genesis.pb.go index 883c298dcc..e87e6ab77e 100644 --- a/x/epochstorage/types/genesis.pb.go +++ b/x/epochstorage/types/genesis.pb.go @@ -120,8 +120,8 @@ var fileDescriptor_6b4c1a9bc1f09c0e = []byte{ 0xa8, 0x4b, 0x31, 0x0d, 0x72, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0xc8, 0x2a, - 0x33, 0xd6, 0xaf, 0x40, 0x8d, 0xb1, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x4c, 0x19, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x9c, 0x7e, 0xcc, 0xbb, 0x02, 0x00, 0x00, + 0x33, 0xd1, 0xaf, 0x40, 0x8d, 0xb1, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x4c, 0x19, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x54, 0x35, 0x5c, 0x79, 0xbb, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/genesis_test.go b/x/epochstorage/types/genesis_test.go index 9aea252088..4e8ba6da82 100644 --- a/x/epochstorage/types/genesis_test.go +++ b/x/epochstorage/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/types/params.pb.go b/x/epochstorage/types/params.pb.go index 1cdb46491c..172f5f2e81 100644 --- a/x/epochstorage/types/params.pb.go +++ b/x/epochstorage/types/params.pb.go @@ -109,8 +109,8 @@ var fileDescriptor_09513f4cf6e403e6 = []byte{ 0x46, 0x01, 0x26, 0x2f, 0x16, 0x0e, 0x56, 0x01, 0x36, 0x27, 0xcf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0x47, 0x09, 0xe2, 0x32, 0x63, 0xfd, 0x0a, 0xd4, 0x70, 0x2e, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, - 0x62, 0x03, 0x07, 0x9b, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x92, 0x7f, 0x86, 0xb2, 0x91, 0x01, + 0xd5, 0x47, 0x09, 0xe2, 0x32, 0x13, 0xfd, 0x0a, 0xd4, 0x70, 0x2e, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, + 0x62, 0x03, 0x07, 0x9b, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xd6, 0xa4, 0x07, 0x91, 0x01, 0x00, 0x00, } diff --git a/x/epochstorage/types/provider_metadata.pb.go b/x/epochstorage/types/provider_metadata.pb.go new file mode 100644 index 0000000000..9ac94c6dcd --- /dev/null +++ b/x/epochstorage/types/provider_metadata.pb.go @@ -0,0 +1,618 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: lavanet/lava/epochstorage/provider_metadata.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + types1 "github.com/cosmos/cosmos-sdk/x/staking/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 ProviderMetadata struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + Vault string `protobuf:"bytes,2,opt,name=vault,proto3" json:"vault,omitempty"` + TotalDelegations types.Coin `protobuf:"bytes,3,opt,name=total_delegations,json=totalDelegations,proto3" json:"total_delegations"` + Chains []string `protobuf:"bytes,4,rep,name=chains,proto3" json:"chains,omitempty"` + DelegateCommission uint64 `protobuf:"varint,5,opt,name=delegate_commission,json=delegateCommission,proto3" json:"delegate_commission,omitempty"` + LastChange uint64 `protobuf:"varint,6,opt,name=last_change,json=lastChange,proto3" json:"last_change,omitempty"` + Description types1.Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` +} + +func (m *ProviderMetadata) Reset() { *m = ProviderMetadata{} } +func (m *ProviderMetadata) String() string { return proto.CompactTextString(m) } +func (*ProviderMetadata) ProtoMessage() {} +func (*ProviderMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_eea88d8dbfad23fd, []int{0} +} +func (m *ProviderMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProviderMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProviderMetadata.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 *ProviderMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProviderMetadata.Merge(m, src) +} +func (m *ProviderMetadata) XXX_Size() int { + return m.Size() +} +func (m *ProviderMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_ProviderMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_ProviderMetadata proto.InternalMessageInfo + +func (m *ProviderMetadata) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *ProviderMetadata) GetVault() string { + if m != nil { + return m.Vault + } + return "" +} + +func (m *ProviderMetadata) GetTotalDelegations() types.Coin { + if m != nil { + return m.TotalDelegations + } + return types.Coin{} +} + +func (m *ProviderMetadata) GetChains() []string { + if m != nil { + return m.Chains + } + return nil +} + +func (m *ProviderMetadata) GetDelegateCommission() uint64 { + if m != nil { + return m.DelegateCommission + } + return 0 +} + +func (m *ProviderMetadata) GetLastChange() uint64 { + if m != nil { + return m.LastChange + } + return 0 +} + +func (m *ProviderMetadata) GetDescription() types1.Description { + if m != nil { + return m.Description + } + return types1.Description{} +} + +func init() { + proto.RegisterType((*ProviderMetadata)(nil), "lavanet.lava.epochstorage.ProviderMetadata") +} + +func init() { + proto.RegisterFile("lavanet/lava/epochstorage/provider_metadata.proto", fileDescriptor_eea88d8dbfad23fd) +} + +var fileDescriptor_eea88d8dbfad23fd = []byte{ + // 402 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xc1, 0x6e, 0xd3, 0x30, + 0x1c, 0xc6, 0xeb, 0xad, 0x2b, 0xd4, 0xbd, 0x6c, 0x66, 0x42, 0x59, 0x0f, 0x59, 0x05, 0x1c, 0x2a, + 0x0e, 0xb6, 0x0a, 0x3c, 0x41, 0xbb, 0x0b, 0x12, 0x48, 0x53, 0x8e, 0x5c, 0xaa, 0x7f, 0x1c, 0x2b, + 0xb1, 0x48, 0xfc, 0x8f, 0x62, 0x2f, 0x82, 0xb7, 0xe0, 0x31, 0x38, 0xf2, 0x18, 0x3b, 0xa1, 0x1d, + 0x39, 0x21, 0xd4, 0x1e, 0x78, 0x8d, 0x29, 0x8e, 0xd3, 0x6d, 0x97, 0x38, 0xdf, 0xff, 0xfb, 0x3e, + 0xe7, 0xa7, 0xd8, 0x74, 0x55, 0x42, 0x0b, 0x46, 0x39, 0xd1, 0xad, 0x42, 0xd5, 0x28, 0x0b, 0xeb, + 0xb0, 0x81, 0x5c, 0x89, 0xba, 0xc1, 0x56, 0x67, 0xaa, 0xd9, 0x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x4a, 0xb0, 0x6e, 0x2b, 0x0b, 0x30, 0xb9, 0x8a, 0x26, 0x3e, 0x48, 0xbb, 0xd1, 0xc6, 0x4f, 0xd8, + 0x35, 0x9d, 0x65, 0xca, 0xca, 0x46, 0xd7, 0xdd, 0x97, 0xa3, 0x67, 0x9e, 0xf8, 0xf5, 0x40, 0x3c, + 0xfc, 0xaa, 0x01, 0xfa, 0xea, 0x21, 0xba, 0x9e, 0x76, 0xec, 0x3f, 0xff, 0xff, 0x7a, 0x4b, 0x92, + 0xc7, 0x5b, 0xac, 0x3f, 0xde, 0xee, 0x62, 0x72, 0xb7, 0x8b, 0xc9, 0xbf, 0x5d, 0x4c, 0x7e, 0xec, + 0xe3, 0xd1, 0xdd, 0x3e, 0x1e, 0xfd, 0xd9, 0xc7, 0xa3, 0x2f, 0x22, 0xd7, 0xae, 0xb8, 0x49, 0xb9, + 0xc4, 0x4a, 0x3c, 0xb9, 0x32, 0xed, 0x07, 0xf1, 0xed, 0xe9, 0xbd, 0x71, 0xdf, 0x6b, 0x65, 0xd3, + 0x89, 0x3f, 0xa2, 0xf7, 0xf7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x46, 0xa9, 0x12, 0xb3, 0x61, 0x02, + 0x00, 0x00, +} + +func (m *ProviderMetadata) 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 *ProviderMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProviderMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProviderMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if m.LastChange != 0 { + i = encodeVarintProviderMetadata(dAtA, i, uint64(m.LastChange)) + i-- + dAtA[i] = 0x30 + } + if m.DelegateCommission != 0 { + i = encodeVarintProviderMetadata(dAtA, i, uint64(m.DelegateCommission)) + i-- + dAtA[i] = 0x28 + } + if len(m.Chains) > 0 { + for iNdEx := len(m.Chains) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Chains[iNdEx]) + copy(dAtA[i:], m.Chains[iNdEx]) + i = encodeVarintProviderMetadata(dAtA, i, uint64(len(m.Chains[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + { + size, err := m.TotalDelegations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProviderMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Vault) > 0 { + i -= len(m.Vault) + copy(dAtA[i:], m.Vault) + i = encodeVarintProviderMetadata(dAtA, i, uint64(len(m.Vault))) + i-- + dAtA[i] = 0x12 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintProviderMetadata(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintProviderMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovProviderMetadata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ProviderMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovProviderMetadata(uint64(l)) + } + l = len(m.Vault) + if l > 0 { + n += 1 + l + sovProviderMetadata(uint64(l)) + } + l = m.TotalDelegations.Size() + n += 1 + l + sovProviderMetadata(uint64(l)) + if len(m.Chains) > 0 { + for _, s := range m.Chains { + l = len(s) + n += 1 + l + sovProviderMetadata(uint64(l)) + } + } + if m.DelegateCommission != 0 { + n += 1 + sovProviderMetadata(uint64(m.DelegateCommission)) + } + if m.LastChange != 0 { + n += 1 + sovProviderMetadata(uint64(m.LastChange)) + } + l = m.Description.Size() + n += 1 + l + sovProviderMetadata(uint64(l)) + return n +} + +func sovProviderMetadata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProviderMetadata(x uint64) (n int) { + return sovProviderMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ProviderMetadata) 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 ErrIntOverflowProviderMetadata + } + 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: ProviderMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProviderMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + 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 ErrInvalidLengthProviderMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviderMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vault", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + 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 ErrInvalidLengthProviderMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviderMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vault = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProviderMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProviderMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalDelegations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chains", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + 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 ErrInvalidLengthProviderMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviderMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chains = append(m.Chains, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegateCommission", wireType) + } + m.DelegateCommission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DelegateCommission |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastChange", wireType) + } + m.LastChange = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastChange |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviderMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProviderMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProviderMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProviderMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProviderMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipProviderMetadata(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, ErrIntOverflowProviderMetadata + } + 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, ErrIntOverflowProviderMetadata + } + 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, ErrIntOverflowProviderMetadata + } + 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, ErrInvalidLengthProviderMetadata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupProviderMetadata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthProviderMetadata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthProviderMetadata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProviderMetadata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProviderMetadata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/epochstorage/types/query.pb.go b/x/epochstorage/types/query.pb.go index 64e754ca79..53bd8ba747 100644 --- a/x/epochstorage/types/query.pb.go +++ b/x/epochstorage/types/query.pb.go @@ -562,6 +562,94 @@ func (m *QueryAllFixatedParamsResponse) GetPagination() *query.PageResponse { return nil } +type QueryProviderMetaDataRequest struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` +} + +func (m *QueryProviderMetaDataRequest) Reset() { *m = QueryProviderMetaDataRequest{} } +func (m *QueryProviderMetaDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProviderMetaDataRequest) ProtoMessage() {} +func (*QueryProviderMetaDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_60112e15fc266719, []int{12} +} +func (m *QueryProviderMetaDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProviderMetaDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProviderMetaDataRequest.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 *QueryProviderMetaDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProviderMetaDataRequest.Merge(m, src) +} +func (m *QueryProviderMetaDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProviderMetaDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProviderMetaDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProviderMetaDataRequest proto.InternalMessageInfo + +func (m *QueryProviderMetaDataRequest) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +type QueryProviderMetaDataResponse struct { + MetaData []ProviderMetadata `protobuf:"bytes,1,rep,name=MetaData,proto3" json:"MetaData"` +} + +func (m *QueryProviderMetaDataResponse) Reset() { *m = QueryProviderMetaDataResponse{} } +func (m *QueryProviderMetaDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProviderMetaDataResponse) ProtoMessage() {} +func (*QueryProviderMetaDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_60112e15fc266719, []int{13} +} +func (m *QueryProviderMetaDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProviderMetaDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProviderMetaDataResponse.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 *QueryProviderMetaDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProviderMetaDataResponse.Merge(m, src) +} +func (m *QueryProviderMetaDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProviderMetaDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProviderMetaDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProviderMetaDataResponse proto.InternalMessageInfo + +func (m *QueryProviderMetaDataResponse) GetMetaData() []ProviderMetadata { + if m != nil { + return m.MetaData + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "lavanet.lava.epochstorage.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "lavanet.lava.epochstorage.QueryParamsResponse") @@ -575,6 +663,8 @@ func init() { proto.RegisterType((*QueryGetFixatedParamsResponse)(nil), "lavanet.lava.epochstorage.QueryGetFixatedParamsResponse") proto.RegisterType((*QueryAllFixatedParamsRequest)(nil), "lavanet.lava.epochstorage.QueryAllFixatedParamsRequest") proto.RegisterType((*QueryAllFixatedParamsResponse)(nil), "lavanet.lava.epochstorage.QueryAllFixatedParamsResponse") + proto.RegisterType((*QueryProviderMetaDataRequest)(nil), "lavanet.lava.epochstorage.QueryProviderMetaDataRequest") + proto.RegisterType((*QueryProviderMetaDataResponse)(nil), "lavanet.lava.epochstorage.QueryProviderMetaDataResponse") } func init() { @@ -582,51 +672,58 @@ func init() { } var fileDescriptor_60112e15fc266719 = []byte{ - // 703 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x4f, 0xd4, 0x40, - 0x14, 0xc7, 0x77, 0x40, 0x88, 0x8e, 0x10, 0xcd, 0xc8, 0x41, 0x57, 0xa8, 0x52, 0x23, 0x02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cc, - 0xa8, 0x52, 0x5b, 0x9e, 0x35, 0xbc, 0x4a, 0x31, 0x5b, 0xef, 0x74, 0xf4, 0x1d, 0xc0, 0x41, 0xeb, - 0xa9, 0x41, 0x65, 0x8a, 0x67, 0x4d, 0x86, 0xea, 0xec, 0xe9, 0x13, 0x35, 0xf6, 0x63, 0x89, 0x5d, - 0x47, 0x35, 0x52, 0xf6, 0xdb, 0xe2, 0x5f, 0xab, 0x7c, 0x01, 0xf0, 0xaa, 0x25, 0x9a, 0xf4, 0x4a, - 0x99, 0x33, 0xff, 0x3f, 0x0b, 0x79, 0xc3, 0xca, 0xad, 0x49, 0x0b, 0xf7, 0xd1, 0x44, 0x69, 0x0b, - 0xf3, 0xcf, 0xf7, 0x0f, 0x1d, 0x70, 0x70, 0xe8, 0x80, 0xdf, 0x87, 0x0e, 0x78, 0x7f, 0xe4, 0x54, - 0x0e, 0x8e, 0x9c, 0xca, 0xcf, 0x23, 0xa7, 0xf2, 0x8a, 0x78, 0xbe, 0xd8, 0xe8, 0x34, 0x71, 0x8b, - 0x6f, 0xda, 0x72, 0xdb, 0x75, 0xb2, 0x63, 0x6b, 0x8a, 0xdd, 0x88, 0xc5, 0xcd, 0x7e, 0xf9, 0xd1, - 0x54, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x27, 0x7e, 0x6a, 0xae, 0x0a, 0x00, 0x00, + // 806 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x4f, 0x13, 0x4d, + 0x1c, 0xc7, 0x3b, 0xf0, 0x40, 0x78, 0xe6, 0x81, 0x3c, 0x64, 0xe4, 0xa0, 0x15, 0xaa, 0xac, 0x11, + 0x79, 0x09, 0x3b, 0x14, 0x88, 0x80, 0x17, 0x02, 0x41, 0x88, 0x07, 0x12, 0x28, 0xc6, 0x83, 0x97, + 0x66, 0xda, 0x0e, 0x65, 0x63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x83, 0x3c, + 0xac, 0x71, 0xa7, 0xd0, 0xab, 0x6e, 0xaa, 0x73, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x72, + 0x9d, 0x80, 0x56, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -653,6 +750,8 @@ type QueryClient interface { FixatedParams(ctx context.Context, in *QueryGetFixatedParamsRequest, opts ...grpc.CallOption) (*QueryGetFixatedParamsResponse, error) // Queries a list of FixatedParams items. FixatedParamsAll(ctx context.Context, in *QueryAllFixatedParamsRequest, opts ...grpc.CallOption) (*QueryAllFixatedParamsResponse, error) + // Queries provider metadata. + ProviderMetaData(ctx context.Context, in *QueryProviderMetaDataRequest, opts ...grpc.CallOption) (*QueryProviderMetaDataResponse, error) } type queryClient struct { @@ -717,6 +816,15 @@ func (c *queryClient) FixatedParamsAll(ctx context.Context, in *QueryAllFixatedP return out, nil } +func (c *queryClient) ProviderMetaData(ctx context.Context, in *QueryProviderMetaDataRequest, opts ...grpc.CallOption) (*QueryProviderMetaDataResponse, error) { + out := new(QueryProviderMetaDataResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.epochstorage.Query/ProviderMetaData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -731,6 +839,8 @@ type QueryServer interface { FixatedParams(context.Context, *QueryGetFixatedParamsRequest) (*QueryGetFixatedParamsResponse, error) // Queries a list of FixatedParams items. FixatedParamsAll(context.Context, *QueryAllFixatedParamsRequest) (*QueryAllFixatedParamsResponse, error) + // Queries provider metadata. + ProviderMetaData(context.Context, *QueryProviderMetaDataRequest) (*QueryProviderMetaDataResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -755,6 +865,9 @@ func (*UnimplementedQueryServer) FixatedParams(ctx context.Context, req *QueryGe func (*UnimplementedQueryServer) FixatedParamsAll(ctx context.Context, req *QueryAllFixatedParamsRequest) (*QueryAllFixatedParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FixatedParamsAll not implemented") } +func (*UnimplementedQueryServer) ProviderMetaData(ctx context.Context, req *QueryProviderMetaDataRequest) (*QueryProviderMetaDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProviderMetaData not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -868,6 +981,24 @@ func _Query_FixatedParamsAll_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_ProviderMetaData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProviderMetaDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ProviderMetaData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.epochstorage.Query/ProviderMetaData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProviderMetaData(ctx, req.(*QueryProviderMetaDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.epochstorage.Query", HandlerType: (*QueryServer)(nil), @@ -896,6 +1027,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "FixatedParamsAll", Handler: _Query_FixatedParamsAll_Handler, }, + { + MethodName: "ProviderMetaData", + Handler: _Query_ProviderMetaData_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "lavanet/lava/epochstorage/query.proto", @@ -1307,6 +1442,73 @@ func (m *QueryAllFixatedParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryProviderMetaDataRequest) 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 *QueryProviderMetaDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProviderMetaDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryProviderMetaDataResponse) 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 *QueryProviderMetaDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProviderMetaDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MetaData) > 0 { + for iNdEx := len(m.MetaData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MetaData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1470,6 +1672,34 @@ func (m *QueryAllFixatedParamsResponse) Size() (n int) { return n } +func (m *QueryProviderMetaDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProviderMetaDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MetaData) > 0 { + for _, e := range m.MetaData { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2484,6 +2714,172 @@ func (m *QueryAllFixatedParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryProviderMetaDataRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProviderMetaDataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProviderMetaDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProviderMetaDataResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProviderMetaDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProviderMetaDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetaData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MetaData = append(m.MetaData, ProviderMetadata{}) + if err := m.MetaData[len(m.MetaData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/epochstorage/types/query.pb.gw.go b/x/epochstorage/types/query.pb.gw.go index 66cc24ed93..29270cc94c 100644 --- a/x/epochstorage/types/query.pb.gw.go +++ b/x/epochstorage/types/query.pb.gw.go @@ -249,6 +249,60 @@ func local_request_Query_FixatedParamsAll_0(ctx context.Context, marshaler runti } +func request_Query_ProviderMetaData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProviderMetaDataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + msg, err := client.ProviderMetaData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ProviderMetaData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProviderMetaDataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + msg, err := server.ProviderMetaData(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -393,6 +447,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ProviderMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ProviderMetaData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProviderMetaData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -554,6 +631,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ProviderMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ProviderMetaData_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProviderMetaData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -569,6 +666,8 @@ var ( pattern_Query_FixatedParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "epochstorage", "fixated_params", "index"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_FixatedParamsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "epochstorage", "fixated_params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ProviderMetaData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "epochstorage", "provider_metadata", "provider"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -583,4 +682,6 @@ var ( forward_Query_FixatedParams_0 = runtime.ForwardResponseMessage forward_Query_FixatedParamsAll_0 = runtime.ForwardResponseMessage + + forward_Query_ProviderMetaData_0 = runtime.ForwardResponseMessage ) diff --git a/x/epochstorage/types/stake_entries.go b/x/epochstorage/types/stake_entries.go index a1a8c5cd81..6bedce637b 100644 --- a/x/epochstorage/types/stake_entries.go +++ b/x/epochstorage/types/stake_entries.go @@ -8,7 +8,7 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/collections/indexes" "cosmossdk.io/math" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) var ( @@ -17,6 +17,7 @@ var ( EpochChainIdProviderIndexesPrefix = collections.NewPrefix([]byte("EpochChainIdProviderIndexes/")) ChainIdVaultIndexesPrefix = collections.NewPrefix([]byte("ChainIdVaultIndexes/")) EpochHashesPrefix = collections.NewPrefix([]byte("EpochHash/")) + ProviderMetaDataPrefix = collections.NewPrefix([]byte("ProviderMetaData/")) ) // EpochChainIdProviderIndexes defines a secondary unique index for the keeper's stakeEntries indexed map diff --git a/x/epochstorage/types/stake_entry.pb.go b/x/epochstorage/types/stake_entry.pb.go index a5753318b7..d4f8e8cd95 100644 --- a/x/epochstorage/types/stake_entry.pb.go +++ b/x/epochstorage/types/stake_entry.pb.go @@ -36,7 +36,6 @@ type StakeEntry struct { Moniker string `protobuf:"bytes,8,opt,name=moniker,proto3" json:"moniker,omitempty"` DelegateTotal types.Coin `protobuf:"bytes,9,opt,name=delegate_total,json=delegateTotal,proto3" json:"delegate_total"` DelegateCommission uint64 `protobuf:"varint,11,opt,name=delegate_commission,json=delegateCommission,proto3" json:"delegate_commission,omitempty"` - LastChange uint64 `protobuf:"varint,12,opt,name=last_change,json=lastChange,proto3" json:"last_change,omitempty"` BlockReport *BlockReport `protobuf:"bytes,13,opt,name=block_report,json=blockReport,proto3" json:"block_report,omitempty"` Vault string `protobuf:"bytes,14,opt,name=vault,proto3" json:"vault,omitempty"` Description types1.Description `protobuf:"bytes,15,opt,name=description,proto3" json:"description"` @@ -140,13 +139,6 @@ func (m *StakeEntry) GetDelegateCommission() uint64 { return 0 } -func (m *StakeEntry) GetLastChange() uint64 { - if m != nil { - return m.LastChange - } - return 0 -} - func (m *StakeEntry) GetBlockReport() *BlockReport { if m != nil { return m.BlockReport @@ -247,45 +239,44 @@ func init() { } var fileDescriptor_df6302d6b53c056e = []byte{ - // 597 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xbd, 0x4e, 0xdd, 0x30, - 0x18, 0xbd, 0x81, 0x5c, 0xb8, 0xd7, 0x01, 0x0a, 0x86, 0xc1, 0x30, 0x84, 0x14, 0xaa, 0x2a, 0x6a, - 0xa5, 0x58, 0x80, 0xfa, 0x00, 0xbd, 0x14, 0x2a, 0x98, 0xaa, 0x94, 0xa9, 0x4b, 0xe4, 0x24, 0x56, - 0xae, 0x4b, 0x62, 0x47, 0xb1, 0xb9, 0x2a, 0x6f, 0xd1, 0xc7, 0xe8, 0xd8, 0xbd, 0x2f, 0xc0, 0xc8, - 0xd8, 0xa9, 0xaa, 0x60, 0xe8, 0x6b, 0x54, 0xb6, 0x93, 0xfb, 0x33, 0x50, 0x75, 0x49, 0x7c, 0xbe, - 0x73, 0xfc, 0xf9, 0x3b, 0x47, 0x36, 0x78,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, 0x6f, 0x7f, 0xbe, 0xbf, 0x72, 0xe2, 0xf9, 0x16, 0xfa, 0x9c, 0xcf, 0x84, 0x95, 0x12, - 0x6d, 0x1a, 0x37, 0x16, 0xc0, 0x03, 0xb0, 0xae, 0x17, 0x09, 0xe5, 0x79, 0xa2, 0x58, 0x45, 0xd1, - 0x56, 0xe0, 0x84, 0xcb, 0xb1, 0xa7, 0x8b, 0x67, 0x3c, 0xbf, 0x62, 0x15, 0xbd, 0x74, 0x07, 0xab, - 0x9b, 0x83, 0x4b, 0x77, 0x00, 0x36, 0xbd, 0x83, 0x73, 0xe0, 0x8d, 0x16, 0x87, 0x37, 0x2e, 0xcd, - 0xed, 0x75, 0x63, 0x0b, 0xe0, 0x73, 0xb0, 0x56, 0x12, 0x45, 0xa5, 0x6a, 0xef, 0xde, 0x92, 0x21, - 0x3d, 0x5b, 0x33, 0xdb, 0x47, 0x17, 0x77, 0x0f, 0xbe, 0x73, 0xff, 0xe0, 0x3b, 0xbf, 0x1f, 0x7c, - 0xe7, 0xeb, 0xa3, 0xdf, 0xbb, 0x7f, 0xf4, 0x7b, 0x3f, 0x1f, 0xfd, 0xde, 0x27, 0x5c, 0x30, 0x35, - 0xbe, 0x49, 0xa3, 0x4c, 0x54, 0x78, 0xe1, 0x0d, 0x4f, 0x4e, 0xf0, 0x97, 0xc5, 0x87, 0xac, 0x6e, - 0x6b, 0x2a, 0xd3, 0x15, 0xf3, 0xae, 0x4e, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x28, 0x02, 0x10, - 0xfc, 0x3a, 0x04, 0x00, 0x00, + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x4e, 0xdc, 0x3c, + 0x14, 0x9d, 0x40, 0x06, 0x66, 0x1c, 0x86, 0x6f, 0x30, 0x2c, 0x0c, 0x8b, 0x7c, 0x29, 0x54, 0x55, + 0x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0x18, 0x9f, 0xb8, 0xb7, 0x3f, 0xff, 0xef, 0xc5, + 0x56, 0x0d, 0x11, 0x58, 0x27, 0x79, 0xde, 0x50, 0x29, 0xd1, 0x4a, 0xe0, 0x84, 0xc3, 0xb8, 0x83, + 0x30, 0x02, 0xdb, 0x36, 0x28, 0x52, 0xd7, 0x25, 0xa3, 0x79, 0x92, 0x96, 0x22, 0xbb, 0x42, 0xab, + 0x81, 0x13, 0xba, 0xf1, 0x96, 0xa1, 0xde, 0x58, 0x66, 0xa2, 0x09, 0xf8, 0x0e, 0x0c, 0xbb, 0x40, + 0x24, 0x72, 0x83, 0xd5, 0xd0, 0x3b, 0x3a, 0x88, 0x1e, 0xcd, 0x35, 0x3a, 0x69, 0xb5, 0xed, 0x38, + 0xf3, 0xbd, 0x30, 0x00, 0x5e, 0x41, 0x45, 0x29, 0x32, 0xa2, 0x98, 0xe0, 0xa8, 0x1f, 0x38, 0x61, + 0x3f, 0x5e, 0x2c, 0xc1, 0x1d, 0xd0, 0xcf, 0x2e, 0x09, 0xe3, 0x68, 0xcd, 0x8c, 0x6c, 0x81, 0xb6, + 0x52, 0x09, 0xce, 0xae, 0x68, 0x83, 0x06, 0xd6, 0x4a, 0x0b, 0xe1, 0x29, 0xd8, 0xcc, 0x69, 0x49, + 0x0b, 0xa2, 0x68, 0xa2, 0x84, 0x22, 0x25, 0x1a, 0xfe, 0x5b, 0x48, 0xa3, 0x6e, 0xdb, 0x85, 0xde, + 0x05, 0x31, 0xd8, 0x9e, 0xf5, 0xc9, 0x44, 0x55, 0x31, 0x29, 0xf5, 0x84, 0x9e, 0x89, 0x04, 0x76, + 0xd4, 0xf1, 0x8c, 0x81, 0x67, 0x60, 0xc3, 0xa4, 0x96, 0x34, 0xb4, 0x16, 0x8d, 0x42, 0x23, 0x73, + 0xec, 0xb3, 0xbf, 0xc4, 0x62, 0xb2, 0x8c, 0x8d, 0x3a, 0xf6, 0xd2, 0x39, 0xd0, 0x9e, 0xa7, 0xe4, + 0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, 0xac, 0x1f, 0x04, 0x00, 0x00, } func (m *StakeEntry) Marshal() (dAtA []byte, err error) { @@ -351,11 +342,6 @@ func (m *StakeEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x6a } - if m.LastChange != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.LastChange)) - i-- - dAtA[i] = 0x60 - } if m.DelegateCommission != 0 { i = encodeVarintStakeEntry(dAtA, i, uint64(m.DelegateCommission)) i-- @@ -510,9 +496,6 @@ func (m *StakeEntry) Size() (n int) { if m.DelegateCommission != 0 { n += 1 + sovStakeEntry(uint64(m.DelegateCommission)) } - if m.LastChange != 0 { - n += 1 + sovStakeEntry(uint64(m.LastChange)) - } if m.BlockReport != nil { l = m.BlockReport.Size() n += 1 + l + sovStakeEntry(uint64(l)) @@ -835,25 +818,6 @@ func (m *StakeEntry) Unmarshal(dAtA []byte) error { break } } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastChange", wireType) - } - m.LastChange = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastChange |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BlockReport", wireType) diff --git a/x/epochstorage/types/stake_storage.pb.go b/x/epochstorage/types/stake_storage.pb.go index a48dfd2f92..9fae4c82fa 100644 --- a/x/epochstorage/types/stake_storage.pb.go +++ b/x/epochstorage/types/stake_storage.pb.go @@ -106,9 +106,9 @@ var fileDescriptor_be7b78aecc265fd4 = []byte{ 0x4f, 0xce, 0xf6, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0x42, 0x13, 0x75, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0x28, 0x33, 0xd6, 0xaf, 0x40, 0x0d, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0x28, 0x33, 0xd1, 0xaf, 0x40, 0x0d, 0x8c, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x8f, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x8a, 0x5d, 0xc5, 0xf7, 0x80, 0x01, 0x00, 0x00, + 0xff, 0xb2, 0xf4, 0xe7, 0x42, 0x80, 0x01, 0x00, 0x00, } func (m *StakeStorage) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/tx.pb.go b/x/epochstorage/types/tx.pb.go index ba02bab9ca..037a995829 100644 --- a/x/epochstorage/types/tx.pb.go +++ b/x/epochstorage/types/tx.pb.go @@ -35,9 +35,9 @@ var fileDescriptor_7051565dcc1777fe = []byte{ 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0x8d, 0x11, 0x2b, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x93, 0xe7, 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, 0xe9, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x58, 0x55, 0x66, 0xac, 0x5f, 0x81, 0x66, 0x5f, 0x65, 0x41, - 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x4e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x69, 0x2a, - 0x3d, 0x99, 0x00, 0x00, 0x00, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x58, 0x55, 0x66, 0xa2, 0x5f, 0x81, 0x66, 0x5f, 0x65, 0x41, + 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x4e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0xc0, 0x08, + 0x88, 0x99, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/fixationstore/client/cli/query.go b/x/fixationstore/client/cli/query.go index 21d4889884..b136b76365 100644 --- a/x/fixationstore/client/cli/query.go +++ b/x/fixationstore/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/fixationstore/client/cli/query_all_indices.go b/x/fixationstore/client/cli/query_all_indices.go index ee0e0562e4..f1c81d9407 100644 --- a/x/fixationstore/client/cli/query_all_indices.go +++ b/x/fixationstore/client/cli/query_all_indices.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/client/cli/query_entry.go b/x/fixationstore/client/cli/query_entry.go index 576fe7597b..d228ee7cfc 100644 --- a/x/fixationstore/client/cli/query_entry.go +++ b/x/fixationstore/client/cli/query_entry.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/client/cli/query_store_keys.go b/x/fixationstore/client/cli/query_store_keys.go index 51d6ffe3f6..11bb8bd8ac 100644 --- a/x/fixationstore/client/cli/query_store_keys.go +++ b/x/fixationstore/client/cli/query_store_keys.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/client/cli/query_versions.go b/x/fixationstore/client/cli/query_versions.go index 00fe55fdbb..d07a12f7b1 100644 --- a/x/fixationstore/client/cli/query_versions.go +++ b/x/fixationstore/client/cli/query_versions.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/keeper/grpc_query_all_indices.go b/x/fixationstore/keeper/grpc_query_all_indices.go index 19b63b01a7..085ef2a8ab 100644 --- a/x/fixationstore/keeper/grpc_query_all_indices.go +++ b/x/fixationstore/keeper/grpc_query_all_indices.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/grpc_query_entry.go b/x/fixationstore/keeper/grpc_query_entry.go index de6b7a3f7f..7e325cef20 100644 --- a/x/fixationstore/keeper/grpc_query_entry.go +++ b/x/fixationstore/keeper/grpc_query_entry.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/grpc_query_store_keys.go b/x/fixationstore/keeper/grpc_query_store_keys.go index 3101f0d1c7..5946ec8a1e 100644 --- a/x/fixationstore/keeper/grpc_query_store_keys.go +++ b/x/fixationstore/keeper/grpc_query_store_keys.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/grpc_query_versions.go b/x/fixationstore/keeper/grpc_query_versions.go index 59e5b9e266..9332d2569e 100644 --- a/x/fixationstore/keeper/grpc_query_versions.go +++ b/x/fixationstore/keeper/grpc_query_versions.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/keeper.go b/x/fixationstore/keeper/keeper.go index dbe03e9c41..601464f9ab 100644 --- a/x/fixationstore/keeper/keeper.go +++ b/x/fixationstore/keeper/keeper.go @@ -4,8 +4,8 @@ import ( "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/v3/x/fixationstore/types" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" + "github.com/lavanet/lava/v4/x/fixationstore/types" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" ) func NewKeeper(cdc codec.BinaryCodec, tsKeeper *timerstorekeeper.Keeper, getStaleBlocks types.GetStaleBlocks) *Keeper { diff --git a/x/fixationstore/module.go b/x/fixationstore/module.go index 4cc5bd9652..7f85acaa57 100644 --- a/x/fixationstore/module.go +++ b/x/fixationstore/module.go @@ -8,9 +8,9 @@ import ( 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/v3/x/fixationstore/client/cli" - "github.com/lavanet/lava/v3/x/fixationstore/keeper" - "github.com/lavanet/lava/v3/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/fixationstore/client/cli" + "github.com/lavanet/lava/v4/x/fixationstore/keeper" + "github.com/lavanet/lava/v4/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/types/fixation.go b/x/fixationstore/types/fixation.go index 51cebdf0fe..fb83b99a1f 100644 --- a/x/fixationstore/types/fixation.go +++ b/x/fixationstore/types/fixation.go @@ -4,7 +4,7 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/utils/common/types" ) // SafeIndex is a sanitized string, i.e. contains only visible ascii characters diff --git a/x/fixationstore/types/fixation.pb.go b/x/fixationstore/types/fixation.pb.go index f7b0460879..744c9939c7 100644 --- a/x/fixationstore/types/fixation.pb.go +++ b/x/fixationstore/types/fixation.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/timerstore/types" + types "github.com/lavanet/lava/v4/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -250,30 +250,30 @@ var fileDescriptor_872ca3cbd39027a3 = []byte{ // 416 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcd, 0x8e, 0xd3, 0x30, 0x10, 0x8e, 0xb7, 0x69, 0x93, 0xf5, 0xae, 0x38, 0x58, 0x2b, 0x61, 0x82, 0x14, 0x42, 0x11, 0x52, - 0xe0, 0x90, 0xa0, 0xdd, 0x27, 0xe8, 0x4a, 0x08, 0x69, 0xd9, 0x53, 0xb8, 0x71, 0x59, 0xb9, 0xed, + 0xe0, 0x90, 0xa0, 0x85, 0x17, 0xe8, 0x4a, 0x08, 0x69, 0xd9, 0x53, 0xb8, 0x71, 0x59, 0xb9, 0xed, 0x6c, 0xb1, 0x48, 0xe3, 0x2a, 0x9e, 0x46, 0xed, 0x95, 0x27, 0xe0, 0x71, 0xb8, 0x72, 0xeb, 0xb1, 0x47, 0x4e, 0x08, 0xb5, 0x2f, 0x82, 0x62, 0xf7, 0x2f, 0x95, 0xba, 0x27, 0xcf, 0xe7, 0x99, 0xef, - 0x9b, 0xf9, 0xec, 0xa1, 0xef, 0x72, 0x51, 0x89, 0x02, 0x30, 0xad, 0xcf, 0xf4, 0x51, 0xce, 0x04, + 0x9b, 0xf9, 0xec, 0xa1, 0x6f, 0x72, 0x51, 0x89, 0x02, 0x30, 0xad, 0xcf, 0xf4, 0x41, 0xce, 0x04, 0x4a, 0x55, 0x68, 0x54, 0x25, 0xec, 0x50, 0x32, 0x29, 0x15, 0x2a, 0x16, 0x6c, 0x4a, 0x93, 0xfa, - 0x4c, 0x1a, 0xa5, 0xc1, 0xd5, 0x48, 0x8d, 0x94, 0x29, 0x4b, 0xeb, 0xc8, 0x32, 0x82, 0x37, 0x0d, + 0x4c, 0x1a, 0xa5, 0xc1, 0xd5, 0x48, 0x8d, 0x94, 0x29, 0x4b, 0xeb, 0xc8, 0x32, 0x82, 0x57, 0x0d, 0x71, 0x94, 0x63, 0x28, 0xad, 0xb2, 0x09, 0x6d, 0x51, 0xf7, 0x17, 0xa1, 0xed, 0x8f, 0x05, 0x96, 0x73, 0x76, 0x45, 0xdb, 0xb2, 0x18, 0xc2, 0x8c, 0x93, 0x88, 0xc4, 0xe7, 0x99, 0x05, 0xf5, 0x6d, - 0x3f, 0x57, 0x83, 0xef, 0xfc, 0x2c, 0x22, 0xb1, 0x9b, 0x59, 0xc0, 0x5e, 0x50, 0x5f, 0xa3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, 0x42, 0x2f, 0x37, 0x43, 0x7c, 0x41, + 0x81, 0xc0, 0x38, 0xf5, 0x2a, 0x28, 0xb5, 0x54, 0x85, 0x19, 0xc2, 0xcd, 0xb6, 0x90, 0xdd, 0xee, + 0xbb, 0x9d, 0x99, 0x6e, 0x6f, 0x1f, 0xeb, 0xd6, 0x74, 0x76, 0xd4, 0x96, 0x7d, 0xa6, 0x74, 0xff, + 0xa1, 0xe6, 0x0b, 0x2e, 0xae, 0x5f, 0x37, 0xe5, 0xf6, 0xf9, 0xe4, 0x70, 0xc0, 0x8d, 0xd2, 0x01, + 0xfd, 0xe6, 0x76, 0xb1, 0x0a, 0xc9, 0x72, 0x15, 0x92, 0x7f, 0xab, 0x90, 0xfc, 0x5c, 0x87, 0xce, + 0x72, 0x1d, 0x3a, 0x7f, 0xd6, 0xa1, 0xf3, 0xf5, 0xdd, 0x48, 0xe2, 0xb7, 0x69, 0x3f, 0x19, 0xa8, + 0x71, 0xda, 0xd8, 0xa6, 0xea, 0x43, 0x3a, 0x3b, 0xda, 0x57, 0x9c, 0x4f, 0x40, 0xf7, 0x3b, 0x66, + 0xad, 0xde, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x1c, 0xa4, 0x89, 0x38, 0xda, 0x02, 0x00, 0x00, } func (m *Entry) Marshal() (dAtA []byte, err error) { diff --git a/x/fixationstore/types/fixationstore.go b/x/fixationstore/types/fixationstore.go index 825d6a729b..6047cd3627 100644 --- a/x/fixationstore/types/fixationstore.go +++ b/x/fixationstore/types/fixationstore.go @@ -10,8 +10,8 @@ import ( 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/v3/utils" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/utils" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) // FixationStore manages lists of entries with versions in the store. diff --git a/x/fixationstore/types/fixationstore_test.go b/x/fixationstore/types/fixationstore_test.go index 2eb837fca1..3c5080f797 100644 --- a/x/fixationstore/types/fixationstore_test.go +++ b/x/fixationstore/types/fixationstore_test.go @@ -13,7 +13,7 @@ import ( "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/v3/x/timerstore/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/stretchr/testify/require" ) diff --git a/x/fixationstore/types/query.pb.go b/x/fixationstore/types/query.pb.go index c00f16fa80..232853364e 100644 --- a/x/fixationstore/types/query.pb.go +++ b/x/fixationstore/types/query.pb.go @@ -514,47 +514,47 @@ func init() { } var fileDescriptor_300bcc00a24e7b21 = []byte{ - // 639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4f, 0x4f, 0x13, 0x4f, - 0x18, 0xc7, 0x3b, 0xd0, 0x85, 0xf6, 0xe1, 0xf2, 0x63, 0xc2, 0x0f, 0x36, 0xab, 0x59, 0xea, 0x1e, - 0x48, 0x3d, 0xb0, 0x03, 0xed, 0xc1, 0x8b, 0xd1, 0x94, 0xa0, 0xf8, 0x37, 0xd1, 0x35, 0xf1, 0x40, - 0x62, 0xc8, 0x42, 0x87, 0x65, 0xc3, 0xba, 0x53, 0x76, 0x07, 0xc2, 0xa6, 0xe1, 0xe2, 0x2b, 0x30, - 0xf1, 0x1d, 0xf8, 0x02, 0x3c, 0x79, 0x30, 0xf1, 0x0d, 0x70, 0x24, 0xf1, 0xe2, 0xc1, 0x18, 0x03, - 0xbe, 0x10, 0x33, 0x7f, 0x16, 0x4a, 0xc1, 0x2d, 0x55, 0x4f, 0xdd, 0x79, 0xe6, 0xf9, 0x3e, 0xdf, - 0xcf, 0x33, 0x33, 0x4f, 0x0a, 0x73, 0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, 0x35, 0x3d, 0x54, 0xa4, 0x7b, 0x7a, 0x77, 0x07, 0xa4, 0xab, 0x2e, 0xe7, 0x00, - 0xbf, 0x47, 0x50, 0x3d, 0x1d, 0x01, 0xbc, 0x38, 0x10, 0xa4, 0x7f, 0x22, 0xad, 0xc6, 0x30, 0x12, - 0x8d, 0xee, 0x4a, 0xf4, 0x3a, 0x9e, 0x2b, 0x42, 0x3f, 0xa5, 0x4d, 0xf1, 0x27, 0x04, 0x95, 0xfc, - 0x95, 0xe3, 0x85, 0x81, 0x86, 0x7d, 0xf3, 0x66, 0x2d, 0x0e, 0xa1, 0xd0, 0x84, 0x2b, 0x92, 0xb0, - 0x85, 0xef, 0x16, 0x11, 0xee, 0x69, 0xd5, 0xa5, 0x27, 0x4b, 0xba, 0x62, 0x89, 0x3f, 0x22, 0x30, - 0xe4, 0xcb, 0xc2, 0xf3, 0x03, 0x29, 0x7a, 0x67, 0xcd, 0x72, 0xaf, 0x9a, 0xae, 0x89, 0x9f, 0x48, - 0xe2, 0xfb, 0x78, 0xb9, 0x88, 0x58, 0x4a, 0x0a, 0x70, 0x49, 0x57, 0xce, 0xe2, 0xc1, 0xd2, 0xa3, - 0xc3, 0x63, 0x1b, 0x1d, 0x1d, 0xdb, 0xe8, 0xc7, 0xb1, 0x8d, 0xde, 0x9e, 0xd8, 0xa5, 0xa3, 0x13, - 0xbb, 0xf4, 0xf5, 0xc4, 0x2e, 0xad, 0x2e, 0x04, 0x21, 0xdf, 0xda, 0x5d, 0x77, 0x37, 0xd8, 0xeb, - 0xf3, 0x4e, 0x7b, 0x4d, 0xb2, 0xdf, 0x67, 0xc7, 0xb3, 0x0e, 0x4d, 0xd7, 0xc7, 0xe4, 0xff, 0x4a, - 0xf3, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xa6, 0x59, 0xda, 0xfc, 0x06, 0x00, 0x00, + // 637 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00,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74, 0x4d, 0xfc, 0x54, 0x12, 0x3f, + 0xc0, 0x4b, 0x45, 0xc4, 0x52, 0x52, 0x80, 0x4b, 0x3a, 0x72, 0x16, 0xf7, 0x17, 0x1f, 0x1f, 0x1c, + 0xd9, 0xe8, 0xf0, 0xc8, 0x46, 0x3f, 0x8f, 0x6c, 0xf4, 0xee, 0xd8, 0x2e, 0x1d, 0x1e, 0xdb, 0xa5, + 0x6f, 0xc7, 0x76, 0x69, 0x65, 0x2e, 0x08, 0xf9, 0xe6, 0xce, 0x9a, 0xbb, 0xce, 0xde, 0x9c, 0x75, + 0xda, 0xbd, 0x45, 0xf6, 0x7a, 0xec, 0x78, 0xd6, 0xa6, 0xe9, 0xda, 0x88, 0xfc, 0x5f, 0x59, 0xf8, + 0x1d, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x3c, 0xee, 0xf2, 0xfc, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/README.md b/x/pairing/README.md index 593aaad6b4..a89b0eda88 100644 --- a/x/pairing/README.md +++ b/x/pairing/README.md @@ -90,6 +90,16 @@ A consumer sends requests to a provider's endpoint to communicate with them. The Stake entries' storage is managed by the epochstorage module. For more details, see its README. +Providers `DelegateTotal` is the delegators delegations part for this chain and is calculated by as follows: `total_provider_delegations` * `stake` / `total_stake` + +when: + +`stake` is the providers stake on a specific chain + +`total_stake` is the total stake of the provider across all chains + +`total_provider_delegations` is the total delegations for the provider + #### Unstake A provider can unstake and retrieve their coins. When a provider unstakes, they are removed from the pairing list starting from the next epoch. After a specified number of blocks called `UnstakeHoldBlocks` (a parameter of the epochstorage module), the provider is eligible to receive their coins back. @@ -354,6 +364,7 @@ The pairing module supports the following transactions: | `stake-provider` | chain-id (string), amount (Coin), endpoints ([]Endpoint), geolocation (int32), validator (string, optional), --provider-moniker (string) --grant-provider-gas-fees-auth (bool)| stake a provider in a chain with multiple endpoints | | `unfreeze` | chain-ids ([]string) | unfreeze a provider in multiple chains | | `unstake-provider` | chain-ids ([]string), validator (string, optional) | unstake a provider from multiple chains | +| `move-provider-stake` | src-chain dst-chain amount (Coin)| move provider stake amount from one chain to another | Note, the `Coin` type is from Cosmos-SDK (`cosmos.base.v1beta1.Coin`). From the CLI, use `100ulava` to assign a `Coin` argument. The `Endpoint` type defines a provider endpoint. From the CLI, use "my-provider-grpc-addr.com:9090,1" for one endpoint (includes the endpoint's URL+port and the endpoint's geolocation). When it comes to staking-related transactions, the geolocation argument should encompass the geolocations of all the endpoints combined. diff --git a/x/pairing/client/cli/query.go b/x/pairing/client/cli/query.go index e7cf42bb61..69e17c6c8d 100644 --- a/x/pairing/client/cli/query.go +++ b/x/pairing/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/pairing/client/cli/query_account_info.go b/x/pairing/client/cli/query_account_info.go index 64dc98f36b..7065137f78 100644 --- a/x/pairing/client/cli/query_account_info.go +++ b/x/pairing/client/cli/query_account_info.go @@ -7,14 +7,14 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - projecttypes "github.com/lavanet/lava/v3/x/projects/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + projecttypes "github.com/lavanet/lava/v4/x/projects/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_debug_query.go b/x/pairing/client/cli/query_debug_query.go index e596ff3f6a..9a7a0b6503 100644 --- a/x/pairing/client/cli/query_debug_query.go +++ b/x/pairing/client/cli/query_debug_query.go @@ -10,11 +10,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - "github.com/lavanet/lava/v3/x/pairing/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/pairing/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_effective_policy.go b/x/pairing/client/cli/query_effective_policy.go index 050c42117a..f7a4ce565c 100644 --- a/x/pairing/client/cli/query_effective_policy.go +++ b/x/pairing/client/cli/query_effective_policy.go @@ -3,9 +3,9 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_get_pairing.go b/x/pairing/client/cli/query_get_pairing.go index de6ab761c7..ae43b61b8e 100644 --- a/x/pairing/client/cli/query_get_pairing.go +++ b/x/pairing/client/cli/query_get_pairing.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_params.go b/x/pairing/client/cli/query_params.go index 104ea1fdbd..440ec16e87 100644 --- a/x/pairing/client/cli/query_params.go +++ b/x/pairing/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_provider.go b/x/pairing/client/cli/query_provider.go index 5401537286..b599de90c8 100644 --- a/x/pairing/client/cli/query_provider.go +++ b/x/pairing/client/cli/query_provider.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_provider_monthly_payout.go b/x/pairing/client/cli/query_provider_monthly_payout.go index 796c1556e5..c23ed63a33 100644 --- a/x/pairing/client/cli/query_provider_monthly_payout.go +++ b/x/pairing/client/cli/query_provider_monthly_payout.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_provider_pairing_chance.go b/x/pairing/client/cli/query_provider_pairing_chance.go index ecbab9388c..630180ab95 100644 --- a/x/pairing/client/cli/query_provider_pairing_chance.go +++ b/x/pairing/client/cli/query_provider_pairing_chance.go @@ -3,9 +3,9 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_providers.go b/x/pairing/client/cli/query_providers.go index 192a79a879..4acf648314 100644 --- a/x/pairing/client/cli/query_providers.go +++ b/x/pairing/client/cli/query_providers.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_providers_epoch_cu.go b/x/pairing/client/cli/query_providers_epoch_cu.go index bc8de3f00c..a79de4fa72 100644 --- a/x/pairing/client/cli/query_providers_epoch_cu.go +++ b/x/pairing/client/cli/query_providers_epoch_cu.go @@ -3,7 +3,7 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_sdk_pairing.go b/x/pairing/client/cli/query_sdk_pairing.go index 85daebb1c5..4683a0c5dd 100644 --- a/x/pairing/client/cli/query_sdk_pairing.go +++ b/x/pairing/client/cli/query_sdk_pairing.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_static_providers_list.go b/x/pairing/client/cli/query_static_providers_list.go index 4328d30179..d1f1db4fe2 100644 --- a/x/pairing/client/cli/query_static_providers_list.go +++ b/x/pairing/client/cli/query_static_providers_list.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_subscription_monthly_payout.go b/x/pairing/client/cli/query_subscription_monthly_payout.go index e007fefcd2..945b8b741f 100644 --- a/x/pairing/client/cli/query_subscription_monthly_payout.go +++ b/x/pairing/client/cli/query_subscription_monthly_payout.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_user_entry.go b/x/pairing/client/cli/query_user_entry.go index 7b5caef808..f34c2eb5b2 100644 --- a/x/pairing/client/cli/query_user_entry.go +++ b/x/pairing/client/cli/query_user_entry.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_verify_pairing.go b/x/pairing/client/cli/query_verify_pairing.go index 0c2bd8b640..03729a1353 100644 --- a/x/pairing/client/cli/query_verify_pairing.go +++ b/x/pairing/client/cli/query_verify_pairing.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx.go b/x/pairing/client/cli/tx.go index 4ee4bb6fd2..82b7058c06 100644 --- a/x/pairing/client/cli/tx.go +++ b/x/pairing/client/cli/tx.go @@ -15,12 +15,12 @@ import ( "github.com/spf13/cobra" // "github.com/cosmos/cosmos-sdk/client/flags" - lavautils "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - dualstakingTypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/client/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + lavautils "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + dualstakingTypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/client/utils" + "github.com/lavanet/lava/v4/x/pairing/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) @@ -48,6 +48,8 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdUnfreeze()) cmd.AddCommand(CmdModifyProvider()) cmd.AddCommand(CmdSimulateRelayPayment()) + cmd.AddCommand(CmdMoveProviderStake()) + cmd.AddCommand(CmdDistributeProviderStake()) // this line is used by starport scaffolding # 1 @@ -134,12 +136,10 @@ func NewSubmitUnstakeProposalTxCmd() *cobra.Command { content.ProvidersInfo = []types.ProviderUnstakeInfo{{Provider: providerEntry.Address, ChainId: providerEntry.Chain}} content.DelegatorsSlashing = []types.DelegatorSlashing{} for _, delegator := range delegators.Delegations { - if delegator.ChainID == providerEntry.Chain { - content.DelegatorsSlashing = append(content.DelegatorsSlashing, types.DelegatorSlashing{ - Delegator: delegator.Delegator, - SlashingAmount: sdk.NewCoin(commontypes.TokenDenom, delegator.Amount.Amount.MulRaw(int64(slashfactor)).QuoRaw(100)), - }) - } + content.DelegatorsSlashing = append(content.DelegatorsSlashing, types.DelegatorSlashing{ + Delegator: delegator.Delegator, + SlashingAmount: sdk.NewCoin(commontypes.TokenDenom, delegator.Amount.Amount.MulRaw(int64(slashfactor)).QuoRaw(100)), + }) } } diff --git a/x/pairing/client/cli/tx_distribute_provider_stake.go b/x/pairing/client/cli/tx_distribute_provider_stake.go new file mode 100644 index 0000000000..f8808b5275 --- /dev/null +++ b/x/pairing/client/cli/tx_distribute_provider_stake.go @@ -0,0 +1,164 @@ +package cli + +import ( + "context" + "fmt" + "sort" + "strconv" + "strings" + + "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" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdDistributeProviderStake() *cobra.Command { + cmd := &cobra.Command{ + Use: "distribute-provider-stake chain,%,chain,%", + Short: "redistribute providers stake between all the chains it is staked on.", + Long: `sends batch of movestake tx to redistribute the total stake according to the users input, the total percentages must be exactly 100`, + Example: `lavad tx pairing distribute-provider-stake chain0,33,chain1,33,chain2,34"`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + provider := clientCtx.GetFromAddress().String() + + pairingQuerier := types.NewQueryClient(clientCtx) + ctx := context.Background() + response, err := pairingQuerier.Provider(ctx, &types.QueryProviderRequest{Address: provider}) + if err != nil { + return err + } + + msgs, err := CalculateDistbiruitions(provider, response.StakeEntries, args[0]) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +type data struct { + chain string + original math.Int + percent sdk.Dec + target math.Int + diff math.Int +} + +func CalculateDistbiruitions(provider string, entries []epochstoragetypes.StakeEntry, distributionsArg string) ([]sdk.Msg, error) { + splitedArgs := strings.Split(distributionsArg, ",") + if len(splitedArgs)%2 != 0 { + return nil, fmt.Errorf("args must: chain,percent,chain,percent") + } + + totalStake := sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()) + totalP := sdk.ZeroDec() + distributions := []data{} + for i := 0; i < len(splitedArgs); i += 2 { + p, err := sdk.NewDecFromStr(splitedArgs[i+1]) + if err != nil { + return nil, err + } + for _, e := range entries { + if splitedArgs[i] == e.Chain { + distributions = append(distributions, data{chain: e.Chain, original: e.Stake.Amount, percent: p}) + totalStake = totalStake.Add(e.Stake) + totalP = totalP.Add(p) + } + } + } + + 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)) { + return nil, fmt.Errorf("total percentages must be 100") + } + + left := totalStake + excesses := []data{} + deficits := []data{} + for i := 0; i < len(distributions); i++ { + if i == len(distributions)-1 { + distributions[i].target = left.Amount + } else { + distributions[i].target = distributions[i].percent.MulInt(totalStake.Amount).QuoInt64(100).RoundInt() + } + left = left.SubAmount(distributions[i].target) + + if distributions[i].original.GT(distributions[i].target) { + distributions[i].diff = distributions[i].original.Sub(distributions[i].target) + excesses = append(excesses, distributions[i]) + } else if distributions[i].original.LT(distributions[i].target) { + distributions[i].diff = distributions[i].target.Sub(distributions[i].original) + deficits = append(deficits, distributions[i]) + } + } + + // Sort excesses and deficits by points, descending order + sort.Slice(excesses, func(i, j int) bool { + return excesses[i].diff.GT(excesses[j].diff) + }) + sort.Slice(deficits, func(i, j int) bool { + return deficits[i].diff.GT(deficits[j].diff) + }) + + // Match excesses and deficits + msgs := []sdk.Msg{} + excessIdx, deficitIdx := 0, 0 + for excessIdx < len(excesses) && deficitIdx < len(deficits) { + // Move the smaller of the excess or deficit + tokensToMove := excesses[excessIdx].diff + if excesses[excessIdx].diff.GT(deficits[deficitIdx].diff) { + tokensToMove = deficits[deficitIdx].diff + } + + msg := types.NewMsgMoveProviderStake(provider, excesses[excessIdx].chain, deficits[deficitIdx].chain, sdk.NewCoin(commontypes.TokenDenom, tokensToMove)) + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + msgs = append(msgs, msg) + excesses[excessIdx].diff = excesses[excessIdx].diff.Sub(tokensToMove) + deficits[deficitIdx].diff = deficits[deficitIdx].diff.Sub(tokensToMove) + + // If an excess or deficit is fully resolved, move to the next one + if excesses[excessIdx].diff.IsZero() { + excessIdx++ + } + if deficits[deficitIdx].diff.IsZero() { + deficitIdx++ + } + } + + for _, item := range deficits { + if !item.diff.IsZero() { + return nil, fmt.Errorf("failed to distribute provider stake") + } + } + + for _, item := range excesses { + if !item.diff.IsZero() { + return nil, fmt.Errorf("failed to distribute provider stake") + } + } + + return msgs, nil +} diff --git a/x/pairing/client/cli/tx_freeze.go b/x/pairing/client/cli/tx_freeze.go index 5d92601d50..855b5bf351 100644 --- a/x/pairing/client/cli/tx_freeze.go +++ b/x/pairing/client/cli/tx_freeze.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_modify_provider.go b/x/pairing/client/cli/tx_modify_provider.go index 66e9404011..f27a93f4e4 100644 --- a/x/pairing/client/cli/tx_modify_provider.go +++ b/x/pairing/client/cli/tx_modify_provider.go @@ -10,11 +10,11 @@ import ( "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/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_move_provider_stake.go b/x/pairing/client/cli/tx_move_provider_stake.go new file mode 100644 index 0000000000..1a125d5d08 --- /dev/null +++ b/x/pairing/client/cli/tx_move_provider_stake.go @@ -0,0 +1,53 @@ +package cli + +import ( + "fmt" + "strconv" + + "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/x/pairing/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdMoveProviderStake() *cobra.Command { + cmd := &cobra.Command{ + Use: "move-provider-stake src-chain dst-chain amount", + Short: "moves providers stak from one chain to another", + Long: `moves a provider stake amount from source chain to destination chain that the provider is taked in`, + Example: `required flags: --from alice. + lavad tx pairing move-provider-stake chain0 chain1 100ulava"`, + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + srcChain := args[0] + dstChain := args[1] + amount, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return fmt.Errorf("failed to parse amount: %w", err) + } + + msg := types.NewMsgMoveProviderStake( + clientCtx.GetFromAddress().String(), + srcChain, + dstChain, + amount, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/pairing/client/cli/tx_relay_payment.go b/x/pairing/client/cli/tx_relay_payment.go index 33f2e8d6af..ca40458597 100644 --- a/x/pairing/client/cli/tx_relay_payment.go +++ b/x/pairing/client/cli/tx_relay_payment.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_simulate_relay_payment.go b/x/pairing/client/cli/tx_simulate_relay_payment.go index eb9899401a..3d9d5986ad 100644 --- a/x/pairing/client/cli/tx_simulate_relay_payment.go +++ b/x/pairing/client/cli/tx_simulate_relay_payment.go @@ -9,10 +9,10 @@ import ( "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/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_stake_provider.go b/x/pairing/client/cli/tx_stake_provider.go index 794007cd8c..7c377f03b2 100644 --- a/x/pairing/client/cli/tx_stake_provider.go +++ b/x/pairing/client/cli/tx_stake_provider.go @@ -13,11 +13,11 @@ import ( 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/v3/utils" - conflicttypes "github.com/lavanet/lava/v3/x/conflict/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + conflicttypes "github.com/lavanet/lava/v4/x/conflict/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_unfreeze.go b/x/pairing/client/cli/tx_unfreeze.go index 2bcbec29cb..3955d9ec6b 100644 --- a/x/pairing/client/cli/tx_unfreeze.go +++ b/x/pairing/client/cli/tx_unfreeze.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_unstake_provider.go b/x/pairing/client/cli/tx_unstake_provider.go index bb0ddbd799..06cd8da538 100644 --- a/x/pairing/client/cli/tx_unstake_provider.go +++ b/x/pairing/client/cli/tx_unstake_provider.go @@ -10,10 +10,10 @@ import ( "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/v3/utils" - dualstakingclient "github.com/lavanet/lava/v3/x/dualstaking/client/cli" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "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" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/proposal_handler.go b/x/pairing/client/proposal_handler.go index 561959378f..b442f190b9 100644 --- a/x/pairing/client/proposal_handler.go +++ b/x/pairing/client/proposal_handler.go @@ -2,7 +2,7 @@ package client import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/lavanet/lava/v3/x/pairing/client/cli" + "github.com/lavanet/lava/v4/x/pairing/client/cli" ) var PairingUnstakeProposal = govclient.NewProposalHandler(cli.NewSubmitUnstakeProposalTxCmd) diff --git a/x/pairing/client/utils/utils.go b/x/pairing/client/utils/utils.go index 1ef0b6a98d..115de34671 100755 --- a/x/pairing/client/utils/utils.go +++ b/x/pairing/client/utils/utils.go @@ -4,7 +4,7 @@ import ( "os" "github.com/cosmos/cosmos-sdk/codec" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) type ( diff --git a/x/pairing/genesis.go b/x/pairing/genesis.go index d0b17726bf..595cbb5118 100644 --- a/x/pairing/genesis.go +++ b/x/pairing/genesis.go @@ -2,8 +2,8 @@ package pairing import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/pairing/genesis_test.go b/x/pairing/genesis_test.go index 9d5c7407ee..5424e4d5ed 100644 --- a/x/pairing/genesis_test.go +++ b/x/pairing/genesis_test.go @@ -3,10 +3,10 @@ package pairing_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/pairing" - "github.com/lavanet/lava/v3/x/pairing/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/pairing" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/handler.go b/x/pairing/handler.go index 9f036f9c2b..b8ebc5684d 100644 --- a/x/pairing/handler.go +++ b/x/pairing/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) // NewHandler ... @@ -33,6 +33,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { 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) diff --git a/x/pairing/keeper/badge_used_cu.go b/x/pairing/keeper/badge_used_cu.go index 38cb3ff31c..2ba9434267 100644 --- a/x/pairing/keeper/badge_used_cu.go +++ b/x/pairing/keeper/badge_used_cu.go @@ -5,9 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" - timertypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" + timertypes "github.com/lavanet/lava/v4/x/timerstore/types" ) // SetBadgeUsedCu set a specific badgeUsedCu in the store from its index diff --git a/x/pairing/keeper/badge_used_cu_test.go b/x/pairing/keeper/badge_used_cu_test.go index a1f6661414..31a4812884 100644 --- a/x/pairing/keeper/badge_used_cu_test.go +++ b/x/pairing/keeper/badge_used_cu_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/cu_tracker_test.go b/x/pairing/keeper/cu_tracker_test.go index cc5454d765..46ba860cb8 100644 --- a/x/pairing/keeper/cu_tracker_test.go +++ b/x/pairing/keeper/cu_tracker_test.go @@ -6,12 +6,12 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/testutil/common" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) @@ -144,17 +144,17 @@ func TestTrackedCuWithDelegations(t *testing.T) { clientAcct, _ := ts.GetAccount(common.CONSUMER, 0) providerAcct, provider := ts.GetAccount(common.PROVIDER, 0) - // change the provider's delegation limit and commission - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) - require.True(t, found) - stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) + // change the provider's and commission + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + metadata.DelegateCommission = 0 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) ts.AdvanceEpoch() // 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) require.NoError(t, err) ts.AdvanceEpoch() @@ -484,16 +484,16 @@ func TestProviderMonthlyPayoutQuery(t *testing.T) { require.NoError(t, err) ts.AdvanceEpoch() - // change the provider's delegation limit and commission - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) - require.True(t, found) - stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) + // change the provider's and commission + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + metadata.DelegateCommission = 10 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) ts.AdvanceEpoch() // 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) require.NoError(t, err) ts.AdvanceEpoch() ts.AdvanceMonths(1).AdvanceEpoch() // advance first month of delegation so it'll apply @@ -515,12 +515,12 @@ func TestProviderMonthlyPayoutQuery(t *testing.T) { } ts.relayPaymentWithoutPay(relayPaymentMessage, true) - // check for expected balance: credit*100/200 (from spec1) + credit*(100/200)*(2/3) (from spec, considering delegations) - // for credit=100 (first month there was no use, so no credit was spent), expected monthly payout is 50+33 - expectedTotalPayout := uint64(83) + // check for expected balance: (credit*100/200 (from spec1) + credit*(100/200))*(4/5+1/5*commission(10%) (from spec, considering delegations) + // for credit=100 (first month there was no use, so no credit was spent), expected monthly payout is 90 + expectedTotalPayout := uint64(82) expectedPayouts := []types.SubscriptionPayout{ - {Subscription: clientAcc.Addr.String(), ChainId: ts.spec.Index, Amount: 33}, - {Subscription: clientAcc.Addr.String(), ChainId: spec1.Index, Amount: 50}, + {Subscription: clientAcc.Addr.String(), ChainId: ts.spec.Index, Amount: 41}, + {Subscription: clientAcc.Addr.String(), ChainId: spec1.Index, Amount: 41}, } res, err := ts.QueryPairingProviderMonthlyPayout(provider) require.NoError(t, err) @@ -603,16 +603,16 @@ func TestProviderMonthlyPayoutQueryWithContributor(t *testing.T) { require.NoError(t, err) ts.AdvanceEpoch() - // change the provider's delegation limit and commission - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) - require.True(t, found) - stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) + // change the provider's and commission + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + metadata.DelegateCommission = 10 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) ts.AdvanceEpoch() // 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake/2))) require.NoError(t, err) delegationTime := ts.BlockTime() ts.AdvanceEpoch() @@ -622,7 +622,7 @@ func TestProviderMonthlyPayoutQueryWithContributor(t *testing.T) { // now since we want to check the expected reward, before it gets transferred). So, we need to artificially // change the delegations' timestamp to be a month forward fakeTimestamp := ts.BlockTime().AddDate(0, -2, 0) - err = ts.ChangeDelegationTimestamp(provider, delegator, ts.spec.Index, ts.BlockHeight(), ts.GetNextMonth(fakeTimestamp)) + err = ts.ChangeDelegationTimestamp(provider, delegator, ts.BlockHeight(), ts.GetNextMonth(fakeTimestamp)) require.NoError(t, err) // send two relay payments in spec and spec1 @@ -641,16 +641,13 @@ func TestProviderMonthlyPayoutQueryWithContributor(t *testing.T) { } ts.relayPaymentWithoutPay(relayPaymentMessage, true) - // half the plan payment for spec1 is 25. Then it's divided between 2 contributors equally rounded down - expectedContributorPay := uint64(12) - - // for planPrice=100, and equal CU usage for both specs, the expected provider monthly payout is: - // spec (delegator is 33% of stake): planPrice * specUsedCu/totalUsedCu * providerStake/totalStake = 100*0.5*(2/3) = 33 - // spec1 (contributors with commission=50%): planPrice * specUsedCu/totalUsedCu - contributorsPart = 100*0.5 - 24 = 26 - expectedTotalPayout := uint64(59) + // check for expected balance: planPrice*(100/200 (from spec1) + planPrice*(100/200))*(4/5 + 1/5*0.1) (from spec, considering delegations) + // for planPrice=100, expected monthly payout is 50 (spec1 with contributor) + 33 (normal spec no contributor) + expectedContributorPay := uint64(12) // half the plan payment for spec1:25 then divided between contributors half half rounded down + expectedTotalPayout := uint64(85) - expectedContributorPay*2 expectedPayouts := []types.SubscriptionPayout{ - {Subscription: clientAcc.Addr.String(), ChainId: ts.spec.Index, Amount: 33}, - {Subscription: clientAcc.Addr.String(), ChainId: spec1.Index, Amount: 26}, + {Subscription: clientAcc.Addr.String(), ChainId: ts.spec.Index, Amount: 41}, + {Subscription: clientAcc.Addr.String(), ChainId: spec1.Index, Amount: 20}, // 50 - 26 for contributors (each contributor gets 12) } res, err := ts.QueryPairingProviderMonthlyPayout(provider) require.NoError(t, err) @@ -690,7 +687,7 @@ func TestProviderMonthlyPayoutQueryWithContributor(t *testing.T) { // advance month + blocksToSave + 1 to trigger the monthly payment // (also restore delegation original timestamp) oldBalance := ts.GetBalance(providerAcct.Vault.Addr) - err = ts.ChangeDelegationTimestamp(provider, delegator, ts.spec.Index, ts.BlockHeight(), ts.GetNextMonth(delegationTime)) + err = ts.ChangeDelegationTimestamp(provider, delegator, ts.BlockHeight(), ts.GetNextMonth(delegationTime)) require.NoError(t, err) ts.AdvanceMonths(1) diff --git a/x/pairing/keeper/delegator_rewards_test.go b/x/pairing/keeper/delegator_rewards_test.go index a8049e9811..e7038f9285 100644 --- a/x/pairing/keeper/delegator_rewards_test.go +++ b/x/pairing/keeper/delegator_rewards_test.go @@ -5,12 +5,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - "github.com/lavanet/lava/v3/x/pairing/types" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + "github.com/lavanet/lava/v4/x/pairing/types" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) @@ -72,25 +71,26 @@ func TestProviderDelegatorsRewards(t *testing.T) { if amount1.IsZero() { amount1.Amount = sdk.OneInt() } - _, err = ts.TxDualstakingDelegate(delegator1, provider, ts.spec.Index, amount1) + _, err = ts.TxDualstakingDelegate(delegator1, provider, amount1) require.NoError(t, err) amount2 := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(tt.d2Amount*delegationAmount/100)) - _, err = ts.TxDualstakingDelegate(delegator2, provider, ts.spec.Index, amount2) + _, err = ts.TxDualstakingDelegate(delegator2, provider, amount2) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations // change delegation traits of stake entry and get the modified one - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) - require.True(t, found) - stakeEntry.DelegateCommission = tt.commission - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + metadata.DelegateCommission = tt.commission + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) + ts.AdvanceEpoch() - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) // check that there are two delegators - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 3, len(res.Delegations)) @@ -187,33 +187,41 @@ func TestProviderRewardWithCommission(t *testing.T) { ts.AdvanceEpoch() // to apply pairing delegationAmount1 := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) - _, err = ts.TxDualstakingDelegate(delegator1, provider, ts.spec.Index, delegationAmount1) + _, err = ts.TxDualstakingDelegate(delegator1, provider, delegationAmount1) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) - require.True(t, found) - // ** provider's commission is 100% ** // + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + metadata.DelegateCommission = 100 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) - stakeEntry.DelegateCommission = 100 - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) // the expected reward for the provider with 100% commission is the total rewards (delegators get nothing) currentTimestamp := ts.Ctx.BlockTime().UTC().Unix() - relevantDelegations := lavaslices.Filter(res.Delegations, - func(d dualstakingtypes.Delegation) bool { - return d.ChainID == ts.spec.Index && d.IsFirstWeekPassed(currentTimestamp) - }) totalReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.NewInt(int64(relayCuSum)))) - providerReward, _ := ts.Keepers.Dualstaking.CalcRewards(ts.Ctx, stakeEntry, totalReward, relevantDelegations) + + relevantDelegations := []dualstakingtypes.Delegation{} + totalDelegations := sdk.ZeroInt() + var selfdelegation dualstakingtypes.Delegation + for _, d := range res.Delegations { + if d.Delegator != stakeEntry.Vault { + selfdelegation = d + } else if d.IsFirstWeekPassed(currentTimestamp) { + relevantDelegations = append(relevantDelegations, d) + totalDelegations = totalDelegations.Add(d.Amount.Amount) + } + } + + providerReward, _ := ts.Keepers.Dualstaking.CalcRewards(ts.Ctx, totalReward, totalDelegations, selfdelegation, relevantDelegations, stakeEntry.DelegateCommission) require.True(t, totalReward.IsEqual(providerReward)) @@ -227,8 +235,11 @@ func TestProviderRewardWithCommission(t *testing.T) { require.Equal(t, 0, len(resRewards.Rewards)) // ** provider's commission is 0% ** // - stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) + metadata, err1 := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err1) + metadata.DelegateCommission = 0 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) + ts.AdvanceEpoch() // the expected reward for the provider with 0% commission is half of the total rewards @@ -301,16 +312,16 @@ func TestQueryDelegatorRewards(t *testing.T) { ts.AdvanceEpoch() - makeProviderCommissionZero(ts, ts.spec.Index, provider1) - makeProviderCommissionZero(ts, spec1.Index, provider1) - makeProviderCommissionZero(ts, ts.spec.Index, provider2) + makeProviderCommissionZero(ts, provider1) + makeProviderCommissionZero(ts, provider1) + makeProviderCommissionZero(ts, provider2) delegationAmount := sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) - _, err = ts.TxDualstakingDelegate(delegator1, provider1, ts.spec.Index, delegationAmount) + _, err = ts.TxDualstakingDelegate(delegator1, provider1, delegationAmount) require.NoError(t, err) - _, err = ts.TxDualstakingDelegate(delegator1, provider1, spec1.Index, delegationAmount) + _, err = ts.TxDualstakingDelegate(delegator1, provider1, delegationAmount) require.NoError(t, err) - _, err = ts.TxDualstakingDelegate(delegator1, provider2, ts.spec.Index, delegationAmount) + _, err = ts.TxDualstakingDelegate(delegator1, provider2, delegationAmount) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations @@ -337,12 +348,11 @@ func TestQueryDelegatorRewards(t *testing.T) { chainID string expectedRewards int64 }{ - {"assigned provider+chainID", delegator1, provider1, ts.spec.Index, (planPrice * 100) / (200 * 2)}, + {"assigned provider+chainID", delegator1, provider1, ts.spec.Index, 2 * (planPrice * 100) / (200 * 2)}, {"assigned provider", delegator1, provider1, "", 2 * ((planPrice * 100) / (200 * 2))}, {"nothing assigned", delegator1, "", "", (2 * ((planPrice * 100) / (200 * 2))) + (planPrice*100)/(100*2)}, {"invalid delegator", delegator2, provider2, spec1.Index, 0}, {"invalid provider", delegator1, provider3, ts.spec.Index, 0}, - {"invalid chain ID", delegator1, provider2, spec1.Index, 0}, } for _, tt := range tests { @@ -410,11 +420,13 @@ func TestVaultProviderDelegatorRewardsQuery(t *testing.T) { } } -func makeProviderCommissionZero(ts *tester, chainID string, provider string) { - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, chainID, provider) - require.True(ts.T, found) - stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) +func makeProviderCommissionZero(ts *tester, provider string) { + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + if err != nil { + panic(err) + } + metadata.DelegateCommission = 0 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) ts.AdvanceEpoch() } @@ -429,13 +441,13 @@ func TestDelegationTimestamp(t *testing.T) { _, delegator := ts.GetAccount(common.CONSUMER, 1) // delegate and check the timestamp is equal to current time + month - currentTimeAfterMonth := ts.GetNextMonth(ts.BlockTime()) - _, err := ts.TxDualstakingDelegate(delegator, provider, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + currentTimeAfterMonth := ts.BlockTime().AddDate(0, 0, 7).UTC().Unix() + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) // expect two because of provider self delegation + delegator for _, d := range res.Delegations { @@ -447,11 +459,11 @@ 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err = ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - res, err = ts.QueryDualstakingProviderDelegators(provider, false) + res, err = ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) // expect two because of provider self delegation + delegator for _, d := range res.Delegations { @@ -478,19 +490,19 @@ func TestDelegationFirstMonthPairing(t *testing.T) { ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - // delegate and check the delegation's timestamp is equal than nowPlusMonthTime - nowPlusMonthTime := ts.GetNextMonth(ts.BlockTime()) + // 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) // expect two because of provider self delegation + delegator for _, d := range res.Delegations { if d.Delegator == delegator { - require.Equal(t, nowPlusMonthTime, d.Timestamp) + require.Equal(t, nowPlusWeekTime, d.Timestamp) } } @@ -518,21 +530,21 @@ func TestDelegationFirstMonthReward(t *testing.T) { require.True(t, found) ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - makeProviderCommissionZero(ts, ts.spec.Index, provider) + makeProviderCommissionZero(ts, provider) - // delegate and check the delegation's timestamp is equal to nowPlusMonthTime - nowPlusMonthTime := ts.GetNextMonth(ts.BlockTime()) + // 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) // expect two because of provider self delegation + delegator for _, d := range res.Delegations { if d.Delegator == delegator { - require.Equal(t, nowPlusMonthTime, d.Timestamp) + require.Equal(t, nowPlusWeekTime, d.Timestamp) } } @@ -572,29 +584,29 @@ func TestRedelegationFirstMonthReward(t *testing.T) { require.True(t, found) ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - makeProviderCommissionZero(ts, ts.spec.Index, provider1) - makeProviderCommissionZero(ts, ts.spec.Index, provider) + makeProviderCommissionZero(ts, provider1) + makeProviderCommissionZero(ts, provider) - // delegate and check the delegation's timestamp is equal to nowPlusMonthTime - nowPlusMonthTime := ts.GetNextMonth(ts.BlockTime()) + // 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, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - res, err := ts.QueryDualstakingProviderDelegators(provider, false) + res, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) // expect two because of provider self delegation + delegator for _, d := range res.Delegations { if d.Delegator == delegator { - require.Equal(t, nowPlusMonthTime, d.Timestamp) + require.Equal(t, nowPlusWeekTime, d.Timestamp) } } // advance a month a redelegate some of the funds to the second provider ts.AdvanceMonths(1) redelegateAmount := sdk.NewCoin(ts.TokenDenom(), res.Delegations[0].Amount.Amount.QuoRaw(2)) - _, err = ts.TxDualstakingRedelegate(delegator, provider, provider1, ts.spec.Index, ts.spec.Index, redelegateAmount) + _, err = ts.TxDualstakingRedelegate(delegator, provider, provider1, redelegateAmount) require.NoError(t, err) // to trigger the payment's code, we need to advance a month+blocksToSave. If we do that, @@ -620,3 +632,84 @@ func TestRedelegationFirstMonthReward(t *testing.T) { require.NoError(t, err) require.Equal(t, 1, len(resRewards.Rewards)) } + +// TestDelegatorRewardProviderAddingChain checks that a delegator gets rewards even if the provider moves stake between chains +func TestDelegatorRewardProviderAddingChain(t *testing.T) { + ts := newTester(t) + ts.setupForPayments(1, 0, 2) // 1 providers, 1 client, 1 providersToPair + ts.AddAccount(common.CONSUMER, 1, testBalance) // add delegator1 + + providerAcc, provider := ts.GetAccount(common.PROVIDER, 0) + _, delegator := ts.GetAccount(common.CONSUMER, 1) + clientAcc, client := ts.AddAccount(common.CONSUMER, 0, testBalance) + makeProviderCommissionZero(ts, provider) + + _, err := ts.TxDualstakingDelegate(delegator, provider, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake))) + require.NoError(t, err) + ts.AdvanceEpoch() // apply delegations + + _, err = ts.TxSubscriptionBuy(client, client, ts.plan.Index, 1, true, false) + require.NoError(t, err) + + ts.AdvanceEpoch() // to apply pairing + + relayPaymentMessage := sendRelay(ts, provider, clientAcc, []string{ts.spec.Index}) + _, err = ts.TxPairingRelayPayment(relayPaymentMessage.Creator, relayPaymentMessage.Relays...) + require.Nil(ts.T, err) + + // advance month + blocksToSave + 1 to trigger the provider monthly payment + ts.AdvanceMonths(1) + ts.AdvanceEpoch() + ts.AdvanceBlocks(ts.BlocksToSave() + 1) + + // delegator should get half of the payment + res, err := ts.QueryDualstakingDelegatorRewards(delegator, provider, "") + require.Nil(ts.T, err) + require.Equal(ts.T, ts.plan.Price.Amount.QuoRaw(2), res.Rewards[0].Amount[0].Amount) + ts.TxDualstakingClaimRewards(delegator, "") + + // add additional spec + spec1 := common.CreateMockSpec() + spec1.Index = "mock1" + spec1.Name = "mock1" + ts.AddSpec(spec1.Index, spec1) + err = ts.StakeProvider(providerAcc.GetVaultAddr(), provider, spec1, testStake) + makeProviderCommissionZero(ts, provider) + require.NoError(t, err) + + ts.AdvanceEpoch() + + relayPaymentMessage = sendRelay(ts, provider, clientAcc, []string{ts.spec.Index, spec1.Index}) + _, err = ts.TxPairingRelayPayment(relayPaymentMessage.Creator, relayPaymentMessage.Relays...) + require.Nil(ts.T, err) + + // advance month + blocksToSave + 1 to trigger the provider monthly payment + ts.AdvanceMonths(1) + ts.AdvanceEpoch() + ts.AdvanceBlocks(ts.BlocksToSave() + 1) + + // delegator should get third of the payment + res, err = ts.QueryDualstakingDelegatorRewards(delegator, provider, "") + require.Nil(ts.T, err) + require.Equal(ts.T, ts.plan.Price.Amount.QuoRaw(3).AddRaw(1), res.Rewards[0].Amount[0].Amount) + ts.TxDualstakingClaimRewards(delegator, "") + + // move the stake between chains, should still get third + relayPaymentMessage = sendRelay(ts, provider, clientAcc, []string{ts.spec.Index, spec1.Index}) + _, 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))) + require.Nil(ts.T, err) + + // advance month + blocksToSave + 1 to trigger the provider monthly payment + ts.AdvanceMonths(1) + ts.AdvanceEpoch() + ts.AdvanceBlocks(ts.BlocksToSave() + 1) + + // delegator should get half of the payment + res, err = ts.QueryDualstakingDelegatorRewards(delegator, provider, "") + require.Nil(ts.T, err) + require.Equal(ts.T, ts.plan.Price.Amount.QuoRaw(3).AddRaw(1), res.Rewards[0].Amount[0].Amount) + ts.TxDualstakingClaimRewards(delegator, "") +} diff --git a/x/pairing/keeper/discipline.go b/x/pairing/keeper/discipline.go index d6db6c2997..aa0f8d732a 100644 --- a/x/pairing/keeper/discipline.go +++ b/x/pairing/keeper/discipline.go @@ -4,7 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) func (k Keeper) JailEntry(ctx sdk.Context, address string, chainID string, jailStartBlock, jailBlocks uint64, bail sdk.Coin) error { diff --git a/x/pairing/keeper/epoch_cu.go b/x/pairing/keeper/epoch_cu.go index 98c798f8b7..a7763b27db 100644 --- a/x/pairing/keeper/epoch_cu.go +++ b/x/pairing/keeper/epoch_cu.go @@ -4,8 +4,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/cachekv" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" ) // UniqueEpochSession is used to detect double spend attacks diff --git a/x/pairing/keeper/epoch_cu_test.go b/x/pairing/keeper/epoch_cu_test.go index aa69bae89e..f0a40f64d4 100644 --- a/x/pairing/keeper/epoch_cu_test.go +++ b/x/pairing/keeper/epoch_cu_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/epoch_payment.go b/x/pairing/keeper/epoch_payment.go index 488219bbd5..09ee4f07b3 100644 --- a/x/pairing/keeper/epoch_payment.go +++ b/x/pairing/keeper/epoch_payment.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) // AddEpochPayment adds a new epoch payment and returns the updated CU used between provider and project diff --git a/x/pairing/keeper/filters/addon_filter.go b/x/pairing/keeper/filters/addon_filter.go index d8be7adb99..d4025ecb96 100644 --- a/x/pairing/keeper/filters/addon_filter.go +++ b/x/pairing/keeper/filters/addon_filter.go @@ -4,9 +4,9 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) type AddonFilter struct { diff --git a/x/pairing/keeper/filters/filter.go b/x/pairing/keeper/filters/filter.go index 097ccee0cc..1ec9953132 100644 --- a/x/pairing/keeper/filters/filter.go +++ b/x/pairing/keeper/filters/filter.go @@ -4,11 +4,11 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingscores "github.com/lavanet/lava/v3/x/pairing/keeper/scores" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingscores "github.com/lavanet/lava/v4/x/pairing/keeper/scores" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) // The Filter interface allows creating filters that filter out providers in the pairing process. diff --git a/x/pairing/keeper/filters/filter_test.go b/x/pairing/keeper/filters/filter_test.go index b32e43b5c2..e84c2c877a 100644 --- a/x/pairing/keeper/filters/filter_test.go +++ b/x/pairing/keeper/filters/filter_test.go @@ -5,8 +5,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/filters/frozen_providers_filter.go b/x/pairing/keeper/filters/frozen_providers_filter.go index 5dc4bcd5fc..ea33310ee9 100644 --- a/x/pairing/keeper/filters/frozen_providers_filter.go +++ b/x/pairing/keeper/filters/frozen_providers_filter.go @@ -2,8 +2,8 @@ package filters import ( sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) type FrozenProvidersFilter struct{} diff --git a/x/pairing/keeper/filters/geolocation_filter.go b/x/pairing/keeper/filters/geolocation_filter.go index 8d614e0372..307f10d640 100644 --- a/x/pairing/keeper/filters/geolocation_filter.go +++ b/x/pairing/keeper/filters/geolocation_filter.go @@ -2,8 +2,8 @@ package filters import ( sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) // TODO: This filter is disabled (InitFilter always returns false) diff --git a/x/pairing/keeper/filters/selected_providers_filter.go b/x/pairing/keeper/filters/selected_providers_filter.go index ec15fcdc5f..8f0fbcedab 100644 --- a/x/pairing/keeper/filters/selected_providers_filter.go +++ b/x/pairing/keeper/filters/selected_providers_filter.go @@ -2,8 +2,8 @@ package filters import ( sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) type SelectedProvidersFilter struct { diff --git a/x/pairing/keeper/fixation_test.go b/x/pairing/keeper/fixation_test.go index b504bab17b..612da1af03 100644 --- a/x/pairing/keeper/fixation_test.go +++ b/x/pairing/keeper/fixation_test.go @@ -4,9 +4,9 @@ import ( "strconv" "testing" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/grpc_query.go b/x/pairing/keeper/grpc_query.go index cc13962edf..c421a0b6c3 100644 --- a/x/pairing/keeper/grpc_query.go +++ b/x/pairing/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/pairing/keeper/grpc_query_effective_policy.go b/x/pairing/keeper/grpc_query_effective_policy.go index 8a2d5ee29a..2ba07c03e2 100644 --- a/x/pairing/keeper/grpc_query_effective_policy.go +++ b/x/pairing/keeper/grpc_query_effective_policy.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/pairing/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_effective_policy_test.go b/x/pairing/keeper/grpc_query_effective_policy_test.go index a230c4b099..2b7d07e1b6 100644 --- a/x/pairing/keeper/grpc_query_effective_policy_test.go +++ b/x/pairing/keeper/grpc_query_effective_policy_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/testutil/common" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/grpc_query_get_pairing.go b/x/pairing/keeper/grpc_query_get_pairing.go index 42ab6c3d2d..88d49e2c55 100644 --- a/x/pairing/keeper/grpc_query_get_pairing.go +++ b/x/pairing/keeper/grpc_query_get_pairing.go @@ -6,9 +6,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_params.go b/x/pairing/keeper/grpc_query_params.go index 3c1bacc8fe..f060dbef67 100644 --- a/x/pairing/keeper/grpc_query_params.go +++ b/x/pairing/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_params_test.go b/x/pairing/keeper/grpc_query_params_test.go index 3fe74bce2a..be349519c9 100644 --- a/x/pairing/keeper/grpc_query_params_test.go +++ b/x/pairing/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/grpc_query_provider.go b/x/pairing/keeper/grpc_query_provider.go index e23711c1f8..69d107ff5e 100644 --- a/x/pairing/keeper/grpc_query_provider.go +++ b/x/pairing/keeper/grpc_query_provider.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -17,9 +17,14 @@ func (k Keeper) Provider(goCtx context.Context, req *types.QueryProviderRequest) ctx := sdk.UnwrapSDKContext(goCtx) + metadata, err := k.epochStorageKeeper.GetMetadata(ctx, req.Address) + if err != nil { + return &types.QueryProviderResponse{}, nil + } + chains := []string{req.ChainID} if req.ChainID == "" { - chains = k.specKeeper.GetAllChainIDs(ctx) + chains = metadata.Chains } stakeEntries := []epochstoragetypes.StakeEntry{} @@ -28,7 +33,10 @@ func (k Keeper) Provider(goCtx context.Context, req *types.QueryProviderRequest) if !found { continue } - stakeEntry.Moniker = stakeEntry.Description.Moniker + stakeEntry.Description = metadata.Description + stakeEntry.Moniker = metadata.Description.Moniker + stakeEntry.DelegateCommission = metadata.DelegateCommission + stakeEntry.Vault = metadata.Vault stakeEntries = append(stakeEntries, stakeEntry) } diff --git a/x/pairing/keeper/grpc_query_provider_monthly_payout.go b/x/pairing/keeper/grpc_query_provider_monthly_payout.go index 1268a2bd82..15c25fde77 100644 --- a/x/pairing/keeper/grpc_query_provider_monthly_payout.go +++ b/x/pairing/keeper/grpc_query_provider_monthly_payout.go @@ -5,10 +5,10 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" - subsciption "github.com/lavanet/lava/v3/x/subscription/keeper" - subsciptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" + subsciption "github.com/lavanet/lava/v4/x/subscription/keeper" + subsciptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_provider_pairing_chance.go b/x/pairing/keeper/grpc_query_provider_pairing_chance.go index b4081c7581..0e720395f8 100644 --- a/x/pairing/keeper/grpc_query_provider_pairing_chance.go +++ b/x/pairing/keeper/grpc_query_provider_pairing_chance.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_providers.go b/x/pairing/keeper/grpc_query_providers.go index 182748f4f7..440665cc60 100644 --- a/x/pairing/keeper/grpc_query_providers.go +++ b/x/pairing/keeper/grpc_query_providers.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -19,16 +19,24 @@ func (k Keeper) Providers(goCtx context.Context, req *types.QueryProvidersReques stakeEntries := k.epochStorageKeeper.GetAllStakeEntriesCurrentForChainId(ctx, req.ChainID) - if !req.ShowFrozen { - stakeEntriesNoFrozen := []epochstoragetypes.StakeEntry{} - for i := range stakeEntries { - stakeEntries[i].Moniker = stakeEntries[i].Description.Moniker - - // show providers with valid stakeAppliedBlock (frozen providers have stakeAppliedBlock = MaxUint64) - if stakeEntries[i].GetStakeAppliedBlock() <= uint64(ctx.BlockHeight()) { - stakeEntriesNoFrozen = append(stakeEntriesNoFrozen, stakeEntries[i]) - } + stakeEntriesNoFrozen := []epochstoragetypes.StakeEntry{} + for i := range stakeEntries { + metadata, err := k.epochStorageKeeper.GetMetadata(ctx, stakeEntries[i].Address) + if err != nil { + return nil, err + } + stakeEntries[i].DelegateCommission = metadata.DelegateCommission + stakeEntries[i].Description = metadata.Description + stakeEntries[i].Moniker = metadata.Description.Moniker + stakeEntries[i].Vault = metadata.Vault + + // show providers with valid stakeAppliedBlock (frozen providers have stakeAppliedBlock = MaxUint64) + if !req.ShowFrozen && stakeEntries[i].GetStakeAppliedBlock() <= uint64(ctx.BlockHeight()) { + stakeEntriesNoFrozen = append(stakeEntriesNoFrozen, stakeEntries[i]) } + } + + if !req.ShowFrozen { stakeEntries = stakeEntriesNoFrozen } diff --git a/x/pairing/keeper/grpc_query_providers_epoch_cu.go b/x/pairing/keeper/grpc_query_providers_epoch_cu.go index 296ab3c7dc..76e7d389e4 100644 --- a/x/pairing/keeper/grpc_query_providers_epoch_cu.go +++ b/x/pairing/keeper/grpc_query_providers_epoch_cu.go @@ -5,7 +5,7 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_static_providers_list.go b/x/pairing/keeper/grpc_query_static_providers_list.go index 9ed0c061ec..28ad425ed5 100644 --- a/x/pairing/keeper/grpc_query_static_providers_list.go +++ b/x/pairing/keeper/grpc_query_static_providers_list.go @@ -5,9 +5,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_subscription_monthly_payout.go b/x/pairing/keeper/grpc_query_subscription_monthly_payout.go index cc1f50ad2d..7d9d0eeab4 100644 --- a/x/pairing/keeper/grpc_query_subscription_monthly_payout.go +++ b/x/pairing/keeper/grpc_query_subscription_monthly_payout.go @@ -6,10 +6,10 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" - subsciption "github.com/lavanet/lava/v3/x/subscription/keeper" - subsciptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" + subsciption "github.com/lavanet/lava/v4/x/subscription/keeper" + subsciptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_user_entry.go b/x/pairing/keeper/grpc_query_user_entry.go index f100d5f60c..6915cf8401 100644 --- a/x/pairing/keeper/grpc_query_user_entry.go +++ b/x/pairing/keeper/grpc_query_user_entry.go @@ -5,9 +5,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_verify_pairing.go b/x/pairing/keeper/grpc_query_verify_pairing.go index bb1deab9a3..b077894097 100644 --- a/x/pairing/keeper/grpc_query_verify_pairing.go +++ b/x/pairing/keeper/grpc_query_verify_pairing.go @@ -6,7 +6,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/helpers_test.go b/x/pairing/keeper/helpers_test.go index e1509bd73b..ed1d64adcb 100644 --- a/x/pairing/keeper/helpers_test.go +++ b/x/pairing/keeper/helpers_test.go @@ -5,13 +5,13 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - testutil "github.com/lavanet/lava/v3/testutil/keeper" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/common" + testutil "github.com/lavanet/lava/v4/testutil/keeper" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) @@ -73,24 +73,30 @@ func (ts *tester) addValidators(count int) { // addProvider: with default endpoints, geolocation, moniker func (ts *tester) addProvider(count int) error { d := common.MockDescription() - return ts.addProviderExtra(count, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) // default: endpoints, geolocation, moniker + return ts.addProviderExtra(count, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, ts.spec) // default: endpoints, geolocation, moniker +} + +// addProvider: with default endpoints, geolocation, moniker +func (ts *tester) addProviderSpec(count int, spec string) error { + d := common.MockDescription() + return ts.addProviderExtra(count, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, ts.Spec(spec)) } // addProviderGelocation: with geolocation, and default endpoints, moniker func (ts *tester) addProviderGeolocation(count int, geolocation int32) error { d := common.MockDescription() - return ts.addProviderExtra(count, nil, geolocation, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + return ts.addProviderExtra(count, nil, geolocation, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, ts.spec) } // addProviderEndpoints: with endpoints, and default geolocation, moniker func (ts *tester) addProviderEndpoints(count int, endpoints []epochstoragetypes.Endpoint) error { d := common.MockDescription() - return ts.addProviderExtra(count, endpoints, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + return ts.addProviderExtra(count, endpoints, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, ts.spec) } // addProviderDescription: with description, and default endpoints, geolocation func (ts *tester) addProviderDescription(count int, moniker string, identity string, website string, securityContact string, descriptionDetails string) error { - return ts.addProviderExtra(count, nil, 0, moniker, identity, website, securityContact, descriptionDetails) + return ts.addProviderExtra(count, nil, 0, moniker, identity, website, securityContact, descriptionDetails, ts.spec) } // addProviderExtra: with mock endpoints, and preset geolocation, description details @@ -103,11 +109,12 @@ func (ts *tester) addProviderExtra( website string, securityContact string, descriptionDetails string, + spec spectypes.Spec, ) error { start := len(ts.Accounts(common.PROVIDER)) for i := 0; i < count; i++ { acc, addr := ts.AddAccount(common.PROVIDER, start+i, testBalance) - err := ts.StakeProviderExtra(acc.GetVaultAddr(), addr, ts.spec, testStake, endpoints, geoloc, moniker, identity, website, securityContact, descriptionDetails) + err := ts.StakeProviderExtra(acc.GetVaultAddr(), addr, spec, testStake, endpoints, geoloc, moniker, identity, website, securityContact, descriptionDetails) if err != nil { return err } diff --git a/x/pairing/keeper/keeper.go b/x/pairing/keeper/keeper.go index 88642b77c0..62050236aa 100644 --- a/x/pairing/keeper/keeper.go +++ b/x/pairing/keeper/keeper.go @@ -4,15 +4,15 @@ import ( "fmt" storetypes "github.com/cosmos/cosmos-sdk/store/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/pairing/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) type ( diff --git a/x/pairing/keeper/limitConsumer.go b/x/pairing/keeper/limitConsumer.go index 43062c85da..3578c25d54 100644 --- a/x/pairing/keeper/limitConsumer.go +++ b/x/pairing/keeper/limitConsumer.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) func (k Keeper) EnforceClientCUsUsageInEpoch(ctx sdk.Context, relayCU, epochAllowedCU, totalCUInEpochForUserProvider uint64, clientAddr sdk.AccAddress, chainID string, epoch uint64) (uint64, error) { diff --git a/x/pairing/keeper/limitConsumer_test.go b/x/pairing/keeper/limitConsumer_test.go index ada0c67360..68bb267905 100644 --- a/x/pairing/keeper/limitConsumer_test.go +++ b/x/pairing/keeper/limitConsumer_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/migrations.go b/x/pairing/keeper/migrations.go index 00b21034ce..da8dafc7e7 100644 --- a/x/pairing/keeper/migrations.go +++ b/x/pairing/keeper/migrations.go @@ -4,8 +4,10 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - v2 "github.com/lavanet/lava/v3/x/pairing/migrations/v2" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/lavanet/lava/v4/utils/lavaslices" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + v2 "github.com/lavanet/lava/v4/x/pairing/migrations/v2" ) type Migrator struct { @@ -24,33 +26,83 @@ func (m Migrator) MigrateVersion2To3(ctx sdk.Context) error { return nil } -// MigrateVersion3To4 fix delegation total in the stake entries -func (m Migrator) MigrateVersion3To4(ctx sdk.Context) error { +func (m Migrator) MigrateVersion4To5(ctx sdk.Context) error { entries := m.keeper.epochStorageKeeper.GetAllStakeEntriesCurrent(ctx) - epoch := m.keeper.epochStorageKeeper.GetCurrentNextEpoch(ctx) - for _, e := range entries { - delegations, err := m.keeper.dualstakingKeeper.GetProviderDelegators(ctx, e.Address, epoch) + providerMap := map[string][]*epochstoragetypes.StakeEntry{} + + // map the providers + for i := range entries { + providerMap[entries[i].Address] = append(providerMap[entries[i].Address], &entries[i]) + } + + // iterate over each provider + for address, entries := range providerMap { + metadata := epochstoragetypes.ProviderMetadata{Provider: address} + + // find the biggest vault + var biggestVault *epochstoragetypes.StakeEntry + biggestEntry := entries[0] + for i := range entries { + e := entries[i] + if biggestEntry.Stake.Amount.LT(e.Stake.Amount) { + biggestEntry = e + } + if e.Vault != e.Address { + if biggestVault == nil { + biggestVault = e + } else if biggestVault.Stake.Amount.LT(e.Stake.Amount) { + biggestVault = e + } + } + } + + // if no vault was found the vault is the address + metadata.Description = biggestEntry.Description + metadata.DelegateCommission = biggestEntry.DelegateCommission + metadata.Provider = address + if biggestVault != nil { + metadata.Vault = biggestVault.Vault + } else { + metadata.Vault = address + } + + // get all delegations and sum + delegations, err := m.keeper.dualstakingKeeper.GetProviderDelegators(ctx, metadata.Provider) if err != nil { - utils.LavaFormatError("failed getting provider delegators at MigrateVersion3To4", err, utils.LogAttr("provider", e.Address)) - continue + return err } - delegateTotal := sdk.ZeroInt() + metadata.TotalDelegations = sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()) for _, d := range delegations { - if e.Address == d.Delegator || e.Vault == d.Delegator || d.ChainID != e.Chain { - continue + if d.Delegator != metadata.Vault { + metadata.TotalDelegations = metadata.TotalDelegations.Add(d.Amount) } - delegateTotal = delegateTotal.Add(d.Amount.Amount) } - if !e.DelegateTotal.Amount.Equal(delegateTotal) { - fmt.Println("fixing delegate total for", e.Address, e.Chain) - e.DelegateTotal.Amount = delegateTotal - if e.TotalStake().LT(m.keeper.specKeeper.GetMinStake(ctx, e.Chain).Amount) { - e.Freeze() + // fix entries with different vaults + // count self delegations + TotalSelfDelegation := sdk.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() + e.Vault = metadata.Vault + } else { + TotalSelfDelegation = TotalSelfDelegation.Add(e.Stake.Amount) } - m.keeper.epochStorageKeeper.SetStakeEntryCurrent(ctx, e) } + + // 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.Description = types1.Description{} + m.keeper.epochStorageKeeper.SetStakeEntryCurrent(ctx, *entry) + } + + // set the metadata + m.keeper.epochStorageKeeper.SetMetadata(ctx, metadata) } return nil diff --git a/x/pairing/keeper/migrations_test.go b/x/pairing/keeper/migrations_test.go new file mode 100644 index 0000000000..dd6250ea5f --- /dev/null +++ b/x/pairing/keeper/migrations_test.go @@ -0,0 +1,64 @@ +package keeper_test + +import ( + "testing" + + "cosmossdk.io/math" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/stretchr/testify/require" +) + +func TestMigration4To5(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 0, 3, 0) + + provider0, _ := ts.AddAccount(common.PROVIDER, 0, testBalance) + provider1, _ := ts.AddAccount(common.PROVIDER, 1, testBalance) + + // stake provider 0 + d := common.MockDescription() + err := ts.StakeProviderExtra(provider0.GetVaultAddr(), provider0.Addr.String(), ts.Spec(SpecName(0)), testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + // stake provider 1 + err = ts.StakeProviderExtra(provider1.Addr.String(), provider1.Addr.String(), ts.Spec(SpecName(1)), testStake, nil, 0, "mon2", d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + // mimic the state where one provider has vault and another dont + + entry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, SpecName(0), provider0.Addr.String()) + ts.Keepers.Epochstorage.RemoveStakeEntryCurrent(ts.Ctx, entry.Chain, entry.Address) + require.True(t, found) + + // provider 0 address is now provider1 with vault of provider 0 + entry.Address = provider1.Addr.String() + entry.DelegateCommission = 49 + entry.Description = d + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, entry) + + keeper.NewMigrator(ts.Keepers.Pairing).MigrateVersion4To5(ts.Ctx) + + // unbond from validator with provider1 + val, _ := ts.GetAccount(common.VALIDATOR, 0) + _, err = ts.TxUnbondValidator(provider1, val, math.NewInt(testStake)) + require.NoError(t, err) + + // check stake entries are correct + res, err := ts.QueryPairingProvider(provider1.Addr.String(), "") + require.NoError(t, err) + require.Len(t, res.StakeEntries, 2) + for _, entry := range res.StakeEntries { + require.Equal(t, entry.Address, provider1.Addr.String()) + require.Equal(t, entry.Vault, provider0.GetVaultAddr()) + } + + mds, err := ts.Keepers.Epochstorage.GetAllMetadata(ts.Ctx) + require.NoError(t, err) + require.Len(t, mds, 1) + require.Equal(t, provider1.Addr.String(), mds[0].Provider) + require.Equal(t, provider0.GetVaultAddr(), mds[0].Vault) + require.Equal(t, []string{SpecName(0), SpecName(1)}, mds[0].Chains) + require.Equal(t, uint64(49), mds[0].DelegateCommission) + require.Equal(t, d, mds[0].Description) +} diff --git a/x/pairing/keeper/msg_server.go b/x/pairing/keeper/msg_server.go index 78e6f7d3dc..dd8e539a03 100644 --- a/x/pairing/keeper/msg_server.go +++ b/x/pairing/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) type msgServer struct { diff --git a/x/pairing/keeper/msg_server_freeze.go b/x/pairing/keeper/msg_server_freeze.go index e8ceb86d35..1be8599f50 100644 --- a/x/pairing/keeper/msg_server_freeze.go +++ b/x/pairing/keeper/msg_server_freeze.go @@ -7,9 +7,9 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) func (k msgServer) FreezeProvider(goCtx context.Context, msg *types.MsgFreezeProvider) (*types.MsgFreezeProviderResponse, error) { diff --git a/x/pairing/keeper/msg_server_freeze_test.go b/x/pairing/keeper/msg_server_freeze_test.go index 58d02387c8..3efe3631d4 100644 --- a/x/pairing/keeper/msg_server_freeze_test.go +++ b/x/pairing/keeper/msg_server_freeze_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/msg_server_move_provider_stake.go b/x/pairing/keeper/msg_server_move_provider_stake.go new file mode 100644 index 0000000000..7c9fb9b3d5 --- /dev/null +++ b/x/pairing/keeper/msg_server_move_provider_stake.go @@ -0,0 +1,49 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" +) + +func (k msgServer) MoveProviderStake(goCtx context.Context, msg *types.MsgMoveProviderStake) (*types.MsgMoveProviderStakeResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + err := k.Keeper.MoveProviderStake(ctx, msg.Creator, msg.SrcChain, msg.DstChain, msg.Amount) + return &types.MsgMoveProviderStakeResponse{}, err +} + +func (k Keeper) MoveProviderStake(ctx sdk.Context, creator, srcChain, dstChain string, amount sdk.Coin) error { + srcEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, srcChain, creator) + if !found { + return utils.LavaFormatError("provider is not staked in the source chain", nil, + utils.LogAttr("provider", creator), + utils.LogAttr("chain", srcChain), + ) + } + + dstEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, dstChain, creator) + if !found { + return utils.LavaFormatError("provider is not staked in the destination chain", nil, + utils.LogAttr("provider", creator), + utils.LogAttr("chain", srcChain), + ) + } + + srcEntry.Stake = srcEntry.Stake.Sub(amount) + dstEntry.Stake = dstEntry.Stake.Add(amount) + + minSelfDelegation := k.dualstakingKeeper.MinSelfDelegation(ctx) + if srcEntry.Stake.IsLT(minSelfDelegation) { + return utils.LavaFormatError("provider will be below min stake on source chain", nil, + utils.LogAttr("provider", creator), + utils.LogAttr("chain", srcChain), + ) + } + + 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) +} diff --git a/x/pairing/keeper/msg_server_relay_payment.go b/x/pairing/keeper/msg_server_relay_payment.go index e4321d4494..a1ec9c0f3f 100644 --- a/x/pairing/keeper/msg_server_relay_payment.go +++ b/x/pairing/keeper/msg_server_relay_payment.go @@ -8,12 +8,12 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" ) type BadgeData struct { @@ -377,6 +377,7 @@ func (k EpochCuCache) updateProvidersComplainerCU(ctx sdk.Context, unresponsiveP "cu": strconv.FormatUint(complainerCuToAdd, 10), "epoch": strconv.FormatUint(epoch, 10), "total_complaint_this_epoch": strconv.FormatUint(pec.ComplainersCu, 10), + "chainID": chainID, } utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProviderReportedEventName, details, "provider got reported by consumer") } 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 6f1f8713cf..3370fdab89 100644 --- a/x/pairing/keeper/msg_server_relay_payment_gov_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_gov_test.go @@ -5,11 +5,11 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/msg_server_relay_payment_test.go b/x/pairing/keeper/msg_server_relay_payment_test.go index 54d11afb53..2103c22bcb 100644 --- a/x/pairing/keeper/msg_server_relay_payment_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_test.go @@ -4,13 +4,13 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - commonconsts "github.com/lavanet/lava/v3/testutil/common/consts" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/testutil/common" + commonconsts "github.com/lavanet/lava/v4/testutil/common/consts" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/msg_server_stake_provider.go b/x/pairing/keeper/msg_server_stake_provider.go index ab90632601..fbc049a17b 100644 --- a/x/pairing/keeper/msg_server_stake_provider.go +++ b/x/pairing/keeper/msg_server_stake_provider.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" ) func (k msgServer) StakeProvider(goCtx context.Context, msg *types.MsgStakeProvider) (*types.MsgStakeProviderResponse, error) { diff --git a/x/pairing/keeper/msg_server_stake_provider_test.go b/x/pairing/keeper/msg_server_stake_provider_test.go index 161c020c57..ccacd1be01 100644 --- a/x/pairing/keeper/msg_server_stake_provider_test.go +++ b/x/pairing/keeper/msg_server_stake_provider_test.go @@ -7,11 +7,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/testutil/common" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/client/cli" - "github.com/lavanet/lava/v3/x/pairing/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/common" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/client/cli" + "github.com/lavanet/lava/v4/x/pairing/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) @@ -27,9 +27,9 @@ func TestModifyStakeProviderWithDescription(t *testing.T) { providerAcct, providerAddr := ts.GetAccount(common.PROVIDER, 0) // Get the stake entry and check the provider is staked - stakeEntry, foundProvider := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, providerAddr) - require.True(t, foundProvider) - require.True(t, stakeEntry.Description.Equal(common.MockDescription())) + stakeEntry, err := ts.QueryPairingProvider(providerAddr, ts.spec.Index) + require.NoError(t, err) + require.True(t, stakeEntry.StakeEntries[0].Description.Equal(common.MockDescription())) // modify description dNew := stakingtypes.NewDescription("bla", "blan", "bal", "lala", "asdasd") @@ -38,9 +38,9 @@ func TestModifyStakeProviderWithDescription(t *testing.T) { ts.AdvanceEpoch() // Get the stake entry and check the provider is staked - stakeEntry, foundProvider = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, providerAddr) - require.True(t, foundProvider) - require.True(t, stakeEntry.Description.Equal(dNew)) + stakeEntry, err = ts.QueryPairingProvider(providerAddr, ts.spec.Index) + require.NoError(t, err) + require.True(t, stakeEntry.StakeEntries[0].Description.Equal(dNew)) } func TestCmdStakeProviderGeoConfigAndEnum(t *testing.T) { @@ -207,7 +207,7 @@ func TestCmdStakeProviderGeoConfigAndEnum(t *testing.T) { endpoints[i].ApiInterfaces = []string{"stub"} endpoints[i].Addons = []string{} } - _, err = ts.TxPairingStakeProvider(provider, acc.GetVaultAddr(), ts.spec.Index, ts.spec.MinStakeProvider, endpoints, geo, common.MockDescription()) + _, err = ts.TxPairingStakeProvider(provider, acc.GetVaultAddr(), ts.spec.Index, ts.spec.MinStakeProvider, endpoints, geo, common.MockDescription(), 100) require.NoError(t, err) } else { require.Error(t, err) @@ -657,7 +657,7 @@ func TestStakeEndpoints(t *testing.T) { for _, play := range playbook { t.Run(play.name, func(t *testing.T) { - _, err := ts.TxPairingStakeProvider(providerAddr, providerAcc.GetVaultAddr(), ts.spec.Index, amount, play.endpoints, play.geolocation, common.MockDescription()) + _, err := ts.TxPairingStakeProvider(providerAddr, providerAcc.GetVaultAddr(), ts.spec.Index, amount, play.endpoints, play.geolocation, common.MockDescription(), 100) if play.success { require.NoError(t, err) @@ -761,7 +761,7 @@ func TestUnfreezeWithDelegations(t *testing.T) { // add delegator and delegate to provider so its effective stake is MinStakeProvider+MinSelfDelegation+1 // provider should still be frozen _, consumer := ts.AddAccount(common.CONSUMER, 1, testBalance) - _, err = ts.TxDualstakingDelegate(consumer, provider, ts.spec.Index, ts.spec.MinStakeProvider) + _, err = ts.TxDualstakingDelegate(consumer, provider, ts.spec.MinStakeProvider) require.NoError(t, err) ts.AdvanceEpoch() // apply delegation stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) @@ -801,7 +801,7 @@ func TestCommisionChange(t *testing.T) { // add delegator and delegate to provider _, consumer := ts.AddAccount(common.CONSUMER, 1, testBalance) - _, err = ts.TxDualstakingDelegate(consumer, provider, ts.spec.Index, ts.spec.MinStakeProvider) + _, err = ts.TxDualstakingDelegate(consumer, provider, ts.spec.MinStakeProvider) require.NoError(t, err) ts.AdvanceEpoch() // apply delegation ts.AdvanceBlock(time.Hour * 25) // advance time to allow changes @@ -855,11 +855,12 @@ func TestVaultProviderNewStakeEntry(t *testing.T) { provider sdk.AccAddress spec spectypes.Spec valid bool + fail bool }{ - {"stake provider = vault", p1Acc.Addr, p1Acc.Addr, ts.spec, true}, - {"stake provider != vault", p2Acc.Vault.Addr, p2Acc.Addr, ts.spec, true}, - {"stake existing provider", p1Acc.Vault.Addr, p1Acc.Addr, ts.spec, false}, - {"stake existing provider different chain", p1Acc.Vault.Addr, p1Acc.Addr, spec1, true}, + {"stake provider = vault", p1Acc.Addr, p1Acc.Addr, ts.spec, true, false}, + {"stake provider != vault", p2Acc.Vault.Addr, p2Acc.Addr, ts.spec, true, false}, + {"stake existing provider", p1Acc.Vault.Addr, p1Acc.Addr, ts.spec, false, false}, + {"stake existing provider different chain", p1Acc.Vault.Addr, p1Acc.Addr, spec1, false, true}, } for _, tt := range tests { @@ -881,10 +882,14 @@ func TestVaultProviderNewStakeEntry(t *testing.T) { // stake entry _, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) + if tt.fail { + require.False(t, found) + return + } require.True(t, found) // should be found because provider is registered in a vaild stake entry // delegations - res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String(), false) + res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String()) require.NoError(t, err) require.Len(t, res.Delegations, 0) } else { @@ -905,7 +910,7 @@ func TestVaultProviderNewStakeEntry(t *testing.T) { require.Equal(t, int64(0), stakeEntry.DelegateTotal.Amount.Int64()) // delegations - res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String(), false) + res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String()) require.NoError(t, err) require.Len(t, res.Delegations, 1) require.Equal(t, tt.provider.String(), res.Delegations[0].Provider) @@ -963,7 +968,7 @@ func TestVaultProviderExistingStakeEntry(t *testing.T) { require.True(t, found) // should be found because provider is registered in a vaild stake entry // delegations - res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String(), false) + res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String()) require.NoError(t, err) require.Len(t, res.Delegations, 0) } else { @@ -984,7 +989,7 @@ func TestVaultProviderExistingStakeEntry(t *testing.T) { require.Equal(t, int64(0), stakeEntry.DelegateTotal.Amount.Int64()) // delegations - res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String(), false) + res, err := ts.QueryDualstakingDelegatorProviders(tt.vault.String()) require.NoError(t, err) require.Len(t, res.Delegations, 1) require.Equal(t, tt.provider.String(), res.Delegations[0].Provider) @@ -1008,11 +1013,13 @@ func TestVaultProviderModifyStakeEntry(t *testing.T) { provider := acc.Addr.String() vault := acc.GetVaultAddr() - valAcc, _ := ts.GetAccount(common.VALIDATOR, 0) stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, acc.Addr.String()) require.True(t, found) + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + // consts for stake entry changes const ( STAKE = iota + 1 @@ -1047,12 +1054,11 @@ func TestVaultProviderModifyStakeEntry(t *testing.T) { t.Run(tt.name, func(t *testing.T) { msg := types.MsgStakeProvider{ Creator: tt.creator, - Validator: sdk.ValAddress(valAcc.Addr).String(), ChainID: stakeEntry.Chain, Amount: stakeEntry.Stake, Geolocation: stakeEntry.Geolocation, Endpoints: stakeEntry.Endpoints, - DelegateCommission: stakeEntry.DelegateCommission, + DelegateCommission: metadata.DelegateCommission, Address: stakeEntry.Address, Description: stakeEntry.Description, } @@ -1126,7 +1132,7 @@ func TestDelegatorStakesAfterProviderUnstakes(t *testing.T) { // create delegator and delegate to provider _, delegator := ts.AddAccount(common.CONSUMER, 0, testBalance) - _, err := ts.TxDualstakingDelegate(delegator, provider, ts.spec.Index, common.NewCoin(ts.TokenDenom(), testBalance/4)) + _, err := ts.TxDualstakingDelegate(delegator, provider, common.NewCoin(ts.TokenDenom(), testBalance/4)) require.NoError(t, err) ts.AdvanceEpoch() @@ -1134,7 +1140,7 @@ func TestDelegatorStakesAfterProviderUnstakes(t *testing.T) { _, err = ts.TxPairingUnstakeProvider(vault, ts.spec.Index) require.NoError(t, err) - res, err := ts.QueryDualstakingDelegatorProviders(delegator, false) + res, err := ts.QueryDualstakingDelegatorProviders(delegator) require.NoError(t, err) require.Len(t, res.Delegations, 1) require.Equal(t, delegator, res.Delegations[0].Delegator) @@ -1182,7 +1188,7 @@ func TestDelegatorAfterProviderUnstakeAndStake(t *testing.T) { // create apple apple and delegate to banana _, apple := ts.AddAccount(common.CONSUMER, 0, testBalance) - _, err = ts.TxDualstakingDelegate(apple, banana, ts.spec.Index, common.NewCoin(ts.TokenDenom(), testBalance/4)) + _, err = ts.TxDualstakingDelegate(apple, banana, common.NewCoin(ts.TokenDenom(), testBalance/4)) require.NoError(t, err) ts.AdvanceEpoch() @@ -1191,7 +1197,7 @@ func TestDelegatorAfterProviderUnstakeAndStake(t *testing.T) { require.NoError(t, err) ts.AdvanceEpoch() - res, err := ts.QueryDualstakingDelegatorProviders(apple, false) + res, err := ts.QueryDualstakingDelegatorProviders(apple) require.NoError(t, err) require.Len(t, res.Delegations, 1) require.Equal(t, apple, res.Delegations[0].Delegator) @@ -1211,10 +1217,10 @@ func TestDelegatorAfterProviderUnstakeAndStake(t *testing.T) { require.True(t, found) require.NotZero(t, stakeEntry.DelegateTotal.Amount.Int64()) - _, err = ts.TxDualstakingUnbond(apple, banana, ts.spec.Index, common.NewCoin(ts.TokenDenom(), testBalance/4)) + _, err = ts.TxDualstakingUnbond(apple, banana, common.NewCoin(ts.TokenDenom(), testBalance/4)) require.NoError(t, err) ts.AdvanceEpoch() - res, err := ts.QueryDualstakingProviderDelegators(banana, false) + res, err := ts.QueryDualstakingProviderDelegators(banana) require.NoError(t, err) require.Len(t, res.Delegations, 1) require.Equal(t, banana, res.Delegations[0].Provider) @@ -1229,10 +1235,10 @@ func TestDelegatorAfterProviderUnstakeAndStake(t *testing.T) { require.True(t, found) require.Zero(t, stakeEntry.DelegateTotal.Amount.Int64()) - _, err = ts.TxDualstakingUnbond(apple, banana, ts.spec.Index, common.NewCoin(ts.TokenDenom(), testBalance/4)) + _, err = ts.TxDualstakingUnbond(apple, banana, common.NewCoin(ts.TokenDenom(), testBalance/4)) require.NoError(t, err) ts.AdvanceEpoch() - res, err := ts.QueryDualstakingProviderDelegators(banana, false) + res, err := ts.QueryDualstakingProviderDelegators(banana) require.NoError(t, err) require.Len(t, res.Delegations, 0) } diff --git a/x/pairing/keeper/msg_server_stake_unstake_gov_test.go b/x/pairing/keeper/msg_server_stake_unstake_gov_test.go index c8a95d339b..a5d4174443 100644 --- a/x/pairing/keeper/msg_server_stake_unstake_gov_test.go +++ b/x/pairing/keeper/msg_server_stake_unstake_gov_test.go @@ -4,7 +4,7 @@ import ( "strconv" "testing" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/msg_server_test.go b/x/pairing/keeper/msg_server_test.go index c1896c153a..e0ae4603a0 100644 --- a/x/pairing/keeper/msg_server_test.go +++ b/x/pairing/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/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" ) // TODO: use or delete this function diff --git a/x/pairing/keeper/msg_server_unfreeze.go b/x/pairing/keeper/msg_server_unfreeze.go index b7afb4851c..37d32129cb 100644 --- a/x/pairing/keeper/msg_server_unfreeze.go +++ b/x/pairing/keeper/msg_server_unfreeze.go @@ -5,8 +5,8 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" ) func (k msgServer) UnfreezeProvider(goCtx context.Context, msg *types.MsgUnfreezeProvider) (*types.MsgUnfreezeProviderResponse, error) { diff --git a/x/pairing/keeper/msg_server_unstake_provider.go b/x/pairing/keeper/msg_server_unstake_provider.go index c072618356..0b28b8e300 100644 --- a/x/pairing/keeper/msg_server_unstake_provider.go +++ b/x/pairing/keeper/msg_server_unstake_provider.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) func (k msgServer) UnstakeProvider(goCtx context.Context, msg *types.MsgUnstakeProvider) (*types.MsgUnstakeProviderResponse, error) { diff --git a/x/pairing/keeper/msg_server_unstake_provider_test.go b/x/pairing/keeper/msg_server_unstake_provider_test.go index 296dfd4b5b..32b89a2e3a 100644 --- a/x/pairing/keeper/msg_server_unstake_provider_test.go +++ b/x/pairing/keeper/msg_server_unstake_provider_test.go @@ -3,39 +3,38 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" + "github.com/lavanet/lava/v4/testutil/common" "github.com/stretchr/testify/require" ) // TestVaultProviderUnstake tests that only the vault address can unstake. // Scenarios: // 1. unstake with vault -> should work -// 2. try with provider -> should fail +// 2. try with provider -> should work func TestVaultProviderUnstake(t *testing.T) { ts := newTester(t) - ts.setupForPayments(1, 0, 0) + ts.setupForPayments(2, 0, 0) - acc, _ := ts.GetAccount(common.PROVIDER, 0) - provider := acc.Addr.String() - vault := acc.GetVaultAddr() + acc1, _ := ts.GetAccount(common.PROVIDER, 0) + provider1 := acc1.Addr.String() + + acc2, _ := ts.GetAccount(common.PROVIDER, 1) + vault2 := acc2.GetVaultAddr() tests := []struct { name string creator string - valid bool }{ - {"provider unstakes", provider, false}, - {"vault unstakes", vault, true}, + {"provider unstakes", provider1}, + {"vault unstakes", vault2}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + prov := ts.Keepers.Epochstorage.GetAllStakeEntriesCurrentForChainId(ts.Ctx, ts.spec.Index) + _ = prov _, err := ts.TxPairingUnstakeProvider(tt.creator, ts.spec.Index) - if tt.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } + require.NoError(t, err) }) } } diff --git a/x/pairing/keeper/pairing.go b/x/pairing/keeper/pairing.go index 638c01648a..f90248e559 100644 --- a/x/pairing/keeper/pairing.go +++ b/x/pairing/keeper/pairing.go @@ -7,14 +7,14 @@ import ( cosmosmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingfilters "github.com/lavanet/lava/v3/x/pairing/keeper/filters" - pairingscores "github.com/lavanet/lava/v3/x/pairing/keeper/scores" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingfilters "github.com/lavanet/lava/v4/x/pairing/keeper/filters" + pairingscores "github.com/lavanet/lava/v4/x/pairing/keeper/scores" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) func (k Keeper) VerifyPairingData(ctx sdk.Context, chainID string, block uint64) (epoch uint64, providersType spectypes.Spec_ProvidersTypes, errorRet error) { diff --git a/x/pairing/keeper/pairing_cache.go b/x/pairing/keeper/pairing_cache.go index a3652babc8..dbaeef2933 100644 --- a/x/pairing/keeper/pairing_cache.go +++ b/x/pairing/keeper/pairing_cache.go @@ -3,8 +3,8 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) func (k Keeper) SetPairingRelayCache(ctx sdk.Context, project string, chainID string, epoch uint64, pairedProviders []epochstoragetypes.StakeEntry, allowedCu uint64) { diff --git a/x/pairing/keeper/pairing_cache_test.go b/x/pairing/keeper/pairing_cache_test.go index fb1f0829ef..74409cad18 100644 --- a/x/pairing/keeper/pairing_cache_test.go +++ b/x/pairing/keeper/pairing_cache_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" + "github.com/lavanet/lava/v4/testutil/common" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/pairing_immediately_test.go b/x/pairing/keeper/pairing_immediately_test.go index 260b9b1488..8c8454bef3 100644 --- a/x/pairing/keeper/pairing_immediately_test.go +++ b/x/pairing/keeper/pairing_immediately_test.go @@ -3,9 +3,9 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/lavaslices" - projectTypes "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/lavaslices" + projectTypes "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/pairing_next_epoch_time_block.go b/x/pairing/keeper/pairing_next_epoch_time_block.go index e454f7114d..881876704e 100644 --- a/x/pairing/keeper/pairing_next_epoch_time_block.go +++ b/x/pairing/keeper/pairing_next_epoch_time_block.go @@ -7,8 +7,8 @@ import ( "github.com/cometbft/cometbft/rpc/core" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/x/pairing/keeper/pairing_subscription_test.go b/x/pairing/keeper/pairing_subscription_test.go index b46c105e9a..2dc1bdd44a 100644 --- a/x/pairing/keeper/pairing_subscription_test.go +++ b/x/pairing/keeper/pairing_subscription_test.go @@ -3,11 +3,11 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/pairing_test.go b/x/pairing/keeper/pairing_test.go index f1e607aff0..c312411f1e 100644 --- a/x/pairing/keeper/pairing_test.go +++ b/x/pairing/keeper/pairing_test.go @@ -8,16 +8,16 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingscores "github.com/lavanet/lava/v3/x/pairing/keeper/scores" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/common" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + specutils "github.com/lavanet/lava/v4/utils/keeper" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingscores "github.com/lavanet/lava/v4/x/pairing/keeper/scores" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) @@ -968,7 +968,7 @@ func TestPairingDistributionPerStake(t *testing.T) { // double the stake of the first provider p := allProviders.StakeEntry[0] - _, err = ts.TxDualstakingDelegate(p.Vault, p.Address, ts.spec.Index, p.Stake) + _, err = ts.TxDualstakingDelegate(p.Vault, p.Address, p.Stake) require.NoError(t, err) ts.AdvanceEpoch() diff --git a/x/pairing/keeper/params.go b/x/pairing/keeper/params.go index b7ca316905..2fd3570c43 100644 --- a/x/pairing/keeper/params.go +++ b/x/pairing/keeper/params.go @@ -4,8 +4,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/types" ) // GetParams get all parameters as types.Params diff --git a/x/pairing/keeper/params_test.go b/x/pairing/keeper/params_test.go index 149c1b22a2..22eeb50164 100644 --- a/x/pairing/keeper/params_test.go +++ b/x/pairing/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/qos_excellence.go b/x/pairing/keeper/qos_excellence.go index 0dd7f16b89..ae58116dd3 100644 --- a/x/pairing/keeper/qos_excellence.go +++ b/x/pairing/keeper/qos_excellence.go @@ -4,8 +4,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) // TODO: implement UpdateProviderQos(payments) diff --git a/x/pairing/keeper/query_sdk_pairing.go b/x/pairing/keeper/query_sdk_pairing.go index cbe2ce3024..872825b5ae 100644 --- a/x/pairing/keeper/query_sdk_pairing.go +++ b/x/pairing/keeper/query_sdk_pairing.go @@ -5,7 +5,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/scores/geo_req.go b/x/pairing/keeper/scores/geo_req.go index b658cd3781..df4aa2f43f 100644 --- a/x/pairing/keeper/scores/geo_req.go +++ b/x/pairing/keeper/scores/geo_req.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) // geo requirement that implements the ScoreReq interface diff --git a/x/pairing/keeper/scores/geo_req_test.go b/x/pairing/keeper/scores/geo_req_test.go index 725f724fd6..79f2cb1257 100644 --- a/x/pairing/keeper/scores/geo_req_test.go +++ b/x/pairing/keeper/scores/geo_req_test.go @@ -3,9 +3,9 @@ package scores import ( "testing" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/scores/pairing_score.go b/x/pairing/keeper/scores/pairing_score.go index 023f5b4be9..5f2d16e8d5 100644 --- a/x/pairing/keeper/scores/pairing_score.go +++ b/x/pairing/keeper/scores/pairing_score.go @@ -2,8 +2,8 @@ package scores import ( "cosmossdk.io/math" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/x/pairing/keeper/scores/qos_req.go b/x/pairing/keeper/scores/qos_req.go index 38d9a6f22c..8f6480b7aa 100644 --- a/x/pairing/keeper/scores/qos_req.go +++ b/x/pairing/keeper/scores/qos_req.go @@ -3,8 +3,8 @@ package scores import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) const qosReqName = "qos-req" diff --git a/x/pairing/keeper/scores/score.go b/x/pairing/keeper/scores/score.go index cce0bca8fc..e411f7f42b 100644 --- a/x/pairing/keeper/scores/score.go +++ b/x/pairing/keeper/scores/score.go @@ -42,10 +42,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/rand" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/rand" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) var uniformStrategy ScoreStrategy diff --git a/x/pairing/keeper/scores/score_req.go b/x/pairing/keeper/scores/score_req.go index 058d2d593b..986c374e6f 100644 --- a/x/pairing/keeper/scores/score_req.go +++ b/x/pairing/keeper/scores/score_req.go @@ -2,7 +2,7 @@ package scores import ( "cosmossdk.io/math" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) // ScoreReq is an interface for pairing requirement scoring diff --git a/x/pairing/keeper/scores/stake_req.go b/x/pairing/keeper/scores/stake_req.go index 74af1713fb..d186f75dd5 100644 --- a/x/pairing/keeper/scores/stake_req.go +++ b/x/pairing/keeper/scores/stake_req.go @@ -3,7 +3,7 @@ package scores import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) const stakeReqName = "stake-req" diff --git a/x/pairing/keeper/single_provider_test.go b/x/pairing/keeper/single_provider_test.go new file mode 100644 index 0000000000..2f5663e1fd --- /dev/null +++ b/x/pairing/keeper/single_provider_test.go @@ -0,0 +1,510 @@ +package keeper_test + +import ( + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/x/pairing/client/cli" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + "github.com/stretchr/testify/require" +) + +func SpecName(num int) string { + return "spec" + strconv.Itoa(num) +} + +func SetupForSingleProviderTests(ts *tester, providers, specs, clientsCount int) { + for i := 0; i < providers; i++ { + ts.AddAccount(common.PROVIDER, i, 100*testBalance) + } + + for i := 0; i < specs; i++ { + spec := ts.spec + spec.Index = SpecName(i) + ts.AddSpec(spec.Index, spec) + for i := 0; i < providers; i++ { + acc, addr := ts.GetAccount(common.PROVIDER, i) + d := common.MockDescription() + err := ts.StakeProviderExtra(acc.GetVaultAddr(), addr, spec, testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + } + } + + ts.addClient(clientsCount) + ts.AdvanceEpoch() +} + +// * unstake to see the delegations distributions +// * unstake from the rest of the chains +// * stake to get all delegations back +func TestUnstakeStake(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 1, 5, 0) + + delegator, _ := ts.AddAccount("del", 1, 1000000000) + provider0, _ := ts.GetAccount(common.PROVIDER, 0) + + // delegate and check delegatetotal + _, err := ts.TxDualstakingDelegate(delegator.Addr.String(), provider0.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), 5000)) + require.NoError(t, err) + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(1000), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + ts.AdvanceEpoch() + + stakeEntries := ts.Keepers.Epochstorage.GetAllStakeEntriesForEpoch(ts.Ctx, ts.EpochStart()) + require.Len(t, stakeEntries, 5) + for _, entry := range stakeEntries { + require.Equal(t, int64(1000), entry.DelegateTotal.Amount.Int64()) + } + + // unstake spec0 provider + _, err = ts.TxPairingUnstakeProvider(provider0.GetVaultAddr(), SpecName(0)) + require.NoError(t, err) + + // check redistribution of delegation + for i := 1; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(1250), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + // unstake all + for i := 1; i < 5; i++ { + _, err = ts.TxPairingUnstakeProvider(provider0.GetVaultAddr(), SpecName(i)) + require.NoError(t, err) + } + + res, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String()) + require.NoError(t, err) + require.Len(t, res.Delegations, 1) + require.Equal(t, provider0.Addr.String(), res.Delegations[0].Provider) + require.Equal(t, int64(5000), res.Delegations[0].Amount.Amount.Int64()) + + // stake again and check we got the delegation back + d := common.MockDescription() + err = ts.StakeProviderExtra(provider0.GetVaultAddr(), provider0.Addr.String(), ts.Spec(SpecName(0)), testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + res1, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, int64(5000), res1.StakeEntries[0].DelegateTotal.Amount.Int64()) + + // stake again on spec1 and check delegations + err = ts.StakeProviderExtra(provider0.GetVaultAddr(), provider0.Addr.String(), ts.Spec(SpecName(1)), testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + res1, err = ts.QueryPairingProvider(provider0.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, int64(2500), res1.StakeEntries[0].DelegateTotal.Amount.Int64()) + + res1, err = ts.QueryPairingProvider(provider0.Addr.String(), SpecName(1)) + require.NoError(t, err) + require.Equal(t, int64(2500), res1.StakeEntries[0].DelegateTotal.Amount.Int64()) + + ts.AdvanceEpoch() + + stakeEntries = ts.Keepers.Epochstorage.GetAllStakeEntriesForEpoch(ts.Ctx, ts.EpochStart()) + require.Len(t, stakeEntries, 2) + for _, entry := range stakeEntries { + require.Equal(t, int64(2500), entry.DelegateTotal.Amount.Int64()) + } +} + +// * unstake to see the delegations distributions +// * unstake from the rest of the chains +// * stake to get all delegations back with a new vault +func TestUnstakeStakeNewVault(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 1, 5, 0) + + delegator, _ := ts.AddAccount("del", 1, 1000000000) + provider0, _ := ts.GetAccount(common.PROVIDER, 0) + provider1, _ := ts.AddAccount(common.PROVIDER, 1, 1000000000) + + // delegate and check delegatetotal + _, err := ts.TxDualstakingDelegate(delegator.Addr.String(), provider0.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), 5000)) + require.NoError(t, err) + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(1000), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + ts.AdvanceEpoch() + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(1000), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + // unstake all + for i := 0; i < 5; i++ { + _, err = ts.TxPairingUnstakeProvider(provider0.GetVaultAddr(), SpecName(i)) + require.NoError(t, err) + + md, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider0.Addr.String()) + if i == 4 { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Len(t, md.Chains, 4-i) + } + } + + res, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String()) + require.NoError(t, err) + require.Len(t, res.Delegations, 1) + require.Equal(t, provider0.Addr.String(), res.Delegations[0].Provider) + require.Equal(t, int64(5000), res.Delegations[0].Amount.Amount.Int64()) + + // stake again and check we got the delegation back + d := common.MockDescription() + err = ts.StakeProviderExtra(provider1.GetVaultAddr(), provider0.Addr.String(), ts.Spec(SpecName(0)), testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + res1, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, int64(5000), res1.StakeEntries[0].DelegateTotal.Amount.Int64()) + + // stake again on spec1 and check delegations + err = ts.StakeProviderExtra(provider1.GetVaultAddr(), provider0.Addr.String(), ts.Spec(SpecName(1)), testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + res1, err = ts.QueryPairingProvider(provider0.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, int64(2500), res1.StakeEntries[0].DelegateTotal.Amount.Int64()) + + res1, err = ts.QueryPairingProvider(provider0.Addr.String(), SpecName(1)) + require.NoError(t, err) + require.Equal(t, int64(2500), res1.StakeEntries[0].DelegateTotal.Amount.Int64()) +} + +func TestDelegations(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 1, 5, 0) + + delegator, _ := ts.AddAccount("del", 1, 1000000000) + provider, _ := ts.GetAccount(common.PROVIDER, 0) + + // delegate amount that does not divide by 5 + _, err := ts.TxDualstakingDelegate(delegator.Addr.String(), provider.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), 4999)) + require.NoError(t, err) + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(999), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + // unbond 4 tokens, now amount divides by 5 + _, err = ts.TxDualstakingUnbond(delegator.Addr.String(), provider.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), 4)) + require.NoError(t, err) + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(999), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + // add stake to spec0 + d := common.MockDescription() + err = ts.StakeProviderExtra(provider.GetVaultAddr(), provider.Addr.String(), ts.Spec(SpecName(0)), 2*testStake, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + // check delegate total is twice than others in spec0 + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, int64(1665), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + + for i := 1; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(832), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + // unbond with vault, should be uniformali + _, err = ts.TxDualstakingUnbond(provider.GetVaultAddr(), provider.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), testStake)) + require.NoError(t, err) + + res, err = ts.QueryPairingProvider(provider.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, testStake+testStake*4/5, res.StakeEntries[0].Stake.Amount.Int64()) + require.Equal(t, 4995*res.StakeEntries[0].Stake.Amount.Int64()/(5*testStake), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + + for i := 1; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, testStake*4/5, res.StakeEntries[0].Stake.Amount.Int64()) + require.Equal(t, 4995*res.StakeEntries[0].Stake.Amount.Int64()/(5*testStake), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + // unbond all delegator + _, err = ts.TxDualstakingUnbond(delegator.Addr.String(), provider.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), 4995)) + require.NoError(t, err) + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(0), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } +} + +func TestUnstakeWithOperator(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 1, 5, 0) + + provider, _ := ts.GetAccount(common.PROVIDER, 0) + + // unstake one chain + _, err := ts.TxPairingUnstakeProvider(provider.Addr.String(), SpecName(0)) + require.NoError(t, err) + + // check the entries got the stake of spec0 + for i := 1; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, testStake*5/4, res.StakeEntries[0].Stake.Amount.Int64()) + } + + // unstake everything + for i := 1; i < 5; i++ { + _, err := ts.TxPairingUnstakeProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + } + + res, err := ts.QueryPairingProvider(provider.Addr.String(), "") + require.NoError(t, err) + require.Len(t, res.StakeEntries, 0) + + // stake again + d := common.MockDescription() + err = ts.StakeProviderExtra(provider.GetVaultAddr(), provider.Addr.String(), ts.Spec(SpecName(0)), 1, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details) + require.NoError(ts.T, err) + + // check we got all the self delegations + res, err = ts.QueryPairingProvider(provider.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, testStake*5+1, res.StakeEntries[0].Stake.Amount.Int64()) +} + +func TestChangeCommisionAndDescription(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 0, 5, 0) + provider, _ := ts.AddAccount(common.PROVIDER, 0, testBalance) + + d := common.MockDescription() + err := ts.StakeProviderFull(provider.GetVaultAddr(), provider.Addr.String(), ts.Spec(SpecName(0)), 100, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, 50) + require.NoError(ts.T, err) + + md, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider.Addr.String()) + require.NoError(ts.T, err) + require.Equal(t, d, md.Description) + require.Equal(t, md.DelegateCommission, uint64(50)) + + d.Moniker = "test2" + err = ts.StakeProviderFull(provider.GetVaultAddr(), provider.Addr.String(), ts.Spec(SpecName(1)), 100, nil, 0, d.Moniker, d.Identity, d.Website, d.SecurityContact, d.Details, 49) + require.NoError(ts.T, err) + + md, err = ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider.Addr.String()) + require.NoError(ts.T, err) + require.Equal(t, d, md.Description) + require.Equal(t, md.DelegateCommission, uint64(49)) + + res, err := ts.QueryPairingProviders(ts.Spec(SpecName(0)).Index, true) + require.NoError(ts.T, err) + require.Equal(t, d, res.StakeEntry[0].Description) + require.Equal(t, uint64(49), res.StakeEntry[0].DelegateCommission) + + res1, err := ts.QueryPairingProvider(provider.Addr.String(), "") + require.NoError(ts.T, err) + require.Equal(t, d, res1.StakeEntries[0].Description) + require.Equal(t, uint64(49), res1.StakeEntries[0].DelegateCommission) +} + +func TestMoveStake(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 1, 5, 0) + + delegator, _ := ts.AddAccount("del", 1, 1000000000) + provider0, _ := ts.GetAccount(common.PROVIDER, 0) + + // delegate and check delegatetotal + _, err := ts.TxDualstakingDelegate(delegator.Addr.String(), provider0.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), 5000)) + require.NoError(t, err) + + for i := 0; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(1000), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } + + _, err = ts.TxPairingMoveStake(provider0.GetVaultAddr(), SpecName(1), SpecName(0), testStake/2) + require.NoError(t, err) + + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(0)) + require.NoError(t, err) + require.Equal(t, int64(1500), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + + res, err = ts.QueryPairingProvider(provider0.Addr.String(), SpecName(1)) + require.NoError(t, err) + require.Equal(t, int64(500), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + + for i := 2; i < 5; i++ { + res, err := ts.QueryPairingProvider(provider0.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(1000), res.StakeEntries[0].DelegateTotal.Amount.Int64()) + } +} + +func TestPairingWithDelegationDistributions(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 0, 2, 1) + + stake := int64(1000) + delegator, _ := ts.AddAccount("del", 1, stake*10000) + client, _ := ts.GetAccount(common.CONSUMER, 0) + spec := ts.Spec(SpecName(0)) + + // stake for spec0 + for i := 0; i < 100; i++ { + acc, addr := ts.AddAccount(common.PROVIDER, i, testBalance) + err := ts.StakeProvider(acc.GetVaultAddr(), addr, spec, stake) + require.NoError(ts.T, err) + } + provider, _ := ts.GetAccount(common.PROVIDER, 0) + + // delegate a lot of stake to the first provider + _, err := ts.TxDualstakingDelegate(delegator.Addr.String(), provider.Addr.String(), types.NewInt64Coin(ts.TokenDenom(), stake*10000)) + require.NoError(t, err) + + numOfPairing := 0 + for i := 0; i < 100; i++ { + ts.AdvanceEpoch() + + // make sure the provider is in the pairing list + res, err := ts.QueryPairingGetPairing(spec.Index, client.Addr.String()) + require.NoError(t, err) + found := false + for _, p := range res.Providers { + if p.Address == provider.Addr.String() { + found = true + break + } + } + if found { + numOfPairing++ + } + } + require.Greater(t, numOfPairing, 95) + + spec = ts.Spec(SpecName(1)) + // stake to spec1 + for i := 0; i < 100; i++ { + acc, addr := ts.GetAccount(common.PROVIDER, i) + err := ts.StakeProvider(acc.GetVaultAddr(), addr, spec, stake) + require.NoError(ts.T, err) + } + + // check that provider is in pairing in spec1 + numOfPairing = 0 + for i := 0; i < 100; i++ { + ts.AdvanceEpoch() + + // make sure the provider is in the pairing list + res, err := ts.QueryPairingGetPairing(spec.Index, client.Addr.String()) + require.NoError(t, err) + found := false + for _, p := range res.Providers { + if p.Address == provider.Addr.String() { + found = true + break + } + } + if found { + numOfPairing++ + } + } + require.Greater(t, numOfPairing, 95) +} + +func TestDistributionCli(t *testing.T) { + ts := newTester(t) + SetupForSingleProviderTests(ts, 1, 100, 0) + + provider, _ := ts.GetAccount(common.PROVIDER, 0) + + res, err := ts.QueryPairingProvider(provider.Addr.String(), "") + require.NoError(t, err) + + // distribute each provider 0.1% and last with 90.1% + distribution := "" + for i := 0; i < 99; i++ { + distribution = distribution + SpecName(i) + "," + "0.1" + "," + } + distribution = distribution + SpecName(99) + "," + "90.1" + + // get the msgs and run + msgs, err := cli.CalculateDistbiruitions(provider.Addr.String(), res.StakeEntries, distribution) + require.NoError(t, err) + for _, msgRaw := range msgs { + msg, ok := msgRaw.(*pairingtypes.MsgMoveProviderStake) + require.True(t, ok) + require.Equal(t, provider.Addr.String(), msg.Creator) + require.Equal(t, SpecName(99), msg.DstChain) + require.NotEqual(t, SpecName(99), msg.SrcChain) + require.Equal(t, int64(90000), msg.Amount.Amount.Int64()) + + _, err := ts.Servers.PairingServer.MoveProviderStake(ts.Ctx, msg) + require.NoError(t, err) + } + + // check the stake entries on chain + for i := 0; i < 99; i++ { + res, err = ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, int64(10000), res.StakeEntries[0].Stake.Amount.Int64()) + } + + res, err = ts.QueryPairingProvider(provider.Addr.String(), SpecName(99)) + require.NoError(t, err) + require.Equal(t, int64(9010000), res.StakeEntries[0].Stake.Amount.Int64()) + + // distribute back to 1% each + res, err = ts.QueryPairingProvider(provider.Addr.String(), "") + require.NoError(t, err) + + distribution = "" + for i := 0; i < 100; i++ { + distribution = distribution + SpecName(i) + "," + "1" + "," + } + distribution = distribution[:len(distribution)-1] + + msgs, err = cli.CalculateDistbiruitions(provider.Addr.String(), res.StakeEntries, distribution) + require.NoError(t, err) + for _, msgRaw := range msgs { + msg, ok := msgRaw.(*pairingtypes.MsgMoveProviderStake) + require.True(t, ok) + require.Equal(t, provider.Addr.String(), msg.Creator) + require.Equal(t, SpecName(99), msg.SrcChain) + require.NotEqual(t, SpecName(99), msg.DstChain) + require.Equal(t, int64(90000), msg.Amount.Amount.Int64()) + + _, err := ts.Servers.PairingServer.MoveProviderStake(ts.Ctx, msg) + require.NoError(t, err) + } + + for i := 0; i < 100; i++ { + res, err = ts.QueryPairingProvider(provider.Addr.String(), SpecName(i)) + require.NoError(t, err) + require.Equal(t, testStake, res.StakeEntries[0].Stake.Amount.Int64()) + } +} diff --git a/x/pairing/keeper/staking.go b/x/pairing/keeper/staking.go index 5f4d179e7c..4e4d8ae221 100644 --- a/x/pairing/keeper/staking.go +++ b/x/pairing/keeper/staking.go @@ -7,11 +7,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" ) const ( @@ -23,6 +24,19 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin logger := k.Logger(ctx) specChainID := chainID + metadata, err := k.epochStorageKeeper.GetMetadata(ctx, provider) + if err != nil { + // first provider with this address + metadata = epochstoragetypes.ProviderMetadata{ + Provider: provider, + Vault: creator, + Chains: []string{chainID}, + TotalDelegations: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()), + } + } else { + metadata.Chains = lavaslices.AddUnique(metadata.Chains, chainID) + } + spec, err := k.specKeeper.GetExpandedSpec(ctx, specChainID) if err != nil || !spec.Enabled { return utils.LavaFormatWarning("spec not found or not active", err, @@ -31,14 +45,6 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin } // if we get here, the spec is active and supported - if amount.IsLT(k.dualstakingKeeper.MinSelfDelegation(ctx)) { // we count on this to also check the denom - return utils.LavaFormatWarning("insufficient stake amount", fmt.Errorf("stake amount smaller than MinSelfDelegation"), - utils.Attribute{Key: "spec", Value: specChainID}, - utils.Attribute{Key: "provider", Value: creator}, - utils.Attribute{Key: "stake", Value: amount}, - utils.Attribute{Key: "minSelfDelegation", Value: k.dualstakingKeeper.MinSelfDelegation(ctx).String()}, - ) - } senderAddr, err := sdk.AccAddressFromBech32(creator) if err != nil { return utils.LavaFormatWarning("invalid address", err, @@ -94,15 +100,14 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin // verify that the provider only tries to change non-stake related traits of the stake entry // a provider can be the same as the vault, so we verify it's not the case if isProvider { - if delegationCommission != existingEntry.DelegateCommission || + if delegationCommission != metadata.DelegateCommission || !amount.Equal(existingEntry.Stake) { return utils.LavaFormatWarning("only vault address can change stake/delegation related properties of the stake entry", fmt.Errorf("invalid modification request for stake entry"), utils.LogAttr("creator", creator), utils.LogAttr("vault", existingEntry.Vault), utils.LogAttr("provider", provider), utils.LogAttr("description", description.String()), - utils.LogAttr("req_delegation_limit", delegationLimit), - utils.LogAttr("current_delegation_commission", existingEntry.DelegateCommission), + utils.LogAttr("current_delegation_commission", metadata.DelegateCommission), utils.LogAttr("req_delegation_commission", delegationCommission), utils.LogAttr("current_stake", existingEntry.Stake.String()), utils.LogAttr("req_stake", amount.String()), @@ -131,48 +136,52 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin // if the provider has no delegations then we dont limit the changes if !existingEntry.DelegateTotal.IsZero() { // if there was a change in the last 24h than we dont allow changes - if ctx.BlockTime().UTC().Unix()-int64(existingEntry.LastChange) < int64(CHANGE_WINDOW.Seconds()) { - if delegationCommission != existingEntry.DelegateCommission { + if ctx.BlockTime().UTC().Unix()-int64(metadata.LastChange) < int64(CHANGE_WINDOW.Seconds()) { + if delegationCommission != metadata.DelegateCommission { return utils.LavaFormatWarning(fmt.Sprintf("stake entry commmision or delegate limit can only be changes once in %s", CHANGE_WINDOW), nil, - utils.LogAttr("last_change_time", existingEntry.LastChange)) + utils.LogAttr("last_change_time", metadata.LastChange)) } } // check that the change is not mode than MAX_CHANGE_RATE - if int64(delegationCommission)-int64(existingEntry.DelegateCommission) > MAX_CHANGE_RATE { + if int64(delegationCommission)-int64(metadata.DelegateCommission) > MAX_CHANGE_RATE { return utils.LavaFormatWarning("stake entry commission increase too high", fmt.Errorf("commission change cannot increase by more than %d at a time", MAX_CHANGE_RATE), - utils.LogAttr("original_commission", existingEntry.DelegateCommission), + utils.LogAttr("original_commission", metadata.DelegateCommission), utils.LogAttr("wanted_commission", delegationCommission), ) } } // we dont change stakeAppliedBlocks and chain once they are set, if they need to change, unstake first + beforeAmount := existingEntry.Stake + increase := amount.Amount.GT(existingEntry.Stake.Amount) + decrease := amount.Amount.LT(existingEntry.Stake.Amount) existingEntry.Geolocation = geolocation existingEntry.Endpoints = endpointsVerified - existingEntry.Description = description - existingEntry.DelegateCommission = delegationCommission - existingEntry.LastChange = uint64(ctx.BlockTime().UTC().Unix()) + metadata.Description = description + metadata.DelegateCommission = delegationCommission + metadata.LastChange = uint64(ctx.BlockTime().UTC().Unix()) + existingEntry.Stake = amount k.epochStorageKeeper.SetStakeEntryCurrent(ctx, existingEntry) - - if amount.Amount.GT(existingEntry.Stake.Amount) { + k.epochStorageKeeper.SetMetadata(ctx, metadata) + if increase { // delegate the difference - diffAmount := amount.Sub(existingEntry.Stake) - err = k.dualstakingKeeper.DelegateFull(ctx, existingEntry.Vault, validator, existingEntry.Address, chainID, diffAmount) + diffAmount := amount.Sub(beforeAmount) + err = k.dualstakingKeeper.DelegateFull(ctx, existingEntry.Vault, validator, existingEntry.Address, diffAmount, true) if err != nil { details = append(details, utils.Attribute{Key: "neededStake", Value: amount.Sub(existingEntry.Stake).String()}) - return utils.LavaFormatWarning("insufficient funds to pay for difference in stake", err, + return utils.LavaFormatWarning("failed to increase stake", err, details..., ) } - } else if amount.Amount.LT(existingEntry.Stake.Amount) { + } else if decrease { // unbond the difference - diffAmount := existingEntry.Stake.Sub(amount) - err = k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator, existingEntry.Address, chainID, diffAmount, false) + diffAmount := beforeAmount.Sub(amount) + err = k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator, existingEntry.Address, diffAmount, true) if err != nil { details = append(details, utils.Attribute{Key: "neededStake", Value: amount.Sub(existingEntry.Stake).String()}) - return utils.LavaFormatWarning("insufficient funds to pay for difference in stake", err, + return utils.LavaFormatWarning("failed to decrease stake", err, details..., ) } @@ -201,6 +210,13 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin } } + if creator != metadata.Vault { + return utils.LavaFormatWarning("creator does not match the provider vault", err, + utils.Attribute{Key: "vault", Value: metadata.Vault}, + utils.Attribute{Key: "creator", Value: creator}, + ) + } + // entry isn't staked so add him details := []utils.Attribute{ {Key: "spec", Value: specChainID}, @@ -220,39 +236,49 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin ) } - delegations, err := k.dualstakingKeeper.GetProviderDelegators(ctx, provider, nextEpoch) - if err != nil { - utils.LavaFormatWarning("cannot get provider's delegators", err, - utils.LogAttr("provider", provider), - utils.LogAttr("block", nextEpoch), - ) + stakeAmount := amount + // creating a new provider, fetch old delegation + if len(metadata.Chains) == 1 { + delegations, err := k.dualstakingKeeper.GetProviderDelegators(ctx, provider) + if err == nil { + for _, d := range delegations { + if d.Delegator == creator { + stakeAmount = stakeAmount.Add(d.Amount) + } else { + metadata.TotalDelegations = metadata.TotalDelegations.Add(d.Amount) + } + } + } } - for _, d := range delegations { - if (d.Delegator == creator && d.Provider == provider) || d.ChainID != chainID { - // ignore provider self delegation (delegator = vault, provider = provider) or delegations from other chains - continue - } - delegateTotal = delegateTotal.Add(d.Amount.Amount) + if stakeAmount.IsLT(k.dualstakingKeeper.MinSelfDelegation(ctx)) { // we count on this to also check the denom + return utils.LavaFormatWarning("insufficient stake amount", fmt.Errorf("stake amount smaller than MinSelfDelegation"), + utils.Attribute{Key: "spec", Value: specChainID}, + utils.Attribute{Key: "provider", Value: creator}, + utils.Attribute{Key: "stake", Value: amount}, + utils.Attribute{Key: "minSelfDelegation", Value: k.dualstakingKeeper.MinSelfDelegation(ctx).String()}, + ) } stakeEntry := epochstoragetypes.StakeEntry{ - Stake: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()), // we set this to 0 since the delegate will take care of this - Address: provider, - StakeAppliedBlock: stakeAppliedBlock, - Endpoints: endpointsVerified, - Geolocation: geolocation, - Chain: chainID, - Description: description, - DelegateTotal: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), delegateTotal), - DelegateCommission: delegationCommission, - Vault: creator, // the stake-provider TX creator is always regarded as the vault address - LastChange: uint64(ctx.BlockTime().UTC().Unix()), + Stake: stakeAmount, + Address: provider, + StakeAppliedBlock: stakeAppliedBlock, + Endpoints: endpointsVerified, + Geolocation: geolocation, + Chain: chainID, + DelegateTotal: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), delegateTotal), + Vault: creator, // the stake-provider TX creator is always regarded as the vault address } + metadata.DelegateCommission = delegationCommission + metadata.LastChange = uint64(ctx.BlockTime().UTC().Unix()) + metadata.Description = description + + k.epochStorageKeeper.SetMetadata(ctx, metadata) k.epochStorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) - err = k.dualstakingKeeper.DelegateFull(ctx, stakeEntry.Vault, validator, stakeEntry.Address, chainID, amount) + err = k.dualstakingKeeper.DelegateFull(ctx, stakeEntry.Vault, validator, stakeEntry.Address, amount, true) if err != nil { return utils.LavaFormatWarning("provider self delegation failed", err, details..., diff --git a/x/pairing/keeper/unresponsive_provider.go b/x/pairing/keeper/unresponsive_provider.go index a1443d7b6c..be1384a402 100644 --- a/x/pairing/keeper/unresponsive_provider.go +++ b/x/pairing/keeper/unresponsive_provider.go @@ -8,9 +8,9 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) const ( diff --git a/x/pairing/keeper/unresponsive_provider_test.go b/x/pairing/keeper/unresponsive_provider_test.go index abaf11842c..2f366d25b6 100644 --- a/x/pairing/keeper/unresponsive_provider_test.go +++ b/x/pairing/keeper/unresponsive_provider_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/utils/rand" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/utils/rand" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -429,7 +429,7 @@ func TestJailProviderForUnresponsiveness(t *testing.T) { // jail first time jailProvider() // try to unfreeze with increase of self delegation - _, err = ts.TxDualstakingDelegate(provider1, provider1, ts.spec.Index, common.NewCoin(ts.TokenDenom(), 1)) + _, err = ts.TxDualstakingDelegate(provider1, provider1, common.NewCoin(ts.TokenDenom(), 1)) require.Nil(t, err) _, err = ts.TxPairingUnfreezeProvider(provider1, ts.spec.Index) @@ -457,7 +457,7 @@ func TestJailProviderForUnresponsiveness(t *testing.T) { // jail third time jailProvider() // try to unfreeze with increase of self delegation - _, err = ts.TxDualstakingDelegate(provider1, provider1, ts.spec.Index, common.NewCoin(ts.TokenDenom(), 1)) + _, err = ts.TxDualstakingDelegate(provider1, provider1, common.NewCoin(ts.TokenDenom(), 1)) require.Nil(t, err) _, err = ts.TxPairingUnfreezeProvider(provider1, ts.spec.Index) diff --git a/x/pairing/keeper/unstaking.go b/x/pairing/keeper/unstaking.go index 87d64d5174..3adbf00b81 100644 --- a/x/pairing/keeper/unstaking.go +++ b/x/pairing/keeper/unstaking.go @@ -6,8 +6,9 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unstakeDescription string) error { @@ -36,8 +37,8 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta ) } - if creator != existingEntry.Vault { - return utils.LavaFormatWarning("can't unstake entry with provider address, only vault address is allowed to unstake", fmt.Errorf("provider unstake failed"), + if creator != existingEntry.Vault && creator != existingEntry.Address { + return utils.LavaFormatWarning("unstake can be don only by provider or vault", fmt.Errorf("provider unstake failed"), utils.LogAttr("creator", creator), utils.LogAttr("provider", existingEntry.Address), utils.LogAttr("vault", existingEntry.Vault), @@ -45,13 +46,46 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta ) } - // the stake entry is removed inside UnbondFull - err := k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator, existingEntry.Address, existingEntry.GetChain(), existingEntry.Stake, true) - if err != nil { - return utils.LavaFormatWarning("can't unbond self delegation", err, - utils.Attribute{Key: "address", Value: existingEntry.Address}, - utils.Attribute{Key: "spec", Value: chainID}, - ) + amount := existingEntry.Stake + k.epochStorageKeeper.RemoveStakeEntryCurrent(ctx, existingEntry.Chain, existingEntry.Address) + + if existingEntry.Vault == creator { + // remove delegation + err := k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator, existingEntry.Address, amount, true) + if err != nil { + return utils.LavaFormatWarning("can't unbond self delegation", err, + utils.Attribute{Key: "address", Value: existingEntry.Address}, + utils.Attribute{Key: "spec", Value: chainID}, + ) + } + } else { + // provider is not vault so delegation stays. + // distribute stake between other chains + metadata, err := k.epochStorageKeeper.GetMetadata(ctx, existingEntry.Address) + if err == nil { + entries := []*epochstoragetypes.StakeEntry{} + for _, chain := range metadata.Chains { + entry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chain, existingEntry.Address) + if found { + entries = append(entries, &entry) + } else { + utils.LavaFormatError("did not find stake entry that exists in metadata", nil, + utils.LogAttr("provider", existingEntry.Address), + utils.LogAttr("chain", chain), + ) + } + } + + total := amount.Amount + count := int64(len(entries)) + for _, entry := range entries { + part := total.QuoRaw(count) + entry.Stake = entry.Stake.AddAmount(part) + total = total.Sub(part) + count-- + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, *entry) + } + } } details := map[string]string{ @@ -96,7 +130,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, existingEntry.GetChain(), sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), amount), true) + err = k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator.OperatorAddress, existingEntry.Address, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), amount), true) if err != nil { return utils.LavaFormatWarning("can't unbond self delegation", err, utils.LogAttr("provider", existingEntry.Address), diff --git a/x/pairing/keeper/unstaking_test.go b/x/pairing/keeper/unstaking_test.go index cff2bf2537..4ca0642f1b 100644 --- a/x/pairing/keeper/unstaking_test.go +++ b/x/pairing/keeper/unstaking_test.go @@ -5,9 +5,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - testutils "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/testutil/common" + testutils "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -24,7 +24,7 @@ func TestUnstakeAndSlashProposal(t *testing.T) { for i := 0; i < delegators; i++ { _, delegator := ts.GetAccount(common.CONSUMER, i) beforeSlashDelegation[delegator] = sdk.NewInt(1000 * int64(i+1)) - _, err := ts.TxDualstakingDelegate(delegator, provider, ts.spec.Index, sdk.NewCoin(ts.BondDenom(), beforeSlashDelegation[delegator])) + _, 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)))}) } @@ -38,7 +38,7 @@ func TestUnstakeAndSlashProposal(t *testing.T) { ) require.NoError(t, err) - result, err := ts.QueryDualstakingProviderDelegators(provider, true) + result, err := ts.QueryDualstakingProviderDelegators(provider) require.NoError(t, err) for _, d := range result.Delegations { for _, s := range delegatorsSlashing { diff --git a/x/pairing/migrations/v2/epoch_payments.go b/x/pairing/migrations/v2/epoch_payments.go index 4f99051035..93c6c75faa 100644 --- a/x/pairing/migrations/v2/epoch_payments.go +++ b/x/pairing/migrations/v2/epoch_payments.go @@ -4,7 +4,7 @@ import ( "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/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" ) // RemoveAllEpochPayments removes all epochPayments diff --git a/x/pairing/module.go b/x/pairing/module.go index 5f605c9eb7..fdb1b7bbe3 100644 --- a/x/pairing/module.go +++ b/x/pairing/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/pairing/client/cli" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/client/cli" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) var ( @@ -133,9 +133,13 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.MigrateVersion2To3); err != nil { panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) } - // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.MigrateVersion3To4); err != nil { - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) + // // register v3 -> v4 migration + // if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.MigrateVersion3To4); err != nil { + // panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) + // } + // register v4 -> v5 migration + if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.MigrateVersion4To5); err != nil { + panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) } } @@ -161,7 +165,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 4 } +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) { diff --git a/x/pairing/module_simulation.go b/x/pairing/module_simulation.go index ee5c80ce35..2d2e31c970 100644 --- a/x/pairing/module_simulation.go +++ b/x/pairing/module_simulation.go @@ -10,9 +10,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" types2 "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - pairingsimulation "github.com/lavanet/lava/v3/x/pairing/simulation" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/testutil/sample" + pairingsimulation "github.com/lavanet/lava/v4/x/pairing/simulation" + "github.com/lavanet/lava/v4/x/pairing/types" ) // avoid unused import issue diff --git a/x/pairing/proposal_handler.go b/x/pairing/proposal_handler.go index d0d2f4351d..9a919709df 100644 --- a/x/pairing/proposal_handler.go +++ b/x/pairing/proposal_handler.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) // NewPlanProposalsHandler creates a new governance Handler for a Plan diff --git a/x/pairing/simulation/freeze.go b/x/pairing/simulation/freeze.go index 9a46c5614c..c583ddb917 100644 --- a/x/pairing/simulation/freeze.go +++ b/x/pairing/simulation/freeze.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) func SimulateMsgFreeze( diff --git a/x/pairing/simulation/relay_payment.go b/x/pairing/simulation/relay_payment.go index 54267f6432..6cd2b08a8d 100644 --- a/x/pairing/simulation/relay_payment.go +++ b/x/pairing/simulation/relay_payment.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) func SimulateMsgRelayPayment( diff --git a/x/pairing/simulation/stake_provider.go b/x/pairing/simulation/stake_provider.go index dc11222b10..0eece3809b 100644 --- a/x/pairing/simulation/stake_provider.go +++ b/x/pairing/simulation/stake_provider.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) func SimulateMsgStakeProvider( diff --git a/x/pairing/simulation/unfreeze.go b/x/pairing/simulation/unfreeze.go index 2290520162..77256d7b20 100644 --- a/x/pairing/simulation/unfreeze.go +++ b/x/pairing/simulation/unfreeze.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) func SimulateMsgUnfreeze( diff --git a/x/pairing/simulation/unstake_provider.go b/x/pairing/simulation/unstake_provider.go index 17dc71b610..71f79e812a 100644 --- a/x/pairing/simulation/unstake_provider.go +++ b/x/pairing/simulation/unstake_provider.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/pairing/keeper" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/keeper" + "github.com/lavanet/lava/v4/x/pairing/types" ) func SimulateMsgUnstakeProvider( diff --git a/x/pairing/types/account_info.pb.go b/x/pairing/types/account_info.pb.go index f61ce4c3a8..bb98b15a49 100644 --- a/x/pairing/types/account_info.pb.go +++ b/x/pairing/types/account_info.pb.go @@ -8,10 +8,10 @@ import ( types3 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types4 "github.com/lavanet/lava/v3/x/dualstaking/types" - types "github.com/lavanet/lava/v3/x/epochstorage/types" - types2 "github.com/lavanet/lava/v3/x/projects/types" - types1 "github.com/lavanet/lava/v3/x/subscription/types" + types4 "github.com/lavanet/lava/v4/x/dualstaking/types" + types "github.com/lavanet/lava/v4/x/epochstorage/types" + types2 "github.com/lavanet/lava/v4/x/projects/types" + types1 "github.com/lavanet/lava/v4/x/subscription/types" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" math "math" @@ -141,35 +141,35 @@ var fileDescriptor_5569ac5696c70068 = []byte{ // 494 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, 0x10, 0x8d, 0x21, 0xa4, 0xc5, 0xe5, 0x00, 0x56, 0x40, 0x56, 0x0f, 0x26, 0x82, 0xa2, 0x46, 0x2d, - 0xda, 0x55, 0xdb, 0x3b, 0x12, 0xa5, 0x08, 0x71, 0x6b, 0x53, 0x89, 0x03, 0x17, 0x6b, 0x63, 0x4f, - 0x5c, 0x83, 0xbb, 0x63, 0xed, 0xae, 0x0d, 0xe1, 0x2b, 0xf8, 0xac, 0x1e, 0x7b, 0xe4, 0x84, 0x50, - 0xf2, 0x19, 0x5c, 0x90, 0xd7, 0xbb, 0x61, 0xf7, 0x08, 0x27, 0xcf, 0x68, 0xde, 0xbc, 0x99, 0x79, - 0xfb, 0x1c, 0xee, 0x57, 0xac, 0x65, 0x1c, 0x14, 0xed, 0xbe, 0xb4, 0x66, 0xa5, 0x28, 0x79, 0x41, - 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0x08, 0xb1, + 0x86, 0x30, 0x06, 0x21, 0xa7, 0x9b, 0x2e, 0xfb, 0x6a, 0xe6, 0xdc, 0x87, 0x0e, 0xdf, 0x87, 0x0d, + 0x5d, 0x94, 0x86, 0x6e, 0x21, 0xb5, 0x2f, 0x24, 0xe3, 0x6d, 0x3d, 0x67, 0xcf, 0x5f, 0xdb, 0x71, + 0xac, 0x33, 0xc9, 0x4c, 0x18, 0x3b, 0x44, 0x67, 0x96, 0x27, 0x3a, 0x0c, 0x1f, 0x28, 0x54, 0xac, + 0x4a, 0x9d, 0x6a, 0x7c, 0x77, 0x12, 0x4c, 0x87, 0xb3, 0xfb, 0xba, 0xf0, 0x97, 0x47, 0x9e, 0x9c, + 0x5e, 0xaf, 0x92, 0xe0, 0x66, 0x95, 0x04, 0xbf, 0x56, 0x49, 0xf0, 0x7d, 0x9d, 0x0c, 0x6e, 0xd6, + 0xc9, 0xe0, 0xc7, 0x3a, 0x19, 0x7c, 0x3c, 0x28, 0x4a, 0x75, 0xd9, 0xcc, 0x49, 0x86, 0x57, 0xd4, + 0xf3, 0x71, 0xfb, 0x92, 0x7e, 0xdd, 0xfc, 0xeb, 0x6a, 0x59, 0x83, 0x9c, 0x8f, 0xb4, 0x95, 0x5f, + 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0xab, 0x04, 0x7b, 0x26, 0x10, 0x04, 0x00, 0x00, } func (m *QueryAccountInfoResponse) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/badge_test.go b/x/pairing/types/badge_test.go index 755f98bbe0..4d6e0a47d2 100644 --- a/x/pairing/types/badge_test.go +++ b/x/pairing/types/badge_test.go @@ -3,7 +3,7 @@ package types import ( "testing" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/badges.pb.go b/x/pairing/types/badges.pb.go index 762f5cf6d8..21dcef0610 100644 --- a/x/pairing/types/badges.pb.go +++ b/x/pairing/types/badges.pb.go @@ -9,8 +9,8 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v3/x/epochstorage/types" - types "github.com/lavanet/lava/v3/x/spec/types" + _ "github.com/lavanet/lava/v4/x/epochstorage/types" + types "github.com/lavanet/lava/v4/x/spec/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -167,35 +167,35 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/badges.proto", fileDescriptor_5013dfba46b4caa4) } var fileDescriptor_5013dfba46b4caa4 = []byte{ - // 442 bytes of a gzipped FileDescriptorProto + // 443 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6f, 0xd3, 0x30, 0x14, 0x6e, 0x46, 0x19, 0x9a, 0xc7, 0x38, 0x58, 0x41, 0x54, 0x85, 0x85, 0x51, 0x2e, 0x68, 0x15, - 0x31, 0x74, 0xbf, 0x80, 0x0a, 0x69, 0xda, 0x0d, 0xb2, 0x1b, 0x97, 0xc8, 0x4d, 0x1e, 0x5e, 0x46, - 0x89, 0x3d, 0xdb, 0x19, 0x54, 0xe2, 0x17, 0x70, 0xe2, 0x67, 0xed, 0xd8, 0x23, 0x27, 0x84, 0xda, - 0x3f, 0x82, 0xfc, 0xec, 0x56, 0x0a, 0x04, 0x69, 0x97, 0xc4, 0x7e, 0xdf, 0x67, 0x7f, 0xef, 0xfb, - 0xfc, 0xc8, 0xb3, 0x39, 0xbf, 0xe6, 0x35, 0x58, 0xe6, 0xfe, 0x4c, 0xf1, 0x4a, 0x57, 0xb5, 0x60, - 0x33, 0x5e, 0x0a, 0x30, 0xa9, 0xd2, 0xd2, 0x4a, 0x1a, 0x07, 0x4a, 0xea, 0xfe, 0x69, 0xa0, 0x0c, - 0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0xea, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x43, 0x04, 0x8b, 0xb8, 0x52, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/codec.go b/x/pairing/types/codec.go index abac0115f6..8c75476c0d 100644 --- a/x/pairing/types/codec.go +++ b/x/pairing/types/codec.go @@ -16,6 +16,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgRelayPayment{}, "pairing/RelayPayment", nil) cdc.RegisterConcrete(&MsgFreezeProvider{}, "pairing/Freeze", nil) cdc.RegisterConcrete(&MsgUnfreezeProvider{}, "pairing/Unfreeze", nil) + cdc.RegisterConcrete(&MsgMoveProviderStake{}, "pairing/MoveProviderStake", nil) // this line is used by starport scaffolding # 2 } @@ -35,6 +36,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUnfreezeProvider{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgMoveProviderStake{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/pairing/types/debug_query.pb.go b/x/pairing/types/debug_query.pb.go index 8cbf5c8a8f..2bbabcf459 100644 --- a/x/pairing/types/debug_query.pb.go +++ b/x/pairing/types/debug_query.pb.go @@ -8,10 +8,10 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v3/x/dualstaking/types" - _ "github.com/lavanet/lava/v3/x/epochstorage/types" - _ "github.com/lavanet/lava/v3/x/projects/types" - _ "github.com/lavanet/lava/v3/x/subscription/types" + _ "github.com/lavanet/lava/v4/x/dualstaking/types" + _ "github.com/lavanet/lava/v4/x/epochstorage/types" + _ "github.com/lavanet/lava/v4/x/projects/types" + _ "github.com/lavanet/lava/v4/x/subscription/types" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" math "math" @@ -154,38 +154,38 @@ func init() { } var fileDescriptor_a315cb51b0edeaef = []byte{ - // 496 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xcd, 0x6e, 0xd3, 0x4e, - 0x14, 0xc5, 0xe3, 0x7f, 0x3f, 0xfe, 0x74, 0x8a, 0x04, 0x32, 0x29, 0xb5, 0x82, 0x64, 0xca, 0x87, - 0xa0, 0x7c, 0x28, 0x43, 0x94, 0x05, 0x0b, 0xc4, 0x82, 0x28, 0x62, 0x85, 0x10, 0x64, 0xc9, 0xc6, - 0x1a, 0xdb, 0x37, 0x8e, 0xe9, 0x8d, 0xef, 0x30, 0x33, 0x76, 0xe9, 0x5b, 0xf0, 0x58, 0x2c, 0xbb, - 0x64, 0x89, 0x92, 0x35, 0xef, 0x80, 0x3c, 0xf6, 0x58, 0x18, 0xba, 0xf2, 0xdc, 0x7b, 0x7e, 0x67, - 0x4e, 0x74, 0x34, 0x61, 0x8f, 0x50, 0x54, 0xa2, 0x00, 0xc3, 0xeb, 0x2f, 0x97, 0x22, 0x57, 0x79, - 0x91, 0xf1, 0x14, 0xe2, 0x32, 0x8b, 0xbe, 0x94, 0xa0, 0x2e, 0xc6, 0x52, 0x91, 0x21, 0x7f, 0xd8, - 0x72, 0xe3, 0xfa, 0x3b, 0x6e, 0xb9, 0xd1, 0x30, 0xa3, 0x8c, 0x2c, 0xc0, 0xeb, 0x53, 0xc3, 0x8e, - 0xc2, 0x8c, 0x28, 0x43, 0xe0, 0x76, 0x8a, 0xcb, 0x25, 0x3f, 0x57, 0x42, 0x4a, 0x50, 0xba, 0xd5, - 0x9f, 0xf5, 0x32, 0x41, 0x52, 0xb2, 0xd2, 0x86, 0x94, 0xc8, 0x80, 0x6b, 0x23, 0xce, 0x20, 0x82, - 0xc2, 0xb8, 0xe0, 0xd1, 0xe3, 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0xce, 0xbe, 0x2c, 0x11, 0x5d, 0x1d, - 0xfb, 0xb6, 0x0e, 0xdf, 0x69, 0x6f, 0x4b, 0xc4, 0xb6, 0x95, 0x97, 0xac, 0xbb, 0xad, 0x85, 0xa3, - 0x82, 0xa2, 0x98, 0x8a, 0x52, 0x07, 0xff, 0x5b, 0xd7, 0x91, 0xd3, 0x1b, 0xc7, 0x7b, 0x9a, 0xd5, - 0xa2, 0x3f, 0x64, 0x7b, 0xb6, 0xdd, 0xe0, 0x9a, 0xa5, 0x9a, 0xc1, 0xbf, 0xcb, 0x0e, 0xd7, 0x54, - 0x98, 0x95, 0x8e, 0x10, 0x96, 0x26, 0x38, 0xb0, 0x1a, 0x6b, 0x56, 0xef, 0x60, 0x69, 0xfc, 0x27, - 0xec, 0x66, 0x25, 0x30, 0x4f, 0x85, 0x21, 0x17, 0x18, 0x30, 0x4b, 0xdd, 0xe8, 0xf6, 0x4d, 0xd0, - 0x6c, 0xfe, 0x7d, 0x13, 0x7a, 0x97, 0x9b, 0xd0, 0xfb, 0xb9, 0x09, 0xbd, 0x6f, 0xdb, 0x70, 0x70, - 0xb9, 0x0d, 0x07, 0x3f, 0xb6, 0xe1, 0xe0, 0xd3, 0xd3, 0x2c, 0x37, 0xab, 0x32, 0x1e, 0x27, 0xb4, - 0xe6, 0xbd, 0x97, 0x53, 0x4d, 0xf9, 0xd7, 0xee, 0xcf, 0x65, 0x2e, 0x24, 0xe8, 0x78, 0xdf, 0x3e, - 0x9e, 0xe9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9e, 0xb9, 0x56, 0xad, 0x81, 0x03, 0x00, 0x00, + // 495 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, + 0x14, 0x85, 0x63, 0xfa, 0x03, 0x9d, 0x22, 0x81, 0x4c, 0x4a, 0xad, 0x20, 0x99,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 0x77, 0xd9, 0xfe, 0x8a, 0x0a, 0xb3, + 0xd4, 0x11, 0xc2, 0xc2, 0x04, 0x7b, 0x56, 0x63, 0xcd, 0xea, 0x3d, 0x2c, 0x8c, 0xff, 0x84, 0xdd, + 0xac, 0x04, 0xe6, 0xa9, 0x30, 0xe4, 0x02, 0x03, 0x66, 0xa9, 0x1b, 0xdd, 0xbe, 0x09, 0x9a, 0xce, + 0x7e, 0xac, 0x43, 0xef, 0x62, 0x1d, 0x7a, 0xbf, 0xd6, 0xa1, 0xf7, 0x7d, 0x13, 0x0e, 0x2e, 0x36, + 0xe1, 0xe0, 0xe7, 0x26, 0x1c, 0x7c, 0x7e, 0x9a, 0xe5, 0x66, 0x59, 0xc6, 0xe3, 0x84, 0x56, 0xbc, + 0xf7, 0x72, 0xaa, 0x97, 0xfc, 0x5b, 0xf7, 0xe7, 0x32, 0xe7, 0x12, 0x74, 0xbc, 0x6b, 0x1f, 0xcf, + 0xc9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x36, 0x45, 0x06, 0x63, 0x81, 0x03, 0x00, 0x00, } func (m *QueryDebugQueryResponse) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/epoch_cu.go b/x/pairing/types/epoch_cu.go index eec3cfeb8f..4f659ce4b4 100644 --- a/x/pairing/types/epoch_cu.go +++ b/x/pairing/types/epoch_cu.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/lavanet/lava/v3/utils" + "github.com/lavanet/lava/v4/utils" ) const ( diff --git a/x/pairing/types/epoch_cu.pb.go b/x/pairing/types/epoch_cu.pb.go index baf21315db..840fc1bd89 100644 --- a/x/pairing/types/epoch_cu.pb.go +++ b/x/pairing/types/epoch_cu.pb.go @@ -225,9 +225,9 @@ var fileDescriptor_c2abb0ec984ffb4c = []byte{ 0x9a, 0x8b, 0xb0, 0x9f, 0x8f, 0x8b, 0x09, 0xae, 0x8b, 0x29, 0xb9, 0xd4, 0xc9, 0xe5, 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, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, - 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x02, 0xa6, 0xcc, 0x58, 0xbf, 0x02, 0x1e, 0x3a, 0x25, 0x95, 0x05, - 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xb0, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x71, 0xca, - 0x79, 0x42, 0x01, 0x00, 0x00, + 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x02, 0xa6, 0xcc, 0x44, 0xbf, 0x02, 0x1e, 0x3a, 0x25, 0x95, 0x05, + 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xb0, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x64, 0x8d, 0x9a, + 0xb7, 0x42, 0x01, 0x00, 0x00, } func (m *UniqueEpochSession) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/expected_keepers.go b/x/pairing/types/expected_keepers.go index b9ba3bed29..076c7b0562 100644 --- a/x/pairing/types/expected_keepers.go +++ b/x/pairing/types/expected_keepers.go @@ -8,15 +8,15 @@ import ( 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/v3/x/downtime/v1" - dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/v3/x/subscription/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v4/x/subscription/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) type SpecKeeper interface { @@ -53,6 +53,8 @@ type EpochstorageKeeper interface { GetAllStakeEntriesCurrent(ctx sdk.Context) []epochstoragetypes.StakeEntry RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, provider string) GetEpochHash(ctx sdk.Context, epoch uint64) []byte + GetMetadata(ctx sdk.Context, provider string) (epochstoragetypes.ProviderMetadata, error) + SetMetadata(ctx sdk.Context, metadata epochstoragetypes.ProviderMetadata) } type AccountKeeper interface { @@ -103,10 +105,12 @@ type DowntimeKeeper interface { type DualstakingKeeper interface { RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, err error) - DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin) error - UnbondFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin, unstake bool) error - GetProviderDelegators(ctx sdk.Context, provider string, epoch uint64) ([]dualstakingtypes.Delegation, error) + DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, amount sdk.Coin, stake bool) error + UnbondFull(ctx sdk.Context, delegator string, validator string, provider string, amount sdk.Coin, stake bool) error + GetProviderDelegators(ctx sdk.Context, provider string) ([]dualstakingtypes.Delegation, error) MinSelfDelegation(ctx sdk.Context) sdk.Coin + GetDelegation(ctx sdk.Context, provider, delegator string) (dualstakingtypes.Delegation, bool) + AfterDelegationModified(ctx sdk.Context, delegator, provider string, amount sdk.Coin, increase, stake bool) (err error) } type FixationStoreKeeper interface { diff --git a/x/pairing/types/genesis.go b/x/pairing/types/genesis.go index 8bf6eb57e5..430e2cc889 100644 --- a/x/pairing/types/genesis.go +++ b/x/pairing/types/genesis.go @@ -3,8 +3,8 @@ package types import ( "fmt" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) // DefaultIndex is the default capability global index diff --git a/x/pairing/types/genesis.pb.go b/x/pairing/types/genesis.pb.go index 8ef380aec8..8c6886d4a6 100644 --- a/x/pairing/types/genesis.pb.go +++ b/x/pairing/types/genesis.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/lavanet/lava/v3/x/fixationstore/types" - types "github.com/lavanet/lava/v3/x/timerstore/types" + types1 "github.com/lavanet/lava/v4/x/fixationstore/types" + types "github.com/lavanet/lava/v4/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -483,7 +483,7 @@ var fileDescriptor_dbd1e49b8b57595b = []byte{ // 697 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xc1, 0x53, 0xd3, 0x4e, 0x18, 0x6d, 0x68, 0x5a, 0xc2, 0x57, 0x7e, 0x3f, 0xcb, 0x8a, 0x12, 0x2a, 0xc4, 0x12, 0xc7, 0x99, - 0xe2, 0x68, 0x32, 0x03, 0x8e, 0x07, 0x8f, 0xa0, 0x32, 0xa0, 0x07, 0x69, 0x61, 0x9c, 0xf1, 0x12, + 0xe2, 0x68, 0x32, 0x83, 0x8c, 0x07, 0x8f, 0xa0, 0x32, 0xa0, 0x07, 0x69, 0x61, 0x9c, 0xf1, 0x12, 0xd3, 0x64, 0x2d, 0xab, 0x34, 0x59, 0xb3, 0x49, 0x87, 0x9e, 0xfc, 0x17, 0xbc, 0x79, 0xf6, 0x1f, 0xf1, 0xcc, 0x91, 0xa3, 0x27, 0xc7, 0x81, 0x83, 0x7f, 0x83, 0x37, 0x27, 0x9b, 0x6d, 0x69, 0xda, 0x04, 0xc5, 0x71, 0x3c, 0x25, 0x9b, 0x7d, 0xdf, 0x7b, 0xdf, 0xcb, 0xbe, 0x6f, 0x16, 0xf4, 0x43, @@ -509,22 +509,22 @@ var fileDescriptor_dbd1e49b8b57595b = []byte{ 0xb4, 0x48, 0x95, 0xa6, 0x77, 0x19, 0x7a, 0x0f, 0xcb, 0xe3, 0x0a, 0x7e, 0x97, 0x1e, 0xda, 0xc4, 0xe3, 0xc9, 0x61, 0x2a, 0x70, 0xb1, 0x07, 0xbf, 0x23, 0x36, 0x28, 0x0c, 0xc6, 0x65, 0x6b, 0x34, 0x13, 0xe7, 0xc6, 0x0d, 0xf4, 0xe1, 0xc6, 0xb0, 0x01, 0xc7, 0xf7, 0x58, 0xd4, 0x4d, 0x79, 0xad, - 0x70, 0xf9, 0xfb, 0x17, 0xcb, 0x6f, 0x8a, 0xba, 0x4c, 0xcf, 0x2a, 0xcd, 0x46, 0xb1, 0x1d, 0x59, - 0x99, 0xaa, 0x16, 0x77, 0x64, 0xa5, 0x58, 0x95, 0x77, 0x64, 0x45, 0xae, 0x96, 0xf4, 0x4f, 0x12, - 0x2c, 0xe6, 0x1e, 0x14, 0x9a, 0x87, 0x12, 0x6f, 0x8c, 0x4f, 0x89, 0xdc, 0x4c, 0x16, 0xa8, 0x06, - 0xca, 0x40, 0x81, 0xcf, 0xd9, 0x4c, 0x73, 0xb8, 0x46, 0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 0xdd, 0xbb, 0xd4, + 0x90, 0x09, 0xf7, 0x0b, 0x39, 0xd3, 0xb5, 0xf1, 0xe8, 0xf8, 0x54, 0x93, 0x4e, 0x4e, 0x35, 0xe9, + 0xdb, 0xa9, 0x26, 0x7d, 0x38, 0xd3, 0x0a, 0x27, 0x67, 0x5a, 0xe1, 0xcb, 0x99, 0x56, 0x78, 0x79, + 0xa7, 0x43, 0xc2, 0x83, 0xa8, 0x6d, 0x38, 0x7e, 0xd7, 0x4c, 0xdd, 0x80, 0xbd, 0x75, 0xf3, 0x68, + 0x78, 0xad, 0x86, 0x7d, 0x8a, 0x59, 0xbb, 0xcc, 0x2f, 0xc1, 0xfb, 0x3f, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x20, 0x0a, 0x08, 0x66, 0xee, 0x07, 0x00, 0x00, } func (m *BadgeUsedCu) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/genesis_test.go b/x/pairing/types/genesis_test.go index dd37d32429..0a18e82419 100644 --- a/x/pairing/types/genesis_test.go +++ b/x/pairing/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/pairing/types" + "github.com/lavanet/lava/v4/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_freeze_test.go b/x/pairing/types/message_freeze_test.go index 2a15891e35..b14eff4be7 100644 --- a/x/pairing/types/message_freeze_test.go +++ b/x/pairing/types/message_freeze_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_move_provider_stake.go b/x/pairing/types/message_move_provider_stake.go new file mode 100644 index 0000000000..442085c265 --- /dev/null +++ b/x/pairing/types/message_move_provider_stake.go @@ -0,0 +1,49 @@ +package types + +import ( + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgMoveProviderStake = "MoveProviderStake" + +var _ sdk.Msg = &MsgMoveProviderStake{} + +func NewMsgMoveProviderStake(creator string, srcChain, dstChain string, amount sdk.Coin) *MsgMoveProviderStake { + return &MsgMoveProviderStake{ + Creator: creator, + SrcChain: srcChain, + DstChain: dstChain, + Amount: amount, + } +} + +func (msg *MsgMoveProviderStake) Route() string { + return RouterKey +} + +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 { + return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/pairing/types/message_relay_payment_test.go b/x/pairing/types/message_relay_payment_test.go index 16d505430f..01cb8388f2 100644 --- a/x/pairing/types/message_relay_payment_test.go +++ b/x/pairing/types/message_relay_payment_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_stake_provider.go b/x/pairing/types/message_stake_provider.go index 616ef44ad9..5193c828e3 100644 --- a/x/pairing/types/message_stake_provider.go +++ b/x/pairing/types/message_stake_provider.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" ) const TypeMsgStakeProvider = "stake_provider" diff --git a/x/pairing/types/message_stake_provider_test.go b/x/pairing/types/message_stake_provider_test.go index b0ee66e3b2..e5ecfe532a 100644 --- a/x/pairing/types/message_stake_provider_test.go +++ b/x/pairing/types/message_stake_provider_test.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/testutil/sample" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/testutil/sample" + commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_unfreeze_test.go b/x/pairing/types/message_unfreeze_test.go index 735f0f6d58..3e7c00cf9e 100644 --- a/x/pairing/types/message_unfreeze_test.go +++ b/x/pairing/types/message_unfreeze_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_unstake_provider_test.go b/x/pairing/types/message_unstake_provider_test.go index 91305349e3..d01e2dcd26 100644 --- a/x/pairing/types/message_unstake_provider_test.go +++ b/x/pairing/types/message_unstake_provider_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/params.pb.go b/x/pairing/types/params.pb.go index 840bb8e6d9..e41f25f268 100644 --- a/x/pairing/types/params.pb.go +++ b/x/pairing/types/params.pb.go @@ -87,30 +87,30 @@ 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, 0xb7, 0x75, 0x0c, 0x65, 0xf1, 0x40, 0x8f, 0x03, 0x09, 0x89, 0xc5, 0x72, - 0x1c, 0x2b, 0x17, 0xd5, 0x8e, 0x23, 0xc7, 0x77, 0x90, 0x0f, 0xc0, 0xce, 0x08, 0x1b, 0x1f, 0xa7, - 0x63, 0x47, 0xc4, 0x10, 0xa1, 0xbb, 0x6f, 0x70, 0x9f, 0x00, 0x25, 0x39, 0x41, 0x91, 0x18, 0x98, - 0xfe, 0x19, 0x7e, 0xbf, 0xf7, 0xf2, 0x9e, 0x9f, 0xf7, 0x58, 0xb2, 0x35, 0x2b, 0x85, 0xc5, 0x5d, - 0xe2, 0x8a, 0x15, 0xa6, 0x28, 0x73, 0x5c, 0x31, 0xc3, 0x54, 0x1d, 0x57, 0x46, 0x5b, 0xed, 0x9f, - 0xed, 0x91, 0xb8, 0xcb, 0x78, 0x8f, 0x3c, 0x3c, 0xcb, 0x75, 0xae, 0x7b, 0x00, 0x77, 0x5f, 0x03, - 0x1b, 0x7d, 0x1d, 0x79, 0xe3, 0x79, 0x2f, 0xfb, 0xd7, 0x9e, 0x2f, 0x2a, 0xcd, 0x97, 0x89, 0xd4, - 0xfc, 0xa6, 0xbe, 0x5e, 0x0b, 0x23, 0x59, 0x35, 0x85, 0xe7, 0xee, 0x05, 0x48, 0xc2, 0x5d, 0x1b, - 0x3e, 0x6a, 0x98, 0x92, 0x97, 0x51, 0xcf, 0xd0, 0xb4, 0x87, 0xa8, 0x1e, 0xa8, 0x68, 0xf1, 0x0f, - 0xd5, 0x2f, 0xbd, 0xc9, 0x6b, 0xfd, 0xe6, 0x9d, 0x28, 0xf2, 0xa5, 0x9d, 0x9e, 0x9e, 0xbb, 0x17, - 0x93, 0x64, 0x7e, 0xdb, 0x86, 0xce, 0x8f, 0x36, 0x7c, 0x9a, 0x17, 0x76, 0xb9, 0x4a, 0x63, 0xae, - 0x15, 0xe6, 0xba, 0x56, 0xba, 0xde, 0xc7, 0xf3, 0x3a, 0xbb, 0xc1, 0xb6, 0xa9, 0x44, 0x1d, 0x5f, - 0x09, 0xbe, 0x6b, 0xc3, 0x60, 0xe8, 0x9a, 0x31, 0xcb, 0xa8, 0x11, 0xb2, 0x60, 0x69, 0x21, 0x0b, - 0xdb, 0x50, 0x23, 0x3e, 0x30, 0x93, 0x45, 0x8b, 0x3f, 0x2d, 0xfc, 0x4f, 0xae, 0xf7, 0xc4, 0x08, - 0xae, 0x95, 0x12, 0x65, 0x26, 0xb2, 0x97, 0xdd, 0x1f, 0xbd, 0x5a, 0xa9, 0xb7, 0xfa, 0x85, 0x96, - 0x52, 0x70, 0x3b, 0x67, 0x8d, 0x12, 0xa5, 0x9d, 0x3e, 0xe8, 0x47, 0x9a, 0xed, 0xda, 0x10, 0x0f, - 0xc5, 0xef, 0x49, 0x74, 0x18, 0xaf, 0x5c, 0x29, 0x6a, 0x35, 0xe5, 0x83, 0x48, 0xab, 0xc1, 0x8c, - 0x16, 0xff, 0x53, 0xff, 0x12, 0x7c, 0xf9, 0x16, 0x3a, 0x04, 0x40, 0x17, 0x1d, 0x10, 0x00, 0x0f, - 0xd0, 0x88, 0x00, 0x38, 0x42, 0x80, 0x00, 0x08, 0xd0, 0x21, 0x01, 0xf0, 0x10, 0x8d, 0x09, 0x80, - 0x63, 0x74, 0x44, 0x00, 0x3c, 0x42, 0x90, 0x00, 0x38, 0x41, 0x1e, 0x01, 0xd0, 0x43, 0xc7, 0x04, - 0xc0, 0x63, 0x74, 0x42, 0x00, 0x3c, 0x41, 0xa7, 0xc9, 0xd5, 0xed, 0x26, 0x70, 0xef, 0x36, 0x81, - 0xfb, 0x73, 0x13, 0xb8, 0x9f, 0xb7, 0x81, 0x73, 0xb7, 0x0d, 0x9c, 0xef, 0xdb, 0xc0, 0x79, 0xff, - 0xec, 0xde, 0xfa, 0xfe, 0xba, 0x87, 0xf5, 0x0c, 0x7f, 0xfc, 0x7d, 0x14, 0xfd, 0x1a, 0xd3, 0x71, - 0xff, 0xd0, 0xb3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x41, 0x4a, 0xff, 0x3d, 0x39, 0x02, 0x00, + 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, 0x36, 0x3e, 0x4e, + 0xc7, 0x8e, 0x88, 0x21, 0x42, 0x77, 0xdf, 0xe0, 0x3e, 0x01, 0x4a, 0x72, 0x82, 0x22, 0x31, 0x74, + 0xfa, 0x67, 0xf8, 0xfd, 0xde, 0xcb, 0x7b, 0x7e, 0xde, 0x63, 0xc9, 0x56, 0xac, 0x14, 0x16, 0x77, + 0x89, 0x2b, 0x56, 0x98, 0xa2, 0xcc, 0x71, 0xc5, 0x0c, 0x53, 0x75, 0x5c, 0x19, 0x6d, 0xb5, 0x7f, + 0xb2, 0x43, 0xe2, 0x2e, 0xe3, 0x1d, 0xf2, 0xf0, 0x24, 0xd7, 0xb9, 0xee, 0x01, 0xdc, 0x7d, 0x0d, + 0x6c, 0xf4, 0x6d, 0xe4, 0x8d, 0x67, 0xbd, 0xec, 0x5f, 0x79, 0xbe, 0xa8, 0x34, 0x5f, 0x24, 0x52, + 0xf3, 0xeb, 0xfa, 0x6a, 0x25, 0x8c, 0x64, 0xd5, 0x14, 0x9e, 0xba, 0x67, 0x20, 0x09, 0xb7, 0x6d, + 0xf8, 0xa8, 0x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 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, } diff --git a/x/pairing/types/query.pb.go b/x/pairing/types/query.pb.go index 883cf7c28c..f69bba8484 100644 --- a/x/pairing/types/query.pb.go +++ b/x/pairing/types/query.pb.go @@ -11,12 +11,12 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" - types "github.com/lavanet/lava/v3/x/epochstorage/types" - types1 "github.com/lavanet/lava/v3/x/plans/types" - _ "github.com/lavanet/lava/v3/x/projects/types" - types2 "github.com/lavanet/lava/v3/x/spec/types" - _ "github.com/lavanet/lava/v3/x/subscription/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" + types "github.com/lavanet/lava/v4/x/epochstorage/types" + types1 "github.com/lavanet/lava/v4/x/plans/types" + _ "github.com/lavanet/lava/v4/x/projects/types" + types2 "github.com/lavanet/lava/v4/x/spec/types" + _ "github.com/lavanet/lava/v4/x/subscription/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1581,7 +1581,7 @@ var fileDescriptor_9e149ce9d21da0d8 = []byte{ // 1807 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0xdc, 0xc6, 0x15, 0x17, 0x57, 0xab, 0xb5, 0xf4, 0xf4, 0xc7, 0xc6, 0x44, 0xb2, 0xa5, 0xad, 0xb2, 0x5a, 0x53, - 0x49, 0xaa, 0x3f, 0xce, 0x32, 0x5a, 0xc7, 0x89, 0xa1, 0x28, 0x6e, 0x2b, 0xc9, 0x31, 0xa4, 0xaa, + 0x49, 0xaa, 0x3f, 0xce, 0x32, 0xda, 0xd8, 0x89, 0xa1, 0x28, 0x6e, 0x2b, 0xc9, 0x31, 0xa4, 0xaa, 0x8d, 0x44, 0xd5, 0x3d, 0x04, 0x05, 0x08, 0x8a, 0x9c, 0x5d, 0x31, 0xe2, 0x72, 0x18, 0x72, 0xb8, 0x96, 0x2a, 0x6c, 0x0b, 0xb4, 0x5f, 0xa0, 0x40, 0xdb, 0x43, 0x4f, 0xbd, 0x04, 0xe8, 0x29, 0xdf, 0xa0, 0xb7, 0x02, 0x45, 0x0e, 0x3d, 0x18, 0xe8, 0xa5, 0x28, 0x8a, 0xa0, 0xb0, 0x7b, 0x2e, 0xd0, @@ -1664,34 +1664,34 @@ var fileDescriptor_9e149ce9d21da0d8 = []byte{ 0xff, 0xf9, 0x6d, 0xa1, 0x82, 0x16, 0x95, 0x9c, 0x17, 0x3a, 0xf4, 0x07, 0x09, 0x26, 0xba, 0xa2, 0x65, 0x3d, 0x6f, 0xf9, 0x9e, 0x77, 0x93, 0xf2, 0xbd, 0xe1, 0x8c, 0x05, 0x9d, 0x0d, 0x46, 0x67, 0x1d, 0xad, 0xf6, 0xa1, 0x13, 0x01, 0x94, 0x4b, 0x71, 0xb7, 0x75, 0xd0, 0x1f, 0x25, 0x18, 0x8f, - 0x16, 0x42, 0x6b, 0x43, 0xec, 0x16, 0x31, 0x5b, 0x1f, 0xca, 0x56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9, 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, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/relay.pb.go b/x/pairing/types/relay.pb.go index df0b7b802d..49f66b8769 100644 --- a/x/pairing/types/relay.pb.go +++ b/x/pairing/types/relay.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/epochstorage/types" + types "github.com/lavanet/lava/v4/x/epochstorage/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -875,7 +875,7 @@ var fileDescriptor_a61d253b10eeeb9e = []byte{ // 1286 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0x1b, 0xc5, 0x17, 0xcf, 0x3a, 0x76, 0x1c, 0x1f, 0x6f, 0xd3, 0x76, 0xda, 0xb4, 0x56, 0xaa, 0xbf, 0x93, 0xee, - 0x5f, 0x84, 0xa8, 0x80, 0x0d, 0x29, 0xe2, 0x02, 0x09, 0xa9, 0xb8, 0x8d, 0x20, 0x50, 0x68, 0xba, + 0x5f, 0x84, 0xa8, 0x80, 0x0d, 0xa1, 0xe2, 0x02, 0x09, 0xa9, 0xb8, 0x8d, 0x20, 0x50, 0x68, 0xba, 0x81, 0x9b, 0x4a, 0x68, 0x3b, 0xde, 0x9d, 0x6c, 0x86, 0xae, 0x77, 0x36, 0x33, 0xb3, 0x6e, 0xcd, 0x0b, 0x70, 0x85, 0xc4, 0x43, 0xf0, 0x04, 0x3c, 0x44, 0xd5, 0xcb, 0x5e, 0x22, 0x24, 0x2a, 0xd4, 0xbe, 0x01, 0xe2, 0x01, 0xd0, 0x99, 0x19, 0x7f, 0x35, 0x69, 0x51, 0x80, 0xab, 0x9d, 0xf9, 0xcd, @@ -927,33 +927,33 @@ var fileDescriptor_a61d253b10eeeb9e = []byte{ 0x75, 0xd0, 0x08, 0x67, 0x10, 0xdb, 0x05, 0x58, 0xee, 0xae, 0x04, 0xe6, 0x4a, 0x0d, 0x44, 0x6c, 0xc7, 0xf9, 0xc1, 0x43, 0x7e, 0xe7, 0xeb, 0x63, 0x36, 0xf0, 0xde, 0x7c, 0xe0, 0x37, 0x61, 0x25,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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, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/relayCache.pb.go b/x/pairing/types/relayCache.pb.go index c7061f6da5..d8d3cb13a2 100644 --- a/x/pairing/types/relayCache.pb.go +++ b/x/pairing/types/relayCache.pb.go @@ -501,53 +501,53 @@ func init() { var fileDescriptor_36fbab536e2bbad1 = []byte{ // 748 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x4e, 0xdb, 0x48, - 0x14, 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 0xc2, 0x70, + 0xa4, 0x92, 0x4d, 0xfd, 0x5d, 0x81, 0x2c, 0x62, 0x69, 0x2b, 0x8a, 0xb0, 0x60, 0xe4, 0x9f, 0xd2, + 0xff, 0xc8, 0x42, 0x18, 0xbd, 0x68, 0xf9, 0x4e, 0x7e, 0xab, 0xbe, 0xdd, 0x31, 0xb2, 0x8e, 0x63, + 0x5c, 0x05, 0x58, 0x31, 0x9d, 0x3e, 0x21, 0xcb, 0x62, 0xa4, 0xb8, 0x08, 0x98, 0x6f, 0x0f, 0x41, + 0x31, 0x87, 0x29, 0xa6, 0x15, 0x3a, 0xc5, 0xad, 0xfa, 0x76, 0x3b, 0x3b, 0xc7, 0x61, 0xc2, 0xda, + 0x29, 0x9d, 0x7d, 0xfa, 0x3d, 0x67, 0x2d, 0xa5, 0xe1, 0x29, 0x4e, 0xd7, 0x08, 0x91, 0x00, 0x81, + 0xdd, 0xf7, 0xc5, 0xe0, 0xa5, 0x56, 0xec, 0xe4, 0xb7, 0x8a, 0x56, 0x2d, 0x42, 0x76, 0x22, 0x80, 0xbe, 0x20, 0x1a, 0xee, 0x48, 0xdb, 0x63, 0xd2, 0x03, 0x69, 0x2b, 0x61, 0x7b, 0xc0, 0x5d, 0x4f, - 0x49, 0xad, 0x84, 0x85, 0x37, 0xb3, 0x0b, 0x63, 0x78, 0x97, 0x49, 0xef, 0x58, 0x74, 0x91, 0x6f, + 0x49, 0xad, 0x84, 0x85, 0x37, 0xb3, 0x0b, 0x63, 0x78, 0x97, 0x49, 0xef, 0x48, 0x74, 0x91, 0x6f, 0xfd, 0x1c, 0x27, 0xea, 0x62, 0x9e, 0x14, 0x95, 0xfa, 0x43, 0x42, 0xb0, 0x3d, 0x4f, 0x25, 0x73, - 0x81, 0xfe, 0x46, 0x6a, 0xb8, 0xea, 0x72, 0x25, 0xb1, 0x3b, 0x25, 0xeb, 0x1a, 0xa0, 0x1d, 0x52, - 0xc7, 0xc5, 0x11, 0x97, 0x12, 0xa4, 0x56,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cb, 0x76, 0xfe, 0xed, 0x55, 0x3b, 0x77, 0x71, 0xd5, 0xce, 0x7d, 0xb8, - 0x6a, 0xe7, 0x9e, 0xff, 0xe5, 0x72, 0xe5, 0x9d, 0xf6, 0x8d, 0x81, 0x18, 0x9a, 0x53, 0x93, 0x71, - 0xbc, 0x63, 0xbe, 0x9e, 0x8c, 0x47, 0x75, 0x36, 0x02, 0xd9, 0x2f, 0x63, 0xe5, 0x9d, 0xaf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x29, 0x10, 0xa1, 0xf0, 0x96, 0x07, 0x00, 0x00, + 0x81, 0xfe, 0x46, 0x6a, 0xb8, 0xea, 0x72, 0x25, 0xb1, 0x3b, 0x25, 0xeb, 0x0a, 0xa0, 0x1d, 0x52, + 0xc7, 0xc5, 0x21, 0x97, 0x12, 0xa4, 0x56, 0xc0, 0xfd, 0xeb, 0x90, 0xee, 0xa5, 0xf1, 0x4c, 0x7a, + 0xf4, 0x3e, 0xa9, 0x84, 0xf0, 0xea, 0x04, 0xa4, 0x4a, 0x1a, 0xbd, 0x31, 0xa7, 0xd1, 0x8f, 0x43, + 0x3e, 0x66, 0x0a, 0x76, 0x99, 0x62, 0x56, 0x1a, 0x46, 0x7f, 0x21, 0xd5, 0x81, 0xc7, 0x78, 0x60, + 0x73, 0x07, 0xab, 0xd5, 0xac, 0x0a, 0xae, 0x0f, 0x1c, 0xfd, 0x63, 0x81, 0x34, 0xad, 0x89, 0xaf, + 0xf6, 0x41, 0xd1, 0x3f, 0x48, 0x23, 0x89, 0xc3, 0x66, 0x61, 0xcd, 0x86, 0x55, 0x4f, 0x30, 0x3c, + 0xd1, 0x1a, 0x21, 0xd8, 0x85, 0x98, 0x50, 0x40, 0x42, 0xad, 0x9f, 0xb6, 0x2a, 0xfa, 0xfa, 0x63, + 0x1e, 0x30, 0x9f, 0xbf, 0x01, 0x07, 0xb5, 0xa8, 0x5a, 0x57, 0x00, 0xdd, 0x24, 0x8b, 0x49, 0x2e, + 0x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 0x3a, 0x01, 0x42, 0x34, 0x21, 0x7d, 0x46, 0xaa, 0xfb, 0xa0, + 0x10, 0xa2, 0x7f, 0xce, 0x71, 0x4e, 0xfa, 0x47, 0x68, 0xad, 0x67, 0x93, 0x66, 0xc6, 0x81, 0x9e, + 0xa3, 0x07, 0xa4, 0xda, 0xbb, 0x75, 0xe6, 0x1e, 0xa8, 0xd6, 0xaa, 0x11, 0xcf, 0x1c, 0x23, 0x9d, + 0x39, 0xc6, 0x5e, 0x34, 0x73, 0xf4, 0x1c, 0xdd, 0x25, 0xe5, 0x2e, 0x30, 0x5f, 0x79, 0xf4, 0x06, + 0x4e, 0xab, 0x33, 0xe7, 0x54, 0xf8, 0x17, 0xd6, 0x73, 0x3b, 0xbb, 0x67, 0x17, 0xed, 0xfc, 0xf9, + 0x45, 0x3b, 0xff, 0xf9, 0xa2, 0x9d, 0x7f, 0x7b, 0xd9, 0xce, 0x9d, 0x5f, 0xb6, 0x73, 0x1f, 0x2e, + 0xdb, 0xb9, 0xe7, 0x7f, 0xb9, 0x5c, 0x79, 0x27, 0x7d, 0x63, 0x20, 0x86, 0xe6, 0xd4, 0x64, 0x1c, + 0xff, 0x6b, 0xbe, 0x9e, 0x8c, 0x47, 0x75, 0x3a, 0x02, 0xd9, 0x2f, 0x63, 0xe5, 0x7f, 0xbe, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x81, 0xec, 0xf1, 0x3e, 0x96, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/relay_exchange.go b/x/pairing/types/relay_exchange.go index 27d2567fd7..429ad417b2 100644 --- a/x/pairing/types/relay_exchange.go +++ b/x/pairing/types/relay_exchange.go @@ -3,8 +3,8 @@ package types import ( "strings" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" ) // RelayExchange consists a relay request and its corresponding response diff --git a/x/pairing/types/relay_session.go b/x/pairing/types/relay_session.go index e11df66c77..7e73c341ec 100644 --- a/x/pairing/types/relay_session.go +++ b/x/pairing/types/relay_session.go @@ -1,7 +1,7 @@ package types import ( - "github.com/lavanet/lava/v3/utils/sigs" + "github.com/lavanet/lava/v4/utils/sigs" ) func (rs RelaySession) GetSignature() []byte { diff --git a/x/pairing/types/static_providers.pb.go b/x/pairing/types/static_providers.pb.go index 90b6db417f..d564dd2c72 100644 --- a/x/pairing/types/static_providers.pb.go +++ b/x/pairing/types/static_providers.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - types "github.com/lavanet/lava/v3/x/epochstorage/types" + types "github.com/lavanet/lava/v4/x/epochstorage/types" io "io" math "math" math_bits "math/bits" diff --git a/x/pairing/types/tx.pb.go b/x/pairing/types/tx.pb.go index 0033fa0454..ba3636a161 100644 --- a/x/pairing/types/tx.pb.go +++ b/x/pairing/types/tx.pb.go @@ -12,7 +12,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/lavanet/lava/v3/x/epochstorage/types" + types1 "github.com/lavanet/lava/v4/x/epochstorage/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -628,6 +628,110 @@ func (m *MsgUnfreezeProviderResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnfreezeProviderResponse proto.InternalMessageInfo +type MsgMoveProviderStake struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + SrcChain string `protobuf:"bytes,2,opt,name=src_chain,json=srcChain,proto3" json:"src_chain,omitempty"` + DstChain string `protobuf:"bytes,3,opt,name=dst_chain,json=dstChain,proto3" json:"dst_chain,omitempty"` + Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgMoveProviderStake) Reset() { *m = MsgMoveProviderStake{} } +func (m *MsgMoveProviderStake) String() string { return proto.CompactTextString(m) } +func (*MsgMoveProviderStake) ProtoMessage() {} +func (*MsgMoveProviderStake) Descriptor() ([]byte, []int) { + return fileDescriptor_07b85a84d2198a91, []int{11} +} +func (m *MsgMoveProviderStake) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMoveProviderStake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMoveProviderStake.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 *MsgMoveProviderStake) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMoveProviderStake.Merge(m, src) +} +func (m *MsgMoveProviderStake) XXX_Size() int { + return m.Size() +} +func (m *MsgMoveProviderStake) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMoveProviderStake.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMoveProviderStake proto.InternalMessageInfo + +func (m *MsgMoveProviderStake) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgMoveProviderStake) GetSrcChain() string { + if m != nil { + return m.SrcChain + } + return "" +} + +func (m *MsgMoveProviderStake) GetDstChain() string { + if m != nil { + return m.DstChain + } + return "" +} + +func (m *MsgMoveProviderStake) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +type MsgMoveProviderStakeResponse struct { +} + +func (m *MsgMoveProviderStakeResponse) Reset() { *m = MsgMoveProviderStakeResponse{} } +func (m *MsgMoveProviderStakeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMoveProviderStakeResponse) ProtoMessage() {} +func (*MsgMoveProviderStakeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_07b85a84d2198a91, []int{12} +} +func (m *MsgMoveProviderStakeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMoveProviderStakeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMoveProviderStakeResponse.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 *MsgMoveProviderStakeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMoveProviderStakeResponse.Merge(m, src) +} +func (m *MsgMoveProviderStakeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMoveProviderStakeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMoveProviderStakeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMoveProviderStakeResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgStakeProvider)(nil), "lavanet.lava.pairing.MsgStakeProvider") proto.RegisterType((*MsgStakeProviderResponse)(nil), "lavanet.lava.pairing.MsgStakeProviderResponse") @@ -640,68 +744,75 @@ func init() { proto.RegisterType((*MsgFreezeProviderResponse)(nil), "lavanet.lava.pairing.MsgFreezeProviderResponse") proto.RegisterType((*MsgUnfreezeProvider)(nil), "lavanet.lava.pairing.MsgUnfreezeProvider") proto.RegisterType((*MsgUnfreezeProviderResponse)(nil), "lavanet.lava.pairing.MsgUnfreezeProviderResponse") + proto.RegisterType((*MsgMoveProviderStake)(nil), "lavanet.lava.pairing.MsgMoveProviderStake") + proto.RegisterType((*MsgMoveProviderStakeResponse)(nil), "lavanet.lava.pairing.MsgMoveProviderStakeResponse") } func init() { proto.RegisterFile("lavanet/lava/pairing/tx.proto", fileDescriptor_07b85a84d2198a91) } var fileDescriptor_07b85a84d2198a91 = []byte{ - // 887 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x73, 0xdb, 0x44, - 0x14, 0x8e, 0x12, 0xc5, 0xb1, 0x9f, 0xdb, 0xc4, 0xd9, 0xa4, 0x44, 0x51, 0x53, 0x63, 0x54, 0x20, - 0x26, 0x03, 0x12, 0x49, 0x0f, 0xcc, 0xf8, 0xe8, 0x86, 0x32, 0xed, 0xd4, 0x43, 0x46, 0x19, 0x0e, - 0x70, 0xf1, 0xac, 0xa5, 0x45, 0x51, 0x63, 0x69, 0x35, 0xda, 0xad, 0xa7, 0xe1, 0xcc, 0x89, 0x0b, - 0xf0, 0x13, 0xb8, 0x71, 0xec, 0xcf, 0xe8, 0xb1, 0x47, 0x4e, 0x0c, 0x93, 0x1c, 0xfa, 0x37, 0x98, - 0x5d, 0xad, 0x64, 0x4b, 0x76, 0x3a, 0x9e, 0x81, 0x4b, 0xac, 0xb7, 0xef, 0x7b, 0xef, 0xfb, 0xf4, - 0xbd, 0xb7, 0x19, 0xc1, 0x83, 0x31, 0x9e, 0xe0, 0x98, 0x70, 0x47, 0xfc, 0x3a, 0x09, 0x0e, 0xd3, - 0x30, 0x0e, 0x1c, 0xfe, 0xca, 0x4e, 0x52, 0xca, 0x29, 0xda, 0x55, 0x69, 0x5b, 0xfc, 0xda, 0x2a, - 0x6d, 0xb6, 0x3d, 0xca, 0x22, 0xca, 0x9c, 0x11, 0x66, 0xc4, 0x99, 0x1c, 0x8f, 0x08, 0xc7, 0xc7, - 0x8e, 0x47, 0xc3, 0x38, 0xab, 0x32, 0x77, 0x03, 0x1a, 0x50, 0xf9, 0xe8, 0x88, 0x27, 0x75, 0xda, - 0x2d, 0x51, 0x91, 0x84, 0x7a, 0x17, 0x8c, 0xd3, 0x14, 0x07, 0xc4, 0x21, 0xb1, 0x9f, 0xd0, 0x30, - 0xe6, 0x0a, 0xd9, 0x59, 0x28, 0x2a, 0x25, 0x63, 0x7c, 0xa5, 0x10, 0x1f, 0x2b, 0x05, 0x8c, 0xe3, - 0x4b, 0x91, 0xcb, 0x45, 0xa8, 0x58, 0xa1, 0xb6, 0x71, 0x14, 0xc6, 0xd4, 0x91, 0x7f, 0xb3, 0x23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 0x31, 0xb1, 0x08, 0xb6, 0xaa, 0x57, 0xba, 0x7b, 0x6b, 0x8b, 0x0a, 0xd2, 0xfc, 0x72, 0x59, - 0x64, 0x41, 0xe7, 0xc3, 0x9d, 0xd2, 0xe5, 0xfc, 0xe4, 0xd6, 0x0e, 0xb3, 0x30, 0xf3, 0x8b, 0xa5, - 0x60, 0x05, 0xcb, 0x0b, 0xd8, 0xac, 0xac, 0xd6, 0xe1, 0xad, 0x0d, 0xca, 0x40, 0xd3, 0x59, 0x12, - 0x58, 0x70, 0x25, 0xd0, 0x9a, 0xdb, 0x98, 0xcf, 0xde, 0xe3, 0x4b, 0x19, 0x6a, 0x1e, 0x2f, 0x0d, - 0xcd, 0x19, 0xfb, 0xa7, 0x6f, 0xae, 0xdb, 0xda, 0xdb, 0xeb, 0xb6, 0xf6, 0xcf, 0x75, 0x5b, 0xfb, - 0xed, 0xa6, 0xbd, 0xf2, 0xf6, 0xa6, 0xbd, 0xf2, 0xd7, 0x4d, 0x7b, 0xe5, 0x87, 0xa3, 0x20, 0xe4, - 0x17, 0x2f, 0x47, 0xb6, 0x47, 0x23, 0xa7, 0xf4, 0xdd, 0x30, 0x79, 0xe4, 0xbc, 0x9a, 0x7e, 0xd1, - 0x5c, 0x25, 0x84, 0x8d, 0x6a, 0xf2, 0x23, 0xe0, 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x78, - 0x28, 0x40, 0xa1, 0xf6, 0x08, 0x00, 0x00, + // 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, + 0x65, 0xfd, 0xac, 0x43, 0xad, 0xc7, 0x82, 0x73, 0x8e, 0x2f, 0xc9, 0x59, 0x42, 0xc7, 0xa1, 0x4f, + 0x12, 0x64, 0xc0, 0x86, 0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x7d, 0xf6, 0x4f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xf3, 0x9b, 0xc2, 0x3d, 0x51, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -721,6 +832,7 @@ type MsgClient interface { RelayPayment(ctx context.Context, in *MsgRelayPayment, opts ...grpc.CallOption) (*MsgRelayPaymentResponse, error) FreezeProvider(ctx context.Context, in *MsgFreezeProvider, opts ...grpc.CallOption) (*MsgFreezeProviderResponse, error) UnfreezeProvider(ctx context.Context, in *MsgUnfreezeProvider, opts ...grpc.CallOption) (*MsgUnfreezeProviderResponse, error) + MoveProviderStake(ctx context.Context, in *MsgMoveProviderStake, opts ...grpc.CallOption) (*MsgMoveProviderStakeResponse, error) } type msgClient struct { @@ -776,6 +888,15 @@ func (c *msgClient) UnfreezeProvider(ctx context.Context, in *MsgUnfreezeProvide return out, nil } +func (c *msgClient) MoveProviderStake(ctx context.Context, in *MsgMoveProviderStake, opts ...grpc.CallOption) (*MsgMoveProviderStakeResponse, error) { + out := new(MsgMoveProviderStakeResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.pairing.Msg/MoveProviderStake", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { StakeProvider(context.Context, *MsgStakeProvider) (*MsgStakeProviderResponse, error) @@ -783,6 +904,7 @@ type MsgServer interface { RelayPayment(context.Context, *MsgRelayPayment) (*MsgRelayPaymentResponse, error) FreezeProvider(context.Context, *MsgFreezeProvider) (*MsgFreezeProviderResponse, error) UnfreezeProvider(context.Context, *MsgUnfreezeProvider) (*MsgUnfreezeProviderResponse, error) + MoveProviderStake(context.Context, *MsgMoveProviderStake) (*MsgMoveProviderStakeResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -804,6 +926,9 @@ func (*UnimplementedMsgServer) FreezeProvider(ctx context.Context, req *MsgFreez func (*UnimplementedMsgServer) UnfreezeProvider(ctx context.Context, req *MsgUnfreezeProvider) (*MsgUnfreezeProviderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnfreezeProvider not implemented") } +func (*UnimplementedMsgServer) MoveProviderStake(ctx context.Context, req *MsgMoveProviderStake) (*MsgMoveProviderStakeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MoveProviderStake not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -899,6 +1024,24 @@ func _Msg_UnfreezeProvider_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_MoveProviderStake_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMoveProviderStake) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MoveProviderStake(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.pairing.Msg/MoveProviderStake", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MoveProviderStake(ctx, req.(*MsgMoveProviderStake)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.pairing.Msg", HandlerType: (*MsgServer)(nil), @@ -923,6 +1066,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnfreezeProvider", Handler: _Msg_UnfreezeProvider_Handler, }, + { + MethodName: "MoveProviderStake", + Handler: _Msg_MoveProviderStake_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "lavanet/lava/pairing/tx.proto", @@ -1387,6 +1534,83 @@ func (m *MsgUnfreezeProviderResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *MsgMoveProviderStake) 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 *MsgMoveProviderStake) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMoveProviderStake) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.DstChain) > 0 { + i -= len(m.DstChain) + copy(dAtA[i:], m.DstChain) + i = encodeVarintTx(dAtA, i, uint64(len(m.DstChain))) + i-- + dAtA[i] = 0x1a + } + if len(m.SrcChain) > 0 { + i -= len(m.SrcChain) + copy(dAtA[i:], m.SrcChain) + i = encodeVarintTx(dAtA, i, uint64(len(m.SrcChain))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgMoveProviderStakeResponse) 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 *MsgMoveProviderStakeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMoveProviderStakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1597,6 +1821,38 @@ func (m *MsgUnfreezeProviderResponse) Size() (n int) { return n } +func (m *MsgMoveProviderStake) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SrcChain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DstChain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgMoveProviderStakeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2911,6 +3167,235 @@ func (m *MsgUnfreezeProviderResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgMoveProviderStake) 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 ErrIntOverflowTx + } + 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: MsgMoveProviderStake: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMoveProviderStake: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgMoveProviderStakeResponse) 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 ErrIntOverflowTx + } + 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: MsgMoveProviderStakeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMoveProviderStakeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/pairing/types/unstake_proposal.pb.go b/x/pairing/types/unstake_proposal.pb.go index fff454679e..b17721dd07 100644 --- a/x/pairing/types/unstake_proposal.pb.go +++ b/x/pairing/types/unstake_proposal.pb.go @@ -183,31 +183,31 @@ var fileDescriptor_d35cf592c1bb0d91 = []byte{ // 425 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x31, 0x6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4d, 0x12, 0xfd, 0xd8, 0x24, 0xd1, - 0xdb, 0xc7, 0x42, 0xba, 0x65, 0x99, 0x92, 0x0c, 0x56, 0xf4, 0x9f, 0x8d, 0xac, 0x4e, 0xe9, 0xc7, - 0x6e, 0x2d, 0xdd, 0x27, 0xcd, 0x6d, 0x7a, 0xdb, 0x2f, 0xc8, 0xe9, 0xef, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x3b, 0x9e, 0xac, 0x44, 0xbb, 0x02, 0x00, 0x00, + 0x02, 0x92, 0xad, 0x16, 0x26, 0x36, 0x4a, 0x07, 0x2a, 0x31, 0x54, 0x45, 0x30, 0x20, 0xa1, 0x93, + 0x93, 0xf8, 0x7c, 0x16, 0x39, 0x3f, 0xcb, 0x76, 0x02, 0x88, 0x1d, 0x31, 0xf2, 0x11, 0xf8, 0x38, + 0x1d, 0x3b, 0x32, 0x21, 0x74, 0xf7, 0x45, 0x50, 0x1c, 0x27, 0x80, 0xc8, 0xe4, 0xbc, 0xf7, 0x7e, + 0xfe, 0xe7, 0xef, 0xf7, 0x1e, 0x7a, 0x54, 0xb0, 0x8a, 0x29, 0xee, 0x68, 0x7d, 0x52, 0xcd, 0xa4, + 0x91, 0x4a, 0xd0, 0x52, 0x59, 0xc7, 0xde, 0xf3, 0xb9, 0x36, 0xa0, 0xc1, 0xb2, 0x82, 0x68, 0x03, + 0x0e, 0xf0, 0x28, 0xc0, 0xa4, 0x3e, 0x49, 0x80, 0x27, 0x23, 0x01, 0x02, 0x3c, 0x40, 0xeb, 0xaf, + 0x86, 0x9d, 0x24, 0x02, 0x40, 0x14, 0x9c, 0xfa, 0x28, 0x2d, 0x17, 0xf4, 0x83, 0x61, 0x5a, 0x73, + 0x63, 0xdb, 0x7a, 0x06, 0x76, 0x05, 0x96, 0xa6, 0xcc, 0x72, 0x5a, 0x1d, 0xa7, 0xdc, 0xb1, 0x63, + 0x9a, 0x81, 0x54, 0x4d, 0x7d, 0xf6, 0x65, 0x0b, 0xed, 0xb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0x39, + 0x48, 0x15, 0x1e, 0xb5, 0xd7, 0xde, 0x7b, 0xe6, 0xaf, 0x9d, 0x9e, 0x5d, 0xad, 0x93, 0xf8, 0x7a, + 0x9d, 0xc4, 0xbf, 0xd6, 0x49, 0xfc, 0x6d, 0x93, 0x44, 0xd7, 0x9b, 0x24, 0xfa, 0xb1, 0x49, 0xa2, + 0xb7, 0x0f, 0x85, 0x74, 0xcb, 0x32, 0x25, 0x19, 0xac, 0xe8, 0x3f, 0x1b, 0x59, 0x3d, 0xa1, 0x1f, + 0xbb, 0xb5, 0x74, 0x9f, 0x34, 0xb7, 0xe9, 0x4d, 0xbf, 0x20, 0x8f, 0x7f, 0x07, 0x00, 0x00, 0xff, + 0xff, 0x93, 0x62, 0xfc, 0x8a, 0xbb, 0x02, 0x00, 0x00, } func (m *UnstakeProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/plans/client/cli/query.go b/x/plans/client/cli/query.go index 4a428e7772..67c2c3379d 100644 --- a/x/plans/client/cli/query.go +++ b/x/plans/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/plans/client/cli/query_info.go b/x/plans/client/cli/query_info.go index dd70d9087b..df5317883d 100644 --- a/x/plans/client/cli/query_info.go +++ b/x/plans/client/cli/query_info.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/plans/client/cli/query_list.go b/x/plans/client/cli/query_list.go index 80a2da41ea..ae74cb4538 100644 --- a/x/plans/client/cli/query_list.go +++ b/x/plans/client/cli/query_list.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/plans/client/cli/query_params.go b/x/plans/client/cli/query_params.go index 978c713248..1091409ee5 100644 --- a/x/plans/client/cli/query_params.go +++ b/x/plans/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/plans/client/cli/tx.go b/x/plans/client/cli/tx.go index 50b20b1220..a23923744f 100644 --- a/x/plans/client/cli/tx.go +++ b/x/plans/client/cli/tx.go @@ -15,8 +15,8 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/plans/client/utils" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/client/utils" + "github.com/lavanet/lava/v4/x/plans/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/plans/client/proposal_handler.go b/x/plans/client/proposal_handler.go index 9e2eff4a19..32dd3965ad 100644 --- a/x/plans/client/proposal_handler.go +++ b/x/plans/client/proposal_handler.go @@ -2,7 +2,7 @@ package client import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/lavanet/lava/v3/x/plans/client/cli" + "github.com/lavanet/lava/v4/x/plans/client/cli" ) var PlansAddProposalHandler = govclient.NewProposalHandler(cli.NewSubmitPlansAddProposalTxCmd) diff --git a/x/plans/client/utils/utils.go b/x/plans/client/utils/utils.go index a2c4949562..8b29ba1356 100755 --- a/x/plans/client/utils/utils.go +++ b/x/plans/client/utils/utils.go @@ -6,9 +6,9 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/utils/decoder" - "github.com/lavanet/lava/v3/x/plans/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/utils/decoder" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/mitchellh/mapstructure" ) diff --git a/x/plans/genesis.go b/x/plans/genesis.go index 644749f056..bf70a7dd8e 100644 --- a/x/plans/genesis.go +++ b/x/plans/genesis.go @@ -2,8 +2,8 @@ package plans import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/plans/keeper" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/keeper" + "github.com/lavanet/lava/v4/x/plans/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/plans/genesis_test.go b/x/plans/genesis_test.go index 1ac5b31be1..42f76e883d 100644 --- a/x/plans/genesis_test.go +++ b/x/plans/genesis_test.go @@ -3,10 +3,10 @@ package plans_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - plans "github.com/lavanet/lava/v3/x/plans" - "github.com/lavanet/lava/v3/x/plans/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + plans "github.com/lavanet/lava/v4/x/plans" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/handler.go b/x/plans/handler.go index c8751846a0..1cc8037873 100644 --- a/x/plans/handler.go +++ b/x/plans/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/plans/keeper" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/keeper" + "github.com/lavanet/lava/v4/x/plans/types" ) // NewHandler ... diff --git a/x/plans/keeper/grpc_query.go b/x/plans/keeper/grpc_query.go index ef0611b5b2..705c439b46 100644 --- a/x/plans/keeper/grpc_query.go +++ b/x/plans/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/plans/keeper/grpc_query_info.go b/x/plans/keeper/grpc_query_info.go index e8f04a3121..52547d0c6c 100644 --- a/x/plans/keeper/grpc_query_info.go +++ b/x/plans/keeper/grpc_query_info.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/plans/keeper/grpc_query_list.go b/x/plans/keeper/grpc_query_list.go index 52a163d6f8..64b1797f71 100644 --- a/x/plans/keeper/grpc_query_list.go +++ b/x/plans/keeper/grpc_query_list.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/plans/keeper/grpc_query_params.go b/x/plans/keeper/grpc_query_params.go index 64b728ecb7..134630043d 100644 --- a/x/plans/keeper/grpc_query_params.go +++ b/x/plans/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/plans/keeper/grpc_query_params_test.go b/x/plans/keeper/grpc_query_params_test.go index 816bb7c818..2e98a3a51c 100644 --- a/x/plans/keeper/grpc_query_params_test.go +++ b/x/plans/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/plans/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/keeper/keeper.go b/x/plans/keeper/keeper.go index 8e982d3c0e..92897b1120 100644 --- a/x/plans/keeper/keeper.go +++ b/x/plans/keeper/keeper.go @@ -10,8 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/plans/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/plans/types" ) type ( diff --git a/x/plans/keeper/migrations.go b/x/plans/keeper/migrations.go index 5803a865af..4aba7e497f 100644 --- a/x/plans/keeper/migrations.go +++ b/x/plans/keeper/migrations.go @@ -4,11 +4,11 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/lavanet/lava/v3/x/plans/migrations/v2" - v3 "github.com/lavanet/lava/v3/x/plans/migrations/v3" - v7 "github.com/lavanet/lava/v3/x/plans/migrations/v7" - v8 "github.com/lavanet/lava/v3/x/plans/migrations/v8" - projectsv3 "github.com/lavanet/lava/v3/x/projects/migrations/v3" + v2 "github.com/lavanet/lava/v4/x/plans/migrations/v2" + v3 "github.com/lavanet/lava/v4/x/plans/migrations/v3" + v7 "github.com/lavanet/lava/v4/x/plans/migrations/v7" + v8 "github.com/lavanet/lava/v4/x/plans/migrations/v8" + projectsv3 "github.com/lavanet/lava/v4/x/projects/migrations/v3" ) type Migrator struct { diff --git a/x/plans/keeper/msg_server.go b/x/plans/keeper/msg_server.go index 7f1dfbbc11..b00aa4e3af 100644 --- a/x/plans/keeper/msg_server.go +++ b/x/plans/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" ) type msgServer struct { diff --git a/x/plans/keeper/msg_server_test.go b/x/plans/keeper/msg_server_test.go index b8a6935a8a..8b4a011f5a 100644 --- a/x/plans/keeper/msg_server_test.go +++ b/x/plans/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/plans/keeper" - "github.com/lavanet/lava/v3/x/plans/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/plans/keeper/params.go b/x/plans/keeper/params.go index 9b6aef6fcf..ca94a9f835 100644 --- a/x/plans/keeper/params.go +++ b/x/plans/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" ) // GetParams get all parameters as types.Params diff --git a/x/plans/keeper/params_test.go b/x/plans/keeper/params_test.go index 2de3feefda..51a68ebd4d 100644 --- a/x/plans/keeper/params_test.go +++ b/x/plans/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/plans/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/keeper/plan.go b/x/plans/keeper/plan.go index 257b64492e..cab1565eda 100644 --- a/x/plans/keeper/plan.go +++ b/x/plans/keeper/plan.go @@ -4,9 +4,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/plans/types" ) // AddPlan adds a new plan to the KVStore diff --git a/x/plans/keeper/plan_test.go b/x/plans/keeper/plan_test.go index 22cc49af92..0d509e424b 100644 --- a/x/plans/keeper/plan_test.go +++ b/x/plans/keeper/plan_test.go @@ -6,10 +6,10 @@ import ( "testing" "cosmossdk.io/math" - "github.com/lavanet/lava/v3/testutil/common" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/testutil/common" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/migrations/v3/plan.pb.go b/x/plans/migrations/v3/plan.pb.go index cb16232ee3..a31305618f 100755 --- a/x/plans/migrations/v3/plan.pb.go +++ b/x/plans/migrations/v3/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - v3 "github.com/lavanet/lava/v3/x/projects/migrations/v3" + v3 "github.com/lavanet/lava/v4/x/projects/migrations/v3" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v7/plan.pb.go b/x/plans/migrations/v7/plan.pb.go index bdf0b1af9b..4b96aa4473 100755 --- a/x/plans/migrations/v7/plan.pb.go +++ b/x/plans/migrations/v7/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v3/x/spec/types" + _ "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v7/policy.pb.go b/x/plans/migrations/v7/policy.pb.go index 28832a56b1..ec451522d3 100755 --- a/x/plans/migrations/v7/policy.pb.go +++ b/x/plans/migrations/v7/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/spec/types" + types "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v8/plan.pb.go b/x/plans/migrations/v8/plan.pb.go index a5c7e7fbe7..883481d13a 100644 --- a/x/plans/migrations/v8/plan.pb.go +++ b/x/plans/migrations/v8/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v3/x/spec/types" + _ "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v8/policy.pb.go b/x/plans/migrations/v8/policy.pb.go index 5aedb997ce..ed334acfdf 100644 --- a/x/plans/migrations/v8/policy.pb.go +++ b/x/plans/migrations/v8/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/spec/types" + types "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v9/plan.pb.go b/x/plans/migrations/v9/plan.pb.go index db9f8b7ac3..e4f2b01f9b 100644 --- a/x/plans/migrations/v9/plan.pb.go +++ b/x/plans/migrations/v9/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v3/x/spec/types" + _ "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v9/policy.pb.go b/x/plans/migrations/v9/policy.pb.go index e708f6edcc..5a43d1f1f6 100644 --- a/x/plans/migrations/v9/policy.pb.go +++ b/x/plans/migrations/v9/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/spec/types" + types "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/module.go b/x/plans/module.go index dab6d6c741..51e5b60028 100644 --- a/x/plans/module.go +++ b/x/plans/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/plans/client/cli" - "github.com/lavanet/lava/v3/x/plans/keeper" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/client/cli" + "github.com/lavanet/lava/v4/x/plans/keeper" + "github.com/lavanet/lava/v4/x/plans/types" ) var ( diff --git a/x/plans/module_simulation.go b/x/plans/module_simulation.go index 43b31ba52c..229fc02022 100644 --- a/x/plans/module_simulation.go +++ b/x/plans/module_simulation.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - plansimulation "github.com/lavanet/lava/v3/x/plans/simulation" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/testutil/sample" + plansimulation "github.com/lavanet/lava/v4/x/plans/simulation" + "github.com/lavanet/lava/v4/x/plans/types" ) // avoid unused import issue diff --git a/x/plans/proposal_handler.go b/x/plans/proposal_handler.go index 70d66bc612..d8e9268432 100644 --- a/x/plans/proposal_handler.go +++ b/x/plans/proposal_handler.go @@ -7,9 +7,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/plans/keeper" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/plans/keeper" + "github.com/lavanet/lava/v4/x/plans/types" ) // NewPlanProposalsHandler creates a new governance Handler for a Plan diff --git a/x/plans/types/delproposal.go b/x/plans/types/delproposal.go index 14834283ba..b32d144f3a 100644 --- a/x/plans/types/delproposal.go +++ b/x/plans/types/delproposal.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" sdkerrors "cosmossdk.io/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const ( diff --git a/x/plans/types/errors.go b/x/plans/types/errors.go index d1c36298ca..977627a586 100644 --- a/x/plans/types/errors.go +++ b/x/plans/types/errors.go @@ -4,7 +4,7 @@ package types import ( sdkerrors "cosmossdk.io/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) // x/plan module sentinel errors diff --git a/x/plans/types/expected_keepers.go b/x/plans/types/expected_keepers.go index 7992ed623c..e3435e2942 100644 --- a/x/plans/types/expected_keepers.go +++ b/x/plans/types/expected_keepers.go @@ -3,8 +3,8 @@ package types import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" ) type EpochStorageKeeper interface { diff --git a/x/plans/types/genesis.go b/x/plans/types/genesis.go index 3b56abdcd0..b4fc2b66c1 100644 --- a/x/plans/types/genesis.go +++ b/x/plans/types/genesis.go @@ -1,7 +1,7 @@ package types import ( - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" ) // DefaultIndex is the default capability global index diff --git a/x/plans/types/genesis.pb.go b/x/plans/types/genesis.pb.go index 983cd25cd1..6730d52176 100644 --- a/x/plans/types/genesis.pb.go +++ b/x/plans/types/genesis.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/fixationstore/types" + types "github.com/lavanet/lava/v4/x/fixationstore/types" io "io" math "math" math_bits "math/bits" @@ -98,8 +98,8 @@ var fileDescriptor_714273f6abd9b14c = []byte{ 0x2d, 0x85, 0x1a, 0x04, 0xd3, 0xee, 0xe4, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x1a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0x9e, - 0x2c, 0x33, 0xd6, 0xaf, 0x80, 0x06, 0x45, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x7f, - 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x05, 0x03, 0xb9, 0x79, 0x01, 0x00, 0x00, + 0x2c, 0x33, 0xd1, 0xaf, 0x80, 0x06, 0x45, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x7f, + 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x9d, 0xba, 0xcf, 0x79, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/plans/types/genesis_test.go b/x/plans/types/genesis_test.go index 0e23d4e7e0..8ab0295b73 100644 --- a/x/plans/types/genesis_test.go +++ b/x/plans/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/types/geolocation_test.go b/x/plans/types/geolocation_test.go index d18d541821..a7506e7262 100644 --- a/x/plans/types/geolocation_test.go +++ b/x/plans/types/geolocation_test.go @@ -3,8 +3,8 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/utils/lavaslices" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/utils/lavaslices" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/types/params.pb.go b/x/plans/types/params.pb.go index d8899d8303..63fa0cc280 100644 --- a/x/plans/types/params.pb.go +++ b/x/plans/types/params.pb.go @@ -74,9 +74,9 @@ var fileDescriptor_bb70e7895581f8ab = []byte{ 0xf1, 0x71, 0xb1, 0x05, 0x80, 0x75, 0x5a, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0xe4, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x1a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, - 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0xf6, 0x97, 0x19, 0xeb, 0x57, 0x40, 0x1d, 0x51, 0x52, 0x59, - 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x36, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x48, 0x2d, 0x55, - 0x6e, 0xa7, 0x00, 0x00, 0x00, + 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0xf6, 0x97, 0x99, 0xe8, 0x57, 0x40, 0x1d, 0x51, 0x52, 0x59, + 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x36, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xb5, 0xec, + 0x18, 0xa7, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/plans/types/plan.pb.go b/x/plans/types/plan.pb.go index 183a9b882d..2f3682d88a 100644 --- a/x/plans/types/plan.pb.go +++ b/x/plans/types/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v3/x/spec/types" + _ "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" @@ -206,45 +206,45 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/plan.proto", fileDescriptor_64c3707a3b09a2e5) } var fileDescriptor_64c3707a3b09a2e5 = []byte{ - // 605 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xcf, 0x6e, 0xd3, 0x30, - 0x1c, 0x6e, 0xda, 0xb4, 0x4b, 0x9d, 0x75, 0x33, 0x86, 0x43, 0xa8, 0x20, 0xa9, 0x38, 0xa0, 0x8a, - 0x43, 0xa2, 0x31, 0x09, 0x89, 0x0b, 0x82, 0x8e, 0x6d, 0x52, 0x35, 0x89, 0x2a, 0xd3, 0x84, 0x04, - 0x48, 0x91, 0xeb, 0x5a, 0xc5, 0xe0, 0xc5, 0x51, 0xe2, 0x96, 0xed, 0x15, 0x38, 0xf1, 0x18, 0x3c, - 0xca, 0x8e, 0x3b, 0x72, 0x8a, 0x50, 0x77, 0xcb, 0x4b, 0x0c, 0xd9, 0xce, 0xd0, 0x0a, 0x88, 0x8b, - 0x3f, 0x7f, 0xbf, 0xef, 0xfb, 0xb5, 0xbf, 0x3f, 0x31, 0x78, 0xc8, 0xf1, 0x12, 0xa7, 0x54, 0x46, - 0x0a, 0xa3, 0x8c, 0xe3, 0xb4, 0xd0, 0x67, 0x98, 0xe5, 0x42, 0x0a, 0x84, 0x6a, 0x39, 0x54, 0x18, - 0x6a, 0xb9, 0x7f, 0x6f, 0x2e, 0xe6, 0x42, 0xcb, 0x91, 0xba, 0x19, 0x67, 0xdf, 0x27, 0xa2, 0x38, - 0x15, 0x45, 0x34, 0xc5, 0x05, 0x8d, 0x96, 0x3b, 0x53, 0x2a, 0xf1, 0x4e, 0x44, 0x04, 0xab, 0x7f, - 0xa9, 0xff, 0x78, 0xed, 0x8f, 0x8a, 0x8c, 0x92, 0x08, 0x67, 0x2c, 0x21, 0x82, 0x73, 0x4a, 0x24, - 0x13, 0x37, 0xbe, 0xe0, 0x5f, 0x05, 0x09, 0xce, 0xc8, 0xb9, 0x31, 0x3c, 0xfa, 0xda, 0x06, 0xf6, - 0x84, 0xe3, 0x14, 0x05, 0xa0, 0xcd, 0xd2, 0x19, 0x3d, 0xf3, 0xac, 0x81, 0x35, 0xec, 0x8e, 0xba, - 0x55, 0x19, 0x98, 0x40, 0x6c, 0x40, 0x19, 0xa6, 0x5c, 0x90, 0xcf, 0x5e, 0x6b, 0x60, 0x0d, 0x6d, - 0x63, 0xd0, 0x81, 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 0x9b, 0x59, 0xee, 0x46, 0x67, 0xf5, 0xc3, 0x51, 0x7b, 0x2e, 0xa6, 0x1d, 0xfd, 0x70, 0x76, 0x7f, - 0x05, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x34, 0x06, 0x77, 0xec, 0x03, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4f, 0x6f, 0xd3, 0x3e, + 0x18, 0x6e, 0xda, 0xb4, 0x4b, 0x9d, 0x75, 0xf3, 0xcf, 0x3f, 0x0e, 0xa1, 0x82, 0xa4, 0xe2, 0x80, + 0x2a, 0x0e, 0x89, 0xc6, 0x10, 0x12, 0x17, 0x04, 0x1d, 0xdb, 0xa4, 0x6a, 0x12, 0x55, 0xa6, 0x09, + 0x09, 0x90, 0x22, 0xd7, 0xb5, 0x8a, 0xc1, 0x8b, 0xa3, 0xc4, 0x2d, 0xdb, 0x57, 0xe0, 0xc4, 0xc7, + 0xe0, 0xa3, 0xec, 0xb8, 0x23, 0xa7, 0x08, 0x75, 0xb7, 0x7c, 0x89, 0x21, 0xdb, 0x19, 0x5a, 0x01, + 0x71, 0xf1, 0xe3, 0xe7, 0x7d, 0x9e, 0xb7, 0x7d, 0xff, 0xc4, 0xe0, 0x3e, 0xc7, 0x4b, 0x9c, 0x52, + 0x19, 0x29, 0x8c, 0x32, 0x8e, 0xd3, 0x42, 0x9f, 0x61, 0x96, 0x0b, 0x29, 0x10, 0xaa, 0xe5, 0x50, + 0x61, 0xa8, 0xe5, 0xfe, 0x9d, 0xb9, 0x98, 0x0b, 0x2d, 0x47, 0xea, 0x66, 0x9c, 0x7d, 0x9f, 0x88, + 0xe2, 0x54, 0x14, 0xd1, 0x14, 0x17, 0x34, 0x5a, 0xee, 0x4c, 0xa9, 0xc4, 0x3b, 0x11, 0x11, 0xac, + 0xfe, 0xa5, 0xfe, 0xc3, 0xb5, 0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0xcd, 0xe5, 0x0d, 0x74, 0x94, 0xf2, 0xf2, 0x00, 0x42, 0x8d, 0xc7, 0x70, 0xa0, 0xf1, + 0x04, 0xbe, 0x40, 0x0e, 0x68, 0x1e, 0x1e, 0xc1, 0xeb, 0xeb, 0xd6, 0xe8, 0xe0, 0xdb, 0xca, 0xb7, + 0x2e, 0x56, 0xbe, 0x75, 0xb9, 0xf2, 0xad, 0x1f, 0x2b, 0xdf, 0xfa, 0x7a, 0xe5, 0x37, 0x2e, 0xaf, + 0xfc, 0xc6, 0xf7, 0x2b, 0xbf, 0xf1, 0x76, 0x38, 0x67, 0xf2, 0xc3, 0x62, 0x1a, 0x12, 0x71, 0x1a, + 0xad, 0xbd, 0x99, 0xe5, 0x93, 0xe8, 0xac, 0x7e, 0x38, 0x6a, 0xcf, 0xc5, 0xb4, 0xa3, 0x1f, 0xce, + 0xee, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xac, 0xbf, 0x01, 0xec, 0x03, 0x00, 0x00, } func (this *Plan) Equal(that interface{}) bool { diff --git a/x/plans/types/plan_decode_test.go b/x/plans/types/plan_decode_test.go index a7a14ddfce..5e892702a0 100644 --- a/x/plans/types/plan_decode_test.go +++ b/x/plans/types/plan_decode_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/utils/decoder" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/utils/decoder" "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/require" ) diff --git a/x/plans/types/plans_proposal.pb.go b/x/plans/types/plans_proposal.pb.go index 6643d4ad39..ab07a9093c 100644 --- a/x/plans/types/plans_proposal.pb.go +++ b/x/plans/types/plans_proposal.pb.go @@ -128,8 +128,8 @@ var fileDescriptor_781f7efff31affc8 = []byte{ 0x9a, 0x89, 0xec, 0x6e, 0x84, 0x9b, 0x9c, 0xdc, 0x56, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0x7d, 0x94, 0x18, 0x2b, 0x33, 0xd6, 0xaf, 0x80, 0x46, 0x5b, 0x49, 0x65, 0x41, 0x6a, - 0x71, 0x12, 0x1b, 0x38, 0xe2, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x67, 0x6f, 0xc1, 0xdc, + 0xfc, 0x5c, 0x7d, 0x94, 0x18, 0x2b, 0x33, 0xd1, 0xaf, 0x80, 0x46, 0x5b, 0x49, 0x65, 0x41, 0x6a, + 0x71, 0x12, 0x1b, 0x38, 0xe2, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xf7, 0x78, 0xaa, 0x2c, 0x02, 0x00, 0x00, } diff --git a/x/plans/types/policy.go b/x/plans/types/policy.go index c95891fd2a..0efe9edcd0 100644 --- a/x/plans/types/policy.go +++ b/x/plans/types/policy.go @@ -11,9 +11,9 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils/decoder" - "github.com/lavanet/lava/v3/utils/lavaslices" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" + "github.com/lavanet/lava/v4/utils/decoder" + "github.com/lavanet/lava/v4/utils/lavaslices" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" "github.com/mitchellh/mapstructure" ) diff --git a/x/plans/types/policy.pb.go b/x/plans/types/policy.pb.go index 564972fb3b..6e6abf096d 100644 --- a/x/plans/types/policy.pb.go +++ b/x/plans/types/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/spec/types" + types "github.com/lavanet/lava/v4/x/spec/types" io "io" math "math" math_bits "math/bits" @@ -280,50 +280,50 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/policy.proto", fileDescriptor_c2388e0faa8deb9b) } var fileDescriptor_c2388e0faa8deb9b = []byte{ - // 680 bytes of a gzipped FileDescriptorProto + // 681 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xcd, 0x6e, 0xda, 0x4a, 0x18, 0x65, 0x02, 0x24, 0x30, 0x10, 0xc4, 0x9d, 0x9b, 0x1f, 0xdf, 0xdc, 0xca, 0xa6, 0x51, 0xd5, - 0xa2, 0x56, 0xb2, 0x95, 0x64, 0xd3, 0x6d, 0x8c, 0x5d, 0x15, 0x89, 0x34, 0x68, 0x48, 0xd2, 0xa8, - 0x8b, 0x58, 0x83, 0x99, 0x92, 0x91, 0x6c, 0xc6, 0xc5, 0x06, 0x91, 0x5d, 0x1f, 0xa1, 0x8f, 0xd1, - 0x07, 0xe8, 0xaa, 0x8b, 0xae, 0xb3, 0xcc, 0xb2, 0x2b, 0xab, 0x22, 0x3b, 0x3f, 0x45, 0xe5, 0xe1, - 0xd7, 0x09, 0xd9, 0x30, 0xdf, 0xcf, 0x39, 0xdf, 0x77, 0x80, 0x33, 0x03, 0x15, 0x87, 0x0c, 0x49, - 0x8f, 0x06, 0x5a, 0x7c, 0x6a, 0x9e, 0x43, 0x7a, 0xbe, 0xe6, 0x71, 0x87, 0xd9, 0x37, 0xaa, 0xd7, - 0xe7, 0x01, 0x47, 0x68, 0x0a, 0x50, 0xe3, 0x53, 0x15, 0x80, 0xbd, 0xad, 0x2e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f5, 0x9d, 0x9b, + 0x50, 0x49, 0x45, 0xa1, 0x72, 0x8f, 0x8e, 0x37, 0xed, 0x39, 0x88, 0x51, 0x1f, 0xbd, 0x87, 0xff, + 0x76, 0x29, 0x77, 0xb8, 0x4d, 0xe2, 0xfd, 0x96, 0xd7, 0xe7, 0x9f, 0x99, 0x43, 0xa5, 0xb5, 0x0a, + 0xa8, 0x66, 0xf5, 0xdd, 0x28, 0x54, 0x56, 0xb5, 0x31, 0x5a, 0x2a, 0x36, 0x27, 0x35, 0xf4, 0x16, + 0x96, 0x02, 0x1e, 0x10, 0xc7, 0xb2, 0x07, 0x96, 0xc3, 0x5c, 0x16, 0x48, 0xe9, 0x0a, 0xa8, 0x66, + 0x74, 0x14, 0x8b, 0x48, 0x76, 0x70, 0x51, 0xe4, 0xb5, 0x41, 0x23, 0xce, 0x62, 0x26, 0xf5, 0xb8, + 0x7d, 0xb5, 0x60, 0x66, 0x16, 0xcc, 0x64, 0x07, 0x17, 0x45, 0x3e, 0x63, 0x36, 0xe0, 0xb6, 0x4b, + 0x46, 0xb1, 0xac, 0x21, 0xeb, 0xd0, 0xbe, 0x6f, 0x05, 0xdc, 0xf2, 0x08, 0xeb, 0x4b, 0x59, 0x31, + 0xe0, 0xbf, 0x28, 0x54, 0x56, 0x03, 0x30, 0x72, 0xc9, 0xa8, 0x39, 0xab, 0x9e, 0xf2, 0x26, 0x61, + 0x7d, 0xf4, 0x15, 0xc0, 0x5d, 0x9f, 0xc6, 0x7f, 0x05, 0xed, 0x2c, 0x51, 0x5c, 0xde, 0xa1, 0xd2, + 0x7a, 0x05, 0x54, 0x4b, 0x87, 0xaf, 0x56, 0xfd, 0xea, 0x2d, 0xb3, 0x61, 0xd6, 0x4e, 0x4d, 0xc3, + 0x6a, 0xe2, 0x93, 0xf3, 0xba, 0x61, 0xe2, 0x96, 0x75, 0x7c, 0x62, 0x98, 0xfa, 0xff, 0x51, 0xa8, + 0x3c, 0x36, 0x0f, 0x6f, 0xcf, 0x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, 0x4e, 0x3e, 0x9a, + 0x46, 0x39, 0x85, 0xf2, 0x30, 0x7b, 0x5c, 0xbf, 0x30, 0x8d, 0x32, 0x40, 0x9b, 0x30, 0x6f, 0x5e, + 0xd4, 0x1a, 0x67, 0xad, 0xfa, 0xb9, 0x59, 0x5e, 0x43, 0x45, 0x98, 0x33, 0xea, 0xad, 0x23, 0xbd, + 0x61, 0x1a, 0xe5, 0xb4, 0xfe, 0xee, 0xfb, 0x58, 0x06, 0x37, 0x63, 0x19, 0xdc, 0x8e, 0x65, 0xf0, + 0x67, 0x2c, 0x83, 0x6f, 0x77, 0x72, 0xea, 0xf6, 0x4e, 0x4e, 0xfd, 0xbe, 0x93, 0x53, 0x9f, 0xaa, + 0x5d, 0x16, 0x5c, 0x0d, 0xda, 0xaa, 0xcd, 0x5d, 0x2d, 0xf1, 0xaa, 0x0c, 0xdf, 0x68, 0xa3, 0xe9, + 0x2b, 0x16, 0x5c, 0x7b, 0xd4, 0x6f, 0xaf, 0x8b, 0x37, 0xe5, 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xf0, 0xda, 0xfc, 0xc6, 0xe8, 0x04, 0x00, 0x00, } func (this *Policy) Equal(that interface{}) bool { diff --git a/x/plans/types/query.pb.go b/x/plans/types/query.pb.go index af308f2eee..1927f6f0ef 100644 --- a/x/plans/types/query.pb.go +++ b/x/plans/types/query.pb.go @@ -358,38 +358,38 @@ var fileDescriptor_060142fb85a7e3eb = []byte{ // 539 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x5d, 0x6b, 0x13, 0x41, 0x14, 0xcd, 0x36, 0x1f, 0x98, 0x09, 0x88, 0x8e, 0x79, 0x58, 0x97, 0x76, 0x1b, 0x16, 0x6b, 0x83, - 0xe0, 0x0c, 0x49, 0x11, 0x04, 0xdf, 0xe2, 0x83, 0x14, 0x04, 0x6b, 0x7c, 0x13, 0xa1, 0x4c, 0xb6, - 0x93, 0x75, 0x60, 0x33, 0xb3, 0xdd, 0x99, 0x84, 0x16, 0x29, 0x42, 0x7e, 0x81, 0xe0, 0x9f, 0xea, - 0x63, 0xc1, 0x17, 0x9f, 0x44, 0x12, 0x7f, 0x88, 0xcc, 0xc7, 0xd2, 0x0d, 0xdd, 0xb6, 0x4f, 0x93, - 0xdc, 0x7b, 0xee, 0x39, 0x67, 0xce, 0x9d, 0x05, 0x61, 0x4a, 0x16, 0x84, 0x53, 0x85, 0xf5, 0x89, - 0xb3, 0x94, 0x70, 0x89, 0x4f, 0xe7, 0x34, 0x3f, 0x47, 0x59, 0x2e, 0x94, 0x80, 0xd0, 0xf5, 0x91, - 0x3e, 0x91, 0xe9, 0x07, 0xdd, 0x44, 0x24, 0xc2, 0xb4, 0xb1, 0xfe, 0x65, 0x91, 0xc1, 0x76, 0x22, - 0x44, 0x92, 0x52, 0x4c, 0x32, 0x86, 0x09, 0xe7, 0x42, 0x11, 0xc5, 0x04, 0x97, 0xae, 0xfb, 0x22, - 0x16, 0x72, 0x26, 0x24, 0x9e, 0x10, 0x49, 0xad, 0x00, 0x5e, 0x0c, 0x26, 0x54, 0x91, 0x01, 0xce, - 0x48, 0xc2, 0xb8, 0x01, 0x3b, 0xec, 0x6e, 0x85, 0xa7, 0x8c, 0xe4, 0x64, 0x56, 0x90, 0x85, 0x65, - 0xb2, 0x82, 0x26, 0x16, 0xac, 0x20, 0xd8, 0xa9, 0x22, 0x48, 0x89, 0x6b, 0x47, 0x5d, 0x00, 0x3f, - 0x6a, 0x07, 0x47, 0x86, 0x73, 0x4c, 0x4f, 0xe7, 0x54, 0xaa, 0xe8, 0x03, 0x78, 0xb2, 0x51, 0x95, - 0x99, 0xe0, 0x92, 0xc2, 0xd7, 0xa0, 0x65, 0xb5, 0x7d, 0xaf, 0xe7, 0xf5, 0x3b, 0xc3, 0x00, 0xdd, - 0x4c, 0x04, 0xd9, 0x99, 0x51, 0xe3, 0xf2,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0x30, 0x25, 0x0b, 0xc2, 0xa9, 0xc2, 0xfa, 0xc4, + 0x59, 0x4a, 0xb8, 0xc4, 0x27, 0x73, 0x9a, 0x9f, 0xa1, 0x2c, 0x17, 0x4a, 0x40, 0xe8, 0xfa, 0x48, + 0x9f, 0xc8, 0xf4, 0x83, 0x6e, 0x22, 0x12, 0x61, 0xda, 0x58, 0xff, 0xb2, 0xc8, 0x60, 0x3b, 0x11, + 0x22, 0x49, 0x29, 0x26, 0x19, 0xc3, 0x84, 0x73, 0xa1, 0x88, 0x62, 0x82, 0x4b, 0xd7, 0x7d, 0x16, + 0x0b, 0x39, 0x13, 0x12, 0x4f, 0x88, 0xa4, 0x56, 0x00, 0x2f, 0x06, 0x13, 0xaa, 0xc8, 0x00, 0x67, + 0x24, 0x61, 0xdc, 0x80, 0x1d, 0x76, 0xb7, 0xc2, 0x53, 0x46, 0x72, 0x32, 0x2b, 0xc8, 0xc2, 0x32, + 0x59, 0x41, 0x13, 0x0b, 0x56, 0x10, 0xec, 0x54, 0x11, 0xa4, 0xc4, 0xb5, 0xa3, 0x2e, 0x80, 0x1f, + 0xb5, 0x83, 0x43, 0xc3, 0x39, 0xa6, 0x27, 0x73, 0x2a, 0x55, 0xf4, 0x01, 0x3c, 0xda, 0xa8, 0xca, + 0x4c, 0x70, 0x49, 0xe1, 0x6b, 0xd0, 0xb2, 0xda, 0xbe, 0xd7, 0xf3, 0xfa, 0x9d, 0x61, 0x80, 0xae, + 0x27, 0x82, 0xec, 0xcc, 0xa8, 0x71, 0xf1, 0x67, 0xb7, 0x36, 0x76, 0xf8, 0x08, 0x82, 0x07, 0x86, + 0xf0, 0x3d, 0x93, 0xaa, 0x10, 0xf9, 0x02, 0x1e, 0x96, 0x6a, 0x4e, 0xe2, 0x1d, 0x00, 0x86, 0xe6, + 0x88, 0xf1, 0xa9, 0xf0, 0xbd, 0x5e, 0xbd, 0xdf, 0x19, 0x46, 0x55, 0x32, 0x7a, 0xea, 0x80, 0x4f, + 0xc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0x4b, 0xfb, 0xb9, 0x45, 0xb7, 0xbc, 0x92, 0xe8, 0xb9, 0xd1, + 0xdd, 0x87, 0x7b, 0x55, 0xba, 0x7a, 0x4f, 0xf8, 0xdb, 0xd5, 0x9a, 0xcf, 0x47, 0xa3, 0x8b, 0x55, + 0xe8, 0x5d, 0xae, 0x42, 0xef, 0xef, 0x2a, 0xf4, 0x7e, 0xac, 0xc3, 0xda, 0xe5, 0x3a, 0xac, 0xfd, + 0x5e, 0x87, 0xb5, 0xcf, 0xfd, 0x84, 0xa9, 0xaf, 0xf3, 0x09, 0x8a, 0xc5, 0x6c, 0x93, 0x6a, 0xf1, + 0x12, 0x9f, 0x3a, 0x3e, 0x75, 0x96, 0x51, 0x39, 0x69, 0x99, 0xcf, 0xf5, 0xc5, 0xff, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x35, 0x9c, 0x0d, 0x98, 0xa4, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/plans/types/tx.pb.go b/x/plans/types/tx.pb.go index 22155bd1eb..13e0e65001 100644 --- a/x/plans/types/tx.pb.go +++ b/x/plans/types/tx.pb.go @@ -33,8 +33,8 @@ var fileDescriptor_3d5c4f7f9bf14ddd = []byte{ 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0x72, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0xc3, - 0xcb, 0x8c, 0xf5, 0x2b, 0x60, 0x36, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x6d, 0x31, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x7a, 0x3e, 0xa0, 0x84, 0x00, 0x00, 0x00, + 0xcb, 0x4c, 0xf4, 0x2b, 0x60, 0x36, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x6d, 0x31, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xe2, 0x87, 0xd6, 0x84, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/projects/client/cli/query.go b/x/projects/client/cli/query.go index 8514f6d4fe..5b44fcbbfb 100644 --- a/x/projects/client/cli/query.go +++ b/x/projects/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/projects/client/cli/query_developer.go b/x/projects/client/cli/query_developer.go index 2ed25397d1..a3d3b11a37 100644 --- a/x/projects/client/cli/query_developer.go +++ b/x/projects/client/cli/query_developer.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/query_info.go b/x/projects/client/cli/query_info.go index f8605515e3..f37856558e 100644 --- a/x/projects/client/cli/query_info.go +++ b/x/projects/client/cli/query_info.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/query_params.go b/x/projects/client/cli/query_params.go index b4bac2c631..2f492c5318 100644 --- a/x/projects/client/cli/query_params.go +++ b/x/projects/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx.go b/x/projects/client/cli/tx.go index 65ce65c883..613d2303eb 100644 --- a/x/projects/client/cli/tx.go +++ b/x/projects/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/projects/client/cli/tx_add_keys.go b/x/projects/client/cli/tx_add_keys.go index ee9df2176c..88028c17e9 100644 --- a/x/projects/client/cli/tx_add_keys.go +++ b/x/projects/client/cli/tx_add_keys.go @@ -4,9 +4,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/decoder" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/decoder" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx_del_keys.go b/x/projects/client/cli/tx_del_keys.go index 9764224d90..2760d6466d 100644 --- a/x/projects/client/cli/tx_del_keys.go +++ b/x/projects/client/cli/tx_del_keys.go @@ -4,9 +4,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/decoder" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/decoder" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx_set_admin_policy.go b/x/projects/client/cli/tx_set_admin_policy.go index 68e97b99c1..ed29711bbb 100644 --- a/x/projects/client/cli/tx_set_admin_policy.go +++ b/x/projects/client/cli/tx_set_admin_policy.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/projects/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/projects/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx_set_subscription_policy.go b/x/projects/client/cli/tx_set_subscription_policy.go index 5b112989d0..44ee9dee78 100644 --- a/x/projects/client/cli/tx_set_subscription_policy.go +++ b/x/projects/client/cli/tx_set_subscription_policy.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/projects/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/genesis.go b/x/projects/genesis.go index 1cd8381873..0aceec18e3 100644 --- a/x/projects/genesis.go +++ b/x/projects/genesis.go @@ -2,8 +2,8 @@ package projects import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/projects/genesis_test.go b/x/projects/genesis_test.go index aa1a7dd91d..f3b55dc000 100644 --- a/x/projects/genesis_test.go +++ b/x/projects/genesis_test.go @@ -3,10 +3,10 @@ package projects_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/projects" - "github.com/lavanet/lava/v3/x/projects/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/projects" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/handler.go b/x/projects/handler.go index f871d6e062..300c2f9ee9 100644 --- a/x/projects/handler.go +++ b/x/projects/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) // NewHandler ... diff --git a/x/projects/keeper/creation.go b/x/projects/keeper/creation.go index a3f1c75741..fac8d9892a 100644 --- a/x/projects/keeper/creation.go +++ b/x/projects/keeper/creation.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/projects/types" ) // Keys management logic: diff --git a/x/projects/keeper/grpc_query.go b/x/projects/keeper/grpc_query.go index 5acb46a58c..e3217cd1e8 100644 --- a/x/projects/keeper/grpc_query.go +++ b/x/projects/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/projects/keeper/grpc_query_developer.go b/x/projects/keeper/grpc_query_developer.go index afcbabc832..4eb83290e7 100644 --- a/x/projects/keeper/grpc_query_developer.go +++ b/x/projects/keeper/grpc_query_developer.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/projects/keeper/grpc_query_info.go b/x/projects/keeper/grpc_query_info.go index f2863eead5..fe8843ca35 100644 --- a/x/projects/keeper/grpc_query_info.go +++ b/x/projects/keeper/grpc_query_info.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/projects/keeper/grpc_query_params.go b/x/projects/keeper/grpc_query_params.go index c6b8fa8a32..488eb6f251 100644 --- a/x/projects/keeper/grpc_query_params.go +++ b/x/projects/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/projects/keeper/grpc_query_params_test.go b/x/projects/keeper/grpc_query_params_test.go index baa195ee66..984bef36a3 100644 --- a/x/projects/keeper/grpc_query_params_test.go +++ b/x/projects/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/keeper/keeper.go b/x/projects/keeper/keeper.go index c7e3c5c71e..d5bb2753f3 100644 --- a/x/projects/keeper/keeper.go +++ b/x/projects/keeper/keeper.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/projects/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/projects/types" ) type ( diff --git a/x/projects/keeper/migrations.go b/x/projects/keeper/migrations.go index 56ca3d9181..614e364816 100644 --- a/x/projects/keeper/migrations.go +++ b/x/projects/keeper/migrations.go @@ -2,11 +2,11 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - v2 "github.com/lavanet/lava/v3/x/projects/migrations/v2" - v3 "github.com/lavanet/lava/v3/x/projects/migrations/v3" - v4 "github.com/lavanet/lava/v3/x/projects/migrations/v4" - v5 "github.com/lavanet/lava/v3/x/projects/migrations/v5" + "github.com/lavanet/lava/v4/utils" + v2 "github.com/lavanet/lava/v4/x/projects/migrations/v2" + v3 "github.com/lavanet/lava/v4/x/projects/migrations/v3" + v4 "github.com/lavanet/lava/v4/x/projects/migrations/v4" + v5 "github.com/lavanet/lava/v4/x/projects/migrations/v5" ) type Migrator struct { diff --git a/x/projects/keeper/msg_server.go b/x/projects/keeper/msg_server.go index 7a19567afe..4660291f90 100644 --- a/x/projects/keeper/msg_server.go +++ b/x/projects/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" ) type msgServer struct { diff --git a/x/projects/keeper/msg_server_add_project_keys.go b/x/projects/keeper/msg_server_add_project_keys.go index 12c35c9402..846ffee1b9 100644 --- a/x/projects/keeper/msg_server_add_project_keys.go +++ b/x/projects/keeper/msg_server_add_project_keys.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/projects/types" ) func (k msgServer) AddKeys(goCtx context.Context, msg *types.MsgAddKeys) (*types.MsgAddKeysResponse, error) { diff --git a/x/projects/keeper/msg_server_del_project_keys.go b/x/projects/keeper/msg_server_del_project_keys.go index dcc52f62da..b66f9c101d 100644 --- a/x/projects/keeper/msg_server_del_project_keys.go +++ b/x/projects/keeper/msg_server_del_project_keys.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/projects/types" ) func (k msgServer) DelKeys(goCtx context.Context, msg *types.MsgDelKeys) (*types.MsgDelKeysResponse, error) { diff --git a/x/projects/keeper/msg_server_set_admin_policy.go b/x/projects/keeper/msg_server_set_admin_policy.go index ce4d2e3579..acc2a72363 100644 --- a/x/projects/keeper/msg_server_set_admin_policy.go +++ b/x/projects/keeper/msg_server_set_admin_policy.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/projects/types" ) func (k msgServer) SetPolicy(goCtx context.Context, msg *types.MsgSetPolicy) (*types.MsgSetPolicyResponse, error) { diff --git a/x/projects/keeper/msg_server_set_subscription_policy.go b/x/projects/keeper/msg_server_set_subscription_policy.go index 82be4d4162..847bdfed18 100644 --- a/x/projects/keeper/msg_server_set_subscription_policy.go +++ b/x/projects/keeper/msg_server_set_subscription_policy.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/projects/types" ) func (k msgServer) SetSubscriptionPolicy(goCtx context.Context, msg *types.MsgSetSubscriptionPolicy) (*types.MsgSetSubscriptionPolicyResponse, error) { diff --git a/x/projects/keeper/msg_server_test.go b/x/projects/keeper/msg_server_test.go index e59ad3c3e3..48d64b9702 100644 --- a/x/projects/keeper/msg_server_test.go +++ b/x/projects/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/projects/keeper/params.go b/x/projects/keeper/params.go index 509087fc15..99c756bf74 100644 --- a/x/projects/keeper/params.go +++ b/x/projects/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" ) // GetParams get all parameters as types.Params diff --git a/x/projects/keeper/params_test.go b/x/projects/keeper/params_test.go index 74a710e0f3..ce29f7bcf5 100644 --- a/x/projects/keeper/params_test.go +++ b/x/projects/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/keeper/project.go b/x/projects/keeper/project.go index a501053a73..e1c9007068 100644 --- a/x/projects/keeper/project.go +++ b/x/projects/keeper/project.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/utils" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/projects/types" ) // getProjectForBlock returns the version of a given project at a given block diff --git a/x/projects/keeper/project_test.go b/x/projects/keeper/project_test.go index 3de619f170..73c7bc28a5 100644 --- a/x/projects/keeper/project_test.go +++ b/x/projects/keeper/project_test.go @@ -7,11 +7,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils/sigs" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/testutil/common" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils/sigs" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/module.go b/x/projects/module.go index 15697169d5..2e78ef4414 100644 --- a/x/projects/module.go +++ b/x/projects/module.go @@ -18,9 +18,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/projects/client/cli" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/client/cli" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) var ( diff --git a/x/projects/module_simulation.go b/x/projects/module_simulation.go index 45fd143daf..b2039803ff 100644 --- a/x/projects/module_simulation.go +++ b/x/projects/module_simulation.go @@ -10,9 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - projectssimulation "github.com/lavanet/lava/v3/x/projects/simulation" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/testutil/sample" + projectssimulation "github.com/lavanet/lava/v4/x/projects/simulation" + "github.com/lavanet/lava/v4/x/projects/types" ) // avoid unused import issue diff --git a/x/projects/simulation/add_project_keys.go b/x/projects/simulation/add_project_keys.go index 4190cfeb48..98f1b06a10 100644 --- a/x/projects/simulation/add_project_keys.go +++ b/x/projects/simulation/add_project_keys.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) func SimulateMsgAddKeys( diff --git a/x/projects/simulation/del_project_keys.go b/x/projects/simulation/del_project_keys.go index 518934f9de..272b112a64 100644 --- a/x/projects/simulation/del_project_keys.go +++ b/x/projects/simulation/del_project_keys.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) func SimulateMsgDelKeys( diff --git a/x/projects/simulation/set_admin_policy.go b/x/projects/simulation/set_admin_policy.go index c396ee3c85..90a10e8bc4 100644 --- a/x/projects/simulation/set_admin_policy.go +++ b/x/projects/simulation/set_admin_policy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) func SimulateMsgSetPolicy( diff --git a/x/projects/simulation/set_subscription_policy.go b/x/projects/simulation/set_subscription_policy.go index 23d6d4826b..21fecf1405 100644 --- a/x/projects/simulation/set_subscription_policy.go +++ b/x/projects/simulation/set_subscription_policy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/projects/keeper" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/keeper" + "github.com/lavanet/lava/v4/x/projects/types" ) func SimulateMsgSetSubscriptionPolicy( diff --git a/x/projects/types/expected_keepers.go b/x/projects/types/expected_keepers.go index 85486e945d..3c932ad2f5 100644 --- a/x/projects/types/expected_keepers.go +++ b/x/projects/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" + fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" ) type EpochStorageKeeper interface { diff --git a/x/projects/types/genesis.go b/x/projects/types/genesis.go index f7c5d72f9a..c8a1c3e2d1 100644 --- a/x/projects/types/genesis.go +++ b/x/projects/types/genesis.go @@ -1,7 +1,7 @@ package types import ( - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" ) // this line is used by starport scaffolding # genesis/types/import diff --git a/x/projects/types/genesis.pb.go b/x/projects/types/genesis.pb.go index cfc0737457..efe101bd66 100644 --- a/x/projects/types/genesis.pb.go +++ b/x/projects/types/genesis.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/fixationstore/types" + types "github.com/lavanet/lava/v4/x/fixationstore/types" io "io" math "math" math_bits "math/bits" @@ -109,9 +109,9 @@ var fileDescriptor_159556069ba44164 = []byte{ 0x4b, 0xcd, 0xc9, 0x2f, 0x48, 0x2d, 0x72, 0x0b, 0x96, 0x60, 0x26, 0xcb, 0x40, 0x64, 0x23, 0x9c, 0x5c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3b, 0x3d, 0xb3, 0x24, - 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x25, 0xfc, 0xca, 0x8c, 0xf5, 0x2b, 0x10, 0x01, + 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x25, 0xfc, 0xca, 0x4c, 0xf4, 0x2b, 0x10, 0x01, 0x5d, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x3d, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x82, 0xae, 0x4b, 0x9d, 0xe0, 0x01, 0x00, 0x00, + 0xff, 0xa4, 0xd5, 0x88, 0x45, 0xe0, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/projects/types/genesis_test.go b/x/projects/types/genesis_test.go index 7447729e61..e26c132dd2 100644 --- a/x/projects/types/genesis_test.go +++ b/x/projects/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_add_keys_test.go b/x/projects/types/message_add_keys_test.go index e147567b9d..faaaed9e04 100644 --- a/x/projects/types/message_add_keys_test.go +++ b/x/projects/types/message_add_keys_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_del_keys_test.go b/x/projects/types/message_del_keys_test.go index 9f82103498..e267de9f40 100644 --- a/x/projects/types/message_del_keys_test.go +++ b/x/projects/types/message_del_keys_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_set_admin_policy.go b/x/projects/types/message_set_admin_policy.go index 0ff04c1643..d06f47ef00 100644 --- a/x/projects/types/message_set_admin_policy.go +++ b/x/projects/types/message_set_admin_policy.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) const TypeMsgSetPolicy = "set_admin_policy" diff --git a/x/projects/types/message_set_admin_policy_test.go b/x/projects/types/message_set_admin_policy_test.go index 09b8a6d53b..50ff9f75fe 100644 --- a/x/projects/types/message_set_admin_policy_test.go +++ b/x/projects/types/message_set_admin_policy_test.go @@ -4,8 +4,8 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/testutil/sample" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_set_subscription_policy.go b/x/projects/types/message_set_subscription_policy.go index 4908d7f7b8..2feda77e0f 100644 --- a/x/projects/types/message_set_subscription_policy.go +++ b/x/projects/types/message_set_subscription_policy.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" ) const TypeMsgSetSubscriptionPolicy = "set_subscription_policy" diff --git a/x/projects/types/message_set_subscription_policy_test.go b/x/projects/types/message_set_subscription_policy_test.go index 0027b4bf0c..026b71c260 100644 --- a/x/projects/types/message_set_subscription_policy_test.go +++ b/x/projects/types/message_set_subscription_policy_test.go @@ -4,8 +4,8 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" - planstypes "github.com/lavanet/lava/v3/x/plans/types" + "github.com/lavanet/lava/v4/testutil/sample" + planstypes "github.com/lavanet/lava/v4/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/params.pb.go b/x/projects/types/params.pb.go index 64356280ba..5f19eaf2bc 100644 --- a/x/projects/types/params.pb.go +++ b/x/projects/types/params.pb.go @@ -76,9 +76,9 @@ var fileDescriptor_acd952a9fad2273a = []byte{ 0x82, 0x28, 0x56, 0xe2, 0xe3, 0x62, 0x0b, 0x00, 0x6b, 0xb6, 0x62, 0x99, 0xb1, 0x40, 0x9e, 0xc1, 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, 0xd3, 0x33, 0x4b, - 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x5c, 0x51, 0x66, 0xac, 0x5f, 0x81, 0x70, + 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x5c, 0x51, 0x66, 0xa2, 0x5f, 0x81, 0x70, 0x4a, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x74, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x34, 0x35, 0x53, 0x21, 0xb0, 0x00, 0x00, 0x00, + 0xff, 0x12, 0x4e, 0x90, 0xf9, 0xb0, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/projects/types/project.go b/x/projects/types/project.go index 9289e67257..06b836b745 100644 --- a/x/projects/types/project.go +++ b/x/projects/types/project.go @@ -3,7 +3,7 @@ package types import ( "fmt" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const ( diff --git a/x/projects/types/project.pb.go b/x/projects/types/project.pb.go index 6fbb6c71bc..40b5a5213d 100644 --- a/x/projects/types/project.pb.go +++ b/x/projects/types/project.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/plans/types" + types "github.com/lavanet/lava/v4/x/plans/types" io "io" math "math" math_bits "math/bits" @@ -333,38 +333,38 @@ var fileDescriptor_9027839604ae2915 = []byte{ // 546 bytes of a gzipped FileDescriptorProto 0x1f, 0x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, 0xdb, 0xa9, 0x1f, 0x5f, 0xaf, 0xc6, 0xd6, - 0x24, 0x5c, 0xd8, 0x99, 0xbd, 0x5b, 0x5f, 0xd8, 0x37, 0xc7, 0x75, 0x8e, 0x93, 0x88, 0xd0, 0x71, - 0x31, 0xdd, 0xbf, 0x8b, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x02, 0x73, 0x0b, 0x10, 0xf4, 0x03, + 0x4f, 0x85, 0x24, 0x65, 0x85, 0xd4, 0x83, 0x53, 0xee, 0x75, 0xf9, 0xb1, 0x3a, 0x92, 0x99, 0x8e, + 0xb2, 0xba, 0x69, 0x41, 0x51, 0x10, 0x58, 0x78, 0x88, 0x40, 0x47, 0x20, 0xf9, 0x08, 0xed, 0xde, + 0xcf, 0xad, 0x81, 0x6e, 0xb6, 0x06, 0xba, 0xdd, 0x1a, 0xe8, 0xef, 0xd6, 0x40, 0x3f, 0x76, 0x46, + 0xee, 0x76, 0x67, 0xe4, 0xfe, 0xec, 0x8c, 0xdc, 0xe5, 0xeb, 0xa9, 0x1f, 0x5f, 0xad, 0xc6, 0xd6, + 0x24, 0x5c, 0xd8, 0x99, 0xbd, 0x5b, 0xbf, 0xb5, 0xaf, 0x8f, 0xeb, 0x1c, 0x27, 0x11, 0xa1, 0xe3, + 0x62, 0xba, 0x7f, 0x6f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x24, 0x08, 0xc8, 0xc8, 0xf4, 0x03, 0x00, 0x00, } diff --git a/x/projects/types/query.pb.go b/x/projects/types/query.pb.go index 300d13c661..f47d340e8b 100644 --- a/x/projects/types/query.pb.go +++ b/x/projects/types/query.pb.go @@ -344,8 +344,8 @@ var fileDescriptor_e0c4357eb0c2f6e6 = []byte{ 0x19, 0x3c, 0x41, 0xe9, 0x57, 0xc3, 0x99, 0xb5, 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, 0x8b, - 0x6a, 0x62, 0x99, 0xb1, 0x7e, 0x05, 0xc2, 0xd8, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, - 0x91, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x5e, 0x2d, 0x1f, 0xcb, 0x04, 0x00, 0x00, + 0x6a, 0x62, 0x99, 0x89, 0x7e, 0x05, 0xc2, 0xd8, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, + 0x91, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x25, 0xee, 0xc7, 0xcb, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/projects/types/tx.pb.go b/x/projects/types/tx.pb.go index 816524051e..37ffc128c0 100644 --- a/x/projects/types/tx.pb.go +++ b/x/projects/types/tx.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/plans/types" + types "github.com/lavanet/lava/v4/x/plans/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -431,35 +431,35 @@ var fileDescriptor_a4f8e20515314f9d = []byte{ // 488 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x31, 0x6f, 0xd3, 0x40, 0x14, 0xc7, 0x73, 0x35, 0x6a, 0xc9, 0x4b, 0x07, 0xb0, 0x12, 0xb0, 0x3c, 0x5c, 0x8d, 0xb3, 0x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0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/protocol/client/cli/query.go b/x/protocol/client/cli/query.go index f5c90dc65f..c067a1a03a 100644 --- a/x/protocol/client/cli/query.go +++ b/x/protocol/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/protocol/client/cli/query_params.go b/x/protocol/client/cli/query_params.go index cb0126f7f2..654bf698c6 100644 --- a/x/protocol/client/cli/query_params.go +++ b/x/protocol/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" "github.com/spf13/cobra" ) diff --git a/x/protocol/client/cli/tx.go b/x/protocol/client/cli/tx.go index 255b6be808..7b1c65cb96 100644 --- a/x/protocol/client/cli/tx.go +++ b/x/protocol/client/cli/tx.go @@ -14,7 +14,7 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/protocol/genesis.go b/x/protocol/genesis.go index 0a21e84e8e..9a0e4c7e9a 100644 --- a/x/protocol/genesis.go +++ b/x/protocol/genesis.go @@ -2,8 +2,8 @@ package protocol import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/protocol/keeper" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/keeper" + "github.com/lavanet/lava/v4/x/protocol/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/protocol/genesis_test.go b/x/protocol/genesis_test.go index f34d4a020f..219370c200 100644 --- a/x/protocol/genesis_test.go +++ b/x/protocol/genesis_test.go @@ -3,10 +3,10 @@ package protocol_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/protocol" - "github.com/lavanet/lava/v3/x/protocol/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/protocol" + "github.com/lavanet/lava/v4/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/handler.go b/x/protocol/handler.go index c70ba89427..c8646de7ef 100644 --- a/x/protocol/handler.go +++ b/x/protocol/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/protocol/keeper" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/keeper" + "github.com/lavanet/lava/v4/x/protocol/types" ) // NewHandler ... diff --git a/x/protocol/keeper/grpc_query.go b/x/protocol/keeper/grpc_query.go index ec9d990ff7..92cbf8ce11 100644 --- a/x/protocol/keeper/grpc_query.go +++ b/x/protocol/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/protocol/keeper/grpc_query_params.go b/x/protocol/keeper/grpc_query_params.go index 0b04fa9dcd..2b045b146f 100644 --- a/x/protocol/keeper/grpc_query_params.go +++ b/x/protocol/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/protocol/keeper/grpc_query_params_test.go b/x/protocol/keeper/grpc_query_params_test.go index 8cc9da92df..b83d7e521b 100644 --- a/x/protocol/keeper/grpc_query_params_test.go +++ b/x/protocol/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/protocol/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/keeper/keeper.go b/x/protocol/keeper/keeper.go index 04921f9284..32778a600a 100644 --- a/x/protocol/keeper/keeper.go +++ b/x/protocol/keeper/keeper.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) type ( diff --git a/x/protocol/keeper/migrations.go b/x/protocol/keeper/migrations.go index bab9c006ea..ecb53c31df 100644 --- a/x/protocol/keeper/migrations.go +++ b/x/protocol/keeper/migrations.go @@ -2,9 +2,9 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - protocoltypes "github.com/lavanet/lava/v3/x/protocol/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + protocoltypes "github.com/lavanet/lava/v4/x/protocol/types" + "github.com/lavanet/lava/v4/x/spec/types" ) type Migrator struct { diff --git a/x/protocol/keeper/msg_server.go b/x/protocol/keeper/msg_server.go index 41c7cf6136..9c1247e115 100644 --- a/x/protocol/keeper/msg_server.go +++ b/x/protocol/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) type msgServer struct { diff --git a/x/protocol/keeper/msg_server_set_version.go b/x/protocol/keeper/msg_server_set_version.go index 7f92bde565..b06750251b 100644 --- a/x/protocol/keeper/msg_server_set_version.go +++ b/x/protocol/keeper/msg_server_set_version.go @@ -6,7 +6,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) func (k msgServer) SetVersion(goCtx context.Context, msg *types.MsgSetVersion) (*types.MsgSetVersionResponse, error) { diff --git a/x/protocol/keeper/msg_server_test.go b/x/protocol/keeper/msg_server_test.go index f4b6b866fd..f047c5f4f7 100644 --- a/x/protocol/keeper/msg_server_test.go +++ b/x/protocol/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/protocol/keeper" - "github.com/lavanet/lava/v3/x/protocol/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/protocol/keeper/params.go b/x/protocol/keeper/params.go index d9d031abf9..1cefeb9c36 100644 --- a/x/protocol/keeper/params.go +++ b/x/protocol/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" ) // GetParams get all parameters as types.Params diff --git a/x/protocol/keeper/params_test.go b/x/protocol/keeper/params_test.go index 138fe2b95e..0845651a20 100644 --- a/x/protocol/keeper/params_test.go +++ b/x/protocol/keeper/params_test.go @@ -6,8 +6,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/protocol/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/module.go b/x/protocol/module.go index 7008f5e421..cfabb651cf 100644 --- a/x/protocol/module.go +++ b/x/protocol/module.go @@ -18,9 +18,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/protocol/client/cli" - "github.com/lavanet/lava/v3/x/protocol/keeper" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/client/cli" + "github.com/lavanet/lava/v4/x/protocol/keeper" + "github.com/lavanet/lava/v4/x/protocol/types" ) var ( @@ -213,10 +213,18 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // panic:ok: at start up, migration cannot proceed anyhow panic(fmt.Errorf("%s: failed to register migration to v22: %w", types.ModuleName, err)) } + if err := cfg.RegisterMigration(types.ModuleName, 22, migrator.MigrateVersion); err != nil { + // panic:ok: at start up, migration cannot proceed anyhow + panic(fmt.Errorf("%s: failed to register migration to v23: %w", types.ModuleName, err)) + } + if err := cfg.RegisterMigration(types.ModuleName, 23, migrator.MigrateVersion); err != nil { + // panic:ok: at start up, migration cannot proceed anyhow + panic(fmt.Errorf("%s: failed to register migration to v24: %w", types.ModuleName, err)) + } } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 22 } +func (AppModule) ConsensusVersion() uint64 { return 24 } // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} diff --git a/x/protocol/module_simulation.go b/x/protocol/module_simulation.go index b271e3b8b7..60a67b4d0f 100644 --- a/x/protocol/module_simulation.go +++ b/x/protocol/module_simulation.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - protocolsimulation "github.com/lavanet/lava/v3/x/protocol/simulation" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/testutil/sample" + protocolsimulation "github.com/lavanet/lava/v4/x/protocol/simulation" + "github.com/lavanet/lava/v4/x/protocol/types" ) // avoid unused import issue diff --git a/x/protocol/types/genesis.pb.go b/x/protocol/types/genesis.pb.go index 2a7547f24f..49abbbff62 100644 --- a/x/protocol/types/genesis.pb.go +++ b/x/protocol/types/genesis.pb.go @@ -88,8 +88,8 @@ var fileDescriptor_5875ab05db1f379d = []byte{ 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x2d, 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, 0xe2, - 0xaa, 0x32, 0x63, 0xfd, 0x0a, 0x84, 0xd3, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x7c, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x39, 0xdf, 0x5f, 0x12, 0x01, 0x00, 0x00, + 0xaa, 0x32, 0x13, 0xfd, 0x0a, 0x84, 0xd3, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x7c, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xad, 0x42, 0x1c, 0x87, 0x12, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/protocol/types/genesis_test.go b/x/protocol/types/genesis_test.go index 6c0e190074..95d8bceb7e 100644 --- a/x/protocol/types/genesis_test.go +++ b/x/protocol/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/protocol/types" + "github.com/lavanet/lava/v4/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/types/message_set_version_test.go b/x/protocol/types/message_set_version_test.go index 2e0914307f..2a91fb283c 100644 --- a/x/protocol/types/message_set_version_test.go +++ b/x/protocol/types/message_set_version_test.go @@ -3,7 +3,7 @@ package types import ( "testing" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/types/params.go b/x/protocol/types/params.go index 20d3bfa881..5ba305a8ee 100644 --- a/x/protocol/types/params.go +++ b/x/protocol/types/params.go @@ -12,8 +12,8 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) const ( - TARGET_VERSION = "3.1.7" - MIN_VERSION = "2.2.2" + TARGET_VERSION = "4.0.0" + MIN_VERSION = "3.1.0" ) var ( diff --git a/x/protocol/types/params.pb.go b/x/protocol/types/params.pb.go index 6d9a00ab52..75e9bbb4a4 100644 --- a/x/protocol/types/params.pb.go +++ b/x/protocol/types/params.pb.go @@ -163,8 +163,8 @@ var fileDescriptor_e1924c66c5d42a94 = []byte{ 0xe4, 0x19, 0x82, 0x60, 0x9a, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, 0x3d, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xed, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, - 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x38, 0x2d, 0x33, 0xd6, 0xaf, 0x40, 0x44, 0x6c, 0x49, 0x65, 0x41, - 0x6a, 0x71, 0x12, 0x1b, 0x98, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x25, 0xae, 0xc4, 0xf8, + 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x38, 0x2d, 0x33, 0xd1, 0xaf, 0x40, 0x44, 0x6c, 0x49, 0x65, 0x41, + 0x6a, 0x71, 0x12, 0x1b, 0x98, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x03, 0xd5, 0x07, 0x20, 0xfe, 0x01, 0x00, 0x00, } diff --git a/x/protocol/types/query.pb.go b/x/protocol/types/query.pb.go index 6a2d55d103..ae969e1df5 100644 --- a/x/protocol/types/query.pb.go +++ b/x/protocol/types/query.pb.go @@ -121,26 +121,26 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/protocol/query.proto", fileDescriptor_c616be00122ebd89) } var fileDescriptor_c616be00122ebd89 = []byte{ - // 299 bytes of a gzipped FileDescriptorProto + // 300 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x03, 0x31, 0x14, 0x80, 0x2f, 0xa2, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xb1, 0xa9, 0x1e, 0x08, 0x5a, 0x21, 0xa1, - 0xed, 0xe8, 0x56, 0x70, 0xd7, 0x8e, 0x6e, 0xb9, 0x12, 0xe2, 0x41, 0x9b, 0x97, 0x36, 0xb9, 0xc3, - 0xae, 0x0e, 0xce, 0x05, 0xff, 0x54, 0xc7, 0x82, 0x8b, 0x93, 0xc8, 0x9d, 0x3f, 0x44, 0x2e, 0x39, - 0x91, 0x62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xeb, 0x82, 0xa2, 0xf7, 0x82, 0xa2, 0x65, 0x49, 0xa3, - 0x75, 0x49, 0xa3, 0xd7, 0x92, 0x46, 0x77, 0x97, 0x2a, 0x75, 0xf7, 0x59, 0xc2, 0xc6, 0x30, 0xdd, - 0x54, 0xe4, 0x03, 0xfe, 0xf0, 0xed, 0x71, 0x0b, 0x23, 0x6d, 0xd2, 0xf0, 0xf9, 0xe0, 0x33, 0x00, - 0x00, 0xff, 0xff, 0x48, 0x9f, 0x07, 0x48, 0x0a, 0x02, 0x00, 0x00, + 0xd5, 0xcd, 0xad, 0xe0, 0xae, 0x1d, 0xdd, 0x72, 0x25, 0xc4, 0x83, 0x36, 0x2f, 0x6d, 0x72, 0x87, + 0x5d, 0x1d, 0x9c, 0x0b, 0xfe, 0xa9, 0x8e, 0x05, 0x17, 0x27, 0x91, 0x3b, 0x7f, 0x88, 0x5c, 0x72, + 0x22, 0xc5, 0x2a, 0x4e, 0x2f, 0xef, 0xbd, 0xef, 0x7d, 0x79, 0x09, 0x3e, 0x1e, 0x8b, 0x5c, 0x68, + 0xe9, 0x78, 0x15, 0xb9, 0x99, 0x81, 0x83, 0x11, 0x8c, 0xf9, 0x34, 0x93, 0xb3, 0x39, 0xf3, 0x29, + 0xd9, 0xaf, 0x11, 0x56, 0x45, 0xf6, 0x85, 0xb4, 0x9a, 0x0a, 0x14, 0xf8, 0x8c, 0x57, 0xa7, 0xd0, + 0x68, 0x1d, 0x2a, 0x00, 0x35, 0x96, 0x5c, 0x98, 0x94, 0x0b, 0xad, 0xc1, 0x09, 0x97, 0x82, 0xb6, + 0x75, 0xb7, 0x3b, 0x02, 0x3b, 0x01, 0xcb, 0x13, 0x61, 0x65, 0xb8, 0x83, 0xe7, 0xbd, 0x44, 0x3a, + 0xd1, 0xe3, 0x46, 0xa8, 0x54, 0x7b, 0xb8, 0x66, 0xe3, 0xcd, 0x9b, 0x19, 0x31, 0x13, 0x93, 0xda, + 0x17, 0x37, 0x31, 0xb9, 0xad, 0x2c, 0x37, 0xbe, 0x38, 0x94, 0xd3, 0x4c, 0x5a, 0x17, 0x0f, 0xf1, + 0xde, 0x5a, 0xd5, 0x1a, 0xd0, 0x56, 0x92, 0x2b, 0xdc, 0x08, 0xc3, 0x07, 0xe8, 0x08, 0x9d, 0xee, + 0xf6, 0xdb, 0x6c, 0xe3, 0xc3, 0x58, 0x18, 0x1b, 0x6c, 0x2f, 0xdf, 0x3a, 0xd1, 0xb0, 0x1e, 0xe9, + 0x2f, 0x10, 0xde, 0xf1, 0x52, 0xf2, 0x84, 0x70, 0x23, 0x20, 0xe4, 0xec, 0x17, 0xc3, 0xcf, 0x9d, + 0x5a, 0xdd, 0xff, 0xa0, 0x61, 0xd1, 0xf8, 0xe4, 0xf1, 0xe5, 0xe3, 0x79, 0xab, 0x43, 0xda, 0xfc, + 0xaf, 0x2f, 0x18, 0x5c, 0x2f, 0x0b, 0x8a, 0x56, 0x05, 0x45, 0xef, 0x05, 0x45, 0x8b, 0x92, 0x46, + 0xab, 0x92, 0x46, 0xaf, 0x25, 0x8d, 0xee, 0xce, 0x55, 0xea, 0xee, 0xb3, 0x84, 0x8d, 0x60, 0xb2, + 0xae, 0xc8, 0x2f, 0xf9, 0xc3, 0xb7, 0xc7, 0xcd, 0x8d, 0xb4, 0x49, 0xc3, 0xe7, 0x17, 0x9f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x6e, 0xe4, 0xc4, 0x90, 0x0a, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/protocol/types/tx.pb.go b/x/protocol/types/tx.pb.go index 86b1d06a84..b0343b8e56 100644 --- a/x/protocol/types/tx.pb.go +++ b/x/protocol/types/tx.pb.go @@ -140,8 +140,8 @@ var fileDescriptor_96fb5a36c35e2c61 = []byte{ 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, 0xb1, 0x7e, 0x05, 0x52, 0x04, 0x55, 0x16, 0xa4, 0x16, 0x27, - 0xb1, 0x81, 0xf9, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, 0xb2, 0x40, 0x94, 0xc6, 0x01, + 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, } diff --git a/x/rewards/abci.go b/x/rewards/abci.go index 6fdc73fd81..ee4c594f62 100644 --- a/x/rewards/abci.go +++ b/x/rewards/abci.go @@ -2,7 +2,7 @@ package rewards import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/keeper" + "github.com/lavanet/lava/v4/x/rewards/keeper" ) // BeginBlocker calculates the validators block rewards and transfers them to the fee collector diff --git a/x/rewards/client/cli/query.go b/x/rewards/client/cli/query.go index 4c22ab4175..d5c8a01c79 100644 --- a/x/rewards/client/cli/query.go +++ b/x/rewards/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/rewards/client/cli/query_block_reward.go b/x/rewards/client/cli/query_block_reward.go index 748043af4a..c4af3a30ad 100644 --- a/x/rewards/client/cli/query_block_reward.go +++ b/x/rewards/client/cli/query_block_reward.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go b/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go index e98de9706b..12c62fde13 100644 --- a/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go +++ b/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_iprpc_spec_reward.go b/x/rewards/client/cli/query_iprpc_spec_reward.go index e2b4c35bb3..511082aa90 100644 --- a/x/rewards/client/cli/query_iprpc_spec_reward.go +++ b/x/rewards/client/cli/query_iprpc_spec_reward.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_params.go b/x/rewards/client/cli/query_params.go index 3b729b8f3c..a771dec008 100644 --- a/x/rewards/client/cli/query_params.go +++ b/x/rewards/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_pools.go b/x/rewards/client/cli/query_pools.go index 5577194980..4a361801a2 100644 --- a/x/rewards/client/cli/query_pools.go +++ b/x/rewards/client/cli/query_pools.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_show_iprpc_data.go b/x/rewards/client/cli/query_show_iprpc_data.go index fb78e66f59..afcd2777b8 100644 --- a/x/rewards/client/cli/query_show_iprpc_data.go +++ b/x/rewards/client/cli/query_show_iprpc_data.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_spec_tracked_info.go b/x/rewards/client/cli/query_spec_tracked_info.go index 96f16a8253..7ba1acf6ec 100644 --- a/x/rewards/client/cli/query_spec_tracked_info.go +++ b/x/rewards/client/cli/query_spec_tracked_info.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/tx.go b/x/rewards/client/cli/tx.go index 24136b28f1..b2f427761f 100644 --- a/x/rewards/client/cli/tx.go +++ b/x/rewards/client/cli/tx.go @@ -16,8 +16,8 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/x/rewards/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/rewards/client/cli/tx_fund_iprpc.go b/x/rewards/client/cli/tx_fund_iprpc.go index 8b154959b5..388eddc7cc 100644 --- a/x/rewards/client/cli/tx_fund_iprpc.go +++ b/x/rewards/client/cli/tx_fund_iprpc.go @@ -7,7 +7,7 @@ import ( "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/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/genesis.go b/x/rewards/genesis.go index 09cbee5ade..e298b8af65 100644 --- a/x/rewards/genesis.go +++ b/x/rewards/genesis.go @@ -2,8 +2,8 @@ package rewards import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/keeper" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/keeper" + "github.com/lavanet/lava/v4/x/rewards/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/rewards/genesis_test.go b/x/rewards/genesis_test.go index 2c46066ffa..be5b54fc0c 100644 --- a/x/rewards/genesis_test.go +++ b/x/rewards/genesis_test.go @@ -4,9 +4,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/rewards/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/handler.go b/x/rewards/handler.go index 7f0b2a276c..144a63eae9 100644 --- a/x/rewards/handler.go +++ b/x/rewards/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/rewards/keeper" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/keeper" + "github.com/lavanet/lava/v4/x/rewards/types" ) // NewHandler ... diff --git a/x/rewards/keeper/base_pay.go b/x/rewards/keeper/base_pay.go index 36c2a7aebc..144b82c0b7 100644 --- a/x/rewards/keeper/base_pay.go +++ b/x/rewards/keeper/base_pay.go @@ -3,7 +3,7 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) // SetBasePay set a specific BasePay in the store from its index @@ -84,8 +84,10 @@ func (k Keeper) popAllBasePayForChain(ctx sdk.Context, chainID string) (list []t k.cdc.MustUnmarshal(iterator.Value(), &val) bs := types.BasePayKeyRecover(string(iterator.Key())) bs.BasePay = val - list = append(list, bs) - store.Delete(iterator.Key()) + if bs.ChainId == chainID { + list = append(list, bs) + store.Delete(iterator.Key()) + } } return diff --git a/x/rewards/keeper/grpc_query.go b/x/rewards/keeper/grpc_query.go index 217854e181..487a1fde88 100644 --- a/x/rewards/keeper/grpc_query.go +++ b/x/rewards/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/rewards/keeper/grpc_query_block_reward.go b/x/rewards/keeper/grpc_query_block_reward.go index 349f6c71df..af52c115c8 100644 --- a/x/rewards/keeper/grpc_query_block_reward.go +++ b/x/rewards/keeper/grpc_query_block_reward.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go index dea898b780..561c01b71f 100644 --- a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go +++ b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go @@ -5,7 +5,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_iprpc_spec_reward.go b/x/rewards/keeper/grpc_query_iprpc_spec_reward.go index 1591841406..01684a5b10 100644 --- a/x/rewards/keeper/grpc_query_iprpc_spec_reward.go +++ b/x/rewards/keeper/grpc_query_iprpc_spec_reward.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_params.go b/x/rewards/keeper/grpc_query_params.go index e74c87bd24..e88b83801e 100644 --- a/x/rewards/keeper/grpc_query_params.go +++ b/x/rewards/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_params_test.go b/x/rewards/keeper/grpc_query_params_test.go index d9e1c2eaf6..17cce90dd0 100644 --- a/x/rewards/keeper/grpc_query_params_test.go +++ b/x/rewards/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/rewards/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/grpc_query_pools.go b/x/rewards/keeper/grpc_query_pools.go index c9038f9b4e..1a6f3c70e5 100644 --- a/x/rewards/keeper/grpc_query_pools.go +++ b/x/rewards/keeper/grpc_query_pools.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_show_iprpc_data.go b/x/rewards/keeper/grpc_query_show_iprpc_data.go index b9eb5423cb..60dffbfc3c 100644 --- a/x/rewards/keeper/grpc_query_show_iprpc_data.go +++ b/x/rewards/keeper/grpc_query_show_iprpc_data.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_spec_tracked_info.go b/x/rewards/keeper/grpc_query_spec_tracked_info.go index 0d9cd5743b..9c96eeb675 100644 --- a/x/rewards/keeper/grpc_query_spec_tracked_info.go +++ b/x/rewards/keeper/grpc_query_spec_tracked_info.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/helpers_test.go b/x/rewards/keeper/helpers_test.go index 3a648083a3..06a836f119 100644 --- a/x/rewards/keeper/helpers_test.go +++ b/x/rewards/keeper/helpers_test.go @@ -9,14 +9,14 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/testutil/common" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/utils/sigs" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/projects/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/common" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/utils/sigs" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/projects/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) @@ -34,7 +34,7 @@ var ( sdk.NewCoin(commontypes.TokenDenom, sdk.NewInt(1100)), sdk.NewCoin(ibcDenom, sdk.NewInt(500)), ) - mockSpec2 string = "mock2" + mockSpec2 string = "mockspec2" ) type tester struct { @@ -187,16 +187,6 @@ func (ts *tester) getConsumersForIprpcSubTest(mode int) (sigs.Account, sigs.Acco return sigs.Account{}, sigs.Account{} } -// deductParticipationFees calculates the validators and community participation -// fees and returns the providers reward after deducting them -func (ts *tester) DeductParticipationFees(reward math.Int) (updatedReward math.Int, valParticipation math.Int, communityParticipation math.Int) { - valPerc, communityPerc, err := ts.Keepers.Rewards.CalculateContributionPercentages(ts.Ctx, reward) - require.Nil(ts.T, err) - valParticipation = valPerc.MulInt(reward).TruncateInt() - communityParticipation = communityPerc.MulInt(reward).TruncateInt() - return reward.Sub(valParticipation).Sub(communityParticipation), valParticipation, communityParticipation -} - // makeBondedRatioNonZero makes BondedRatio() to be 0.25 // assumptions: // 1. validators was created using addValidators(1) and TxCreateValidator diff --git a/x/rewards/keeper/iprpc.go b/x/rewards/keeper/iprpc.go index 90d94380c9..e8ce4cd503 100644 --- a/x/rewards/keeper/iprpc.go +++ b/x/rewards/keeper/iprpc.go @@ -6,8 +6,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" ) func (k Keeper) FundIprpc(ctx sdk.Context, creator string, duration uint64, fund sdk.Coins, spec string) error { @@ -127,6 +127,13 @@ func (k Keeper) addSpecFunds(ctx sdk.Context, spec string, fund sdk.Coins, durat // distributeIprpcRewards is distributing the IPRPC rewards for providers according to their serviced CU func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcReward, specCuMap map[string]types.SpecCuType) { + // set the last rewards block + err := k.SetLastRewardsBlock(ctx) + if err != nil { + utils.LavaFormatError("distributeIprpcRewards failed", err) + return + } + // none of the providers will get the IPRPC reward this month, transfer the funds to the next month if len(specCuMap) == 0 { k.handleNoIprpcRewardToProviders(ctx, iprpcReward.SpecFunds) @@ -177,12 +184,12 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR UsedReward = UsedRewardTemp // reward the provider - _, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, providerCU.Provider, specFund.Spec, providerIprpcReward, string(types.IprpcPoolName), false, false, false) + providerOnlyReward, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, providerCU.Provider, specFund.Spec, providerIprpcReward, string(types.IprpcPoolName), false, false, false) if err != nil { // failed sending the rewards, add the claimable rewards to the leftovers that will be transferred to the community pool utils.LavaFormatPanic("failed to send iprpc rewards to provider", err, utils.LogAttr("provider", providerCU)) } - details[providerCU.Provider] = fmt.Sprintf("cu: %d reward: %s", providerCU.CU, providerIprpcReward.String()) + details[providerCU.Provider] = fmt.Sprintf("cu: %d reward: %s", providerCU.CU, providerOnlyReward.String()) } details["total_cu"] = strconv.FormatUint(specCu.TotalCu, 10) details["total_reward"] = specFund.Fund.String() @@ -194,8 +201,42 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR } // handle leftovers - err := k.FundCommunityPoolFromModule(ctx, leftovers, string(types.IprpcPoolName)) + err = k.FundCommunityPoolFromModule(ctx, leftovers, string(types.IprpcPoolName)) if err != nil { utils.LavaFormatError("could not send iprpc leftover to community pool", err) } } + +// SetLastRewardsBlock sets the lastRewardsBlock as the current height +func (k Keeper) SetLastRewardsBlock(ctx sdk.Context) error { + return k.lastRewardsBlock.Set(ctx, uint64(ctx.BlockHeight())) +} + +// GetLastRewardsBlock returns the last block in which the IPRPC rewards +// were distributed and the block height of 24 hours later. +// This is used by the subscription module's estimate-rewards query +func (k Keeper) GetLastRewardsBlock(ctx sdk.Context) (rewardsDistributionBlock uint64, after24HoursBlock uint64, err error) { + // get the number of blocks in an epoch + epochBlocks, err := k.epochstorage.EpochBlocks(ctx, uint64(ctx.BlockHeight())) + if err != nil || epochBlocks == uint64(0) { + return 0, 0, utils.LavaFormatError("GetLastRewardsBlock: invalid EpochBlocks", err, + utils.LogAttr("epoch_blocks", epochBlocks), + utils.LogAttr("block", ctx.BlockHeight()), + ) + } + + // calculate 24 hours in blocks + blockTime := k.downtimeKeeper.GetParams(ctx).EpochDuration.Seconds() / float64(epochBlocks) + blocksIn24Hours := uint64(24 * 60 * 60 / blockTime) + + // get the rewards distribution block + rewardsDistributionBlock, err = k.lastRewardsBlock.Get(ctx) + if err != nil { + return 0, 0, utils.LavaFormatError("GetLastRewardsBlock: cannot get last rewards block", err, + utils.LogAttr("epoch_blocks", epochBlocks), + utils.LogAttr("block", ctx.BlockHeight()), + ) + } + + return rewardsDistributionBlock, rewardsDistributionBlock + blocksIn24Hours, nil +} diff --git a/x/rewards/keeper/iprpc_data.go b/x/rewards/keeper/iprpc_data.go index a0c5541da1..f29071fc9f 100644 --- a/x/rewards/keeper/iprpc_data.go +++ b/x/rewards/keeper/iprpc_data.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/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 { diff --git a/x/rewards/keeper/iprpc_data_test.go b/x/rewards/keeper/iprpc_data_test.go index 85de563c11..acd59f6fdc 100644 --- a/x/rewards/keeper/iprpc_data_test.go +++ b/x/rewards/keeper/iprpc_data_test.go @@ -5,17 +5,17 @@ import ( "testing" "cosmossdk.io/math" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/rewards/keeper" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/rewards/keeper" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/testutil/sample" ) // Prevent strconv unused error diff --git a/x/rewards/keeper/iprpc_reward.go b/x/rewards/keeper/iprpc_reward.go index 41602d88c2..82138786da 100644 --- a/x/rewards/keeper/iprpc_reward.go +++ b/x/rewards/keeper/iprpc_reward.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) // GetIprpcRewardsCurrentId get the total number of IprpcReward diff --git a/x/rewards/keeper/iprpc_test.go b/x/rewards/keeper/iprpc_test.go index 7cf2a6ccea..a1fba6cb94 100644 --- a/x/rewards/keeper/iprpc_test.go +++ b/x/rewards/keeper/iprpc_test.go @@ -6,9 +6,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/sigs" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/keeper.go b/x/rewards/keeper/keeper.go index 41f5c703b3..a74ef74d80 100644 --- a/x/rewards/keeper/keeper.go +++ b/x/rewards/keeper/keeper.go @@ -3,14 +3,16 @@ package keeper import ( "fmt" + "cosmossdk.io/collections" cosmosMath "cosmossdk.io/math" "github.com/cometbft/cometbft/libs/log" "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" - "github.com/lavanet/lava/v3/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + collcompat "github.com/lavanet/lava/v4/utils/collcompat" + "github.com/lavanet/lava/v4/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) type ( @@ -41,6 +43,9 @@ type ( // the address capable of executing a MsgSetIprpcData message. Typically, this // should be the x/gov module account. authority string + + schema collections.Schema + lastRewardsBlock collections.Item[uint64] } ) @@ -66,6 +71,8 @@ func NewKeeper( ps = ps.WithKeyTable(types.ParamKeyTable()) } + sb := collections.NewSchemaBuilder(collcompat.NewKVStoreService(storeKey)) + keeper := Keeper{ cdc: cdc, storeKey: storeKey, @@ -83,10 +90,12 @@ func NewKeeper( feeCollectorName: feeCollectorName, authority: authority, + + lastRewardsBlock: collections.NewItem(sb, types.LastRewardsBlockPrefix, "last_rewards_block", collections.Uint64Value), } refillRewardsPoolTimerCallback := func(ctx sdk.Context, subkey, data []byte) { - keeper.distributeMonthlyBonusRewards(ctx) + keeper.DistributeMonthlyBonusRewards(ctx) keeper.RefillRewardsPools(ctx, subkey, data) } @@ -94,6 +103,12 @@ func NewKeeper( keeper.refillRewardsPoolTS = *timerStoreKeeper.NewTimerStoreEndBlock(storeKey, types.RefillRewardsPoolTimerPrefix). WithCallbackByBlockTime(refillRewardsPoolTimerCallback) + schema, err := sb.Build() + if err != nil { + panic(err) + } + keeper.schema = schema + return &keeper } diff --git a/x/rewards/keeper/msg_server.go b/x/rewards/keeper/msg_server.go index e44a39ce58..d2a97b28b0 100644 --- a/x/rewards/keeper/msg_server.go +++ b/x/rewards/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) type msgServer struct { diff --git a/x/rewards/keeper/msg_server_fund_iprpc.go b/x/rewards/keeper/msg_server_fund_iprpc.go index 77ca0fb38e..8dca29ce4f 100644 --- a/x/rewards/keeper/msg_server_fund_iprpc.go +++ b/x/rewards/keeper/msg_server_fund_iprpc.go @@ -5,8 +5,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" ) func (k msgServer) FundIprpc(goCtx context.Context, msg *types.MsgFundIprpc) (*types.MsgFundIprpcResponse, error) { diff --git a/x/rewards/keeper/msg_server_set_iprpc_data.go b/x/rewards/keeper/msg_server_set_iprpc_data.go index e87cc068b1..3f8313bbbc 100644 --- a/x/rewards/keeper/msg_server_set_iprpc_data.go +++ b/x/rewards/keeper/msg_server_set_iprpc_data.go @@ -7,8 +7,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" ) func (k msgServer) SetIprpcData(goCtx context.Context, msg *types.MsgSetIprpcData) (*types.MsgSetIprpcDataResponse, error) { diff --git a/x/rewards/keeper/msg_server_test.go b/x/rewards/keeper/msg_server_test.go index e152b10b53..da58116073 100644 --- a/x/rewards/keeper/msg_server_test.go +++ b/x/rewards/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/rewards/keeper" - "github.com/lavanet/lava/v3/x/rewards/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/rewards/keeper/params.go b/x/rewards/keeper/params.go index ded8ea66cd..bb829422fd 100644 --- a/x/rewards/keeper/params.go +++ b/x/rewards/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) // GetParams get all parameters as types.Params diff --git a/x/rewards/keeper/params_test.go b/x/rewards/keeper/params_test.go index b3f7772e70..4346e571d6 100644 --- a/x/rewards/keeper/params_test.go +++ b/x/rewards/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/rewards/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/pool.go b/x/rewards/keeper/pool.go index 11326a2cdf..da9fccd546 100644 --- a/x/rewards/keeper/pool.go +++ b/x/rewards/keeper/pool.go @@ -4,7 +4,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" ) // TotalPoolTokens gets the total tokens supply from a pool diff --git a/x/rewards/keeper/pool_test.go b/x/rewards/keeper/pool_test.go index cec811e3fc..2516c47a26 100644 --- a/x/rewards/keeper/pool_test.go +++ b/x/rewards/keeper/pool_test.go @@ -7,11 +7,11 @@ import ( abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" distribution "github.com/cosmos/cosmos-sdk/x/distribution" - "github.com/lavanet/lava/v3/testutil/common" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/testutil/common" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/providers.go b/x/rewards/keeper/providers.go index 43dc4b42f9..4ad9b0befd 100644 --- a/x/rewards/keeper/providers.go +++ b/x/rewards/keeper/providers.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) const DAY_SECONDS = 60 * 60 * 24 @@ -48,7 +48,7 @@ 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) { +func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context) { coins := k.TotalPoolTokens(ctx, types.ProviderRewardsDistributionPool) total := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) totalRewarded := sdk.ZeroInt() @@ -88,11 +88,11 @@ func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { return } // now give the reward the provider contributor and delegators - _, 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(k.stakingKeeper.BondDenom(ctx), 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)) } - details[basepay.Provider] = fmt.Sprintf("cu: %d reward: %s", basepay.BasePay.TotalAdjusted, reward.String()) + details[basepay.Provider] = fmt.Sprintf("cu: %d reward: %s", basepay.BasePay.TotalAdjusted, providerOnlyReward.String()) } // count iprpc cu diff --git a/x/rewards/keeper/providers_test.go b/x/rewards/keeper/providers_test.go index 5ed1c58d52..56b01aafdb 100644 --- a/x/rewards/keeper/providers_test.go +++ b/x/rewards/keeper/providers_test.go @@ -6,10 +6,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/lavanet/lava/v3/testutil/common" - "github.com/lavanet/lava/v3/utils/sigs" - "github.com/lavanet/lava/v3/x/rewards/types" - subscription "github.com/lavanet/lava/v3/x/subscription/keeper" + "github.com/lavanet/lava/v4/testutil/common" + "github.com/lavanet/lava/v4/utils/sigs" + "github.com/lavanet/lava/v4/x/rewards/types" + subscription "github.com/lavanet/lava/v4/x/subscription/keeper" "github.com/stretchr/testify/require" ) @@ -271,10 +271,9 @@ func Test2SpecsZeroShares(t *testing.T) { res, err := ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") require.NoError(t, err) - require.Len(t, res.Rewards, 2) + require.Len(t, res.Rewards, 1) expectedReward, _, _ := ts.DeductParticipationFees(ts.plan.Price.Amount) - require.Equal(t, expectedReward, res.Rewards[0].Amount.AmountOf(ts.BondDenom())) - require.Equal(t, expectedReward, res.Rewards[1].Amount.AmountOf(ts.BondDenom())) + require.Equal(t, expectedReward.MulRaw(2), res.Rewards[0].Amount.AmountOf(ts.BondDenom())) _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), "") require.NoError(t, err) @@ -287,7 +286,6 @@ func Test2SpecsZeroShares(t *testing.T) { require.NoError(t, err) require.Len(t, res.Rewards, 1) require.Equal(t, distBalance.QuoRaw(int64(ts.Keepers.Rewards.MaxRewardBoost(ts.Ctx))), res.Rewards[0].Amount.AmountOf(ts.BondDenom())) - require.Equal(t, res.Rewards[0].ChainId, ts.specs[0].Index) _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String()) require.NoError(t, err) } @@ -303,11 +301,12 @@ func Test2SpecsDoubleShares(t *testing.T) { spec2.Shares *= 2 ts.AddSpec(spec2.Index, spec2) - providerAcc, _ := ts.AddAccount(common.PROVIDER, 1, 2*testBalance) - err := ts.StakeProvider(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), ts.specs[0], testBalance) + providerAcc1, _ := ts.AddAccount(common.PROVIDER, 1, 2*testBalance) + err := ts.StakeProvider(providerAcc1.GetVaultAddr(), providerAcc1.Addr.String(), ts.specs[0], testBalance) require.NoError(t, err) - err = ts.StakeProvider(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), spec2, testBalance) + providerAcc2, _ := ts.AddAccount(common.PROVIDER, 2, 2*testBalance) + err = ts.StakeProvider(providerAcc2.GetVaultAddr(), providerAcc2.Addr.String(), spec2, testBalance) require.NoError(t, err) ts.AdvanceEpoch() @@ -316,7 +315,7 @@ func Test2SpecsDoubleShares(t *testing.T) { _, err = ts.TxSubscriptionBuy(consumerAcc.Addr.String(), consumerAcc.Addr.String(), ts.plan.Index, 1, false, false) require.NoError(t, err) - msg := ts.SendRelay(providerAcc.Addr.String(), consumerAcc, []string{ts.specs[0].Index}, ts.plan.Price.Amount.Uint64()) + msg := ts.SendRelay(providerAcc1.Addr.String(), consumerAcc, []string{ts.specs[0].Index}, ts.plan.Price.Amount.Uint64()) _, err = ts.TxPairingRelayPayment(msg.Creator, msg.Relays...) require.NoError(t, err) @@ -324,7 +323,7 @@ func Test2SpecsDoubleShares(t *testing.T) { _, err = ts.TxSubscriptionBuy(consumerAcc2.Addr.String(), consumerAcc2.Addr.String(), ts.plan.Index, 1, false, false) require.NoError(t, err) - msg = ts.SendRelay(providerAcc.Addr.String(), consumerAcc2, []string{spec2.Index}, ts.plan.Price.Amount.Uint64()) + msg = ts.SendRelay(providerAcc2.Addr.String(), consumerAcc2, []string{spec2.Index}, ts.plan.Price.Amount.Uint64()) _, err = ts.TxPairingRelayPayment(msg.Creator, msg.Relays...) require.NoError(t, err) @@ -333,25 +332,39 @@ func Test2SpecsDoubleShares(t *testing.T) { ts.AdvanceEpoch() ts.AdvanceBlocks(ts.BlocksToSave() + 1) - res, err := ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") + res, err := ts.QueryDualstakingDelegatorRewards(providerAcc1.GetVaultAddr(), providerAcc1.Addr.String(), "") require.NoError(t, err) - require.Len(t, res.Rewards, 2) + require.Len(t, res.Rewards, 1) expectedReward, _, _ := ts.DeductParticipationFees(ts.plan.Price.Amount) require.Equal(t, expectedReward, res.Rewards[0].Amount.AmountOf(ts.BondDenom())) - require.Equal(t, expectedReward, res.Rewards[1].Amount.AmountOf(ts.BondDenom())) - _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), "") + _, err = ts.TxDualstakingClaimRewards(providerAcc1.GetVaultAddr(), "") + require.NoError(t, err) + + res, err = ts.QueryDualstakingDelegatorRewards(providerAcc2.GetVaultAddr(), providerAcc2.Addr.String(), "") + require.NoError(t, err) + require.Len(t, res.Rewards, 1) + expectedReward, _, _ = ts.DeductParticipationFees(ts.plan.Price.Amount) + require.Equal(t, expectedReward, res.Rewards[0].Amount.AmountOf(ts.BondDenom())) + _, err = ts.TxDualstakingClaimRewards(providerAcc2.GetVaultAddr(), "") require.NoError(t, err) // now the provider should get all of the provider allocation ts.AdvanceMonths(1) ts.AdvanceEpoch() - res, err = ts.QueryDualstakingDelegatorRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String(), "") + res1, err := ts.QueryDualstakingDelegatorRewards(providerAcc1.GetVaultAddr(), providerAcc1.Addr.String(), "") require.NoError(t, err) - require.Len(t, res.Rewards, 2) - require.Equal(t, res.Rewards[0].Amount.AmountOf(ts.BondDenom()).QuoRaw(2), res.Rewards[1].Amount.AmountOf(ts.BondDenom())) - _, err = ts.TxDualstakingClaimRewards(providerAcc.GetVaultAddr(), providerAcc.Addr.String()) + require.Len(t, res1.Rewards, 1) + _, err = ts.TxDualstakingClaimRewards(providerAcc1.GetVaultAddr(), providerAcc1.Addr.String()) + require.NoError(t, err) + + res2, err := ts.QueryDualstakingDelegatorRewards(providerAcc2.GetVaultAddr(), providerAcc2.Addr.String(), "") + require.NoError(t, err) + require.Len(t, res1.Rewards, 1) + _, err = ts.TxDualstakingClaimRewards(providerAcc2.GetVaultAddr(), providerAcc2.Addr.String()) require.NoError(t, err) + + require.Equal(t, res1.Rewards[0].Amount.AmountOf(ts.BondDenom()), res2.Rewards[0].Amount.AmountOf(ts.BondDenom()).QuoRaw(2)) } // in this test we setup 3 providers, each with different cu used (-> 3 different rewards from the plan) (1,2,4) @@ -742,3 +755,122 @@ func TestCommunityTaxOne(t *testing.T) { communityBalance := communityCoins.AmountOf(ts.TokenDenom()).TruncateInt() require.Equal(t, expectedReward, communityBalance) } + +// TestEstimateRewardsQuery tests that the subscription module's estimate-rewards query works as expected +// for all three use-cases: provider, delegator, and delegation (dummy delegator) +// The test lets a provider get subscription, bonus and iprpc rewards. Before advancing a month, the +// query should present the expected rewards amount for the provider +func TestEstimateRewardsQuery(t *testing.T) { + const ( + Provider = iota + Delegator + Delegation + ) + + testCases := []struct { + name string + mode int + num int64 // provider/delegator stake + denom int64 // total stake + }{ + {name: "provider only", mode: Provider, num: 2 * testStake, denom: 2 * testStake}, + {name: "delegator", mode: Delegator, num: testStake / 2, denom: 2*testStake + testStake/2}, + {name: "delegation", mode: Delegation, num: testStake / 2, denom: 2*testStake + testStake/2}, + } + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + ts := newTester(t, true) + + // stake and buy iprpc-eligible subcription (total stake = 2*testStake) + ts.setupForIprpcTests(true) + consumerAcc, consumer := ts.GetAccount(common.CONSUMER, 0) + _, provider := ts.GetAccount(common.PROVIDER, 0) + + if tt.mode == Delegator { + // delegate to the provider + // advance ctx by a month and a day to make the delegation count + _, err := ts.TxDualstakingDelegate(consumer, provider, sdk.NewInt64Coin(ts.TokenDenom(), testStake/2)) + require.NoError(t, err) + ts.AdvanceMonths(1) + } + + // make provider commission zero + metadata, err := ts.Keepers.Epochstorage.GetMetadata(ts.Ctx, provider) + require.NoError(t, err) + metadata.DelegateCommission = 0 + ts.Keepers.Epochstorage.SetMetadata(ts.Ctx, metadata) + + ts.AdvanceEpoch() + + // send relay on specs[0] (normal spec) + cu := int64(100) + msg := ts.SendRelay(provider, consumerAcc, []string{ts.specs[0].Index}, uint64(cu)) + _, err = ts.TxPairingRelayPayment(msg.Creator, msg.Relays...) + require.NoError(t, err) + + // send relay on specs[1] (the iprpc eligible spec) + msg = ts.SendRelay(provider, consumerAcc, []string{ts.specs[1].Index}, uint64(cu)) + _, err = ts.TxPairingRelayPayment(msg.Creator, msg.Relays...) + require.NoError(t, err) + + ts.AdvanceEpoch() + + // subscription expected rewards (for two specs) + if tt.mode == Delegation { + trackedCuFactor := sdk.OneDec().Add(sdk.NewDec(testStake / 2).QuoInt64(tt.denom)) + cu = trackedCuFactor.MulInt64(cu).TruncateInt64() + } + expectedSubSpec0 := sdk.NewIntFromUint64(uint64(cu) * subscription.LIMIT_TOKEN_PER_CU) + expectedSubSpec0AfterTax, _, _ := ts.DeductParticipationFees(expectedSubSpec0) + expectedSubSpec1 := sdk.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) + + // iprpc expected rewards + expectedIprpc := iprpcFunds.AmountOf(ts.BondDenom()).Sub(minIprpcCost.Amount) + expectedIprpcAfterTax, _, _ := ts.DeductParticipationFees(expectedIprpc) + + // total expected reward (multiply by num/denom to get the relevant part) + expectedTotal := expectedSubSpec0AfterTax.Add(expectedSubSpec1AfterTax).Add(expectedIprpcAfterTax).Add(expectedBonusSpec0).Add(expectedBonusSpec1) + expectedTotal = expectedTotal.MulRaw(tt.num).QuoRaw(tt.denom) + + if tt.mode == Provider { + // run the estimated rewards query for the provider + total, info := ts.EstimateProviderRewards(provider, "") + require.InDelta(t, expectedTotal.Int64(), total.Int64(), 5) // InDelta because of Int divisions + + if tt.mode == Provider { + // check the result's info, should have all the reward parts + expectedInfoAmounts := []math.Int{ + expectedSubSpec0AfterTax.MulRaw(tt.num).QuoRaw(tt.denom), + expectedSubSpec1AfterTax.MulRaw(tt.num).QuoRaw(tt.denom), + expectedBonusSpec0.MulRaw(tt.num).QuoRaw(tt.denom), + expectedBonusSpec1.MulRaw(tt.num).QuoRaw(tt.denom), + expectedIprpcAfterTax.MulRaw(tt.num).QuoRaw(tt.denom), + } + infoAmounts := []math.Int{} + for _, infoPart := range info { + infoAmounts = append(infoAmounts, infoPart.Amount.AmountOf(ts.TokenDenom()).TruncateInt()) + } + require.ElementsMatch(t, expectedInfoAmounts, infoAmounts) + } + } else if tt.mode == Delegator { + // run the estimated rewards query for the delegator (should not have info, it's only for providers) + total, info := ts.EstimateProviderRewards(provider, consumer) + require.InDelta(t, expectedTotal.Int64(), total.Int64(), 5) // InDelta because of Int divisions + require.Empty(t, info) + } else { + // run the estimated rewards query for delegation simulation (should not have info, it's only for providers) + delegation := sdk.NewInt64Coin(ts.TokenDenom(), testStake/2).String() + total, info := ts.EstimateProviderRewards(provider, delegation) + + // expectedTotal = trackedCuFactor.MulInt(expectedTotal).TruncateInt() + require.InDelta(t, expectedTotal.Int64(), total.Int64(), 5) // InDelta because of Int divisions + require.Empty(t, info) + } + }) + } +} diff --git a/x/rewards/keeper/rewards.go b/x/rewards/keeper/rewards.go index 4a8876d321..c4d0fdc080 100644 --- a/x/rewards/keeper/rewards.go +++ b/x/rewards/keeper/rewards.go @@ -9,9 +9,9 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) func (k Keeper) DistributeBlockReward(ctx sdk.Context) { diff --git a/x/rewards/module.go b/x/rewards/module.go index 094a535682..7ff6796541 100644 --- a/x/rewards/module.go +++ b/x/rewards/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/rewards/client/cli" - "github.com/lavanet/lava/v3/x/rewards/keeper" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/client/cli" + "github.com/lavanet/lava/v4/x/rewards/keeper" + "github.com/lavanet/lava/v4/x/rewards/types" ) var ( diff --git a/x/rewards/module_simulation.go b/x/rewards/module_simulation.go index 6504793ec2..a5f6613792 100644 --- a/x/rewards/module_simulation.go +++ b/x/rewards/module_simulation.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - rewardssimulation "github.com/lavanet/lava/v3/x/rewards/simulation" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/testutil/sample" + rewardssimulation "github.com/lavanet/lava/v4/x/rewards/simulation" + "github.com/lavanet/lava/v4/x/rewards/types" ) // avoid unused import issue diff --git a/x/rewards/types/base_pay.pb.go b/x/rewards/types/base_pay.pb.go index 09c60e6539..edcf9b9100 100644 --- a/x/rewards/types/base_pay.pb.go +++ b/x/rewards/types/base_pay.pb.go @@ -148,28 +148,28 @@ 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,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8e, 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, } 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 989c7b78ea..a59877db44 100644 --- a/x/rewards/types/expected_keepers.go +++ b/x/rewards/types/expected_keepers.go @@ -5,10 +5,10 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - v1 "github.com/lavanet/lava/v3/x/downtime/v1" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + v1 "github.com/lavanet/lava/v4/x/downtime/v1" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -40,6 +40,7 @@ type TimerStoreKeeper interface { type EpochstorageKeeper interface { GetStakeEntryCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []epochstoragetypes.StakeEntry + EpochBlocks(ctx sdk.Context, block uint64) (res uint64, err error) } type DowntimeKeeper interface { diff --git a/x/rewards/types/genesis.go b/x/rewards/types/genesis.go index a3c1332cf1..05a215b45e 100644 --- a/x/rewards/types/genesis.go +++ b/x/rewards/types/genesis.go @@ -4,8 +4,8 @@ import ( fmt "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/timerstore/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/timerstore/types" ) // this line is used by starport scaffolding # genesis/types/import diff --git a/x/rewards/types/genesis.pb.go b/x/rewards/types/genesis.pb.go index 440b87ca97..d3cebcb0cf 100644 --- a/x/rewards/types/genesis.pb.go +++ b/x/rewards/types/genesis.pb.go @@ -8,7 +8,7 @@ import ( types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/timerstore/types" + types "github.com/lavanet/lava/v4/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -127,35 +127,35 @@ func init() { } var fileDescriptor_02c24f4df31ca14e = []byte{ - // 442 bytes of a gzipped FileDescriptorProto + // 443 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x6f, 0xd3, 0x30, 0x14, 0xc7, 0x1b, 0x52, 0x0a, 0xf3, 0x06, 0x48, 0xde, 0x90, 0xc2, 0x84, 0x42, 0x36, 0x04, 0x8a, - 0x38, 0xd8, 0x5a, 0x77, 0xe3, 0xd8, 0x82, 0x50, 0x25, 0x0e, 0x53, 0x0a, 0x42, 0xe2, 0x12, 0x39, - 0x99, 0xc9, 0x2c, 0x35, 0x76, 0xe4, 0xe7, 0x96, 0xf5, 0x5b, 0xf0, 0xb1, 0x76, 0xdc, 0x91, 0x13, - 0x42, 0xad, 0xc4, 0xe7, 0x40, 0xb1, 0x3d, 0xda, 0xa2, 0x9c, 0x6c, 0xbd, 0xf7, 0x7f, 0xbf, 0xf7, - 0xfe, 0xf6, 0x43, 0xa7, 0x33, 0xb6, 0x60, 0x92, 0x1b, 0xda, 0x9e, 0x54, 0xf3, 0xef, 0x4c, 0x5f, - 0x02, 0xad, 0xb8, 0xe4, 0x20, 0x80, 0x34, 0x5a, 0x19, 0x85, 0x8f, 0xbc, 0x86, 0xb4, 0x27, 0xf1, - 0x9a, 0xe3, 0xb8, 0x54, 0x50, 0x2b, 0xa0, 0x05, 0x03, 0x4e, 0x17, 0x67, 0x05, 0x37, 0xec, 0x8c, - 0x96, 0x4a, 0x48, 0x57, 0x75, 0x7c, 0x54, 0xa9, 0x4a, 0xd9, 0x2b, 0x6d, 0x6f, 0x3e, 0xfa, 0xb2, - 0xb3, 0x5f, 0xcb, 0xc8, 0x1b, 0xb6, 0xf4, 0xa2, 0xa4, 0x53, 0x24, 0x1a, 0xdd, 0x94, 0x5e, 0x71, - 0xd2, 0xa9, 0x68, 0x98, 0x66, 0x35, 0x74, 0x76, 0x32, 0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, 0x8a, 0x4a, 0x05, 0x26, 0xba, 0x6b, 0x1d, 0x3d, 0x21, 0xee, 0xf7, 0x49, 0x8b, 0x26, + 0xfe, 0xf7, 0xc9, 0x58, 0x09, 0xe9, 0x7b, 0x1e, 0xd4, 0x42, 0x4e, 0xda, 0xaa, 0xb1, 0x02, 0x83, + 0x3f, 0xa2, 0x07, 0x0e, 0xe1, 0x27, 0x8d, 0x06, 0xd6, 0xc6, 0x49, 0xb7, 0x0d, 0x5b, 0xe7, 0xfc, + 0xdf, 0xd2, 0xc4, 0x26, 0x04, 0x78, 0x88, 0x1e, 0xef, 0xd0, 0xf2, 0x72, 0xae, 0x35, 0x97, 0x26, + 0xba, 0x97, 0x04, 0x69, 0x3f, 0x3b, 0xdc, 0x16, 0x8f, 0x5d, 0x6a, 0xf4, 0xee, 0x7a, 0x15, 0x07, + 0x37, 0xab, 0x38, 0xf8, 0xbd, 0x8a, 0x83, 0x1f, 0xeb, 0xb8, 0x77, 0xb3, 0x8e, 0x7b, 0x3f, 0xd7, + 0x71, 0xef, 0xeb, 0xab, 0x4a, 0x98, 0xcb, 0x79, 0x41, 0x4a, 0x55, 0xd3, 0x9d, 0x95, 0x59, 0xbc, + 0xa1, 0x57, 0xff, 0x56, 0xcb, 0x2c, 0x1b, 0x0e, 0xc5, 0xc0, 0x6e, 0xcd, 0xeb, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xe3, 0xae, 0xbf, 0x90, 0x36, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/genesis_test.go b/x/rewards/types/genesis_test.go index c681f3270a..7ebf5b18b6 100644 --- a/x/rewards/types/genesis_test.go +++ b/x/rewards/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/rewards/types" + "github.com/lavanet/lava/v4/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/types/iprpc.go b/x/rewards/types/iprpc.go index 38cdcff1fd..02df21ec3c 100644 --- a/x/rewards/types/iprpc.go +++ b/x/rewards/types/iprpc.go @@ -1,5 +1,7 @@ package types +import "cosmossdk.io/collections" + const ( // IprpcSubscriptionPrefix is the prefix to retrieve all IprpcSubscription IprpcSubscriptionPrefix = "IprpcSubscription/" @@ -13,3 +15,5 @@ const ( // IprpcRewardsCurrentPrefix is the prefix to retrieve all IprpcRewardsCurrent IprpcRewardsCurrentPrefix = "IprpcRewardsCurrent/" ) + +var LastRewardsBlockPrefix = collections.NewPrefix([]byte("LastRewardsBlock/")) diff --git a/x/rewards/types/iprpc.pb.go b/x/rewards/types/iprpc.pb.go index cdb5ade74c..ae7c618d92 100644 --- a/x/rewards/types/iprpc.pb.go +++ b/x/rewards/types/iprpc.pb.go @@ -141,23 +141,23 @@ var fileDescriptor_1293618a311573f7 = []byte{ // 303 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x31, 0x4e, 0xc3, 0x30, 0x14, 0x86, 0x93, 0x10, 0x21, 0xea, 0x4a, 0x0c, 0x56, 0x87, 0xd2, 0xc1, 0x8d, 0x3a, 0x45, 0x48, - 0xd8, 0x94, 0xde, 0x20, 0x45, 0x48, 0xac, 0x61, 0x63, 0xa9, 0x12, 0xc7, 0x04, 0x0b, 0x1a, 0x5b, - 0x71, 0x1a, 0x60, 0xe2, 0x0a, 0x9c, 0x83, 0x93, 0x74, 0xec, 0xc8, 0x04, 0x28, 0xb9, 0x08, 0x7a, - 0x4e, 0x40, 0x20, 0x31, 0x3d, 0x4b, 0xff, 0xff, 0xbe, 0xf7, 0xfb, 0x47, 0xc1, 0x7d, 0x52, 0x27, - 0x85, 0xa8, 0x18, 0x4c, 0x56, 0x8a, 0x87, 0xa4, 0xcc, 0x0c, 0x93, 0xba, 0xd4, 0x9c, 0xea, 0x52, - 0x55, 0x0a, 0x8f, 0x7a, 0x07, 0x85, 0x49,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0x7c, 0x10, 0xec, 0x89, 0x41, 0x6c, 0xdf, 0x78, 0x89, 0x7c, 0xd0, 0x7a, + 0xfc, 0x01, 0xed, 0x22, 0x53, 0x88, 0x4c, 0xfb, 0xc8, 0x74, 0xa1, 0x64, 0x11, 0x1d, 0x03, 0xf9, + 0xf5, 0x63, 0x1a, 0xe6, 0xb2, 0xba, 0x5d, 0xa7, 0x94, 0xab, 0x15, 0xeb, 0xff, 0xd7, 0x8d, 0x23, + 0x93, 0xdd, 0xb1, 0xea, 0x49, 0x0b, 0x63, 0x17, 0x4c, 0x6c, 0xc1, 0xd1, 0xf9, 0xa6, 0x21, 0xee, + 0xb6, 0x21, 0xee, 0x67, 0x43, 0xdc, 0x97, 0x96, 0x38, 0xdb, 0x96, 0x38, 0x6f, 0x2d, 0x71, 0xae, + 0x0f, 0x7f, 0x91, 0xfe, 0xf4, 0x5e, 0x9f, 0xb1, 0xc7, 0x9f, 0xf2, 0x2d, 0x31, 0xdd, 0xb5, 0x8d, + 0x9d, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0xef, 0x38, 0x3b, 0x66, 0xa1, 0x01, 0x00, 0x00, } func (m *IprpcReward) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/message_fund_iprpc_test.go b/x/rewards/types/message_fund_iprpc_test.go index 24a196edf4..8701bc245e 100644 --- a/x/rewards/types/message_fund_iprpc_test.go +++ b/x/rewards/types/message_fund_iprpc_test.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/types/message_set_iprpc_data_test.go b/x/rewards/types/message_set_iprpc_data_test.go index 46fd398a80..a723accffb 100644 --- a/x/rewards/types/message_set_iprpc_data_test.go +++ b/x/rewards/types/message_set_iprpc_data_test.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/sample" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/testutil/sample" + commontypes "github.com/lavanet/lava/v4/utils/common/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/types/params.pb.go b/x/rewards/types/params.pb.go index 6d245a526a..1e53f187a4 100644 --- a/x/rewards/types/params.pb.go +++ b/x/rewards/types/params.pb.go @@ -80,34 +80,34 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/params.proto", fileDescriptor_12687c5fbcde5c39) } var fileDescriptor_12687c5fbcde5c39 = []byte{ - // 421 bytes of a gzipped FileDescriptorProto + // 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, 0xd8, 0x6e, 0x4b, 0xdc, 0x58, 0x68, 0xb3, 0x41, 0x2b, 0x0b, 0x6f, 0x0e, 0x70, 0x17, + 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, 0x51, 0x0e, 0x0d, 0x94, 0x4c, 0x05, 0xdd, + 0xce, 0xe1, 0xcb, 0xc7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xf2, 0xbd, 0x5d, 0xb3, 0x5d, 0xac, 0xbb, 0xce, 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, } 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 270c6a3ab1..f60ebd819b 100644 --- a/x/rewards/types/query.pb.go +++ b/x/rewards/types/query.pb.go @@ -764,71 +764,71 @@ var fileDescriptor_15bce9a904340007 = []byte{ // 1069 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6f, 0xdc, 0x44, 0x14, 0x8e, 0x9b, 0xdf, 0x93, 0xfe, 0x80, 0x49, 0xa4, 0x6e, 0x9c, 0x74, 0x9b, 0xba, 0x81, 0x6e, - 0x23, 0xc5, 0x4e, 0x52, 0xa9, 0x20, 0xaa, 0x42, 0xb5, 0x29, 0xa0, 0x95, 0x8a, 0x94, 0x3a, 0x91, - 0x90, 0xb8, 0x98, 0x59, 0x7b, 0x76, 0x77, 0x14, 0xaf, 0xc7, 0xf1, 0xcc, 0x26, 0x8d, 0xaa, 0x08, - 0x09, 0xc4, 0x81, 0x1b, 0x12, 0x12, 0xe2, 0xca, 0x81, 0x0b, 0x27, 0xfe, 0x01, 0xee, 0x3d, 0x56, - 0xe2, 0xc2, 0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d, 0x77, 0x16, 0xd0, 0x3c, 0x24, 0xdd, 0xee, 0xf0, + 0x83, 0x86, 0x9a, 0xd2, 0x47, 0x44, 0x92, 0xbc, 0xe2, 0x37, 0x16, 0xb2, 0x8b, 0x76, 0xfb, 0x9d, + 0x98, 0xea, 0xb2, 0x24, 0x08, 0xb9, 0x90, 0xc3, 0x96, 0x9d, 0xec, 0xb2, 0x64, 0x93, 0x0b, 0x89, + 0x3d, 0x34, 0x0b, 0x97, 0x22, 0x10, 0xbd, 0xa6, 0x08, 0x33, 0x96, 0xc2, 0x4d, 0x83, 0x79, 0x9a, + 0xf6, 0x31, 0x6c, 0x6d, 0x0f, 0xee, 0x38, 0x3b, 0x68, 0x41, 0x53, 0x49, 0x69, 0xb8, 0x93, 0x91, + 0x70, 0x97, 0x46, 0xaa, 0xbf, 0x86, 0x2a, 0x9e, 0x47, 0x53, 0x61, 0x87, 0xb0, 0x24, 0x60, 0x91, + 0x99, 0xd5, 0x49, 0xf8, 0x6e, 0x44, 0xd8, 0x46, 0x53, 0x69, 0xc6, 0xf7, 0x59, 0x44, 0x33, 0x68, + 0xf7, 0xb4, 0xdf, 0xff, 0x76, 0x3e, 0x47, 0x8b, 0xc5, 0x59, 0x8d, 0xc4, 0x87, 0x68, 0x8c, 0x25, + 0x2d, 0x6e, 0x66, 0xed, 0xcd, 0xe2, 0x59, 0xab, 0x13, 0x41, 0xb7, 0xc8, 0xe1, 0xa7, 0x4c, 0x76, + 0x1a, 0x49, 0x44, 0x9f, 0x1a, 0xad, 0x10, 0xe9, 0x7c, 0x8c, 0xee, 0x42, 0x05, 0x38, 0xbe, 0x2d, + 0x53, 0x57, 0x77, 0xef, 0x43, 0x3d, 0x42, 0x8c, 0x27, 0xb9, 0x8a, 0x41, 0xaa, 0xd6, 0x19, 0xaa, + 0x7b, 0x68, 0x65, 0x98, 0x44, 0x86, 0xf8, 0x26, 0x42, 0x22, 0xa5, 0x61, 0xd0, 0xea, 0x25, 0xd1, + 0x2b, 0xae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, 0xbe, 0xf5, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x09, 0x12, 0x3f, 0xa3, 0x6c, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/rewards/types/tx.pb.go b/x/rewards/types/tx.pb.go index f2d1fa2370..d3d4236e3c 100644 --- a/x/rewards/types/tx.pb.go +++ b/x/rewards/types/tx.pb.go @@ -241,37 +241,37 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/tx.proto", fileDescriptor_6a4c66e189226d78) } var fileDescriptor_6a4c66e189226d78 = []byte{ - // 478 bytes of a gzipped FileDescriptorProto + // 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, 0xbb, 0xed, 0xb8, 0x0d, 0x24, 0x0e, 0xbd, 0x64, 0x37, 0x38, 0x4c, 0x4e, 0x62, - 0x65, 0x16, 0xc4, 0x8e, 0xf2, 0x9c, 0xb2, 0x7d, 0x05, 0x4e, 0x7c, 0x0e, 0x4e, 0x7c, 0x09, 0xa4, - 0x1e, 0x77, 0x44, 0x1c, 0x00, 0xb5, 0x07, 0xbe, 0x06, 0xb2, 0x93, 0xb4, 0x5d, 0xc5, 0x9f, 0x5d, - 0xf2, 0xfe, 0xfc, 0x5e, 0xde, 0xfb, 0xfd, 0x9e, 0x6d, 0xf4, 0xf4, 0x1d, 0x9b, 0x32, 0xc9, 0x35, - 0x35, 0x96, 0x16, 0xfc, 0x3d, 0x2b, 0x12, 0xa0, 0xfa, 0x92, 0xe4, 0x85, 0xd2, 0x0a, 0xf7, 0x6b, - 0x98, 0x18, 0x4b, 0x6a, 0xd8, 0x7b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db, + 0xbb, 0x51, 0x59, 0x33, 0x0d, 0xbf, 0x41, 0xdd, 0xd5, 0x7a, 0x83, 0xbf, 0xfe, 0xbb, 0xac, 0xf1, + 0xc6, 0xff, 0xaf, 0x69, 0x9a, 0x1f, 0x9d, 0xcc, 0xe6, 0xbe, 0x73, 0x35, 0xf7, 0x9d, 0x9f, 0x73, + 0xdf, 0xf9, 0xb8, 0xf0, 0x5b, 0x57, 0x0b, 0xbf, 0xf5, 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, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/spec/ante/ante.go b/x/spec/ante/ante.go index 2caf241dd6..9ed7b26b7b 100644 --- a/x/spec/ante/ante.go +++ b/x/spec/ante/ante.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/gogoproto/proto" - "github.com/lavanet/lava/v3/x/spec/keeper" + "github.com/lavanet/lava/v4/x/spec/keeper" "google.golang.org/protobuf/reflect/protoreflect" ) diff --git a/x/spec/ante/ante_test.go b/x/spec/ante/ante_test.go index 1cbc463c9a..bc90cce63c 100644 --- a/x/spec/ante/ante_test.go +++ b/x/spec/ante/ante_test.go @@ -12,12 +12,12 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/gogoproto/proto" - "github.com/lavanet/lava/v3/app" - specutils "github.com/lavanet/lava/v3/utils/keeper" - plantypes "github.com/lavanet/lava/v3/x/plans/types" - "github.com/lavanet/lava/v3/x/spec/ante" - spectypes "github.com/lavanet/lava/v3/x/spec/types" - subsciptiontypes "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/app" + specutils "github.com/lavanet/lava/v4/utils/keeper" + plantypes "github.com/lavanet/lava/v4/x/plans/types" + "github.com/lavanet/lava/v4/x/spec/ante" + spectypes "github.com/lavanet/lava/v4/x/spec/types" + subsciptiontypes "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/client/cli/query.go b/x/spec/client/cli/query.go index cffa9657eb..444102e8cf 100644 --- a/x/spec/client/cli/query.go +++ b/x/spec/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/spec/client/cli/query_params.go b/x/spec/client/cli/query_params.go index f8d0dd5634..8e8b048166 100644 --- a/x/spec/client/cli/query_params.go +++ b/x/spec/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_show_all_chains.go b/x/spec/client/cli/query_show_all_chains.go index ae09657e9e..6bab361ce9 100644 --- a/x/spec/client/cli/query_show_all_chains.go +++ b/x/spec/client/cli/query_show_all_chains.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_show_chain_info.go b/x/spec/client/cli/query_show_chain_info.go index c3b48968c9..26abbe6e01 100644 --- a/x/spec/client/cli/query_show_chain_info.go +++ b/x/spec/client/cli/query_show_chain_info.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_spec.go b/x/spec/client/cli/query_spec.go index 0e5a4cf731..92abddc9a7 100644 --- a/x/spec/client/cli/query_spec.go +++ b/x/spec/client/cli/query_spec.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_spec_test.go b/x/spec/client/cli/query_spec_test.go index 28e707db1c..cf648aba25 100644 --- a/x/spec/client/cli/query_spec_test.go +++ b/x/spec/client/cli/query_spec_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/v3/testutil/network" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/spec/client/cli" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/network" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/spec/client/cli" + "github.com/lavanet/lava/v4/x/spec/types" ) // Prevent strconv unused error diff --git a/x/spec/client/cli/tx.go b/x/spec/client/cli/tx.go index f19d318330..635f41a7e9 100644 --- a/x/spec/client/cli/tx.go +++ b/x/spec/client/cli/tx.go @@ -14,9 +14,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - utilslib "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/spec/client/utils" - "github.com/lavanet/lava/v3/x/spec/types" + utilslib "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/spec/client/utils" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/spec/client/proposal_handler.go b/x/spec/client/proposal_handler.go index 13d8a3bf49..db78062038 100644 --- a/x/spec/client/proposal_handler.go +++ b/x/spec/client/proposal_handler.go @@ -2,7 +2,7 @@ package client import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/lavanet/lava/v3/x/spec/client/cli" + "github.com/lavanet/lava/v4/x/spec/client/cli" ) // SpecAddProposalHandler is the param change proposal handler. diff --git a/x/spec/client/utils/utils.go b/x/spec/client/utils/utils.go index 359092287d..10e676a950 100755 --- a/x/spec/client/utils/utils.go +++ b/x/spec/client/utils/utils.go @@ -10,9 +10,9 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/spec/types" ) type ( diff --git a/x/spec/genesis.go b/x/spec/genesis.go index 8e83b04b55..e493be1ea9 100644 --- a/x/spec/genesis.go +++ b/x/spec/genesis.go @@ -2,8 +2,8 @@ package spec import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/spec/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/keeper" + "github.com/lavanet/lava/v4/x/spec/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/spec/genesis_test.go b/x/spec/genesis_test.go index 95b37a99eb..2c13a2403e 100644 --- a/x/spec/genesis_test.go +++ b/x/spec/genesis_test.go @@ -6,10 +6,10 @@ import ( types2 "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/gogoproto/proto" - "github.com/lavanet/lava/v3/testutil/nullify" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/x/spec" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/nullify" + specutils "github.com/lavanet/lava/v4/utils/keeper" + "github.com/lavanet/lava/v4/x/spec" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/handler.go b/x/spec/handler.go index 13f8c69b72..71a327bbcd 100644 --- a/x/spec/handler.go +++ b/x/spec/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/spec/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/keeper" + "github.com/lavanet/lava/v4/x/spec/types" ) // NewHandler ... diff --git a/x/spec/keeper/grpc_query.go b/x/spec/keeper/grpc_query.go index 329a3e21e6..cffbdc0b1f 100644 --- a/x/spec/keeper/grpc_query.go +++ b/x/spec/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/spec/keeper/grpc_query_params.go b/x/spec/keeper/grpc_query_params.go index 79018aeab0..40b56f9479 100644 --- a/x/spec/keeper/grpc_query_params.go +++ b/x/spec/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_params_test.go b/x/spec/keeper/grpc_query_params_test.go index 33a370aa46..693334f54b 100644 --- a/x/spec/keeper/grpc_query_params_test.go +++ b/x/spec/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + specutils "github.com/lavanet/lava/v4/utils/keeper" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/keeper/grpc_query_show_all_chains.go b/x/spec/keeper/grpc_query_show_all_chains.go index ba3f4df556..07d420e113 100644 --- a/x/spec/keeper/grpc_query_show_all_chains.go +++ b/x/spec/keeper/grpc_query_show_all_chains.go @@ -5,8 +5,8 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_show_chain_info.go b/x/spec/keeper/grpc_query_show_chain_info.go index df70b6dafc..683f719a3f 100644 --- a/x/spec/keeper/grpc_query_show_chain_info.go +++ b/x/spec/keeper/grpc_query_show_chain_info.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_spec.go b/x/spec/keeper/grpc_query_spec.go index 32bcc57bb5..4d72f0295a 100644 --- a/x/spec/keeper/grpc_query_spec.go +++ b/x/spec/keeper/grpc_query_spec.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_spec_test.go b/x/spec/keeper/grpc_query_spec_test.go index 94b4e2386c..7df8aadefe 100644 --- a/x/spec/keeper/grpc_query_spec_test.go +++ b/x/spec/keeper/grpc_query_spec_test.go @@ -10,9 +10,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/v3/testutil/nullify" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/nullify" + specutils "github.com/lavanet/lava/v4/utils/keeper" + "github.com/lavanet/lava/v4/x/spec/types" ) // Prevent strconv unused error diff --git a/x/spec/keeper/keeper.go b/x/spec/keeper/keeper.go index 8964f7037c..86efa041f9 100644 --- a/x/spec/keeper/keeper.go +++ b/x/spec/keeper/keeper.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" ) type ( diff --git a/x/spec/keeper/migrations.go b/x/spec/keeper/migrations.go index 20a48ba86d..f39fdc02f5 100644 --- a/x/spec/keeper/migrations.go +++ b/x/spec/keeper/migrations.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/spec/types" - typesv1 "github.com/lavanet/lava/v3/x/spec/types/migrations/v1" + "github.com/lavanet/lava/v4/x/spec/types" + typesv1 "github.com/lavanet/lava/v4/x/spec/types/migrations/v1" ) type Migrator struct { diff --git a/x/spec/keeper/msg_server.go b/x/spec/keeper/msg_server.go index f5156769cf..3975d02f4e 100644 --- a/x/spec/keeper/msg_server.go +++ b/x/spec/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" ) type msgServer struct { diff --git a/x/spec/keeper/msg_server_test.go b/x/spec/keeper/msg_server_test.go index 7b9aaa3b0d..a75a189906 100644 --- a/x/spec/keeper/msg_server_test.go +++ b/x/spec/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/x/spec/keeper" - "github.com/lavanet/lava/v3/x/spec/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/spec/keeper/params.go b/x/spec/keeper/params.go index f3309cdbb6..a975a6a12e 100644 --- a/x/spec/keeper/params.go +++ b/x/spec/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" ) // GetParams get all parameters as types.Params diff --git a/x/spec/keeper/params_test.go b/x/spec/keeper/params_test.go index 48d2a3b5b7..b621e40a5c 100644 --- a/x/spec/keeper/params_test.go +++ b/x/spec/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - specutils "github.com/lavanet/lava/v3/utils/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + specutils "github.com/lavanet/lava/v4/utils/keeper" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/keeper/spec.go b/x/spec/keeper/spec.go index b52e77fe1a..fade6be0ef 100644 --- a/x/spec/keeper/spec.go +++ b/x/spec/keeper/spec.go @@ -9,10 +9,10 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/spec/types" ) // SetSpec set a specific Spec in the store from its index diff --git a/x/spec/keeper/spec_test.go b/x/spec/keeper/spec_test.go index eeb4304e08..1fda3f3e03 100644 --- a/x/spec/keeper/spec_test.go +++ b/x/spec/keeper/spec_test.go @@ -9,13 +9,13 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/cmd/lavad/cmd" - "github.com/lavanet/lava/v3/testutil/common" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/spec/client/utils" - "github.com/lavanet/lava/v3/x/spec/keeper" - "github.com/lavanet/lava/v3/x/spec/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" + "github.com/lavanet/lava/v4/x/spec/client/utils" + "github.com/lavanet/lava/v4/x/spec/keeper" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/module.go b/x/spec/module.go index a95e78642f..7fbe7731ce 100644 --- a/x/spec/module.go +++ b/x/spec/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/spec/client/cli" - "github.com/lavanet/lava/v3/x/spec/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/client/cli" + "github.com/lavanet/lava/v4/x/spec/keeper" + "github.com/lavanet/lava/v4/x/spec/types" ) var ( diff --git a/x/spec/module_simulation.go b/x/spec/module_simulation.go index cfedbe289f..63eb972e93 100644 --- a/x/spec/module_simulation.go +++ b/x/spec/module_simulation.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - specsimulation "github.com/lavanet/lava/v3/x/spec/simulation" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/testutil/sample" + specsimulation "github.com/lavanet/lava/v4/x/spec/simulation" + "github.com/lavanet/lava/v4/x/spec/types" ) // avoid unused import issue diff --git a/x/spec/proposal_handler.go b/x/spec/proposal_handler.go index f2632775b1..6038c6ff09 100644 --- a/x/spec/proposal_handler.go +++ b/x/spec/proposal_handler.go @@ -12,10 +12,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramkeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - "github.com/lavanet/lava/v3/x/spec/keeper" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + "github.com/lavanet/lava/v4/x/spec/keeper" + "github.com/lavanet/lava/v4/x/spec/types" ) // overwriting the params handler so we can add events and callbacks on specific params diff --git a/x/spec/types/api_collection.pb.go b/x/spec/types/api_collection.pb.go index 2cb76295ff..045d219b8f 100644 --- a/x/spec/types/api_collection.pb.go +++ b/x/spec/types/api_collection.pb.go @@ -1111,105 +1111,105 @@ var fileDescriptor_c9f7567a181f534f = []byte{ // 1613 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6f, 0xdb, 0xc8, 0x15, 0x36, 0x25, 0xea, 0xd7, 0xb3, 0x24, 0x4f, 0x26, 0x6e, 0xaa, 0x4d, 0xb3, 0x96, 0xcb, 0xdd, - 0x76, 0x03, 0x2f, 0x6a, 0xa3, 0x0e, 0x0a, 0x14, 0x8b, 0x16, 0x2d, 0x25, 0xd1, 0x89, 0x12, 0x59, + 0x76, 0x03, 0x2f, 0x6a, 0xa3, 0x4e, 0x0b, 0x14, 0x8b, 0x16, 0x2d, 0x25, 0xd1, 0x89, 0x12, 0x59, 0x32, 0x46, 0xb4, 0x5b, 0xf7, 0x42, 0x8c, 0xa9, 0xb1, 0x3c, 0x58, 0x8a, 0x24, 0xc8, 0xa1, 0x1b, 0x9f, 0xfb, 0x0f, 0xf4, 0x50, 0xa0, 0xff, 0x42, 0x81, 0x05, 0x0a, 0xf4, 0xbf, 0xd8, 0xe3, 0xde, 0xda, 0x93, 0x51, 0x24, 0x87, 0x02, 0x39, 0xe6, 0x52, 0xf4, 0x50, 0xa0, 0x98, 0x21, 0xf5, 0x83, - 0x89, 0xe2, 0x62, 0xf7, 0x24, 0xcd, 0xf7, 0xbe, 0xf9, 0xe6, 0xcd, 0x7b, 0x33, 0xdf, 0x48, 0xf0, - 0x63, 0x8f, 0x5e, 0x53, 0x9f, 0x89, 0x03, 0xf9, 0x79, 0x10, 0x87, 0xcc, 0x3d, 0xa0, 0x21, 0x77, - 0xdc, 0xc0, 0xf3, 0x98, 0x2b, 0x78, 0xe0, 0xef, 0x87, 0x51, 0x20, 0x02, 0x7c, 0x2f, 0xe3, 0xed, - 0xcb, 0xcf, 0x7d, 0xc9, 0x7b, 0xb8, 0x3d, 0x0d, 0xa6, 0x81, 0x8a, 0x1e, 0xc8, 0x6f, 0x29, 0xd1, - 0xf8, 0x6f,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 0x56, 0xfc, 0x16, 0x05, 0x6b, 0xa4, + 0x73, 0xe7, 0x15, 0xfb, 0x08, 0xaa, 0xd2, 0x1d, 0xd4, 0x61, 0x51, 0x57, 0x8e, 0x54, 0x68, 0xc8, + 0x87, 0xf2, 0xbc, 0xac, 0x54, 0xab, 0xf4, 0xff, 0x55, 0xeb, 0x2f, 0x1a, 0x6c, 0xae, 0x64, 0x20, + 0xdb, 0x93, 0x86, 0x1c, 0x1a, 0xc9, 0x42, 0x15, 0xa5, 0x87, 0xa7, 0x88, 0x19, 0x4d, 0xf1, 0x2f, + 0xe5, 0x39, 0x57, 0x61, 0xb9, 0xe7, 0xec, 0xa2, 0xae, 0xdb, 0xd5, 0x89, 0x49, 0xc6, 0x16, 0x71, 0x64, 0x3d, 0x49, 0xa6, 0x78, 0x94, 0xf8, 0xae, 0x3c, 0xe1, 0x13, 0x76, 0x49, 0x65, 0x69, 0xd2, 0x37, 0x40, 0x79, 0x0f, 0xa9, 0x67, 0x60, 0xfa, 0x04, 0x3c, 0x84, 0x2a, 0xf3, 0xdd, 0x60, 0x22, - 0x0b, 0x97, 0xee, 0x78, 0x31, 0x36, 0xfe, 0xac, 0x41, 0x23, 0xb7, 0xa3, 0x45, 0xca, 0xa9, 0x35, - 0x66, 0xcf, 0x8e, 0x42, 0x94, 0xc9, 0x6d, 0x43, 0x69, 0xf5, 0xb5, 0x49, 0x07, 0xf8, 0x97, 0xf3, + 0x0b, 0x97, 0xee, 0x78, 0x31, 0x36, 0xfe, 0xa4, 0x41, 0x23, 0xb7, 0xa3, 0x45, 0xca, 0xa9, 0x35, + 0x66, 0xcf, 0x8e, 0x42, 0x94, 0xc9, 0x6d, 0x43, 0x69, 0xf5, 0xb5, 0x49, 0x07, 0xf8, 0x17, 0xf3, 0x49, 0x0b, 0x03, 0xbc, 0x73, 0x1f, 0xf6, 0xf9, 0x89, 0x95, 0x89, 0x2a, 0x77, 0xc0, 0xd9, 0x8f, 0x83, 0x34, 0x3b, 0xf5, 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0x8e, 0xf6, 0x8f, + 0x57, 0x3b, 0xda, 0x1f, 0x5e, 0xef, 0x6c, 0x7c, 0xf3, 0x7a, 0x67, 0xe3, 0xef, 0xaf, 0x77, 0x36, + 0x7e, 0xfb, 0xd9, 0x94, 0x8b, 0xab, 0xe4, 0x62, 0xdf, 0x0d, 0x66, 0x07, 0xb9, 0x3f, 0x65, 0xd7, + 0x3f, 0x39, 0x78, 0x99, 0xfe, 0x33, 0x93, 0x77, 0x2a, 0xbe, 0x28, 0xab, 0x3f, 0x5a, 0x4f, 0xfe, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x8c, 0xdd, 0xfc, 0xbb, 0x0d, 0x00, 0x00, } func (this *ApiCollection) Equal(that interface{}) bool { diff --git a/x/spec/types/errors.go b/x/spec/types/errors.go index eb83388e72..21f82f9d6e 100644 --- a/x/spec/types/errors.go +++ b/x/spec/types/errors.go @@ -4,7 +4,7 @@ package types import ( sdkerrors "cosmossdk.io/errors" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) // x/spec module sentinel errors diff --git a/x/spec/types/genesis.pb.go b/x/spec/types/genesis.pb.go index b81b6b6b42..d07441a65e 100644 --- a/x/spec/types/genesis.pb.go +++ b/x/spec/types/genesis.pb.go @@ -105,9 +105,9 @@ var fileDescriptor_012a82932c0e5e6a = []byte{ 0xe7, 0xfc, 0xd2, 0xbc, 0x12, 0x09, 0x66, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x84, 0x80, 0x93, 0xe3, 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, 0xa9, 0xa7, 0x67, 0x96, 0x64, 0x94, - 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0xf8, 0xb2, 0xcc, 0x58, 0xbf, 0x02, 0xe2, 0xd5, 0x92, - 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x67, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe5, - 0x12, 0xd0, 0xaa, 0x76, 0x01, 0x00, 0x00, + 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0xf8, 0xb2, 0xcc, 0x44, 0xbf, 0x02, 0xe2, 0xd5, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x67, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa5, + 0x2c, 0x09, 0xcf, 0x76, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/spec/types/genesis_test.go b/x/spec/types/genesis_test.go index 5305f637a8..911a5b6bbc 100644 --- a/x/spec/types/genesis_test.go +++ b/x/spec/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/spec/types" + "github.com/lavanet/lava/v4/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/types/params.pb.go b/x/spec/types/params.pb.go index d412d0e859..9df3b2894f 100644 --- a/x/spec/types/params.pb.go +++ b/x/spec/types/params.pb.go @@ -97,8 +97,8 @@ var fileDescriptor_ad2f67d2fb6b4afa = []byte{ 0x65, 0xc6, 0x02, 0x79, 0x06, 0x2f, 0x16, 0x0e, 0x46, 0x01, 0x26, 0x27, 0xc7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, - 0xce, 0xcf, 0xd5, 0x47, 0x09, 0x9d, 0x32, 0x63, 0xfd, 0x0a, 0x48, 0x10, 0x95, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0x7d, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xd1, 0xd4, 0x0f, + 0xce, 0xcf, 0xd5, 0x47, 0x09, 0x9d, 0x32, 0x13, 0xfd, 0x0a, 0x48, 0x10, 0x95, 0x54, 0x16, 0xa4, + 0x16, 0x27, 0xb1, 0x81, 0x7d, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xef, 0x0d, 0x6a, 0x44, 0x01, 0x00, 0x00, } diff --git a/x/spec/types/query.pb.go b/x/spec/types/query.pb.go index 04c741ca09..3fa12f818d 100644 --- a/x/spec/types/query.pb.go +++ b/x/spec/types/query.pb.go @@ -636,60 +636,60 @@ func init() { proto.RegisterFile("lavanet/lava/spec/query.proto", fileDescriptor var fileDescriptor_fac9d1cad3c30379 = []byte{ // 857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x4b, 0x33, 0x47, - 0x1c, 0xc7, 0xb3, 0x49, 0x4c, 0x9e, 0x4c, 0x11, 0xda, 0x79, 0x02, 0x26, 0x1b, 0x5d, 0x75, 0x7d, - 0x89, 0x95, 0xba, 0x53, 0x15, 0x5a, 0x7a, 0x8c, 0x96, 0x8a, 0xa5, 0x88, 0x5d, 0x6f, 0x42, 0x09, - 0x93, 0x75, 0x4c, 0x16, 0x36, 0x3b, 0x6b, 0x76, 0x62, 0x6a, 0xc5, 0x8b, 0xb7, 0xde, 0x4a, 0x7b, - 0xe9, 0xb9, 0xf4, 0x8f, 0xf1, 0x28, 0xf4, 0xe2, 0xa9, 0x14, 0xd3, 0x3f, 0xa4, 0xcc, 0x4b, 0x92, - 0x5d, 0xb3, 0x1b, 0xa5, 0x3c, 0x17, 0xd7, 0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xc6, 0x83, 0xf7, 0x6f, 0xc2, 0xae, 0x50, 0xaf, 0xc3, 0xcd, 0x14, 0xf5, 0x66, 0x0f, 0x0f, + 0x22, 0x46, 0xdc, 0x6b, 0x00, 0x28, 0x27, 0x66, 0xe2, 0xfc, 0x5f, 0x33, 0xd6, 0x05, 0xce, 0x32, + 0xac, 0xcd, 0xc0, 0x81, 0xbf, 0x6b, 0x60, 0x3e, 0x36, 0xc3, 0xe0, 0x27, 0x69, 0xfd, 0x93, 0x26, + 0xaf, 0xbe, 0xfb, 0xc6, 0x6c, 0xc5, 0xb4, 0x23, 0x98, 0x36, 0xa0, 0x99, 0xc4, 0xd4, 0xa1, 0x83, + 0x26, 0xf6, 0xbc, 0xa6, 0x23, 0x41, 0xfe, 0x54, 0x68, 0xe3, 0xa1, 0x30, 0x1b, 0xed, 0xe5, 0x70, + 0x9b, 0x8d, 0x36, 0x35, 0x69, 0xcc, 0x2f, 0x04, 0xda, 0xa7, 0xd0, 0x4a, 0x43, 0x13, 0x58, 0x4d, + 0xd7, 0xbf, 0xa4, 0xe8, 0x76, 0x3c, 0x24, 0xef, 0x0e, 0x1a, 0x0f, 0xcf, 0x86, 0xf6, 0xf8, 0x6c, + 0x68, 0xff, 0x3c, 0x1b, 0xda, 0x2f, 0x43, 0x23, 0xf3, 0x38, 0x34, 0x32, 0x4f, 0x43, 0x23, 0x73, + 0x5e, 0x6f, 0xbb, 0xac, 0xd3, 0x6f, 0x59, 0x0e, 0xed, 0xc6, 0x7b, 0x5e, 0x7f, 0x8e, 0x7e, 0x94, + 0x8d, 0xd9, 0x4d, 0x40, 0xc2, 0x56, 0x41, 0xfc, 0xe3, 0xf2, 0xd9, 0x7f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xd9, 0x57, 0xaa, 0x55, 0x8a, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/spec/types/spec.go b/x/spec/types/spec.go index f41ee8fda0..b1b99ff00b 100644 --- a/x/spec/types/spec.go +++ b/x/spec/types/spec.go @@ -10,8 +10,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) const ( diff --git a/x/spec/types/spec.pb.go b/x/spec/types/spec.pb.go index 304a9a5ea7..fd3de514df 100644 --- a/x/spec/types/spec.pb.go +++ b/x/spec/types/spec.pb.go @@ -232,51 +232,51 @@ func init() { proto.RegisterFile("lavanet/lava/spec/spec.proto", fileDescriptor_ var fileDescriptor_789140b95c48dfce = []byte{ // 719 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcf, 0x52, 0xe3, 0x36, - 0x18, 0x8f, 0x1b, 0x6f, 0x12, 0x94, 0x6e, 0xf0, 0xaa, 0x59, 0x46, 0x30, 0x5b, 0xaf, 0xbb, 0x07, - 0xea, 0x76, 0x5a, 0x7b, 0x80, 0x4b, 0x6f, 0x1d, 0x02, 0x64, 0x0a, 0xd3, 0x4e, 0xa9, 0xa1, 0x97, - 0x5e, 0x3c, 0xb2, 0x2c, 0x12, 0x0d, 0xb6, 0xe4, 0x5a, 0x22, 0x25, 0x7d, 0x8a, 0x3e, 0x46, 0x1f, - 0x85, 0x23, 0x47, 0xa6, 0x07, 0xa6, 0x13, 0x5e, 0xa4, 0x23, 0xd9, 0xa6, 0xce, 0xb0, 0x97, 0xc8, - 0x9f, 0x7e, 0x7f, 0x3e, 0x49, 0xf9, 0x49, 0xe0, 0x5d, 0x86, 0x17, 0x98, 0x53, 0x15, 0xea, 0x31, - 0x94, 0x05, 0x25, 0xe6, 0x27, 0x28, 0x4a, 0xa1, 0x04, 0x7c, 0x53, 0xa3, 0x81, 0x1e, 0x03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0a, 0xc3, 0xef, 0xc1, 0x3b, 0x43, 0x90, 0x31, 0xe3, 0x8d, 0x01, 0xd6, - 0xa7, 0x18, 0x17, 0xa5, 0x10, 0x57, 0x68, 0x60, 0x4c, 0xb6, 0x2b, 0xce, 0x29, 0x9f, 0xb6, 0x18, - 0xe7, 0x9a, 0x00, 0xbf, 0x01, 0x10, 0x2f, 0x68, 0x89, 0x67, 0x34, 0xae, 0x96, 0xa4, 0x58, 0x4e, - 0xd1, 0x86, 0x67, 0xf9, 0xdd, 0xc8, 0xa9, 0x91, 0x89, 0x06, 0x2e, 0x59, 0x4e, 0xe1, 0x21, 0x70, - 0x71, 0x96, 0x89, 0x3f, 0x68, 0x5a, 0xb3, 0x33, 0x3c, 0x33, 0x6b, 0xff, 0x5d, 0xc8, 0x58, 0x2e, - 0x39, 0x41, 0xc0, 0x28, 0xb7, 0x6b, 0x96, 0x51, 0xfe, 0x88, 0x67, 0x53, 0x51, 0xfe, 0x22, 0xe4, - 0xc5, 0x92, 0x13, 0xdd, 0xb0, 0x91, 0x4a, 0x15, 0xdf, 0x14, 0x29, 0x56, 0x34, 0x45, 0x43, 0xcf, - 0xf2, 0xed, 0xc8, 0x49, 0x2a, 0xbe, 0x54, 0xbf, 0x56, 0xf3, 0xf0, 0x27, 0x00, 0x73, 0xc6, 0x63, - 0xa9, 0xf0, 0x35, 0xd5, 0x5b, 0x5a, 0xb0, 0x94, 0x96, 0xe8, 0x53, 0xcf, 0xf2, 0x87, 0xfb, 0xdb, - 0x41, 0x15, 0x91, 0x40, 0x47, 0x24, 0xa8, 0x23, 0x12, 0x1c, 0x09, 0xc6, 0x27, 0xf6, 0xdd, 0xe3, - 0xfb, 0x4e, 0xe4, 0xe4, 0x8c, 0x5f, 0x68, 0xe5, 0x79, 0x2d, 0x84, 0x3f, 0x83, 0xcd, 0xc6, 0x44, - 0xc6, 0x6a, 0x59, 0x50, 0x89, 0x46, 0x9e, 0xe5, 0x8f, 0xf6, 0x77, 0x83, 0x17, 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, 0x2b, 0xd7, 0xfa, 0x67, 0xe5, + 0x5a, 0x7f, 0x3e, 0xb9, 0x9d, 0xfb, 0x27, 0xb7, 0xf3, 0xf0, 0xe4, 0x76, 0x7e, 0xfd, 0xbc, 0xb5, + 0x8f, 0xb5, 0xb7, 0x64, 0xf1, 0x4d, 0x78, 0x5b, 0x3d, 0x28, 0x66, 0x33, 0x49, 0xcf, 0x3c, 0x14, + 0x07, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x42, 0xf7, 0x5f, 0x91, 0xb9, 0x04, 0x00, 0x00, } func (this *Spec) Equal(that interface{}) bool { diff --git a/x/spec/types/spec_add_proposal.pb.go b/x/spec/types/spec_add_proposal.pb.go index c098f5683e..aa12a03aa9 100644 --- a/x/spec/types/spec_add_proposal.pb.go +++ b/x/spec/types/spec_add_proposal.pb.go @@ -84,9 +84,9 @@ var fileDescriptor_90ccba27a5c90c8a = []byte{ 0xad, 0x15, 0x47, 0xc7, 0x02, 0x79, 0x86, 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x5c, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf5, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0x1f, 0x95, 0x19, 0xeb, 0x57, 0x40, 0xbc, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0x1f, 0x95, 0x99, 0xe8, 0x57, 0x40, 0xbc, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0x98, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0xd5, 0xd1, 0x5c, 0x6a, 0x4c, 0x01, 0x00, 0x00, + 0x95, 0xef, 0x85, 0x0f, 0x4c, 0x01, 0x00, 0x00, } func (this *SpecAddProposal) Equal(that interface{}) bool { diff --git a/x/spec/types/tx.pb.go b/x/spec/types/tx.pb.go index e20b23012e..ae8b731bc8 100644 --- a/x/spec/types/tx.pb.go +++ b/x/spec/types/tx.pb.go @@ -33,8 +33,8 @@ var fileDescriptor_c6aee532b425dbb5 = []byte{ 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0xa3, 0xcb, - 0x8c, 0xf5, 0x2b, 0xa0, 0xe6, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xed, 0x30, 0x06, 0x04, - 0x00, 0x00, 0xff, 0xff, 0x93, 0xa4, 0x62, 0x61, 0x81, 0x00, 0x00, 0x00, + 0x4c, 0xf4, 0x2b, 0xa0, 0xe6, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xed, 0x30, 0x06, 0x04, + 0x00, 0x00, 0xff, 0xff, 0xd3, 0x9a, 0xbb, 0x04, 0x81, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/subscription/README.md b/x/subscription/README.md index 25c851908a..11796ec441 100644 --- a/x/subscription/README.md +++ b/x/subscription/README.md @@ -159,8 +159,15 @@ The subscription module supports the following queries: | `list` | subscription (string) | Shows all current subscriptions | | `list-projects` | none | Shows all the subscription's projects | | `next-to-month-expiry` | none | Shows the subscriptions with the closest month expiry | +| `tracked-cu-usage` | subscription (string) | Shows the monthly CU usage of a specific subscription by provider | +| `estimated-rewards` | provider (string), delegator/delegation_amount (optional, string/Coin) | Shows the estimated monthly rewards for a specific provider. Using the optional argument, the query can return the estimated rewards of a specific delegator or the estimated rewards a delegator will get for a specific delegation amount | +| `estimated-validator-rewards` | validator (string), delegator/delegation_amount (optional, string/Coin) | like the estimated-rewards query, but for validators | | `params` | none | Shows the parameters of the module | +Note, the `Coin` type is from Cosmos-SDK (`cosmos.base.v1beta1.Coin`). From the CLI, use `100ulava` to assign a `Coin` argument. + +Also, note that the `estimated-provider-rewards` query might return a non-zero "recommended_block". Part of the calculated rewards are the IPRPC rewards. These IPRPC rewards estimation might be misleading in the first 24H since it's dependent on CU count, so the user should run the query again using the `--height` flag with the recommended_block. + ## Transactions All the transactions below require setting the `--from` flag and gas related flags. diff --git a/x/subscription/client/cli/query.go b/x/subscription/client/cli/query.go index 56b9be3903..1c78247f2a 100644 --- a/x/subscription/client/cli/query.go +++ b/x/subscription/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) // GetQueryCmd returns the cli query commands for this module @@ -26,7 +26,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdCurrent()) - cmd.AddCommand(CmdEstimatedRewards()) + cmd.AddCommand(CmdEstimatedProviderRewards()) cmd.AddCommand(CmdEstimatedValidatorsRewards()) cmd.AddCommand(CmdTrackedCuUsage()) diff --git a/x/subscription/client/cli/query_current.go b/x/subscription/client/cli/query_current.go index 20565b23c9..dc3986bea9 100644 --- a/x/subscription/client/cli/query_current.go +++ b/x/subscription/client/cli/query_current.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_estimated_rewards.go b/x/subscription/client/cli/query_estimated_rewards.go index cd44154df0..1f82c3a345 100644 --- a/x/subscription/client/cli/query_estimated_rewards.go +++ b/x/subscription/client/cli/query_estimated_rewards.go @@ -3,25 +3,29 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) -func CmdEstimatedRewards() *cobra.Command { +func CmdEstimatedProviderRewards() *cobra.Command { cmd := &cobra.Command{ - Use: "estimated-rewards [provider] [chainid] {optional: amount/delegator}", - Short: "calculates the rewards estimation for a provider delegation", - Long: `Query to estimate the rewards a delegator will get for 1 month from the provider, if used without optional args the calculations will be for the provider. - optional args can be amount for new delegation or address for an existing one. - The estimation takes into account subscription rewards, bonus rewards and iprpc rewards, as well as the provider delegation limit, spec contribution and tax. - The query does not take into account the likes of addons, geolocation and the quality of the provider services. - args: - [provider] provider address. - [chain-id] provider chain id. - [amount/delegator] optional: delegation amount for the estimation Or delegator address for existing delegation. if not used the rewards will be calculated for the provider. + Use: "estimated-provider-rewards [provider] {optional: amount/delegator}", + Short: "Calculates estimated rewards for a provider delegation.", + Long: `Estimates the rewards a delegator will earn from a provider over one month. If no optional arguments are provided, the calculation is for the provider itself. + The estimation considers subscription rewards, bonus rewards, IPRPC rewards, provider delegation limits, spec contribution, and tax. + It does not factor in addons, geolocation, or provider service quality. + + The optional argument can either be: + - amount: The delegation amount for a new delegation + - delegator: The address of an existing delegator. `, - Args: cobra.RangeArgs(2, 3), + Example: ` The query can be used in 3 ways: + 1. estimated-provider-rewards : estimates the monthly reward of a provider. + 2. estimated-provider-rewards : estimates the monthly reward of a delegator from a specific provider. + 3. estimated-provider-rewards : estimates the monthly reward of a delegator that has a specific amount of delegation to a specific provider. + `, + Args: cobra.RangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -30,20 +34,22 @@ func CmdEstimatedRewards() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - req := types.QueryEstimatedRewardsRequest{} - req.Provider = args[0] - req.ChainId = args[1] + req := types.QueryEstimatedProviderRewardsRequest{} + req.Provider, err = utils.ParseCLIAddress(clientCtx, args[0]) + if err != nil { + return err + } - if len(args) == 3 { - address, err := utils.ParseCLIAddress(clientCtx, args[2]) + if len(args) == 2 { + address, err := utils.ParseCLIAddress(clientCtx, args[1]) if err != nil { - req.AmountDelegator = args[2] + req.AmountDelegator = args[1] } else { req.AmountDelegator = address } } - res, err := queryClient.EstimatedRewards(cmd.Context(), &req) + res, err := queryClient.EstimatedProviderRewards(cmd.Context(), &req) if err != nil { return err } diff --git a/x/subscription/client/cli/query_estimated_validators_rewards.go b/x/subscription/client/cli/query_estimated_validators_rewards.go index e522d32e14..c83a758d30 100644 --- a/x/subscription/client/cli/query_estimated_validators_rewards.go +++ b/x/subscription/client/cli/query_estimated_validators_rewards.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_list.go b/x/subscription/client/cli/query_list.go index ff1a335cea..3792a3a1c8 100644 --- a/x/subscription/client/cli/query_list.go +++ b/x/subscription/client/cli/query_list.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_list_projects.go b/x/subscription/client/cli/query_list_projects.go index 931448ea5f..962bf27871 100644 --- a/x/subscription/client/cli/query_list_projects.go +++ b/x/subscription/client/cli/query_list_projects.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_next_to_month_expiry.go b/x/subscription/client/cli/query_next_to_month_expiry.go index 1f2bfce8e2..32f71fee89 100644 --- a/x/subscription/client/cli/query_next_to_month_expiry.go +++ b/x/subscription/client/cli/query_next_to_month_expiry.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_params.go b/x/subscription/client/cli/query_params.go index 272e2e65aa..82da6a773c 100644 --- a/x/subscription/client/cli/query_params.go +++ b/x/subscription/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_tracked_cu_usage.go b/x/subscription/client/cli/query_tracked_cu_usage.go index 55a756006e..f2f114c440 100644 --- a/x/subscription/client/cli/query_tracked_cu_usage.go +++ b/x/subscription/client/cli/query_tracked_cu_usage.go @@ -3,7 +3,7 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx.go b/x/subscription/client/cli/tx.go index 7a5501090d..853c32b87f 100644 --- a/x/subscription/client/cli/tx.go +++ b/x/subscription/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/subscription/client/cli/tx_add_project.go b/x/subscription/client/cli/tx_add_project.go index cf42d7ae75..4687502260 100644 --- a/x/subscription/client/cli/tx_add_project.go +++ b/x/subscription/client/cli/tx_add_project.go @@ -6,11 +6,11 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/decoder" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/decoder" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx_auto_renewal.go b/x/subscription/client/cli/tx_auto_renewal.go index 6b6633c10d..8404be4e93 100644 --- a/x/subscription/client/cli/tx_auto_renewal.go +++ b/x/subscription/client/cli/tx_auto_renewal.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx_buy.go b/x/subscription/client/cli/tx_buy.go index 2f518ee611..ef89756cb8 100644 --- a/x/subscription/client/cli/tx_buy.go +++ b/x/subscription/client/cli/tx_buy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx_del_project.go b/x/subscription/client/cli/tx_del_project.go index 76ec6611cc..d1651dc52b 100644 --- a/x/subscription/client/cli/tx_del_project.go +++ b/x/subscription/client/cli/tx_del_project.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/genesis.go b/x/subscription/genesis.go index 8280be0897..4fcd829b7b 100644 --- a/x/subscription/genesis.go +++ b/x/subscription/genesis.go @@ -2,8 +2,8 @@ package subscription import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/subscription/genesis_test.go b/x/subscription/genesis_test.go index ade04231be..9e221ed69c 100644 --- a/x/subscription/genesis_test.go +++ b/x/subscription/genesis_test.go @@ -3,10 +3,10 @@ package subscription_test import ( "testing" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/testutil/nullify" - "github.com/lavanet/lava/v3/x/subscription" - "github.com/lavanet/lava/v3/x/subscription/types" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/testutil/nullify" + "github.com/lavanet/lava/v4/x/subscription" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/handler.go b/x/subscription/handler.go index f522a16f5c..71203e5475 100644 --- a/x/subscription/handler.go +++ b/x/subscription/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) // NewHandler ... diff --git a/x/subscription/keeper/adjustment.go b/x/subscription/keeper/adjustment.go index b939cf32ef..b2b32d27a9 100644 --- a/x/subscription/keeper/adjustment.go +++ b/x/subscription/keeper/adjustment.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" ) // SetAdjustment set a specific Adjustment in the store from its index diff --git a/x/subscription/keeper/adjustment_test.go b/x/subscription/keeper/adjustment_test.go index 8a1df55d9d..028efb1b1d 100644 --- a/x/subscription/keeper/adjustment_test.go +++ b/x/subscription/keeper/adjustment_test.go @@ -4,7 +4,7 @@ import ( "testing" "cosmossdk.io/math" - "github.com/lavanet/lava/v3/testutil/common" + "github.com/lavanet/lava/v4/testutil/common" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/cluster.go b/x/subscription/keeper/cluster.go index f4c5b126a4..5cb947d1f4 100644 --- a/x/subscription/keeper/cluster.go +++ b/x/subscription/keeper/cluster.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) func (k Keeper) GetAllClusters(ctx sdk.Context) []string { diff --git a/x/subscription/keeper/cluster_test.go b/x/subscription/keeper/cluster_test.go index 2d94b3a208..f7911bf801 100644 --- a/x/subscription/keeper/cluster_test.go +++ b/x/subscription/keeper/cluster_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/cu_tracker.go b/x/subscription/keeper/cu_tracker.go index 6426cffc5b..79817c614c 100644 --- a/x/subscription/keeper/cu_tracker.go +++ b/x/subscription/keeper/cu_tracker.go @@ -8,10 +8,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) const LIMIT_TOKEN_PER_CU = 100 @@ -87,7 +87,7 @@ func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, block uint64) ( _, provider, chainID := types.DecodeCuTrackerKey(key) cu, found, _ := k.GetTrackedCu(ctx, sub, provider, chainID, block) if !found { - utils.LavaFormatWarning("cannot remove cu tracker", legacyerrors.ErrKeyNotFound, + utils.LavaFormatWarning("cannot get cu tracker", legacyerrors.ErrKeyNotFound, utils.Attribute{Key: "sub", Value: sub}, utils.Attribute{Key: "provider", Value: provider}, utils.Attribute{Key: "chain_id", Value: chainID}, @@ -107,6 +107,36 @@ func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, block uint64) ( return trackedCuList, totalCuTracked } +func (k Keeper) GetSubTrackedCuInfoForProvider(ctx sdk.Context, sub string, provider string, block uint64) []*types.TrackedCuInfo { + keys := k.GetAllSubTrackedCuIndices(ctx, sub) + trackedCuList := []*types.TrackedCuInfo{} + + for _, key := range keys { + _, providerFromKey, chainID := types.DecodeCuTrackerKey(key) + if providerFromKey != provider { + continue + } + cu, found, _ := k.GetTrackedCu(ctx, sub, provider, chainID, block) + if !found { + utils.LavaFormatWarning("cannot get cu tracker", legacyerrors.ErrKeyNotFound, + utils.Attribute{Key: "sub", Value: sub}, + utils.Attribute{Key: "provider", Value: provider}, + utils.Attribute{Key: "chain_id", Value: chainID}, + utils.Attribute{Key: "block", Value: strconv.FormatUint(block, 10)}, + ) + continue + } + trackedCuList = append(trackedCuList, &types.TrackedCuInfo{ + Provider: provider, + TrackedCu: cu, + ChainID: chainID, + Block: block, + }) + } + + return trackedCuList +} + // remove only before the sub is deleted func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes []byte, cuTrackerTimerData []byte) { sub := string(cuTrackerTimerKeyBytes) @@ -195,7 +225,7 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes // Note: if the reward function doesn't reward the provider // because he was unstaked, we only print an error and not returning - _, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, provider, chainID, sdk.NewCoins(creditToSub), types.ModuleName, false, false, false) + providerReward, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, provider, chainID, sdk.NewCoins(creditToSub), types.ModuleName, false, false, false) if errors.Is(err, epochstoragetypes.ErrProviderNotStaked) || errors.Is(err, epochstoragetypes.ErrStakeStorageNotFound) { utils.LavaFormatWarning("sending provider reward with delegations failed", err, utils.Attribute{Key: "provider", Value: provider}, @@ -212,7 +242,7 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes utils.Attribute{Key: "block", Value: ctx.BlockHeight()}, ) } else { - details[provider+" "+chainID] = fmt.Sprintf("cu: %d reward: %s", trackedCu, creditToSub.String()) + details[provider+" "+chainID] = fmt.Sprintf("cu: %d reward: %s", trackedCu, providerReward.String()) } } diff --git a/x/subscription/keeper/grpc_query.go b/x/subscription/keeper/grpc_query.go index 1abf00d8ed..ac95d19838 100644 --- a/x/subscription/keeper/grpc_query.go +++ b/x/subscription/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/subscription/keeper/grpc_query_current.go b/x/subscription/keeper/grpc_query_current.go index b757119c52..bcbfb27089 100644 --- a/x/subscription/keeper/grpc_query_current.go +++ b/x/subscription/keeper/grpc_query_current.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_estimated_rewards.go b/x/subscription/keeper/grpc_query_estimated_rewards.go index 6c180b44ef..2c39590579 100644 --- a/x/subscription/keeper/grpc_query_estimated_rewards.go +++ b/x/subscription/keeper/grpc_query_estimated_rewards.go @@ -3,127 +3,392 @@ package keeper import ( "context" "fmt" + "sort" + "strings" - "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/testutil/sample" + "github.com/lavanet/lava/v4/utils" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) -func (k Keeper) EstimatedRewards(goCtx context.Context, req *types.QueryEstimatedRewardsRequest) (*types.QueryEstimatedRewardsResponse, error) { +func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.QueryEstimatedProviderRewardsRequest) (*types.QueryEstimatedRewardsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } + oldCtx := sdk.UnwrapSDKContext(goCtx) + ctx, _ := oldCtx.CacheContext() // verify the original ctx is not changed - ctx := sdk.UnwrapSDKContext(goCtx) res := types.QueryEstimatedRewardsResponse{} - _, specContribut := k.specKeeper.GetContributorReward(ctx, req.ChainId) + details := []utils.Attribute{ + utils.LogAttr("block", ctx.BlockHeight()), + utils.LogAttr("provider", req.Provider), + } + + // parse the delegator/delegation optional argument (delegate if needed) + delegator := req.AmountDelegator + trackedCuFactor := sdk.ZeroDec() + if req.AmountDelegator != "" { + details = append(details, utils.LogAttr("delegator_amount", req.AmountDelegator)) + delegation, err := sdk.ParseCoinNormalized(req.AmountDelegator) + if err != nil { + // arg is not delegation, check if it's an address + _, err := sdk.AccAddressFromBech32(req.AmountDelegator) + if err != nil { + return nil, utils.LavaFormatWarning("cannot estimate rewards for delegator/delegation", fmt.Errorf("delegator/delegation argument is neither a valid coin or a valid bech32 address"), details...) + } + } else { + var err error + // arg is delegation, assign arbitrary delegator address and delegate the amount + delegator, err = k.createDummyDelegator(ctx, req.Provider, delegation) + if err != nil { + return nil, utils.LavaFormatWarning("cannot estimate rewards for delegator/delegation, cannot get delegator", err, details...) + } + + totalDelegations := sdk.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...) + } + for _, chain := range md.Chains { + entry, found := k.epochstorageKeeper.GetStakeEntryCurrent(ctx, chain, req.Provider) + if found { + totalDelegations = totalDelegations.Add(entry.TotalStake()) + } + } - storage := k.epochstorageKeeper.GetAllStakeEntriesCurrentForChainId(ctx, req.ChainId) + // calculate tracked CU factor which will increase the tracked CU due to + // a higher total stake (because of the dummy delegation, which will affect pairing) + trackedCuFactor = delegation.Amount.ToLegacyDec().QuoInt(totalDelegations) - totalStake := math.ZeroInt() - var entry epochstoragetypes.StakeEntry - found := false - for _, e := range storage { - totalStake = totalStake.Add(e.TotalStake()) - if e.Address == req.Provider { - found = true - entry = e + // advance ctx by a month and a day to make the delegation count + ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(0, 1, 1)) } } - if !found { - return nil, fmt.Errorf("provider not found in stake entries for chain ID: %s", req.ChainId) + + // get claimable rewards before the rewards distribution + before, err := k.getClaimableRewards(ctx, req.Provider, delegator) + if err != nil { + return nil, utils.LavaFormatWarning("cannot estimate rewards, cannot get claimable rewards before distribution", err, details...) } - // delegation of the provider - delegationAmount := entry.Stake - delegatorPart := sdk.NewDecFromInt(delegationAmount.Amount).QuoInt(totalStake) - if req.AmountDelegator != "" { - _, err := sdk.AccAddressFromBech32(req.AmountDelegator) - if err == nil { - d, found := k.dualstakingKeeper.GetDelegation(ctx, req.AmountDelegator, req.Provider, req.ChainId, uint64(ctx.BlockHeight())) + // we use events to get the detailed info about the rewards (for the provider only use-case) + // we reset the context's event manager to have a "clean slate" + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + // trigger subs + subs := k.GetAllSubscriptionsIndices(ctx) + for _, sub := range subs { + if !trackedCuFactor.IsZero() { + subObj, found := k.GetSubscription(ctx, sub) if !found { - return nil, fmt.Errorf("could not find delegator") + continue } - delegationAmount = d.Amount - } else { - var err error - delegationAmount, err = sdk.ParseCoinNormalized(req.AmountDelegator) - if err != nil { - return nil, err + trackedCuInfos := k.GetSubTrackedCuInfoForProvider(ctx, sub, req.Provider, subObj.Block) + for _, info := range trackedCuInfos { + cuToAdd := trackedCuFactor.MulInt64(int64(info.TrackedCu)).TruncateInt64() + err := k.AddTrackedCu(ctx, sub, req.Provider, info.ChainID, uint64(cuToAdd), subObj.Block) + if err != nil { + continue + } } - entry.DelegateTotal = entry.DelegateTotal.Add(delegationAmount) } - delegatorPart = sdk.NewDecFromInt(delegationAmount.Amount).QuoInt(totalStake).MulInt64(int64(100 - entry.DelegateCommission)).QuoInt64(100) + k.advanceMonth(ctx, []byte(sub)) + } + + // get all CU tracker timers (used to keep data on subscription rewards) and distribute all subscription rewards + gs := k.ExportCuTrackerTimers(ctx) + for _, timer := range gs.BlockEntries { + k.RewardAndResetCuTracker(ctx, []byte(timer.Key), timer.Data) + } + + // distribute bonus and IPRPC rewards + k.rewardsKeeper.DistributeMonthlyBonusRewards(ctx) + + // get claimable rewards after the rewards distribution + after, err := k.getClaimableRewards(ctx, req.Provider, delegator) + if err != nil { + return nil, utils.LavaFormatWarning("cannot estimate rewards, cannot get claimable rewards after distribution", err, details...) + } + + // calculate the claimable rewards difference + res.Total = sdk.NewDecCoinsFromCoins(after.Sub(before...)...) + + // get detailed info for providers only + if req.AmountDelegator == "" { + info, total := k.getRewardsInfoFromEvents(ctx, req.Provider) + if !total.IsEqual(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"), + utils.LogAttr("total_claimable_rewards", res.Total.String()), + utils.LogAttr("total_info_rewards", total.String()), + utils.LogAttr("info", info), + ) + } + + res.Info = info + } + + // get the last IPRPC rewards distribution block + // note: on error we simply leave RecommendedBlock to be zero since until the + // upcoming IPRPC rewards will be distributed (from the time this query is merged in main) + // there will be no LastRewardsBlock set + rewardsDistributionBlock, after24HoursBlock, err := k.rewardsKeeper.GetLastRewardsBlock(ctx) + if err == nil { + // if the query was sent within the first 24 hours of the month, + // make the recommended block be the rewards distribution block - 1 + if uint64(ctx.BlockHeight()) <= after24HoursBlock { + res.RecommendedBlock = rewardsDistributionBlock - 1 + } + } + + return &res, nil +} + +// 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) + + // get delegator rewards + if delegator == "" { + // self delegation + md, err := k.epochstorageKeeper.GetMetadata(ctx, provider) + if err != nil { + return nil, err + } + qRes, err = k.dualstakingKeeper.DelegatorRewards(goCtx, &dualstakingtypes.QueryDelegatorRewardsRequest{ + Delegator: md.Vault, + Provider: md.Provider, + }) + if err != nil { + return nil, err + } } else { - totalDelegations := entry.DelegateTotal.Amount - commission := sdk.NewDecFromInt(totalDelegations).QuoInt(totalStake).MulInt64(int64(entry.DelegateCommission)).QuoInt64(100) - delegatorPart = delegatorPart.Add(commission) - } - delegatorPart = delegatorPart.Mul(sdk.OneDec().Sub(specContribut)) - - totalSubsRewards := sdk.Coins{} - subsIndices := k.GetAllSubscriptionsIndices(ctx) - for _, subIndex := range subsIndices { - sub, found := k.GetSubscription(ctx, subIndex) - if found { - sub.Credit.Amount = sub.Credit.Amount.Quo(sdk.NewIntFromUint64(sub.DurationLeft)) - totalSubsRewards = totalSubsRewards.Add(sub.Credit) + qRes, err = k.dualstakingKeeper.DelegatorRewards(goCtx, &dualstakingtypes.QueryDelegatorRewardsRequest{ + Delegator: delegator, + Provider: provider, + }) + if err != nil { + return nil, err } } - emissions := k.rewardsKeeper.SpecEmissionParts(ctx) - var specEmission rewardstypes.SpecEmissionPart - found = false - for _, k := range emissions { - if k.ChainID == req.ChainId { - specEmission = k - found = true - break + if len(qRes.Rewards) == 0 { + return sdk.NewCoins(), nil + } + + // we have one reward from the specific provider + return qRes.Rewards[0].Amount, nil +} + +// getRewardsInfoFromEvents build the estimated reward info array by checking events details +// it also returns the total reward amount for validation +func (k Keeper) getRewardsInfoFromEvents(ctx sdk.Context, provider string) (infos []types.EstimatedRewardInfo, total sdk.DecCoins) { + events := ctx.EventManager().ABCIEvents() + rewardsInfo := map[string]sdk.DecCoins{} + + for _, event := range events { + // get reward info from event (!ok == event not relevant) + eventRewardsInfo, ok := k.parseEvent(event, provider) + if !ok { + continue + } + + // append the event map to rewardsInfo + for source, reward := range eventRewardsInfo { + savedReward, ok := rewardsInfo[source] + if ok { + rewardsInfo[source] = savedReward.Add(reward...) + } else { + rewardsInfo[source] = reward + } } } - if !found { - return nil, fmt.Errorf("spec emission part not found for chain ID: %s", req.ChainId) + // sort the rewardsInfo keys + sortedKeys := []string{} + for key := range rewardsInfo { + sortedKeys = append(sortedKeys, key) } + sort.Strings(sortedKeys) - subscriptionRewards, _ := sdk.NewDecCoinsFromCoins(totalSubsRewards...).MulDec(specEmission.Emission).TruncateDecimal() - valRewards, comRewards, err := k.rewardsKeeper.CalculateValidatorsAndCommunityParticipationRewards(ctx, subscriptionRewards[0]) - if err != nil { - return nil, fmt.Errorf("failed to calculate Validators And Community Participation Rewards") + // construct the info list and calculate the total rewards + for _, key := range sortedKeys { + infos = append(infos, types.EstimatedRewardInfo{ + Source: key, + Amount: rewardsInfo[key], + }) + total = total.Add(rewardsInfo[key]...) + } + + return infos, total +} + +// parseEvent parses an event. If it's one of the payment events and contains the provider address +// it builds the "source" string that is required for the estimated rewards info. Also it returns the +// rewards amount of the provider for a specific payment type and a specific chain +// if it returns ok == false, the event is not relevant and can be skipped +func (k Keeper) parseEvent(event abci.Event, provider string) (eventRewardsInfo map[string]sdk.DecCoins, ok bool) { + subEventName := utils.EventPrefix + types.SubscriptionPayoutEventName + boostEventName := utils.EventPrefix + rewardstypes.ProvidersBonusRewardsEventName + iprpcEventName := utils.EventPrefix + rewardstypes.IprpcPoolEmissionEventName + + // check event type and call appropriate handler + switch event.Type { + case subEventName: + return extractInfoFromSubscriptionEvent(event, provider) + case boostEventName: + return extractInfoFromBoostEvent(event, provider) + case iprpcEventName: + return extractInfoFromIprpcEvent(event, provider) } - coins := k.rewardsKeeper.TotalPoolTokens(ctx, rewardstypes.ProviderRewardsDistributionPool) - TotalPoolTokens := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) + return nil, false +} - bonusRewards := k.rewardsKeeper.SpecTotalPayout(ctx, - TotalPoolTokens, - sdk.NewDecFromInt(subscriptionRewards.AmountOf(k.stakingKeeper.BondDenom(ctx))), - specEmission) +// extractInfoFromSubscriptionEvent extract a map of source string keys (source = "Subscription: ") +// that hold rewards amount. The subscription payout event holds multiple keys of each reward for each chain ID. +// All of the rewards keys are prefixed with provider addresses +func extractInfoFromSubscriptionEvent(event abci.Event, provider string) (eventRewardsInfo map[string]sdk.DecCoins, ok bool) { + eventRewardsInfo = map[string]sdk.DecCoins{} - subscriptionRewards = subscriptionRewards.Sub(valRewards...).Sub(comRewards...) + for _, atr := range event.Attributes { + if strings.HasPrefix(atr.Key, provider) { + // extract chain ID + parts := strings.Split(atr.Key, " ") + if len(parts) != 2 { + // should never happen (as long as the event key is not changed) + utils.LavaFormatWarning("cannot extract chain ID from attribute", + fmt.Errorf("attribute key is not in expected format of ' '"), + utils.LogAttr("attribute_key", atr.Key), + utils.LogAttr("provider", provider), + ) + return nil, false + } + source := "Subscription: " + parts[1] - iprpcReward, found := k.rewardsKeeper.GetIprpcReward(ctx, k.rewardsKeeper.GetIprpcRewardsCurrentId(ctx)) - if found { - for _, fund := range iprpcReward.SpecFunds { - if fund.Spec == req.ChainId { - res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "iprpc", Amount: sdk.NewDecCoinsFromCoins(fund.Fund...).MulDec(delegatorPart)}) + // extract provider reward + parts = strings.Split(atr.Value, " ") + if len(parts) != 4 { + // should never happen (as long as the event value is not changed) + utils.LavaFormatWarning("cannot extract provider reward from attribute", + fmt.Errorf("attribute value is not in expected format of 'cu: reward: '"), + utils.LogAttr("attribute_key", atr.Key), + utils.LogAttr("attribute_value", atr.Value), + utils.LogAttr("provider", provider), + ) + return nil, false + } + reward, err := sdk.ParseDecCoins(parts[3]) + if err != nil { + // should never happen + utils.LavaFormatError("cannot parse DecCoins from reward string", err, + utils.LogAttr("provider", provider), + utils.LogAttr("chain_id", parts[1]), + utils.LogAttr("amount", parts[3]), + ) + return nil, false + } + + // put source and reward in result map + savedReward, ok := eventRewardsInfo[source] + if ok { + eventRewardsInfo[source] = savedReward.Add(reward...) + } else { + eventRewardsInfo[source] = reward } } } - res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "subscriptions", Amount: sdk.NewDecCoinsFromCoins(subscriptionRewards...).MulDec(delegatorPart)}) - res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "boost", Amount: sdk.NewDecCoins(sdk.NewDecCoinFromDec(k.stakingKeeper.BondDenom(ctx), bonusRewards.Mul(delegatorPart)))}) + if len(eventRewardsInfo) == 0 { + // the provider address was not found in the event + return nil, false + } - res.Total = sdk.NewDecCoins() - for _, k := range res.Info { - res.Total = res.Total.Add(k.Amount...) + return eventRewardsInfo, true +} + +// extractInfoFromIprpcEvent extract a map of source string keys that hold rewards amount from +// a boost payout event +func extractInfoFromBoostEvent(event abci.Event, provider string) (eventRewardsInfo map[string]sdk.DecCoins, ok bool) { + return extractInfoFromIprpcAndBoostEvent(event, provider, "Boost: ") +} + +// extractInfoFromIprpcEvent extract a map of source string keys that hold rewards amount from +// an IPRPC payout event +func extractInfoFromIprpcEvent(event abci.Event, provider string) (eventRewardsInfo map[string]sdk.DecCoins, ok bool) { + return extractInfoFromIprpcAndBoostEvent(event, provider, "Pools: ") +} + +// extractInfoFromIprpcAndBoostEvent extract a map of source string keys (source = "Pools: ") +// that hold rewards amount from either IPRPC and boost rewards. There's an event for each chain ID. +// All keys are prefixed with provider addresses. Since the events are emitted per chain ID, +// we expect a single reward key for a specific provider. Also, the reward string in the event +// is of type sdk.Coins. +func extractInfoFromIprpcAndBoostEvent(event abci.Event, provider string, sourcePrefix string) (eventRewardsInfo map[string]sdk.DecCoins, ok bool) { + var rewardStr, chainID string + eventRewardsInfo = map[string]sdk.DecCoins{} + + for _, atr := range event.Attributes { + if strings.HasPrefix(atr.Key, provider) { + // extract provider reward + parts := strings.Split(atr.Value, " ") + if len(parts) != 4 { + // should never happen (as long as the event value is not changed) + utils.LavaFormatWarning("cannot extract provider reward from attribute", + fmt.Errorf("attribute value is not in expected format of 'cu: reward: '"), + utils.LogAttr("attribute_key", atr.Key), + utils.LogAttr("attribute_value", atr.Value), + utils.LogAttr("provider", provider), + ) + return nil, false + } + rewardStr = parts[3] + } + + if atr.Key == "chainid" { + chainID = atr.Value + } } - return &res, nil + if rewardStr == "" || chainID == "" { + // the provider address was not found in the event + return nil, false + } + + reward, err := sdk.ParseCoinsNormalized(rewardStr) + if err != nil { + // should never happen + utils.LavaFormatError("cannot parse DecCoins from reward string", err, + utils.LogAttr("provider", provider), + utils.LogAttr("chain_id", chainID), + utils.LogAttr("reward", rewardStr), + ) + return nil, false + } + + // put source and reward in result map + eventRewardsInfo[sourcePrefix+chainID] = sdk.NewDecCoinsFromCoins(reward...) + return eventRewardsInfo, true +} + +// createDummyDelegator is a helper function to create a dummy delegator that delegates to the provider +func (k Keeper) createDummyDelegator(ctx sdk.Context, provider string, delegation sdk.Coin) (string, error) { + delegator := sample.AccAddress() + return delegator, k.dualstakingKeeper.Delegate(ctx, delegator, provider, delegation, false) +} + +// Deprecated: backwards compatibility support for the old deprecated version of the EstimatedProviderRewards query +func (k Keeper) EstimatedRewards(goCtx context.Context, req *types.QueryEstimatedRewardsRequest) (*types.QueryEstimatedRewardsResponse, error) { + newReq := types.QueryEstimatedProviderRewardsRequest{Provider: req.Provider, AmountDelegator: req.AmountDelegator} + return k.EstimatedProviderRewards(goCtx, &newReq) } diff --git a/x/subscription/keeper/grpc_query_estimated_validator_rewards.go b/x/subscription/keeper/grpc_query_estimated_validator_rewards.go index 7d65dfcedc..988072d3bc 100644 --- a/x/subscription/keeper/grpc_query_estimated_validator_rewards.go +++ b/x/subscription/keeper/grpc_query_estimated_validator_rewards.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - "github.com/lavanet/lava/v3/x/subscription/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_list.go b/x/subscription/keeper/grpc_query_list.go index c1c86e458d..e1f4509b31 100644 --- a/x/subscription/keeper/grpc_query_list.go +++ b/x/subscription/keeper/grpc_query_list.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_list_projects.go b/x/subscription/keeper/grpc_query_list_projects.go index d0cd8a5802..dd83f7f089 100644 --- a/x/subscription/keeper/grpc_query_list_projects.go +++ b/x/subscription/keeper/grpc_query_list_projects.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_next_to_month_expiry.go b/x/subscription/keeper/grpc_query_next_to_month_expiry.go index ede72c98d7..4ede178e9e 100644 --- a/x/subscription/keeper/grpc_query_next_to_month_expiry.go +++ b/x/subscription/keeper/grpc_query_next_to_month_expiry.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" - timertypes "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/subscription/types" + timertypes "github.com/lavanet/lava/v4/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_params.go b/x/subscription/keeper/grpc_query_params.go index e6875cb943..142e3f07fb 100644 --- a/x/subscription/keeper/grpc_query_params.go +++ b/x/subscription/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_params_test.go b/x/subscription/keeper/grpc_query_params_test.go index 5aff504135..cffb744309 100644 --- a/x/subscription/keeper/grpc_query_params_test.go +++ b/x/subscription/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/grpc_query_tracked_usage.go b/x/subscription/keeper/grpc_query_tracked_usage.go index b9af85a727..53720b261a 100644 --- a/x/subscription/keeper/grpc_query_tracked_usage.go +++ b/x/subscription/keeper/grpc_query_tracked_usage.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/keeper.go b/x/subscription/keeper/keeper.go index c583ed4c2b..037da90286 100644 --- a/x/subscription/keeper/keeper.go +++ b/x/subscription/keeper/keeper.go @@ -10,9 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - "github.com/lavanet/lava/v3/x/subscription/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + "github.com/lavanet/lava/v4/x/subscription/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) type ( diff --git a/x/subscription/keeper/migrations.go b/x/subscription/keeper/migrations.go index b3bc25d008..22aebf0452 100644 --- a/x/subscription/keeper/migrations.go +++ b/x/subscription/keeper/migrations.go @@ -6,12 +6,12 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - v2 "github.com/lavanet/lava/v3/x/subscription/migrations/v2" - v5 "github.com/lavanet/lava/v3/x/subscription/migrations/v5" - v6 "github.com/lavanet/lava/v3/x/subscription/migrations/v6" - v8 "github.com/lavanet/lava/v3/x/subscription/migrations/v8" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + v2 "github.com/lavanet/lava/v4/x/subscription/migrations/v2" + v5 "github.com/lavanet/lava/v4/x/subscription/migrations/v5" + v6 "github.com/lavanet/lava/v4/x/subscription/migrations/v6" + v8 "github.com/lavanet/lava/v4/x/subscription/migrations/v8" + "github.com/lavanet/lava/v4/x/subscription/types" ) type Migrator struct { diff --git a/x/subscription/keeper/msg_server.go b/x/subscription/keeper/msg_server.go index 4b033809aa..0ed2a91c4a 100644 --- a/x/subscription/keeper/msg_server.go +++ b/x/subscription/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) type msgServer struct { diff --git a/x/subscription/keeper/msg_server_add_project.go b/x/subscription/keeper/msg_server_add_project.go index fba236ccf5..4c4bf0fb2f 100644 --- a/x/subscription/keeper/msg_server_add_project.go +++ b/x/subscription/keeper/msg_server_add_project.go @@ -5,9 +5,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) func (k msgServer) AddProject(goCtx context.Context, msg *types.MsgAddProject) (*types.MsgAddProjectResponse, error) { diff --git a/x/subscription/keeper/msg_server_auto_renewal.go b/x/subscription/keeper/msg_server_auto_renewal.go index a399da62fd..1e39a6d7eb 100644 --- a/x/subscription/keeper/msg_server_auto_renewal.go +++ b/x/subscription/keeper/msg_server_auto_renewal.go @@ -6,9 +6,9 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + "github.com/lavanet/lava/v4/x/subscription/types" ) func (k msgServer) AutoRenewal(goCtx context.Context, msg *types.MsgAutoRenewal) (*types.MsgAutoRenewalResponse, error) { diff --git a/x/subscription/keeper/msg_server_buy.go b/x/subscription/keeper/msg_server_buy.go index 36d8324d13..780cdb5cb4 100644 --- a/x/subscription/keeper/msg_server_buy.go +++ b/x/subscription/keeper/msg_server_buy.go @@ -6,8 +6,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" ) func (k msgServer) Buy(goCtx context.Context, msg *types.MsgBuy) (*types.MsgBuyResponse, error) { diff --git a/x/subscription/keeper/msg_server_del_project.go b/x/subscription/keeper/msg_server_del_project.go index 33012a6fbb..da447a6bb4 100644 --- a/x/subscription/keeper/msg_server_del_project.go +++ b/x/subscription/keeper/msg_server_del_project.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/x/subscription/types" ) func (k msgServer) DelProject(goCtx context.Context, msg *types.MsgDelProject) (*types.MsgDelProjectResponse, error) { diff --git a/x/subscription/keeper/msg_server_test.go b/x/subscription/keeper/msg_server_test.go index 3b91e5fdac..b537768e68 100644 --- a/x/subscription/keeper/msg_server_test.go +++ b/x/subscription/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/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" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/subscription/keeper/params.go b/x/subscription/keeper/params.go index 3fe927cdd0..d1d8f6073b 100644 --- a/x/subscription/keeper/params.go +++ b/x/subscription/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) // GetParams get all parameters as types.Params diff --git a/x/subscription/keeper/params_test.go b/x/subscription/keeper/params_test.go index c6b94af34a..b683b9e52b 100644 --- a/x/subscription/keeper/params_test.go +++ b/x/subscription/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + testkeeper "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/subscription.go b/x/subscription/keeper/subscription.go index 7cde34e7ed..9a873a0d0a 100644 --- a/x/subscription/keeper/subscription.go +++ b/x/subscription/keeper/subscription.go @@ -8,11 +8,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/utils" - "github.com/lavanet/lava/v3/utils/lavaslices" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/utils" + "github.com/lavanet/lava/v4/utils/lavaslices" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + "github.com/lavanet/lava/v4/x/subscription/types" ) // GetSubscription returns the subscription of a given consumer diff --git a/x/subscription/keeper/subscription_test.go b/x/subscription/keeper/subscription_test.go index 59995a4e92..f29d70dc2e 100644 --- a/x/subscription/keeper/subscription_test.go +++ b/x/subscription/keeper/subscription_test.go @@ -8,15 +8,15 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/testutil/common" - keepertest "github.com/lavanet/lava/v3/testutil/keeper" - "github.com/lavanet/lava/v3/utils" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/utils/sigs" - pairingtypes "github.com/lavanet/lava/v3/x/pairing/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/testutil/common" + keepertest "github.com/lavanet/lava/v4/testutil/keeper" + "github.com/lavanet/lava/v4/utils" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/utils/sigs" + pairingtypes "github.com/lavanet/lava/v4/x/pairing/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/module.go b/x/subscription/module.go index 890f3a9ece..6a8f4fbdbe 100644 --- a/x/subscription/module.go +++ b/x/subscription/module.go @@ -18,9 +18,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/v3/x/subscription/client/cli" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/client/cli" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) var ( diff --git a/x/subscription/module_simulation.go b/x/subscription/module_simulation.go index e36b975910..c8047e4039 100644 --- a/x/subscription/module_simulation.go +++ b/x/subscription/module_simulation.go @@ -10,9 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v3/testutil/sample" - subscriptionsimulation "github.com/lavanet/lava/v3/x/subscription/simulation" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/testutil/sample" + subscriptionsimulation "github.com/lavanet/lava/v4/x/subscription/simulation" + "github.com/lavanet/lava/v4/x/subscription/types" ) // avoid unused import issue diff --git a/x/subscription/simulation/add_project.go b/x/subscription/simulation/add_project.go index fb30603637..a82d928431 100644 --- a/x/subscription/simulation/add_project.go +++ b/x/subscription/simulation/add_project.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) func SimulateMsgAddProject( diff --git a/x/subscription/simulation/auto_renewal.go b/x/subscription/simulation/auto_renewal.go index e4fb430944..6fc8fde634 100644 --- a/x/subscription/simulation/auto_renewal.go +++ b/x/subscription/simulation/auto_renewal.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) func SimulateMsgAutoRenewal( diff --git a/x/subscription/simulation/buy.go b/x/subscription/simulation/buy.go index d67915c3f8..9f3eb3b304 100644 --- a/x/subscription/simulation/buy.go +++ b/x/subscription/simulation/buy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) func SimulateMsgBuy( diff --git a/x/subscription/simulation/del_project.go b/x/subscription/simulation/del_project.go index 8864ae934d..574f434ed0 100644 --- a/x/subscription/simulation/del_project.go +++ b/x/subscription/simulation/del_project.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v3/x/subscription/keeper" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/keeper" + "github.com/lavanet/lava/v4/x/subscription/types" ) func SimulateMsgDelProject( diff --git a/x/subscription/types/adjustment.pb.go b/x/subscription/types/adjustment.pb.go index 3402e12a2c..852b37df4f 100644 --- a/x/subscription/types/adjustment.pb.go +++ b/x/subscription/types/adjustment.pb.go @@ -102,9 +102,9 @@ var fileDescriptor_6061843cba96837b = []byte{ 0xab, 0x24, 0xbf, 0x24, 0x31, 0x07, 0xa2, 0x84, 0x19, 0xac, 0x04, 0x49, 0xc4, 0xc9, 0xf3, 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, 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, - 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x7c, 0x55, 0x66, 0xac, 0x5f, 0x81, 0xea, 0xb5, 0x92, 0xca, - 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xb7, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x47, 0x54, - 0x5a, 0xe1, 0x04, 0x01, 0x00, 0x00, + 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x7c, 0x55, 0x66, 0xa2, 0x5f, 0x81, 0xea, 0xb5, 0x92, 0xca, + 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xb7, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xfd, + 0x78, 0x54, 0x04, 0x01, 0x00, 0x00, } func (m *Adjustment) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/cu_tracker.pb.go b/x/subscription/types/cu_tracker.pb.go index c4ff1a2fa5..f942146d43 100644 --- a/x/subscription/types/cu_tracker.pb.go +++ b/x/subscription/types/cu_tracker.pb.go @@ -199,28 +199,28 @@ func init() { } var fileDescriptor_5974e118ddf7c543 = []byte{ - // 323 bytes of a gzipped FileDescriptorProto + // 324 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xbd, 0x6e, 0xc2, 0x30, 0x14, 0x85, 0x13, 0x4a, 0x69, 0xe3, 0xaa, 0x1d, 0x2c, 0x86, 0x40, 0x2b, 0x17, 0x31, 0xa1, 0x0e, - 0xb6, 0x28, 0x43, 0x77, 0x60, 0x61, 0x8d, 0x98, 0xba, 0x54, 0x8e, 0x71, 0xc1, 0x02, 0x72, 0x23, - 0xc7, 0x8e, 0xca, 0x5b, 0xf4, 0xb1, 0x18, 0x19, 0x3b, 0x55, 0x15, 0x79, 0x91, 0x2a, 0x3f, 0xfc, - 0x4d, 0xf7, 0x9e, 0xeb, 0x63, 0x9f, 0x4f, 0xbe, 0xe8, 0x65, 0xc5, 0x53, 0x1e, 0x49, 0xc3, 0xf2, - 0xca, 0x12, 0x1b, 0x26, 0x42, 0xab, 0xd8, 0x28, 0x88, 0x98, 0xb0, 0x1f, 0x46, 0x73, 0xb1, 0x94, - 0x9a, 0xc6, 0x1a, 0x0c, 0xe0, 0x56, 0xe5, 0xa5, 0x79, 0xa5, 0xe7, 0xde, 0x36, 0x11, 0x90, 0xac, - 0x21, 0x61, 0x21, 0x4f, 0x24, 0x4b, 0xfb, 0xa1, 0x34, 0xbc, 0xcf, 0x04, 0xa8, 0xa8, 0xbc, 0xda, - 0x6e, 0xce, 0x61, 0x0e, 0x45, 0xcb, 0xf2, 0xae, 0x9c, 0x76, 0x1f, 0x91, 0x37, 0x2d, 0x12, 0x66, - 0x23, 0x8b, 0x1f, 0x50, 0x4d, 0x58, 0xdf, 0xed, 0xb8, 0xbd, 0x7a, 0x50, 0x13, 0xb6, 0x2b, 0x10, - 0x1e, 0xd9, 0xf2, 0x58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x31, 0xe7, + 0x2a, 0x1a, 0x8f, 0x8a, 0x18, 0x2f, 0xd8, 0x4b, 0xfc, 0x80, 0x3c, 0xb3, 0x7f, 0xc6, 0xbf, 0x28, + 0xc8, 0x8e, 0x83, 0x23, 0x73, 0xfd, 0x84, 0x79, 0x30, 0xde, 0xec, 0x88, 0xbb, 0xdd, 0x11, 0xf7, + 0x6f, 0x47, 0xdc, 0xef, 0x8c, 0x38, 0xdb, 0x8c, 0x38, 0x3f, 0x19, 0x71, 0xde, 0xd9, 0x4c, 0x99, + 0xb9, 0x0d, 0xa9, 0x80, 0x15, 0x3b, 0x5b, 0x4f, 0xfa, 0xca, 0xbe, 0xce, 0x77, 0x64, 0xd6, 0xb1, + 0x4c, 0xc2, 0x46, 0xf1, 0x9d, 0x2f, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x17, 0xcc, 0x38, + 0xcd, 0x01, 0x00, 0x00, } func (m *TrackedCu) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/expected_keepers.go b/x/subscription/types/expected_keepers.go index f459e5e1bc..2169e5b817 100644 --- a/x/subscription/types/expected_keepers.go +++ b/x/subscription/types/expected_keepers.go @@ -1,18 +1,20 @@ package types import ( + context "context" + "cosmossdk.io/math" storetypes "github.com/cosmos/cosmos-sdk/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/v3/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/v3/x/epochstorage/types" - fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" - rewardstypes "github.com/lavanet/lava/v3/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + dualstakingtypes "github.com/lavanet/lava/v4/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v4/x/epochstorage/types" + fixationtypes "github.com/lavanet/lava/v4/x/fixationstore/types" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" + rewardstypes "github.com/lavanet/lava/v4/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -37,6 +39,7 @@ type EpochstorageKeeper interface { GetCurrentNextEpoch(ctx sdk.Context) (nextEpoch uint64) GetStakeEntryCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []epochstoragetypes.StakeEntry + GetMetadata(ctx sdk.Context, provider string) (epochstoragetypes.ProviderMetadata, error) // Methods imported from epochstorage should be defined here } @@ -69,7 +72,10 @@ type TimerStoreKeeper interface { type DualStakingKeeper interface { RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, err error) - GetDelegation(ctx sdk.Context, delegator, provider, chainID string, epoch uint64) (dualstakingtypes.Delegation, bool) + GetDelegation(ctx sdk.Context, delegator, provider string) (dualstakingtypes.Delegation, bool) + DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, amount sdk.Coin, stake bool) error + DelegatorRewards(goCtx context.Context, req *dualstakingtypes.QueryDelegatorRewardsRequest) (res *dualstakingtypes.QueryDelegatorRewardsResponse, err error) + Delegate(ctx sdk.Context, delegator, provider string, amount sdk.Coin, stake bool) error } type RewardsKeeper interface { @@ -87,6 +93,8 @@ type RewardsKeeper interface { GetIprpcReward(ctx sdk.Context, id uint64) (val rewardstypes.IprpcReward, found bool) AllocationPoolMonthsLeft(ctx sdk.Context) int64 GetCommunityTax(ctx sdk.Context) math.LegacyDec + DistributeMonthlyBonusRewards(ctx sdk.Context) + GetLastRewardsBlock(ctx sdk.Context) (rewardsDistributionBlock uint64, after24HoursBlock uint64, err error) } type StakingKeeper interface { diff --git a/x/subscription/types/genesis.go b/x/subscription/types/genesis.go index 07d1f5901d..cadd802c9e 100644 --- a/x/subscription/types/genesis.go +++ b/x/subscription/types/genesis.go @@ -1,8 +1,8 @@ package types import ( - fixationstoretypes "github.com/lavanet/lava/v3/x/fixationstore/types" - timerstoretypes "github.com/lavanet/lava/v3/x/timerstore/types" + fixationstoretypes "github.com/lavanet/lava/v4/x/fixationstore/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) // this line is used by starport scaffolding # genesis/types/import diff --git a/x/subscription/types/genesis.pb.go b/x/subscription/types/genesis.pb.go index a01062a1b7..dfae6509e4 100644 --- a/x/subscription/types/genesis.pb.go +++ b/x/subscription/types/genesis.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/fixationstore/types" - types1 "github.com/lavanet/lava/v3/x/timerstore/types" + types "github.com/lavanet/lava/v4/x/fixationstore/types" + types1 "github.com/lavanet/lava/v4/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -120,28 +120,28 @@ func init() { var fileDescriptor_dc6c60f9c112fe52 = []byte{ // 347 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4e, 0xf3, 0x30, - 0x18, 0x86, 0x93, 0xbf, 0xfd, 0x33, 0xa4, 0x4c, 0x11, 0x43, 0xe8, 0x10, 0x0a, 0x08, 0x28, 0x0c, - 0xb6, 0x44, 0x0f, 0x80, 0x28, 0x52, 0x11, 0x03, 0x52, 0x45, 0x32, 0xb1, 0xb9, 0xc1, 0x84, 0x00, - 0x89, 0x23, 0xdb, 0xa9, 0xca, 0x2d, 0x38, 0x56, 0x07, 0x86, 0x8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xfd, 0xff, 0xbf, 0xef, 0xa6, 0xe7, 0x85, 0x6e, 0xfd, 0x8f, 0x99, + 0xef, 0xf4, 0x5a, 0x3f, 0x75, 0xc6, 0x37, 0xbf, 0x58, 0xd1, 0x4b, 0x9d, 0x96, 0x1f, 0x5c, 0xcf, + 0x16, 0x81, 0x3d, 0x5f, 0x04, 0xf6, 0xd7, 0x22, 0xb0, 0xdf, 0xaa, 0xc0, 0x9a, 0x57, 0x81, 0xf5, + 0x51, 0x05, 0xd6, 0x1d, 0x4c, 0x52, 0xfe, 0x58, 0x8e, 0x41, 0x4c, 0x32, 0x68, 0x2c, 0xc6, 0xe4, + 0x0c, 0x4e, 0xcd, 0xa5, 0xe3, 0xaf, 0x05, 0x66, 0x63, 0x47, 0x2e, 0xc8, 0xe9, 0x77, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x0c, 0x9b, 0xf0, 0x5d, 0x20, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/genesis_test.go b/x/subscription/types/genesis_test.go index 4e6ad883bb..42a66273c7 100644 --- a/x/subscription/types/genesis_test.go +++ b/x/subscription/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/v3/x/subscription/types" + "github.com/lavanet/lava/v4/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_add_project.go b/x/subscription/types/message_add_project.go index bbb3a4f6b1..cb6359c596 100644 --- a/x/subscription/types/message_add_project.go +++ b/x/subscription/types/message_add_project.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" ) const TypeMsgAddProject = "add_project" diff --git a/x/subscription/types/message_add_project_test.go b/x/subscription/types/message_add_project_test.go index c17851199a..84d33ca9f0 100644 --- a/x/subscription/types/message_add_project_test.go +++ b/x/subscription/types/message_add_project_test.go @@ -4,9 +4,9 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" - planstypes "github.com/lavanet/lava/v3/x/plans/types" - projectstypes "github.com/lavanet/lava/v3/x/projects/types" + "github.com/lavanet/lava/v4/testutil/sample" + planstypes "github.com/lavanet/lava/v4/x/plans/types" + projectstypes "github.com/lavanet/lava/v4/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_auto_renewal_test.go b/x/subscription/types/message_auto_renewal_test.go index cbe6a371fc..6b6ad20057 100644 --- a/x/subscription/types/message_auto_renewal_test.go +++ b/x/subscription/types/message_auto_renewal_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_buy_test.go b/x/subscription/types/message_buy_test.go index 14c10a4443..3182c0e222 100644 --- a/x/subscription/types/message_buy_test.go +++ b/x/subscription/types/message_buy_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_del_project_test.go b/x/subscription/types/message_del_project_test.go index 7e08bb1e00..f7f4ddb8e8 100644 --- a/x/subscription/types/message_del_project_test.go +++ b/x/subscription/types/message_del_project_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/v3/testutil/sample" + "github.com/lavanet/lava/v4/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/params.pb.go b/x/subscription/types/params.pb.go index 8037e61ca9..960677d4a0 100644 --- a/x/subscription/types/params.pb.go +++ b/x/subscription/types/params.pb.go @@ -77,8 +77,8 @@ var fileDescriptor_8b1e38ca40b9ef74 = []byte{ 0xc6, 0x02, 0x79, 0x06, 0x27, 0xcf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x71, 0x4d, 0x99, - 0xb1, 0x7e, 0x05, 0xaa, 0x93, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x36, 0x18, 0x03, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x4b, 0xae, 0x64, 0x46, 0xbc, 0x00, 0x00, 0x00, + 0x89, 0x7e, 0x05, 0xaa, 0x93, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x36, 0x18, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x73, 0x07, 0x46, 0xf3, 0xbc, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/query.pb.go b/x/subscription/types/query.pb.go index fc9db2d9a8..d4341cca75 100644 --- a/x/subscription/types/query.pb.go +++ b/x/subscription/types/query.pb.go @@ -740,9 +740,10 @@ func (m *QuerySubscriptionTrackedUsageResponse) GetTotalUsage() uint64 { return 0 } +// Deprecated: Do not use. type QueryEstimatedRewardsRequest struct { Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id",deprecated:"true"` // Deprecated: Do not use. AmountDelegator string `protobuf:"bytes,3,opt,name=amount_delegator,json=amountDelegator,proto3" json:"amount_delegator,omitempty"` } @@ -786,6 +787,7 @@ func (m *QueryEstimatedRewardsRequest) GetProvider() string { return "" } +// Deprecated: Do not use. func (m *QueryEstimatedRewardsRequest) GetChainId() string { if m != nil { return m.ChainId @@ -800,6 +802,58 @@ func (m *QueryEstimatedRewardsRequest) GetAmountDelegator() string { return "" } +type QueryEstimatedProviderRewardsRequest struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + AmountDelegator string `protobuf:"bytes,2,opt,name=amount_delegator,json=amountDelegator,proto3" json:"amount_delegator,omitempty"` +} + +func (m *QueryEstimatedProviderRewardsRequest) Reset() { *m = QueryEstimatedProviderRewardsRequest{} } +func (m *QueryEstimatedProviderRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEstimatedProviderRewardsRequest) ProtoMessage() {} +func (*QueryEstimatedProviderRewardsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{15} +} +func (m *QueryEstimatedProviderRewardsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEstimatedProviderRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEstimatedProviderRewardsRequest.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 *QueryEstimatedProviderRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEstimatedProviderRewardsRequest.Merge(m, src) +} +func (m *QueryEstimatedProviderRewardsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEstimatedProviderRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEstimatedProviderRewardsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEstimatedProviderRewardsRequest proto.InternalMessageInfo + +func (m *QueryEstimatedProviderRewardsRequest) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *QueryEstimatedProviderRewardsRequest) GetAmountDelegator() string { + if m != nil { + return m.AmountDelegator + } + return "" +} + type EstimatedRewardInfo struct { Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"amount"` @@ -809,7 +863,7 @@ func (m *EstimatedRewardInfo) Reset() { *m = EstimatedRewardInfo{} } func (m *EstimatedRewardInfo) String() string { return proto.CompactTextString(m) } func (*EstimatedRewardInfo) ProtoMessage() {} func (*EstimatedRewardInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{15} + return fileDescriptor_e870698c9d8ccc09, []int{16} } func (m *EstimatedRewardInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -853,15 +907,16 @@ func (m *EstimatedRewardInfo) GetAmount() github_com_cosmos_cosmos_sdk_types.Dec } type QueryEstimatedRewardsResponse struct { - Info []*EstimatedRewardInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"` - Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` + Info []EstimatedRewardInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info"` + Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` + RecommendedBlock uint64 `protobuf:"varint,3,opt,name=recommended_block,json=recommendedBlock,proto3" json:"recommended_block,omitempty"` } func (m *QueryEstimatedRewardsResponse) Reset() { *m = QueryEstimatedRewardsResponse{} } func (m *QueryEstimatedRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryEstimatedRewardsResponse) ProtoMessage() {} func (*QueryEstimatedRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{16} + return fileDescriptor_e870698c9d8ccc09, []int{17} } func (m *QueryEstimatedRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -890,7 +945,7 @@ func (m *QueryEstimatedRewardsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryEstimatedRewardsResponse proto.InternalMessageInfo -func (m *QueryEstimatedRewardsResponse) GetInfo() []*EstimatedRewardInfo { +func (m *QueryEstimatedRewardsResponse) GetInfo() []EstimatedRewardInfo { if m != nil { return m.Info } @@ -904,6 +959,13 @@ func (m *QueryEstimatedRewardsResponse) GetTotal() github_com_cosmos_cosmos_sdk_ return nil } +func (m *QueryEstimatedRewardsResponse) GetRecommendedBlock() uint64 { + if m != nil { + return m.RecommendedBlock + } + return 0 +} + type QueryEstimatedValidatorRewardsRequest struct { Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` AmountDelegator string `protobuf:"bytes,2,opt,name=amount_delegator,json=amountDelegator,proto3" json:"amount_delegator,omitempty"` @@ -913,7 +975,7 @@ func (m *QueryEstimatedValidatorRewardsRequest) Reset() { *m = QueryEsti func (m *QueryEstimatedValidatorRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryEstimatedValidatorRewardsRequest) ProtoMessage() {} func (*QueryEstimatedValidatorRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{17} + return fileDescriptor_e870698c9d8ccc09, []int{18} } func (m *QueryEstimatedValidatorRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -967,7 +1029,7 @@ func (m *QueryEstimatedValidatorRewardsResponse) Reset() { func (m *QueryEstimatedValidatorRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryEstimatedValidatorRewardsResponse) ProtoMessage() {} func (*QueryEstimatedValidatorRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{18} + return fileDescriptor_e870698c9d8ccc09, []int{19} } func (m *QueryEstimatedValidatorRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1026,6 +1088,7 @@ func init() { proto.RegisterType((*QuerySubscriptionTrackedUsageRequest)(nil), "lavanet.lava.subscription.QuerySubscriptionTrackedUsageRequest") proto.RegisterType((*QuerySubscriptionTrackedUsageResponse)(nil), "lavanet.lava.subscription.QuerySubscriptionTrackedUsageResponse") proto.RegisterType((*QueryEstimatedRewardsRequest)(nil), "lavanet.lava.subscription.QueryEstimatedRewardsRequest") + proto.RegisterType((*QueryEstimatedProviderRewardsRequest)(nil), "lavanet.lava.subscription.QueryEstimatedProviderRewardsRequest") proto.RegisterType((*EstimatedRewardInfo)(nil), "lavanet.lava.subscription.EstimatedRewardInfo") proto.RegisterType((*QueryEstimatedRewardsResponse)(nil), "lavanet.lava.subscription.QueryEstimatedRewardsResponse") proto.RegisterType((*QueryEstimatedValidatorRewardsRequest)(nil), "lavanet.lava.subscription.QueryEstimatedValidatorRewardsRequest") @@ -1037,91 +1100,99 @@ func init() { } var fileDescriptor_e870698c9d8ccc09 = []byte{ - // 1343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcd, 0x6f, 0x13, 0x47, - 0x14, 0xcf, 0x06, 0xc7, 0x49, 0x5e, 0x1c, 0x08, 0x13, 0x84, 0x1c, 0x2b, 0x75, 0xc8, 0xf2, 0x1d, - 0x60, 0x47, 0x21, 0xad, 0x02, 0x17, 0xa0, 0x09, 0x54, 0x05, 0xd1, 0x2a, 0x2c, 0x01, 0xa4, 0x4a, - 0xed, 0x6a, 0xbc, 0x3b, 0x71, 0xb6, 0xd8, 0x3b, 0xcb, 0xee, 0x6c, 0x08, 0x8a, 0x22, 0x55, 0x3d, - 0xa2, 0x1e, 0xaa, 0xf6, 0xdc, 0x43, 0x6f, 0x55, 0x4f, 0x3d, 0xf7, 0xd6, 0x1b, 0x47, 0xd4, 0x1e, - 0x5a, 0xa9, 0x52, 0x8b, 0x00, 0xa9, 0x7f, 0x46, 0xab, 0xf9, 0x58, 0x67, 0xed, 0xd8, 0xeb, 0x84, - 0xaa, 0x87, 0x5e, 0xe2, 0x9d, 0x37, 0xef, 0xfd, 0xde, 0xef, 0xbd, 0x79, 0x33, 0xef, 0x05, 0x4e, - 0x36, 0xc8, 0x06, 0x09, 0x28, 0xc7, 0xe2, 0x17, 0xc7, 0x49, 0x2d, 0x76, 0x23, 0x3f, 0xe4, 0x3e, - 0x0b, 0xf0, 0xa3, 0x84, 0x46, 0x4f, 0xac, 0x30, 0x62, 0x9c, 0xa1, 0x29, 0xad, 0x66, 0x89, 0x5f, - 0x2b, 0xab, 0x56, 0x99, 0x73, 0x59, 0xdc, 0x64, 0x31, 0xae, 0x91, 0x98, 0x2a, 0x1b, 0xbc, 0x31, - 0x5f, 0xa3, 0x9c, 0xcc, 0xe3, 0x90, 0xd4, 0xfd, 0x80, 0x08, 0x2d, 0x05, 0x53, 0xa9, 0x66, 0x75, - 0x53, 0x2d, 0x97, 0xf9, 0xe9, 0xfe, 0x91, 0x3a, 0xab, 0x33, 0xf9, 0x89, 0xc5, 0x97, 0x96, 0x4e, - 0xd7, 0x19, 0xab, 0x37, 0x28, 0x26, 0xa1, 0x8f, 0x49, 0x10, 0x30, 0x2e, 0x21, 0x63, 0xbd, 0x3b, - 0xd7, 0x3b, 0x02, 0x37, 0x71, 0x78, 0x44, 0xdc, 0x87, 0x34, 0xd2, 0xba, 0xa7, 0x7a, 0xeb, 0x86, - 0x24, 0x22, 0xcd, 0x14, 0xf3, 0x7c, 0x6f, 0xbd, 0xec, 0x42, 0x6b, 0x1f, 0x26, 0x4d, 0x3f, 0x60, - 0x58, 0xfe, 0x55, 0x22, 0xf3, 0x08, 0xa0, 0x3b, 0x22, 0x15, 0x2b, 0x12, 0xd5, 0xa6, 0x8f, 0x12, - 0x1a, 0x73, 0xf3, 0x3e, 0x4c, 0xb6, 0x49, 0xe3, 0x90, 0x05, 0x31, 0x45, 0x57, 0xa1, 0xa8, 0xbc, - 0x97, 0x8d, 0x63, 0xc6, 0x99, 0xb1, 0x8b, 0xb3, 0x56, 0xcf, 0x6c, 0x5b, 0xca, 0x74, 0xa9, 0xf0, - 0xec, 0x8f, 0x99, 0x01, 0x5b, 0x9b, 0x99, 0xf3, 0x1a, 0x77, 0x39, 0x89, 0x22, 0x1a, 0x70, 0xed, - 0x0e, 0x55, 0x60, 0xc4, 0x65, 0x41, 0x9c, 0x34, 0x69, 0x24, 0x91, 0x47, 0xed, 0xd6, 0xda, 0x7c, - 0x00, 0x47, 0xda, 0x4d, 0x5a, 0x5c, 0x0e, 0xc4, 0x49, 0x4d, 0x13, 0x39, 0x9d, 0x43, 0xe4, 0x6e, - 0x66, 0x21, 0xe9, 0x18, 0xb6, 0xb0, 0x34, 0xaf, 0x40, 0x59, 0x02, 0xdf, 0xf6, 0x63, 0xbe, 0x12, - 0xb1, 0x4f, 0xa9, 0xcb, 0xd3, 0xf8, 0x91, 0x09, 0xa5, 0x2c, 0x86, 0x26, 0xd5, 0x26, 0x33, 0x17, - 0x61, 0xaa, 0x8b, 0xbd, 0x66, 0x57, 0x81, 0x91, 0x50, 0xcb, 0xca, 0xc6, 0xb1, 0x03, 0x22, 0xa2, - 0x74, 0x6d, 0x22, 0x98, 0x68, 0x19, 0xa6, 0x09, 0x27, 0x70, 0x38, 0x23, 0xd3, 0x20, 0xb7, 0x61, - 0x54, 0x78, 0x74, 0xfc, 0x60, 0x8d, 0x49, 0x94, 0xb1, 0x8b, 0x67, 0x73, 0x02, 0x15, 0xb6, 0x37, - 0x83, 0x35, 0x76, 0x97, 0x47, 0x89, 0xcb, 0x75, 0xe6, 0x47, 0x84, 0x8a, 0x90, 0x9a, 0x4f, 0x0b, - 0x70, 0xb0, 0x5d, 0x25, 0x2f, 0xef, 0x08, 0x41, 0x21, 0x6c, 0x90, 0xa0, 0x3c, 0x28, 0xe5, 0xf2, - 0x1b, 0x9d, 0x86, 0x43, 0x5e, 0x12, 0xc9, 0xa2, 0x76, 0x6a, 0x2c, 0xa9, 0xaf, 0xf3, 0xf2, 0x81, - 0x63, 0xc6, 0x99, 0x82, 0x7d, 0x30, 0x15, 0x2f, 0x49, 0x29, 0x3a, 0x0e, 0xe3, 0x2d, 0xc5, 0x06, - 0x5d, 0xe3, 0xe5, 0x82, 0x54, 0x2b, 0xa5, 0xc2, 0xdb, 0x74, 0x8d, 0xa3, 0x59, 0x28, 0x35, 0x59, - 0xc0, 0xd7, 0x1d, 0xba, 0x19, 0xfa, 0xd1, 0x93, 0xf2, 0x90, 0xd4, 0x19, 0x93, 0xb2, 0x1b, 0x52, - 0x84, 0x4e, 0xc0, 0x41, 0xa5, 0x22, 0x2e, 0x08, 0xe3, 0xa4, 0x51, 0x2e, 0x2a, 0x20, 0x29, 0x5d, - 0x4e, 0x56, 0x85, 0x0c, 0x99, 0x30, 0xde, 0xd2, 0x92, 0xde, 0x86, 0x33, 0x48, 0xcb, 0x89, 0x74, - 0x56, 0x86, 0x61, 0xb7, 0x91, 0xc4, 0x9c, 0x46, 0xe5, 0x11, 0x19, 0x51, 0xba, 0x44, 0x27, 0xa1, - 0xc5, 0x5e, 0xfb, 0x18, 0x95, 0xe6, 0xad, 0x08, 0x94, 0x93, 0x05, 0x38, 0x4a, 0x12, 0xce, 0x9c, - 0x88, 0x06, 0xf4, 0x31, 0x69, 0x38, 0x01, 0xdd, 0xe4, 0x8e, 0xcc, 0xd0, 0x98, 0xc4, 0x9b, 0x14, - 0xbb, 0xb6, 0xda, 0xfc, 0x90, 0x6e, 0xf2, 0x15, 0x91, 0xb0, 0x4f, 0x60, 0x72, 0x2d, 0xe1, 0x49, - 0x44, 0x9d, 0xb6, 0x72, 0x2a, 0xc9, 0xa2, 0xbd, 0x90, 0x73, 0x96, 0xef, 0x49, 0xab, 0x6c, 0xe9, - 0xda, 0x68, 0x6d, 0x97, 0x0c, 0xcd, 0x43, 0xd1, 0x8d, 0xa8, 0xe7, 0xf3, 0xf2, 0xb8, 0x84, 0x9c, - 0xb2, 0xd4, 0xbb, 0x65, 0x89, 0x77, 0xcb, 0xd2, 0xef, 0x96, 0xb5, 0xcc, 0xfc, 0xc0, 0xd6, 0x8a, - 0xb7, 0x0a, 0x23, 0x30, 0x31, 0x66, 0xce, 0xc0, 0x5b, 0xb2, 0xde, 0x04, 0xd3, 0x55, 0xf6, 0xc1, - 0x4e, 0xca, 0xd3, 0x82, 0x5c, 0x81, 0x43, 0xab, 0x7e, 0x93, 0x46, 0x4a, 0x2a, 0x6a, 0x26, 0xb7, - 0x5a, 0x3a, 0xcf, 0x72, 0x70, 0xd7, 0x59, 0x9a, 0x9b, 0x50, 0xed, 0xe5, 0x52, 0xd7, 0xfb, 0x7d, - 0x18, 0xcf, 0x26, 0x21, 0xd6, 0x35, 0x3f, 0x97, 0x93, 0xa7, 0x0e, 0x8e, 0xba, 0xe8, 0xdb, 0x61, - 0xcc, 0x5b, 0x70, 0x42, 0x7a, 0xce, 0xa6, 0x6e, 0x55, 0x3e, 0xb7, 0xde, 0xbd, 0x98, 0xd4, 0xe9, - 0x7e, 0x6e, 0xfd, 0xef, 0x06, 0x9c, 0xec, 0x03, 0xa6, 0xa3, 0xb9, 0xd3, 0x05, 0x6d, 0xdf, 0x2f, - 0x55, 0x1b, 0x04, 0xba, 0x02, 0x43, 0x89, 0xf0, 0x51, 0x1e, 0x94, 0x89, 0x39, 0x93, 0x97, 0x18, - 0x45, 0x69, 0x39, 0x11, 0x69, 0xb1, 0x95, 0x19, 0x9a, 0x81, 0x31, 0x59, 0xe1, 0x8e, 0x42, 0x51, - 0x77, 0x17, 0xa4, 0x48, 0x72, 0x37, 0x3f, 0x33, 0x60, 0x5a, 0x46, 0x77, 0x23, 0xe6, 0x7e, 0x93, - 0x70, 0xea, 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1, 0x2c, - 0x47, 0x2c, 0xce, 0x9c, 0xec, 0x64, 0x81, 0x7e, 0x36, 0xa0, 0x94, 0xed, 0xb7, 0xe8, 0x6a, 0x3f, - 0x12, 0x7d, 0xda, 0x7e, 0xe5, 0xda, 0x9b, 0x03, 0xec, 0xa3, 0x4a, 0xd4, 0xff, 0x77, 0x9e, 0x6a, - 0xbd, 0x9d, 0x55, 0xf2, 0xda, 0x80, 0x89, 0xce, 0x7e, 0x82, 0x16, 0xfb, 0xf1, 0xea, 0xd1, 0xa4, - 0x2b, 0x97, 0xf6, 0x6f, 0xa8, 0x03, 0xf9, 0x58, 0x06, 0xf2, 0x00, 0xdd, 0xcb, 0x09, 0x84, 0xa6, - 0xc6, 0x4e, 0xa4, 0xac, 0xf1, 0x56, 0x3a, 0x02, 0x6c, 0xe3, 0xad, 0x74, 0x02, 0xd8, 0xc6, 0x5b, - 0x9d, 0x5d, 0x60, 0x1b, 0xfd, 0x6d, 0xc0, 0x54, 0xcf, 0xa7, 0x1e, 0x5d, 0xdb, 0x33, 0xed, 0x1e, - 0x8d, 0xa9, 0xf2, 0xee, 0xbf, 0x40, 0x78, 0xa3, 0x0c, 0xb4, 0xba, 0xde, 0x4e, 0x2e, 0x5a, 0xa2, - 0x6e, 0x19, 0x58, 0xba, 0xf9, 0xec, 0x65, 0xd5, 0x78, 0xfe, 0xb2, 0x6a, 0xbc, 0x78, 0x59, 0x35, - 0xbe, 0x7c, 0x55, 0x1d, 0x78, 0xfe, 0xaa, 0x3a, 0xf0, 0xdb, 0xab, 0xea, 0xc0, 0x47, 0x38, 0xd3, - 0x61, 0xda, 0x5c, 0x6f, 0x2c, 0xe0, 0xcd, 0x8e, 0x52, 0x12, 0xed, 0xa6, 0x56, 0x94, 0xff, 0xc0, - 0x2f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x52, 0x6d, 0xb1, 0x2d, 0x19, 0x11, 0x00, 0x00, + // 1458 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0x13, 0xc7, + 0x17, 0xcf, 0x18, 0xc7, 0x49, 0x5e, 0x7e, 0x90, 0x4c, 0x10, 0xda, 0x58, 0xf9, 0x3a, 0x64, 0xf9, + 0x11, 0x08, 0xe0, 0x55, 0x80, 0xaf, 0x02, 0x1c, 0x80, 0x3a, 0x50, 0x15, 0x44, 0xab, 0x60, 0x02, + 0x48, 0xad, 0xda, 0xed, 0x7a, 0x77, 0xe2, 0x6c, 0xb1, 0x77, 0xcc, 0xec, 0x6c, 0x48, 0x14, 0xe5, + 0x52, 0x71, 0xa8, 0x38, 0x55, 0xed, 0xb9, 0x87, 0xde, 0xaa, 0x4a, 0x95, 0x7a, 0xee, 0xad, 0x37, + 0x8e, 0xa8, 0xbd, 0x54, 0xaa, 0x44, 0x11, 0x54, 0xe2, 0xce, 0x3f, 0xd0, 0x6a, 0x7e, 0xac, 0xb3, + 0x76, 0xfc, 0x23, 0x86, 0x56, 0xbd, 0xe0, 0x9d, 0x37, 0xef, 0x7d, 0xde, 0xe7, 0xfd, 0x98, 0x99, + 0x47, 0xe0, 0x68, 0xc5, 0x59, 0x77, 0x02, 0xc2, 0x2d, 0xf1, 0x6b, 0x85, 0x51, 0x29, 0x74, 0x99, + 0x5f, 0xe3, 0x3e, 0x0d, 0xac, 0x07, 0x11, 0x61, 0x9b, 0xf9, 0x1a, 0xa3, 0x9c, 0xe2, 0x29, 0xad, + 0x96, 0x17, 0xbf, 0xf9, 0xa4, 0x5a, 0x76, 0xde, 0xa5, 0x61, 0x95, 0x86, 0x56, 0xc9, 0x09, 0x89, + 0xb2, 0xb1, 0xd6, 0x17, 0x4a, 0x84, 0x3b, 0x0b, 0x56, 0xcd, 0x29, 0xfb, 0x81, 0x23, 0xb4, 0x14, + 0x4c, 0x36, 0x97, 0xd4, 0x8d, 0xb5, 0x5c, 0xea, 0xc7, 0xfb, 0x07, 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, 0x33, 0x17, 0x61, 0xaa, 0x85, 0xbd, 0x66, 0x97, 0x85, 0xc1, 0x9a, 0x96, 0x19, + 0xe8, 0xd0, 0x3e, 0x11, 0x51, 0xbc, 0x36, 0x31, 0x8c, 0xd7, 0x0d, 0xe3, 0x84, 0x3b, 0x30, 0x91, + 0x90, 0x69, 0x90, 0x9b, 0x30, 0x24, 0x3c, 0xda, 0x7e, 0xb0, 0x4a, 0x25, 0xca, 0xf0, 0x99, 0x13, + 0x1d, 0x02, 0x15, 0xb6, 0xd7, 0x83, 0x55, 0x7a, 0x9b, 0xb3, 0xc8, 0xe5, 0x3a, 0xf3, 0x83, 0x42, + 0x45, 0x48, 0xcd, 0xc7, 0x69, 0x18, 0x6b, 0x54, 0xe9, 0x94, 0x77, 0x8c, 0x21, 0x5d, 0xab, 0x38, + 0x81, 0x91, 0x92, 0x72, 0xf9, 0x8d, 0xe7, 0x60, 0xbf, 0x17, 0x31, 0xd9, 0xd4, 0x76, 0x89, 0x46, + 0xe5, 0x35, 0x6e, 0xec, 0x3b, 0x84, 0x8e, 0xa7, 0x8b, 0x63, 0xb1, 0xb8, 0x20, 0xa5, 0xf8, 0x30, + 0x8c, 0xd6, 0x15, 0x2b, 0x64, 0x95, 0x1b, 0x69, 0xa9, 0x36, 0x12, 0x0b, 0x6f, 0x92, 0x55, 0x8e, + 0x67, 0x61, 0xa4, 0x4a, 0x03, 0xbe, 0x66, 0x93, 0x8d, 0x9a, 0xcf, 0x36, 0x8d, 0x7e, 0xa9, 0x33, + 0x2c, 0x65, 0xd7, 0xa4, 0x08, 0x1f, 0x81, 0x31, 0xa5, 0x22, 0x0e, 0x08, 0xe5, 0x4e, 0xc5, 0xc8, + 0x28, 0x20, 0x29, 0x5d, 0x8a, 0x56, 0x84, 0x0c, 0x9b, 0x30, 0x5a, 0xd7, 0x92, 0xde, 0x06, 0x12, + 0x48, 0x4b, 0x91, 0x74, 0x66, 0xc0, 0x80, 0x5b, 0x89, 0x42, 0x4e, 0x98, 0x31, 0x28, 0x23, 0x8a, + 0x97, 0xf8, 0x28, 0xd4, 0xd9, 0x6b, 0x1f, 0x43, 0xd2, 0xbc, 0x1e, 0x81, 0x72, 0x72, 0x16, 0x0e, + 0x3a, 0x11, 0xa7, 0x36, 0x23, 0x01, 0x79, 0xe8, 0x54, 0xec, 0x80, 0x6c, 0x70, 0x5b, 0x66, 0x68, + 0x58, 0xe2, 0x4d, 0x8a, 0xdd, 0xa2, 0xda, 0xfc, 0x80, 0x6c, 0xf0, 0x65, 0x91, 0xb0, 0x4f, 0x60, + 0x72, 0x35, 0xe2, 0x11, 0x23, 0x76, 0x43, 0x3b, 0x8d, 0xc8, 0xa6, 0x3d, 0xdd, 0xa1, 0x96, 0xef, + 0x4a, 0xab, 0x64, 0xeb, 0x16, 0xf1, 0xea, 0x2e, 0x19, 0x5e, 0x80, 0x8c, 0xcb, 0x88, 0xe7, 0x73, + 0x63, 0x54, 0x42, 0x4e, 0xe5, 0xd5, 0xbd, 0x95, 0x17, 0xf7, 0x56, 0x5e, 0xdf, 0x5b, 0xf9, 0x25, + 0xea, 0x07, 0x45, 0xad, 0x78, 0x23, 0x3d, 0x08, 0xe3, 0xc3, 0xe6, 0x0c, 0xfc, 0x4f, 0xf6, 0x9b, + 0x60, 0xba, 0x42, 0xdf, 0xdf, 0x49, 0x79, 0xdc, 0x90, 0xcb, 0xb0, 0x7f, 0xc5, 0xaf, 0x12, 0xa6, + 0xa4, 0xa2, 0x67, 0x3a, 0x76, 0x4b, 0x73, 0x2d, 0x53, 0xbb, 0x6a, 0x69, 0x6e, 0x40, 0xae, 0x9d, + 0x4b, 0xdd, 0xef, 0x77, 0x61, 0x34, 0x99, 0x84, 0x50, 0xf7, 0xfc, 0x7c, 0x87, 0x3c, 0x35, 0x71, + 0xd4, 0x4d, 0xdf, 0x08, 0x63, 0xde, 0x80, 0x23, 0xd2, 0x73, 0x32, 0x75, 0x2b, 0xf2, 0xba, 0xf5, + 0xee, 0x84, 0x4e, 0x99,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, 0x9b, 0x1f, 0x1f, 0xbc, 0xd8, 0x8d, 0x57, 0x9b, 0x69, 0x23, 0x7b, + 0xbe, 0x77, 0x43, 0x1d, 0xc8, 0xa7, 0x32, 0x90, 0x7b, 0xf8, 0x4e, 0x87, 0x40, 0x48, 0x6c, 0x6c, + 0x33, 0x65, 0x6d, 0x6d, 0xc5, 0x43, 0xc1, 0xb6, 0xb5, 0x15, 0x0f, 0x2c, 0xdb, 0xd6, 0x56, 0xf3, + 0x2b, 0xb0, 0xfd, 0x45, 0x0a, 0xe1, 0xd7, 0x08, 0x8c, 0x76, 0x63, 0x47, 0xf7, 0x52, 0x76, 0x19, + 0x58, 0xde, 0x22, 0xf2, 0x8f, 0x64, 0xe4, 0x77, 0xf0, 0xed, 0x3d, 0x45, 0x1e, 0x07, 0xdc, 0x32, + 0x05, 0xbb, 0xe2, 0xc6, 0x7f, 0x21, 0x98, 0x6a, 0xfb, 0xc4, 0xe1, 0x2b, 0x7b, 0x26, 0xdd, 0xe6, + 0x41, 0xce, 0xbe, 0xf3, 0x16, 0x08, 0x3a, 0xfe, 0x8f, 0x7b, 0xaa, 0x7c, 0xfd, 0xb5, 0xdf, 0x49, + 0x40, 0x5d, 0xd4, 0x2a, 0x03, 0x85, 0xeb, 0x4f, 0x5e, 0xe4, 0xd0, 0xd3, 0x17, 0x39, 0xf4, 0xfc, + 0x45, 0x0e, 0x7d, 0xf9, 0x32, 0xd7, 0xf7, 0xf4, 0x65, 0xae, 0xef, 0xb7, 0x97, 0xb9, 0xbe, 0x0f, + 0xad, 0xc4, 0xcb, 0xda, 0xe0, 0x7a, 0xfd, 0x9c, 0xb5, 0xd1, 0x74, 0x84, 0xc4, 0x33, 0x5b, 0xca, + 0xc8, 0xbf, 0xc0, 0x9c, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x41, 0x28, 0x84, 0xda, 0x12, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1149,7 +1220,10 @@ type QueryClient interface { // Queries a list of Current items. TrackedUsage(ctx context.Context, in *QuerySubscriptionTrackedUsageRequest, opts ...grpc.CallOption) (*QuerySubscriptionTrackedUsageResponse, error) // Queries a rewards estimation. + // Deprecated: please use EstimatedProviderRewards EstimatedRewards(ctx context.Context, in *QueryEstimatedRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedRewardsResponse, error) + // Queries a rewards estimation. + EstimatedProviderRewards(ctx context.Context, in *QueryEstimatedProviderRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedRewardsResponse, error) EstimatedValidatorRewards(ctx context.Context, in *QueryEstimatedValidatorRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedValidatorRewardsResponse, error) } @@ -1215,6 +1289,7 @@ func (c *queryClient) TrackedUsage(ctx context.Context, in *QuerySubscriptionTra return out, nil } +// Deprecated: Do not use. func (c *queryClient) EstimatedRewards(ctx context.Context, in *QueryEstimatedRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedRewardsResponse, error) { out := new(QueryEstimatedRewardsResponse) err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/EstimatedRewards", in, out, opts...) @@ -1224,6 +1299,15 @@ func (c *queryClient) EstimatedRewards(ctx context.Context, in *QueryEstimatedRe return out, nil } +func (c *queryClient) EstimatedProviderRewards(ctx context.Context, in *QueryEstimatedProviderRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedRewardsResponse, error) { + out := new(QueryEstimatedRewardsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/EstimatedProviderRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) EstimatedValidatorRewards(ctx context.Context, in *QueryEstimatedValidatorRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedValidatorRewardsResponse, error) { out := new(QueryEstimatedValidatorRewardsResponse) err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/EstimatedValidatorRewards", in, out, opts...) @@ -1248,7 +1332,10 @@ type QueryServer interface { // Queries a list of Current items. TrackedUsage(context.Context, *QuerySubscriptionTrackedUsageRequest) (*QuerySubscriptionTrackedUsageResponse, error) // Queries a rewards estimation. + // Deprecated: please use EstimatedProviderRewards EstimatedRewards(context.Context, *QueryEstimatedRewardsRequest) (*QueryEstimatedRewardsResponse, error) + // Queries a rewards estimation. + EstimatedProviderRewards(context.Context, *QueryEstimatedProviderRewardsRequest) (*QueryEstimatedRewardsResponse, error) EstimatedValidatorRewards(context.Context, *QueryEstimatedValidatorRewardsRequest) (*QueryEstimatedValidatorRewardsResponse, error) } @@ -1277,6 +1364,9 @@ func (*UnimplementedQueryServer) TrackedUsage(ctx context.Context, req *QuerySub func (*UnimplementedQueryServer) EstimatedRewards(ctx context.Context, req *QueryEstimatedRewardsRequest) (*QueryEstimatedRewardsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EstimatedRewards not implemented") } +func (*UnimplementedQueryServer) EstimatedProviderRewards(ctx context.Context, req *QueryEstimatedProviderRewardsRequest) (*QueryEstimatedRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimatedProviderRewards not implemented") +} func (*UnimplementedQueryServer) EstimatedValidatorRewards(ctx context.Context, req *QueryEstimatedValidatorRewardsRequest) (*QueryEstimatedValidatorRewardsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EstimatedValidatorRewards not implemented") } @@ -1411,6 +1501,24 @@ func _Query_EstimatedRewards_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_EstimatedProviderRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEstimatedProviderRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EstimatedProviderRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.subscription.Query/EstimatedProviderRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimatedProviderRewards(ctx, req.(*QueryEstimatedProviderRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_EstimatedValidatorRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryEstimatedValidatorRewardsRequest) if err := dec(in); err != nil { @@ -1461,6 +1569,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "EstimatedRewards", Handler: _Query_EstimatedRewards_Handler, }, + { + MethodName: "EstimatedProviderRewards", + Handler: _Query_EstimatedProviderRewards_Handler, + }, { MethodName: "EstimatedValidatorRewards", Handler: _Query_EstimatedValidatorRewards_Handler, @@ -2041,6 +2153,43 @@ func (m *QueryEstimatedRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryEstimatedProviderRewardsRequest) 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 *QueryEstimatedProviderRewardsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEstimatedProviderRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AmountDelegator) > 0 { + i -= len(m.AmountDelegator) + copy(dAtA[i:], m.AmountDelegator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AmountDelegator))) + i-- + dAtA[i] = 0x12 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EstimatedRewardInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2105,6 +2254,11 @@ func (m *QueryEstimatedRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.RecommendedBlock != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.RecommendedBlock)) + i-- + dAtA[i] = 0x18 + } if len(m.Total) > 0 { for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { { @@ -2480,6 +2634,23 @@ func (m *QueryEstimatedRewardsRequest) Size() (n int) { return n } +func (m *QueryEstimatedProviderRewardsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AmountDelegator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *EstimatedRewardInfo) Size() (n int) { if m == nil { return 0 @@ -2517,6 +2688,9 @@ func (m *QueryEstimatedRewardsResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } + if m.RecommendedBlock != 0 { + n += 1 + sovQuery(uint64(m.RecommendedBlock)) + } return n } @@ -4129,6 +4303,120 @@ func (m *QueryEstimatedRewardsRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryEstimatedProviderRewardsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryEstimatedProviderRewardsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEstimatedProviderRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountDelegator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AmountDelegator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EstimatedRewardInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4303,7 +4591,7 @@ func (m *QueryEstimatedRewardsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Info = append(m.Info, &EstimatedRewardInfo{}) + m.Info = append(m.Info, EstimatedRewardInfo{}) if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4342,6 +4630,25 @@ func (m *QueryEstimatedRewardsResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RecommendedBlock", wireType) + } + m.RecommendedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RecommendedBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/subscription/types/query.pb.gw.go b/x/subscription/types/query.pb.gw.go index 51e6e69a42..62ef16cb99 100644 --- a/x/subscription/types/query.pb.gw.go +++ b/x/subscription/types/query.pb.gw.go @@ -347,6 +347,82 @@ func local_request_Query_EstimatedRewards_0(ctx context.Context, marshaler runti } +func request_Query_EstimatedProviderRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEstimatedProviderRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + val, ok = pathParams["amount_delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount_delegator") + } + + protoReq.AmountDelegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount_delegator", err) + } + + msg, err := client.EstimatedProviderRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_EstimatedProviderRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEstimatedProviderRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + val, ok = pathParams["amount_delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount_delegator") + } + + protoReq.AmountDelegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount_delegator", err) + } + + msg, err := server.EstimatedProviderRewards(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_EstimatedValidatorRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryEstimatedValidatorRewardsRequest var metadata runtime.ServerMetadata @@ -590,6 +666,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_EstimatedProviderRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_EstimatedProviderRewards_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EstimatedProviderRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_EstimatedValidatorRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -794,6 +893,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_EstimatedProviderRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_EstimatedProviderRewards_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EstimatedProviderRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_EstimatedValidatorRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -832,6 +951,8 @@ var ( pattern_Query_EstimatedRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"lavanet", "lava", "subscription", "estimated_rewards", "provider", "chain_id", "amount_delegator"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EstimatedProviderRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"lavanet", "lava", "subscription", "estimated_provider_rewards", "provider", "amount_delegator"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EstimatedValidatorRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"lavanet", "lava", "subscription", "estimated_validator_rewards", "validator", "amount_delegator"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -850,5 +971,7 @@ var ( forward_Query_EstimatedRewards_0 = runtime.ForwardResponseMessage + forward_Query_EstimatedProviderRewards_0 = runtime.ForwardResponseMessage + forward_Query_EstimatedValidatorRewards_0 = runtime.ForwardResponseMessage ) diff --git a/x/subscription/types/subscription.pb.go b/x/subscription/types/subscription.pb.go index f36117e3fa..c0debc0794 100644 --- a/x/subscription/types/subscription.pb.go +++ b/x/subscription/types/subscription.pb.go @@ -266,41 +266,42 @@ func init() { } var fileDescriptor_c3bc5507ca237d79 = []byte{ - // 544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xb6, 0xac, 0x6b, 0xdd, 0x9f, 0xf3, 0x26, 0xe4, 0x55, 0x22, 0x54, 0x05, 0x44, 0x85, - 0x20, 0xd1, 0xe8, 0x81, 0x7b, 0x27, 0x90, 0x56, 0x21, 0x84, 0xca, 0x4e, 0x1c, 0x88, 0x9c, 0xd4, - 0x6d, 0x23, 0x92, 0xb8, 0x72, 0xec, 0x92, 0xfd, 0x17, 0xfc, 0x59, 0x3b, 0xa1, 0x1d, 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88, 0x87, 0xe6, 0xf5, 0xf7, - 0x07, 0xa5, 0x71, 0x4e, 0x1f, 0x99, 0x95, 0x6a, 0x1b, 0x8d, 0xcc, 0x4a, 0xbd, 0xdd, 0x18, 0x99, - 0x95, 0x56, 0xbb, 0xdd, 0xfb, 0x6a, 0x20, 0x7c, 0xbb, 0xd5, 0x3b, 0x5c, 0xb8, 0xeb, 0xa9, 0xbd, - 0xbb, 0x3d, 0xb5, 0xff, 0x0f, 0x9e, 0x32, 0xff, 0xe8, 0xa9, 0xdf, 0x23, 0x1e, 0xfc, 0xd7, 0x88, - 0xc3, 0x8b, 0xeb, 0x95, 0x65, 0xdc, 0xac, 0x2c, 0xe3, 0xc7, 0xca, 0x32, 0xbe, 0xac, 0xad, 0xd2, - 0xcd, 0xda, 0x2a, 0x7d, 0x5b, 0x5b, 0xa5, 0x0f, 0xce, 0x2c, 0x90, 0x73, 0xe5, 0xd9, 0x3e, 0x8f, - 0x9c, 0x9d, 0x4f, 0xbf, 0x1c, 0x38, 0xe9, 0xee, 0xcf, 0x97, 0x57, 0x0b, 0x96, 0x78, 0x65, 0xf8, - 0xa2, 0x83, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x03, 0x42, 0x4d, 0x23, 0x04, 0x00, 0x00, + // 546 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x5f, 0x6f, 0xd3, 0x3e, + 0x14, 0x6d, 0xb6, 0xb4, 0x6b, 0xdd, 0xbf, 0xf3, 0xa6, 0x9f, 0xbc, 0x4a, 0xbf, 0x50, 0x15, 0x10, + 0x15, 0x82, 0x44, 0x63, 0x48, 0xbc, 0x77, 0x02, 0x69, 0x15, 0x42, 0xa8, 0xec, 0x89, 0x07, 0x22, + 0x27, 0x75, 0xdb, 0x88, 0x24, 0xae, 0x1c, 0xbb, 0x64, 0xdf, 0x82, 0x8f, 0xb5, 0x27, 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ce, 0x83, 0x78, 0x68, 0x5e, + 0x7f, 0xbb, 0x57, 0x1a, 0xe7, 0xf4, 0x91, 0x59, 0xad, 0x75, 0xd0, 0xc8, 0xac, 0x36, 0x3a, 0xcd, + 0x91, 0x59, 0x6d, 0x77, 0x3a, 0xfd, 0x2f, 0x06, 0xc2, 0xb7, 0x5b, 0xbd, 0xc3, 0x85, 0xbb, 0x9e, + 0xda, 0xbb, 0xdb, 0x53, 0xfb, 0x7f, 0xe1, 0x29, 0xf3, 0xb7, 0x9e, 0xfa, 0x35, 0x62, 0xf9, 0x9f, + 0x46, 0x1c, 0x5e, 0x5c, 0xaf, 0x2c, 0xe3, 0x66, 0x65, 0x19, 0xdf, 0x57, 0x96, 0xf1, 0x79, 0x6d, + 0x95, 0x6e, 0xd6, 0x56, 0xe9, 0xeb, 0xda, 0x2a, 0xbd, 0x77, 0x66, 0x81, 0x9c, 0x2b, 0xcf, 0xf6, + 0x79, 0xe4, 0xec, 0x7c, 0xfa, 0xe5, 0x73, 0x27, 0xdd, 0xfd, 0xf9, 0xf2, 0x6a, 0xc1, 0x12, 0xaf, + 0x02, 0x5f, 0xf4, 0xec, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0xaa, 0x60, 0xf8, 0x23, 0x04, + 0x00, 0x00, } func (m *Subscription) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/tx.pb.go b/x/subscription/types/tx.pb.go index 4bae4295e5..d631e3339a 100644 --- a/x/subscription/types/tx.pb.go +++ b/x/subscription/types/tx.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v3/x/projects/types" + types "github.com/lavanet/lava/v4/x/projects/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -449,39 +449,39 @@ 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, 0xb0, 0xdd, 0x7a, 0x5b, 0xb5, 0x0b, 0xa0, 0x4a, 0x53, 0xb8, 0xc1, 0xa1, 0x72, 0x13, 0x2b, - 0x0d, 0xb4, 0x76, 0x14, 0x3b, 0xa5, 0xfd, 0x0a, 0x9c, 0x90, 0xe0, 0xc6, 0x97, 0xe0, 0x63, 0xec, - 0xb8, 0x23, 0x12, 0x12, 0x42, 0xed, 0x81, 0xaf, 0x81, 0xe2, 0x24, 0x4d, 0x02, 0x74, 0xd9, 0x25, - 0x7e, 0xef, 0xf9, 0xe7, 0xf7, 0xfb, 0xf9, 0xbd, 0x17, 0x43, 0x73, 0x82, 0x67, 0x98, 0x12, 0x61, - 0x27, 0xab, 0xcd, 0xe3, 0x11, 0x77, 0xa3, 0x20, 0x14, 0x01, 0xa3, 0xb6, 0x98, 0x5b, 0x61, 0xc4, - 0x04, 0x43, 0x0f, 0x32, 0x8c, 0x95, 0xac, 0x56, 0x19, 0xa3, 0xdf, 0xc7, 0xd3, 0x80, 0x32, 0x5b, - 0x7e, 0x53, 0xb4, 0xfe, 0xa4, 0x92, 0x31, 0x8c, 0xd8, 0x3b, 0xe2, 0x0a, 0x9e, 0x1b, 0x19, 0x68, - 0xd7, 0x67, 0x3e, 0x93, 0xa6, 0x9d, 0x58, 0x69, 0xd4, 0xfc, 0x01, 0xa0, 0x3a, 0xe0, 0x7e, 0x3f, - 0x5e, 0x20, 0x0d, 0x6e, 0xbb, 0x11, 0xc1, 0x82, 0x45, 0x1a, 0x38, 0x04, 0xdd, 0xdb, 0x4e, 0xee, - 0x22, 0x1d, 0xb6, 0x5c, 0x46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xff, 0xff, 0xa2, 0x31, 0x09, 0xee, 0x44, 0x05, 0x00, 0x00, + 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, 0xbf, 0x8b, 0xa7, 0x01, 0x65, 0xb6, + 0xfc, 0xa6, 0x68, 0xfd, 0x51, 0x25, 0x63, 0x18, 0xb1, 0x77, 0xc4, 0x15, 0x3c, 0x37, 0x32, 0xd0, + 0xae, 0xcf, 0x7c, 0x26, 0x4d, 0x3b, 0xb1, 0xd2, 0xa8, 0xf9, 0x03, 0x40, 0x75, 0xc0, 0xfd, 0x7e, + 0xbc, 0x40, 0x1a, 0xdc, 0x76, 0x23, 0x82, 0x05, 0x8b, 0x34, 0x70, 0x08, 0xba, 0x37, 0x9d, 0xdc, + 0x45, 0x3a, 0x6c, 0xb9, 0x8c, 0xf2, 0x78, 0x4a, 0x22, 0xed, 0x86, 0xdc, 0x5a, 0xfb, 0x68, 0x17, + 0x6e, 0x05, 0xd4, 0x23, 0x73, 0xad, 0x29, 0x37, 0x52, 0x27, 0x39, 0xe1, 0xc5, 0x11, 0x4e, 0x04, + 0x6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8a, 0x47, 0x93, 0x94, 0xb9, 0xe5, 0x64, 0x5e, 0x65, + 0x6a, 0x9a, 0x9b, 0xa6, 0x46, 0x29, 0x4d, 0x4d, 0xef, 0x41, 0xa2, 0x56, 0xab, 0xd6, 0xa8, 0x90, + 0x60, 0x6a, 0x70, 0xbf, 0x2a, 0x2a, 0xd7, 0x7b, 0xf2, 0xb5, 0x09, 0x9b, 0x03, 0xee, 0xa3, 0xd7, + 0xb0, 0x99, 0x4c, 0xf2, 0x91, 0xb5, 0xf1, 0xf7, 0xb1, 0xd2, 0x79, 0xd0, 0x8f, 0x6b, 0x21, 0x79, + 0x72, 0x34, 0x86, 0xb0, 0x34, 0x2e, 0xdd, 0xab, 0x0f, 0x16, 0x48, 0xfd, 0xc9, 0x75, 0x91, 0x65, + 0xa6, 0x52, 0xa7, 0x6b, 0x98, 0x0a, 0x64, 0x1d, 0xd3, 0xbf, 0x0d, 0x46, 0xef, 0x61, 0xbb, 0xdc, + 0xdc, 0x9a, 0x6a, 0x94, 0xa0, 0xfa, 0xd3, 0x6b, 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, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/timerstore/client/cli/query.go b/x/timerstore/client/cli/query.go index e779583f95..8dc9c991d3 100644 --- a/x/timerstore/client/cli/query.go +++ b/x/timerstore/client/cli/query.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/client/cli/query_all_timers.go b/x/timerstore/client/cli/query_all_timers.go index 26e89e2c38..b4f12f9dba 100644 --- a/x/timerstore/client/cli/query_all_timers.go +++ b/x/timerstore/client/cli/query_all_timers.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/client/cli/query_next.go b/x/timerstore/client/cli/query_next.go index 0b9b6830d1..767372ab8d 100644 --- a/x/timerstore/client/cli/query_next.go +++ b/x/timerstore/client/cli/query_next.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/client/cli/query_store_keys.go b/x/timerstore/client/cli/query_store_keys.go index 397fc1f66c..1858047069 100644 --- a/x/timerstore/client/cli/query_store_keys.go +++ b/x/timerstore/client/cli/query_store_keys.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/keeper/grpc_query_all_timers.go b/x/timerstore/keeper/grpc_query_all_timers.go index cd5e1a61e4..7250d26a18 100644 --- a/x/timerstore/keeper/grpc_query_all_timers.go +++ b/x/timerstore/keeper/grpc_query_all_timers.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/timerstore/keeper/grpc_query_next.go b/x/timerstore/keeper/grpc_query_next.go index a8753db700..ce758780cf 100644 --- a/x/timerstore/keeper/grpc_query_next.go +++ b/x/timerstore/keeper/grpc_query_next.go @@ -5,8 +5,8 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/v3/utils/common/types" - "github.com/lavanet/lava/v3/x/timerstore/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/timerstore/keeper/grpc_query_store_keys.go b/x/timerstore/keeper/grpc_query_store_keys.go index 3a1c213fec..ad5029a84a 100644 --- a/x/timerstore/keeper/grpc_query_store_keys.go +++ b/x/timerstore/keeper/grpc_query_store_keys.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/timerstore/keeper/keeper.go b/x/timerstore/keeper/keeper.go index ac7386f019..925d267083 100644 --- a/x/timerstore/keeper/keeper.go +++ b/x/timerstore/keeper/keeper.go @@ -4,7 +4,7 @@ import ( "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/v3/x/timerstore/types" + timerstoretypes "github.com/lavanet/lava/v4/x/timerstore/types" ) func NewKeeper(cdc codec.BinaryCodec) *Keeper { diff --git a/x/timerstore/module.go b/x/timerstore/module.go index 2fc0ae3190..24b6d590d5 100644 --- a/x/timerstore/module.go +++ b/x/timerstore/module.go @@ -8,9 +8,9 @@ import ( 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/v3/x/timerstore/client/cli" - timerstorekeeper "github.com/lavanet/lava/v3/x/timerstore/keeper" - "github.com/lavanet/lava/v3/x/timerstore/types" + "github.com/lavanet/lava/v4/x/timerstore/client/cli" + timerstorekeeper "github.com/lavanet/lava/v4/x/timerstore/keeper" + "github.com/lavanet/lava/v4/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/types/query.pb.go b/x/timerstore/types/query.pb.go index 8b6b5756f8..146b095c03 100644 --- a/x/timerstore/types/query.pb.go +++ b/x/timerstore/types/query.pb.go @@ -505,7 +505,7 @@ var fileDescriptor_67348a2ef655ad3f = []byte{ // 595 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, 0x10, 0xb6, 0x13, 0xb7, 0xe0, 0x29, 0xa8, 0xcd, 0x0a, 0xda, 0x28, 0x20, 0x13, 0xb9, 0x20, 0x85, - 0x22, 0xbc, 0x52, 0xca, 0x01, 0xf5, 0x44, 0x23, 0xa4, 0x06, 0x51, 0xa1, 0x62, 0x38, 0x71, 0xa0, + 0x22, 0xbc, 0x52, 0xe8, 0x01, 0xf5, 0x44, 0x23, 0xa4, 0x06, 0x51, 0xa1, 0x62, 0x38, 0x71, 0xa0, 0x72, 0xd2, 0xad, 0x6b, 0xc5, 0xf5, 0xa6, 0xf1, 0xa6, 0xc4, 0xaa, 0xca, 0x81, 0x27, 0x40, 0xe2, 0xc4, 0x4b, 0xf0, 0x1c, 0x3d, 0x70, 0xa8, 0xc4, 0x85, 0x13, 0x42, 0x09, 0x0f, 0xc0, 0x23, 0xa0, 0x5d, 0x6f, 0x5c, 0xe7, 0xc7, 0x34, 0x82, 0x93, 0xc7, 0xb3, 0xdf, 0x7e, 0xf3, 0xcd, 0x37, 0x63, @@ -535,11 +535,11 @@ var fileDescriptor_67348a2ef655ad3f = []byte{ 0xbb, 0xf1, 0x2b, 0x3e, 0x49, 0x1c, 0x3d, 0xc5, 0x27, 0xb1, 0x65, 0xa7, 0xe8, 0xb3, 0x0a, 0x7a, 0x32, 0xd8, 0xcb, 0x04, 0x8f, 0x2f, 0xd9, 0x65, 0x82, 0x27, 0x36, 0xc6, 0x7c, 0x20, 0x04, 0xdf, 0x43, 0xab, 0x99, 0x82, 0x13, 0x91, 0x21, 0xd7, 0xa6, 0xf1, 0x59, 0xa2, 0xfb, 0x7f, 0x2f, 0x93, - 0x5a, 0x9c, 0xd2, 0xda, 0x2c, 0x50, 0x29, 0x66, 0x43, 0x88, 0x79, 0x84, 0xaa, 0x99, 0x62, 0xf8, - 0xe8, 0xa7, 0xfa, 0x56, 0xdb, 0x3a, 0xeb, 0x1b, 0xea, 0x79, 0xdf, 0x50, 0x7f, 0xf6, 0x0d, 0xf5, - 0xe3, 0xc0, 0x50, 0xce, 0x07, 0x86, 0xf2, 0x7d, 0x60, 0x28, 0x6f, 0x1e, 0xba, 0x1e, 0x3b, 0xe8, - 0x36, 0xac, 0x26, 0x3d, 0x1c, 0xe5, 0x3d, 0x5e, 0xc7, 0xbd, 0x91, 0x7f, 0x6c, 0xd4, 0x26, 0x61, - 0x63, 0x5e, 0xfc, 0x64, 0xd7, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x10, 0x1f, 0xd8, 0xfd, 0xfd, + 0x5a, 0x9c, 0xd2, 0xda, 0x2c, 0x50, 0x29, 0x66, 0x43, 0x88, 0x59, 0x47, 0xd5, 0x4c, 0x31, 0x7c, + 0xf4, 0x53, 0x7d, 0xab, 0x6d, 0x9d, 0xf5, 0x0d, 0xf5, 0xbc, 0x6f, 0xa8, 0x3f, 0xfb, 0x86, 0xfa, + 0x71, 0x60, 0x28, 0xe7, 0x03, 0x43, 0xf9, 0x3e, 0x30, 0x94, 0x37, 0x0f, 0x5d, 0x8f, 0x1d, 0x74, + 0x1b, 0x56, 0x93, 0x1e, 0x8e, 0xf2, 0x1e, 0xaf, 0xe3, 0xde, 0xc8, 0x3f, 0x36, 0x6a, 0x93, 0xb0, + 0x31, 0x2f, 0x7e, 0xb2, 0x8f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x43, 0xec, 0xd1, 0xf9, 0xfd, 0x05, 0x00, 0x00, } diff --git a/x/timerstore/types/timer.go b/x/timerstore/types/timer.go index b4f0a66678..99b84910f8 100644 --- a/x/timerstore/types/timer.go +++ b/x/timerstore/types/timer.go @@ -8,7 +8,7 @@ import ( "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/v3/utils/common/types" + commontypes "github.com/lavanet/lava/v4/utils/common/types" ) // TimerStore manages timers to efficiently support future timeouts. Timeouts diff --git a/x/timerstore/types/timer.pb.go b/x/timerstore/types/timer.pb.go index 3fa445a3a0..72c7ab1802 100644 --- a/x/timerstore/types/timer.pb.go +++ b/x/timerstore/types/timer.pb.go @@ -169,28 +169,29 @@ func init() { } var fileDescriptor_0bfa2b3f0d19f843 = []byte{ - // 336 bytes of a gzipped FileDescriptorProto + // 337 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xc1, 0x6a, 0xf2, 0x40, 0x10, 0xc7, 0x13, 0x8d, 0xdf, 0x47, 0xd7, 0x88, 0x75, 0x11, 0x1a, 0x7a, 0x48, 0xc5, 0x42, 0x11, - 0xa1, 0x09, 0xd4, 0x37, 0x10, 0xc4, 0xde, 0x0a, 0xb1, 0xbd, 0xf4, 0x22, 0xd1, 0x0e, 0x71, 0x51, - 0x77, 0x65, 0x77, 0x0c, 0xfa, 0x16, 0x7d, 0x8c, 0x3e, 0x8a, 0x47, 0x8f, 0x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01, 0xd2, 0x53, 0x52, 0x9c, 0xc2, 0xda, 0xac, 0xea, 0x24, 0xd2, 0x92, 0xd6, 0x49, - 0x29, 0x8d, 0x67, 0x4b, 0xc8, 0x57, 0x93, 0x25, 0x94, 0x12, 0xe7, 0x29, 0xc6, 0xd8, 0x6c, 0xc1, - 0x8d, 0x8c, 0xee, 0xf6, 0x37, 0x3b, 0xdf, 0xde, 0xee, 0x7c, 0xfb, 0x7d, 0xe7, 0xdb, 0xcf, 0x7b, - 0xdf, 0xda, 0xee, 0x7d, 0xeb, 0x75, 0xef, 0x5b, 0x8f, 0xd7, 0x09, 0xc3, 0xc9, 0x72, 0x14, 0x8c, - 0xc5, 0x3c, 0x3c, 0x3a, 0x7a, 0xda, 0x09, 0x57, 0x47, 0x97, 0x5f, 0x2f, 0x40, 0x8d, 0xfe, 0x99, - 0x5b, 0x76, 0x3e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x0e, 0xa2, 0xfe, 0x21, 0x02, 0x00, 0x00, + 0xa1, 0x09, 0xb4, 0x7d, 0x02, 0x41, 0xec, 0xad, 0x10, 0xdb, 0x4b, 0x2f, 0x12, 0xed, 0x10, 0x17, + 0x75, 0x57, 0x76, 0xc7, 0xa0, 0x6f, 0xd1, 0xc7, 0xe8, 0xa3, 0x78, 0xf4, 0xd8, 0x53, 0x29, 0xfa, + 0x22, 0x65, 0x37, 0xb1, 0xad, 0x94, 0x5e, 0x7a, 0x9a, 0xff, 0xcc, 0xfc, 0xf2, 0xcf, 0xec, 0x0c, + 0x39, 0x9f, 0xc6, 0x69, 0xcc, 0x01, 0x43, 0x1d, 0x43, 0x64, 0x33, 0x90, 0x0a, 0x85, 0x84, 0x4c, + 0x06, 0x73, 0x29, 0x50, 0xd0, 0x93, 0x1c, 0x0a, 0x74, 0x0c, 0xbe, 0xa0, 0xd3, 0x7a, 0x22, 0x12, + 0x61, 0x98, 0x50, 0xab, 0x0c, 0x6f, 0xbe, 0x14, 0x88, 0xdb, 0x03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48, 0xcc, 0xc2, 0x83, 0xa3, 0xa7, 0x37, 0xe1, 0xf2, 0xe0, 0xf2, 0xab, 0x39, 0xa8, 0xe1, 0x3f, + 0x73, 0xcb, 0xeb, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x29, 0xfd, 0xab, 0xfa, 0x21, 0x02, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) {