Skip to content

feat(iota-graphql-rpc): add subscription recovery#11196

Open
sergiupopescu199 wants to merge 1 commit intofeat/update-rpc-infra-stream-recoveryfrom
sc-platform/issue-11013-graphql-subscription-recovery-feature
Open

feat(iota-graphql-rpc): add subscription recovery#11196
sergiupopescu199 wants to merge 1 commit intofeat/update-rpc-infra-stream-recoveryfrom
sc-platform/issue-11013-graphql-subscription-recovery-feature

Conversation

@sergiupopescu199
Copy link
Copy Markdown
Contributor

@sergiupopescu199 sergiupopescu199 commented Apr 9, 2026

Description of change

This PR adds subscription recovery support to iota-graphql-rpc, allowing clients to resume transaction and event subscriptions from a specific transaction digest after a disconnection.

When a startFrom digest is provided, the stream first backfills historical data from the database, then seamlessly transitions to live data from the broadcast channel. Without startFrom, behavior is unchanged.

Links to any relevant issues

fixes #11199

How the change has been tested

  • started a local network using the iota-localnet
cargo r --features indexer  -- start --force-regenesis --with-indexer --with-graphql
  • First started a grpahql subscription through the grpahiql on http://localhost:9125
subscription Transactions {
    transactions {
        __typename
        ... on TransactionBlock {
            digest,
           effects {
            checkpoint {
              sequenceNumber,
            }
          }
        }
        ... on Lagged {
            count
        }
    }
}
  • Stopped the subscription and got the latest digest it returned. Used that digest to start a new subscription.
subscription Transactions {
    transactions(startFrom: "5GJHkPzZq94pn74q5Mfd1GtZPC6TXNFN8a2sXYoEVkkd") {
        __typename
        ... on TransactionBlock {
            digest,
           effects {
            checkpoint {
              sequenceNumber,
            }
          }
        }
        ... on Lagged {
            count
        }
    }
}
  • The client received historical transactions noticeably faster than live ones. Historical data is fetched from the database in batches, limited only by query speed. Live data depends on the network's checkpoint production rate, which is inherently slower. The debug logs confirmed the transition from historical backfill to live streaming.

  • Basic tests (linting, compilation, formatting, unit/integration tests)

  • Patch-specific tests (correctness, functionality coverage)

Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure)

  • Synchronization of the indexer from genesis for a network including migration objects.
  • Restart of indexer synchronization locally without resetting the database.
  • Restart of indexer synchronization on a production-like database.
  • Deployment of services using Docker.
  • Verification of API backward compatibility.

Release Notes

  • GraphQL: Subscription queries now accept an optional startFrom transaction digest to resume receiving transactions and events from a specific point.

@sergiupopescu199 sergiupopescu199 requested a review from a team as a code owner April 9, 2026 08:38
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

6 Skipped Deployments
Project Deployment Actions Updated (UTC)
apps-backend Ignored Ignored Apr 9, 2026 8:38am
apps-ui-kit Ignored Ignored Apr 9, 2026 8:38am
iota-evm-bridge Ignored Ignored Apr 9, 2026 8:38am
iota-multisig-toolkit Ignored Ignored Apr 9, 2026 8:38am
rebased-explorer Ignored Ignored Apr 9, 2026 8:38am
wallet-dashboard Ignored Ignored Apr 9, 2026 8:38am

Request Review

@iota-ci iota-ci added infrastructure Issues related to the Infrastructure Team sc-platform Issues related to the Smart Contract Platform group. labels Apr 9, 2026
@sergiupopescu199 sergiupopescu199 changed the base branch from sc-platform/issue-11013-streaming-recovery-feature to feat/update-rpc-infra-stream-recovery April 9, 2026 09:13
@sergiupopescu199 sergiupopescu199 linked an issue Apr 9, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Issues related to the Infrastructure Team sc-platform Issues related to the Smart Contract Platform group.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iota-graphql-rpc]: Add Subscriptions recovery

2 participants