-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add queries for PSS and consumer commission rate #1733
Changes from 1 commit
b0d4cf9
0162242
7ad2993
5cd5ba5
5393f19
03af237
07429fa
0ab0b32
1a0fa9e
56ca38d
c614fd2
6503f9b
330c085
629cfd1
afd4652
2e95f89
a9db491
1e3a8e7
149ba7a
24be8b2
b311f35
22ca561
5509108
ad91b0e
559b28f
00e43a9
4f9084f
d4fc4cb
938d930
9739ddd
c01ab08
4661a99
219d310
10dbb53
d642e8a
69d0b28
f9e63f0
3ae3031
ed402f8
c75594f
899f3ea
b1c1beb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,11 +266,13 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, | |
|
||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
|
||
// get all the consumer chains for which the validator is opted-in | ||
// get all the consumer chains for which the validator is already or will be | ||
// opted-in starting from the next epoch | ||
consumersToValidate := []string{} | ||
for _, consumer := range k.GetAllConsumerChains(ctx) { | ||
chainID := consumer.ChainId | ||
if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) || k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) { | ||
|
||
if k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that top N validators are only opted in right when the epoch begins, so this doesn't tell you who will get opted into the chain because of being in the top N. Of course we cannot know for sure, but I would change this to just compute the MinPowerToOptIn for the chain, and then compute the validators that would be opted in, if the epoch would end without further power changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Will add that. Thanks! |
||
consumersToValidate = append(consumersToValidate, chainID) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't match the code below, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does. When
k.IsOptedIn
returnstrue
, it means that the validator is either already on the consumer valset or will be opt-in at the start of the next epoch, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I guess you are right. I'm just a bit confused what should happen when someone has opted out, but is still currently in power on the consumer chain