-
Notifications
You must be signed in to change notification settings - Fork 995
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
Prysm rpc: submit signed execution payload header #14441
Conversation
3692c44
to
c486002
Compare
c486002
to
85c833b
Compare
@@ -31,6 +32,17 @@ func (vs *Server) SubmitSignedExecutionPayloadEnvelope(ctx context.Context, env | |||
return nil, nil | |||
} | |||
|
|||
// SubmitSignedExecutionPayloadHeader submits a signed execution payload header to the beacon node. | |||
func (vs *Server) SubmitSignedExecutionPayloadHeader(ctx context.Context, h *enginev1.SignedExecutionPayloadHeader) (*emptypb.Empty, 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.
If I understood correctly, this is a method within beacon node and is intended to be called by validator, right?
if vs.TimeFetcher.CurrentSlot() != h.Message.Slot && vs.TimeFetcher.CurrentSlot() != h.Message.Slot-1 { | ||
return nil, status.Errorf(codes.InvalidArgument, "invalid slot: current slot %d, got %d", vs.TimeFetcher.CurrentSlot(), h.Message.Slot) |
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.
There are three calls for vs.TimeFetcher.CurrentSlot()
in these two lines, can we change this to
if vs.TimeFetcher.CurrentSlot() != h.Message.Slot && vs.TimeFetcher.CurrentSlot() != h.Message.Slot-1 { | |
return nil, status.Errorf(codes.InvalidArgument, "invalid slot: current slot %d, got %d", vs.TimeFetcher.CurrentSlot(), h.Message.Slot) | |
currSlot := vs.TimeFetcher.CurrentSlot() | |
if currSlot > h.message.Slot || currSlot + 1 < h.message.Slot { | |
return nil, status.Errorf(codes.InvalidArgument, "invalid slot: current slot %d, got %d", currSlot, h.Message.Slot) |
c4b17ef
to
329e685
Compare
This PR adds a Prysm RPC endpoint for the validator to submit a signed execution payload header. The beacon node will cache the signed execution payload header, with the condition that the slot must be the current slot, and only one header will be cached, updating to the latest one