Skip to content

feat!: Expose offchain effects when simulating/sending txs#20563

Merged
mverzilli merged 32 commits intomerge-train/fairiesfrom
mv/expose-offchain-messages
Mar 4, 2026
Merged

feat!: Expose offchain effects when simulating/sending txs#20563
mverzilli merged 32 commits intomerge-train/fairiesfrom
mv/expose-offchain-messages

Conversation

@mverzilli
Copy link
Contributor

@mverzilli mverzilli commented Feb 16, 2026

Up for debate: is there any point in exposing that for deploy calls? Main reasons why I chose to leave it in:

  • Less slight variations of the same type
  • Even if we don't expose it, we might want to consider wrapping {} the return type so we make it possible to extend without breaking backwards compatibility in the future

Closes F-322

@mverzilli mverzilli requested a review from Thunkar February 16, 2026 18:52
public async simulate<T extends SimulateInteractionOptions>(
options: T,
): Promise<SimulationReturn<T['includeMetadata']>>;
public async simulate(options: SimulateWithGasEstimationOptions): Promise<SimulationReturn<true>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to have a dual return type for simulation if it's always an object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could unify everything under a single SimulationReturn type with result and offchainEffects, and make stats and estimatedGas optional

@critesjosh
Copy link
Contributor

it looks like this includes authwit type changes. can you also updated https://github.com/AztecProtocol/aztec-packages/blob/mv/expose-offchain-messages/docs/examples/ts/aztecjs_authwit/index.ts?

@mverzilli mverzilli requested a review from a team as a code owner February 17, 2026 14:53
@mverzilli mverzilli force-pushed the mv/expose-offchain-messages branch from 0facefd to 6b58772 Compare February 18, 2026 11:25
@mverzilli mverzilli changed the base branch from next to merge-train/fairies February 18, 2026 11:25
Copy link
Contributor

@Thunkar Thunkar left a comment

Choose a reason for hiding this comment

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

Ty so much for this! I'd ping @nventuro for the "big picture" review since he's back, but LGTM

@mverzilli mverzilli force-pushed the mv/expose-offchain-messages branch from 3b7b4f5 to fe599bc Compare February 24, 2026 10:31
@mverzilli mverzilli requested review from nventuro and removed request for charlielye February 24, 2026 10:31
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

Lovely!

Are we returning the authwit effects too? We were not exposing them before, and I don't think we should either now, but I don't know the js code well enough to know where to search.

re. the offchain effect refactor (effect types etc) would we do that later?

@mverzilli
Copy link
Contributor Author

mverzilli commented Mar 4, 2026

Are we returning the authwit effects too? We were not exposing them before, and I don't think we should either now, but I don't know the js code well enough to know where to search.
re. the offchain effect refactor (effect types etc) would we do that later?

It looks like we were exposing them before, and they're even used in an e2e test: https://github.com/AztecProtocol/aztec-packages/blob/next/yarn-project/end-to-end/src/e2e_kernelless_simulation.test.ts#L113

So now we need to decide if we live with that, or we subtly break backwards compatibility by having the wallet strip offchainEffects before it returns them to the app (waiting on Grego to share some context on this).

IF we decide to strip them

Unfortunately selectively filtering them out (properly) implies changing how we emit them (eg: tagging them with proper union id, as we have for offchain messages), and I would rather not make this PR more complicated by tackling that now, so I'd propose:

  • We always return offchainEffects empty (we just include offchainMessages, which we can properly identify)
  • We start passing offchain effects through when we can properly tackle that refactor

I think it's fine to do so since this refactor makes extending return types with new stuff backwards compatible.

Proposed follow up is tracked at: https://linear.app/aztec-labs/issue/F-394/support-extensible-offchain-effects

EDIT 2026-03-04 11:38 GMT: I think the e2e tests that rely on it are testing wallet functionality so they shouldn't be relying on that anyway working on a PR dangling from this to remove offchainEffects from app facing APIs

EDIT 2026-03-04 12:05 GMT: Grego's perspective is that we shouldn't filter out authwit call data, if we agree on that this PR is good to merge as is.

@mverzilli mverzilli added ci-full Run all master checks. backport-to-v4 labels Mar 4, 2026
@mverzilli mverzilli enabled auto-merge (squash) March 4, 2026 14:21
@mverzilli mverzilli merged commit 3ab7b10 into merge-train/fairies Mar 4, 2026
10 checks passed
@mverzilli mverzilli deleted the mv/expose-offchain-messages branch March 4, 2026 14:29
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 4, 2026

