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

Commit

Permalink
Merge pull request #145 from anton-rs/refcell/small-nits
Browse files Browse the repository at this point in the history
chore: Smaller Nits
  • Loading branch information
clabby authored Oct 31, 2023
2 parents ce627e2 + 3a0317c commit 825cc73
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 91 deletions.
1 change: 0 additions & 1 deletion bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]
optimism = [
"reth-primitives/optimism",
"reth-primitives/value-256",
"reth-revm/optimism",
"reth-interfaces/optimism",
"reth-rpc/optimism",
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/args/payload_builder_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,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
7 changes: 2 additions & 5 deletions bin/reth/src/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ impl Command {
// TODO: add support for withdrawals
withdrawals: None,
#[cfg(feature = "optimism")]
optimism_payload_attributes: reth_rpc_types::engine::OptimismPayloadAttributes {
transactions: None,
no_tx_pool: None,
gas_limit: None,
},
optimism_payload_attributes: reth_rpc_types::engine::OptimismPayloadAttributes::default(
),
};
let payload_config = PayloadConfig::new(
Arc::clone(&best_block),
Expand Down
1 change: 0 additions & 1 deletion bin/reth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ pub mod dirs;
pub mod init;
pub mod node;
pub mod p2p;
pub mod precaution;
pub mod prometheus_exporter;
pub mod recover;
pub mod runner;
Expand Down
4 changes: 0 additions & 4 deletions bin/reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn main() {
// Ensure feature flags are set correctly for different chains
reth::precaution::ensure_ethereum!();
reth::precaution::ensure_optimism!();

if let Err(err) = reth::cli::run() {
eprintln!("Error: {err:?}");
std::process::exit(1);
Expand Down
13 changes: 4 additions & 9 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ use std::{
use tokio::sync::{mpsc::unbounded_channel, oneshot, watch};
use tracing::*;

#[cfg(feature = "optimism")]
use reth_rpc_api::EngineApiClient;
#[cfg(feature = "optimism")]
use reth_rpc_types::engine::ForkchoiceState;

pub mod cl_events;
pub mod events;

Expand Down Expand Up @@ -563,9 +558,9 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
#[cfg(feature = "optimism")]
if self.chain.optimism && !self.rollup.enable_genesis_walkback {
let client = _rpc_server_handles.auth.http_client();
EngineApiClient::fork_choice_updated_v2(
reth_rpc_api::EngineApiClient::fork_choice_updated_v2(
&client,
ForkchoiceState {
reth_rpc_types::engine::ForkchoiceState {
head_block_hash: head.hash,
safe_block_hash: head.hash,
finalized_block_hash: head.hash,
Expand Down Expand Up @@ -794,15 +789,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
24 changes: 0 additions & 24 deletions bin/reth/src/precaution.rs

This file was deleted.

Loading

0 comments on commit 825cc73

Please sign in to comment.