Skip to content

Commit 8371ce1

Browse files
committed
wip
1 parent 9ea8692 commit 8371ce1

File tree

7 files changed

+4485
-218
lines changed

7 files changed

+4485
-218
lines changed

.github/workflows/recursive-verification-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: sandbox
21-
AZTEC_VERSION: 3.0.0-nightly.20251026
21+
AZTEC_VERSION: 3.0.0-devnet.2
2222

2323
steps:
2424
- name: Checkout repository

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
target
2-
.DS_Store
2+
.DS_Store
3+
ivc

recursive_verification/contract/Nargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ type = "contract"
44
authors = ["Satyam Bansal"]
55

66
[dependencies]
7-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251026", directory = "noir-projects/aztec-nr/aztec" }
8-
value_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251026", directory = "noir-projects/aztec-nr/value-note" }
9-
easy_private_state = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251026", directory = "noir-projects/aztec-nr/easy-private-state" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/aztec-nr/aztec" }
8+
value_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/aztec-nr/value-note" }
9+
easy_private_state = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/aztec-nr/easy-private-state" }

recursive_verification/data.json

Lines changed: 184 additions & 184 deletions
Large diffs are not rendered by default.

recursive_verification/package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"clean": "rm -rf store",
77
"cli": "bun run cli.ts",
88
"ccc": "cd contract && aztec-nargo compile && aztec-postprocess-contract && aztec codegen target -o artifacts",
9-
"bb-download-debug": "curl -L https://github.com/AztecProtocol/aztec-packages/releases/download/v3.0.0-nightly.20251026/barretenberg-threads-debug-wasm.tar.gz -o barretenberg-debug.wasm.gz && tar -xzvf barretenberg-debug.wasm.gz",
9+
"bb-download-debug": "curl -L https://github.com/AztecProtocol/aztec-packages/releases/download/v3.0.0-devnet.2/barretenberg-threads-debug-wasm.tar.gz -o barretenberg-debug.wasm.gz && tar -xzvf barretenberg-debug.wasm.gz",
1010
"recursion:debug": "bun run bb-download-debug && BB_WASM_PATH=\"$(pwd)/barretenberg-debug.wasm\" LOG_LEVEL=verbose bun run recursion",
1111
"data": "bun run scripts/generate_data.ts",
1212
"recursion": "tsx scripts/run_recursion.ts",
@@ -20,15 +20,16 @@
2020
"typescript": "^5.0.0"
2121
},
2222
"dependencies": {
23-
"@aztec/accounts": "3.0.0-nightly.20251026",
24-
"@aztec/aztec.js": "3.0.0-nightly.20251026",
25-
"@aztec/bb.js": "3.0.0-nightly.20251026",
26-
"@aztec/kv-store": "3.0.0-nightly.20251026",
27-
"@aztec/noir-contracts.js": "3.0.0-nightly.20251026",
28-
"@aztec/noir-noir_js": "3.0.0-nightly.20251026",
29-
"@aztec/pxe": "3.0.0-nightly.20251026",
30-
"@aztec/test-wallet": "3.0.0-nightly.20251026",
23+
"@aztec/accounts": "3.0.0-devnet.2",
24+
"@aztec/aztec.js": "3.0.0-devnet.2",
25+
"@aztec/bb.js": "3.0.0-devnet.2",
26+
"@aztec/kv-store": "3.0.0-devnet.2",
27+
"@aztec/noir-contracts.js": "3.0.0-devnet.2",
28+
"@aztec/noir-noir_js": "3.0.0-devnet.2",
29+
"@aztec/pxe": "3.0.0-devnet.2",
30+
"@aztec/test-wallet": "3.0.0-devnet.2",
3131
"add": "^2.0.6",
3232
"tsx": "^4.20.6"
33-
}
33+
},
34+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
3435
}

