-
Notifications
You must be signed in to change notification settings - Fork 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
PrepareBeaconProposer API #10367
PrepareBeaconProposer API #10367
Conversation
var FeeRecipients []common.Address | ||
var ValidatorIndices []types.ValidatorIndex | ||
for _, recipientContainer := range request.Recipients { | ||
FeeRecipients = append(FeeRecipients, common.BytesToAddress(recipientContainer.FeeRecipient)) |
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 it's worth validating common.BytesToAddress(recipientContainer.FeeRecipient)
var FeeRecipients []common.Address | ||
var ValidatorIndices []types.ValidatorIndex | ||
for _, recipientContainer := range request.Recipients { | ||
FeeRecipients = append(FeeRecipients, common.BytesToAddress(recipientContainer.FeeRecipient)) |
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.
Same here. Worth validating common.BytesToAddress(recipientContainer.FeeRecipient)
var FeeRecipients []common.Address | ||
var ValidatorIndices []types.ValidatorIndex | ||
for _, recipientContainer := range request.Recipients { | ||
if len(recipientContainer.FeeRecipient) != fieldparams.FeeRecipientLength { |
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.
Why not just do IsHexAddress(common.BytesToAddress(recipientContainer.FeeRecipient)))
?
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 can do it that way too will update then.
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { |
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 test should also read from the DB to ensure the expected data was saved
db := dbutil.SetupDB(t) | ||
ctx := context.Background() | ||
proposerServer := &Server{BeaconDB: db} | ||
_, err := proposerServer.PrepareBeaconProposer(ctx, tt.args.request) |
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.
+1 here
What type of PR is this?
Feature
part of #10292
What does this PR do? Why is it needed?
This PR implements the inner workings of https://github.com/ethereum/beacon-APIs/pull/178/files Beacon API to set the prysm config. This cache is then used when calling get execution payload