From 2abbee1ba24a32a651a3a9693f87bb3234d97f64 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Thu, 19 Feb 2026 17:18:58 +0100 Subject: [PATCH 1/3] move init_defaults to tempo-node crate Move init_download_urls, init_payload_builder_defaults, init_txpool_defaults and the public init_defaults function from bin/tempo into crates/node/src/defaults.rs. Re-export init_defaults from tempo_node lib.rs alongside init_version_metadata. Telemetry CLI types (TelemetryArgs, UrlWithAuth, TelemetryConfig) remain in the tempo binary as they are CLI-specific. Amp-Thread-ID: https://ampcode.com/threads/T-019c76ac-cb19-70fd-aa37-75be4e69ea25 Co-authored-by: Amp --- Cargo.lock | 2 +- bin/tempo/Cargo.toml | 1 - bin/tempo/src/defaults.rs | 62 +------------------------------------ bin/tempo/src/main.rs | 2 +- crates/node/Cargo.toml | 2 ++ crates/node/src/defaults.rs | 61 ++++++++++++++++++++++++++++++++++++ crates/node/src/lib.rs | 2 ++ 7 files changed, 68 insertions(+), 64 deletions(-) create mode 100644 crates/node/src/defaults.rs diff --git a/Cargo.lock b/Cargo.lock index 3c7fd9a5cb..3b610a789b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11704,7 +11704,6 @@ dependencies = [ "pyroscope", "pyroscope_pprofrs", "rand 0.8.5", - "reth-cli-commands", "reth-cli-runner", "reth-cli-util", "reth-ethereum", @@ -12036,6 +12035,7 @@ dependencies = [ "p256", "rand 0.9.2", "reqwest 0.13.2", + "reth-cli-commands", "reth-e2e-test-utils", "reth-engine-local", "reth-errors", diff --git a/bin/tempo/Cargo.toml b/bin/tempo/Cargo.toml index 18d33e5118..6b18d7bc7b 100644 --- a/bin/tempo/Cargo.toml +++ b/bin/tempo/Cargo.toml @@ -45,7 +45,6 @@ serde_json.workspace = true tempo-alloy.workspace = true tempo-contracts.workspace = true tempo-dkg-onchain-artifacts.workspace = true -reth-cli-commands.workspace = true reth-cli-runner.workspace = true reth-cli-util.workspace = true rustls.workspace = true diff --git a/bin/tempo/src/defaults.rs b/bin/tempo/src/defaults.rs index 6f04c52478..7566c2dd8e 100644 --- a/bin/tempo/src/defaults.rs +++ b/bin/tempo/src/defaults.rs @@ -1,14 +1,9 @@ use base64::{Engine, prelude::BASE64_STANDARD}; use eyre::Context as _; use jiff::SignedDuration; -use reth_cli_commands::download::DownloadDefaults; -use reth_ethereum::node::core::args::{DefaultPayloadBuilderValues, DefaultTxPoolValues}; -use std::{borrow::Cow, str::FromStr, time::Duration}; -use tempo_chainspec::hardfork::TempoHardfork; +use std::str::FromStr; use url::Url; -pub(crate) const DEFAULT_DOWNLOAD_URL: &str = "https://snapshots.tempoxyz.dev/4217"; - /// Default OTLP logs filter level for telemetry. const DEFAULT_LOGS_OTLP_FILTER: &str = "debug"; @@ -119,58 +114,3 @@ pub(crate) struct TelemetryConfig { /// Authorization header for metrics push pub(crate) metrics_auth_header: Option, } - -fn init_download_urls() { - let download_defaults = DownloadDefaults { - available_snapshots: vec![ - Cow::Owned(format!("{DEFAULT_DOWNLOAD_URL} (mainnet)")), - Cow::Borrowed("https://snapshots.tempoxyz.dev/42431 (moderato)"), - Cow::Borrowed("https://snapshots.tempoxyz.dev/42429 (andantino)"), - ], - default_base_url: Cow::Borrowed(DEFAULT_DOWNLOAD_URL), - default_chain_aware_base_url: None, - long_help: None, - }; - - download_defaults - .try_init() - .expect("failed to initialize download URLs"); -} - -fn init_payload_builder_defaults() { - DefaultPayloadBuilderValues::default() - .with_interval(Duration::from_millis(100)) - .with_max_payload_tasks(16) - .with_deadline(4) - .try_init() - .expect("failed to initialize payload builder defaults"); -} - -fn init_txpool_defaults() { - DefaultTxPoolValues::default() - .with_pending_max_count(50000) - .with_basefee_max_count(50000) - .with_queued_max_count(50000) - .with_pending_max_size(100) - .with_basefee_max_size(100) - .with_queued_max_size(100) - .with_no_locals(true) - .with_max_queued_lifetime(Duration::from_secs(120)) - .with_max_new_pending_txs_notifications(150000) - .with_max_account_slots(150000) - .with_pending_tx_listener_buffer_size(50000) - .with_new_tx_listener_buffer_size(50000) - .with_disable_transactions_backup(true) - .with_additional_validation_tasks(8) - .with_minimal_protocol_basefee(TempoHardfork::default().base_fee()) - .with_minimum_priority_fee(Some(0)) - .with_max_batch_size(50000) - .try_init() - .expect("failed to initialize txpool defaults"); -} - -pub(crate) fn init_defaults() { - init_download_urls(); - init_payload_builder_defaults(); - init_txpool_defaults(); -} diff --git a/bin/tempo/src/main.rs b/bin/tempo/src/main.rs index 55e5262429..7f400126bf 100644 --- a/bin/tempo/src/main.rs +++ b/bin/tempo/src/main.rs @@ -131,7 +131,7 @@ fn main() -> eyre::Result<()> { } tempo_node::init_version_metadata(); - defaults::init_defaults(); + tempo_node::init_defaults(); let mut cli = Cli::< TempoChainSpecParser, diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index 8cc88d9461..f4bcc73b7c 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -21,6 +21,8 @@ tempo-payload-types.workspace = true tempo-precompiles.workspace = true tempo-primitives = { workspace = true, features = ["default"] } +base64.workspace = true +reth-cli-commands.workspace = true thiserror.workspace = true reth-errors.workspace = true diff --git a/crates/node/src/defaults.rs b/crates/node/src/defaults.rs new file mode 100644 index 0000000000..ba2890c166 --- /dev/null +++ b/crates/node/src/defaults.rs @@ -0,0 +1,61 @@ +use reth_cli_commands::download::DownloadDefaults; +use reth_ethereum::node::core::args::{DefaultPayloadBuilderValues, DefaultTxPoolValues}; +use std::{borrow::Cow, time::Duration}; +use tempo_chainspec::hardfork::TempoHardfork; + +pub const DEFAULT_DOWNLOAD_URL: &str = "https://snapshots.tempoxyz.dev/4217"; + +fn init_download_urls() { + let download_defaults = DownloadDefaults { + available_snapshots: vec![ + Cow::Owned(format!("{DEFAULT_DOWNLOAD_URL} (mainnet)")), + Cow::Borrowed("https://snapshots.tempoxyz.dev/42431 (moderato)"), + Cow::Borrowed("https://snapshots.tempoxyz.dev/42429 (andantino)"), + ], + default_base_url: Cow::Borrowed(DEFAULT_DOWNLOAD_URL), + default_chain_aware_base_url: None, + long_help: None, + }; + + download_defaults + .try_init() + .expect("failed to initialize download URLs"); +} + +fn init_payload_builder_defaults() { + DefaultPayloadBuilderValues::default() + .with_interval(Duration::from_millis(100)) + .with_max_payload_tasks(16) + .with_deadline(4) + .try_init() + .expect("failed to initialize payload builder defaults"); +} + +fn init_txpool_defaults() { + DefaultTxPoolValues::default() + .with_pending_max_count(50000) + .with_basefee_max_count(50000) + .with_queued_max_count(50000) + .with_pending_max_size(100) + .with_basefee_max_size(100) + .with_queued_max_size(100) + .with_no_locals(true) + .with_max_queued_lifetime(Duration::from_secs(120)) + .with_max_new_pending_txs_notifications(150000) + .with_max_account_slots(150000) + .with_pending_tx_listener_buffer_size(50000) + .with_new_tx_listener_buffer_size(50000) + .with_disable_transactions_backup(true) + .with_additional_validation_tasks(8) + .with_minimal_protocol_basefee(TempoHardfork::default().base_fee()) + .with_minimum_priority_fee(Some(0)) + .with_max_batch_size(50000) + .try_init() + .expect("failed to initialize txpool defaults"); +} + +pub fn init_defaults() { + init_download_urls(); + init_payload_builder_defaults(); + init_txpool_defaults(); +} diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index e8069a2f66..9a7fdeca4e 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -4,6 +4,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] pub use tempo_payload_types::{TempoExecutionData, TempoPayloadTypes}; +pub use defaults::init_defaults; pub use version::{init_version_metadata, version_metadata}; use crate::node::{TempoAddOns, TempoNode}; @@ -12,6 +13,7 @@ use reth_ethereum::provider::db::DatabaseEnv; use reth_node_builder::{FullNode, NodeAdapter, RethFullAdapter}; pub use tempo_transaction_pool::validator::DEFAULT_AA_VALID_AFTER_MAX_SECS; +pub mod defaults; pub mod engine; pub mod node; pub mod rpc; From 06561c87b941715ed272867f78dce1e008ef5f6b Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Thu, 19 Feb 2026 17:21:17 +0100 Subject: [PATCH 2/3] fmt Amp-Thread-ID: https://ampcode.com/threads/T-019c76ac-cb19-70fd-aa37-75be4e69ea25 Co-authored-by: Amp --- crates/node/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index 9a7fdeca4e..af2ed38851 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -3,8 +3,8 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] -pub use tempo_payload_types::{TempoExecutionData, TempoPayloadTypes}; pub use defaults::init_defaults; +pub use tempo_payload_types::{TempoExecutionData, TempoPayloadTypes}; pub use version::{init_version_metadata, version_metadata}; use crate::node::{TempoAddOns, TempoNode}; From b9d21c4ad691f965738cd08068c0fbda36ec4fd8 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Thu, 19 Feb 2026 17:25:10 +0100 Subject: [PATCH 3/3] remove unused base64 dep, move reth-cli-commands to reth section Amp-Thread-ID: https://ampcode.com/threads/T-019c76ac-cb19-70fd-aa37-75be4e69ea25 Co-authored-by: Amp --- crates/node/Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index f4bcc73b7c..fa6de5b5da 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -21,10 +21,9 @@ tempo-payload-types.workspace = true tempo-precompiles.workspace = true tempo-primitives = { workspace = true, features = ["default"] } -base64.workspace = true -reth-cli-commands.workspace = true thiserror.workspace = true +reth-cli-commands.workspace = true reth-errors.workspace = true reth-ethereum = { workspace = true, features = ["node", "rpc"] } reth-primitives-traits = { workspace = true, features = ["secp256k1", "rayon"] }