-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Custom Type ValidatorIndex Across Prysm #8478
Conversation
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
@@ -24,8 +24,8 @@ type ReadOnlyDatabase interface { | |||
GetLatestEpochDetected(ctx context.Context) (types.Epoch, error) | |||
|
|||
// BlockHeader related methods. | |||
BlockHeaders(ctx context.Context, slot types.Slot, validatorID uint64) ([]*ethpb.SignedBeaconBlockHeader, error) | |||
HasBlockHeader(ctx context.Context, slot types.Slot, validatorID uint64) bool | |||
BlockHeaders(ctx context.Context, slot types.Slot, validatorID types.ValidatorIndex) ([]*ethpb.SignedBeaconBlockHeader, error) |
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.
Can we change ID
to index
in this file's interfaces and in some other places? They are not really the same (what would be a validator ID anyway? it's public key?) and we use indexes here. This might be too big of a change for this PR, though.
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.
Also I wonder whether it would not be a braking change...
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 should indeed be validatorIdx or validatorIndex
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.
Sounds good. Will do that in the next PR. It seems out of scope for now
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.
Amazing work!
Had just couple of minor requests.
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.
lgtm, thank you!
What type of PR is this?
What does this PR do? Why is it needed?
Use eth2 type
ValidtorIndex
across PrysmWhich issues(s) does this PR fix?
Part of #8205
Other notes for review
N/A