fix(tycho-indexer): support non-ethereum chains in rpc subcommand - #1237
Open
die-herdplatte wants to merge 1 commit into
Open
fix(tycho-indexer): support non-ethereum chains in rpc subcommand#1237die-herdplatte wants to merge 1 commit into
die-herdplatte wants to merge 1 commit into
Conversation
The rpc subcommand hardcoded Chain::Ethereum when building the storage gateway. Since the single-chain DB guard (0c1249f), this made `tycho-indexer rpc` fail on any non-ethereum database with "Chain table already contains '<chain>' but attempting to initialize with 'ethereum'", which broke the protocol-testing range harness for every non-ethereum protocol at the post-indexing validation step. - add --chain (default: ethereum) and --chain-config to the rpc subcommand, mirroring the run subcommand, and use them in run_rpc - pass --chain from the testing harness's start_rpc_server Validated end-to-end: arbitrum-ramses-v3 range test now passes 1/1 (component state, on-chain balances, 6 simulations, 6 executions). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
tycho-indexer rpchardcodes the storage gateway chain:Since the single-chain DB guard landed (0c1249f), starting the standalone
RPC server against any non-ethereum database fails with:
This breaks the
protocol-testingrange harness for every non-ethereumprotocol: after indexing succeeds, the harness spawns
tycho-indexer rpcfor the validation step, which then tries to initialize the freshly synced
DB as ethereum and dies.
Fix
--chain(default:ethereum, so existing invocations are unaffected)and
--chain-configto therpcsubcommand, mirroring therunsubcommand— including
init_chainsso custom chains resolve.run_rpcinstead of the hardcodedChain::Ethereum,resolving the TODO.
--chainfrom the testing harness'sstart_rpc_server.The harness is the only invocation of
tycho-indexer rpcin this repo (theother subcommands —
index,run,analyze-tokens— were alreadychain-aware), so no other call sites needed updating. The dockerized testing
harness builds the binary from the same source tree and picks the fix up
automatically.
Testing
(
range --package arbitrum-ramses-v3 --chain arbitrum, from feat: add Ramses V3 Arbitrum support #1235):indexing, component state validation, on-chain balance checks, 6 simulations
and 6 executions all pass (1/1). Previously this failed at the RPC-server
step with the error above.
rpcwithout--chainkeeps the previous behavior (ethereum default).Note for infra
If any out-of-repo deployment manifests run
tycho-indexer rpcas standaloneRPC replicas against a non-ethereum database, they have been failing on
startup with this same guard error since 0c1249f — after this fix they need
--chain <chain>added, since the default remainsethereum.🤖 Generated with Claude Code