feat: resolve per-extractor chain against custom chains#1122
Open
brunoguerios wants to merge 2 commits into
Open
feat: resolve per-extractor chain against custom chains#1122brunoguerios wants to merge 2 commits into
brunoguerios wants to merge 2 commits into
Conversation
16d1aa7 to
de7ea8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements items 3 & 4 of ENG-5744. Stacked on #909
The ENG-6199 registry refactor lets
--chainsresolve a custom chain nameagainst the extractors file's
chains:section, but the per-extractorchain:field was still parsed straight intoChainby serde. SinceChain::Customis externally tagged ({custom: name}), a barechain: tempofailed to parse, and the registry-awareChain::from_strdidn'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
ExtractorConfignow reads the YAMLchain:key into a plainchain_name: Stringand keepschain: Chainas a skipped, defaultfield resolved after parse. The five downstream
self.config.chainreads and
ExtractorConfig::new's signature are unchanged;newsetschain_namefrom the passedChain'sDisplay.ExtractorConfigs::resolve_extractor_chainsresolves every extractor'schain_nameagainst theChainConfigRegistry(reusingresolve_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.
crates/tycho-indexer/extractors.example.yamltemplate documentingevery per-extractor field plus the optional top-level
chains:section,including a
chain: tempoentry that exercises the custom-chain flow.Production
crates/tycho-indexer/extractors.yaml(mainnet-Ethereum) isuntouched. Operators point the indexer at their own extractors file
carrying the matching
chains:entry.Testing
chain: tempoandchain: ethereumagainst a registry built from the
chains:section, assertingChain::custom("tempo")/Chain::Ethereum, and that an unknown namereturns
ExtractionError::Setup.cargo test -p tycho-indexer, clippy, and/run-cipass.