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
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.

3 participants