Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bin/reth/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ struct Cli {
verbosity: Verbosity,
}

/// The log configuration.
#[derive(Args)]
#[command(next_help_heading = "Logging")]
struct Logs {
pub struct Logs {
/// The path to put log files in.
#[arg(
long = "log.directory",
Expand All @@ -112,7 +113,7 @@ struct Logs {

impl Logs {
/// Builds a tracing layer from the current log options.
fn layer<S>(&self) -> (BoxedLayer<S>, Option<FileWorkerGuard>)
pub fn layer<S>(&self) -> (BoxedLayer<S>, Option<FileWorkerGuard>)
where
S: Subscriber,
for<'a> S: LookupSpan<'a>,
Expand All @@ -129,9 +130,10 @@ impl Logs {
}
}

/// The verbosity settings for the cli.
#[derive(Args)]
#[command(next_help_heading = "Display")]
struct Verbosity {
pub struct Verbosity {
/// Set the minimum log level.
///
/// -v Errors
Expand All @@ -150,7 +152,7 @@ struct Verbosity {
impl Verbosity {
/// Get the corresponding [Directive] for the given verbosity, or none if the verbosity
/// corresponds to silent.
fn directive(&self) -> Directive {
pub fn directive(&self) -> Directive {
if self.quiet {
LevelFilter::OFF.into()
} else {
Expand Down
3 changes: 2 additions & 1 deletion bin/reth/src/dirs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ impl XdgPath for LogsDir {

/// A small helper trait for unit structs that represent a standard path following the XDG
/// path specification.
trait XdgPath {
pub trait XdgPath {
/// Resolve the standard path.
fn resolve() -> Option<PathBuf>;
}

Expand Down
11 changes: 7 additions & 4 deletions crates/stages/src/stages/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,20 @@ where

/// Represents a gap to sync: from `local_head` to `target`
#[derive(Debug)]
struct SyncGap {
local_head: SealedHeader,
target: SyncTarget,
pub struct SyncGap {
/// The local head block. Represents lower bound of sync range.
pub local_head: SealedHeader,

/// The sync target. Represents upper bound of sync range.
pub target: SyncTarget,
}

// === impl SyncGap ===

impl SyncGap {
/// Returns `true` if the gap from the head to the target was closed
#[inline]
fn is_closed(&self) -> bool {
pub fn is_closed(&self) -> bool {
self.local_head.hash() == self.target.tip()
}
}
Expand Down