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

Slasher proto and function renames #4797

Merged
merged 10 commits into from Feb 10, 2020

Conversation

0xKiwi
Copy link
Contributor

@0xKiwi 0xKiwi commented Feb 8, 2020

This PR renames and cleans up the slasher further to reduce confusion.

Renames:

  • ValidatorIDToIdxAtt -> CompressedIdxAtt
  • ValidatorIDToIdxAttList -> CompressedIdxAttList
  • BlockHeader() -> BlockHeaders()
  • dataForDetection() -> attsAndCommitteesForEpoch()
  • slasherOldAttestationFeeder() -> historicalAttestationFeeder()

Changed indexedAttestationsIndicesBucket to compressedIdxAttsBucket

detectAttestation() split into convertToIndexed()and detectSlashings()

Changes the ClearDB() function to only clear the slasher db, not the whole DB folder.

@codecov
Copy link

codecov bot commented Feb 8, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@ccdb2c5). Click here to learn what that means.
The diff coverage is 21.56%.

@@           Coverage Diff            @@
##             master   #4797   +/-   ##
========================================
  Coverage          ?   3.35%           
========================================
  Files             ?      78           
  Lines             ?    6433           
  Branches          ?       0           
========================================
  Hits              ?     216           
  Misses            ?    6179           
  Partials          ?      38

Copy link
Contributor

@shayzluf shayzluf left a comment

Choose a reason for hiding this comment

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

thanks for doing it @0xKiwi , much clearer naming. did you run it with an archive endpoint to see it doesn't break?
lgtm

@@ -25,8 +25,8 @@ func unmarshalIdxAtt(enc []byte) (*ethpb.IndexedAttestation, error) {
return protoIdxAtt, nil
}

func unmarshalValIDsToIdxAttList(enc []byte) (*slashpb.ValidatorIDToIdxAttList, error) {
protoIdxAtt := &slashpb.ValidatorIDToIdxAttList{}
func unmarshalCompressedIdxAttList(enc []byte) (*slashpb.CompressedIdxAttList, error) {
Copy link
Member

Choose a reason for hiding this comment

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

CompressedIdx sounds too vague imo, is it validator index? attestation index? block index?... etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an indexed attestation, but the AttestationData is changed to its []byte attestation data root. That's why I refer to it as "compressed".

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense 👍

}
}

// finalizedChangeUpdater this is a stub for the coming PRs #3133
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// finalizedChangeUpdater this is a stub for the coming PRs #3133
// finalizedChangeUpdater this is a stub for the coming PRs #3133.

}

// finalizedChangeUpdater this is a stub for the coming PRs #3133
// Store validator index to public key map Validate attestation signature.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Store validator index to public key map Validate attestation signature.
// Store validator index to public key map to validate attestation signature.

@0xKiwi 0xKiwi requested a review from shayzluf February 10, 2020 05:50
Copy link
Contributor

@shayzluf shayzluf left a comment

Choose a reason for hiding this comment

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

lgtm

@prylabs-bulldozer prylabs-bulldozer bot merged commit 18fbdd5 into prysmaticlabs:master Feb 10, 2020
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 24, 2020
* Rename elements for clarity
* Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into slasher-renames
* Fix test
* Rename more functions
* Cleanup
* Fix logs
* Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into slasher-renames
* Reorganize and clean up logs
* Address comments
* Add comments
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 28, 2020
* Rename elements for clarity
* Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into slasher-renames
* Fix test
* Rename more functions
* Cleanup
* Fix logs
* Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into slasher-renames
* Reorganize and clean up logs
* Address comments
* Add comments
@0xKiwi 0xKiwi deleted the slasher-renames branch March 15, 2020 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants