Skip to content

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

Merged
Thunkar merged 4 commits into
backport-to-v4-next-stagingfrom
claudebox/backport-22985-v4-next
May 8, 2026
Merged

chore: backport DeployMethod refactor (#22985) to v4-next#23029
Thunkar merged 4 commits into
backport-to-v4-next-stagingfrom
claudebox/backport-22985-v4-next

Conversation

@AztecBot

@AztecBot AztecBot commented May 7, 2026

Copy link
Copy Markdown
Collaborator

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

@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 AztecBot force-pushed the claudebox/backport-22985-v4-next branch 5 times, most recently from 36f47c0 to 136c3c1 Compare May 8, 2026 07:20
Thunkar and others added 3 commits May 8, 2026 08:27
Records the raw cherry-pick state (including conflict markers) so reviewers can see exactly what conflicted before resolution.

Original PR: #22985
Resolve conflicts in #22985 cherry-pick onto v4-next-staging:
- migration_notes.md: keep only the new DeployMethod note. Drop unrelated entries
  (getBlock/getCheckpoint, feeAssetPriceModifier, Domain separators, aztec-up
  table, slasher renames, Unreleased v5 returnReceipt removal) from PRs not yet
  backported.
- txe_oracles.nr / constants*.nr: drop bleed-through constants
  (NULL_MSG_SENDER_CONTRACT_ADDRESS, DOM_SEP__HANDSHAKE_SECRET_HASH,
  DOM_SEP__MERKLE_HASH, DOM_SEP__NON_INTERACTIVE_HANDSHAKE_LOG_TAG,
  DOM_SEP__NULLIFIER_MERKLE, DOM_SEP__PARTIAL_NOTE_COMMITMENT,
  DOM_SEP__PUBLIC_DATA_MERKLE) introduced by other PRs.
- bot/factory.ts: adopt new DeployInstantiationOptions API; drop
  setupTokenWithOptionalEarlyRefuel / setupTokenContractWithOptionalEarlyRefuel
  / getTokenInstance helpers from an unbackported refuel PR; hoist instance
  variable so the post-if address read works on v4-next.
- e2e tests + cli-wallet/deploy.ts: adopt new DeployInstantiationOptions API
  (salt/deployer/universalDeploy/publicKeys move to construction); keep v4-next-only
  'wait: { returnReceipt: true }' callers compatible.
- aztec.js/api/contract.ts: keep DeployTxReceipt / DeployWaitOptions /
  DeployInteractionWaitOptions exports (v4-next-only).
- e2e_ha_full.test.ts: drop the keystore-reload test (introduced by an
  unbackported keystore-reload PR).
- token_bridge/index.ts: keep node.getProvenBlockNumber() (the new
  getBlockNumber('proven') ships with the unbackported getBlock RPC PR).
v4-next-staging keeps DeployTxReceipt / DeployWaitOptions and the
'wait: { returnReceipt: true }' API. The upstream PR removed
DeployInteractionWaitOptions and tightened the generic constraint to
extends InteractionWaitOptions. Switch DeployOptions, DeployReturn,
convertDeployOptionsToSendOptions, send overloads, and the deployAccounts
parameter type back to DeployInteractionWaitOptions so the v4-next-only
returnReceipt callers keep type-checking.
@AztecBot AztecBot force-pushed the claudebox/backport-22985-v4-next branch from 136c3c1 to fa2a24a Compare May 8, 2026 08:43
@Thunkar Thunkar marked this pull request as ready for review May 8, 2026 09:57
@Thunkar Thunkar requested a review from a team as a code owner May 8, 2026 09:57
@Thunkar Thunkar enabled auto-merge May 8, 2026 09:57
@Thunkar Thunkar merged commit cb6863c into backport-to-v4-next-staging May 8, 2026
17 checks passed
@Thunkar Thunkar deleted the claudebox/backport-22985-v4-next branch May 8, 2026 09:57
AztecBot added a commit that referenced this pull request May 9, 2026
BEGIN_COMMIT_OVERRIDE
fix(aztec-up): Aztec installer does not shadow user installed binaries
on PATH (#22902)
fix: include sqlite binary in its npm package (#23039)
chore: backport #23041 (add sendMessagesAs to wallet api schemas) to
v4-next (#23081)
chore: backport DeployMethod refactor (#22985) to v4-next (#23029)
refactor(pxe): deduplicate tx hash lookups in MessageContextService
(#23075)
refactor(pxe): batch tagged private log queries across all secrets
(#23048)
refactor(pxe): batch log RPC calls in LogService.fetchLogsByTag (#23088)
feat(aztec-nr): Initial handshake registry contract with non interactive
handshake function (#22854)
fix: add Tag.random() helper required by backported #23088 tests
(#23094)
chore: backport: fix(aztec-up): installer does not shadow user binaries
on PATH (#22902) (#23060)
chore: backport handshake registry contract (#22854) to v4-next (#23063)
feat: deploy method refactor 2 (#23033)
refactor(pxe): skip redundant getBlock RPC when querying at anchor block
(#23100)
port(v4-next): feat(docs): autogenerate node JSON-RPC API reference
(#22543) (#23046)
chore: backport feat: deploy method refactor 2 (#23033) to v4-next
(#23103)
port(v4-next): feat(ci): Snapshots for aztec-nr contract compilation
failures and nargo expand (#23061) (#23104)
feat(txe): allow authorizing cross-contract utility calls in nr tests
(#23064)
END_COMMIT_OVERRIDE
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