Skip to content
Open
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bin/tempo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
62 changes: 1 addition & 61 deletions bin/tempo/src/defaults.rs
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -119,58 +114,3 @@ pub(crate) struct TelemetryConfig {
/// Authorization header for metrics push
pub(crate) metrics_auth_header: Option<String>,
}

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();
}
2 changes: 1 addition & 1 deletion bin/tempo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tempo-primitives = { workspace = true, features = ["default"] }

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"] }
Expand Down
61 changes: 61 additions & 0 deletions crates/node/src/defaults.rs
Original file line number Diff line number Diff line change
@@ -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();
}
2 changes: 2 additions & 0 deletions crates/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg))]

pub use defaults::init_defaults;
pub use tempo_payload_types::{TempoExecutionData, TempoPayloadTypes};
pub use version::{init_version_metadata, version_metadata};

Expand All @@ -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;
Expand Down
Loading