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 archiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ All flags can also be set via environment variables (see below).
| `--end-height` | `END_HEIGHT` | *(none)* | Stop after this block (inclusive). Omit to follow the tip |
| `--max-fetch-tasks` | `MAX_FETCH_TASKS` | `8` | Max concurrent block fetch tasks (IO-bound) |
| `--max-api-range` | `MAX_API_RANGE` | `1000` | Max block range per `/roots` API request |
| `--stream-timeout-secs` | `STREAM_TIMEOUT_SECS` | `120` | Seconds before treating a stream as stalled |
| `--stream-timeout-secs` | `STREAM_TIMEOUT_SECS` | `180` | Seconds without a new root before the stream is rebuilt; keep it above the eth client's 130 s block-fetch retry budget so fallbacks get a chance to serve |
| `--sled-db-path` | `SLED_DB_PATH` | `./data/roots.sled` | Path to the sled database directory |
| `--api-bind` | `API_BIND` | `0.0.0.0:8080` | HTTP API bind address |
| `--flush-every` | `FLUSH_EVERY` | `10000` | Catch-up batch size: write roots (and request a flush) every N blocks |
Expand Down
11 changes: 8 additions & 3 deletions archiver/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ pub struct Config {
#[arg(long, env = "MAX_API_RANGE", default_value = "1000")]
pub max_api_range: u64,

/// Timeout in seconds for the stream before treating it as stalled.
#[arg(long, env = "STREAM_TIMEOUT_SECS", default_value = "120")]
pub stream_timeout_secs: u64,
/// Seconds without a new root before the stream is declared stalled and rebuilt
/// (reconnect + anchor check). This is the outer watchdog; it must be longer than the
/// block-fetch retry budget inside the eth client (5 sweeps over `[primary, fallbacks]`
/// with 10/20/40/60 s back-off, i.e. 130 s of waiting) or the watchdog tears the stream
/// down while the client is still walking its fallbacks, and a block that only a fallback
/// can serve never gets served.
#[arg(long, env = "STREAM_TIMEOUT_SECS", default_value = "180")]
pub stream_timeout_secs: NonZeroU64,

/// Path to the sled database directory for root storage.
#[arg(long, env = "SLED_DB_PATH", default_value = "./data/roots.sled")]
Expand Down
2 changes: 1 addition & 1 deletion archiver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ async fn main() -> Result<()> {
let flush_size = cfg.flush_every.get() as usize;
let mut batch_buf = Vec::with_capacity(flush_size);

let stream_timeout = Duration::from_secs(cfg.stream_timeout_secs);
let stream_timeout = Duration::from_secs(cfg.stream_timeout_secs.get());
let mut last_height: Option<u64> = None;
// Stamped in the past so the first block at the tip is flushed immediately.
let mut last_tip_flush = Instant::now() - TIP_FLUSH_INTERVAL;
Expand Down
Loading