Skip to content
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

Use new proposal protection format #7518

Merged
merged 44 commits into from
Oct 15, 2020

Conversation

shayzluf
Copy link
Contributor

@shayzluf shayzluf commented Oct 13, 2020

What type of PR is this?

Feature

What does this PR do? Why is it needed?
Use the new proposal protection format in runtime
Why
As part of the effort to support slashing protection data interchange format and the need to add signing root to our protection db i have found that proposals db was built for the old slashing rule (1 proposal per epoch) since that rule changed to (1 proposal per slot) there is no benefit for saving this data on epoch context and adding complexity .
The new db structure saves proposals signing roots per slot for slashing protection.

  • This PR also imports old protection data format to the new format on validator node startup and saves a flag of it being exported in the old bucket

Which issues(s) does this PR fix?

Part of #7196

data interchange format
https://hackmd.io/@sproul/Bk0Y0qdGD#Implementations

@shayzluf shayzluf requested a review from a team as a code owner October 13, 2020 10:38
@shayzluf shayzluf self-assigned this Oct 13, 2020
@shayzluf shayzluf added the Ready For Review A pull request ready for code review label Oct 14, 2020
@shayzluf
Copy link
Contributor Author

@terencechain added link to pr description

…aticlabs/prysm into use_new_proposal_protection_format
…proposal_protection_format

# Conflicts:
#	validator/accounts/v1/BUILD.bazel
#	validator/accounts/v1/account_test.go
#	validator/client/propose.go
#	validator/client/propose_protect_test.go
@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #7518 into master will decrease coverage by 0.14%.
The diff coverage is 63.38%.

@@            Coverage Diff             @@
##           master    #7518      +/-   ##
==========================================
- Coverage   61.83%   61.69%   -0.15%     
==========================================
  Files         422      422              
  Lines       29527    29493      -34     
==========================================
- Hits        18259    18196      -63     
- Misses       8343     8379      +36     
+ Partials     2925     2918       -7     

validator/client/propose_protect.go Outdated Show resolved Hide resolved
validator/client/propose_protect.go Outdated Show resolved Hide resolved

for i, key := range pubKeys {
proposalHistory := bitfield.Bitlist{byte(i), 0x00, 0x00, 0x00, 0x01}
if err := store.SaveProposalHistoryForEpoch(context.Background(), key[:], 0, proposalHistory); err != nil {
signingRoot := bytesutil.PadTo([]byte{byte(i)}, 32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is confusing, why is the signing root the index of the pubkey ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to have different values

rauljordan
rauljordan previously approved these changes Oct 15, 2020
…proposal_protection_format

# Conflicts:
#	validator/client/propose_protect.go
#	validator/client/propose_test.go
@prylabs-bulldozer prylabs-bulldozer bot merged commit acf2014 into master Oct 15, 2020
@rauljordan rauljordan deleted the use_new_proposal_protection_format branch October 15, 2020 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants