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
1 change: 1 addition & 0 deletions tools/hindsight/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Three subcommands via `cargo run -p hindsight --release --`:
| `ALLIUM_API_KEY` | Allium API key (`verify` only) |
| `ALLIUM_QUERY_ID` | Saved Allium query ID (`verify` only) |
| `HINDSIGHT_REGISTRY` | Override path for the decoder address-book TOML |
| `BLOCKLIST_CONFIG` | Blocklist TOML of component IDs excluded from the Tycho stream (`monitor` only; falls back to tycho-simulation's default blocklist) |

## Architecture

Expand Down
14 changes: 14 additions & 0 deletions tools/hindsight/src/resolve/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ pub(crate) struct MonitorArgs {
#[arg(long, env = "WORKER_POOLS_CONFIG", default_value = "worker_pools.toml")]
pub worker_pools_config: std::path::PathBuf,

/// Blocklist TOML of component IDs to exclude from the Tycho stream, same semantics as
/// `fynd serve --blocklist-config`. Falls back to tycho-simulation's embedded default
/// blocklist when unset
#[arg(long, env = "BLOCKLIST_CONFIG")]
pub blocklist_config: Option<std::path::PathBuf>,

/// Per-quote timeout in milliseconds
#[arg(long, default_value_t = 10_000)]
pub timeout_ms: u64,
Expand Down Expand Up @@ -301,6 +307,13 @@ async fn build_solver(
if let Some(key) = cfg.tycho_api_key.as_deref() {
builder = builder.tycho_api_key(key);
}
let blocklist = match &cfg.blocklist_config {
Some(path) => fynd_rpc::config::BlocklistConfig::load_from_file(path)
.map_err(|e| anyhow::anyhow!("failed to load blocklist config: {e}"))?
.into_components(),
None => tycho_simulation::utils::default_blocklist(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tycho-simulation already auto-applies the default blocklist so you do not need to explicitly do it here.

};
builder = builder.blocklisted_components(blocklist);
for (name, pool) in pools_config.pools() {
builder = builder
.add_pool(name, pool)
Expand Down Expand Up @@ -573,6 +586,7 @@ mod tests {
min_tvl: 10_000.0,
tycho_api_key: api_key,
worker_pools_config: std::path::PathBuf::from("worker_pools.toml"),
blocklist_config: None,
timeout_ms: 10_000,
metrics_port: None,
max_blocks: Some(1),
Expand Down
Loading