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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ alloy = { version = "1.4", features = ["full", "rpc-types-trace"] }
indicatif = "0.18"
reqwest = { version = "0.12", features = ["json", "gzip"] }
axum = "0.8.9"
tower-http = { version = "0.6.10", features = ["fs", "cors", "trace"] }
tower-http = { version = "0.6.10", features = ["fs", "cors", "trace", "compression-gzip"] }
duckdb = { version = "1.10", features = ["bundled"] }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter", "chrono"] }
Expand Down
32 changes: 0 additions & 32 deletions src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,35 +156,3 @@ pub fn blocks_per_day(chain_id: u64, block_number: u64) -> u64 {
}
}
}

#[cfg(test)]
mod tests {
use chrono::{Datelike, TimeZone};

use super::{block_number_at_time, block_timestamp};
use crate::chains::GNOSIS_CHAIN_ID;

#[test]
fn gnosis_recent_blocks_map_to_current_calendar_dates() {
assert_eq!(
block_timestamp(GNOSIS_CHAIN_ID, 46_762_380),
chrono::Utc
.with_ymd_and_hms(2026, 6, 18, 16, 0, 38)
.unwrap()
);
}

#[test]
fn gnosis_recent_time_ranges_convert_back_to_blocks() {
let block = block_number_at_time(
GNOSIS_CHAIN_ID,
chrono::Utc.with_ymd_and_hms(2026, 6, 19, 0, 0, 0).unwrap(),
);

assert!(block > 46_762_380);
assert_eq!(
block_timestamp(GNOSIS_CHAIN_ID, block).date_naive().month(),
6
);
}
}
13 changes: 13 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ pub struct LoadArgs {
/// Rebuild existing CSV import tables or replace existing Parquet links
#[arg(long)]
pub overwrite: bool,
/// Rebuild all Verifier Alliance labels instead of importing changed VA files only
#[arg(long = "rebuild-va", alias = "rebuild")]
pub rebuild_va: bool,
/// DuckDB memory limit for CSV and verification imports
#[arg(long, default_value = "8GB")]
pub memory_limit: String,
Expand Down Expand Up @@ -190,4 +193,14 @@ pub struct ServeArgs {
/// Background extraction max concurrent HTTP requests
#[arg(long, default_value_t = 16)]
pub tail_max_concurrent_requests: usize,
/// DuckDB memory limit for the dashboard database, e.g. "2GB".
/// Recommended on small hosts; DuckDB otherwise assumes 80% of RAM.
#[arg(long, env = "BLINK_DB_MEMORY_LIMIT")]
pub db_memory_limit: Option<String>,
/// DuckDB thread count for the dashboard database
#[arg(long, env = "BLINK_DB_THREADS")]
pub db_threads: Option<u64>,
/// Read connections serving dashboard queries (0 = auto-size from cores)
#[arg(long, env = "BLINK_DB_READERS", default_value_t = 0)]
pub db_readers: usize,
}
Loading
Loading