Skip to content

chore: Accumulated backports to v4-next#23236

Merged
AztecBot merged 8 commits into
v4-nextfrom
backport-to-v4-next-staging
May 14, 2026
Merged

chore: Accumulated backports to v4-next#23236
AztecBot merged 8 commits into
v4-nextfrom
backport-to-v4-next-staging

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented May 13, 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

While the current sqlite backend for kv-store works fine in vanilla
browser environments, browser policies can be stricter for extensions.
For example, Chromium's MV3 doesn't accept extensions using `eval` or
freely instantiating `Function`'s. This PR deals with said issues so
that eventual wallet implementers don't have to.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## 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.
AztecBot and others added 3 commits May 13, 2026 13:44
…nk public dispatch (#23161)

## Summary

Work towards resolving
AztecProtocol/aztec-nr#35

- Mark `emit_event_in_public` `#[inline_never]` (and `unconstrained`,
required by the attribute) so it stops being copied into every public
call site.
- Propagate `unconstrained` to `ContractSelfPublic::emit` so it can
still call the helper.
- Mirrors the existing precedent on `assert_is_initialized_public`
(`aztec-nr/aztec/src/macros/functions/initialization_utils.nr:100`) from
#22869

## Bytecode impact
Measured via `nargo compile --inliner-aggressiveness 0` + `bb
aztec_process`, reading `public_dispatch` packed bytecode size on
`public_fns_with_emit_repro_contract`:

| State             | AVM bytes | Δ              |
|-------------------|-----------|----------------|
| Baseline          | 5,576     | —              |
| `#[inline_never]` | 4,601     | -975 (-17.5%)  |

Roughly 65 bytes saved per emit call site across the 15 functions. Real
contracts with many public functions emitting the same event shape
should see the same per-site savings.

## Additional Context
- `--inliner-aggressiveness` cannot achieve this on its own: for
`public_dispatch` the noirc driver pins aggressiveness to 0
(`noir/noir-repo/compiler/noirc_driver/src/lib.rs:743-744`)
- `ContractSelfPublic::emit` becoming `unconstrained` is a small surface
change. All `#[external(\"public\")]` bodies are already unconstrained,
so contract code calling `self.emit(...)` directly is unaffected
Adds some structure to typical decryption errors, and a couple of
convenience helpers for orchestrating encrypted store management from
embedded wallet, so that the most basic usage is straightforward and
downstream projects don't need to rewrite the same lines over and over.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot AztecBot merged commit 8c30060 into v4-next May 14, 2026
13 checks passed
@AztecBot
Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 8 hours of inactivity. This PR will be merged automatically once all checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants