Skip to content

refactor(indexer,graphql): optimize transaction execution flow#11439

Merged
kodemartin merged 5 commits intodevelopfrom
infra/feat/optimize-transaction-execution-flow
May 7, 2026
Merged

refactor(indexer,graphql): optimize transaction execution flow#11439
kodemartin merged 5 commits intodevelopfrom
infra/feat/optimize-transaction-execution-flow

Conversation

@kodemartin
Copy link
Copy Markdown
Contributor

Description of change

This patch refactors the optimistic transaction execution flow in iota-indexer. The main motivation is to avoid the redundant database queries in the Mutation.executeTransactionBlock as identified in #8775.

The changes implemented have been dictated by the observation that GraphQL only requires the transaction ingested after execution, let it be either optimistic or checkpointed.

We therefore decouple execution and ingestion from constructing the JSON-RPC response in iota_indexer::optimistic_indexing. This leads to a series of simplifications both in iota-indexer and particularly in iota-graphql-rpc.

In summary:

  • We introduce a new IngestionPath enum that represents the dual possibility of ingestion in this context: Optimistic or Checkpoint. This is the returned by OptimisticExecutor::execute_and_index_transaction.
  • Building the JSON-RPC response is delegated directly in OptimisticWriteApi where it fits the scope more.
  • GraphQL uses IngestionPath to construct the TransactionBlockEffects required for the associated response, and the errors are generated by the available methods of the latter.

Links to any relevant issues

Fixes #8775

How the change has been tested

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • Patch-specific tests (correctness, functionality coverage)

Release Notes

  • GraphQL: Optimize Mutation.executeTransactionBlock.

@iota-ci iota-ci added infrastructure Issues related to the Infrastructure Team sc-platform Issues related to the Smart Contract Platform group. labels May 6, 2026
@kodemartin kodemartin changed the title Infra/feat/optimize transaction execution flow refactor(indexer,graphql): optimize transaction execution flow May 6, 2026
@kodemartin kodemartin force-pushed the infra/feat/optimize-transaction-execution-flow branch from 5b16c35 to e6a9625 Compare May 6, 2026 13:58
Copy link
Copy Markdown
Contributor

@sergiupopescu199 sergiupopescu199 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🎸

@kodemartin kodemartin force-pushed the infra/feat/optimize-transaction-execution-flow branch from e6a9625 to 6746ead Compare May 7, 2026 13:09
@kodemartin kodemartin marked this pull request as ready for review May 7, 2026 13:15
@kodemartin kodemartin requested a review from a team as a code owner May 7, 2026 13:15
@kodemartin kodemartin merged commit 94888f5 into develop May 7, 2026
45 of 46 checks passed
@kodemartin kodemartin deleted the infra/feat/optimize-transaction-execution-flow branch May 7, 2026 14:08
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.

refactor(graphql-rpc): Optimize transaction execution flow to avoid unnecessary fetch of optimistic tx from DB

4 participants