mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Engine api changes
This commit is contained in:
@@ -6525,6 +6525,25 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
None
|
||||
};
|
||||
|
||||
// For Heze, fetch inclusion list transactions from the cache.
|
||||
let inclusion_list_transactions =
|
||||
if prepare_slot_fork.heze_enabled() {
|
||||
let il_slot = prepare_slot.saturating_sub(1_u64);
|
||||
let il_txs = self
|
||||
.inclusion_list_cache
|
||||
.read()
|
||||
.get_inclusion_list_transactions(il_slot)
|
||||
.unwrap_or_default();
|
||||
Some(
|
||||
il_txs
|
||||
.into_iter()
|
||||
.map(|tx| tx.to_vec())
|
||||
.collect::<Vec<Vec<u8>>>(),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let payload_attributes = PayloadAttributes::new(
|
||||
self.slot_clock
|
||||
.start_of(prepare_slot)
|
||||
@@ -6535,6 +6554,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
withdrawals.map(Into::into),
|
||||
parent_beacon_block_root,
|
||||
slot_number,
|
||||
inclusion_list_transactions,
|
||||
);
|
||||
|
||||
execution_layer
|
||||
|
||||
@@ -1120,6 +1120,24 @@ where
|
||||
.await;
|
||||
let slot_number = Some(builder_params.slot.as_u64());
|
||||
|
||||
// For Heze, fetch inclusion list transactions from the cache (previous slot's ILs).
|
||||
let inclusion_list_transactions = if fork.heze_enabled() {
|
||||
let il_slot = builder_params.slot.saturating_sub(1_u64);
|
||||
let il_txs = chain
|
||||
.inclusion_list_cache
|
||||
.read()
|
||||
.get_inclusion_list_transactions(il_slot)
|
||||
.unwrap_or_default();
|
||||
Some(
|
||||
il_txs
|
||||
.into_iter()
|
||||
.map(|tx| tx.to_vec())
|
||||
.collect::<Vec<Vec<u8>>>(),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let payload_attributes = PayloadAttributes::new(
|
||||
timestamp,
|
||||
random,
|
||||
@@ -1127,6 +1145,7 @@ where
|
||||
Some(withdrawals),
|
||||
Some(parent_beacon_block_root),
|
||||
slot_number,
|
||||
inclusion_list_transactions,
|
||||
);
|
||||
|
||||
let target_gas_limit = execution_layer.get_proposer_gas_limit(proposer_index).await;
|
||||
|
||||
@@ -542,6 +542,7 @@ where
|
||||
withdrawals,
|
||||
parent_beacon_block_root,
|
||||
slot_number,
|
||||
None,
|
||||
);
|
||||
|
||||
let target_gas_limit = execution_layer.get_proposer_gas_limit(proposer_index).await;
|
||||
|
||||
@@ -1035,6 +1035,7 @@ async fn payload_preparation() {
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
assert_eq!(rig.previous_payload_attributes(), payload_attributes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user