@aztec/simulator 0.85.0-alpha-testnet.7 → 0.85.0-alpha-testnet.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulation_provider.d.ts","sourceRoot":"","sources":["../../../src/private/providers/simulation_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,sBAAsB,CACpB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,kBAAkB,CAChB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC;AAED,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG;IAAE,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAIxG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"simulation_provider.d.ts","sourceRoot":"","sources":["../../../src/private/providers/simulation_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,sBAAsB,CACpB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,kBAAkB,CAChB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC;AAED,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG;IAAE,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAIxG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,GAAG,YAAY,CAwC1G"}
|
|
@@ -4,23 +4,21 @@ import { extractCallStack } from '../acvm/acvm.js';
|
|
|
4
4
|
// Payload parsing taken from noir/noir-repo/tooling/noir_js/src/witness_generation.ts.
|
|
5
5
|
// TODO: import this in isolation without having to import noir_js in its entirety.
|
|
6
6
|
export function enrichNoirError(artifact, originalError) {
|
|
7
|
-
const payload = originalError.rawAssertionPayload;
|
|
8
|
-
if (!payload) {
|
|
9
|
-
return originalError;
|
|
10
|
-
}
|
|
11
7
|
const enrichedError = originalError;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
if (originalError.rawAssertionPayload) {
|
|
9
|
+
try {
|
|
10
|
+
// Decode the payload
|
|
11
|
+
const decodedPayload = abiDecodeError(artifact.abi, originalError.rawAssertionPayload);
|
|
12
|
+
if (typeof decodedPayload === 'string') {
|
|
13
|
+
// If it's a string, just add it to the error message
|
|
14
|
+
enrichedError.message = `Circuit execution failed: ${decodedPayload}`;
|
|
15
|
+
} else {
|
|
16
|
+
// If not, attach the payload to the original error
|
|
17
|
+
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
18
|
+
}
|
|
19
|
+
} catch (_errorDecoding) {
|
|
20
|
+
// Ignore errors decoding the payload
|
|
21
21
|
}
|
|
22
|
-
} catch (_errorDecoding) {
|
|
23
|
-
// Ignore errors decoding the payload
|
|
24
22
|
}
|
|
25
23
|
try {
|
|
26
24
|
// Decode the callstack
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/simulator",
|
|
3
|
-
"version": "0.85.0-alpha-testnet.
|
|
3
|
+
"version": "0.85.0-alpha-testnet.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
@@ -60,24 +60,24 @@
|
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@aztec/constants": "0.85.0-alpha-testnet.
|
|
64
|
-
"@aztec/foundation": "0.85.0-alpha-testnet.
|
|
65
|
-
"@aztec/noir-acvm_js": "0.85.0-alpha-testnet.
|
|
66
|
-
"@aztec/noir-noirc_abi": "0.85.0-alpha-testnet.
|
|
67
|
-
"@aztec/noir-protocol-circuits-types": "0.85.0-alpha-testnet.
|
|
68
|
-
"@aztec/noir-types": "0.85.0-alpha-testnet.
|
|
69
|
-
"@aztec/protocol-contracts": "0.85.0-alpha-testnet.
|
|
70
|
-
"@aztec/stdlib": "0.85.0-alpha-testnet.
|
|
71
|
-
"@aztec/telemetry-client": "0.85.0-alpha-testnet.
|
|
72
|
-
"@aztec/world-state": "0.85.0-alpha-testnet.
|
|
63
|
+
"@aztec/constants": "0.85.0-alpha-testnet.9",
|
|
64
|
+
"@aztec/foundation": "0.85.0-alpha-testnet.9",
|
|
65
|
+
"@aztec/noir-acvm_js": "0.85.0-alpha-testnet.9",
|
|
66
|
+
"@aztec/noir-noirc_abi": "0.85.0-alpha-testnet.9",
|
|
67
|
+
"@aztec/noir-protocol-circuits-types": "0.85.0-alpha-testnet.9",
|
|
68
|
+
"@aztec/noir-types": "0.85.0-alpha-testnet.9",
|
|
69
|
+
"@aztec/protocol-contracts": "0.85.0-alpha-testnet.9",
|
|
70
|
+
"@aztec/stdlib": "0.85.0-alpha-testnet.9",
|
|
71
|
+
"@aztec/telemetry-client": "0.85.0-alpha-testnet.9",
|
|
72
|
+
"@aztec/world-state": "0.85.0-alpha-testnet.9",
|
|
73
73
|
"lodash.clonedeep": "^4.5.0",
|
|
74
74
|
"lodash.merge": "^4.6.2",
|
|
75
75
|
"tslib": "^2.4.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@aztec/kv-store": "0.85.0-alpha-testnet.
|
|
79
|
-
"@aztec/merkle-tree": "0.85.0-alpha-testnet.
|
|
80
|
-
"@aztec/noir-contracts.js": "0.85.0-alpha-testnet.
|
|
78
|
+
"@aztec/kv-store": "0.85.0-alpha-testnet.9",
|
|
79
|
+
"@aztec/merkle-tree": "0.85.0-alpha-testnet.9",
|
|
80
|
+
"@aztec/noir-contracts.js": "0.85.0-alpha-testnet.9",
|
|
81
81
|
"@jest/globals": "^29.5.0",
|
|
82
82
|
"@types/jest": "^29.5.0",
|
|
83
83
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
@@ -45,27 +45,23 @@ export type DecodedError = ExecutionError & { decodedAssertionPayload?: any; noi
|
|
|
45
45
|
// Payload parsing taken from noir/noir-repo/tooling/noir_js/src/witness_generation.ts.
|
|
46
46
|
// TODO: import this in isolation without having to import noir_js in its entirety.
|
|
47
47
|
export function enrichNoirError(artifact: NoirCompiledCircuit, originalError: ExecutionError): DecodedError {
|
|
48
|
-
const payload = originalError.rawAssertionPayload;
|
|
49
|
-
if (!payload) {
|
|
50
|
-
return originalError;
|
|
51
|
-
}
|
|
52
48
|
const enrichedError = originalError as DecodedError;
|
|
49
|
+
if (originalError.rawAssertionPayload) {
|
|
50
|
+
try {
|
|
51
|
+
// Decode the payload
|
|
52
|
+
const decodedPayload = abiDecodeError(artifact.abi, originalError.rawAssertionPayload);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
//
|
|
63
|
-
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
54
|
+
if (typeof decodedPayload === 'string') {
|
|
55
|
+
// If it's a string, just add it to the error message
|
|
56
|
+
enrichedError.message = `Circuit execution failed: ${decodedPayload}`;
|
|
57
|
+
} else {
|
|
58
|
+
// If not, attach the payload to the original error
|
|
59
|
+
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
60
|
+
}
|
|
61
|
+
} catch (_errorDecoding) {
|
|
62
|
+
// Ignore errors decoding the payload
|
|
64
63
|
}
|
|
65
|
-
} catch (_errorDecoding) {
|
|
66
|
-
// Ignore errors decoding the payload
|
|
67
64
|
}
|
|
68
|
-
|
|
69
65
|
try {
|
|
70
66
|
// Decode the callstack
|
|
71
67
|
const callStack = extractCallStack(originalError, {
|