Skip to content

fix(noir-contracts): deliver notes via onchain_unconstrained in app/deployment contracts#24333

Closed
AztecBot wants to merge 2 commits into
merge-train/fairies-v5from
cb/fix-fairies-v5-client-flow-bench-steps
Closed

fix(noir-contracts): deliver notes via onchain_unconstrained in app/deployment contracts#24333
AztecBot wants to merge 2 commits into
merge-train/fairies-v5from
cb/fix-fairies-v5-client-flow-bench-steps

Conversation

@AztecBot

@AztecBot AztecBot commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

Switch the note delivery in the account (ecdsa_r/ecdsa_k/schnorr), token and benchmarking contracts from MessageDelivery::onchain_constrained() to MessageDelivery::onchain_unconstrained(). No benchmark expectations are changed.

(Supersedes this PR's earlier approach of bumping the expectedExecutionSteps(...) inputs — per the fairies team the extra step isn't wanted here.)

Why

#24223 (merge-train/fairies-v5v5-next) kept getting dequeued. After the compile fix (#24323), the full merge-queue lane failed on three benches, all traced to one cause:

  • client_flows/account_deploymentsExpected 10 execution steps, got 11
  • client_flows/amm (add_liquidity) — Expected 14 execution steps, got 17
  • bench_build_block — repeated Failed to commit transaction: … Tagging window length 20 is configured too low → 600s timeout

These contracts delivered notes with onchain_constrained(), which was effectively a no-op on v5-next. #23866 — wire constrained message delivery (on the train) made that mode issue a real validate_handshake private call on the first send (index 0) of each (sender, recipient, secret) sequence. Once v5-next merged into the train:

  • every cold constrained send gained one extra app circuit (the handshake bootstrap) → the step-count benches above; and
  • the per-secret tagging index advanced on each send, so bench_build_block (which emits many notes to one recipient before finalization) blew past UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20 (yarn-project/pxe/src/tagging/constants.ts:10), failing every tx commit until timeout.

These flows test app/deployment logic and don't need constrained delivery — that has dedicated coverage in constrained_delivery_test_contract. So deliver via onchain_unconstrained(), the behavior these benches were written against.

Why no benchmark-expectation changes

The onchain_constrained() usage and the bench expectations both came from v5-next, where the mode was a no-op — so the existing expectedExecutionSteps(...) inputs already encode the unconstrained (no-bootstrap) counts. Reverting the contracts to unconstrained makes the actual counts match them again (account_deployments → 10, amm → 14). The warm-send benches (transfers, bridging) never hit a cold bootstrap, so they're unaffected either way.

Scope / verification

  • Touches only the account / token / benchmarking contracts the failing benches exercise (plus ecdsa_k for account-contract consistency). The dedicated constrained_delivery_test_contract is intentionally left untouched.
  • These client_flows benches run only in the full/merge-queue lane, not in this PR's fast CI, so the authoritative check is re-queuing feat: merge-train/fairies-v5 #24223 (or a CI_FULL run). A local build/run wasn't possible in this container (no docker/cache; needs the noir submodule).
  • Other app/test contracts (nft, escrow, counter, simple_token, …) still use onchain_constrained(). If you want the full "unconstrained everywhere" sweep (which also touches e2e discovery tests), say the word and I'll extend it — kept scoped here to what unblocks feat: merge-train/fairies-v5 #24223.

cc @vezenovm @nicolas-venturo — this implements the onchain_unconstrained switch you described.

@AztecBot AztecBot 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 ci-no-squash claudebox Owned by claudebox. it can push to this PR. labels Jun 26, 2026
@mverzilli mverzilli requested review from nchamo and vezenovm June 26, 2026 14:10
@mverzilli mverzilli added the ci-full Run all master checks. label Jun 26, 2026
@mverzilli mverzilli marked this pull request as ready for review June 26, 2026 14:11
…eployment contracts

These account, token and benchmarking contracts delivered their notes with
MessageDelivery::onchain_constrained(). That mode was effectively a no-op on
v5-next, but #23866 (wire constrained message delivery) made it issue a real
validate_handshake private call on the first send (index 0) of each
(sender, recipient, secret) sequence. That extra app circuit broke the full
(merge-queue-only) client_flows step-count benches once v5-next merged into
merge-train/fairies-v5, dequeuing #24223:
  - account_deployments: 10 -> 11 execution steps
  - amm add_liquidity:   14 -> 17 execution steps
and it advanced the per-secret tagging index until bench_build_block exceeded
UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN (20), failing every tx commit until the
600s timeout.

These flows test app/deployment logic and don't need constrained delivery
(constrained delivery has dedicated coverage in constrained_delivery_test_contract),
so deliver via onchain_unconstrained instead -- the behavior these benches were
written against. No benchmark expectations change: they already encode the
unconstrained (no-bootstrap) step counts.

The warm-send benches (transfers, bridging) were unaffected either way, and the
dedicated constrained_delivery_test_contract is intentionally left as-is.
@AztecBot AztecBot changed the title test(bench): account for constrained-delivery handshake bootstrap in client_flows step counts fix(noir-contracts): deliver notes via onchain_unconstrained in app/deployment contracts Jun 26, 2026
@AztecBot AztecBot force-pushed the cb/fix-fairies-v5-client-flow-bench-steps branch from ba4c36f to 78d11d1 Compare June 26, 2026 14:55
Reflects the onchain_constrained -> onchain_unconstrained delivery change in
token_contract. Only token_contract is in EXPAND_CASES among the changed
contracts; the call text is verbatim in nargo expand output, so the snapshot
diff is exactly the six delivery-mode lines.
@vezenovm

Copy link
Copy Markdown
Contributor

Superceded by #24336, will do a test token contract split separately

@vezenovm vezenovm closed this Jun 26, 2026
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-full Run all master checks. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-no-squash claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants