Skip to content

Commit

Permalink
reverts name to ComputeNextValidators because the semantics of Comput…
Browse files Browse the repository at this point in the history
…eNextEpochConsumerValSet were different in v4.1
  • Loading branch information
insumity committed May 2, 2024
1 parent 2109b42 commit f2482b6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ func (k Keeper) HasToValidate(
// if the validator is opted in and belongs to the validators of the next epoch, then if nothing changes
// the validator would have to validate in the next epoch
if k.IsOptedIn(ctx, chainID, provAddr) {
nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chainID, k.stakingKeeper.GetLastValidators(ctx))
nextValidators := k.ComputeNextValidators(ctx, chainID, k.stakingKeeper.GetLastValidators(ctx))
for _, v := range nextValidators {
consAddr := sdk.ConsAddress(v.ProviderConsAddr)
if provAddr.ToSdkConsAddr().Equals(consAddr) {
Expand Down
4 changes: 2 additions & 2 deletions x/ccv/provider/keeper/partial_set_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ func (k Keeper) FilterOptedInAndAllowAndDenylistedPredicate(ctx sdk.Context, cha
!k.IsDenylisted(ctx, chainID, providerAddr))
}

// ComputeNextEpochConsumerValSet computes the validators for the upcoming epoch based on the currently `bondedValidators`
func (k Keeper) ComputeNextEpochConsumerValSet(ctx sdk.Context, chainID string, bondedValidators []stakingtypes.Validator) []types.ConsumerValidator {
// ComputeNextValidators computes the validators for the upcoming epoch based on the currently `bondedValidators`.
func (k Keeper) ComputeNextValidators(ctx sdk.Context, chainID string, bondedValidators []stakingtypes.Validator) []types.ConsumerValidator {
nextValidators := k.FilterValidators(ctx, chainID, bondedValidators,
func(providerAddr types.ProviderConsAddress) bool {
return k.FilterOptedInAndAllowAndDenylistedPredicate(ctx, chainID, providerAddr)
Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func (k Keeper) MakeConsumerGenesis(
}
}

nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators)
nextValidators := k.ComputeNextValidators(ctx, chainID, bondedValidators)

k.SetConsumerValSet(ctx, chainID, nextValidators)

Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) {
}
}

nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators)
nextValidators := k.ComputeNextValidators(ctx, chain.ChainId, bondedValidators)

valUpdates := DiffValidators(currentValidators, nextValidators)
k.SetConsumerValSet(ctx, chain.ChainId, nextValidators)
Expand Down

0 comments on commit f2482b6

Please sign in to comment.