Skip to content

feat(e2e): interactive handshake e2e#24590

Merged
nchamo merged 4 commits into
merge-train/fairies-v5from
nchamo/f-787-feate2e-interactive-handshake-end-to-end-flow-wallet-helpers
Jul 8, 2026
Merged

feat(e2e): interactive handshake e2e#24590
nchamo merged 4 commits into
merge-train/fairies-v5from
nchamo/f-787-feate2e-interactive-handshake-end-to-end-flow-wallet-helpers

Conversation

@nchamo

@nchamo nchamo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Motivation

With sender-side selection (#24522) and recipient-side registration (#24514) in place, the interactive handshake flow had no end-to-end coverage. The only producer of a valid RecipientSignature was the offline script that generated the Noir test fixture, and TXE only covers the no-resolver failure path.

The change

  • Adds interactive handshake x constrained and unconstrained cells to the delivery matrix, exercising the full round-trip across two PXEs: the sender's PXE requests the recipient's authorization through the resolveCustomRequest hook, the recipient registers the handshake on its own PXE and answers with a RecipientSignature the registry verifies in-circuit, and delivery proceeds under the resulting shared secret.
  • The test serves the signature request in-process: it parses the request, signs with the master message-signing key, and serializes the response to the exact field layout the circuit deserializes.
  • Extends the delivery harness with a customRequestResponder option and a baseline assertion that the hook fires exactly once per cell.
  • Adds INTERACTIVE_HANDSHAKE_REQUEST_KIND to @aztec/standard-contracts/handshake-registry so the contract's request kind has one TS definition.

Fixes F-787

@nchamo nchamo self-assigned this Jul 7, 2026
@nchamo nchamo added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure labels Jul 7, 2026
@nchamo nchamo changed the title feat(e2e): interactive handshake e2e with in-process responder feat(e2e): interactive handshake e2e Jul 7, 2026
@nchamo nchamo marked this pull request as ready for review July 7, 2026 20:12
@nchamo nchamo requested a review from vezenovm July 7, 2026 20:13

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

Awesome! Some small comments.

We can discuss a more public API as a follow-up. I am good with having the responder be localized to tests at this stage (better to have the e2e tests).

Comment thread yarn-project/end-to-end/src/automine/delivery/onchain_delivery_harness.ts Outdated
Comment thread yarn-project/end-to-end/src/automine/delivery/onchain_delivery_harness.ts Outdated
* Request kind under which the HandshakeRegistry asks for a recipient's interactive-handshake signature through the
* `resolveCustomRequest` hook. Mirrors `INTERACTIVE_HANDSHAKE_REQUEST_KIND` in the registry contract.
*/
export const INTERACTIVE_HANDSHAKE_REQUEST_KIND: Fr = sha256ToField([

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.

We should be able to use the #[abi] attribute in the contract on this global and then we can access the constant through the contract artifact. We then do not risk any constant drift.

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.

Claude is telling me that #[abi] only supports literal constants. So we wouldn't be able to use sha256_to_field("HANDSHAKE_REGISTRY::INTERACTIVE_HANDSHAKE_REQUEST".as_bytes())

Do you know if it's correct?

@nchamo nchamo Jul 8, 2026

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.

If Claude is correct, then I would try to keep the current version instead of using a "magic" literal value. This test would actually catch any drifts, so I think we would be safe

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.

#[abi] only supports literal constants

Claude is right and it is actually worse. Confirmed with a minimal repro against the nargo we pin (beta.22). A computed initializer like sha256_to_field(...) on an #[abi] global (even 40 + 2) crashes the compiler with an internal panic during ABI emission. noir-lang/noir#12714 fixes the panic in beta.23.

Separately, exported globals are unnamed in the artifact until beta.23 (noir-lang/noir#12620).

Let's just leave a TODO marker here that we can remove this mirrored constant at the next Noir release.

@nchamo nchamo requested a review from vezenovm July 8, 2026 13:11
* Request kind under which the HandshakeRegistry asks for a recipient's interactive-handshake signature through the
* `resolveCustomRequest` hook. Mirrors `INTERACTIVE_HANDSHAKE_REQUEST_KIND` in the registry contract.
*/
export const INTERACTIVE_HANDSHAKE_REQUEST_KIND: Fr = sha256ToField([

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.

#[abi] only supports literal constants

Claude is right and it is actually worse. Confirmed with a minimal repro against the nargo we pin (beta.22). A computed initializer like sha256_to_field(...) on an #[abi] global (even 40 + 2) crashes the compiler with an internal panic during ABI emission. noir-lang/noir#12714 fixes the panic in beta.23.

Separately, exported globals are unnamed in the artifact until beta.23 (noir-lang/noir#12620).

Let's just leave a TODO marker here that we can remove this mirrored constant at the next Noir release.

@nchamo nchamo enabled auto-merge (squash) July 8, 2026 16:46
@nchamo nchamo merged commit 23e8e1e into merge-train/fairies-v5 Jul 8, 2026
12 checks passed
@nchamo nchamo deleted the nchamo/f-787-feate2e-interactive-handshake-end-to-end-flow-wallet-helpers branch July 8, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants