Skip to content

Commit fa9e813

Browse files
authored
chore: Accumulated backports to v4-next (#23198)
BEGIN_COMMIT_OVERRIDE chore: kv store test fully on vitest (#23096) chore: backport kv-store vitest migration (#23096) to v4-next (#23185) test: add noir tests for get_note_hash_membership_witness (#23190) fix(aztec-up): explicit exit in CLI acceptance test harness (#23200) refactor(pxe): batch nullifier sync across scopes (#23129) refactor(pxe): backport batch nullifier sync across scopes (#23129) to v4-next (#23208) fix(ci): revert ci-compat-e2e to AWS access keys (#23211) test: drop event_logs from compat matrix and loosen avm_simulator assertion regex (#23193) fix(aztec-up): install manifest-pinned Node version instead of LTS (#23201) fix(ci): move CLI acceptance test timeout from job to step (#23205) END_COMMIT_OVERRIDE
2 parents 175c684 + 11c995e commit fa9e813

31 files changed

Lines changed: 729 additions & 931 deletions

.github/workflows/aztec-cli-acceptance-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
(github.event_name == 'workflow_run'
2525
&& github.event.workflow_run.conclusion == 'success'
2626
&& !contains(github.event.workflow_run.head_branch, '-commit.'))
27-
timeout-minutes: 30
2827
env:
2928
VERSION: ${{ github.event.inputs.version || github.event.workflow_run.head_branch }}
3029
steps:
@@ -41,6 +40,7 @@ jobs:
4140
node-version: 22
4241

4342
- name: Run Aztec CLI acceptance test
43+
timeout-minutes: 30
4444
run: ./aztec-up/test/aztec-cli-acceptance-test/run-test.sh
4545

4646
- name: Notify Slack on success

.github/workflows/ci3.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ jobs:
298298
# Escape hatch: ci-skip-compat-e2e label makes failures non-blocking on release PRs.
299299
ci-compat-e2e:
300300
runs-on: ubuntu-latest
301-
permissions:
302-
id-token: write
303-
contents: read
304301
needs: [ci]
305302
if: |
306303
always()
@@ -320,17 +317,11 @@ jobs:
320317
with:
321318
ref: ${{ github.event.pull_request.head.sha || github.sha }}
322319

323-
- name: Configure AWS credentials (OIDC)
324-
uses: aws-actions/configure-aws-credentials@v4
325-
with:
326-
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }}
327-
aws-region: us-east-2
328-
role-session-name: ci3-compat-e2e-${{ github.run_id }}
329-
role-duration-seconds: 21600 # 6h – covers AWS_SHUTDOWN_TIME (300 min) + 60 min buffer
330-
331320
- name: Run Backwards Compatibility E2E Tests
332321
timeout-minutes: 330
333322
env:
323+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
324+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
334325
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
335326
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
336327
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

