mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(bin/stage): add explicit doc of the use of to-block and hashing stage (#7805)
Signed-off-by: jsvisa <delweng@gmail.com> Co-authored-by: Oliver Nordbjerg <onbjerg@users.noreply.github.com>
This commit is contained in:
@ -236,10 +236,12 @@ impl Command {
|
||||
/// `reth stage unwind` subcommand
|
||||
#[derive(Subcommand, Debug, Eq, PartialEq)]
|
||||
enum Subcommands {
|
||||
/// Unwinds the database until the given block number (range is inclusive).
|
||||
/// Unwinds the database from the latest block, until the given block number or hash has been
|
||||
/// reached, that block is not included.
|
||||
#[command(name = "to-block")]
|
||||
ToBlock { target: BlockHashOrNumber },
|
||||
/// Unwinds the given number of blocks from the database.
|
||||
/// Unwinds the database from the latest block, until the given number of blocks have been
|
||||
/// reached.
|
||||
#[command(name = "num-blocks")]
|
||||
NumBlocks { amount: u64 },
|
||||
}
|
||||
@ -263,6 +265,9 @@ impl Subcommands {
|
||||
},
|
||||
Subcommands::NumBlocks { amount } => last.saturating_sub(*amount),
|
||||
} + 1;
|
||||
if target > last {
|
||||
eyre::bail!("Target block number is higher than the latest block number")
|
||||
}
|
||||
Ok(target..=last)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user