mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-22 23:38:24 +00:00
Gloas spec v1.7.0-alpha.5 and beacon_chain tests (#8998)
Fix database pruning post-Gloas - Fix DB pruning logic (and state summaries DAG) - Get the `beacon_chain` tests running with `FORK_NAME=gloas` 🎉 Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com> Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
@@ -91,7 +91,7 @@ pub async fn publish_execution_payload_envelope<T: BeaconChainTypes>(
|
||||
chain: Arc<BeaconChain<T>>,
|
||||
network_tx: &UnboundedSender<NetworkMessage<T::EthSpec>>,
|
||||
) -> Result<Response<Body>, Rejection> {
|
||||
let slot = envelope.message.slot;
|
||||
let slot = envelope.slot();
|
||||
let beacon_block_root = envelope.message.beacon_block_root;
|
||||
|
||||
// TODO(gloas): Replace this check once we have gossip validation.
|
||||
@@ -161,9 +161,7 @@ pub(crate) fn get_beacon_execution_payload_envelope<T: BeaconChainTypes>(
|
||||
))
|
||||
})?;
|
||||
|
||||
let fork_name = chain
|
||||
.spec
|
||||
.fork_name_at_slot::<T::EthSpec>(envelope.message.slot);
|
||||
let fork_name = chain.spec.fork_name_at_slot::<T::EthSpec>(envelope.slot());
|
||||
|
||||
match accept_header {
|
||||
Some(api_types::Accept::Ssz) => Response::builder()
|
||||
|
||||
@@ -66,12 +66,11 @@ pub fn get_state_before_applying_block<T: BeaconChainTypes>(
|
||||
})
|
||||
.map_err(|e| custom_not_found(format!("Parent state is not available! {:?}", e)))?;
|
||||
|
||||
// TODO(gloas): handle payloads?
|
||||
let replayer = BlockReplayer::new(parent_state, &chain.spec)
|
||||
.no_signature_verification()
|
||||
.state_root_iter([Ok((parent_block.state_root(), parent_block.slot()))].into_iter())
|
||||
.minimal_block_root_verification()
|
||||
.apply_blocks(vec![], vec![], Some(block.slot()))
|
||||
.apply_blocks(vec![], Some(block.slot()))
|
||||
.map_err(unhandled_error::<BeaconChainError>)?;
|
||||
|
||||
Ok(replayer.into_state())
|
||||
|
||||
@@ -3937,7 +3937,7 @@ impl ApiTester {
|
||||
.cloned()
|
||||
.expect("envelope should exist in pending cache for local building");
|
||||
assert_eq!(envelope.beacon_block_root, block_root);
|
||||
assert_eq!(envelope.slot, slot);
|
||||
assert_eq!(envelope.slot(), slot);
|
||||
}
|
||||
|
||||
/// Assert envelope fields match the expected block root and slot.
|
||||
@@ -3948,9 +3948,8 @@ impl ApiTester {
|
||||
slot: Slot,
|
||||
) {
|
||||
assert_eq!(envelope.beacon_block_root, block_root);
|
||||
assert_eq!(envelope.slot, slot);
|
||||
assert_eq!(envelope.slot(), slot);
|
||||
assert_eq!(envelope.builder_index, BUILDER_INDEX_SELF_BUILD);
|
||||
assert_ne!(envelope.state_root, Hash256::ZERO);
|
||||
}
|
||||
|
||||
/// Sign an execution payload envelope.
|
||||
|
||||
Reference in New Issue
Block a user