@aztec/simulator 0.0.1-commit.d1f2d6c → 0.0.1-commit.d20b825a7
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.
- package/README.md +4 -4
- package/dest/private/acvm/acvm.d.ts +4 -2
- package/dest/private/acvm/acvm.d.ts.map +1 -1
- package/dest/private/acvm/acvm.js +4 -3
- package/dest/private/acvm_native.d.ts +5 -3
- package/dest/private/acvm_native.d.ts.map +1 -1
- package/dest/private/acvm_native.js +8 -6
- package/dest/private/acvm_wasm.d.ts +4 -3
- package/dest/private/acvm_wasm.d.ts.map +1 -1
- package/dest/private/acvm_wasm.js +4 -4
- package/dest/private/circuit_recording/circuit_recorder.d.ts +4 -3
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/circuit_recorder.js +7 -5
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts +3 -2
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.js +2 -2
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts +7 -2
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/memory_circuit_recorder.js +4 -4
- package/dest/private/factory.d.ts +3 -3
- package/dest/private/factory.d.ts.map +1 -1
- package/dest/private/factory.js +7 -4
- package/dest/public/avm/avm_context.d.ts +3 -3
- package/dest/public/avm/avm_context.d.ts.map +1 -1
- package/dest/public/avm/avm_contract_call_result.d.ts +6 -6
- package/dest/public/avm/avm_contract_call_result.d.ts.map +1 -1
- package/dest/public/avm/avm_contract_call_result.js +3 -3
- package/dest/public/avm/avm_execution_environment.d.ts +6 -5
- package/dest/public/avm/avm_execution_environment.d.ts.map +1 -1
- package/dest/public/avm/avm_gas.js +3 -3
- package/dest/public/avm/avm_machine_state.d.ts +6 -5
- package/dest/public/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/public/avm/avm_machine_state.js +3 -2
- package/dest/public/avm/avm_simulator.d.ts +3 -2
- package/dest/public/avm/avm_simulator.d.ts.map +1 -1
- package/dest/public/avm/avm_simulator.js +6 -5
- package/dest/public/avm/calldata.d.ts +51 -0
- package/dest/public/avm/calldata.d.ts.map +1 -0
- package/dest/public/avm/calldata.js +64 -0
- package/dest/public/avm/fixtures/account_proof_fetcher.d.ts +2 -0
- package/dest/public/avm/fixtures/account_proof_fetcher.d.ts.map +1 -0
- package/dest/public/avm/fixtures/account_proof_fetcher.js +152 -0
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +1 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.js +3 -2
- package/dest/public/avm/fixtures/initializers.d.ts +1 -1
- package/dest/public/avm/fixtures/initializers.d.ts.map +1 -1
- package/dest/public/avm/fixtures/initializers.js +2 -1
- package/dest/public/avm/opcodes/accrued_substate.d.ts +4 -5
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/public/avm/opcodes/accrued_substate.js +15 -16
- package/dest/public/avm/opcodes/external_calls.d.ts +1 -1
- package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/public/avm/opcodes/external_calls.js +7 -7
- package/dest/public/avm/opcodes/memory.js +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.js +3 -3
- package/dest/public/avm/serialization/instruction_serialization.d.ts +2 -2
- package/dest/public/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/public/avm/serialization/instruction_serialization.js +1 -1
- package/dest/public/contracts_db_checkpoint.d.ts +2 -2
- package/dest/public/contracts_db_checkpoint.d.ts.map +1 -1
- package/dest/public/contracts_db_checkpoint.js +1 -1
- package/dest/public/debug_fn_name.d.ts +4 -4
- package/dest/public/debug_fn_name.d.ts.map +1 -1
- package/dest/public/debug_fn_name.js +7 -5
- package/dest/public/executor_metrics.d.ts +1 -1
- package/dest/public/executor_metrics.d.ts.map +1 -1
- package/dest/public/executor_metrics.js +7 -2
- package/dest/public/fixtures/amm_test.js +2 -2
- package/dest/public/fixtures/bulk_test.d.ts +1 -1
- package/dest/public/fixtures/bulk_test.d.ts.map +1 -1
- package/dest/public/fixtures/bulk_test.js +4 -4
- package/dest/public/fixtures/custom_bytecode_tests.d.ts +3 -1
- package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +1 -1
- package/dest/public/fixtures/custom_bytecode_tests.js +61 -1
- package/dest/public/fixtures/opcode_spammer.d.ts +3 -4
- package/dest/public/fixtures/opcode_spammer.d.ts.map +1 -1
- package/dest/public/fixtures/opcode_spammer.js +16 -56
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +6 -5
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +37 -10
- package/dest/public/fixtures/utils.d.ts +2 -2
- package/dest/public/fixtures/utils.d.ts.map +1 -1
- package/dest/public/fixtures/utils.js +10 -10
- package/dest/public/hinting_db_sources.d.ts +5 -5
- package/dest/public/hinting_db_sources.d.ts.map +1 -1
- package/dest/public/hinting_db_sources.js +7 -6
- package/dest/public/public_db_sources.d.ts +6 -5
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +14 -14
- package/dest/public/public_processor/guarded_merkle_tree.d.ts +5 -5
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -1
- package/dest/public/public_processor/guarded_merkle_tree.js +5 -5
- package/dest/public/public_processor/public_processor.d.ts +8 -4
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +75 -50
- package/dest/public/public_processor/public_processor_metrics.d.ts +5 -2
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor_metrics.js +28 -4
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +3 -2
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.js +4 -3
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +5 -5
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +10 -11
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts +4 -4
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.js +7 -7
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts +4 -4
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.js +6 -6
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts +3 -2
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.js +2 -2
- package/dest/public/public_tx_simulator/factories.d.ts +3 -2
- package/dest/public/public_tx_simulator/factories.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/factories.js +4 -4
- package/dest/public/public_tx_simulator/public_tx_context.d.ts +10 -5
- package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_context.js +16 -18
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +9 -4
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +23 -15
- package/dest/public/side_effect_trace.d.ts +4 -4
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace.js +3 -3
- package/dest/public/state_manager/state_manager.d.ts +10 -4
- package/dest/public/state_manager/state_manager.d.ts.map +1 -1
- package/dest/public/state_manager/state_manager.js +12 -5
- package/dest/public/test_executor_metrics.d.ts +8 -2
- package/dest/public/test_executor_metrics.d.ts.map +1 -1
- package/dest/public/test_executor_metrics.js +24 -2
- package/package.json +15 -16
- package/src/private/acvm/acvm.ts +4 -3
- package/src/private/acvm_native.ts +11 -5
- package/src/private/acvm_wasm.ts +7 -3
- package/src/private/circuit_recording/circuit_recorder.ts +7 -5
- package/src/private/circuit_recording/file_circuit_recorder.ts +7 -2
- package/src/private/circuit_recording/memory_circuit_recorder.ts +6 -4
- package/src/private/factory.ts +7 -4
- package/src/public/avm/avm_context.ts +2 -2
- package/src/public/avm/avm_contract_call_result.ts +8 -6
- package/src/public/avm/avm_execution_environment.ts +9 -4
- package/src/public/avm/avm_gas.ts +2 -2
- package/src/public/avm/avm_machine_state.ts +6 -5
- package/src/public/avm/avm_simulator.ts +9 -6
- package/src/public/avm/calldata.ts +101 -0
- package/src/public/avm/fixtures/account_proof.json +553 -0
- package/src/public/avm/fixtures/account_proof_fetcher.ts +166 -0
- package/src/public/avm/fixtures/avm_simulation_tester.ts +8 -2
- package/src/public/avm/fixtures/initializers.ts +2 -1
- package/src/public/avm/opcodes/accrued_substate.ts +16 -19
- package/src/public/avm/opcodes/external_calls.ts +9 -8
- package/src/public/avm/opcodes/memory.ts +1 -1
- package/src/public/avm/serialization/bytecode_serialization.ts +2 -2
- package/src/public/avm/serialization/instruction_serialization.ts +1 -1
- package/src/public/contracts_db_checkpoint.ts +1 -1
- package/src/public/debug_fn_name.ts +10 -8
- package/src/public/executor_metrics.ts +4 -1
- package/src/public/fixtures/amm_test.ts +2 -2
- package/src/public/fixtures/bulk_test.ts +2 -4
- package/src/public/fixtures/custom_bytecode_tests.ts +139 -1
- package/src/public/fixtures/opcode_spammer.ts +18 -55
- package/src/public/fixtures/public_tx_simulation_tester.ts +47 -6
- package/src/public/fixtures/utils.ts +17 -12
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +1 -1
- package/src/public/hinting_db_sources.ts +9 -7
- package/src/public/public_db_sources.ts +27 -19
- package/src/public/public_processor/guarded_merkle_tree.ts +6 -6
- package/src/public/public_processor/public_processor.ts +112 -67
- package/src/public/public_processor/public_processor_metrics.ts +22 -4
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +8 -4
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +10 -8
- package/src/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.ts +7 -5
- package/src/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.ts +7 -5
- package/src/public/public_tx_simulator/dumping_cpp_public_tx_simulator.ts +3 -1
- package/src/public/public_tx_simulator/factories.ts +6 -3
- package/src/public/public_tx_simulator/public_tx_context.ts +21 -16
- package/src/public/public_tx_simulator/public_tx_simulator.ts +28 -15
- package/src/public/side_effect_trace.ts +5 -2
- package/src/public/state_manager/state_manager.ts +27 -4
- package/src/public/test_executor_metrics.ts +27 -3
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
* - `EMITNOTEHASH`: max 64 per TX
|
|
144
144
|
* - `EMITNULLIFIER`: max 63 per TX (one reserved for TX nullifier)
|
|
145
145
|
* - `SENDL2TOL1MSG`: max 8 per TX
|
|
146
|
-
* - `
|
|
146
|
+
* - `EMITPUBLICLOG`: limited by total log payload size
|
|
147
147
|
*
|
|
148
148
|
* By having the inner contract REVERT after emitting side effects, those effects are discarded, allowing the outer contract to call it again. This enables thousands of opcode executions per TX instead of just the limit.
|
|
149
149
|
*
|
|
@@ -164,7 +164,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
164
164
|
import type { Bufferable } from '@aztec/foundation/serialize';
|
|
165
165
|
import { type CallStackMetadata, PublicDataWrite, type PublicTxResult } from '@aztec/stdlib/avm';
|
|
166
166
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
167
|
-
import { computePublicDataTreeLeafSlot
|
|
167
|
+
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
168
168
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
169
169
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
170
170
|
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
EcAdd,
|
|
183
183
|
EmitNoteHash,
|
|
184
184
|
EmitNullifier,
|
|
185
|
-
|
|
185
|
+
EmitPublicLog,
|
|
186
186
|
Eq,
|
|
187
187
|
FieldDiv,
|
|
188
188
|
GetContractInstance,
|
|
@@ -295,9 +295,8 @@ export interface SpamConfigsForOpcode {
|
|
|
295
295
|
export const WARM_NOTE_HASH = new Fr(0xdeadbeefn);
|
|
296
296
|
export const WARM_L1_TO_L2_MSG = new Fr(0xcafebabedeadbeefn);
|
|
297
297
|
|
|
298
|
-
/** Warm nullifier
|
|
299
|
-
export const
|
|
300
|
-
export const WARM_NULLIFIER_ADDRESS = AztecAddress.fromNumber(0xbeef);
|
|
298
|
+
/** Warm nullifier constant - a pre-siloed nullifier value inserted directly into the tree */
|
|
299
|
+
export const WARM_SILOED_NULLIFIER = new Fr(0xdeadbeef0001n);
|
|
301
300
|
|
|
302
301
|
/** Warm storage constants - storage is inserted for the deployed contract's address */
|
|
303
302
|
export const WARM_STORAGE_SLOT = new Fr(0xdeadbeef0002n);
|
|
@@ -331,9 +330,8 @@ export async function insertWarmTreeEntries(
|
|
|
331
330
|
// Insert into L1 to L2 message tree
|
|
332
331
|
await merkleTrees.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, [WARM_L1_TO_L2_MSG]);
|
|
333
332
|
|
|
334
|
-
// Insert siloed nullifier into nullifier tree
|
|
335
|
-
|
|
336
|
-
await merkleTrees.sequentialInsert(MerkleTreeId.NULLIFIER_TREE, [siloedNullifier.toBuffer()]);
|
|
333
|
+
// Insert siloed nullifier into nullifier tree (already siloed - used directly by NULLIFIEREXISTS)
|
|
334
|
+
await merkleTrees.sequentialInsert(MerkleTreeId.NULLIFIER_TREE, [WARM_SILOED_NULLIFIER.toBuffer()]);
|
|
337
335
|
|
|
338
336
|
// Insert storage value into public data tree
|
|
339
337
|
const leafSlot = await computePublicDataTreeLeafSlot(contractAddress, WARM_STORAGE_SLOT);
|
|
@@ -1060,56 +1058,25 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
|
|
|
1060
1058
|
[Opcode.NULLIFIEREXISTS]: [
|
|
1061
1059
|
{
|
|
1062
1060
|
label: 'Non-existent nullifier',
|
|
1061
|
+
// NULLIFIEREXISTS now takes a siloed nullifier directly (no address parameter)
|
|
1063
1062
|
setup: [
|
|
1064
|
-
{ offset: 0, value: new Field(Fr.random()) }, // random nullifier
|
|
1065
|
-
{ offset: 1, value: new Field(Fr.random()) }, // random address
|
|
1063
|
+
{ offset: 0, value: new Field(Fr.random()) }, // random siloed nullifier (won't exist)
|
|
1066
1064
|
],
|
|
1067
1065
|
targetInstructions: () => [
|
|
1068
|
-
new NullifierExists(/*addressing_mode=*/ 0, /*
|
|
1066
|
+
new NullifierExists(/*addressing_mode=*/ 0, /*siloedNullifierOffset=*/ 0, /*existsOffset=*/ 1),
|
|
1069
1067
|
],
|
|
1070
1068
|
},
|
|
1071
1069
|
{
|
|
1072
1070
|
label: 'Existing nullifier (warm - from tree)',
|
|
1073
|
-
// Uses pre-inserted nullifier from insertWarmTreeEntries()
|
|
1071
|
+
// Uses pre-inserted siloed nullifier from insertWarmTreeEntries()
|
|
1072
|
+
// NULLIFIEREXISTS now takes a siloed nullifier directly
|
|
1074
1073
|
setup: [
|
|
1075
|
-
{ offset: 0, value: new Field(
|
|
1076
|
-
{ offset: 1, value: new Field(WARM_NULLIFIER_ADDRESS.toField()) }, // address it was siloed with
|
|
1074
|
+
{ offset: 0, value: new Field(WARM_SILOED_NULLIFIER) }, // pre-inserted siloed nullifier
|
|
1077
1075
|
],
|
|
1078
1076
|
targetInstructions: () => [
|
|
1079
|
-
new NullifierExists(/*addressing_mode=*/ 0, /*
|
|
1077
|
+
new NullifierExists(/*addressing_mode=*/ 0, /*siloedNullifierOffset=*/ 0, /*existsOffset=*/ 1),
|
|
1080
1078
|
],
|
|
1081
1079
|
},
|
|
1082
|
-
{
|
|
1083
|
-
label: 'Existing nullifier (warm - EMITNULLIFIER first)',
|
|
1084
|
-
// Memory layout: nullifier (incremented), constant 1, current address (from GETENVVAR), revertSize, exists result
|
|
1085
|
-
setup: [
|
|
1086
|
-
{ offset: 0, value: new Field(Fr.random()) }, // nullifier (will be incremented)
|
|
1087
|
-
{ offset: 1, value: new Field(1n) }, // constant 1 for ADD
|
|
1088
|
-
() => [
|
|
1089
|
-
// Get current contract address into offset 2
|
|
1090
|
-
new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 2, /*varEnum=*/ 0).as(
|
|
1091
|
-
Opcode.GETENVVAR_16,
|
|
1092
|
-
GetEnvVar.wireFormat16,
|
|
1093
|
-
),
|
|
1094
|
-
],
|
|
1095
|
-
{ offset: 3, value: new Uint32(0n) }, // revertSize
|
|
1096
|
-
],
|
|
1097
|
-
targetInstructions: () => [
|
|
1098
|
-
new EmitNullifier(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0),
|
|
1099
|
-
new NullifierExists(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 2, /*existsOffset=*/ 4),
|
|
1100
|
-
new Add(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
|
|
1101
|
-
Opcode.ADD_8,
|
|
1102
|
-
Add.wireFormat8,
|
|
1103
|
-
), // nullifier++
|
|
1104
|
-
],
|
|
1105
|
-
cleanupInstructions: () => [
|
|
1106
|
-
new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 3, /*returnOffset=*/ 0).as(
|
|
1107
|
-
Opcode.REVERT_8,
|
|
1108
|
-
Revert.wireFormat8,
|
|
1109
|
-
),
|
|
1110
|
-
],
|
|
1111
|
-
limit: MAX_NULLIFIERS_PER_TX - 1,
|
|
1112
|
-
},
|
|
1113
1080
|
],
|
|
1114
1081
|
|
|
1115
1082
|
[Opcode.L1TOL2MSGEXISTS]: [
|
|
@@ -1275,17 +1242,15 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
|
|
|
1275
1242
|
},
|
|
1276
1243
|
],
|
|
1277
1244
|
|
|
1278
|
-
//
|
|
1279
|
-
[Opcode.
|
|
1245
|
+
// EMITPUBLICLOG - two configs: minimal (many small logs) and max-size (one large log)
|
|
1246
|
+
[Opcode.EMITPUBLICLOG]: [
|
|
1280
1247
|
{
|
|
1281
1248
|
label: 'Many empty logs, revert, repeat',
|
|
1282
1249
|
setup: [
|
|
1283
1250
|
{ offset: 0, value: new Uint32(0n) }, // logSize = 0 fields (minimal)
|
|
1284
1251
|
{ offset: 1, value: new Uint32(0n) }, // revertSize
|
|
1285
1252
|
],
|
|
1286
|
-
targetInstructions: () => [
|
|
1287
|
-
new EmitUnencryptedLog(/*addressing_mode=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 1),
|
|
1288
|
-
], // logOffset doesn't matter when size is 0
|
|
1253
|
+
targetInstructions: () => [new EmitPublicLog(/*addressing_mode=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 1)], // logOffset doesn't matter when size is 0
|
|
1289
1254
|
cleanupInstructions: () => [
|
|
1290
1255
|
new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(
|
|
1291
1256
|
Opcode.REVERT_8,
|
|
@@ -1309,9 +1274,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
|
|
|
1309
1274
|
// value: new Field(0n),
|
|
1310
1275
|
//})),
|
|
1311
1276
|
],
|
|
1312
|
-
targetInstructions: () => [
|
|
1313
|
-
new EmitUnencryptedLog(/*addressing_mode=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 2),
|
|
1314
|
-
], // uses logOffset 2 (uninitialized Field(0))
|
|
1277
|
+
targetInstructions: () => [new EmitPublicLog(/*addressing_mode=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 2)], // uses logOffset 2 (uninitialized Field(0))
|
|
1315
1278
|
cleanupInstructions: () => [
|
|
1316
1279
|
new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(
|
|
1317
1280
|
Opcode.REVERT_8,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PUBLIC_TX_L2_GAS_OVERHEAD, TX_DA_GAS_OVERHEAD } from '@aztec/constants';
|
|
2
2
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
3
3
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { type ContractArtifact, encodeArguments } from '@aztec/stdlib/abi';
|
|
6
6
|
import { PublicSimulatorConfig, type PublicTxResult } from '@aztec/stdlib/avm';
|
|
7
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import { Gas, GasFees } from '@aztec/stdlib/gas';
|
|
8
|
+
import { FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT, Gas, GasFees } from '@aztec/stdlib/gas';
|
|
9
9
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
10
10
|
import { PublicCallRequest } from '@aztec/stdlib/kernel';
|
|
11
11
|
import { GlobalVariables, PublicCallRequestWithCalldata, type Tx } from '@aztec/stdlib/tx';
|
|
@@ -112,6 +112,7 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
112
112
|
feePayer: AztecAddress = sender,
|
|
113
113
|
/* need some unique first nullifier for note-nonce computations */
|
|
114
114
|
privateInsertions: TestPrivateInsertions = { nonRevertible: { nullifiers: [new Fr(420000 + this.txCount)] } },
|
|
115
|
+
gasLimits?: Gas,
|
|
115
116
|
): Promise<Tx> {
|
|
116
117
|
const setupCallRequests = await asyncMap(setupCalls, call =>
|
|
117
118
|
this.#createPubicCallRequestForCall(call, call.sender ?? sender),
|
|
@@ -131,9 +132,13 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
131
132
|
teardownCallRequest,
|
|
132
133
|
feePayer,
|
|
133
134
|
/*gasUsedByPrivate*/ teardownCall
|
|
134
|
-
? new Gas(
|
|
135
|
-
|
|
135
|
+
? new Gas(
|
|
136
|
+
FALLBACK_TEARDOWN_DA_GAS_LIMIT + TX_DA_GAS_OVERHEAD,
|
|
137
|
+
FALLBACK_TEARDOWN_L2_GAS_LIMIT + PUBLIC_TX_L2_GAS_OVERHEAD,
|
|
138
|
+
)
|
|
139
|
+
: new Gas(TX_DA_GAS_OVERHEAD, PUBLIC_TX_L2_GAS_OVERHEAD),
|
|
136
140
|
defaultGlobals(),
|
|
141
|
+
gasLimits,
|
|
137
142
|
);
|
|
138
143
|
}
|
|
139
144
|
|
|
@@ -146,8 +151,9 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
146
151
|
/* need some unique first nullifier for note-nonce computations */
|
|
147
152
|
privateInsertions?: TestPrivateInsertions,
|
|
148
153
|
txLabel: string = 'unlabeledTx',
|
|
154
|
+
gasLimits?: Gas,
|
|
149
155
|
): Promise<PublicTxResult> {
|
|
150
|
-
const tx = await this.createTx(sender, setupCalls, appCalls, teardownCall, feePayer, privateInsertions);
|
|
156
|
+
const tx = await this.createTx(sender, setupCalls, appCalls, teardownCall, feePayer, privateInsertions, gasLimits);
|
|
151
157
|
|
|
152
158
|
await this.setFeePayerBalance(feePayer);
|
|
153
159
|
|
|
@@ -161,6 +167,8 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
161
167
|
}
|
|
162
168
|
const avmResult = await this.simulator.simulate(tx, fullTxLabel);
|
|
163
169
|
|
|
170
|
+
await this.#recordBytecodeSizes(fullTxLabel, [...setupCalls, ...appCalls, ...(teardownCall ? [teardownCall] : [])]);
|
|
171
|
+
|
|
164
172
|
// Something like this is often useful for debugging:
|
|
165
173
|
//if (avmResult.revertReason) {
|
|
166
174
|
// // resolve / enrich revert reason
|
|
@@ -190,8 +198,18 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
190
198
|
teardownCall?: TestEnqueuedCall,
|
|
191
199
|
feePayer?: AztecAddress,
|
|
192
200
|
privateInsertions?: TestPrivateInsertions,
|
|
201
|
+
gasLimits?: Gas,
|
|
193
202
|
): Promise<PublicTxResult> {
|
|
194
|
-
return await this.simulateTx(
|
|
203
|
+
return await this.simulateTx(
|
|
204
|
+
sender,
|
|
205
|
+
setupCalls,
|
|
206
|
+
appCalls,
|
|
207
|
+
teardownCall,
|
|
208
|
+
feePayer,
|
|
209
|
+
privateInsertions,
|
|
210
|
+
txLabel,
|
|
211
|
+
gasLimits,
|
|
212
|
+
);
|
|
195
213
|
}
|
|
196
214
|
|
|
197
215
|
/**
|
|
@@ -209,6 +227,7 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
209
227
|
teardownCall?: TestEnqueuedCall,
|
|
210
228
|
feePayer?: AztecAddress,
|
|
211
229
|
privateInsertions?: TestPrivateInsertions,
|
|
230
|
+
gasLimits?: Gas,
|
|
212
231
|
): Promise<PublicTxResult> {
|
|
213
232
|
return await this.simulateTxWithLabel(
|
|
214
233
|
txLabel,
|
|
@@ -218,6 +237,7 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
218
237
|
teardownCall,
|
|
219
238
|
feePayer,
|
|
220
239
|
privateInsertions,
|
|
240
|
+
gasLimits,
|
|
221
241
|
);
|
|
222
242
|
}
|
|
223
243
|
|
|
@@ -277,6 +297,27 @@ export class PublicTxSimulationTester extends BaseAvmSimulationTester {
|
|
|
277
297
|
|
|
278
298
|
return new PublicCallRequestWithCalldata(request, calldata);
|
|
279
299
|
}
|
|
300
|
+
|
|
301
|
+
// WARNING: Deduplicates by artifact name, so two different artifacts with the same name
|
|
302
|
+
// in a single tx would only record the first one's bytecode size.
|
|
303
|
+
async #recordBytecodeSizes(txLabel: string, calls: TestEnqueuedCall[]) {
|
|
304
|
+
const seenArtifactNames = new Set<string>();
|
|
305
|
+
for (const call of calls) {
|
|
306
|
+
const artifact = await this.contractDataSource.getContractArtifact(call.address);
|
|
307
|
+
if (!artifact || seenArtifactNames.has(artifact.name)) {
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
seenArtifactNames.add(artifact.name);
|
|
311
|
+
const instance = await this.contractDataSource.getContract(call.address);
|
|
312
|
+
if (!instance) {
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
const contractClass = await this.contractDataSource.getContractClass(instance.currentContractClassId);
|
|
316
|
+
if (contractClass) {
|
|
317
|
+
this.metrics.recordBytecodeSize(txLabel, artifact.name, contractClass.packedBytecode.length);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
280
321
|
}
|
|
281
322
|
|
|
282
323
|
export function defaultGlobals() {
|
|
@@ -2,10 +2,8 @@ import {
|
|
|
2
2
|
CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE,
|
|
3
3
|
CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS,
|
|
4
4
|
CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
DEFAULT_TEARDOWN_DA_GAS_LIMIT,
|
|
8
|
-
DEFAULT_TEARDOWN_L2_GAS_LIMIT,
|
|
5
|
+
MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT,
|
|
6
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
9
7
|
PRIVATE_LOG_SIZE_IN_FIELDS,
|
|
10
8
|
} from '@aztec/constants';
|
|
11
9
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
@@ -14,7 +12,13 @@ import { CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG } from '@aztec/protocol-contracts
|
|
|
14
12
|
import { bufferAsFields } from '@aztec/stdlib/abi';
|
|
15
13
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
16
14
|
import type { ContractClassPublic, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
17
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
FALLBACK_TEARDOWN_DA_GAS_LIMIT,
|
|
17
|
+
FALLBACK_TEARDOWN_L2_GAS_LIMIT,
|
|
18
|
+
Gas,
|
|
19
|
+
GasFees,
|
|
20
|
+
GasSettings,
|
|
21
|
+
} from '@aztec/stdlib/gas';
|
|
18
22
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
19
23
|
import {
|
|
20
24
|
LogHash,
|
|
@@ -62,13 +66,14 @@ export async function createTxForPublicCalls(
|
|
|
62
66
|
feePayer = AztecAddress.zero(),
|
|
63
67
|
gasUsedByPrivate: Gas = Gas.empty(),
|
|
64
68
|
globals: GlobalVariables = GlobalVariables.empty(),
|
|
69
|
+
gasLimits?: Gas,
|
|
65
70
|
): Promise<Tx> {
|
|
66
71
|
assert(
|
|
67
72
|
setupCallRequests.length > 0 || appCallRequests.length > 0 || teardownCallRequest !== undefined,
|
|
68
73
|
"Can't create public tx with no enqueued calls",
|
|
69
74
|
);
|
|
70
75
|
// use max limits
|
|
71
|
-
|
|
76
|
+
gasLimits = gasLimits ?? new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
72
77
|
|
|
73
78
|
const forPublic = PartialPrivateTailPublicInputsForPublic.empty();
|
|
74
79
|
|
|
@@ -128,19 +133,19 @@ export async function createTxForPublicCalls(
|
|
|
128
133
|
|
|
129
134
|
const maxFeesPerGas = feePayer.isZero() ? GasFees.empty() : new GasFees(10, 10);
|
|
130
135
|
const teardownGasLimits = teardownCallRequest
|
|
131
|
-
? new Gas(
|
|
136
|
+
? new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT)
|
|
132
137
|
: Gas.empty();
|
|
133
138
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, maxFeesPerGas, GasFees.empty());
|
|
134
139
|
const txContext = new TxContext(Fr.zero(), Fr.zero(), gasSettings);
|
|
135
140
|
const header = BlockHeader.empty({ globalVariables: globals });
|
|
136
141
|
const constantData = new TxConstantData(header, txContext, Fr.zero(), Fr.zero());
|
|
137
|
-
const
|
|
142
|
+
const expirationTimestamp = 0n; // Not used in the simulator.
|
|
138
143
|
|
|
139
144
|
const txData = new PrivateKernelTailCircuitPublicInputs(
|
|
140
145
|
constantData,
|
|
141
146
|
/*gasUsed=*/ gasUsedByPrivate,
|
|
142
147
|
feePayer,
|
|
143
|
-
|
|
148
|
+
expirationTimestamp,
|
|
144
149
|
forPublic,
|
|
145
150
|
);
|
|
146
151
|
|
|
@@ -163,7 +168,7 @@ export async function createTxForPrivateOnly(
|
|
|
163
168
|
gasUsedByPrivate: Gas = new Gas(10, 10),
|
|
164
169
|
): Promise<Tx> {
|
|
165
170
|
// use max limits
|
|
166
|
-
const gasLimits = new Gas(
|
|
171
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
167
172
|
|
|
168
173
|
const forRollup = PartialPrivateTailPublicInputsForRollup.empty();
|
|
169
174
|
|
|
@@ -171,13 +176,13 @@ export async function createTxForPrivateOnly(
|
|
|
171
176
|
const gasSettings = new GasSettings(gasLimits, Gas.empty(), maxFeesPerGas, GasFees.empty());
|
|
172
177
|
const txContext = new TxContext(Fr.zero(), Fr.zero(), gasSettings);
|
|
173
178
|
const constantData = new TxConstantData(BlockHeader.empty(), txContext, Fr.zero(), Fr.zero());
|
|
174
|
-
const
|
|
179
|
+
const expirationTimestamp = 0n; // Not used in the simulator.
|
|
175
180
|
|
|
176
181
|
const txData = new PrivateKernelTailCircuitPublicInputs(
|
|
177
182
|
constantData,
|
|
178
183
|
/*gasUsed=*/ gasUsedByPrivate,
|
|
179
184
|
feePayer,
|
|
180
|
-
|
|
185
|
+
expirationTimestamp,
|
|
181
186
|
/*forPublic=*/ undefined,
|
|
182
187
|
forRollup,
|
|
183
188
|
);
|
|
@@ -146,7 +146,7 @@ async function createTxFromHint(cppTx: AvmTxHint): Promise<Tx> {
|
|
|
146
146
|
constants,
|
|
147
147
|
cppTx.gasUsedByPrivate,
|
|
148
148
|
cppTx.feePayer,
|
|
149
|
-
0n, //
|
|
149
|
+
0n, // expirationTimestamp
|
|
150
150
|
forPublic,
|
|
151
151
|
undefined, // forRollup - not needed for public simulation
|
|
152
152
|
);
|
|
@@ -410,12 +410,12 @@ export class HintingMerkleWriteOperations implements MerkleTreeWriteOperations {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
public async createCheckpoint(): Promise<
|
|
413
|
+
public async createCheckpoint(): Promise<number> {
|
|
414
414
|
const actionCounter = this.checkpointActionCounter++;
|
|
415
415
|
const oldCheckpointId = this.getCurrentCheckpointId();
|
|
416
416
|
const treesStateHash = await this.getTreesStateHash();
|
|
417
417
|
|
|
418
|
-
await this.db.createCheckpoint();
|
|
418
|
+
const depth = await this.db.createCheckpoint();
|
|
419
419
|
this.checkpointStack.push(this.nextCheckpointId++);
|
|
420
420
|
const newCheckpointId = this.getCurrentCheckpointId();
|
|
421
421
|
|
|
@@ -424,14 +424,16 @@ export class HintingMerkleWriteOperations implements MerkleTreeWriteOperations {
|
|
|
424
424
|
HintingMerkleWriteOperations.log.trace(
|
|
425
425
|
`[createCheckpoint:${actionCounter}] Checkpoint evolved ${oldCheckpointId} -> ${newCheckpointId} at trees state ${treesStateHash}.`,
|
|
426
426
|
);
|
|
427
|
+
|
|
428
|
+
return depth;
|
|
427
429
|
}
|
|
428
430
|
|
|
429
|
-
public
|
|
430
|
-
throw new Error('
|
|
431
|
+
public commitAllCheckpointsTo(_depth: number): Promise<void> {
|
|
432
|
+
throw new Error('commitAllCheckpointsTo is not supported in HintingMerkleWriteOperations.');
|
|
431
433
|
}
|
|
432
434
|
|
|
433
|
-
public
|
|
434
|
-
throw new Error('
|
|
435
|
+
public revertAllCheckpointsTo(_depth: number): Promise<void> {
|
|
436
|
+
throw new Error('revertAllCheckpointsTo is not supported in HintingMerkleWriteOperations.');
|
|
435
437
|
}
|
|
436
438
|
|
|
437
439
|
public async commitCheckpoint(): Promise<void> {
|
|
@@ -572,7 +574,7 @@ export class HintingMerkleWriteOperations implements MerkleTreeWriteOperations {
|
|
|
572
574
|
return await this.db.close();
|
|
573
575
|
}
|
|
574
576
|
|
|
575
|
-
async [Symbol.
|
|
577
|
+
async [Symbol.asyncDispose](): Promise<void> {
|
|
576
578
|
await this.close();
|
|
577
579
|
}
|
|
578
580
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PUBLIC_DATA_SUBTREE_HEIGHT,
|
|
6
6
|
} from '@aztec/constants';
|
|
7
7
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
8
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
9
9
|
import { Timer } from '@aztec/foundation/timer';
|
|
10
10
|
import { ContractClassPublishedEvent } from '@aztec/protocol-contracts/class-registry';
|
|
11
11
|
import { ContractInstancePublishedEvent } from '@aztec/protocol-contracts/instance-registry';
|
|
@@ -46,14 +46,19 @@ import { L1ToL2MessageIndexOutOfRangeError, NoteHashIndexOutOfRangeError } from
|
|
|
46
46
|
export class PublicContractsDB implements PublicContractsDBInterface {
|
|
47
47
|
private contractStateStack: ContractsDbCheckpoint[] = [new ContractsDbCheckpoint()];
|
|
48
48
|
|
|
49
|
-
private log
|
|
49
|
+
private log: Logger;
|
|
50
50
|
|
|
51
|
-
constructor(
|
|
51
|
+
constructor(
|
|
52
|
+
private dataSource: ContractDataSource,
|
|
53
|
+
bindings?: LoggerBindings,
|
|
54
|
+
) {
|
|
55
|
+
this.log = createLogger('simulator:contracts-data-source', bindings);
|
|
56
|
+
}
|
|
52
57
|
|
|
53
|
-
public
|
|
58
|
+
public addContracts(contractDeploymentData: ContractDeploymentData): void {
|
|
54
59
|
const currentState = this.getCurrentState();
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
this.addContractClassesFromEvents(
|
|
57
62
|
ContractClassPublishedEvent.extractContractClassEvents(contractDeploymentData.getContractClassLogs()),
|
|
58
63
|
currentState,
|
|
59
64
|
);
|
|
@@ -64,10 +69,10 @@ export class PublicContractsDB implements PublicContractsDBInterface {
|
|
|
64
69
|
);
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
public
|
|
72
|
+
public addNewContracts(tx: Tx): void {
|
|
68
73
|
const contractDeploymentData = AllContractDeploymentData.fromTx(tx);
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
this.addContracts(contractDeploymentData.getNonRevertibleContractDeploymentData());
|
|
75
|
+
this.addContracts(contractDeploymentData.getRevertibleContractDeploymentData());
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
/**
|
|
@@ -76,7 +81,7 @@ export class PublicContractsDB implements PublicContractsDBInterface {
|
|
|
76
81
|
*/
|
|
77
82
|
public createCheckpoint(): void {
|
|
78
83
|
const currentState = this.getCurrentState();
|
|
79
|
-
const newState = currentState.
|
|
84
|
+
const newState = currentState.fork();
|
|
80
85
|
this.contractStateStack.push(newState);
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -169,17 +174,15 @@ export class PublicContractsDB implements PublicContractsDBInterface {
|
|
|
169
174
|
return await this.dataSource.getDebugFunctionName(address, selector);
|
|
170
175
|
}
|
|
171
176
|
|
|
172
|
-
private
|
|
177
|
+
private addContractClassesFromEvents(
|
|
173
178
|
contractClassEvents: ContractClassPublishedEvent[],
|
|
174
179
|
state: ContractsDbCheckpoint,
|
|
175
180
|
) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}),
|
|
182
|
-
);
|
|
181
|
+
for (const event of contractClassEvents) {
|
|
182
|
+
this.log.debug(`Adding class ${event.contractClassId.toString()} to contract state`);
|
|
183
|
+
const contractClass = event.toContractClassPublic();
|
|
184
|
+
state.addClass(event.contractClassId, contractClass);
|
|
185
|
+
}
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
private addContractInstancesFromEvents(
|
|
@@ -208,9 +211,14 @@ export class PublicContractsDB implements PublicContractsDBInterface {
|
|
|
208
211
|
* to decide whether to use hints or not (same with tracing, etc).
|
|
209
212
|
*/
|
|
210
213
|
export class PublicTreesDB implements PublicStateDBInterface {
|
|
211
|
-
private logger
|
|
214
|
+
private logger: Logger;
|
|
212
215
|
|
|
213
|
-
constructor(
|
|
216
|
+
constructor(
|
|
217
|
+
private readonly db: MerkleTreeWriteOperations,
|
|
218
|
+
bindings?: LoggerBindings,
|
|
219
|
+
) {
|
|
220
|
+
this.logger = createLogger('simulator:public-trees-db', bindings);
|
|
221
|
+
}
|
|
214
222
|
|
|
215
223
|
public async storageRead(contract: AztecAddress, slot: Fr): Promise<Fr> {
|
|
216
224
|
const timer = new Timer();
|
|
@@ -82,7 +82,7 @@ export class GuardedMerkleTreeOperations implements MerkleTreeWriteOperations {
|
|
|
82
82
|
return this.guardAndPush(() => this.target.close());
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
async [Symbol.
|
|
85
|
+
async [Symbol.asyncDispose](): Promise<void> {
|
|
86
86
|
await this.close();
|
|
87
87
|
}
|
|
88
88
|
getTreeInfo(treeId: MerkleTreeId): Promise<TreeInfo> {
|
|
@@ -134,7 +134,7 @@ export class GuardedMerkleTreeOperations implements MerkleTreeWriteOperations {
|
|
|
134
134
|
): Promise<(BlockNumber | undefined)[]> {
|
|
135
135
|
return this.guardAndPush(() => this.target.getBlockNumbersForLeafIndices(treeId, leafIndices));
|
|
136
136
|
}
|
|
137
|
-
createCheckpoint(): Promise<
|
|
137
|
+
createCheckpoint(): Promise<number> {
|
|
138
138
|
return this.guardAndPush(() => this.target.createCheckpoint());
|
|
139
139
|
}
|
|
140
140
|
commitCheckpoint(): Promise<void> {
|
|
@@ -143,11 +143,11 @@ export class GuardedMerkleTreeOperations implements MerkleTreeWriteOperations {
|
|
|
143
143
|
revertCheckpoint(): Promise<void> {
|
|
144
144
|
return this.guardAndPush(() => this.target.revertCheckpoint());
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
return this.guardAndPush(() => this.target.
|
|
146
|
+
commitAllCheckpointsTo(depth: number): Promise<void> {
|
|
147
|
+
return this.guardAndPush(() => this.target.commitAllCheckpointsTo(depth));
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
return this.guardAndPush(() => this.target.
|
|
149
|
+
revertAllCheckpointsTo(depth: number): Promise<void> {
|
|
150
|
+
return this.guardAndPush(() => this.target.revertAllCheckpointsTo(depth));
|
|
151
151
|
}
|
|
152
152
|
findSiblingPaths<ID extends MerkleTreeId>(
|
|
153
153
|
treeId: ID,
|