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

Prysm rpc: submit signed execution payload header #14441

Merged
merged 3 commits into from
Sep 18, 2024
Merged

Conversation

terencechain
Copy link
Member

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

@@ -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) {

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?

Comment on lines 38 to 40
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)
Copy link
Contributor

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

Suggested change
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)

@potuz potuz merged commit b0c8f87 into epbs Sep 18, 2024
15 of 16 checks passed
@potuz potuz deleted the submit-signed-header branch September 18, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ePBS EIP-7732
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants