batch event inserts to avoid SQLite bind variable limit#608
Merged
urvisavla merged 4 commits intorelease/v25.0.1from Feb 20, 2026
Merged
batch event inserts to avoid SQLite bind variable limit#608urvisavla merged 4 commits intorelease/v25.0.1from
urvisavla merged 4 commits intorelease/v25.0.1from
Conversation
A single Soroban transaction emitting >3,276 events would exceed SQLite's SQLITE_MAX_VARIABLE_NUMBER limit (32,767) since each event uses 10 bind variables in the INSERT statement. This caused crashes for transactions with ~4K events. Batch insertableEvents into chunks of 1,000 per INSERT (10,000 bind variables) to stay well within the limit. All batches complete before InsertEvents returns. Add TestInsertEventsBatchingExceedsLimit to verify a single transaction with 5,000 operation events inserts successfully.
tamirms
reviewed
Feb 20, 2026
karthikiyer56
commented
Feb 20, 2026
Add TestInsertEventsBatchingExceedsLimit which creates a single transaction with 5,000 operation events (5,003 total with tx-level events), inserts, commits, reads back via GetEvents, and asserts the exact count matches. Also fix ledgerCloseMetaWithEvents helper to include a valid TransactionResult so InsertLedger serialization succeeds.
urvisavla
reviewed
Feb 20, 2026
tamirms
approved these changes
Feb 20, 2026
…ounts Cover 0, 1, 10, 1000, 3000, and 5000 op-level events to exercise zero-event no-op, single batch, and multi-batch code paths in InsertEvents. Each subtest inserts, commits, reads back via GetEvents, and asserts the exact expected count (numOpEvents + 3 tx-level events).
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.
A single Soroban transaction emitting >3,276 events would exceed SQLite's SQLITE_MAX_VARIABLE_NUMBER limit (32,767) since each event uses 10 bind variables in the INSERT statement. This caused crashes for transactions with ~4K events.
Batch insertableEvents into chunks of 1,000 per INSERT (10,000 bind variables) to stay well within the limit. All batches complete before InsertEvents returns.
Add TestInsertEventsBatchingExceedsLimit to verify a single transaction with 5,000 operation events inserts successfully.