Skip to content

fix(txe): align tagging strategy oracle with PXE - #24561

Merged
vezenovm merged 26 commits into
merge-train/fairies-v5from
mv/f-700-f-765-txe-unconstrained-delivery
Jul 8, 2026
Merged

fix(txe): align tagging strategy oracle with PXE#24561
vezenovm merged 26 commits into
merge-train/fairies-v5from
mv/f-700-f-765-txe-unconstrained-delivery

Conversation

@vezenovm

@vezenovm vezenovm commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes F-700
Fixes F-765

  • makes TXE tagging secret strategy resolution mode-aware, matching PXE's resolveTaggingSecretStrategy hook request
  • supports configuring unconstrained and constrained delivery strategies independently in Noir tests
  • falls back to PXE's default strategy for unset modes, while preserving the no-hook path when no strategy is configured
  • adds coverage for resolved tagging strategy serialization/deserialization and per-mode TXE defaults
  • updates execution hook docs for the new Noir test helpers

@vezenovm
vezenovm requested a review from nventuro as a code owner July 6, 2026 20:50
vezenovm added 16 commits July 6, 2026 17:15
Review cleanup for the unconstrained delivery coverage:

- TestEnvironmentOptions now exposes a keyed with_tag_secret_strategy(mode, strategy)
  setter plus with_tag_secret_strategy_all_modes; a mode left unset falls back to the
  PXE default (non-interactive handshake), matching a hook that hardcodes the default
  for modes it does not customize.
- Share DEFAULT_TAGGING_SECRET_STRATEGY between PXE and the TXE hook fallback.
- Add compute_directional_app_secret so tests derive expected secrets instead of
  inlining the poseidon2 derivation.
- Merge the per-mode next-index test wrappers into next_index_for_secret(secret, mode).
- Drop dead locals, reuse toSingle in the oracle unit test, reword the test contract
  module doc.
Replaces the per-mode aztec_txe_setTaggingSecretStrategy oracle (called
twice per TestEnvironment creation) with a single
aztec_txe_setTaggingSecretStrategies call carrying an option per
delivery mode, halving the setup round-trips every TXE test pays. Also
updates the stale execution_hooks doc example to the current
TestEnvironmentOptions API, refreshes the onchain delivery test module
header to cover the unconstrained tests, and tidies minor conventions
in the TXE tagging strategy code (JSDoc, stale comment, compound test
assertion).
@vezenovm vezenovm changed the title test(txe): cover unconstrained delivery fix(txe): align tagging strategy oracle with PXE Jul 7, 2026
@vezenovm
vezenovm requested a review from nchamo July 7, 2026 20:20

@nchamo nchamo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work!

This is much more helpful than the original oracle way I had done it. Just left a few comments/questions

Comment thread yarn-project/pxe/src/hooks/resolve_tagging_secret_strategy.ts
Comment thread noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr Outdated
/// and the recipient is folded in for direction. Mirrors `AppTaggingSecret.computeDirectional` on the PXE side; tests
/// use it to derive the secret they expect an [`arbitrary_secret`](TaggingSecretStrategy::arbitrary_secret) strategy
/// to produce.
pub fn compute_directional_app_secret(secret: EmbeddedCurvePoint, app: AztecAddress, recipient: AztecAddress) -> Field {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that we have this, but I have two questions:

  1. Should it be here? Maybe it should be next to compute_app_siloed_shared_secret?
  2. Does it need to be pub, or can it be pub(crate)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. I thought about moving it there too, but this is only used by tests so it felt better to leave in the test module.
  2. Yeah it can be pub(crate).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. Makes sense
  2. Great

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually we used this method in the new test in noir-projects/noir-contracts/contracts/test/onchain_delivery_test_contract/src/test.nr. I kept it as pub for now (I think another reason to leave it under the test module).

Comment thread noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr Outdated
}

#[test]
unconstrained fn constrained_mode_arbitrary_secret_resolves_without_rejecting() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure what we are trying to test here. I mean, I know that we don't validate it in resolve_tagging_strategy because we do that later, in constrained world. But do we need to test it? What do we win from it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just wanted something to pin the boundary. TXE resolves the strategy, while constrained delivery rejects
unsound secrets later. I could rename to something like defers_constrained_arbitrary_secret_validation_to_delivery. Or do you think it is still unnecessary?

@nchamo nchamo Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I personally think it's unnecessary. But if you want to keep it, that name helps

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I decided to merge this into app_silos_an_arbitrary_secret_point where we just test both delivery modes and I left a comment about the deferred validation. There were no other tests for the constrained * arbitrary secret combo.