❌ Failed to cherry-pick to v4 due to conflicts. Dispatching ClaudeBox to resolve. View backport run.

AztecBot pushed a commit that referenced this pull request Mar 4, 2026
AztecBot added a commit that referenced this pull request Mar 4, 2026
Adapt cherry-pick of #20563 for v4:
- Resolve return type destructuring for send() calls
- Wire additionalScopes in base_wallet and interaction_options
- Handle modify/delete for files not on v4 (e2e_custom_message, e2e_pxe)
- Keep v4 contract names (AvmGadgetsTestContract)
- Add GasFees import for priority fee logic
- Update bot factory for v4 PrivateToken deploy pattern
AztecBot pushed a commit that referenced this pull request Mar 5, 2026
AztecBot added a commit that referenced this pull request Mar 5, 2026
Adapt cherry-pick of #20563 for v4:
- Resolve return type destructuring for send() calls
- Wire additionalScopes in base_wallet and interaction_options
- Handle modify/delete for files not on v4 (e2e_custom_message, e2e_pxe)
- Keep v4 contract names (AvmGadgetsTestContract)
- Add GasFees import for priority fee logic
- Update bot factory for v4 PrivateToken deploy pattern
mverzilli added a commit that referenced this pull request Mar 5, 2026
…20563) (#21110)

## Summary

Backport of #20563
to v4.

**Commit 1** — Cherry-pick of the original squash merge (authored by
@mverzilli), conflicts resolved by accepting the incoming version.

**Commit 2** — Fix commit adapting the cherry-pick for v4:
- Resolved `send()` return type destructuring in 11 files
- Wired `additionalScopes` in `base_wallet`, `interaction_options`, and
`wallet.ts` schemas
- Deleted modify/delete conflict files (`e2e_custom_message.test.ts`,
`e2e_pxe.test.ts`) not present on v4
- Kept v4's `AvmGadgetsTestContract` name in `n_tps_prove.test.ts`
- Added `GasFees` import for priority fee logic in
`e2e_block_building.test.ts`
- Updated bot factory for v4 PrivateToken deploy pattern

Closes F-322.

---------

Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 5, 2026
BEGIN_COMMIT_OVERRIDE
chore: remove prefund env var in non local networks (#21095)
feat: aztec new supporting multiple contract crates (#21007)
feat!: Expose offchain effects when simulating/sending txs (#20563)
chore: exclude auto-generated dirs from VS Code search (#20881)
feat: improve oracle name prefixes (#21101)
fix(pxe): correct contract class log DA gas metering from +2 to +1
(#21102)
chore: remove stale aes comments (#21133)
chore: add warning on invalid recipients (#21134)
feat: mask ciphertext fields with Poseidon2-derived values (#21009)
END_COMMIT_OVERRIDE
mverzilli added a commit that referenced this pull request Mar 5, 2026
ludamad added a commit that referenced this pull request Mar 10, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ledwards2225 <ledwards2225@users.noreply.github.com>
Co-authored-by: PhilWindle <PhilWindle@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: mrzeszutko <mrzeszutko@users.noreply.github.com>
Co-authored-by: spalladino <spalladino@users.noreply.github.com>
Co-authored-by: johnathan79717 <johnathan79717@users.noreply.github.com>
Co-authored-by: nventuro <nventuro@users.noreply.github.com>
Co-authored-by: alexghr <alexghr@users.noreply.github.com>
Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: mverzilli <mverzilli@users.noreply.github.com>
Co-authored-by: benesjan <benesjan@users.noreply.github.com>
Co-authored-by: danielntmd <danielntmd@users.noreply.github.com>
Co-authored-by: deffrian <deffrian@users.noreply.github.com>
Co-authored-by: benesjan <janbenes1234@gmail.com>
ludamad added a commit that referenced this pull request Mar 11, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
fix: Simulate gas in n tps test. Set min txs per block to 1 (backport
#21312) (#21329)
fix(log): do not log validation error if unregistered handler (#21111)
fix(node): fix index misalignment in findLeavesIndexes (#21327)
fix: limit parallel blocks in prover to max AVM parallel simulations
(#21320)
fix: use native sha256 to speed up proving job id generation (#21292)
fix(validator): wait for l1 sync before processing block proposals
(#21336)
fix(txpool): cap priority fee with max fees when computing priority
(#21279)
chore: reduce severity of errors due to HA node not acquiring signature
(#21311)
fix: (A-643) add buffer to maxFeePerBlobGas for gas estimation and fix
bump loop truncation (#21323)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v4 ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants