mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 14:58:31 +00:00
merge conflicts
This commit is contained in:
@@ -60,6 +60,7 @@ use crate::execution_payload::{
|
||||
};
|
||||
use crate::kzg_utils::blobs_to_data_column_sidecars;
|
||||
use crate::observed_block_producers::SeenBlock;
|
||||
use crate::payload_envelope_verification::EnvelopeError;
|
||||
use crate::validator_monitor::HISTORIC_EPOCHS as VALIDATOR_MONITOR_HISTORIC_EPOCHS;
|
||||
use crate::validator_pubkey_cache::ValidatorPubkeyCache;
|
||||
use crate::{
|
||||
@@ -321,13 +322,18 @@ pub enum BlockError {
|
||||
bid_parent_root: Hash256,
|
||||
block_parent_root: Hash256,
|
||||
},
|
||||
/// The parent block is known but its execution payload envelope has not been received yet.
|
||||
/// The child block is known but its parent execution payload envelope has not been received yet.
|
||||
///
|
||||
/// ## Peer scoring
|
||||
///
|
||||
/// It's unclear if this block is valid, but it cannot be fully verified without the parent's
|
||||
/// execution payload envelope.
|
||||
ParentEnvelopeUnknown { parent_root: Hash256 },
|
||||
|
||||
PayloadEnvelopeError {
|
||||
e: Box<EnvelopeError>,
|
||||
penalize_peer: bool,
|
||||
},
|
||||
}
|
||||
|
||||
/// Which specific signature(s) are invalid in a SignedBeaconBlock
|
||||
@@ -494,6 +500,36 @@ impl From<ArithError> for BlockError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EnvelopeError> for BlockError {
|
||||
fn from(e: EnvelopeError) -> Self {
|
||||
let penalize_peer = match &e {
|
||||
// REJECT per spec: peer sent invalid envelope data
|
||||
EnvelopeError::BadSignature
|
||||
| EnvelopeError::BuilderIndexMismatch { .. }
|
||||
| EnvelopeError::BlockHashMismatch { .. }
|
||||
| EnvelopeError::SlotMismatch { .. }
|
||||
| EnvelopeError::IncorrectBlockProposer { .. } => true,
|
||||
// IGNORE per spec: not the peer's fault
|
||||
EnvelopeError::BlockRootUnknown { .. }
|
||||
| EnvelopeError::PriorToFinalization { .. }
|
||||
| EnvelopeError::UnknownValidator { .. } => false,
|
||||
// Internal errors: not the peer's fault
|
||||
EnvelopeError::BeaconChainError(_)
|
||||
| EnvelopeError::BeaconStateError(_)
|
||||
| EnvelopeError::BlockProcessingError(_)
|
||||
| EnvelopeError::EnvelopeProcessingError(_)
|
||||
| EnvelopeError::ExecutionPayloadError(_)
|
||||
| EnvelopeError::BlockError(_)
|
||||
| EnvelopeError::InternalError(_)
|
||||
| EnvelopeError::OptimisticSyncNotSupported { .. } => false,
|
||||
};
|
||||
BlockError::PayloadEnvelopeError {
|
||||
e: Box::new(e),
|
||||
penalize_peer,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Stores information about verifying a payload against an execution engine.
|
||||
#[derive(Debug, PartialEq, Clone, Encode, Decode)]
|
||||
pub struct PayloadVerificationOutcome {
|
||||
@@ -1978,8 +2014,9 @@ fn load_parent<T: BeaconChainTypes, B: AsBlock<T::EthSpec>>(
|
||||
} else if let Ok(parent_bid_block_hash) = parent_block.payload_bid_block_hash()
|
||||
&& block.as_block().is_parent_block_full(parent_bid_block_hash)
|
||||
{
|
||||
// Post-Gloas Full block case.
|
||||
// TODO(gloas): loading the envelope here is not very efficient
|
||||
// If the parent's execution payload envelope hasn't arrived yet,
|
||||
// return an unknown parent error so the block gets sent to the
|
||||
// reprocess queue.
|
||||
let envelope = chain
|
||||
.store
|
||||
.get_payload_envelope(&root)?
|
||||
|
||||
Reference in New Issue
Block a user