Skip to content

chore: backport DeployMethod refactor (#22985) to v4-next#23029

Draft
AztecBot wants to merge 5 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-22985-v4-next
Draft

chore: backport DeployMethod refactor (#22985) to v4-next#23029
AztecBot wants to merge 5 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-22985-v4-next

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented May 7, 2026

Summary

Backport of #22985 (fix: better DeployMethod) to backport-to-v4-next-staging.

The original PR refactors DeployMethod so that all address-affecting parameters (salt, deployer, universalDeploy, publicKeys) are locked in at construction time via a new DeployInstantiationOptions argument, and removes the silent salt-cache poisoning bug where the address could change between calls. See the migration notes added under ## TBD for the full API change.

Commits

This backport preserves the standard 3-commit history so reviewers can see exactly what conflicted and how it was resolved:

  1. chore: cherry-pick #22985 ... with conflicts — raw git cherry-pick result with conflict markers in place. Does not compile.
  2. fix: resolve cherry-pick conflicts — resolution. Notable choices:
    • migration_notes.md: only the new DeployMethod note was added. Other entries that came in via the cherry-pick (getBlock / getCheckpoint, feeAssetPriceModifier, Domain separators, aztec-up table reformatting) belong to PRs that have not been backported, so they were dropped to avoid bringing in unrelated changes.
    • txe_oracles.nr, constants.nr, constants_tests.nr: dropped formatting-only diffs that depended on constants/types not present on v4-next (MAX_PRIVATE_LOGS_PER_TX, PRIVATE_LOG_SIZE_IN_FIELDS, DOM_SEP__HANDSHAKE_SECRET_HASH, DOM_SEP__MERKLE_HASH, etc.).
    • bot/src/factory.ts: dropped the new setupTokenWithOptionalEarlyRefuel / setupTokenContractWithOptionalEarlyRefuel / getTokenInstance helpers (introduced by an unrelated PR) and applied the new DeployInstantiationOptions API to the existing setupToken flow.
    • e2e/composed/ha/e2e_ha_full.test.ts: dropped the should reload keystore via admin API and keep building blocks after swapping attesters test that does not exist on v4-next.
    • docs/examples/ts/aave_bridge, docs/examples/ts/example_swap: kept deleted (modify/delete conflict — these examples don't exist on v4-next).
    • docs/examples/ts/token_bridge/index.ts: kept node.getProvenBlockNumber() — the new getBlockNumber('proven') is from a different PR.
    • End-to-end tests, aztec.js/src/api/contract.ts, bot, etc.: adopted the new DeployInstantiationOptions API; kept v4-next-only DeployTxReceipt / DeployWaitOptions exports.
  3. fix: restore DeployInteractionWaitOptions for v4-next returnReceipt API — v4-next still supports wait: { returnReceipt: true } (a feature added on v4-next that does not exist upstream). The upstream PR removed DeployInteractionWaitOptions and tightened DeployOptions<W extends InteractionWaitOptions>, which broke type-checking for the existing returnReceipt callers. This commit restores DeployInteractionWaitOptions = NoWait | DeployWaitOptions | undefined and rewires DeployOptions / DeployReturn / send to use it, so the v4-next-only returnReceipt: true callers keep type-checking.

Test plan

  • CI green on this branch
  • e2e_deploy_contract tests pass

ClaudeBox log: https://claudebox.work/s/2e03d384f1f73fd0?run=1

Thunkar and others added 3 commits May 7, 2026 09:51
Records the raw cherry-pick state (including conflict markers) so reviewers can see exactly what conflicted before resolution.
Resolve conflicts in #22985 cherry-pick:
- Keep v4-next migration notes structure; add only the DeployMethod note (not unrelated entries from merge-train)
- Drop unrelated formatting/refactor bleed-through (txe_oracles, constants*, contract.test fixture, factory helpers)
- Adopt the new DeployInstantiationOptions API in factory and e2e tests
- Preserve v4-next-specific DeployTxReceipt / DeployWaitOptions types
- Drop deleted-by-us doc examples and the unrelated keystore-reload e2e test
v4-next-staging keeps DeployTxReceipt / DeployWaitOptions and the
'wait: { returnReceipt: true }' API. Restore DeployInteractionWaitOptions
(removed by upstream PR) and use it in DeployOptions/send so that
the existing returnReceipt callers keep type-checking.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 7, 2026
AztecBot added 2 commits May 7, 2026 12:09
Cherry-pick conflict resolution on commits 3befdc8/2ee3b06763 accidentally
reverted 7 files to an older API. Upstream PR #22985 only touched 43 files;
none of these 7 are among them. Restoring to origin/backport-to-v4-next-staging.

- yarn-project/foundation/src/collection/array.ts (re-add uniqueBy)
- yarn-project/foundation/src/collection/array.test.ts (re-add uniqueBy tests)
- yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts
- yarn-project/pxe/src/events/event_service.ts (batched validateAndStoreEvents)
- yarn-project/pxe/src/events/event_service.test.ts
- yarn-project/pxe/src/notes/note_service.ts (chunked nullifier batching)
- yarn-project/pxe/src/notes/note_service.test.ts
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. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants