tempo/defaults.rs
1use reth_cli_commands::download::DownloadDefaults;
2use reth_ethereum::node::core::args::{DefaultPayloadBuilderValues, DefaultTxPoolValues};
3use std::{borrow::Cow, time::Duration};
4
5pub(crate) const DEFAULT_DOWNLOAD_URL: &str = "https://snapshots.tempoxyz.dev/42429";
6
7fn init_download_urls() {
8 let download_defaults = DownloadDefaults {
9 available_snapshots: vec![Cow::Borrowed(
10 "https://snapshots.tempoxyz.dev/42429 (andantino-1)",
11 )],
12 default_base_url: Cow::Borrowed(DEFAULT_DOWNLOAD_URL),
13 long_help: None,
14 };
15
16 download_defaults
17 .try_init()
18 .expect("failed to initialize download URLs");
19}
20
21fn init_payload_builder_defaults() {
22 DefaultPayloadBuilderValues::default()
23 .with_interval(Duration::from_millis(100))
24 .with_max_payload_tasks(16)
25 .with_deadline(4)
26 .try_init()
27 .expect("failed to initialize payload builder defaults");
28}
29
30fn init_txpool_defaults() {
31 DefaultTxPoolValues::default()
32 .with_pending_max_count(50000)
33 .with_basefee_max_count(50000)
34 .with_queued_max_count(50000)
35 .with_pending_max_size(100)
36 .with_basefee_max_size(100)
37 .with_queued_max_size(100)
38 .with_no_locals(true)
39 .with_max_queued_lifetime(Duration::from_secs(120))
40 .with_max_new_pending_txs_notifications(150000)
41 .with_max_account_slots(150000)
42 .with_pending_tx_listener_buffer_size(50000)
43 .with_new_tx_listener_buffer_size(50000)
44 .with_disable_transactions_backup(true)
45 .with_additional_validation_tasks(8)
46 .with_minimal_protocol_basefee(0)
47 .with_minimum_priority_fee(Some(0))
48 .with_max_batch_size(50000)
49 .try_init()
50 .expect("failed to initialize txpool defaults");
51}
52
53pub(crate) fn init_defaults() {
54 init_download_urls();
55 init_payload_builder_defaults();
56 init_txpool_defaults();
57}