mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-29 10:43:42 +00:00
Merge conflicts'
This commit is contained in:
@@ -940,12 +940,20 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO(gloas) The following validation can only be completed once fork choice has been implemented:
|
||||
// The block's parent execution payload (defined by bid.parent_block_hash) has been seen
|
||||
// (via gossip or non-gossip sources) (a client MAY queue blocks for processing
|
||||
// once the parent payload is retrieved). If execution_payload verification of block's execution
|
||||
// payload parent by an execution node is complete, verify the block's execution payload
|
||||
// parent (defined by bid.parent_block_hash) passes all validation.
|
||||
// Check that we've received the parent envelope. If not, issue a single envelope
|
||||
// lookup for the parent and queue this block in the reprocess queue.
|
||||
let parent_is_gloas = chain
|
||||
.spec
|
||||
.fork_name_at_slot::<T::EthSpec>(parent_block.slot)
|
||||
.gloas_enabled();
|
||||
|
||||
if parent_is_gloas
|
||||
&& !fork_choice_read_lock.is_payload_received(&block.message().parent_root())
|
||||
{
|
||||
return Err(BlockError::ParentEnvelopeUnknown {
|
||||
parent_root: block.message().parent_root(),
|
||||
});
|
||||
}
|
||||
|
||||
drop(fork_choice_read_lock);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ pub async fn publish_execution_payload_envelope<T: BeaconChainTypes>(
|
||||
})
|
||||
};
|
||||
|
||||
let ctx = chain.gossip_verification_context();
|
||||
let ctx = chain.payload_envelope_gossip_verification_context();
|
||||
let gossip_verified_envelope = match GossipVerifiedEnvelope::new(signed_envelope, &ctx) {
|
||||
Ok(envelope) => envelope,
|
||||
Err(e) => {
|
||||
|
||||
@@ -19,7 +19,7 @@ use lighthouse_network::{
|
||||
};
|
||||
use logging::TimeLatch;
|
||||
use logging::crit;
|
||||
use slot_clock::SlotClock;
|
||||
use slot_clock::{SlotClock, timestamp_now};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::mpsc;
|
||||
use tokio_stream::wrappers::UnboundedReceiverStream;
|
||||
|
||||
@@ -66,7 +66,7 @@ use lighthouse_network::types::{NetworkGlobals, SyncState};
|
||||
use lighthouse_network::{PeerAction, PeerId};
|
||||
use logging::crit;
|
||||
use lru_cache::LRUTimeCache;
|
||||
use slot_clock::SlotClock;
|
||||
use slot_clock::{SlotClock, timestamp_now};
|
||||
use std::ops::Sub;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -1506,6 +1506,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns whether the payload envelope has been received for the given block.
|
||||
pub fn is_payload_received(&self, block_root: &Hash256) -> bool {
|
||||
self.proto_array.is_payload_received(block_root)
|
||||
}
|
||||
|
||||
/// Returns whether the proposer should extend the execution payload chain of the given block.
|
||||
pub fn should_extend_payload(&self, block_root: &Hash256) -> Result<bool, Error<T::Error>> {
|
||||
let proposer_boost_root = self.fc_store.proposer_boost_root();
|
||||
|
||||
Reference in New Issue
Block a user