@aztec-labs/foundation 6.0.0-nightly.20260921 → 6.0.0-nightly.20260922
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,13 @@ export declare function readTestData(repoPath: string): Buffer;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function updateInlineTestData(targetFileFromRepoRoot: string, itemName: string, value: string): void;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Same as {@link updateInlineTestData}, for a target that lives in the foundation repository this one is a submodule
|
|
13
|
+
* of rather than in this one. The path is relative to the foundation repository root.
|
|
14
|
+
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set
|
|
15
|
+
*/
|
|
16
|
+
export declare function updateInlineFndTestData(targetFileFromFndRoot: string, itemName: string, value: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the sample Prover.toml files in the foundation repository's noir-projects/fnd/noir-protocol-circuits/crates/.
|
|
13
19
|
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set. The block-root, block-merge, checkpoint,
|
|
14
20
|
* tx-merge, and root rollup samples are regenerated by the prover-client
|
|
15
21
|
* `regenerate_rollup_sample_inputs.test.ts` suite; the private-kernel and transaction-base rollup
|
|
@@ -18,10 +24,16 @@ export declare function updateInlineTestData(targetFileFromRepoRoot: string, ite
|
|
|
18
24
|
export declare function updateProtocolCircuitSampleInputs(circuitName: string, value: string): void;
|
|
19
25
|
/**
|
|
20
26
|
* Resolves the output path for an l1-contracts test fixture. The `l1-contracts` project lives in the foundation
|
|
21
|
-
* repository,
|
|
27
|
+
* repository, so regenerating fixtures from a checkout that is not a submodule of it requires pointing
|
|
22
28
|
* `AZTEC_L1_FIXTURES_DIR` at `l1-contracts/test/fixtures` in the foundation tree. The fallback is the historical path
|
|
23
29
|
* relative to the running package's working directory.
|
|
24
30
|
*/
|
|
25
31
|
export declare function getL1FixturePath(fileName: string): string;
|
|
26
32
|
export declare function getPathToFile(targetFileFromRepoRoot: string): string;
|
|
27
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Resolves a path relative to the root of the foundation repository (aztec-packages), which checks this repository out
|
|
35
|
+
* as its `labs` submodule. Test data that lives in the protocol circuits is only committed there, so regenerating it
|
|
36
|
+
* means writing one directory above this repository's root.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getPathToFndFile(targetFileFromFndRoot: string): string;
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZXN0aW5nL2ZpbGVzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLDJGQUEyRjtBQUMzRix3QkFBZ0IsYUFBYSxDQUFDLHNCQUFzQixFQUFFLE1BQU0sRUFBRSxRQUFRLEVBQUUsTUFBTSxHQUFHLE1BQU0sRUFBRSxHQUFHLEdBQUUsT0FBZSxRQVM1RztBQUVELHdCQUFnQixZQUFZLENBQUMsUUFBUSxFQUFFLE1BQU0sR0FBRyxNQUFNLENBR3JEO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBZ0Isb0JBQW9CLENBQUMsc0JBQXNCLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxNQUFNLEVBQUUsS0FBSyxFQUFFLE1BQU0sUUFLbkc7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQWdCLHVCQUF1QixDQUFDLHFCQUFxQixFQUFFLE1BQU0sRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxNQUFNLFFBS3JHO0FBbUJEOzs7Ozs7R0FNRztBQUNILHdCQUFnQixpQ0FBaUMsQ0FBQyxXQUFXLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxNQUFNLFFBTW5GO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBZ0IsZ0JBQWdCLENBQUMsUUFBUSxFQUFFLE1BQU0sVUFFaEQ7QUFFRCx3QkFBZ0IsYUFBYSxDQUFDLHNCQUFzQixFQUFFLE1BQU0sVUFPM0Q7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQWdCLGdCQUFnQixDQUFDLHFCQUFxQixFQUFFLE1BQU0sVUFXN0QifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/files/index.ts"],"names":[],"mappings":"AAOA,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,sBAAsB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,GAAE,OAAe,QAS5G;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,sBAAsB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/files/index.ts"],"names":[],"mappings":"AAOA,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,sBAAsB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,GAAE,OAAe,QAS5G;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,sBAAsB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAKnG;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,qBAAqB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAKrG;AAmBD;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAMnF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,UAEhD;AAED,wBAAgB,aAAa,CAAC,sBAAsB,EAAE,MAAM,UAO3D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,qBAAqB,EAAE,MAAM,UAW7D"}
|
|
@@ -26,8 +26,20 @@ export function readTestData(repoPath) {
|
|
|
26
26
|
if (!isGenerateTestDataEnabled()) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
+
updateInlineTestDataAt(getPathToFile(targetFileFromRepoRoot), itemName, value);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Same as {@link updateInlineTestData}, for a target that lives in the foundation repository this one is a submodule
|
|
33
|
+
* of rather than in this one. The path is relative to the foundation repository root.
|
|
34
|
+
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set
|
|
35
|
+
*/ export function updateInlineFndTestData(targetFileFromFndRoot, itemName, value) {
|
|
36
|
+
if (!isGenerateTestDataEnabled()) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
updateInlineTestDataAt(getPathToFndFile(targetFileFromFndRoot), itemName, value);
|
|
40
|
+
}
|
|
41
|
+
function updateInlineTestDataAt(targetFile, itemName, value) {
|
|
29
42
|
const logger = createConsoleLogger('aztec:testing:test_data');
|
|
30
|
-
const targetFile = getPathToFile(targetFileFromRepoRoot);
|
|
31
43
|
const contents = readFileSync(targetFile, 'utf8').toString();
|
|
32
44
|
const regex = new RegExp(`(let|pub\\s+global)\\s+${itemName}(\\s*:\\s*[^=]+)?\\s*=\\s*([\\s\\S]*?);`, 'g');
|
|
33
45
|
if (!regex.exec(contents)) {
|
|
@@ -38,21 +50,21 @@ export function readTestData(repoPath) {
|
|
|
38
50
|
logger(`Updated test data in ${targetFile} for ${itemName} to ${value}`);
|
|
39
51
|
}
|
|
40
52
|
/**
|
|
41
|
-
* Updates the sample Prover.toml files in noir-projects/fnd/noir-protocol-circuits/crates/.
|
|
53
|
+
* Updates the sample Prover.toml files in the foundation repository's noir-projects/fnd/noir-protocol-circuits/crates/.
|
|
42
54
|
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set. The block-root, block-merge, checkpoint,
|
|
43
55
|
* tx-merge, and root rollup samples are regenerated by the prover-client
|
|
44
56
|
* `regenerate_rollup_sample_inputs.test.ts` suite; the private-kernel and transaction-base rollup
|
|
45
57
|
* samples by the e2e 'AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn test:e2e single-node/prover/server/full.test' dump.
|
|
46
58
|
*/ export function updateProtocolCircuitSampleInputs(circuitName, value) {
|
|
47
59
|
const logger = createConsoleLogger('aztec:testing:test_data');
|
|
48
|
-
const
|
|
49
|
-
const targetFile =
|
|
60
|
+
const targetFileFromFndRoot = `noir-projects/fnd/noir-protocol-circuits/crates/${circuitName}/Prover.toml`;
|
|
61
|
+
const targetFile = getPathToFndFile(targetFileFromFndRoot);
|
|
50
62
|
writeFileSync(targetFile, value);
|
|
51
63
|
logger(`Updated test data in ${targetFile} for ${circuitName}`);
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
66
|
* Resolves the output path for an l1-contracts test fixture. The `l1-contracts` project lives in the foundation
|
|
55
|
-
* repository,
|
|
67
|
+
* repository, so regenerating fixtures from a checkout that is not a submodule of it requires pointing
|
|
56
68
|
* `AZTEC_L1_FIXTURES_DIR` at `l1-contracts/test/fixtures` in the foundation tree. The fallback is the historical path
|
|
57
69
|
* relative to the running package's working directory.
|
|
58
70
|
*/ export function getL1FixturePath(fileName) {
|
|
@@ -65,3 +77,14 @@ export function getPathToFile(targetFileFromRepoRoot) {
|
|
|
65
77
|
}
|
|
66
78
|
return join(repoRoot, targetFileFromRepoRoot);
|
|
67
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Resolves a path relative to the root of the foundation repository (aztec-packages), which checks this repository out
|
|
82
|
+
* as its `labs` submodule. Test data that lives in the protocol circuits is only committed there, so regenerating it
|
|
83
|
+
* means writing one directory above this repository's root.
|
|
84
|
+
*/ export function getPathToFndFile(targetFileFromFndRoot) {
|
|
85
|
+
const fndRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../../../');
|
|
86
|
+
if (!existsSync(join(fndRoot, 'CODEOWNERS')) || !existsSync(join(fndRoot, 'labs-patches'))) {
|
|
87
|
+
throw new Error(`Cannot resolve ${targetFileFromFndRoot}: ${fndRoot} is not an aztec-packages checkout. ` + `This fixture is committed in aztec-packages, not in this repository, so it can only be regenerated from an ` + `aztec-packages checkout with this repository checked out as its labs submodule.`);
|
|
88
|
+
}
|
|
89
|
+
return join(fndRoot, targetFileFromFndRoot);
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec-labs/foundation",
|
|
3
|
-
"version": "6.0.0-nightly.
|
|
3
|
+
"version": "6.0.0-nightly.20260922",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dest/index.js",
|
|
6
6
|
"types": "./dest/index.d.ts",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"testEnvironment": "../../foundation/src/jest/env.mjs"
|
|
147
147
|
},
|
|
148
148
|
"dependencies": {
|
|
149
|
-
"@aztec-foundation/bb.js": "6.0.0-nightly.
|
|
149
|
+
"@aztec-foundation/bb.js": "6.0.0-nightly.20260921",
|
|
150
150
|
"@koa/cors": "^5.0.0",
|
|
151
151
|
"@noble/curves": "=1.7.0",
|
|
152
152
|
"@noble/hashes": "^1.6.1",
|
|
@@ -32,8 +32,23 @@ export function updateInlineTestData(targetFileFromRepoRoot: string, itemName: s
|
|
|
32
32
|
if (!isGenerateTestDataEnabled()) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
+
updateInlineTestDataAt(getPathToFile(targetFileFromRepoRoot), itemName, value);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Same as {@link updateInlineTestData}, for a target that lives in the foundation repository this one is a submodule
|
|
40
|
+
* of rather than in this one. The path is relative to the foundation repository root.
|
|
41
|
+
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set
|
|
42
|
+
*/
|
|
43
|
+
export function updateInlineFndTestData(targetFileFromFndRoot: string, itemName: string, value: string) {
|
|
44
|
+
if (!isGenerateTestDataEnabled()) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
updateInlineTestDataAt(getPathToFndFile(targetFileFromFndRoot), itemName, value);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function updateInlineTestDataAt(targetFile: string, itemName: string, value: string) {
|
|
35
51
|
const logger = createConsoleLogger('aztec:testing:test_data');
|
|
36
|
-
const targetFile = getPathToFile(targetFileFromRepoRoot);
|
|
37
52
|
const contents = readFileSync(targetFile, 'utf8').toString();
|
|
38
53
|
const regex = new RegExp(`(let|pub\\s+global)\\s+${itemName}(\\s*:\\s*[^=]+)?\\s*=\\s*([\\s\\S]*?);`, 'g');
|
|
39
54
|
if (!regex.exec(contents)) {
|
|
@@ -50,7 +65,7 @@ export function updateInlineTestData(targetFileFromRepoRoot: string, itemName: s
|
|
|
50
65
|
}
|
|
51
66
|
|
|
52
67
|
/**
|
|
53
|
-
* Updates the sample Prover.toml files in noir-projects/fnd/noir-protocol-circuits/crates/.
|
|
68
|
+
* Updates the sample Prover.toml files in the foundation repository's noir-projects/fnd/noir-protocol-circuits/crates/.
|
|
54
69
|
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set. The block-root, block-merge, checkpoint,
|
|
55
70
|
* tx-merge, and root rollup samples are regenerated by the prover-client
|
|
56
71
|
* `regenerate_rollup_sample_inputs.test.ts` suite; the private-kernel and transaction-base rollup
|
|
@@ -58,15 +73,15 @@ export function updateInlineTestData(targetFileFromRepoRoot: string, itemName: s
|
|
|
58
73
|
*/
|
|
59
74
|
export function updateProtocolCircuitSampleInputs(circuitName: string, value: string) {
|
|
60
75
|
const logger = createConsoleLogger('aztec:testing:test_data');
|
|
61
|
-
const
|
|
62
|
-
const targetFile =
|
|
76
|
+
const targetFileFromFndRoot = `noir-projects/fnd/noir-protocol-circuits/crates/${circuitName}/Prover.toml`;
|
|
77
|
+
const targetFile = getPathToFndFile(targetFileFromFndRoot);
|
|
63
78
|
writeFileSync(targetFile, value);
|
|
64
79
|
logger(`Updated test data in ${targetFile} for ${circuitName}`);
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
/**
|
|
68
83
|
* Resolves the output path for an l1-contracts test fixture. The `l1-contracts` project lives in the foundation
|
|
69
|
-
* repository,
|
|
84
|
+
* repository, so regenerating fixtures from a checkout that is not a submodule of it requires pointing
|
|
70
85
|
* `AZTEC_L1_FIXTURES_DIR` at `l1-contracts/test/fixtures` in the foundation tree. The fallback is the historical path
|
|
71
86
|
* relative to the running package's working directory.
|
|
72
87
|
*/
|
|
@@ -82,3 +97,21 @@ export function getPathToFile(targetFileFromRepoRoot: string) {
|
|
|
82
97
|
|
|
83
98
|
return join(repoRoot, targetFileFromRepoRoot);
|
|
84
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Resolves a path relative to the root of the foundation repository (aztec-packages), which checks this repository out
|
|
103
|
+
* as its `labs` submodule. Test data that lives in the protocol circuits is only committed there, so regenerating it
|
|
104
|
+
* means writing one directory above this repository's root.
|
|
105
|
+
*/
|
|
106
|
+
export function getPathToFndFile(targetFileFromFndRoot: string) {
|
|
107
|
+
const fndRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../../../');
|
|
108
|
+
if (!existsSync(join(fndRoot, 'CODEOWNERS')) || !existsSync(join(fndRoot, 'labs-patches'))) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
`Cannot resolve ${targetFileFromFndRoot}: ${fndRoot} is not an aztec-packages checkout. ` +
|
|
111
|
+
`This fixture is committed in aztec-packages, not in this repository, so it can only be regenerated from an ` +
|
|
112
|
+
`aztec-packages checkout with this repository checked out as its labs submodule.`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return join(fndRoot, targetFileFromFndRoot);
|
|
117
|
+
}
|