@aztec/simulator 3.0.0-nightly.20251112 → 3.0.0-nightly.20251113
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":"cpp_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/cpp_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"cpp_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/cpp_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EAIL,cAAc,EACd,KAAK,uBAAuB,EAE7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAkB,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAK5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,kCAAkC,EAClC,0BAA0B,EAC3B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,iBAAkB,YAAW,0BAA0B;IAC/F,UAAmB,GAAG,EAAE,MAAM,CAAC;gBAG7B,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EAChC,MAAM,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC;IAM3C;;;;;OAKG;IACmB,QAAQ,CAAC,EAAE,EAA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
import { avmSimulate, avmSimulateWithHintedDbs } from '@aztec/native';
|
|
3
4
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
4
5
|
import { AvmCircuitInputs, AvmFastSimulationInputs, AvmTxHint, PublicTxResult, deserializeFromMessagePack } from '@aztec/stdlib/avm';
|
|
@@ -82,8 +83,10 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
82
83
|
// Deserialize the msgpack result
|
|
83
84
|
this.log.verbose(`Deserializing C++ from buffer (size: ${resultBuffer.length})...`);
|
|
84
85
|
const cppResultJSON = deserializeFromMessagePack(resultBuffer);
|
|
86
|
+
// Write testdata if AZTEC_WRITE_TESTDATA=1.
|
|
87
|
+
writeTestData(`barretenberg/cpp/src/barretenberg/vm2/testing/tx_result_${txHash}.testdata.bin`, resultBuffer, /*raw=*/ true);
|
|
85
88
|
this.log.verbose(`Deserializing C++ result to PublicTxResult...`);
|
|
86
|
-
const cppResult = PublicTxResult.
|
|
89
|
+
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
87
90
|
this.log.verbose(`Done.`);
|
|
88
91
|
// TODO(fcarreiro): complete this.
|
|
89
92
|
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
@@ -162,7 +165,7 @@ export class MeasuredCppPublicTxSimulator extends CppPublicTxSimulator {
|
|
|
162
165
|
}
|
|
163
166
|
// Deserialize the msgpack result
|
|
164
167
|
const cppResultJSON = deserializeFromMessagePack(resultBuffer);
|
|
165
|
-
const cppResult = PublicTxResult.
|
|
168
|
+
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
166
169
|
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
167
170
|
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
168
171
|
this.log.debug(`C++ hinted simulation completed for tx ${txHash}`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/simulator",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251113",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
@@ -64,26 +64,26 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
68
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
69
|
-
"@aztec/native": "3.0.0-nightly.
|
|
70
|
-
"@aztec/noir-acvm_js": "3.0.0-nightly.
|
|
71
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
72
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
73
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
74
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
75
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
76
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
77
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
67
|
+
"@aztec/constants": "3.0.0-nightly.20251113",
|
|
68
|
+
"@aztec/foundation": "3.0.0-nightly.20251113",
|
|
69
|
+
"@aztec/native": "3.0.0-nightly.20251113",
|
|
70
|
+
"@aztec/noir-acvm_js": "3.0.0-nightly.20251113",
|
|
71
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251113",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251113",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-nightly.20251113",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251113",
|
|
75
|
+
"@aztec/stdlib": "3.0.0-nightly.20251113",
|
|
76
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251113",
|
|
77
|
+
"@aztec/world-state": "3.0.0-nightly.20251113",
|
|
78
78
|
"lodash.clonedeep": "^4.5.0",
|
|
79
79
|
"lodash.merge": "^4.6.2",
|
|
80
80
|
"tslib": "^2.4.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
84
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
85
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
86
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
83
|
+
"@aztec/kv-store": "3.0.0-nightly.20251113",
|
|
84
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251113",
|
|
85
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251113",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251113",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { writeTestData } from '@aztec/foundation/testing/files';
|
|
2
3
|
import { avmSimulate, avmSimulateWithHintedDbs } from '@aztec/native';
|
|
3
4
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
4
5
|
import {
|
|
@@ -124,8 +125,14 @@ export class CppPublicTxSimulator extends PublicTxSimulator implements PublicTxS
|
|
|
124
125
|
// Deserialize the msgpack result
|
|
125
126
|
this.log.verbose(`Deserializing C++ from buffer (size: ${resultBuffer.length})...`);
|
|
126
127
|
const cppResultJSON: object = deserializeFromMessagePack(resultBuffer);
|
|
128
|
+
// Write testdata if AZTEC_WRITE_TESTDATA=1.
|
|
129
|
+
writeTestData(
|
|
130
|
+
`barretenberg/cpp/src/barretenberg/vm2/testing/tx_result_${txHash}.testdata.bin`,
|
|
131
|
+
resultBuffer,
|
|
132
|
+
/*raw=*/ true,
|
|
133
|
+
);
|
|
127
134
|
this.log.verbose(`Deserializing C++ result to PublicTxResult...`);
|
|
128
|
-
const cppResult = PublicTxResult.
|
|
135
|
+
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
129
136
|
this.log.verbose(`Done.`);
|
|
130
137
|
// TODO(fcarreiro): complete this.
|
|
131
138
|
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
@@ -234,7 +241,7 @@ export class CppPublicTxSimulatorHintedDbs extends PublicTxSimulator implements
|
|
|
234
241
|
|
|
235
242
|
// Deserialize the msgpack result
|
|
236
243
|
const cppResultJSON: object = deserializeFromMessagePack(resultBuffer);
|
|
237
|
-
const cppResult = PublicTxResult.
|
|
244
|
+
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
238
245
|
|
|
239
246
|
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
240
247
|
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|