Skip to content

Contract addresses change across toolchain upgrades due to artifact drift #21599

@infrmtcs

Description

@infrmtcs

What are you trying to do?

Use a previously deployed contract after upgrading the Aztec toolchain version.

Current Behavior

When the Aztec toolchain is upgraded, the Noir compiler produces different artifacts for the same contract source code. This leads to a cascading mismatch:

  1. Different artifact → different contract class ID
  2. Different contract class ID → different partial address
  3. Different partial address → different complete address

Since APIs like wallet.createSchnorrAccount always resolve to the latest bundled artifact, they compute a different address for the same inputs on the same network. This means:

  • The wallet can no longer match the contract originally deployed on-chain
  • Transaction building fails because the computed address doesn't correspond to any deployed contract
  • Users effectively lose access to their accounts after a toolchain upgrade

This affects any contract whose artifact is bundled with the toolchain — account contracts (e.g., Schnorr), token contracts, etc.

Steps to Reproduce

  1. Deploy a contract (e.g., a Schnorr account) using toolchain version A
  2. Upgrade the Aztec toolchain to version B
  3. Instantiate the same contract with the same inputs (e.g., wallet.createSchnorrAccount with the same secret key)
  4. Observe that the resolved complete address differs from the one deployed in step 1
  5. Attempting to build transactions against this contract fails

Questions

  • Is there a recommended way to handle contracts deployed with a previous toolchain version?
  • Should artifact stability across compiler versions be a guarantee, or is this expected to break?
  • What is the intended migration path for users/applications when the toolchain is upgraded?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions