Fallback to getPayload v1 if v2 fails (#8163)

N/A


  Post fulu, we should be calling the v2 api on the relays that doesn't return the blobs/data columns.

However, we decided to start hitting the v2 api as soon as fulu is scheduled to avoid unexpected surprises at the fork.
In the ACDT call, it seems like most clients are calling v2 only after the fulu fork.
This PR aims to be the best of both worlds where we fallback to hitting v1 api if v2 fails. This way, we know beforehand if relays don't support it and can potentially alert them.


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
This commit is contained in:
Pawan Dhananjay
2025-10-07 07:32:41 -07:00
committed by GitHub
parent 4eb89604f8
commit a4ad3e492f

View File

@@ -1914,9 +1914,19 @@ impl<E: EthSpec> ExecutionLayer<E> {
) -> Result<SubmitBlindedBlockResponse<E>, Error> {
debug!(?block_root, "Sending block to builder");
if spec.is_fulu_scheduled() {
self.post_builder_blinded_blocks_v2(block_root, block)
let resp = self
.post_builder_blinded_blocks_v2(block_root, block)
.await
.map(|()| SubmitBlindedBlockResponse::V2)
.map(|()| SubmitBlindedBlockResponse::V2);
// Fallback to v1 if v2 fails because the relay doesn't support it.
// Note: we should remove the fallback post fulu when all relays have support for v2.
if resp.is_err() {
self.post_builder_blinded_blocks_v1(block_root, block)
.await
.map(|full_payload| SubmitBlindedBlockResponse::V1(Box::new(full_payload)))
} else {
resp
}
} else {
self.post_builder_blinded_blocks_v1(block_root, block)
.await