From f4aaf18096a8f417f56cdc166249d174e0871cf9 Mon Sep 17 00:00:00 2001 From: puneetmahajan Date: Thu, 30 May 2024 14:50:15 +0400 Subject: [PATCH] re-add UpdateLiquidValidatorSet to begin blocker --- x/liquidstake/abci.go | 20 +++++ x/liquidstake/keeper/genesis_test.go | 4 +- x/liquidstake/keeper/grpc_query_test.go | 4 +- x/liquidstake/keeper/hooks.go | 2 +- x/liquidstake/keeper/keeper_test.go | 2 +- x/liquidstake/keeper/liquidstake_test.go | 20 ++--- x/liquidstake/keeper/rebalancing.go | 25 +++--- x/liquidstake/keeper/rebalancing_test.go | 64 +++++++------- x/liquidstake/module.go | 4 +- x/liquidstake/types/liquidstake_test.go | 6 +- x/liquidstake/types/tx.pb.go | 107 ++++++++++++----------- 11 files changed, 144 insertions(+), 114 deletions(-) create mode 100644 x/liquidstake/abci.go diff --git a/x/liquidstake/abci.go b/x/liquidstake/abci.go new file mode 100644 index 000000000..e8375e074 --- /dev/null +++ b/x/liquidstake/abci.go @@ -0,0 +1,20 @@ +package liquidstake + +import ( + "time" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/persistenceOne/pstake-native/v2/x/liquidstake/keeper" + "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types" +) + +func BeginBlock(ctx sdk.Context, k keeper.Keeper) { + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + + if !k.GetParams(ctx).ModulePaused { + // return value of UpdateLiquidValidatorSet is useful only in testing + _ = k.UpdateLiquidValidatorSet(ctx, false) + } +} diff --git a/x/liquidstake/keeper/genesis_test.go b/x/liquidstake/keeper/genesis_test.go index bb2e90ba5..07995a320 100644 --- a/x/liquidstake/keeper/genesis_test.go +++ b/x/liquidstake/keeper/genesis_test.go @@ -25,7 +25,7 @@ func (s *KeeperTestSuite) TestImportExportGenesis() { } params.ModulePaused = false k.SetParams(ctx, params) - k.UpdateLiquidValidatorSet(ctx) + k.UpdateLiquidValidatorSet(ctx, true) stakingAmt := math.NewInt(100000000) s.Require().NoError(s.liquidStaking(s.delAddrs[0], stakingAmt)) @@ -55,7 +55,7 @@ func (s *KeeperTestSuite) TestImportExportGenesis() { func (s *KeeperTestSuite) TestImportExportGenesisEmpty() { k, ctx := s.keeper, s.ctx k.SetParams(ctx, types.DefaultParams()) - k.UpdateLiquidValidatorSet(ctx) + k.UpdateLiquidValidatorSet(ctx, true) genState := k.ExportGenesis(ctx) var genState2 types.GenesisState diff --git a/x/liquidstake/keeper/grpc_query_test.go b/x/liquidstake/keeper/grpc_query_test.go index a2599e5d1..5f2771a1f 100644 --- a/x/liquidstake/keeper/grpc_query_test.go +++ b/x/liquidstake/keeper/grpc_query_test.go @@ -21,7 +21,7 @@ func (s *KeeperTestSuite) TestGRPCQueries() { params := s.keeper.GetParams(s.ctx) params.MinLiquidStakeAmount = math.NewInt(50000) s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // add active validator params.WhitelistedValidators = []types.WhitelistedValidator{ @@ -30,7 +30,7 @@ func (s *KeeperTestSuite) TestGRPCQueries() { {ValidatorAddress: valOpers[2].String(), TargetWeight: math.NewInt(3333)}, } s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // Test LiquidValidators grpc query res := s.keeper.GetAllLiquidValidatorStates(s.ctx) diff --git a/x/liquidstake/keeper/hooks.go b/x/liquidstake/keeper/hooks.go index 9b2f7a5ff..87d73f799 100644 --- a/x/liquidstake/keeper/hooks.go +++ b/x/liquidstake/keeper/hooks.go @@ -35,7 +35,7 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, _ int6 if epochIdentifier == liquidstake.RebalanceEpoch { // return value of UpdateLiquidValidatorSet is useful only in testing - _ = k.UpdateLiquidValidatorSet(ctx) + _ = k.UpdateLiquidValidatorSet(ctx, true) } } diff --git a/x/liquidstake/keeper/keeper_test.go b/x/liquidstake/keeper/keeper_test.go index 22478bdd5..fb0427fe9 100644 --- a/x/liquidstake/keeper/keeper_test.go +++ b/x/liquidstake/keeper/keeper_test.go @@ -64,7 +64,7 @@ func (s *KeeperTestSuite) SetupTest() { params.UnstakeFeeRate = sdk.ZeroDec() params.AutocompoundFeeRate = types.DefaultAutocompoundFeeRate s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // call mint.BeginBlocker for init k.SetLastBlockTime(ctx, ctx.BlockTime()) mint.BeginBlocker(s.ctx, s.app.MintKeeper, minttypes.DefaultInflationCalculationFn) } diff --git a/x/liquidstake/keeper/liquidstake_test.go b/x/liquidstake/keeper/liquidstake_test.go index 0da3ef7d7..79052519f 100644 --- a/x/liquidstake/keeper/liquidstake_test.go +++ b/x/liquidstake/keeper/liquidstake_test.go @@ -18,7 +18,7 @@ func (s *KeeperTestSuite) TestLiquidStake() { params.MinLiquidStakeAmount = math.NewInt(50000) params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := params.MinLiquidStakeAmount @@ -38,7 +38,7 @@ func (s *KeeperTestSuite) TestLiquidStake() { {ValidatorAddress: valOpers[2].String(), TargetWeight: math.NewInt(2000)}, } s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) res := s.keeper.GetAllLiquidValidatorStates(s.ctx) s.Require().Equal(params.WhitelistedValidators[0].ValidatorAddress, @@ -254,7 +254,7 @@ func (s *KeeperTestSuite) TestLiquidStakeFromVestingAccount() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) from := s.delAddrs[0] vestingAmt := s.app.BankKeeper.GetAllBalances(s.ctx, from) @@ -294,7 +294,7 @@ func (s *KeeperTestSuite) TestLiquidStakeFromVestingAccount() { func (s *KeeperTestSuite) TestLiquidStakeEdgeCases() { _, valOpers, _ := s.CreateValidators([]int64{1000000, 2000000, 3000000}) params := s.keeper.GetParams(s.ctx) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(5000000) // add active validator @@ -305,7 +305,7 @@ func (s *KeeperTestSuite) TestLiquidStakeEdgeCases() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // fail Invalid BondDenom case _, err := s.keeper.LiquidStake(s.ctx, types.LiquidStakeProxyAcc, s.delAddrs[0], sdk.NewCoin("bad", stakingAmt)) @@ -318,7 +318,7 @@ func (s *KeeperTestSuite) TestLiquidStakeEdgeCases() { s.Require().NoError(s.liquidStaking(s.delAddrs[0], hugeAmt)) s.Require().NoError(s.liquidUnstaking(s.delAddrs[0], math.NewInt(10), true)) s.Require().NoError(s.liquidUnstaking(s.delAddrs[0], hugeAmt, true)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.completeRedelegationUnbonding() states := s.keeper.GetNetAmountState(s.ctx) states.TotalLiquidTokens.Equal(hugeAmt) @@ -333,7 +333,7 @@ func (s *KeeperTestSuite) TestLiquidUnstakeEdgeCases() { _, valOpers, _ := s.CreateValidators([]int64{1000000, 2000000, 3000000}) params := s.keeper.GetParams(s.ctx) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(5000000) // add active validator @@ -344,7 +344,7 @@ func (s *KeeperTestSuite) TestLiquidUnstakeEdgeCases() { } params.ModulePaused = false s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // success liquid stake s.Require().NoError(s.liquidStaking(s.delAddrs[0], stakingAmt)) @@ -379,7 +379,7 @@ func (s *KeeperTestSuite) TestLiquidUnstakeEdgeCases() { // set empty whitelisted, active liquid validator params.WhitelistedValidators = []types.WhitelistedValidator{} s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // error case where there is a quantity that are unbonding balance or remaining rewards that is not re-stake or withdrawn in netAmount. // NOT APPLICABLE since we do not validator unbond if validator goes inactive. @@ -413,7 +413,7 @@ func (s *KeeperTestSuite) TestShareInflation() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) initialStakingAmt := math.NewInt(1) // little amount initializingStakingAmt := math.NewInt(10000) // normal amount diff --git a/x/liquidstake/keeper/rebalancing.go b/x/liquidstake/keeper/rebalancing.go index 38719897a..bbfc4d646 100644 --- a/x/liquidstake/keeper/rebalancing.go +++ b/x/liquidstake/keeper/rebalancing.go @@ -149,7 +149,7 @@ func (k Keeper) Rebalance( return redelegations } -func (k Keeper) UpdateLiquidValidatorSet(ctx sdk.Context) (redelegations []types.Redelegation) { +func (k Keeper) UpdateLiquidValidatorSet(ctx sdk.Context, redelegate bool) (redelegations []types.Redelegation) { params := k.GetParams(ctx) liquidValidators := k.GetAllLiquidValidators(ctx) liquidValsMap := liquidValidators.Map() @@ -177,18 +177,21 @@ func (k Keeper) UpdateLiquidValidatorSet(ctx sdk.Context) (redelegations []types // rebalancing based updated liquid validators status with threshold, try by cachedCtx // tombstone status also handled on Rebalance - redelegations = k.Rebalance( - ctx, - types.LiquidStakeProxyAcc, - liquidValidators, - whitelistedValsMap, - types.RebalancingTrigger, - ) + if redelegate { + redelegations = k.Rebalance( + ctx, + types.LiquidStakeProxyAcc, + liquidValidators, + whitelistedValsMap, + types.RebalancingTrigger, + ) - // if there are inactive liquid validators, do not unbond, - // instead let validator selection and rebalancing take care of it. + // if there are inactive liquid validators, do not unbond, + // instead let validator selection and rebalancing take care of it. - return redelegations + return redelegations + } + return nil } // AutocompoundStakingRewards withdraws staking rewards and re-stakes when over threshold. diff --git a/x/liquidstake/keeper/rebalancing_test.go b/x/liquidstake/keeper/rebalancing_test.go index 9bded2de0..0f4a3b8d6 100644 --- a/x/liquidstake/keeper/rebalancing_test.go +++ b/x/liquidstake/keeper/rebalancing_test.go @@ -19,7 +19,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { params.UnstakeFeeRate = sdk.ZeroDec() params.MinLiquidStakeAmount = math.NewInt(10000) s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(49998) // add active validator @@ -30,13 +30,13 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - reds := s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds := s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) stkXPRTMintAmt, err := s.keeper.LiquidStake(s.ctx, types.LiquidStakeProxyAcc, s.delAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, stakingAmt)) s.Require().NoError(err) s.Require().Equal(stkXPRTMintAmt, stakingAmt) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) proxyAccDel1, found := s.app.StakingKeeper.GetDelegation(s.ctx, types.LiquidStakeProxyAcc, valOpers[0]) @@ -61,7 +61,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { {ValidatorAddress: valOpers[3].String(), TargetWeight: math.NewInt(2500)}, } s.keeper.SetParams(s.ctx, params) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 3) proxyAccDel1, found = s.app.StakingKeeper.GetDelegation(s.ctx, types.LiquidStakeProxyAcc, valOpers[0]) @@ -104,7 +104,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { {ValidatorAddress: valOpers[4].String(), TargetWeight: math.NewInt(2000)}, } s.keeper.SetParams(s.ctx, params) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 4) proxyAccDel1, found = s.app.StakingKeeper.GetDelegation(s.ctx, types.LiquidStakeProxyAcc, valOpers[0]) @@ -140,7 +140,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { testhelpers.PP(s.keeper.GetAllLiquidValidatorStates(s.ctx)) s.keeper.SetParams(s.ctx, params) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 4) testhelpers.PP(s.keeper.GetAllLiquidValidatorStates(s.ctx)) @@ -173,7 +173,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { } s.keeper.SetParams(s.ctx, params) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 3) proxyAccDel1, found = s.app.StakingKeeper.GetDelegation(s.ctx, types.LiquidStakeProxyAcc, valOpers[0]) @@ -208,7 +208,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { s.Require().NotEqualValues(lvState.LiquidTokens, sdk.ZeroInt()) // rebalancing, remove tombstoned liquid validator - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 1) // all redelegated, no delShares ( exception, dust ) @@ -226,7 +226,7 @@ func (s *KeeperTestSuite) TestRebalancingCase1() { // jail last liquid validator, undelegate all liquid tokens to proxy acc nasBefore := s.keeper.GetNetAmountState(s.ctx) s.doubleSign(valOpers[0], sdk.ConsAddress(pks[0].Address())) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) // no delegation of proxy acc @@ -267,7 +267,7 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { params.UnstakeFeeRate = sdk.ZeroDec() params.MinLiquidStakeAmount = math.NewInt(10000) s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(10000000000000) s.fundAddr(s.delAddrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, stakingAmt))) @@ -284,14 +284,14 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - reds := s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds := s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) stkXPRTMintAmt, err := s.keeper.LiquidStake(s.ctx, types.LiquidStakeProxyAcc, s.delAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, stakingAmt)) s.Require().NoError(err) s.Require().Equal(stkXPRTMintAmt, stakingAmt) // assert rebalanced - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) s.Require().Equal(s.redelegationsErrorCount(reds), 0) s.printRedelegationsLiquidTokens() @@ -310,12 +310,12 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { } s.keeper.SetParams(s.ctx, params) s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24)) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 8) s.Require().Equal(s.redelegationsErrorCount(reds), 0) s.printRedelegationsLiquidTokens() // assert rebalanced - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) // add active validator @@ -333,18 +333,18 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { } s.keeper.SetParams(s.ctx, params) s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24)) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 9) s.Require().Equal(s.redelegationsErrorCount(reds), 0) s.printRedelegationsLiquidTokens() // assert rebalanced - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) // complete redelegations s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24 * 20).Add(time.Hour)) staking.EndBlocker(s.ctx, s.app.StakingKeeper) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) // assert rebalanced s.Require().Equal(s.redelegationsErrorCount(reds), 0) @@ -364,12 +364,12 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { } s.keeper.SetParams(s.ctx, params) s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24)) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 9) s.Require().Equal(s.redelegationsErrorCount(reds), 0) s.printRedelegationsLiquidTokens() // assert rebalanced - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) // add active validator @@ -389,7 +389,7 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { } s.keeper.SetParams(s.ctx, params) s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24)) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 11) // fail rebalancing due to redelegation hopping s.Require().Equal(s.redelegationsErrorCount(reds), 11) @@ -397,13 +397,13 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { // complete redelegation and retry s.completeRedelegationUnbonding() - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.printRedelegationsLiquidTokens() s.Require().Len(reds, 11) s.Require().Equal(s.redelegationsErrorCount(reds), 0) // assert rebalanced - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) // modify weight @@ -423,7 +423,7 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { } s.keeper.SetParams(s.ctx, params) s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24)) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 6) // fail rebalancing partially due to redelegation hopping s.Require().Equal(s.redelegationsErrorCount(reds), 3) @@ -437,7 +437,7 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { // complete some redelegations s.ctx = s.ctx.WithBlockHeight(s.ctx.BlockHeight() + 100).WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 24 * 20).Add(time.Hour)) staking.EndBlocker(s.ctx, s.app.StakingKeeper) - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 9) // failed redelegations with small amount (less than rebalancing trigger) @@ -445,7 +445,7 @@ func (s *KeeperTestSuite) TestRebalancingConsecutiveCase() { s.printRedelegationsLiquidTokens() // assert rebalanced - reds = s.keeper.UpdateLiquidValidatorSet(s.ctx) + reds = s.keeper.UpdateLiquidValidatorSet(s.ctx, true) s.Require().Len(reds, 0) s.Require().Equal(s.redelegationsErrorCount(reds), 0) s.printRedelegationsLiquidTokens() @@ -461,7 +461,7 @@ func (s *KeeperTestSuite) TestAutocompoundStakingRewards() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(100000000) s.Require().NoError(s.liquidStaking(s.delAddrs[0], stakingAmt)) @@ -505,7 +505,7 @@ func (s *KeeperTestSuite) TestLimitAutocompoundStakingRewards() { } params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(100000000) s.Require().NoError(s.liquidStaking(s.delAddrs[0], stakingAmt)) @@ -539,7 +539,7 @@ func (s *KeeperTestSuite) TestRemoveAllLiquidValidator() { } params.ModulePaused = false s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := math.NewInt(100000000) s.Require().NoError(s.liquidStaking(s.delAddrs[0], stakingAmt)) @@ -556,7 +556,7 @@ func (s *KeeperTestSuite) TestRemoveAllLiquidValidator() { // remove all whitelist params.WhitelistedValidators = []types.WhitelistedValidator{} s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // no liquid validator lvs := s.keeper.GetAllLiquidValidators(s.ctx) @@ -584,7 +584,7 @@ func (s *KeeperTestSuite) TestUndelegatedFundsNotBecomeFees() { } params.ModulePaused = false s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // stake funds stakingAmt := math.NewInt(100000000) @@ -597,7 +597,7 @@ func (s *KeeperTestSuite) TestUndelegatedFundsNotBecomeFees() { {ValidatorAddress: valOpers[2].String(), TargetWeight: math.NewInt(3000)}, } s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // unbonding should occur nas := s.keeper.GetNetAmountState(s.ctx) @@ -614,7 +614,7 @@ func (s *KeeperTestSuite) TestUndelegatedFundsNotBecomeFees() { // complete unbondings s.completeRedelegationUnbonding() - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // fee account has funds, but its from undelegated tokens feeAccountBalanceAfterUndelegation := s.app.BankKeeper.GetBalance( diff --git a/x/liquidstake/module.go b/x/liquidstake/module.go index adb3eaf9c..32c2153ea 100644 --- a/x/liquidstake/module.go +++ b/x/liquidstake/module.go @@ -135,7 +135,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock returns the begin blocker for the liquidstake module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + BeginBlock(ctx, am.keeper) +} // EndBlock returns the end blocker for the liquidstake module. It returns no validator // updates. diff --git a/x/liquidstake/types/liquidstake_test.go b/x/liquidstake/types/liquidstake_test.go index e649f9e81..6843d1e11 100644 --- a/x/liquidstake/types/liquidstake_test.go +++ b/x/liquidstake/types/liquidstake_test.go @@ -275,7 +275,7 @@ func (s *KeeperTestSuite) SetupTest() { params := s.keeper.GetParams(s.ctx) params.UnstakeFeeRate = sdk.ZeroDec() s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) // call mint.BeginBlocker for init k.SetLastBlockTime(ctx, ctx.BlockTime()) mint.BeginBlocker(s.ctx, s.app.MintKeeper, minttypes.DefaultInflationCalculationFn) } @@ -310,7 +310,7 @@ func (s *KeeperTestSuite) TestLiquidStake() { params.MinLiquidStakeAmount = math.NewInt(50000) params.ModulePaused = false s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) stakingAmt := params.MinLiquidStakeAmount @@ -327,7 +327,7 @@ func (s *KeeperTestSuite) TestLiquidStake() { {ValidatorAddress: valOpers[2].String(), TargetWeight: math.NewInt(3333)}, } s.keeper.SetParams(s.ctx, params) - s.keeper.UpdateLiquidValidatorSet(s.ctx) + s.keeper.UpdateLiquidValidatorSet(s.ctx, true) res := s.keeper.GetAllLiquidValidatorStates(s.ctx) s.Require().Equal(params.WhitelistedValidators[0].ValidatorAddress, res[0].OperatorAddress) diff --git a/x/liquidstake/types/tx.pb.go b/x/liquidstake/types/tx.pb.go index 0ddb4220b..a9b6c6d0f 100644 --- a/x/liquidstake/types/tx.pb.go +++ b/x/liquidstake/types/tx.pb.go @@ -9,6 +9,7 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -538,57 +539,61 @@ func init() { } var fileDescriptor_d90501ae6d9f0009 = []byte{ - // 785 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x4e, 0xdb, 0x4c, - 0x14, 0x8d, 0x81, 0x0f, 0x91, 0x1b, 0x7e, 0x2d, 0xbe, 0x10, 0xcc, 0x27, 0x07, 0xe5, 0x93, 0xaa, - 0x88, 0x82, 0x0d, 0xa1, 0xa2, 0x12, 0x8b, 0xaa, 0xa4, 0x65, 0x47, 0x54, 0x14, 0xa0, 0xad, 0xba, - 0x89, 0x9c, 0x78, 0x6a, 0x46, 0x8d, 0x3d, 0x6e, 0x66, 0x12, 0x60, 0xd9, 0xae, 0xba, 0xe4, 0x05, - 0x2a, 0x21, 0xf5, 0x05, 0x50, 0xd5, 0x87, 0x60, 0x89, 0xba, 0xea, 0xaa, 0x54, 0xb0, 0x68, 0x1f, - 0xa3, 0xb2, 0x67, 0x3c, 0x49, 0xf8, 0x49, 0x02, 0xea, 0xa6, 0xab, 0xd8, 0xbe, 0xe7, 0x9e, 0x7b, - 0xce, 0xb1, 0xef, 0x28, 0xf0, 0xbf, 0x4f, 0x99, 0xf5, 0x06, 0x99, 0x55, 0xfc, 0xb6, 0x8e, 0x6d, - 0x7e, 0xdd, 0x58, 0x2a, 0x23, 0x66, 0x2d, 0x99, 0x6c, 0xdf, 0xf0, 0x6b, 0x84, 0x11, 0x55, 0xe3, - 0x20, 0xa3, 0x05, 0x64, 0x08, 0x90, 0x36, 0xe9, 0x10, 0x87, 0x84, 0x30, 0x33, 0xb8, 0xe2, 0x1d, - 0xda, 0x74, 0x85, 0x50, 0x97, 0xd0, 0x12, 0x2f, 0xf0, 0x1b, 0x51, 0xd2, 0xf9, 0x9d, 0x59, 0xb6, - 0x68, 0x73, 0x54, 0x85, 0x60, 0x4f, 0xd4, 0xa7, 0x44, 0xdd, 0xa5, 0x8e, 0xd9, 0x58, 0x0a, 0x7e, - 0x44, 0x21, 0xed, 0x10, 0xe2, 0x54, 0x91, 0x19, 0xde, 0x95, 0xeb, 0xaf, 0x4d, 0x86, 0x5d, 0x44, - 0x99, 0xe5, 0xfa, 0x02, 0x30, 0xdf, 0xc1, 0x4b, 0xab, 0xf4, 0x10, 0x9d, 0x39, 0x56, 0x60, 0xb4, - 0x40, 0x9d, 0x8d, 0xb0, 0xb0, 0x15, 0x14, 0xd4, 0x75, 0x98, 0xb0, 0x51, 0x15, 0x39, 0x16, 0x23, - 0xb5, 0x92, 0x65, 0xdb, 0x35, 0x44, 0x69, 0x4a, 0x99, 0x55, 0xb2, 0xf1, 0x7c, 0xea, 0xeb, 0x97, - 0x85, 0x49, 0xe1, 0x63, 0x8d, 0x57, 0xb6, 0x58, 0x0d, 0x7b, 0x4e, 0x71, 0x5c, 0xb6, 0x88, 0xe7, - 0xea, 0x43, 0x18, 0xb4, 0x5c, 0x52, 0xf7, 0x58, 0xaa, 0x6f, 0x56, 0xc9, 0x26, 0x72, 0xd3, 0x86, - 0x68, 0x0c, 0x2c, 0x47, 0xc1, 0x19, 0x4f, 0x08, 0xf6, 0xf2, 0x03, 0x27, 0xdf, 0xd3, 0xb1, 0xa2, - 0x80, 0xaf, 0xea, 0x1f, 0x8e, 0xd2, 0xb1, 0x5f, 0x47, 0xe9, 0xd8, 0xfb, 0x9f, 0xc7, 0x73, 0x57, - 0xa5, 0x64, 0x52, 0x90, 0x6c, 0x57, 0x5c, 0x44, 0xd4, 0x27, 0x1e, 0x45, 0x99, 0x93, 0x3e, 0x18, - 0x2e, 0x50, 0x27, 0x7c, 0xb8, 0x4d, 0x36, 0x36, 0xff, 0x94, 0x95, 0x75, 0x98, 0x68, 0x58, 0x55, - 0x6c, 0xb7, 0xd1, 0xf4, 0x75, 0xa3, 0x91, 0x2d, 0x11, 0xcd, 0x53, 0x18, 0x09,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, 0x72, 0x78, 0xa1, 0xc7, 0x4e, - 0x2f, 0xf4, 0xd8, 0xb7, 0x0b, 0x3d, 0xf6, 0xea, 0x91, 0x83, 0xd9, 0x6e, 0xbd, 0x6c, 0x54, 0x88, - 0x6b, 0xfa, 0xa8, 0x46, 0x03, 0xf1, 0x5e, 0x05, 0x3d, 0xf3, 0x90, 0xc9, 0x47, 0x2d, 0x78, 0x16, - 0xc3, 0x0d, 0x64, 0x36, 0x72, 0xe6, 0x7e, 0xdb, 0xdf, 0x21, 0x76, 0xe0, 0x23, 0x5a, 0x1e, 0x0c, - 0x0f, 0xf6, 0xe5, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x94, 0x0e, 0x16, 0xfd, 0x09, 0x00, - 0x00, + // 851 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xee, 0x16, 0x24, 0x74, 0xca, 0xe7, 0x06, 0xa1, 0x2c, 0x64, 0x4b, 0xd6, 0xc4, 0x34, 0x15, + 0x76, 0xa1, 0x18, 0x8c, 0x35, 0x7e, 0x50, 0xe5, 0x46, 0x23, 0x29, 0xa0, 0xc6, 0x4b, 0xb3, 0xed, + 0x8e, 0xcb, 0xc4, 0xee, 0xce, 0xda, 0x99, 0x16, 0xb8, 0x7a, 0x32, 0x1e, 0x0c, 0x7f, 0xc0, 0x84, + 0x83, 0x3f, 0x80, 0x83, 0xff, 0xc0, 0x0b, 0x37, 0x89, 0x5e, 0x3c, 0x89, 0x81, 0x18, 0xfc, 0x19, + 0x66, 0x77, 0x76, 0xb7, 0xbb, 0xa5, 0xb4, 0x85, 0x78, 0xf0, 0x02, 0xbb, 0xf3, 0x3e, 0xef, 0xf3, + 0xbe, 0xcf, 0x33, 0xf3, 0xce, 0x16, 0xdc, 0xb0, 0x08, 0x55, 0x5f, 0x43, 0xa5, 0x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00, 0x00, 0xff, 0xff, 0x63, 0x40, 0x59, 0x7c, 0xdf, + 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.