aztec-up/bin/0.0.1/install

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ function install_node {
123123
# Need to install - check if nvm is available
124124
if [ ! -f "$HOME/.nvm/nvm.sh" ]; then
125125
echo "Minimum Node.js version $node_min_version not found (got $node_installed_version)."
126-
echo "Installation: nvm install --lts && nvm alias default lts/*"
126+
echo "Installation: nvm install $node_min_version && nvm alias default $node_min_version"
127127
exit 1
128128
fi
129129

130130
. "$HOME/.nvm/nvm.sh"
131-
nvm install --lts
132-
nvm alias default lts/*
131+
nvm install "$node_min_version"
132+
nvm alias default "$node_min_version"
133133
}
134134

135135
function install_versions_file {

aztec-up/test/aztec-cli-acceptance-test/aztec-cli-acceptance-test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,14 @@ if (result.ok) {
7272
log(`All steps PASSED (${msToSecs(Date.now() - totalStart)}s total)`);
7373
console.log(`TEST_RESULT=pass version=${result.aztecVersion}`);
7474
rmSync(TMP_DIR, { recursive: true, force: true });
75+
// Explicit exit fires the 'exit' handler registered in startLocalNetwork(), which SIGTERMs the
76+
// long-running `aztec start --local-network` child. Without this, the child keeps Node's event
77+
// loop alive — the handler never fires and the process hangs until the CI timeout cancels it.
78+
process.exit(0);
7579
} else {
7680
reportFailure(result.stepName, result.aztecVersion, result.error);
7781
leaveTmpDirForInspection();
78-
process.exitCode = 1;
82+
process.exit(1);
7983
}
8084

8185
async function main(): Promise<RunResult> {

noir-projects/aztec-nr/aztec/src/history/mod.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ pub mod deployment;
1414
pub mod note;
1515
pub mod nullifier;
1616
pub mod storage;
17-
mod test;
17+
pub(crate) mod test;

noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ unconstrained fn get_block_hash_membership_witness_oracle(
2121

2222
/// Returns a membership witness for a `note_hash` in the note hash tree whose root is defined in
2323
// `anchor_block_header`.
24-
// TODO(https://linear.app/aztec-labs/issue/F-652): add Noir tests for this oracle
2524
pub unconstrained fn get_note_hash_membership_witness(
2625
anchor_block_header: BlockHeader,
2726
note_hash: Field,
@@ -55,10 +54,52 @@ pub unconstrained fn get_maybe_block_hash_membership_witness(
5554
}
5655

5756
mod test {
57+
use crate::history::test::{create_note, NOTE_CREATED_AT};
58+
use crate::note::note_interface::NoteHash;
5859
use crate::oracle::block_header::get_block_header_at;
59-
use crate::protocol::{merkle_tree::root::root_from_sibling_path, traits::Hash};
60-
use crate::test::helpers::test_environment::TestEnvironment;
61-
use super::{get_block_hash_membership_witness, get_maybe_block_hash_membership_witness};
60+
use crate::protocol::{
61+
hash::{compute_siloed_note_hash, compute_unique_note_hash},
62+
merkle_tree::root::root_from_sibling_path,
63+
traits::Hash,
64+
};
65+
use crate::test::helpers::test_environment::{PrivateContextOptions, TestEnvironment};
66+
use super::{
67+
get_block_hash_membership_witness, get_maybe_block_hash_membership_witness, get_note_hash_membership_witness,
68+
};
69+
70+
#[test]
71+
unconstrained fn get_note_hash_membership_witness_returns_valid_witness_for_known_note() {
72+
let (env, hinted_note) = create_note();
73+
74+
env.private_context_opts(PrivateContextOptions::new().at_anchor_block_number(NOTE_CREATED_AT), |context| {
75+
let anchor = context.anchor_block_header;
76+
77+
let note_hash =
78+
hinted_note.note.compute_note_hash(hinted_note.owner, hinted_note.storage_slot, hinted_note.randomness);
79+
let siloed = compute_siloed_note_hash(hinted_note.contract_address, note_hash);
80+
let unique = compute_unique_note_hash(hinted_note.metadata.to_settled().note_nonce(), siloed);
81+
82+
let witness = get_note_hash_membership_witness(anchor, unique);
83+
84+
assert_eq(
85+
root_from_sibling_path(unique, witness.leaf_index, witness.sibling_path),
86+
anchor.state.partial.note_hash_tree.root,
87+
);
88+
});
89+
}
90+
91+
#[test(should_fail_with = "not found in the note hash tree at block")]
92+
unconstrained fn get_note_hash_membership_witness_panics_for_unknown_note() {
93+
let env = TestEnvironment::new();
94+
95+
env.mine_block();
96+
env.mine_block();
97+
98+
env.private_context(|context| {
99+
let anchor = context.anchor_block_header;
100+
let _witness = get_note_hash_membership_witness(anchor, 0xdeadbeef);
101+
});
102+
}
62103

63104
#[test]
64105
unconstrained fn get_block_hash_membership_witness_returns_valid_witness_for_known_block() {

yarn-project/end-to-end/bootstrap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ function avm_check_circuit {
262262
# tests are known-flaky and provide no additional backwards-compat coverage). Also excludes
263263
# kernelless_simulation, which asserts on the exact number of nullifiers emitted and breaks whenever
264264
# contracts add/remove nullifier emissions across versions (unrelated to the compat contract surface).
265+
# event_logs is excluded because the new tagging-cache reconciliation test (#23044) calls a
266+
# TestLog method (deliver_squashed_and_surviving_notes) that does not exist in legacy artifacts.
265267
function compat_test_cmds {
266268
local version=${1:?version is required}
267269
local run_test_script="yarn-project/end-to-end/scripts/run_test.sh"
@@ -271,7 +273,7 @@ function compat_test_cmds {
271273
local tests=(
272274
src/e2e_!(prover|block_building|epochs)/*.test.ts
273275
src/e2e_p2p/reqresp/*.test.ts
274-
src/e2e_!(block_building|prover_*|kernelless_simulation).test.ts
276+
src/e2e_!(block_building|prover_*|kernelless_simulation|event_logs).test.ts
275277
)
276278
for test in "${tests[@]}"; do
277279
local name=${test#*e2e_}

yarn-project/end-to-end/src/e2e_avm_simulator.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ describe('e2e_avm_simulator', () => {
5656
* at function.name();
5757
* let call = quote { $name($args) (/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch.nr:59:20)
5858
* at AvmTest.0xc3515746
59+
*
60+
* Older nargo (pre-#22911) recorded the assertion span as the inner boolean expression only,
61+
* so legacy contract artifacts under compat-e2e emit `'not_true == true'` instead of the full
62+
* `'assert(not_true == true, "This assertion should fail!")'`. The regex below accepts either
63+
* form so the test passes against both current-nargo artifacts and pinned legacy artifacts.
5964
*/
6065
describe('Not nested', () => {
6166
it('PXE processes user code assertions and recovers message (properly enriched)', async () => {
6267
await expect(
6368
avmContract.methods.assertion_failure().simulate({ from: defaultAccountAddress }),
6469
).rejects.toThrow(
6570
expect.objectContaining({
66-
message: expect.stringMatching(
67-
/Assertion failed: This assertion should fail! 'assert\(not_true == true, "This assertion should fail!"\)'/,
68-
),
71+
message: expect.stringMatching(/Assertion failed: This assertion should fail!.*not_true == true/),
6972
stack: expect.stringMatching(/at inner_helper_with_failed_assertion[\s\S]*at AvmTest\..*/),
7073
}),
7174
);

yarn-project/kv-store/.mocharc.json

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

yarn-project/kv-store/package.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"build": "yarn clean && ../scripts/tsc.sh",
1717
"build:dev": "../scripts/tsc.sh --watch",
1818
"clean": "rm -rf ./dest .tsbuildinfo",
19-
"test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json",
19+
"test:node": "vitest run --project node",
2020
"test:browser": "bash scripts/run-browser-tests.sh",
21-
"bench:browser": "VITE_BENCH=1 vitest run --config ./vitest.config.ts src/bench",
22-
"test": "yarn test:node && yarn test:browser",
21+
"bench:browser": "VITE_BENCH=1 vitest run --project browser src/bench",
22+
"test": "vitest run",
2323
"test:jest": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
2424
},
2525
"inherits": [
@@ -41,23 +41,13 @@
4141
},
4242
"devDependencies": {
4343
"@jest/globals": "^30.0.0",
44-
"@types/chai": "^5.0.1",
45-
"@types/chai-as-promised": "^8.0.1",
4644
"@types/jest": "^30.0.0",
47-
"@types/mocha": "^10.0.10",
48-
"@types/mocha-each": "^2.0.4",
4945
"@types/node": "^22.15.17",
50-
"@types/sinon": "^17.0.3",
5146
"@typescript/native-preview": "7.0.0-dev.20260113.1",
5247
"@vitest/browser-playwright": "^4.0.0",
5348
"buffer": "^6.0.3",
54-
"chai": "^5.1.2",
55-
"chai-as-promised": "^8.0.1",
5649
"jest": "^30.0.0",
57-
"mocha": "^10.8.2",
58-
"mocha-each": "^2.0.1",
5950
"playwright": "1.49.0",
60-
"sinon": "^19.0.2",
6151
"ts-node": "^10.9.1",
6252
"typescript": "^5.3.3",
6353
"util": "^0.12.5",

0 commit comments

Comments
 (0)