-
Notifications
You must be signed in to change notification settings - Fork 920
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
Always Update Attesting History If Not Slashable #7935
Merged
Merged
Conversation
This file contains 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
rauljordan
added
Priority: Critical
Highest, immediate priority item
release-target
Ready For Review
A pull request ready for code review
labels
Nov 24, 2020
prestonvanloon
previously approved these changes
Nov 24, 2020
terencechain
previously approved these changes
Nov 24, 2020
rauljordan
dismissed stale reviews from terencechain and prestonvanloon
via
November 24, 2020 02:06
71fbfa4
terencechain
previously approved these changes
Nov 24, 2020
validator/client/attest_protect.go
Outdated
Comment on lines
101
to
113
newHistory, err := kv.MarkAllAsAttestedSinceLatestWrittenEpoch( | ||
ctx, | ||
history, | ||
indexedAtt.Data.Target.Epoch, | ||
&kv.HistoryData{ | ||
Source: indexedAtt.Data.Source.Epoch, | ||
SigningRoot: signingRoot[:], | ||
}, | ||
) | ||
if err != nil { | ||
return errors.Wrapf(err, "could not mark epoch %d as attested", indexedAtt.Data.Target.Epoch) | ||
} | ||
v.attesterHistoryByPubKey[pubKey] = newHistory |
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 is duplicated on lines 85-97. Recommend: move to after the if/else block to deduplicate the code
prestonvanloon
approved these changes
Nov 24, 2020
rauljordan
added a commit
that referenced
this pull request
Nov 24, 2020
…ng a pub key data (#7937) * minimal change to handle nil attesterHistoryByPubKey * Revert "Always Update Attesting History If Not Slashable (#7935)" This reverts commit 3cc2ebc. * remove unused functions * move save before propose * wait before go func * move wait into the go routine * handling map mutation * remove map handling in this case * log in case it is still not found * fix log * fix locks * Update validator/client/attest_protect.go * remove code duplication * remove method extraction * move metrics to their appropriate place Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Priority: Critical
Highest, immediate priority item
Ready For Review
A pull request ready for code review
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.
Follow up to #7934, this PR ensures we update the attesting history if an attestation is not found to be slashable. Additionally, we save the protection data to DB before we attest rather than afterwards