-
Notifications
You must be signed in to change notification settings - Fork 476
Downtime slashing when epoch changes #2436
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
Merged
celo-ci-bot-user
merged 8 commits into
celo-org:master
from
mrsmkl:downtime-slashing-epoch-change-fix
Jan 24, 2020
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
588e8f8
fixing it?
mrsmkl 56a116a
seems to work now
mrsmkl d660fb6
Merge branch 'master' into downtime-slashing-epoch-change-fix
mrsmkl 9ec4316
Merge branch 'master' of github.com:celo-org/celo-monorepo into downt…
mrsmkl bb166b3
added comment
mrsmkl d7ff23a
lint
mrsmkl 2b0dca8
Merge branch 'master' into downtime-slashing-epoch-change-fix
mrsmkl 0b2b621
Merge branch 'master' into downtime-slashing-epoch-change-fix
mrsmkl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,9 @@ contract DowntimeSlasher is SlasherUtil { | |
| uint256 signerIndex = epochNumberOfBlock(n, sz) == startEpoch | ||
| ? startSignerIndex | ||
| : endSignerIndex; | ||
| if (uint256(getParentSealBitmap(n)) & (1 << signerIndex) != 0) return false; | ||
| // We want to check signers for block n, | ||
| // so we get the parent seal bitmap for the next block | ||
| if (uint256(getParentSealBitmap(n + 1)) & (1 << signerIndex) != 0) return false; | ||
|
Contributor
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. Do we need to change
Contributor
Author
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. No, I think it's correct now. |
||
| } | ||
| return true; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
So, not sure of the semantics of
getParentSealBitmap.From your change it seems that
getParentSeal(x)will get the parentSeal that's on block X header. which is a seal of all signers for block X-1.In that case, this is correct.. and great catch by the way!
Can you confirm? The other case is that getParentSealBitmap(x) get's the parent seal that have signer for block X and that lives on block X+1 header..
In any case, a comment would be nice :D
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 I'll check from geth, but I tried to check from baklava, the current version didn't seem to work.
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.
It gets the header from the block given as argument https://github.com/celo-org/celo-blockchain/blob/master/core/vm/contracts.go#L797
So it should be correct now.