@@ -14,7 +14,7 @@ use crate::{
1414} ;
1515use execution_layer:: {
1616 BlockProposalContents , BlockProposalContentsType , BuilderParams , NewPayloadRequest ,
17- PayloadAttributes , PayloadStatus ,
17+ PayloadAttributes , PayloadParameters , PayloadStatus ,
1818} ;
1919use fork_choice:: { InvalidationOperation , PayloadVerificationStatus } ;
2020use proto_array:: { Block as ProtoBlock , ExecutionStatus } ;
@@ -375,8 +375,9 @@ pub fn get_execution_payload<T: BeaconChainTypes>(
375375 let timestamp =
376376 compute_timestamp_at_slot ( state, state. slot ( ) , spec) . map_err ( BeaconStateError :: from) ?;
377377 let random = * state. get_randao_mix ( current_epoch) ?;
378- let latest_execution_payload_header_block_hash =
379- state. latest_execution_payload_header ( ) ?. block_hash ( ) ;
378+ let latest_execution_payload_header = state. latest_execution_payload_header ( ) ?;
379+ let latest_execution_payload_header_block_hash = latest_execution_payload_header. block_hash ( ) ;
380+ let latest_execution_payload_header_gas_limit = latest_execution_payload_header. gas_limit ( ) ;
380381 let withdrawals = match state {
381382 & BeaconState :: Capella ( _) | & BeaconState :: Deneb ( _) | & BeaconState :: Electra ( _) => {
382383 Some ( get_expected_withdrawals ( state, spec) ?. 0 . into ( ) )
@@ -406,6 +407,7 @@ pub fn get_execution_payload<T: BeaconChainTypes>(
406407 random,
407408 proposer_index,
408409 latest_execution_payload_header_block_hash,
410+ latest_execution_payload_header_gas_limit,
409411 builder_params,
410412 withdrawals,
411413 parent_beacon_block_root,
@@ -443,6 +445,7 @@ pub async fn prepare_execution_payload<T>(
443445 random : Hash256 ,
444446 proposer_index : u64 ,
445447 latest_execution_payload_header_block_hash : ExecutionBlockHash ,
448+ latest_execution_payload_header_gas_limit : u64 ,
446449 builder_params : BuilderParams ,
447450 withdrawals : Option < Vec < Withdrawal > > ,
448451 parent_beacon_block_root : Option < Hash256 > ,
@@ -526,13 +529,20 @@ where
526529 parent_beacon_block_root,
527530 ) ;
528531
532+ let target_gas_limit = execution_layer. get_proposer_gas_limit ( proposer_index) . await ;
533+ let payload_parameters = PayloadParameters {
534+ parent_hash,
535+ parent_gas_limit : latest_execution_payload_header_gas_limit,
536+ proposer_gas_limit : target_gas_limit,
537+ payload_attributes : & payload_attributes,
538+ forkchoice_update_params : & forkchoice_update_params,
539+ current_fork : fork,
540+ } ;
541+
529542 let block_contents = execution_layer
530543 . get_payload (
531- parent_hash,
532- & payload_attributes,
533- forkchoice_update_params,
544+ payload_parameters,
534545 builder_params,
535- fork,
536546 & chain. spec ,
537547 builder_boost_factor,
538548 block_production_version,
0 commit comments