diff --git a/x/stake/endblock.go b/x/stake/endblock.go index f383c16d2..22611e940 100644 --- a/x/stake/endblock.go +++ b/x/stake/endblock.go @@ -270,8 +270,7 @@ func handleMatureUnbondingDelegations(k keeper.Keeper, ctx sdk.Context) ([]types } const ( - maxProcessedRefundCount = 10 - maxUnboundPerBreatheBlock = 100 + maxProcessedRefundCount = 10 ) func handleRefundStake(ctx sdk.Context, sideChainPrefix []byte, k keeper.Keeper) sdk.Events { @@ -282,11 +281,6 @@ func handleRefundStake(ctx sdk.Context, sideChainPrefix []byte, k keeper.Keeper) count := 0 boundDenom := k.BondDenom(sideChainCtx) bscSideChainId := k.ScKeeper.BscSideChainId(ctx) - unBoundingDelegationSize := k.GetUnbondingSizeInQueue(sideChainCtx, ctx.BlockHeader().Time.Add(k.UnbondingTime(ctx))) - if unBoundingDelegationSize >= maxUnboundPerBreatheBlock { - ctx.Logger().Info("unBoundingDelegation exceed the maxUnboundPerBreatheBlock") - return refundEvents - } for ; iterator.Valid(); iterator.Next() { delegation := types.MustUnmarshalDelegation(k.CDC(), iterator.Key(), iterator.Value()) diff --git a/x/stake/keeper/delegation.go b/x/stake/keeper/delegation.go index 2a35eae22..a627fac33 100644 --- a/x/stake/keeper/delegation.go +++ b/x/stake/keeper/delegation.go @@ -322,16 +322,6 @@ func (k Keeper) UnbondingQueueIterator(ctx sdk.Context, endTime time.Time) sdk.I return store.Iterator(UnbondingQueueKey, sdk.InclusiveEndBytes(GetUnbondingDelegationTimeKey(endTime))) } -func (k Keeper) GetUnbondingSizeInQueue(ctx sdk.Context, endTime time.Time) int { - unbondingTimesliceIterator := k.UnbondingQueueIterator(ctx, endTime) - defer unbondingTimesliceIterator.Close() - size := 0 - for ; unbondingTimesliceIterator.Valid(); unbondingTimesliceIterator.Next() { - size++ - } - return size -} - // Returns a concatenated list of all the timeslices before currTime, and deletes the timeslices from the queue func (k Keeper) DequeueAllMatureUnbondingQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair) { store := ctx.KVStore(k.storeKey)