indexer: bump tx-indexer commit timeouts from 30s to 45s#679
Merged
barnabasbusa merged 2 commits intoMay 6, 2026
Merged
Conversation
Per-block tx-indexer commits include up to 8192 event-log inserts and up to ~70K internal-call inserts on high-deposit-density blocks (e.g. EIP-8254-style stress at 200M gas). Even with WAL+NORMAL pragmas and the mattn/go-sqlite3 driver, these blocks regularly land in the 30-35 second range under SQLite, which causes the existing 30s context deadline to fire and rolls the transaction back, putting the indexer into a retry loop instead of making forward progress. Bumping the three tx-indexer-side timeouts (main commit, balance lookup, balance-commit-on-error) to 45s lets these large blocks finish under the deadline. The change is conservative: 45s is well below the 12s slot rate that an indexer falling behind on every block would imply, and Postgres-backed deployments aren't affected since their commit phase is sub-second on the same workload. This is a band-aid for the underlying volume issue (a deeper fix would restructure per-block inserts into one chunked INSERT per table), but it stops the rollback-and-retry storm in the meantime.
pk910
approved these changes
May 6, 2026
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.
Bumps the three tx-indexer-side context timeouts in
indexer/execution/txindexer/process_blocks.gofrom 30s to 45s:Why
Per-block tx-indexer commits can contain up to 8192 event-log inserts and ~70K internal-call inserts on high-deposit-density blocks (e.g. EIP-8254-style stress at 200M gas). On SQLite, even after the recent pragma tuning + chunking + driver-swap improvements (#677, #678), these blocks land in the 30-35s range — right at the existing 30s deadline. The deadline fires, the transaction is rolled back, and the indexer enters a rollback-and-retry loop instead of making forward progress.
Measured timings on a 200M-gas devnet running the spamoor
geastx16×512-deposit scenario (8192 logs/block):glebarez+ default pragmasglebarez+ tuned pragmasmattn/go-sqlite3+ tuned pragmas + chunking (#677 + #678)Bumping to 45s gives enough headroom for the 8192-log case to finish under the deadline once #678 lands.
What this isn't
A real fix for the underlying per-block insert volume — the deeper change would restructure the per-tx callbacks in
processElBlockto collect rows and do one chunkedINSERTper table per block (acknowledging the address-id-resolution dependency tangle pk910 already flagged). That's a much bigger refactor.This is a band-aid: it stops the rollback-and-retry storm at high-deposit density, while leaving the structural work for a follow-up. Postgres-backed deployments are unaffected — their commit time on the same workload is sub-second.
Test plan
go build ./...cleancontext deadline exceededand stays caught up