fix: make Transaction.to nullable for contract-creation txs#245
Conversation
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe GraphQL ChangesTransaction recipient nullability
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
🚀 Subgraph Studio preview deployed
curl -H 'Content-Type: application/json' \
-d '{"query":"{ protocol(id: \"0\") { inflation } }"}' \
https://api.studio.thegraph.com/query/31909/livepeer-ci/pr-245-7d36a8d-29782918708 |
4657158 to
3c21f2b
Compare
Contract-creation txs have no recipient, so `event.transaction.to` is null and graph-node aborted on the non-nullable `Transaction.to`. `null` is the correct value (matches graph-ts `Address | null`); no mapping change needed.
3c21f2b to
a9f84af
Compare
Problem
Contract-creation transactions (e.g. a Tenderize unlock deployed via its constructor) have no recipient, so
event.transaction.toisnull.Transaction.towasString!, socreateOrLoadTransactionFromEventleft it unset and graph-node aborted withmissing value for non-nullable field 'to'— deterministically halting the subgraph. First hit 2026-07-18 at block485100965. See #243.Fix
Make
Transaction.tonullable:String!→String. A creation tx genuinely has no recipient, sonullis the correct value — it matches Ethereum/JSON-RPC and graph-ts itself (to: Address | null). No mapping change is needed: the existing conditional assignment already leavestonull for creation txs. OnlyTransaction.tochanges;MintEvent.tostays non-null (it's an event parameter, always present).Alternative: default to the zero address (#244)
You can instead default
toto the zero address (EMPTY_ADDRESS), which avoids the schema change. We prefer nullable because the zero address is less accurate: it reuses a real, valid address (0x0, the burn address) as a stand-in for "no recipient," so a consumer can't distinguish a contract-creation tx from an actual transfer to0x0.nullstates what is true.Testing
yarn codegenandyarn buildpass. The Livepeer Explorer does not readTransaction.to, so the nullable change is safe for it.Deployment
Redeploys with a full resync (grafting is disabled). Republish so subgraph
FE63…points at the fixed deployment.Fixes #243