Skip to content

feat: resolve per-extractor chain against custom chains#1122

Open
brunoguerios wants to merge 2 commits into
feat/self-hosted-firehose-profilefrom
bg/extractors-example-yaml
Open

feat: resolve per-extractor chain against custom chains#1122
brunoguerios wants to merge 2 commits into
feat/self-hosted-firehose-profilefrom
bg/extractors-example-yaml

Conversation

@brunoguerios

Copy link
Copy Markdown
Contributor

Implements items 3 & 4 of ENG-5744. Stacked on #909

The ENG-6199 registry refactor lets --chains resolve a custom chain name
against the extractors file's chains: section, but the per-extractor
chain: field was still parsed straight into Chain by serde. Since
Chain::Custom is externally tagged ({custom: name}), a bare
chain: tempo failed to parse, and the registry-aware Chain::from_str
didn't exist yet at parse time. So an operator could name a custom chain
on the command line but not on an individual extractor.

Changes

  • ExtractorConfig now reads the YAML chain: key into a plain
    chain_name: String and keeps chain: Chain as a skipped, default
    field resolved after parse. The five downstream self.config.chain
    reads and ExtractorConfig::new's signature are unchanged;
    new sets chain_name from the passed Chain's Display.
  • ExtractorConfigs::resolve_extractor_chains resolves every extractor's
    chain_name against the ChainConfigRegistry (reusing resolve_chain),
    called right after the registry is built and before the config is moved
    into task creation. An unknown name fails fast with a setup error.
  • New crates/tycho-indexer/extractors.example.yaml template documenting
    every per-extractor field plus the optional top-level chains: section,
    including a chain: tempo entry that exercises the custom-chain flow.

Production crates/tycho-indexer/extractors.yaml (mainnet-Ethereum) is
untouched. Operators point the indexer at their own extractors file
carrying the matching chains: entry.

Testing

  • New unit test resolves a config with chain: tempo and chain: ethereum
    against a registry built from the chains: section, asserting
    Chain::custom("tempo") / Chain::Ethereum, and that an unknown name
    returns ExtractionError::Setup.
  • cargo test -p tycho-indexer, clippy, and /run-ci pass.

@brunoguerios brunoguerios force-pushed the bg/extractors-example-yaml branch from 16d1aa7 to de7ea8c Compare June 25, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant