mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
merge conflicts
This commit is contained in:
@@ -1956,11 +1956,13 @@ fn load_parent<T: BeaconChainTypes, B: AsBlock<T::EthSpec>>(
|
|||||||
if block.as_block().is_parent_block_full(parent_bid_block_hash) {
|
if block.as_block().is_parent_block_full(parent_bid_block_hash) {
|
||||||
// TODO(gloas): loading the envelope here is not very efficient
|
// TODO(gloas): loading the envelope here is not very efficient
|
||||||
// TODO(gloas): check parent payload existence prior to this point?
|
// TODO(gloas): check parent payload existence prior to this point?
|
||||||
let envelope = chain.store.get_payload_envelope(&root)?.ok_or_else(|| {
|
// If the parent's execution payload envelope hasn't arrived yet,
|
||||||
BeaconChainError::DBInconsistent(format!(
|
// return an unknown parent error so the block gets sent to the
|
||||||
"Missing envelope for parent block {root:?}",
|
// reprocess queue.
|
||||||
))
|
let envelope = chain
|
||||||
})?;
|
.store
|
||||||
|
.get_payload_envelope(&root)?
|
||||||
|
.ok_or(BlockError::ParentEnvelopeUnknown { parent_root: root })?;
|
||||||
(StatePayloadStatus::Full, envelope.message.state_root)
|
(StatePayloadStatus::Full, envelope.message.state_root)
|
||||||
} else {
|
} else {
|
||||||
(StatePayloadStatus::Pending, parent_block.state_root())
|
(StatePayloadStatus::Pending, parent_block.state_root())
|
||||||
|
|||||||
@@ -5129,7 +5129,7 @@ async fn replay_from_split_state() {
|
|||||||
assert!(
|
assert!(
|
||||||
store
|
store
|
||||||
.hierarchy
|
.hierarchy
|
||||||
.storage_strategy(split.slot, anchor_slot, StatePayloadStatus::Pending)
|
.storage_strategy(split.slot, anchor_slot)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.is_replay_from()
|
.is_replay_from()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -815,42 +815,33 @@ mod tests {
|
|||||||
let sslot = Slot::new(0);
|
let sslot = Slot::new(0);
|
||||||
|
|
||||||
let moduli = config.to_moduli().unwrap();
|
let moduli = config.to_moduli().unwrap();
|
||||||
let payload_status = StatePayloadStatus::Pending;
|
|
||||||
|
|
||||||
// Full snapshots at multiples of 2^21.
|
// Full snapshots at multiples of 2^21.
|
||||||
let snapshot_freq = Slot::new(1 << 21);
|
let snapshot_freq = Slot::new(1 << 21);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
moduli
|
moduli.storage_strategy(Slot::new(0), sslot).unwrap(),
|
||||||
.storage_strategy(Slot::new(0), sslot, payload_status)
|
|
||||||
.unwrap(),
|
|
||||||
StorageStrategy::Snapshot
|
StorageStrategy::Snapshot
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
moduli
|
moduli.storage_strategy(snapshot_freq, sslot).unwrap(),
|
||||||
.storage_strategy(snapshot_freq, sslot, payload_status)
|
|
||||||
.unwrap(),
|
|
||||||
StorageStrategy::Snapshot
|
StorageStrategy::Snapshot
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
moduli
|
moduli.storage_strategy(snapshot_freq * 3, sslot).unwrap(),
|
||||||
.storage_strategy(snapshot_freq * 3, sslot, payload_status)
|
|
||||||
.unwrap(),
|
|
||||||
StorageStrategy::Snapshot
|
StorageStrategy::Snapshot
|
||||||
);
|
);
|
||||||
|
|
||||||
// Diffs should be from the previous layer (the snapshot in this case), and not the previous diff in the same layer.
|
// Diffs should be from the previous layer (the snapshot in this case), and not the previous diff in the same layer.
|
||||||
let first_layer = Slot::new(1 << 18);
|
let first_layer = Slot::new(1 << 18);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
moduli
|
moduli.storage_strategy(first_layer * 2, sslot).unwrap(),
|
||||||
.storage_strategy(first_layer * 2, sslot, payload_status)
|
|
||||||
.unwrap(),
|
|
||||||
StorageStrategy::DiffFrom(Slot::new(0))
|
StorageStrategy::DiffFrom(Slot::new(0))
|
||||||
);
|
);
|
||||||
|
|
||||||
let replay_strategy_slot = first_layer + 1;
|
let replay_strategy_slot = first_layer + 1;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
moduli
|
moduli
|
||||||
.storage_strategy(replay_strategy_slot, sslot, payload_status)
|
.storage_strategy(replay_strategy_slot, sslot)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
StorageStrategy::ReplayFrom(first_layer)
|
StorageStrategy::ReplayFrom(first_layer)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user