@vezenovm
vezenovm requested a review from nchamo July 8, 2026 20:50

@nchamo nchamo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work!

Comment thread noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr Outdated
Comment thread docs/docs-developers/docs/resources/migration_notes.md Outdated
@vezenovm
vezenovm enabled auto-merge (squash) July 8, 2026 22:11
@vezenovm
vezenovm disabled auto-merge July 8, 2026 22:11
@vezenovm
vezenovm enabled auto-merge (squash) July 8, 2026 22:12
@vezenovm
vezenovm merged commit 6dd1271 into merge-train/fairies-v5 Jul 8, 2026
25 checks passed
@vezenovm
vezenovm deleted the mv/f-700-f-765-txe-unconstrained-delivery branch July 8, 2026 22:39
@PhilWindle PhilWindle added port-to-next Forward-port this merged PR into next and removed port-to-next Forward-port this merged PR into next labels Jul 21, 2026
nchamo pushed a commit that referenced this pull request Jul 23, 2026
Fixes F-700
Fixes F-765

- makes TXE tagging secret strategy resolution mode-aware, matching
PXE's resolveTaggingSecretStrategy hook request
- supports configuring unconstrained and constrained delivery strategies
independently in Noir tests
- falls back to PXE's default strategy for unset modes, while preserving
the no-hook path when no strategy is configured
- adds coverage for resolved tagging strategy
serialization/deserialization and per-mode TXE defaults
- updates execution hook docs for the new Noir test helpers

(cherry picked from commit 6dd1271)
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
…ecProtocol#24932)

Forward-ports the **pxe / client / txe** slice of the v5-next → next
backlog (work merged to `v5-next` after the ~2026-07-08 cut that
reshaped `next`).

## Applied (clean cherry-picks, chronological)
- fix: tweak depositToAztec gas config (AztecProtocol#24607)
- refactor: cache Aztec node reads per execution (AztecProtocol#24630)
- fix: prevent access to secrets not in scope (AztecProtocol#24616)
- docs: fee readme improvements (AztecProtocol#24666)
- fix(pxe): widen tracked sender tagging ranges with onchain discovery
evidence (AztecProtocol#24655)
- fix: tagging secrets not being scoped by sender (AztecProtocol#24772)

## Conflict resolutions (cherry-picked with `-x`, resolved against
reshaped `next`)
- fix(txe): align tagging strategy oracle with PXE (AztecProtocol#24561) — TXE oracle
version bumped to 4.0 (breaking rename `setTaggingSecretStrategy` ->
`setTaggingSecretStrategies`; `next` was at 3.0 with its own hash),
interface hash recomputed on the merged registry. Migration note
dropped: already on `next` under 5.0.0.
- feat(pxe)!: Add AppTaggingSecret kinds to keys in tagging stores
(AztecProtocol#24604) — `PXE_DATA_SCHEMA_VERSION` 12 -> 13 applies cleanly on `next`.
Migration note dropped: already on `next` under 5.0.0.
- feat: add batch is block in archive oracle (AztecProtocol#24634) — applied cleanly
on top of AztecProtocol#24561; contract oracle version 30.6 -> 30.7, v5 interface
hash matched the merged registry.
- feat: getTxEffects oracle (AztecProtocol#24636) — applied cleanly.
- ~~feat: preserve stores on schema version or rollup address change
(AztecProtocol#24631)~~ — ported separately via AztecProtocol#24947 together with the rest of the
sqlite/OPFS line
- feat(txe): add option to authorize all utility call targets (AztecProtocol#24662) —
additive on our 4.0 -> TXE oracle version 4.1 (was 3.0 -> 3.1 on v5),
hash recomputed.
- refactor(pxe): compute oracle interface hash from wire-structural
mapping labels (AztecProtocol#24752) — TXE hash recomputed under the new
wire-structural scheme; PXE hash from the pick matched.

Verified locally: full `yarn build`, `check_oracle_version` +
`check_txe_oracle_version`, TXE unit suite (21), pxe
tagging/type-mapping/utility-oracle suites, and 29 targeted aztec-nr +
onchain_delivery_test_contract TXE tests — all green.

Part of the manual v5-next → next backlog sweep.

## Added after review
- AztecProtocol#24627 fix(aztec.js): give waitForNode a bounded default timeout —
missed by the initial sweep (merge-commit wrapper + non-`(#N)` leaf);
genuinely absent from `next`.
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.

4 participants