mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: Pseudo peer and staged sync
For simplicity, we use with_pow() + pseudo peer that connects to reth itself, so that it can support 1. StateFetcher via NetworkState 2. Block announcement (which requires with_pow()). For block announcement, another way was using ImportService like before, or calling engine_api. But for simplicitiy, for now we just publish from pseudo peer like pre-PoS, hence with_pow().
This commit is contained in:
36
src/pseudo_peer/error.rs
Normal file
36
src/pseudo_peer/error.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum PseudoPeerError {
|
||||
#[error("Block source error: {0}")]
|
||||
BlockSource(String),
|
||||
|
||||
#[error("Network error: {0}")]
|
||||
Network(#[from] reth_network::error::NetworkError),
|
||||
|
||||
#[error("Configuration error: {0}")]
|
||||
Config(String),
|
||||
|
||||
#[error("AWS S3 error: {0}")]
|
||||
S3(#[from] aws_sdk_s3::Error),
|
||||
|
||||
#[error("IO error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error("Serialization error: {0}")]
|
||||
Serialization(#[from] rmp_serde::encode::Error),
|
||||
|
||||
#[error("Deserialization error: {0}")]
|
||||
Deserialization(#[from] rmp_serde::decode::Error),
|
||||
|
||||
#[error("Compression error: {0}")]
|
||||
Compression(String),
|
||||
}
|
||||
|
||||
impl From<eyre::Error> for PseudoPeerError {
|
||||
fn from(err: eyre::Error) -> Self {
|
||||
PseudoPeerError::Config(err.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, PseudoPeerError>;
|
||||
Reference in New Issue
Block a user