Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

fix(bin): Fix Compute Pending Block Docs #127

Merged
merged 6 commits into from
Oct 30, 2023
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
6 changes: 5 additions & 1 deletion bin/reth/src/args/payload_builder_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pub struct PayloadBuilderArgs {
/// to save resources and not leak txs from the tx-pool,
/// this flag enables computing of the pending block
/// from the tx-pool instead.
///
/// If `compute_pending_block` is not enabled, the payload builder
/// will use the payload attributes from the latest block. Note
/// that this flag is not yet functional.
#[cfg(feature = "optimism")]
#[arg(long = "rollup.compute-pending-block")]
pub compute_pending_block: bool,
Expand Down Expand Up @@ -94,7 +98,7 @@ impl TypedValueParser for ExtradataValueParser {
format!(
"Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}bytes limit"
),
))
));
}
Ok(val.to_string())
}
Expand Down
22 changes: 14 additions & 8 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ pub struct NodeCommand<Ext: RethCliExt = ()> {
#[clap(flatten)]
pub pruning: PruningArgs,

/// Additional cli arguments
#[clap(flatten)]
pub ext: Ext::Node,

/// Rollup related arguments
#[cfg(feature = "optimism")]
#[clap(flatten)]
rollup: crate::args::RollupArgs,
pub rollup: crate::args::RollupArgs,

/// Additional cli arguments
#[clap(flatten)]
pub ext: Ext::Node,
}

impl<Ext: RethCliExt> NodeCommand<Ext> {
Expand Down Expand Up @@ -238,9 +238,9 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
db,
dev,
pruning,
ext,
#[cfg(feature = "optimism")]
rollup,
ext,
}
}

Expand Down Expand Up @@ -554,6 +554,12 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {

self.ext.on_node_started(&components)?;

// If `enable_genesis_walkback` is set to true, the rollup client will need to
// perform the derivation pipeline from genesis, validating the data dir.
// When set to false, set the finalized, safe, and unsafe head block hashes
// on the rollup client using a fork choice update. This prevents the rollup
// client from performing the derivation pipeline from genesis, and instead
// starts syncing from the current tip in the DB.
#[cfg(feature = "optimism")]
if self.chain.optimism && !self.rollup.enable_genesis_walkback {
let client = _rpc_server_handles.auth.http_client();
Expand Down Expand Up @@ -788,15 +794,15 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
// try to look up the header in the database
if let Some(header) = header {
info!(target: "reth::cli", ?tip, "Successfully looked up tip block in the database");
return Ok(header.seal_slow())
return Ok(header.seal_slow());
}

info!(target: "reth::cli", ?tip, "Fetching tip block from the network.");
loop {
match get_single_header(&client, tip).await {
Ok(tip_header) => {
info!(target: "reth::cli", ?tip, "Successfully fetched tip");
return Ok(tip_header)
return Ok(tip_header);
}
Err(error) => {
error!(target: "reth::cli", %error, "Failed to fetch the tip. Retrying...");
Expand Down
Loading