Skip to content

fix: make Transaction.to nullable for contract-creation txs#245

Merged
rickstaa merged 1 commit into
mainfrom
fix/transaction-to-nullable
Jul 21, 2026
Merged

fix: make Transaction.to nullable for contract-creation txs#245
rickstaa merged 1 commit into
mainfrom
fix/transaction-to-nullable

Conversation

@rickstaa

@rickstaa rickstaa commented Jul 20, 2026

Copy link
Copy Markdown
Member

Problem

Contract-creation transactions (e.g. a Tenderize unlock deployed via its constructor) have no recipient, so event.transaction.to is null. Transaction.to was String!, so createOrLoadTransactionFromEvent left it unset and graph-node aborted with missing value for non-nullable field 'to' — deterministically halting the subgraph. First hit 2026-07-18 at block 485100965. See #243.

Fix

Make Transaction.to nullable: String!String. A creation tx genuinely has no recipient, so null is 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 leaves to null for creation txs. Only Transaction.to changes; MintEvent.to stays non-null (it's an event parameter, always present).

Alternative: default to the zero address (#244)

You can instead default to to 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 to 0x0. null states what is true.

Testing

yarn codegen and yarn build pass. The Livepeer Explorer does not read Transaction.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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rickstaa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: baa5d501-c941-4787-9dcf-3e38af36b093

📥 Commits

Reviewing files that changed from the base of the PR and between 4ddaf42 and a9f84af.

📒 Files selected for processing (1)
  • schema.graphql
📝 Walkthrough

Walkthrough

The GraphQL Transaction.to field changes from non-nullable String! to nullable String, allowing transactions without recipient addresses to be represented as null.

Changes

Transaction recipient nullability

Layer / File(s) Summary
Relax Transaction.to nullability
schema.graphql
Changes Transaction.to from String! to String while retaining its documentation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • livepeer/subgraph#244: Updates transaction creation logic to use EMPTY_ADDRESS when the event recipient is null.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses #243 by preventing contract-creation tx saves from failing on a missing to value, which restores indexing.
Out of Scope Changes check ✅ Passed The changes are limited to the Transaction.to schema nullability needed for the reported indexing failure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main change: making Transaction.to nullable for contract-creation transactions.
Description check ✅ Passed The description covers the problem, fix, issue reference, testing, and deployment context, and is mostly complete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/transaction-to-nullable

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

🚀 Subgraph Studio preview deployed

Item Details
Version label pr-245-7d36a8d-29782918708
Query endpoint https://api.studio.thegraph.com/query/31909/livepeer-ci/pr-245-7d36a8d-29782918708
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

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.
@rickstaa
rickstaa force-pushed the fix/transaction-to-nullable branch from 3c21f2b to a9f84af Compare July 20, 2026 22:09
@rickstaa
rickstaa merged commit 6d24f4e into main Jul 21, 2026
2 of 3 checks passed
@rickstaa
rickstaa deleted the fix/transaction-to-nullable branch July 21, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indexing halts on contract-creation transactions that emit protocol events

1 participant