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

Execution API Electra: requests as a sidecar #14492

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Sep 30, 2024

What type of PR is this?

Feature

What does this PR do? Why is it needed?

implements ethereum/execution-apis#591

  • adds API calls for engine_newPayloadV4 and engine_getPayloadV4
  • adds encoding for executionRequestsHash
  • adds decoding of execution request byte data

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@james-prysm james-prysm added API Api related tasks Electra electra hardfork labels Sep 30, 2024
}

// ExecutionEnvelopeElectra is a container that builds on Payload V4 and includes execution requests sidecar needed post Electra
message ExecutionEnvelopeElectra {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should I call it something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

conflicts with epbs, i should rename

Copy link
Contributor

Choose a reason for hiding this comment

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

I think naming it mentioning electra is self explanatory to me like we have simple ExecutionPayloadEnvelope so in my views its ok to keep this naming

bytes value = 2;
BlobsBundle blobs_bundle = 3;
bool should_override_builder = 4;
repeated bytes execution_requests = 5;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

double check if the type and size are correct

@@ -259,6 +259,9 @@ func (s *Service) ForkchoiceUpdated(

func getPayloadMethodAndMessage(slot primitives.Slot) (string, proto.Message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit of a nit, would this be better/clearer as a switch?

func getPayloadMethodAndMessage(slot primitives.Slot) (string, proto.Message) {
	pe := slots.ToEpoch(slot)
	switch {
	case pe >= params.beaconConfig().ElectraForkEpoch:
		return GetPayloadMethodV4, &pb.ExecutionEnvelopeElectra{}
	case pe == params.beaconConfig().DenebForkEpoch:
		return GetPayloadMethodV3, &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{}
	case pe == params.beaconConfig().CapellaForkEpoch:
		return GetPayloadMethodV2, &pb.ExecutionPayloadCapellaWithValue{}
	default:
		return GetPayloadMethod, &pb.ExecutionPayload{}
	}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's about the same but can update

@james-prysm james-prysm changed the title Execution API: requests as a sidecar Execution API Electra: requests as a sidecar Oct 1, 2024
}
pr := common.Hash(blk.Block().ParentRoot())
// TODO: get encoded hash for execution requests
executionRequestsHash := &common.Hash{}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe we don't want to do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Electra electra hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants