chore: rm unused error variants (#14183)

This commit is contained in:
Matthias Seitz
2025-02-04 00:29:29 +01:00
committed by GitHub
parent 556c79f787
commit af3eb83c90
6 changed files with 5 additions and 44 deletions

View File

@ -189,10 +189,3 @@ pub enum InsertBlockValidationError {
#[error(transparent)]
Validation(#[from] BlockValidationError),
}
impl InsertBlockValidationError {
/// Returns true if this is a block pre merge error.
pub const fn is_block_pre_merge(&self) -> bool {
matches!(self, Self::Validation(BlockValidationError::BlockPreMerge { .. }))
}
}

View File

@ -2592,12 +2592,7 @@ where
// invalid headers cache and `Ok` with [PayloadStatusEnum::Invalid] is
// returned.
warn!(target: "engine::tree", invalid_hash=?block.hash(), invalid_number=?block.number(), %validation_err, "Invalid block error on new payload");
let latest_valid_hash = if validation_err.is_block_pre_merge() {
// zero hash must be returned if block is pre-merge
Some(B256::ZERO)
} else {
self.latest_valid_hash_for_invalid_payload(block.parent_hash())?
};
let latest_valid_hash = self.latest_valid_hash_for_invalid_payload(block.parent_hash())?;
// keep track of the invalid header
self.state.invalid_headers.insert(block.block_with_parent());