Skip to content

Commit

Permalink
remove extra validation from builder response in builder proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Feb 24, 2024
1 parent 8943ab6 commit d38219b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/beacon-node/src/execution/builder/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,12 @@ export class ExecutionBuilderHttp implements IExecutionBuilder {
const {data} = res.response;

const {executionPayload, blobsBundle} = parseExecutionPayloadAndBlobsBundle(data);
// some validations for execution payload
const expectedTransactionsRoot = signedBlindedBlock.message.body.executionPayloadHeader.transactionsRoot;
const actualTransactionsRoot = ssz.bellatrix.Transactions.hashTreeRoot(executionPayload.transactions);
if (!byteArrayEquals(expectedTransactionsRoot, actualTransactionsRoot)) {
throw Error(
`Invalid transactionsRoot of the builder payload, expected=${toHexString(
expectedTransactionsRoot
)}, actual=${toHexString(actualTransactionsRoot)}`
);
}

// for the sake of timely proposals we can skip matching the payload with payloadHeader
// if the roots (transactions, withdrawals) don't match, this will likely lead to a block with
// invalid signature, but there is no recourse to this anyway so lets just proceed and will
// need probably need diagonis if this block turns out to be invalid because of some bug
//
const contents = blobsBundle ? {blobs: blobsBundle.blobs, kzgProofs: blobsBundle.proofs} : null;
return reconstructFullBlockOrContents(signedBlindedBlock, {executionPayload, contents});
}
Expand Down

0 comments on commit d38219b

Please sign in to comment.