feat: optimize get next app tag as sender#23239
Merged
Thunkar merged 2 commits intoMay 13, 2026
Merged
Conversation
nchamo
approved these changes
May 13, 2026
Comment on lines
+390
to
+391
| expect(aztecNode.getTxReceipt).toHaveBeenCalledWith(preExistingTxHash); | ||
| expect(aztecNode.getTxReceipt).toHaveBeenCalledWith(newlyDiscoveredTxHash); |
Contributor
There was a problem hiding this comment.
Should we check it was called twice?
AztecBot
pushed a commit
that referenced
this pull request
May 13, 2026
## Summary Cuts the round-trip cost of `aztec_prv_getNextAppTagAsSender` by firing the logs query and the receipts query for already-known pending tx hashes in parallel. A second-pass receipt query still runs when the logs query surfaces previously-unseen pending tx hashes, but only for those. ## Changes - `sync_sender_tagging_indexes.ts`: pre-fetch known-pending tx hashes from the store, then `Promise.all([loadAndStoreNewTaggingIndexes, getStatusChangeOfPending(known)])`. Diff against the post-load store snapshot to find newly-discovered pending and fetch their receipts in a conditional follow-up call. - `get_status_change_of_pending.ts`: exports `StatusChange`, `EMPTY_STATUS_CHANGE`, `mergeStatusChanges` for use by the sync loop. - Tests: four new cases covering pre-existing-pending finalization, the no-pending no-logs RPC-skip path, mixed known/newly-discovered pending in one window, and idempotent rediscovery.
Collaborator
|
✅ Successfully backported to backport-to-v4-next-staging #23236. |
AztecBot
added a commit
that referenced
this pull request
May 14, 2026
BEGIN_COMMIT_OVERRIDE feat: package sqlite kv-store backend for stricter browser envs (#23089) fix(pxe): sync target contract before cross-contract utility call (#23225) fix(ci): swap slack_notify args in CLI acceptance test (#23241) feat: optimize get next app tag as sender (#23239) fix(noir): noirfmt nested_utility_contract main.nr (#23246) chore(aztec-nr): mark emit_event_in_public as #[inline_never] to shrink public dispatch (#23161) END_COMMIT_OVERRIDE
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.
Summary
Cuts the round-trip cost of
aztec_prv_getNextAppTagAsSenderby firing the logs query and the receipts query for already-known pending tx hashes in parallel.A second-pass receipt query still runs when the logs query surfaces previously-unseen pending tx hashes, but only for those.
Changes
sync_sender_tagging_indexes.ts: pre-fetch known-pending tx hashes from the store, thenPromise.all([loadAndStoreNewTaggingIndexes, getStatusChangeOfPending(known)]). Diff against the post-load store snapshot to find newly-discovered pending and fetch their receipts in a conditional follow-up call.get_status_change_of_pending.ts: exportsStatusChange,EMPTY_STATUS_CHANGE,mergeStatusChangesfor use by the sync loop.