use alloy_eips::BlockId;
use alloy_primitives::B256;
use alloy_transport::{RpcError, TransportErrorKind};
use kona_protocol::FromBlockError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum SyncStartError {
#[error("An RPC error occurred: {0}")]
RpcError(#[from] RpcError<TransportErrorKind>),
#[error(transparent)]
FromBlock(#[from] FromBlockError),
#[error("Block not found: {0}")]
BlockNotFound(BlockId),
#[error("Invalid L1 genesis hash. Expected {0}, Got {1}")]
InvalidL1GenesisHash(B256, B256),
#[error("Invalid L2 genesis hash. Expected {0}, Got {1}")]
InvalidL2GenesisHash(B256, B256),
#[error("Finalized block mismatch. Expected {0}, Got {1}")]
MismatchedFinalizedBlock(B256, B256),
#[error("L1 origin mismatch")]
L1OriginMismatch,
#[error("Non-zero sequence number for block with different L1 origin")]
NonZeroSequenceNumber,
#[error("Inconsistent sequence number; Must monotonically increase.")]
InconsistentSequenceNumber,
}