Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Soft opt out #833
Soft opt out #833
Changes from all commits
584b3f2
01ce4d4
a5880e3
19a31c8
a1da5e3
ed09b43
353c8db
282716a
fef5415
0d5b248
3506858
66ee828
421bee2
9b6c50a
edac41a
df7ddaf
059c750
f862642
b4ede6b
5b86af8
171a573
b7b35aa
741da8a
59910f6
65bf8da
6bfb60e
16180be
d495656
2d60b2f
d686044
d0bff24
8d2a613
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
The
infractionHeight
for downtime misbehavior is the current height minus two, see https://github.com/cosmos/cosmos-sdk/blob/b05b6fe651514c11af3d4160f7c75fbaad92d5db/x/slashing/keeper/infractions.go#L89. This means thatSoftOptOutThresholdPower
should contain info from two height ago.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.
@smarshall-spitzbart please open an issue to address this later.
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.
Actually that's not needed as the
ccv.BeginBlock
will be called afterslashing.BeginBlock
, seeinterchain-security/app/consumer/app.go
Line 404 in 94de30e
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.
@mpoke even with this order of begin blockers, wouldn't the soft opt out logic still be off by 1 block? (not 2)
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 don't think so. Consider the following example.
interchain-security/x/ccv/consumer/module.go
Line 202 in afcc4f5
interchain-security/x/ccv/consumer/module.go
Line 153 in afcc4f5
ccv.Slash
compares the validator's power at height 9 with the smallest power that was updated at height 10 using powers from height 9.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.
Ah makes sense, neat how that works out 👍