@@ -14,7 +14,7 @@ use crate::{
14
14
} ;
15
15
use execution_layer:: {
16
16
BlockProposalContents , BlockProposalContentsType , BuilderParams , NewPayloadRequest ,
17
- PayloadAttributes , PayloadStatus ,
17
+ PayloadAttributes , PayloadParameters , PayloadStatus ,
18
18
} ;
19
19
use fork_choice:: { InvalidationOperation , PayloadVerificationStatus } ;
20
20
use proto_array:: { Block as ProtoBlock , ExecutionStatus } ;
@@ -375,8 +375,9 @@ pub fn get_execution_payload<T: BeaconChainTypes>(
375
375
let timestamp =
376
376
compute_timestamp_at_slot ( state, state. slot ( ) , spec) . map_err ( BeaconStateError :: from) ?;
377
377
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 ( ) ;
380
381
let withdrawals = match state {
381
382
& BeaconState :: Capella ( _) | & BeaconState :: Deneb ( _) | & BeaconState :: Electra ( _) => {
382
383
Some ( get_expected_withdrawals ( state, spec) ?. 0 . into ( ) )
@@ -406,6 +407,7 @@ pub fn get_execution_payload<T: BeaconChainTypes>(
406
407
random,
407
408
proposer_index,
408
409
latest_execution_payload_header_block_hash,
410
+ latest_execution_payload_header_gas_limit,
409
411
builder_params,
410
412
withdrawals,
411
413
parent_beacon_block_root,
@@ -443,6 +445,7 @@ pub async fn prepare_execution_payload<T>(
443
445
random : Hash256 ,
444
446
proposer_index : u64 ,
445
447
latest_execution_payload_header_block_hash : ExecutionBlockHash ,
448
+ latest_execution_payload_header_gas_limit : u64 ,
446
449
builder_params : BuilderParams ,
447
450
withdrawals : Option < Vec < Withdrawal > > ,
448
451
parent_beacon_block_root : Option < Hash256 > ,
@@ -526,13 +529,20 @@ where
526
529
parent_beacon_block_root,
527
530
) ;
528
531
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
+
529
542
let block_contents = execution_layer
530
543
. get_payload (
531
- parent_hash,
532
- & payload_attributes,
533
- forkchoice_update_params,
544
+ payload_parameters,
534
545
builder_params,
535
- fork,
536
546
& chain. spec ,
537
547
builder_boost_factor,
538
548
block_production_version,
0 commit comments