-
Notifications
You must be signed in to change notification settings - Fork 136
add get payload v2 #746
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
base: main
Are you sure you want to change the base?
add get payload v2 #746
Conversation
One thing to note here is that I have kept the naming to |
@@ -1343,6 +1345,7 @@ func (api *RelayAPI) checkProposerSignature(block *common.VersionedSignedBlinded | |||
} | |||
} | |||
|
|||
// Depreciated: Use handleGetPayloadV2. For more info visit: https://github.com/ethereum/builder-specs/issues/119 |
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.
// Depreciated: Use handleGetPayloadV2. For more info visit: https://github.com/ethereum/builder-specs/issues/119 | |
// Deprecated: Use handleGetPayloadV2. For more info visit: https://github.com/ethereum/builder-specs/issues/119 |
return | ||
} | ||
|
||
if api.isElectra(headSlot) && payload.Electra == nil { |
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.
we should rebase this PR from #745 to include fulu payloads.
code, err := api.beaconClient.PublishBlock(signedBeaconBlock) // errors are logged inside | ||
if err != nil || (code != http.StatusOK && code != http.StatusAccepted) { | ||
log.WithError(err).WithField("code", code).Error("failed to publish block") | ||
api.RespondError(w, http.StatusBadRequest, "failed to publish block") | ||
return | ||
} |
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.
Block publishing needs to be async. The API should return 202 success once we acknowledge the block is valid and do the block publishing async.
@@ -1752,6 +1755,401 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request) | |||
log.Info("execution payload delivered") | |||
} | |||
|
|||
func (api *RelayAPI) handleGetPayloadV2(w http.ResponseWriter, req *http.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.
there is duplicate code here but I guess its fine since we will eventually remove V1 API in glamsterdam?
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.
yeah the idea was that since we will be getting rid of it in glamsterdam we can introduce the duplication for time being for simiplicity.
@@ -1752,6 +1755,401 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request) | |||
log.Info("execution payload delivered") | |||
} | |||
|
|||
func (api *RelayAPI) handleGetPayloadV2(w http.ResponseWriter, req *http.Request) { | |||
api.getPayloadCallsInFlight.Add(1) |
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 am thinking whether we should allow concurrent runs of getPayloadV1
and getPayloadV2
? whats the risk if someone calls both these APIs at the same time?
π Summary
Introduces v2 blinded blocks endpoint which doesn't return the entire ExecutionPayload and BlobsBundle.
β± Motivation and Context
Currently the /eth/v1/builder/blinded_blocks returns the entire ExecutionPayload and BlobsBundle. This can increase network bandwidth costs for the proposer and also the request time as we increase the number of Blobs. We therefore introduce a new v2 API endpoint, /eth/v2/builder/blinded_blocks which no longer returns the fully signed unblinded payload. Instead, it returns an empty response and relies on the relay to propagate the block.
π References
ethereum/builder-specs#119
ethereum/builder-specs#123
β I have run these commands
make lint
make test-race
go mod tidy
CONTRIBUTING.md