feat: merge-train/fairies-v5#24470
Merged
Merged
Conversation
Follow up of #24416. With this, PXE no longer has access to the message signing key nor the fallback keys, as should be (since the semantics of those keys require user approval before usage). To keep things simple, I removed the option of passing a seed from which all keys are derived to PXE and made it so the wallet must pass the privacy keys plus the message signing and fallback public keys. The wallet _does_ derive these from a seed, but that's a decision the wallet makes, PXE doesn't force it.
We were accidentally rejecting these but there's not reason not to, and had inconsistent encode/decode behavior.
The docs don't currently do a good job of explaining to users just how scared they should be of trying to do an upgrade as of today.
This makes PXE stop trying to track a contract's current class. Instead, we fetch it on the fly from the node (which we already had to do anyway to make sure PXE's tracking of it was not out of sync). As a result, `pxe.updateContract` gets deleted. I introduced a contract class service, which deals with the interaction with the node for determining the current class (plus a cache to avoid repeated roundtrips), and an anchored contract data class for a given execution. There are some rough edges here (mostly in pxe.ts, which contains too much inlined code, and in some cases which receive both the anchored data and the raw store because the anchored data doesn't expose enough), but it's good enough for now I think. I created multiple follow up issues to clean some of this up. With this weird current class management gone, `registerContract` also became less important, so I simplified it to only take an instance, with `registerContractClass` taking the artifact. Both must be called. I also introduced a simpler version of `ContractInstance` (`ContractInstacePreimage`) which does not contain the current class - something only the AVM and the node care about - this is what PXE uses throughout. Once we fork the monorepo I imagine `ContractInstance` would be deleted on our side. Most other changes result from these decisions - the effects were quite far reaching. --------- Co-authored-by: Nicolas Chamo <nicolas@chamo.com.ar>
…24480) It was set to Field but was u32. I also adjusted some slightly outdated comments.
…4482) ## Problem CI on `merge-train/fairies-v5` is red at the `yarn-project` build step ([ci.aztec-labs.com/1783026321562696](http://ci.aztec-labs.com/1783026321562696)). The `compile_all` → `yarn tsgo -b --emitDeclarationOnly` typecheck fails with: ``` wallet-sdk/src/base-wallet/base_wallet.ts(375,36): error TS2339: Property 'address' does not exist on type 'ContractInstancePreimage'. wallet-sdk/src/base-wallet/base_wallet.ts(377,113): error TS2339: Property 'address' does not exist on type 'ContractInstancePreimage'. ``` These two were the complete set of errors reported by the (non-fail-fast) tsgo pass. ## Root cause This is a train-integration break, not a defect in the commit the CI run is attributed to (#24480, which only touched a TXE registry type). On the `v5-next` base, `ContractInstancePreimage` was refactored to no longer store a derived `address` field (address is now computed from the preimage; the with-address variant is the separate `ContractInstancePreimageWithAddress`). The fairies train's rewrite of `BaseWallet.registerContract` still read `instance.address`, which no longer exists on that type. ## Fix `PXE.registerContract(instance)` already returns the derived `AztecAddress` (it computes `computeContractAddressFromInstance(instance)` internally). Capture and use that returned address for the account-mismatch assertion instead of the removed `instance.address` field. This is semantically identical — the returned value is exactly the address the field used to hold — and touches only the two failing references. ## Verification The workspace this fix was prepared in is a bare checkout with no build/test cache available (no redis/docker) and insufficient free disk for a from-scratch `bb` + `noir` + TS build, so a full local `./bootstrap.sh ci-fast` could not be run to completion. The change is verified by inspection against the type definitions and the `PXE.registerContract` return contract; CI on this PR will exercise the real build. --- *Created by [claudebox](https://claudebox.work/v2/sessions/8542372f24dbb848) · group: `slackbot`*
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGIN_COMMIT_OVERRIDE
feat!: remove fallback and signing keys from pxe (#24451)
fix(aztec-nr): support empty notes and events (#24464)
docs: improve upgrades warning (#24462)
feat!: make contract classes dynamic (#24282)
fix(txe): align aztec_avm_returndataSize registry type with Noir u32 (#24480)
fix(wallet-sdk): use derived contract address in registerContract (#24482)
docs: document how to make nested utility calls (#24478)
feat(aztec-nr): add interactive handshake to the handshake registry (#24473)
END_COMMIT_OVERRIDE