subgraph: bind DecimalFloat on Robinhood Chain - #2868
kaisbaccour wants to merge 1 commit into
Conversation
The Robinhood subgraph is not lagging, it is dead: it aborted on the first Raindex event ever emitted on 4663, a 20 USDG deposit at block 60,339,226, with "Call reverted ... in handler 'handleDeposit'". getDecimalFloatAddress picks the contract from a hardcoded switch over dataSource.network(). Robinhood matches no branch, so it falls through to FALLBACK_DECIMAL_FLOAT_ADDRESS, 0x...0001, which has no code on that chain — eth_getCode returns 0x — so every DecimalFloat call reverts and the mapping aborts. DecimalFloat is deployed there, at Base's address 0x2F665EcE3345bF09197DAd22A50dFB623BD310A7: 36,335 bytes on 4663 and 36,335 bytes on Base, and the exact call that aborted, fromFixedDecimalLossless(20000000, 6), returns 0xfffffffa...01312d00 against it. The branch keys on "robinhood", the network name the Ormi build carries. A Goldsky deployment renders the manifest as "robinhood-mainnet" and would still fall through; adding that string to this same branch is the one-word change that fixes it too, left out here deliberately. Note the shape of the failure rather than the value: an unknown network returns a dead address instead of failing the build, so the first symptom is a subgraph that indexes 790k blocks and then dies on its first event. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe DecimalFloat address resolver now maps the ChangesDecimalFloat network mapping
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This small mapping change enables Robinhood DecimalFloat calls to use the deployed contract address and is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The bug
The Robinhood subgraph deployed today is not lagging, it is dead. It aborted on the first Raindex event ever emitted on chain 4663 — a 20 USDG deposit at block 60,339,226:
getDecimalFloatAddress()insubgraph/src/float.tspicks the contract from a hardcodedif/elseoverdataSource.network(): flare, base, bsc, arbitrum-one, matic, linea, mainnet. Robinhood matches none, so it falls through toFALLBACK_DECIMAL_FLOAT_ADDRESS=0x…0001.eth_getCodefor that address on 4663 returns0x. EveryDecimalFloatcall therefore reverts, and since every numeric path goes throughgetCalculator(), the first event kills the subgraph.The fix
DecimalFloat is deployed on Robinhood Chain, at Base's address:
0x2F665EcE3345bF09197DAd22A50dFB623BD310A7on 4663And the exact call that aborted succeeds against it:
fromFixedDecimalLossless(20000000, 6)→0xfffffffa00000000000000000000000000000000000000000000000001312d00(USDG is 6 dp, the deposit was 20 USDG).Which network string
This branch keys on
robinhood, the network name an Ormi build carries. A Goldsky deployment renders the manifest asrobinhood-mainnet(thenetworks.jsonkey in #2866) and would still fall through. Adding that string to the same branch is a one-word change and fixes that deployment too — left out here deliberately.Two things for whoever redeploys
networks.json.subgraph-deployloops every key in that file, so adding one here would mint another hosted subgraph on the next dispatch.Worth noting beyond this chain
The failure shape matters more than the missing address: an unknown network returns a dead address rather than failing the build, so the first symptom is a subgraph that indexes 790k blocks and then dies on its first event. Every future chain hits the same trap. Making the fallback a compile-time or startup failure would be a small, separate change.
🤖 Generated with Claude Code
Summary by CodeRabbit