Repository navigation
feat(indexer): add Robinhood Chain (4663) - #20
Conversation
Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
⚠️ AI Review (Claude Opus 5.5, worked 5m): config checks out on-chain; please confirm a run against Robinhood reaches and holds the tip
Finding: [QUESTION] Has the indexer been run against Robinhood up to the tip? This release can't be promoted for any chain until Robinhood is healthy
- Location:
src/chains/index.ts(ACTIVE_CHAINS = ALL_DEFINED_CHAINS),src/api/index.ts:35(/readyz),src/api/freshness.ts:10(DEFAULT_MAX_LAG_SECONDS = 300) /readyzreturns 200 only after Ponder's/readypasses, which needs historical sync done on every chain, and only while every active chain is within 300s of the tip. Robinhood is always active, so if Robinhood is slow or stuck, the v0.4.7 rollout never gets promoted. That holds back all 12 chains, not only Robinhood.- Robinhood is now the fastest chain we index: 100ms blocks, which is 2x Base and 3x Arbitrum. Prod
/statusshows Base and Arbitrum about 1s behind the tip today, so we know 3–5 blocks/s works. Nobody has watched 10 blocks/s yet. The PR's testing section only lists lint, typecheck, codegen and tests. - Backfill size: ComposableCoW starts at 94,383,853 and the head is about 117.5M, so roughly 23M blocks. With the default
ethGetLogsBlockRangeof 1000, that's about 23keth_getLogscalls per contract (ComposableCow and CoWShedFactory). - Rollout ordering: viem 2.57 adds 4663 to
viem/chains. Ponder now finds a match for this chain, so ifROBINHOOD_RPC_URLis unset it no longer fails at startup. It quietly uses viem's publicrpc.mainnet.chain.robinhood.comand only logs a warning (build/config.js,buildConfig). The infra change needs to add the RPC env var together with the image bump.
Suggested fix
- Add the actual results to the PR body from a local
pnpm devrun against a Robinhood RPC: how long the backfill took, that live lag stays under 300s, and that/readyzreturns 200. - In the infra PR, set
ROBINHOOD_RPC_URL(and preferablyROBINHOOD_WS_RPC_URL). If the provider allows it, consider raisingETH_GET_LOGS_BLOCK_RANGE_4663above 1000, since 1000 blocks is only about 100s of chain time here.
Finding: [NON-BLOCKING] Add the fixed-block-cadence note to robinhood.ts, like base.ts has
- Location:
src/chains/robinhood.ts:4-8,ponder.config.ts:148,162,176,src/constants.ts:59 - Some intervals are fixed block counts and don't scale with
blockTime. At 100ms,FlashLoanOrderEnricher,OwnerBackfillLiveandCancellationWatcherfire every 10 blocks, about once per second. TheDETERMINISTIC_CANCEL_SWEEP_INTERVALre-readssingleOrders()for each deterministic generator every 100 blocks, about every 10s. On mainnet that's every 20 min. - fix(indexer): adjust Base block time #18 wrote down exactly this trade-off in
base.ts. The Robinhood comment only covers finality, so the next person tuning RPC load won't find it.
Suggested fix
- Copy the "fixed block counts do NOT scale" paragraph from
base.tsintorobinhood.tswith Robinhood's numbers (≈1s handlers, ≈10s cancel sweep).
Review scope and related context
No human review threads yet. The only comment is the Socket bot's dependency scan, and nothing here repeats it.
Checked against PR head 8758899, no issues found:
- Addresses and start blocks. I recomputed the CREATE2 addresses from the deploy tx inputs (deployer
0x4e59…956c). ComposableCoW0xfdaF…3b74was deployed in 94,383,853 and CoWShed factory0x0a65…7213in 94,384,309, matchingstartBlock.0x5e28…and0xc94f…have no code on 4663, which matches the comment. - viem bump. Ponder looks up
finalityBlockCountand multicall3 through theviem/chainsmatch. Without the bump, 4663 would fall back to the default of 30 blocks (~3s) and the patch would never apply. viem 2.57.13 defines 4663 with multicall30xca11…ca11, and that contract has code on-chain. The lockfile resolves to a single viem (2.57.13), and the ponder patch hash is updated. - cow-sdk 9.3.3. It pulls major bumps of sub-packages (
sdk-app-data6,sdk-contracts-ts4), but this repo imports onlySupportedChainId, so no runtime code is affected. orderbookApiPath: "robinhood".api.cow.fi/robinhood/api/v1/versionresponds (v2.388.1).- Finality and wall-clock settings. Finality of 600 blocks (~60s), a 40s orderbook recheck (400 blocks), and the 1200s reorg window all match Base and Arbitrum.
- Checks.
pnpm codegen,typecheck,lintandtest(214 tests) all pass.
🤖 Prompt for AI agents
Verify these findings against current code on PR #20 (Robinhood Chain 4663). Keep changes minimal.
1. Validation / rollout (no code change expected):
- /readyz (src/api/index.ts) requires Ponder /ready plus every ACTIVE_CHAINS entry within
DEFAULT_MAX_LAG_SECONDS=300 (src/api/freshness.ts). Robinhood is always active.
- Run `pnpm dev` against a Robinhood RPC; record backfill duration from block 94383853,
live lag, and /readyz status. Add the observed results to the PR body.
- Note for the infra PR: with viem >=2.55 an unset ROBINHOOD_RPC_URL falls back to viem's public
RPC instead of failing; set ROBINHOOD_RPC_URL (and optionally ETH_GET_LOGS_BLOCK_RANGE_4663).
2. Docs-only change in src/chains/robinhood.ts:
- Mirror the base.ts comment about fixed block counts not scaling with blockTime:
FlashLoanOrderEnricher / OwnerBackfillLive / CancellationWatcher every 10 blocks (~1s at 0.1s),
DETERMINISTIC_CANCEL_SWEEP_INTERVAL 100 blocks (~10s), TRY_NEXT_BLOCK backoff <= 50 blocks (~5s).
- Run pnpm lint and pnpm typecheck.
Generated using the pr-review skill from the CoW Protocol skills repo.
There was a problem hiding this comment.
Ran it against RH. The backfill from 94,383,853 took 38 min with no RPC errors, then 10 min live at <= 1s lag with /readyz 200 throughout.
I've added the results to the description.
And ROBINHOOD_RPC_URL is in 1pw, the infra PR will it alongwith the image bump.
smol correction: prod probes /health, not /readyz, so a slow Robinhood wouldn't hold back the other chains.
Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
Description
Adds Robinhood to the indexer, so CoW Swap can show EOA TWAPs on Robinhood: their parts, the live part for cancelling, and the user's CoW Shed.
Changes
src/chains/robinhood.ts, registered inCHAIN_CONFIGS:0x221c…and0x0a65…. legacy is left out, same as ink.blockTime0.1s. Orderbook poll and reorg window as on Base.@cowprotocol/cow-sdk^9.2.6 -> ^9.3.3 forSupportedChainId.ROBINHOOD.viem→ ^2.57.13. Ponder takes each chain's finality depth and multicall3 address fromviem/chains, which has Robinhood only since 2.55.0. On the old version,context.client.multicallthrows on 4663.ROBINHOOD_RPC_URLadded to.env.exampleanddocs/deployment.md.How to test
ponder start+ Postgres, defaultethGetLogsBlockRange). The backfill from 94,383,853 to the tip (24.7M blocks) took 38 min with no RPC errors. It then ran live for 10 min at ≤ 1s lag (~10 blocks/s), with/readyzreturning 200 throughout.After merge, this needs a release (v0.4.7) so I can bump the image in the infra repo for the Robinhood launch.