refactor(indexer,graphql): optimize transaction execution flow#11439
Merged
kodemartin merged 5 commits intodevelopfrom May 7, 2026
Merged
refactor(indexer,graphql): optimize transaction execution flow#11439kodemartin merged 5 commits intodevelopfrom
kodemartin merged 5 commits intodevelopfrom
Conversation
tomxey
approved these changes
May 6, 2026
5b16c35 to
e6a9625
Compare
e6a9625 to
6746ead
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theMutation.executeTransactionBlockas 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 iniota-indexerand particularly iniota-graphql-rpc.In summary:
IngestionPathenum that represents the dual possibility of ingestion in this context:OptimisticorCheckpoint. This is the returned byOptimisticExecutor::execute_and_index_transaction.OptimisticWriteApiwhere it fits the scope more.IngestionPathto construct theTransactionBlockEffectsrequired 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
Release Notes
Mutation.executeTransactionBlock.