Skip to content

Commit 49aa094

Browse files
authored
chore: Accumulated backports to v4-next (#22474)
BEGIN_COMMIT_OVERRIDE cherry-pick: fix: passing in user call info from wallet (#21937) fix: passing in user call info from wallet (backport #21937) (#22459) fix: prepopulated scopes in simulateviaentrypoint (#22464) chore: backport #22464 (fix: prepopulated scopes in simulateviaentrypoint) to v4-next (#22470) docs: add macOS prerequisites and improve Node.js version guidance (#22408) END_COMMIT_OVERRIDE
2 parents ab636e8 + e3dd5a1 commit 49aa094

42 files changed

Lines changed: 720 additions & 275 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/developer_versioned_docs/version-v4.2.0-aztecnr-rc.2/getting_started_on_local_network.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ import { General, Fees } from '@site/src/components/Snippets/general_snippets';
2727

2828
- <General.node_ver />
2929

30+
### macOS-specific requirements
31+
32+
- **Homebrew**: [Homebrew](https://brew.sh/) is required for installing dependencies on macOS.
33+
- **Bash**: macOS ships with an outdated version of Bash (v3.2) that is known to cause issues with the Aztec installer. Install a modern version with `brew install bash`. Even if you use zsh as your default shell, the installer explicitly invokes `bash`. If the installer still picks up the old version, add the Homebrew `bash` to your `$PATH` or [set it as your default shell](https://support.apple.com/en-gb/guide/terminal/trml113/mac).
34+
3035
## Install and run the local network
3136

3237
### Install the Aztec toolchain

docs/docs-developers/getting_started_on_local_network.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ import { General, Fees } from '@site/src/components/Snippets/general_snippets';
2727

2828
- <General.node_ver />
2929

30+
### macOS-specific requirements
31+
32+
- **Homebrew**: [Homebrew](https://brew.sh/) is required for installing dependencies on macOS.
33+
- **Bash**: macOS ships with an outdated version of Bash (v3.2) that is known to cause issues with the Aztec installer. Install a modern version with `brew install bash`. Even if you use zsh as your default shell, the installer explicitly invokes `bash`. If the installer still picks up the old version, add the Homebrew `bash` to your `$PATH` or [set it as your default shell](https://support.apple.com/en-gb/guide/terminal/trml113/mac).
34+
3035
## Install and run the local network
3136

3237
### Install the Aztec toolchain

docs/docs-operate/operators/prerequisites.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ Install the Aztec toolchain using the official installer:
5959
VERSION=#release_version bash -i <(curl -sL https://install.aztec.network/#release_version)
6060
```
6161

62+
:::note macOS users
63+
macOS ships with an outdated version of Bash (v3.2) that is known to cause issues with the installer. Install a modern version with [Homebrew](https://brew.sh/):
64+
65+
```bash
66+
brew install bash
67+
```
68+
69+
Even if you use zsh as your default shell, the installer explicitly invokes `bash`. If the installer still picks up the old version, add the Homebrew `bash` to your `$PATH` or [set it as your default shell](https://support.apple.com/en-gb/guide/terminal/trml113/mac).
70+
:::
71+
6272
### L1 Ethereum Node Access
6373

6474
All Aztec nodes require access to Ethereum L1 node endpoints:

docs/network_versioned_docs/version-v2.1.11-ignition/operators/prerequisites.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ Install the correct version for the current network:
6565
aztec-up 2.1.11
6666
```
6767

68+
:::note macOS users
69+
macOS ships with an outdated version of Bash (v3.2) that is known to cause issues with the installer. Install a modern version with [Homebrew](https://brew.sh/):
70+
71+
```bash
72+
brew install bash
73+
```
74+
75+
Even if you use zsh as your default shell, the installer explicitly invokes `bash`. If the installer still picks up the old version, add the Homebrew `bash` to your `$PATH` or [set it as your default shell](https://support.apple.com/en-gb/guide/terminal/trml113/mac).
76+
:::
77+
6878
### L1 Ethereum Node Access
6979

7080
All Aztec nodes require access to Ethereum L1 node endpoints:

docs/src/components/Snippets/general_snippets.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ export const General = {
1919

2020
node_ver: () => (
2121
<p>
22-
Aztec libraries require Node.js version 24. You can use{" "}
23-
<a href="https://github.com/nvm-sh/nvm">nvm</a> to help manage node
24-
versions.
22+
Aztec libraries require Node.js version 24. If you have an older version
23+
installed, the installer will try to upgrade via{" "}
24+
<a href="https://github.com/nvm-sh/nvm">nvm</a> if available. If nvm is
25+
not installed, you will need to upgrade Node.js manually (e.g.{" "}
26+
<code>nvm install 24</code> after installing nvm).
2527
</p>
2628
),
2729

noir-projects/noir-contracts/Nargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ members = [
44
"contracts/account/ecdsa_r_account_contract",
55
"contracts/account/schnorr_account_contract",
66
"contracts/account/schnorr_hardcoded_account_contract",
7-
"contracts/account/simulated_account_contract",
7+
"contracts/account/simulated_schnorr_account_contract",
8+
"contracts/account/simulated_ecdsa_account_contract",
89
"contracts/app/amm_contract",
910
"contracts/app/app_subscription_contract",
1011
"contracts/app/auth_contract",

noir-projects/noir-contracts/contracts/account/simulated_account_contract/src/main.nr

Lines changed: 0 additions & 52 deletions
This file was deleted.

noir-projects/noir-contracts/contracts/account/simulated_account_contract/Nargo.toml renamed to noir-projects/noir-contracts/contracts/account/simulated_ecdsa_account_contract/Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "simulated_account_contract"
2+
name = "simulated_ecdsa_account_contract"
33
authors = [""]
44
compiler_version = ">=0.25.0"
55
type = "contract"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
use aztec::macros::aztec;
2+
3+
// Stub account contract for ECDSA accounts (both secp256k1 and secp256r1) used during simulation.
4+
// Matches the constructor signature of EcdsaKAccount / EcdsaRAccount so that deployment
5+
// simulations using this stub as an override do not fail on selector lookup.
6+
// See simulated_account_contract for the base stub without a constructor.
7+
#[aztec]
8+
pub contract SimulatedEcdsaAccount {
9+
use aztec::{
10+
authwit::{account::AccountActions, auth::IS_VALID_SELECTOR, entrypoint::app::AppPayload},
11+
context::PrivateContext,
12+
macros::functions::{allow_phase_change, external, view},
13+
messages::encoding::MESSAGE_CIPHERTEXT_LEN,
14+
oracle::{notes::set_sender_for_tags, random::random},
15+
};
16+
17+
// Stub constructor matching the EcdsaKAccount / EcdsaRAccount constructor signature.
18+
// Does NOT use #[initializer] so that the macro does not inject
19+
// assert_initialization_matches_address_preimage_private, which would fail during kernelless
20+
// simulation because the stub instance has a different initialization hash than the real account.
21+
// Emits the same shape of side effects as the real constructor (one nullifier for
22+
// SinglePrivateImmutable initialization, one note hash for the key note, and one private
23+
// log tied to that note hash) so that gas estimation produces accurate results.
24+
#[external("private")]
25+
fn constructor(_signing_pub_key_x: [u8; 32], _signing_pub_key_y: [u8; 32]) {
26+
// Safety: Random seeds are only used to produce dummy side effects that match the shape of
27+
// the real EcdsaKAccount / EcdsaRAccount constructor. The values are never constrained or
28+
// used for any security purpose.
29+
let seed = unsafe { random() };
30+
31+
// Emit the initialization nullifier for the signing_public_key SinglePrivateImmutable.
32+
self.context.push_nullifier(seed);
33+
34+
// Emit the note hash for the signing key note.
35+
self.context.push_note_hash(seed + 1);
36+
37+
// Emit a private log tied to the note hash, matching the length of a real note delivery
38+
// log (MESSAGE_CIPHERTEXT_LEN fields). The signing key note is a SinglePrivateImmutable
39+
// and is therefore never nullified, so in practice the log will never be squashed. We
40+
// pass the note hash counter anyway for correctness.
41+
let dummy_log: [Field; MESSAGE_CIPHERTEXT_LEN] = [seed + 2; MESSAGE_CIPHERTEXT_LEN];
42+
self.context.emit_raw_note_log_unsafe(
43+
seed + 3,
44+
dummy_log,
45+
MESSAGE_CIPHERTEXT_LEN,
46+
self.context.side_effect_counter,
47+
);
48+
}
49+
50+
// @dev: If you globally change the entrypoint signature don't forget to update account_entrypoint.ts
51+
#[external("private")]
52+
#[allow_phase_change]
53+
fn entrypoint(app_payload: AppPayload, fee_payment_method: u8, cancellable: bool) {
54+
// Safety: The sender for tags is only used to compute unconstrained shared secrets for
55+
// emitting logs. It is not used in any constrained logic, so it is safe to set here.
56+
unsafe { set_sender_for_tags(self.address) };
57+
58+
let actions = AccountActions::init(self.context, is_valid_impl);
59+
actions.entrypoint(app_payload, fee_payment_method, cancellable);
60+
}
61+
62+
#[external("private")]
63+
#[view]
64+
fn verify_private_authwit(inner_hash: Field) -> Field {
65+
IS_VALID_SELECTOR
66+
}
67+
68+
#[contract_library_method]
69+
fn is_valid_impl(_context: &mut PrivateContext, _outer_hash: Field) -> bool {
70+
true
71+
}
72+
73+
#[external("utility")]
74+
unconstrained fn sync_state() {
75+
assert(
76+
false,
77+
"BUG ALERT: sync_state on a simulated account contract should never be triggered.",
78+
);
79+
}
80+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "simulated_schnorr_account_contract"
3+
authors = [""]
4+
compiler_version = ">=0.25.0"
5+
type = "contract"
6+
7+
[dependencies]
8+
aztec = { path = "../../../../aztec-nr/aztec" }

0 commit comments

Comments
 (0)