recursive_verification/scripts/run_recursion.ts

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,41 @@ import { getPXEConfig } from "@aztec/pxe/config";
1010
import { TestWallet } from "@aztec/test-wallet/server";
1111
import { AztecAddress } from "@aztec/aztec.js/addresses";
1212
import { rm } from "node:fs/promises";
13+
import { join } from "node:path";
14+
import { mkdir, writeFile } from "node:fs/promises";
15+
import { serializePrivateExecutionSteps } from "@aztec/stdlib/kernel";
16+
import type {
17+
ContractFunctionInteraction,
18+
DeployMethod,
19+
DeployOptions,
20+
SendInteractionOptions,
21+
} from "@aztec/aztec.js/contracts";
1322

1423
const sponsoredFPC = await getSponsoredFPCInstance();
1524
const sponsoredPaymentMethod = new SponsoredFeePaymentMethod(
1625
sponsoredFPC.address
1726
);
1827

28+
async function captureProfile(
29+
interaction: ContractFunctionInteraction | DeployMethod,
30+
opts: SendInteractionOptions | DeployOptions,
31+
label: string
32+
) {
33+
const result = await interaction.profile({
34+
...opts,
35+
profileMode: "full",
36+
skipProofGeneration: true,
37+
});
38+
const ivcFolder = process.env.CAPTURE_IVC_FOLDER ?? "ivc";
39+
const resultsDirectory = join(ivcFolder, label);
40+
await mkdir(resultsDirectory, { recursive: true });
41+
const ivcInputsPath = join(resultsDirectory, "ivc-inputs.msgpack");
42+
await writeFile(
43+
ivcInputsPath,
44+
serializePrivateExecutionSteps(result.executionSteps)
45+
);
46+
}
47+
1948
export const setupSandbox = async (): Promise<TestWallet> => {
2049
try {
2150
const nodeUrl = "http://localhost:8080";
@@ -49,31 +78,37 @@ async function main() {
4978
.deployed();
5079
const accounts = await testWallet.getAccounts();
5180

52-
const valueNotEqual = await ValueNotEqualContract.deploy(
81+
const deploymentOptions = {
82+
from: accounts[0].item,
83+
fee: { paymentMethod: sponsoredPaymentMethod },
84+
};
85+
86+
const deploymentInteraction = await ValueNotEqualContract.deploy(
5387
testWallet,
5488
10,
5589
accounts[0].item
56-
)
57-
.send({
58-
from: accounts[0].item,
59-
fee: { paymentMethod: sponsoredPaymentMethod },
60-
})
90+
);
91+
92+
await captureProfile(deploymentInteraction, deploymentOptions, "deployment");
93+
94+
const valueNotEqual = await deploymentInteraction
95+
.send(deploymentOptions)
6196
.deployed();
6297

63-
const tx = await valueNotEqual.methods
64-
.increment(
65-
accounts[0].item,
66-
data.vkAsFields as unknown as FieldLike[],
67-
data.proofAsFields as unknown as FieldLike[],
68-
data.publicInputs as unknown as FieldLike[]
69-
)
70-
.send({
71-
from: accounts[0].item,
72-
fee: { paymentMethod: sponsoredPaymentMethod },
73-
})
74-
.wait();
98+
const opts = {
99+
from: accounts[0].item,
100+
fee: { paymentMethod: sponsoredPaymentMethod },
101+
};
102+
103+
const interaction = await valueNotEqual.methods.increment(
104+
accounts[0].item,
105+
data.vkAsFields as unknown as FieldLike[],
106+
data.proofAsFields as unknown as FieldLike[],
107+
data.publicInputs as unknown as FieldLike[]
108+
);
109+
110+
await captureProfile(interaction, opts, "recursion");
75111

76-
console.log(`Tx hash: ${tx.txHash.toString()}`);
77112
const counterValue = await valueNotEqual.methods
78113
.get_counter(accounts[0].item)
79114
.simulate({ from: accounts[0].item });

0 commit comments

Comments
 (0)