Skip to content
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
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.16.0-rc.8"
version = "0.16.0-rc.9"
edition = "2024"
rust-version = "1.88"
authors = ["init4"]
Expand Down Expand Up @@ -34,15 +34,15 @@ debug = false
incremental = false

[workspace.dependencies]
signet-blobber = { version = "0.16.0-rc.8", path = "crates/blobber" }
signet-block-processor = { version = "0.16.0-rc.8", path = "crates/block-processor" }
signet-db = { version = "0.16.0-rc.8", path = "crates/db" }
signet-genesis = { version = "0.16.0-rc.8", path = "crates/genesis" }
signet-node = { version = "0.16.0-rc.8", path = "crates/node" }
signet-node-config = { version = "0.16.0-rc.8", path = "crates/node-config" }
signet-node-tests = { version = "0.16.0-rc.8", path = "crates/node-tests" }
signet-node-types = { version = "0.16.0-rc.8", path = "crates/node-types" }
signet-rpc = { version = "0.16.0-rc.8", path = "crates/rpc" }
signet-blobber = { version = "0.16.0-rc.9", path = "crates/blobber" }
signet-block-processor = { version = "0.16.0-rc.9", path = "crates/block-processor" }
signet-db = { version = "0.16.0-rc.9", path = "crates/db" }
signet-genesis = { version = "0.16.0-rc.9", path = "crates/genesis" }
signet-node = { version = "0.16.0-rc.9", path = "crates/node" }
signet-node-config = { version = "0.16.0-rc.9", path = "crates/node-config" }
signet-node-tests = { version = "0.16.0-rc.9", path = "crates/node-tests" }
signet-node-types = { version = "0.16.0-rc.9", path = "crates/node-types" }
signet-rpc = { version = "0.16.0-rc.9", path = "crates/rpc" }

init4-bin-base = { version = "0.18.0-rc.8", features = ["alloy"] }

Expand Down
18 changes: 18 additions & 0 deletions crates/node-config/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::{
fmt::Display,
path::PathBuf,
sync::{Arc, OnceLock},
time::Duration,
};
use tracing::warn;
use trevm::revm::primitives::hardfork::SpecId;
Expand Down Expand Up @@ -72,6 +73,15 @@ pub struct SignetNodeConfig {
optional
)]
backfill_max_blocks: Option<u64>,

/// Maximum duration of a backfill batch.
/// This prevents MDBX from killing the read transaction, leading to a crash if reth's default mdbx read transaction timeout is exceeded.
#[from_env(
var = "BACKFILL_MAX_DURATION",
desc = "Maximum duration of a backfill batch, in seconds",
optional
)]
backfill_max_duration: Option<u64>,
}

impl Display for SignetNodeConfig {
Expand Down Expand Up @@ -105,6 +115,7 @@ impl SignetNodeConfig {
genesis,
slot_calculator,
backfill_max_blocks: None, // Uses default of 10,000 via accessor
backfill_max_duration: None, // Uses default of 30 seconds via accessor
}
}

Expand Down Expand Up @@ -252,6 +263,12 @@ impl SignetNodeConfig {
// Default to 10,000 if not explicitly configured
Some(self.backfill_max_blocks.unwrap_or(10_000))
}

/// Get the maximum duration of a backfill batch.
/// Returns `Some(30)` seconds by default if not configured.
pub fn backfill_max_duration(&self) -> Option<Duration> {
Some(Duration::from_secs(self.backfill_max_duration.unwrap_or(30)))
}
}

#[cfg(test)]
Expand All @@ -272,6 +289,7 @@ mod defaults {
genesis: GenesisSpec::Known(KnownChains::Test),
slot_calculator: SlotCalculator::new(0, 0, 12),
backfill_max_blocks: None, // Uses default of 10,000 via accessor
backfill_max_duration: None, // Uses default of 30 seconds via accessor
}
}
}
Expand Down
15 changes: 8 additions & 7 deletions crates/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,14 @@ where
/// This should be called after `set_with_head` to configure how many
/// blocks can be processed per backfill batch.
fn set_backfill_thresholds(&mut self) {
if let Some(max_blocks) = self.config.backfill_max_blocks() {
self.host.notifications.set_backfill_thresholds(ExecutionStageThresholds {
max_blocks: Some(max_blocks),
..Default::default()
});
debug!(max_blocks, "configured backfill thresholds");
}
let max_blocks = self.config.backfill_max_blocks();
let max_duration = self.config.backfill_max_duration();
self.host.notifications.set_backfill_thresholds(ExecutionStageThresholds {
max_blocks,
max_duration,
..Default::default()
});
debug!(?max_blocks, ?max_duration, "configured backfill thresholds");
}

/// Runs on any notification received from the ExEx context.
Expand Down