Skip to content

Commit

Permalink
Use efficient payload reconstruction for HTTP API (sigp#4102)
Browse files Browse the repository at this point in the history
Builds on sigp#4028 to use the new payload bodies methods in the HTTP API as well.

The payloads by range method only works for the finalized chain, so it can't be used in the execution engine integration tests because we try to reconstruct unfinalized payloads there.
  • Loading branch information
michaelsproul authored and Woodpile37 committed Jan 6, 2024
1 parent e3915cf commit e52d559
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.execution_layer
.as_ref()
.ok_or(Error::ExecutionLayerMissing)?
.get_payload_by_block_hash(exec_block_hash, fork)
.get_payload_for_header(&execution_payload_header, fork)
.await
.map_err(|e| {
Error::ExecutionLayerErrorPayloadReconstruction(exec_block_hash, Box::new(e))
Expand Down
3 changes: 2 additions & 1 deletion testing/execution_engine_integration/src/test_rig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,10 @@ async fn check_payload_reconstruction<E: GenericExecutionEngine>(
ee: &ExecutionPair<E, MainnetEthSpec>,
payload: &ExecutionPayload<MainnetEthSpec>,
) {
// check via legacy eth_getBlockByHash
let reconstructed = ee
.execution_layer
.get_payload_by_block_hash(payload.block_hash(), payload.fork_name())
.get_payload_by_hash_legacy(payload.block_hash(), payload.fork_name())
.await
.unwrap()
.unwrap();
Expand Down

0 comments on commit e52d559

Please sign in to comment.