@aztec/simulator 0.0.1-commit.b655e406 → 0.0.1-commit.fce3e4f
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/dest/client.d.ts +1 -1
- package/dest/common/errors.d.ts +1 -7
- package/dest/common/errors.d.ts.map +1 -1
- package/dest/common/index.d.ts +1 -1
- package/dest/common/stats/index.d.ts +1 -1
- package/dest/common/stats/stats.d.ts +1 -1
- package/dest/private/acvm/acvm.d.ts +1 -1
- package/dest/private/acvm/acvm_types.d.ts +1 -1
- package/dest/private/acvm/deserialize.d.ts +1 -1
- package/dest/private/acvm/index.d.ts +1 -1
- package/dest/private/acvm/serialize.d.ts +1 -1
- package/dest/private/acvm_native.d.ts +1 -1
- package/dest/private/acvm_native.d.ts.map +1 -1
- package/dest/private/acvm_wasm.d.ts +1 -1
- package/dest/private/acvm_wasm.d.ts.map +1 -1
- package/dest/private/acvm_wasm_with_blobs.d.ts +1 -1
- package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -1
- package/dest/private/circuit_recording/circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -1
- package/dest/private/circuit_simulator.d.ts +1 -1
- package/dest/private/factory.d.ts +1 -1
- package/dest/public/avm/avm_context.d.ts +1 -1
- package/dest/public/avm/avm_context.d.ts.map +1 -1
- package/dest/public/avm/avm_contract_call_result.d.ts +1 -1
- package/dest/public/avm/avm_contract_call_result.d.ts.map +1 -1
- package/dest/public/avm/avm_execution_environment.d.ts +4 -4
- package/dest/public/avm/avm_execution_environment.d.ts.map +1 -1
- package/dest/public/avm/avm_execution_environment.js +4 -7
- package/dest/public/avm/avm_gas.d.ts +2 -2
- package/dest/public/avm/avm_gas.d.ts.map +1 -1
- package/dest/public/avm/avm_machine_state.d.ts +1 -1
- package/dest/public/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/public/avm/avm_memory_types.d.ts +13 -13
- package/dest/public/avm/avm_memory_types.d.ts.map +1 -1
- 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 +2 -2
- package/dest/public/avm/avm_simulator_interface.d.ts +1 -1
- package/dest/public/avm/errors.d.ts +1 -1
- package/dest/public/avm/errors.d.ts.map +1 -1
- 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 +11 -2
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +1 -1
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/initializers.d.ts +1 -2
- package/dest/public/avm/fixtures/initializers.d.ts.map +1 -1
- package/dest/public/avm/fixtures/initializers.js +6 -4
- package/dest/public/avm/fixtures/utils.d.ts +1 -1
- package/dest/public/avm/index.d.ts +1 -1
- package/dest/public/avm/opcodes/accrued_substate.d.ts +1 -1
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/public/avm/opcodes/addressing_mode.d.ts +1 -1
- package/dest/public/avm/opcodes/addressing_mode.d.ts.map +1 -1
- package/dest/public/avm/opcodes/arithmetic.d.ts +8 -8
- package/dest/public/avm/opcodes/arithmetic.d.ts.map +1 -1
- package/dest/public/avm/opcodes/bitwise.d.ts +5 -5
- package/dest/public/avm/opcodes/bitwise.d.ts.map +1 -1
- package/dest/public/avm/opcodes/comparators.d.ts +4 -4
- package/dest/public/avm/opcodes/comparators.d.ts.map +1 -1
- package/dest/public/avm/opcodes/contract.d.ts +1 -1
- package/dest/public/avm/opcodes/contract.d.ts.map +1 -1
- package/dest/public/avm/opcodes/control_flow.d.ts +1 -1
- package/dest/public/avm/opcodes/control_flow.d.ts.map +1 -1
- package/dest/public/avm/opcodes/conversion.d.ts +1 -1
- package/dest/public/avm/opcodes/conversion.d.ts.map +1 -1
- package/dest/public/avm/opcodes/ec_add.d.ts +2 -2
- package/dest/public/avm/opcodes/ec_add.d.ts.map +1 -1
- package/dest/public/avm/opcodes/environment_getters.d.ts +1 -1
- package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -1
- 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/hashing.d.ts +2 -2
- package/dest/public/avm/opcodes/hashing.d.ts.map +1 -1
- package/dest/public/avm/opcodes/index.d.ts +1 -1
- package/dest/public/avm/opcodes/instruction.d.ts +2 -2
- package/dest/public/avm/opcodes/instruction.d.ts.map +1 -1
- package/dest/public/avm/opcodes/instruction_impl.d.ts +1 -1
- package/dest/public/avm/opcodes/instruction_impl.d.ts.map +1 -1
- package/dest/public/avm/opcodes/memory.d.ts +2 -2
- package/dest/public/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/public/avm/opcodes/misc.d.ts +1 -1
- package/dest/public/avm/opcodes/misc.d.ts.map +1 -1
- package/dest/public/avm/opcodes/misc.js +4 -4
- package/dest/public/avm/opcodes/storage.d.ts +3 -3
- package/dest/public/avm/opcodes/storage.d.ts.map +1 -1
- package/dest/public/avm/revert_reason.d.ts +1 -1
- package/dest/public/avm/serialization/buffer_cursor.d.ts +1 -1
- package/dest/public/avm/serialization/buffer_cursor.d.ts.map +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.d.ts +1 -1
- package/dest/public/avm/serialization/instruction_serialization.d.ts +1 -1
- package/dest/public/avm/test_utils.d.ts +1 -1
- package/dest/public/contracts_db_checkpoint.d.ts +16 -0
- package/dest/public/contracts_db_checkpoint.d.ts.map +1 -0
- package/dest/public/contracts_db_checkpoint.js +30 -0
- package/dest/public/db_interfaces.d.ts +13 -1
- package/dest/public/db_interfaces.d.ts.map +1 -1
- package/dest/public/debug_fn_name.d.ts +1 -1
- package/dest/public/executor_metrics.d.ts +3 -2
- package/dest/public/executor_metrics.d.ts.map +1 -1
- package/dest/public/executor_metrics.js +1 -1
- package/dest/public/executor_metrics_interface.d.ts +3 -2
- package/dest/public/executor_metrics_interface.d.ts.map +1 -1
- package/dest/public/fixtures/amm_test.d.ts +1 -1
- package/dest/public/fixtures/bulk_test.d.ts +1 -1
- package/dest/public/fixtures/custom_bytecode_tester.d.ts +2 -2
- package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -1
- package/dest/public/fixtures/custom_bytecode_tests.d.ts +1 -1
- package/dest/public/fixtures/index.d.ts +1 -1
- package/dest/public/fixtures/minimal_public_tx.d.ts +2 -3
- package/dest/public/fixtures/minimal_public_tx.d.ts.map +1 -1
- package/dest/public/fixtures/minimal_public_tx.js +2 -2
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +4 -5
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +15 -11
- package/dest/public/fixtures/simple_contract_data_source.d.ts +1 -1
- package/dest/public/fixtures/simple_contract_data_source.d.ts.map +1 -1
- package/dest/public/fixtures/token_test.d.ts +1 -1
- package/dest/public/fixtures/token_test.js +3 -4
- package/dest/public/fixtures/utils.d.ts +1 -1
- package/dest/public/hinting_db_sources.d.ts +10 -2
- package/dest/public/hinting_db_sources.d.ts.map +1 -1
- package/dest/public/hinting_db_sources.js +64 -11
- package/dest/public/index.d.ts +3 -2
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/public_db_sources.d.ts +21 -62
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +73 -130
- package/dest/public/public_errors.d.ts +1 -1
- package/dest/public/public_errors.d.ts.map +1 -1
- package/dest/public/public_processor/guarded_merkle_tree.d.ts +3 -3
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.d.ts +7 -14
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +27 -29
- package/dest/public/public_processor/public_processor_metrics.d.ts +1 -1
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +30 -0
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.js +133 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +29 -4
- 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 +138 -17
- package/dest/public/public_tx_simulator/index.d.ts +2 -1
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +13 -6
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.js +5 -5
- package/dest/public/public_tx_simulator/public_tx_context.d.ts +5 -2
- package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_context.js +12 -4
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +10 -30
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +102 -125
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +2 -2
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts +3 -3
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/side_effect_errors.d.ts +1 -1
- package/dest/public/side_effect_errors.d.ts.map +1 -1
- package/dest/public/side_effect_trace.d.ts +1 -2
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace_interface.d.ts +2 -3
- package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
- package/dest/public/state_manager/index.d.ts +1 -1
- package/dest/public/state_manager/nullifiers.d.ts +1 -1
- package/dest/public/state_manager/nullifiers.d.ts.map +1 -1
- package/dest/public/state_manager/public_storage.d.ts +1 -1
- package/dest/public/state_manager/public_storage.d.ts.map +1 -1
- package/dest/public/state_manager/state_manager.d.ts +3 -10
- package/dest/public/state_manager/state_manager.d.ts.map +1 -1
- package/dest/public/state_manager/state_manager.js +5 -4
- package/dest/public/test_executor_metrics.d.ts +4 -3
- package/dest/public/test_executor_metrics.d.ts.map +1 -1
- package/dest/public/test_executor_metrics.js +5 -4
- package/dest/public/unique_class_ids.d.ts +1 -1
- package/dest/public/unique_class_ids.d.ts.map +1 -1
- package/dest/public/utils.d.ts +1 -1
- package/dest/server.d.ts +1 -1
- package/dest/testing.d.ts +1 -1
- package/package.json +21 -20
- package/src/public/avm/avm_execution_environment.ts +3 -5
- package/src/public/avm/avm_simulator.ts +3 -4
- package/src/public/avm/fixtures/avm_simulation_tester.ts +9 -1
- package/src/public/avm/fixtures/initializers.ts +6 -8
- package/src/public/avm/opcodes/misc.ts +4 -4
- package/src/public/contracts_db_checkpoint.ts +41 -0
- package/src/public/db_interfaces.ts +15 -0
- package/src/public/executor_metrics.ts +2 -1
- package/src/public/executor_metrics_interface.ts +2 -1
- package/src/public/fixtures/custom_bytecode_tester.ts +1 -1
- package/src/public/fixtures/minimal_public_tx.ts +3 -4
- package/src/public/fixtures/public_tx_simulation_tester.ts +18 -10
- package/src/public/fixtures/token_test.ts +3 -4
- package/src/public/hinting_db_sources.ts +104 -7
- package/src/public/index.ts +2 -6
- package/src/public/public_db_sources.ts +92 -171
- package/src/public/public_processor/guarded_merkle_tree.ts +2 -2
- package/src/public/public_processor/public_processor.ts +46 -36
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +162 -0
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +199 -21
- package/src/public/public_tx_simulator/index.ts +1 -0
- package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +9 -13
- package/src/public/public_tx_simulator/public_tx_context.ts +8 -2
- package/src/public/public_tx_simulator/public_tx_simulator.ts +145 -192
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +1 -2
- package/src/public/public_tx_simulator/telemetry_public_tx_simulator.ts +2 -2
- package/src/public/state_manager/state_manager.ts +4 -11
- package/src/public/test_executor_metrics.ts +7 -5
- package/dest/public/tx_contract_cache.d.ts +0 -41
- package/dest/public/tx_contract_cache.d.ts.map +0 -1
- package/dest/public/tx_contract_cache.js +0 -49
- package/src/public/tx_contract_cache.ts +0 -69
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
|
+
import { deserializeFromMessagePack, serializeWithMessagePack } from '@aztec/stdlib/avm';
|
|
5
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import { ContractDeploymentData } from '@aztec/stdlib/contract';
|
|
7
|
+
import { ContractClassLog, ContractClassLogFields, PrivateLog } from '@aztec/stdlib/logs';
|
|
8
|
+
export class ContractProviderForCpp {
|
|
9
|
+
contractsDB;
|
|
10
|
+
globalVariables;
|
|
11
|
+
log;
|
|
12
|
+
constructor(contractsDB, globalVariables){
|
|
13
|
+
this.contractsDB = contractsDB;
|
|
14
|
+
this.globalVariables = globalVariables;
|
|
15
|
+
this.log = createLogger('simulator:contract_provider_for_cpp');
|
|
16
|
+
this.getContractInstance = async (address)=>{
|
|
17
|
+
this.log.debug(`Contract provider callback: getContractInstance(${address})`);
|
|
18
|
+
const aztecAddr = AztecAddress.fromString(address);
|
|
19
|
+
const instance = await this.contractsDB.getContractInstance(aztecAddr, this.globalVariables.timestamp);
|
|
20
|
+
if (!instance) {
|
|
21
|
+
this.log.debug(`Contract instance not found: ${address}`);
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return serializeWithMessagePack(instance);
|
|
25
|
+
};
|
|
26
|
+
this.getContractClass = async (classId)=>{
|
|
27
|
+
this.log.debug(`Contract provider callback: getContractClass(${classId})`);
|
|
28
|
+
// Parse classId string to Fr
|
|
29
|
+
const classIdFr = Fr.fromString(classId);
|
|
30
|
+
// Fetch contract class from the contracts DB
|
|
31
|
+
const contractClass = await this.contractsDB.getContractClass(classIdFr);
|
|
32
|
+
if (!contractClass) {
|
|
33
|
+
this.log.debug(`Contract class not found: ${classId}`);
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return serializeWithMessagePack(contractClass);
|
|
37
|
+
};
|
|
38
|
+
this.addContracts = async (contractDeploymentDataBuffer)=>{
|
|
39
|
+
this.log.debug(`Contract provider callback: addContracts`);
|
|
40
|
+
const rawData = deserializeFromMessagePack(contractDeploymentDataBuffer);
|
|
41
|
+
// Construct class instances using the from method
|
|
42
|
+
const contractDeploymentData = this.reconstructContractDeploymentData(rawData);
|
|
43
|
+
// Add contracts to the contracts DB
|
|
44
|
+
this.log.debug(`Calling contractsDB.addContracts`);
|
|
45
|
+
await this.contractsDB.addContracts(contractDeploymentData);
|
|
46
|
+
};
|
|
47
|
+
this.getBytecodeCommitment = async (classId)=>{
|
|
48
|
+
this.log.debug(`Contract provider callback: getBytecodeCommitment(${classId})`);
|
|
49
|
+
// Parse classId string to Fr
|
|
50
|
+
const classIdFr = Fr.fromString(classId);
|
|
51
|
+
// Fetch bytecode commitment from the contracts DB
|
|
52
|
+
const commitment = await this.contractsDB.getBytecodeCommitment(classIdFr);
|
|
53
|
+
if (!commitment) {
|
|
54
|
+
this.log.debug(`Bytecode commitment not found: ${classId}`);
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
// Serialize the Fr to buffer
|
|
58
|
+
return serializeWithMessagePack(commitment);
|
|
59
|
+
};
|
|
60
|
+
this.getDebugFunctionName = async (address, selector)=>{
|
|
61
|
+
this.log.debug(`Contract provider callback: getDebugFunctionName(${address}, ${selector})`);
|
|
62
|
+
// Parse address and selector strings
|
|
63
|
+
const aztecAddr = AztecAddress.fromString(address);
|
|
64
|
+
const selectorFr = Fr.fromString(selector);
|
|
65
|
+
const functionSelector = FunctionSelector.fromField(selectorFr);
|
|
66
|
+
// Fetch debug function name from the contracts DB
|
|
67
|
+
const name = await this.contractsDB.getDebugFunctionName(aztecAddr, functionSelector);
|
|
68
|
+
if (!name) {
|
|
69
|
+
this.log.debug(`Debug function name not found for ${address}:${selector}`);
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return name;
|
|
73
|
+
};
|
|
74
|
+
this.createCheckpoint = ()=>{
|
|
75
|
+
this.log.debug(`Contract provider callback: createCheckpoint`);
|
|
76
|
+
return Promise.resolve(this.contractsDB.createCheckpoint());
|
|
77
|
+
};
|
|
78
|
+
this.commitCheckpoint = ()=>{
|
|
79
|
+
this.log.debug(`Contract provider callback: commitCheckpoint`);
|
|
80
|
+
return Promise.resolve(this.contractsDB.commitCheckpoint());
|
|
81
|
+
};
|
|
82
|
+
this.revertCheckpoint = ()=>{
|
|
83
|
+
this.log.debug(`Contract provider callback: revertCheckpoint`);
|
|
84
|
+
return Promise.resolve(this.contractsDB.revertCheckpoint());
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
getContractInstance;
|
|
88
|
+
getContractClass;
|
|
89
|
+
addContracts;
|
|
90
|
+
getBytecodeCommitment;
|
|
91
|
+
getDebugFunctionName;
|
|
92
|
+
createCheckpoint;
|
|
93
|
+
commitCheckpoint;
|
|
94
|
+
revertCheckpoint;
|
|
95
|
+
/**
|
|
96
|
+
* Reconstruct ContractDeploymentData from plain msgpack-deserialized objects.
|
|
97
|
+
*
|
|
98
|
+
* msgpackr does not automatically apply extensions to nested fields, so we need to
|
|
99
|
+
* manually reconstruct ContractClassLog and PrivateLog instances with proper types.
|
|
100
|
+
*
|
|
101
|
+
* TODO(dbanks12): we really shouldn't have to do this.... We need to for now because
|
|
102
|
+
* msgpack deserialization doesn't give us actual typed objects, but rather just JSON.
|
|
103
|
+
* It would be easier if all types matched between languages (like AztecAddress which is just
|
|
104
|
+
* FF in C++).
|
|
105
|
+
*/ reconstructContractDeploymentData(rawData) {
|
|
106
|
+
// Helper to ensure a value is an Fr instance
|
|
107
|
+
const toFr = (value)=>{
|
|
108
|
+
if (value instanceof Fr) {
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
if (Buffer.isBuffer(value)) {
|
|
112
|
+
return Fr.fromBuffer(value);
|
|
113
|
+
}
|
|
114
|
+
return new Fr(value);
|
|
115
|
+
};
|
|
116
|
+
// Reconstruct ContractClassLogs
|
|
117
|
+
const contractClassLogs = (rawData.contractClassLogs || []).map((log)=>{
|
|
118
|
+
// Convert contractAddress to TS AztecAddress
|
|
119
|
+
const addressFr = toFr(log.contractAddress);
|
|
120
|
+
const address = AztecAddress.fromField(addressFr);
|
|
121
|
+
// Ensure all fields are Fr instances
|
|
122
|
+
const fields = (log.fields.fields || []).map((field)=>toFr(field));
|
|
123
|
+
// Create proper ContractClassLog instance
|
|
124
|
+
return new ContractClassLog(address, new ContractClassLogFields(fields), log.emittedLength);
|
|
125
|
+
});
|
|
126
|
+
// Reconstruct PrivateLogs - ensure fields are Fr instances
|
|
127
|
+
const privateLogs = (rawData.privateLogs || []).map((log)=>{
|
|
128
|
+
const fields = (log.fields || []).map((field)=>toFr(field));
|
|
129
|
+
return new PrivateLog(fields, log.emittedLength);
|
|
130
|
+
});
|
|
131
|
+
return new ContractDeploymentData(contractClassLogs, privateLogs);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
+
import { type PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
3
4
|
import type { GlobalVariables, Tx } from '@aztec/stdlib/tx';
|
|
4
5
|
import type { ExecutorMetricsInterface } from '../executor_metrics_interface.js';
|
|
5
6
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
6
|
-
import {
|
|
7
|
+
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
7
8
|
import type { MeasuredPublicTxSimulatorInterface, PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
9
|
+
/**
|
|
10
|
+
* C++ implementation of PublicTxSimulator using the C++ simulator.
|
|
11
|
+
* The C++ simulator accesses the world state directly/natively within C++.
|
|
12
|
+
* For contract DB accesses, it makes callbacks through NAPI back to the TS PublicContractsDB cache.
|
|
13
|
+
*
|
|
14
|
+
* TODO(dbanks12): for now this still simulates first in TS to generate hints and public inputs,
|
|
15
|
+
* since the C++ simulator doesn't have hinting & PI generation logic yet.
|
|
16
|
+
*/
|
|
17
|
+
export declare class CppPublicTxSimulator extends PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
18
|
+
protected log: Logger;
|
|
19
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, config?: Partial<PublicSimulatorConfig>);
|
|
20
|
+
/**
|
|
21
|
+
* Simulate a transaction's public portion using the C++ avvm simulator.
|
|
22
|
+
*
|
|
23
|
+
* @param tx - The transaction to simulate.
|
|
24
|
+
* @returns The result of the transaction's public execution.
|
|
25
|
+
*/
|
|
26
|
+
simulate(tx: Tx): Promise<PublicTxResult>;
|
|
27
|
+
}
|
|
28
|
+
export declare class MeasuredCppPublicTxSimulator extends CppPublicTxSimulator implements MeasuredPublicTxSimulatorInterface {
|
|
29
|
+
protected readonly metrics: ExecutorMetricsInterface;
|
|
30
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, metrics: ExecutorMetricsInterface, config?: Partial<PublicSimulatorConfig>);
|
|
31
|
+
simulate(tx: Tx, txLabel?: string): Promise<PublicTxResult>;
|
|
32
|
+
}
|
|
8
33
|
/**
|
|
9
34
|
* C++ implementation of PublicTxSimulator using pre-collected hints.
|
|
10
35
|
* This implementation runs TS simulation first to collect all hints,
|
|
@@ -13,7 +38,7 @@ import type { MeasuredPublicTxSimulatorInterface, PublicTxSimulatorInterface } f
|
|
|
13
38
|
*/
|
|
14
39
|
export declare class CppPublicTxSimulatorHintedDbs extends PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
15
40
|
protected log: Logger;
|
|
16
|
-
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, config?: Partial<
|
|
41
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, config?: Partial<PublicSimulatorConfig>);
|
|
17
42
|
/**
|
|
18
43
|
* Simulate a transaction's public portion using the C++ vm2 simulator with hinted DBs.
|
|
19
44
|
*
|
|
@@ -35,7 +60,7 @@ export declare class CppPublicTxSimulatorHintedDbs extends PublicTxSimulator imp
|
|
|
35
60
|
*/
|
|
36
61
|
export declare class MeasuredCppPublicTxSimulatorHintedDbs extends CppPublicTxSimulatorHintedDbs implements MeasuredPublicTxSimulatorInterface {
|
|
37
62
|
protected readonly metrics: ExecutorMetricsInterface;
|
|
38
|
-
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, metrics: ExecutorMetricsInterface, config?: Partial<
|
|
63
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, metrics: ExecutorMetricsInterface, config?: Partial<PublicSimulatorConfig>);
|
|
39
64
|
simulate(tx: Tx, txLabel?: string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FRDs7Ozs7O0dBTUc7QUFDSCxxQkFBYSxxQ0FDWCxTQUFRLDZCQUNSLFlBQVcsa0NBQWtDO0lBTTNDLFNBQVMsQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFFLHdCQUF3QjtJQUp0RCxZQUNFLFVBQVUsRUFBRSx5QkFBeUIsRUFDckMsV0FBVyxFQUFFLGlCQUFpQixFQUM5QixlQUFlLEVBQUUsZUFBZSxFQUNiLE9BQU8sRUFBRSx3QkFBd0IsRUFDcEQsTUFBTSxDQUFDLEVBQUUsT0FBTyxDQUFDLHFCQUFxQixDQUFDLEVBR3hDO0lBRXFCLFFBQVEsQ0FBQyxFQUFFLEVBQUUsRUFBRSxFQUFFLE9BQU8sR0FBRSxNQUFzQixHQUFHLE9BQU8sQ0FBQyxjQUFjLENBQUMsQ0FTL0Y7Q0FDRiJ9
|
|
@@ -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;AAIlE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,
|
|
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,KAAK,qBAAqB,EAC1B,cAAc,EAEf,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,MA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GAAG,OAAO,CAAC,cAAc,CAAC,CA8C9D;CACF;AAED;;;;;;GAMG;AACH,qBAAa,qCACX,SAAQ,6BACR,YAAW,kCAAkC;IAM3C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB;IAJtD,YACE,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EACb,OAAO,EAAE,wBAAwB,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAGxC;IAEqB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAS/F;CACF"}
|
|
@@ -1,8 +1,133 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { writeTestData } from '@aztec/foundation/testing/files';
|
|
3
|
+
import { avmSimulate, avmSimulateWithHintedDbs } from '@aztec/native';
|
|
4
|
+
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
5
|
+
import { AvmCircuitInputs, AvmFastSimulationInputs, AvmTxHint, PublicTxResult, deserializeFromMessagePack } from '@aztec/stdlib/avm';
|
|
4
6
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
7
|
+
import { WorldStateRevisionWithHandle } from '@aztec/stdlib/world-state';
|
|
8
|
+
import { strict as assert } from 'assert';
|
|
9
|
+
import { ContractProviderForCpp } from './contract_provider_for_cpp.js';
|
|
5
10
|
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
11
|
+
/**
|
|
12
|
+
* C++ implementation of PublicTxSimulator using the C++ simulator.
|
|
13
|
+
* The C++ simulator accesses the world state directly/natively within C++.
|
|
14
|
+
* For contract DB accesses, it makes callbacks through NAPI back to the TS PublicContractsDB cache.
|
|
15
|
+
*
|
|
16
|
+
* TODO(dbanks12): for now this still simulates first in TS to generate hints and public inputs,
|
|
17
|
+
* since the C++ simulator doesn't have hinting & PI generation logic yet.
|
|
18
|
+
*/ export class CppPublicTxSimulator extends PublicTxSimulator {
|
|
19
|
+
log;
|
|
20
|
+
constructor(merkleTree, contractsDB, globalVariables, config){
|
|
21
|
+
super(merkleTree, contractsDB, globalVariables, config);
|
|
22
|
+
this.log = createLogger(`simulator:cpp_public_tx_simulator`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Simulate a transaction's public portion using the C++ avvm simulator.
|
|
26
|
+
*
|
|
27
|
+
* @param tx - The transaction to simulate.
|
|
28
|
+
* @returns The result of the transaction's public execution.
|
|
29
|
+
*/ async simulate(tx) {
|
|
30
|
+
const txHash = this.computeTxHash(tx);
|
|
31
|
+
this.log.debug(`C++ simulation of ${tx.publicFunctionCalldata.length} public calls for tx ${txHash}`, {
|
|
32
|
+
txHash
|
|
33
|
+
});
|
|
34
|
+
// TODO(dbanks12): remove the first run with TS that hints!
|
|
35
|
+
// Run TS simulation to generate hints and public inputs
|
|
36
|
+
this.log.debug(`Running TS simulation for tx ${txHash}`);
|
|
37
|
+
// create checkpoint for ws
|
|
38
|
+
let tsResult;
|
|
39
|
+
let tsStateRef;
|
|
40
|
+
await this.merkleTree.createCheckpoint();
|
|
41
|
+
this.contractsDB.createCheckpoint();
|
|
42
|
+
try {
|
|
43
|
+
// Run the full TypeScript simulation using the parent class
|
|
44
|
+
// This will modify the merkle tree with the transaction's state changes
|
|
45
|
+
tsResult = await super.simulate(tx);
|
|
46
|
+
this.log.debug(`TS simulation completed for tx ${txHash}`);
|
|
47
|
+
tsStateRef = await this.merkleTree.getStateReference(); // capture tree roots for later comparsion
|
|
48
|
+
} catch (error) {
|
|
49
|
+
this.log.warn(`TS simulation failed, but still continuing with C++ simulation: ${error.message} ${error.stack}`);
|
|
50
|
+
} finally{
|
|
51
|
+
// revert checkpoint for ws and clear contract db changes
|
|
52
|
+
// (cpp should reapply exactly the same changes if there are no bugs)
|
|
53
|
+
await this.merkleTree.revertCheckpoint();
|
|
54
|
+
this.contractsDB.revertCheckpoint();
|
|
55
|
+
}
|
|
56
|
+
this.log.debug(`Running C++ simulation for tx ${txHash}`);
|
|
57
|
+
// Using the "as WorldStateRevisionWithHandle" is a bit of a "trust me bro", hence the assert.
|
|
58
|
+
let wsRevision = this.merkleTree.getRevision();
|
|
59
|
+
assert(wsRevision instanceof WorldStateRevisionWithHandle, 'CppPublicTxSimulator a real NativeWorldStateInstance with a handle to the C++ WorldState object');
|
|
60
|
+
const wsCppHandle = wsRevision.handle;
|
|
61
|
+
wsRevision = wsRevision.toWorldStateRevision(); // for msgpack serialization, we don't include the handle in the type
|
|
62
|
+
this.log.debug(`Running C++ simulation with world state revision ${JSON.stringify(wsRevision)}`);
|
|
63
|
+
// Create the fast simulation inputs
|
|
64
|
+
const txHint = AvmTxHint.fromTx(tx, this.globalVariables.gasFees);
|
|
65
|
+
const protocolContracts = ProtocolContractsList;
|
|
66
|
+
const fastSimInputs = new AvmFastSimulationInputs(wsRevision, this.config, txHint, this.globalVariables, protocolContracts);
|
|
67
|
+
// Create contract provider for callbacks to TypeScript PublicContractsDB from C++
|
|
68
|
+
const contractProvider = new ContractProviderForCpp(this.contractsDB, this.globalVariables);
|
|
69
|
+
// Serialize to msgpack and call the C++ simulator
|
|
70
|
+
this.log.verbose(`Serializing fast simulation inputs to msgpack...`);
|
|
71
|
+
const inputBuffer = fastSimInputs.serializeWithMessagePack();
|
|
72
|
+
let resultBuffer;
|
|
73
|
+
try {
|
|
74
|
+
this.log.verbose(`Calling C++ simulator for tx ${txHash}`);
|
|
75
|
+
resultBuffer = await avmSimulate(inputBuffer, contractProvider, wsCppHandle);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
throw new SimulationError(`C++ simulation failed: ${error.message}`, []);
|
|
78
|
+
}
|
|
79
|
+
// If we've reached this point, C++ succeeded during simulation,
|
|
80
|
+
// so we assert that TS also succeeded.
|
|
81
|
+
assert(tsResult !== undefined, 'TS simulation should have succeeded if C++ succeeded');
|
|
82
|
+
assert(tsStateRef !== undefined, 'TS state reference should have been captured if C++ succeeded');
|
|
83
|
+
// Deserialize the msgpack result
|
|
84
|
+
this.log.verbose(`Deserializing C++ from buffer (size: ${resultBuffer.length})...`);
|
|
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);
|
|
88
|
+
this.log.verbose(`Deserializing C++ result to PublicTxResult...`);
|
|
89
|
+
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
90
|
+
this.log.verbose(`Done.`);
|
|
91
|
+
// TODO(fcarreiro): complete this.
|
|
92
|
+
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
93
|
+
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
94
|
+
assert(cppResult.gasUsed.publicGas.equals(tsResult.gasUsed.publicGas));
|
|
95
|
+
assert(cppResult.gasUsed.teardownGas.equals(tsResult.gasUsed.teardownGas));
|
|
96
|
+
assert(cppResult.gasUsed.billedGas.equals(tsResult.gasUsed.billedGas));
|
|
97
|
+
assert(cppResult.publicInputs.toBuffer().equals(tsResult.publicInputs.toBuffer()));
|
|
98
|
+
if (this.config?.collectCallMetadata) {
|
|
99
|
+
assert(cppResult.appLogicReturnValues.length == tsResult.appLogicReturnValues.length);
|
|
100
|
+
assert(cppResult.appLogicReturnValues.every((v, i)=>v.equals(tsResult.appLogicReturnValues[i])));
|
|
101
|
+
}
|
|
102
|
+
// Confirm that tree roots match
|
|
103
|
+
const cppStateRef = await this.merkleTree.getStateReference();
|
|
104
|
+
assert(cppStateRef.equals(tsStateRef), `Tree roots mismatch between TS and C++ public simulations for tx ${txHash}`);
|
|
105
|
+
this.log.debug(`C++ simulation completed for tx ${txHash}`, {
|
|
106
|
+
txHash,
|
|
107
|
+
reverted: !tsResult.revertCode.isOK(),
|
|
108
|
+
tsGasUsed: tsResult.gasUsed.totalGas.l2Gas,
|
|
109
|
+
cppGasUsed: tsResult.gasUsed.totalGas.l2Gas
|
|
110
|
+
});
|
|
111
|
+
// TODO(dbanks12): C++ should return PublicTxResult (or something similar)
|
|
112
|
+
return tsResult;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export class MeasuredCppPublicTxSimulator extends CppPublicTxSimulator {
|
|
116
|
+
metrics;
|
|
117
|
+
constructor(merkleTree, contractsDB, globalVariables, metrics, config){
|
|
118
|
+
super(merkleTree, contractsDB, globalVariables, config), this.metrics = metrics;
|
|
119
|
+
}
|
|
120
|
+
async simulate(tx, txLabel = 'unlabeledTx') {
|
|
121
|
+
this.metrics.startRecordingTxSimulation(txLabel);
|
|
122
|
+
let result;
|
|
123
|
+
try {
|
|
124
|
+
result = await super.simulate(tx);
|
|
125
|
+
} finally{
|
|
126
|
+
this.metrics.stopRecordingTxSimulation(txLabel, result?.gasUsed, result?.revertCode);
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
6
131
|
/**
|
|
7
132
|
* C++ implementation of PublicTxSimulator using pre-collected hints.
|
|
8
133
|
* This implementation runs TS simulation first to collect all hints,
|
|
@@ -30,19 +155,12 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
30
155
|
});
|
|
31
156
|
// First, run TS simulation to generate hints and public inputs
|
|
32
157
|
this.log.debug(`Running TS simulation for tx ${txHash}`);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
tsResult = await super.simulate(tx);
|
|
38
|
-
this.log.debug(`TS simulation succeeded for tx ${txHash}`);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
// If TS simulation fails, clear any partial contract additions and re-throw the error
|
|
41
|
-
this.contractsDB.clearContractsForTx();
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
158
|
+
// Run the full TypeScript simulation using the parent class
|
|
159
|
+
// This will modify the merkle tree with the transaction's state changes
|
|
160
|
+
const tsResult = await super.simulate(tx);
|
|
161
|
+
this.log.debug(`TS simulation succeeded for tx ${txHash}`);
|
|
44
162
|
// Extract the full AvmCircuitInputs from the TS result
|
|
45
|
-
const avmCircuitInputs = tsResult.
|
|
163
|
+
const avmCircuitInputs = new AvmCircuitInputs(tsResult.hints, tsResult.publicInputs);
|
|
46
164
|
// Second, run C++ simulation with hinted DBs
|
|
47
165
|
this.log.debug(`Running C++ simulation with hinted DBs for tx ${txHash}`);
|
|
48
166
|
// Serialize to msgpack and call the C++ simulator
|
|
@@ -54,14 +172,17 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
54
172
|
throw new SimulationError(`C++ hinted simulation failed: ${error.message}`, []);
|
|
55
173
|
}
|
|
56
174
|
// Deserialize the msgpack result
|
|
57
|
-
const
|
|
175
|
+
const cppResultJSON = deserializeFromMessagePack(resultBuffer);
|
|
176
|
+
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
177
|
+
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
178
|
+
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
58
179
|
this.log.debug(`C++ hinted simulation completed for tx ${txHash}`, {
|
|
59
180
|
txHash,
|
|
60
181
|
reverted: !tsResult.revertCode.isOK(),
|
|
61
182
|
tsGasUsed: tsResult.gasUsed.totalGas.l2Gas,
|
|
62
183
|
cppGasUsed: tsResult.gasUsed.totalGas.l2Gas
|
|
63
184
|
});
|
|
64
|
-
// TODO(
|
|
185
|
+
// TODO(fcarreiro): complete this.
|
|
65
186
|
return tsResult;
|
|
66
187
|
}
|
|
67
188
|
}
|
|
@@ -82,7 +203,7 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
82
203
|
try {
|
|
83
204
|
result = await super.simulate(tx);
|
|
84
205
|
} finally{
|
|
85
|
-
this.metrics.stopRecordingTxSimulation(txLabel, result?.revertCode);
|
|
206
|
+
this.metrics.stopRecordingTxSimulation(txLabel, result?.gasUsed, result?.revertCode);
|
|
86
207
|
}
|
|
87
208
|
return result;
|
|
88
209
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './public_tx_simulator.js';
|
|
2
2
|
export type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
3
3
|
export { TelemetryPublicTxSimulator } from './telemetry_public_tx_simulator.js';
|
|
4
|
-
|
|
4
|
+
export type { PublicTxResult, PublicSimulatorConfig as PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMvcHVibGljX3R4X3NpbXVsYXRvci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLFlBQVksRUFBRSwwQkFBMEIsRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBQ3JGLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBQ2hGLFlBQVksRUFBRSxjQUFjLEVBQUUscUJBQXFCLElBQUksdUJBQXVCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,qBAAqB,IAAI,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
3
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
4
5
|
import { type GlobalVariables, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
@@ -7,18 +8,24 @@ import type { ExecutorMetricsInterface } from '../executor_metrics_interface.js'
|
|
|
7
8
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
8
9
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
9
10
|
import { PublicTxContext } from './public_tx_context.js';
|
|
10
|
-
import {
|
|
11
|
+
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
11
12
|
import type { MeasuredPublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
12
13
|
/**
|
|
13
14
|
* A public tx simulator that tracks miscellaneous simulation metrics without telemetry.
|
|
14
15
|
*/
|
|
15
16
|
export declare class MeasuredPublicTxSimulator extends PublicTxSimulator implements MeasuredPublicTxSimulatorInterface {
|
|
16
17
|
protected readonly metrics: ExecutorMetricsInterface;
|
|
17
|
-
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, metrics: ExecutorMetricsInterface, config?: Partial<
|
|
18
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, metrics: ExecutorMetricsInterface, config?: Partial<PublicSimulatorConfig>);
|
|
18
19
|
simulate(tx: Tx, txLabel?: string): Promise<PublicTxResult>;
|
|
19
|
-
protected insertNonRevertiblesFromPrivate(context: PublicTxContext
|
|
20
|
-
protected insertRevertiblesFromPrivate(context: PublicTxContext
|
|
21
|
-
protected simulatePhase(phase: TxExecutionPhase, context: PublicTxContext): Promise<
|
|
20
|
+
protected insertNonRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
21
|
+
protected insertRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
22
|
+
protected simulatePhase(phase: TxExecutionPhase, context: PublicTxContext): Promise<{
|
|
23
|
+
phase: TxExecutionPhase;
|
|
24
|
+
durationMs?: number | undefined;
|
|
25
|
+
returnValues: import("@aztec/stdlib/tx").NestedProcessReturnValues[];
|
|
26
|
+
reverted: boolean;
|
|
27
|
+
revertReason?: import("../../../../stdlib/dest/errors/simulation_error.js").SimulationError | undefined;
|
|
28
|
+
}>;
|
|
22
29
|
protected simulateEnqueuedCallInternal(stateManager: PublicPersistableStateManager, callRequest: PublicCallRequestWithCalldata, allocatedGas: Gas, transactionFee: Fr, fnName: string): Promise<AvmFinalizedCallResult>;
|
|
23
30
|
}
|
|
24
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVhc3VyZWRfcHVibGljX3R4X3NpbXVsYXRvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3B1YmxpYy9wdWJsaWNfdHhfc2ltdWxhdG9yL21lYXN1cmVkX3B1YmxpY190eF9zaW11bGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFbkQsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUJBQW1CLENB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xFQUFFLEVBQUUsRUFBRSxPQUFPLEdBQUUsTUFBc0IsR0FBRyxPQUFPLENBQUMsY0FBYyxDQUFDLENBUy9GO0lBRUQsVUFBeUIsK0JBQStCLENBQUMsT0FBTyxFQUFFLGVBQWUsaUJBSWhGO0lBRUQsVUFBeUIsNEJBQTRCLENBQUMsT0FBTyxFQUFFLGVBQWUsaUJBSTdFO0lBRUQsVUFBeUIsYUFBYSxDQUFDLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxPQUFPLEVBQUUsZUFBZTs7Ozs7O09BS3ZGO0lBRUQsVUFBeUIsNEJBQTRCLENBQ25ELFlBQVksRUFBRSw2QkFBNkIsRUFDM0MsV0FBVyxFQUFFLDZCQUE2QixFQUMxQyxZQUFZLEVBQUUsR0FBRyxFQUNqQixjQUFjLEVBQUUsRUFBRSxFQUNsQixNQUFNLEVBQUUsTUFBTSxHQUNiLE9BQU8sQ0FBQyxzQkFBc0IsQ0FBQyxDQXFDakM7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measured_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/measured_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,6BAA6B,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE7G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"measured_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/measured_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,6BAA6B,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE7G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAC;AAE7F;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,iBAAkB,YAAW,kCAAkC;IAK1G,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB;IAJtD,YACE,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EACb,OAAO,EAAE,wBAAwB,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAGxC;IAEqB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAS/F;IAED,UAAyB,+BAA+B,CAAC,OAAO,EAAE,eAAe,iBAIhF;IAED,UAAyB,4BAA4B,CAAC,OAAO,EAAE,eAAe,iBAI7E;IAED,UAAyB,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe;;;;;;OAKvF;IAED,UAAyB,4BAA4B,CACnD,YAAY,EAAE,6BAA6B,EAC3C,WAAW,EAAE,6BAA6B,EAC1C,YAAY,EAAE,GAAG,EACjB,cAAc,EAAE,EAAE,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC,CAqCjC;CACF"}
|
|
@@ -13,18 +13,18 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
13
13
|
try {
|
|
14
14
|
avmResult = await super.simulate(tx);
|
|
15
15
|
} finally{
|
|
16
|
-
this.metrics.stopRecordingTxSimulation(txLabel, avmResult?.revertCode);
|
|
16
|
+
this.metrics.stopRecordingTxSimulation(txLabel, avmResult?.gasUsed, avmResult?.revertCode);
|
|
17
17
|
}
|
|
18
18
|
return avmResult;
|
|
19
19
|
}
|
|
20
|
-
async insertNonRevertiblesFromPrivate(context
|
|
20
|
+
async insertNonRevertiblesFromPrivate(context) {
|
|
21
21
|
const timer = new Timer();
|
|
22
|
-
await super.insertNonRevertiblesFromPrivate(context
|
|
22
|
+
await super.insertNonRevertiblesFromPrivate(context);
|
|
23
23
|
this.metrics.recordPrivateEffectsInsertion(timer.us(), 'non-revertible');
|
|
24
24
|
}
|
|
25
|
-
async insertRevertiblesFromPrivate(context
|
|
25
|
+
async insertRevertiblesFromPrivate(context) {
|
|
26
26
|
const timer = new Timer();
|
|
27
|
-
await super.insertRevertiblesFromPrivate(context
|
|
27
|
+
await super.insertRevertiblesFromPrivate(context);
|
|
28
28
|
this.metrics.recordPrivateEffectsInsertion(timer.us(), 'revertible');
|
|
29
29
|
}
|
|
30
30
|
async simulatePhase(phase, context) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { AvmCircuitPublicInputs, RevertCode } from '@aztec/stdlib/avm';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { type ContractDeploymentData } from '@aztec/stdlib/contract';
|
|
4
5
|
import type { SimulationError } from '@aztec/stdlib/errors';
|
|
5
6
|
import { Gas } from '@aztec/stdlib/gas';
|
|
6
7
|
import { PrivateToPublicAccumulatedData } from '@aztec/stdlib/kernel';
|
|
@@ -25,6 +26,8 @@ export declare class PublicTxContext {
|
|
|
25
26
|
private readonly setupCallRequests;
|
|
26
27
|
private readonly appLogicCallRequests;
|
|
27
28
|
private readonly teardownCallRequests;
|
|
29
|
+
readonly nonRevertibleContractDeploymentData: ContractDeploymentData;
|
|
30
|
+
readonly revertibleContractDeploymentData: ContractDeploymentData;
|
|
28
31
|
readonly nonRevertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData;
|
|
29
32
|
readonly revertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData;
|
|
30
33
|
readonly feePayer: AztecAddress;
|
|
@@ -36,7 +39,7 @@ export declare class PublicTxContext {
|
|
|
36
39
|
private revertCode;
|
|
37
40
|
revertReason: SimulationError | undefined;
|
|
38
41
|
private constructor();
|
|
39
|
-
static create(treesDB: PublicTreesDB, contractsDB: PublicContractsDBInterface, tx: Tx, globalVariables: GlobalVariables, protocolContracts: ProtocolContracts,
|
|
42
|
+
static create(treesDB: PublicTreesDB, contractsDB: PublicContractsDBInterface, tx: Tx, globalVariables: GlobalVariables, protocolContracts: ProtocolContracts, proverId: Fr): Promise<PublicTxContext>;
|
|
40
43
|
/**
|
|
41
44
|
* Signal that the entire transaction execution is done.
|
|
42
45
|
* All phases have been processed.
|
|
@@ -124,4 +127,4 @@ declare class PhaseStateManager {
|
|
|
124
127
|
discardForkedState(): Promise<void>;
|
|
125
128
|
}
|
|
126
129
|
export {};
|
|
127
|
-
//# sourceMappingURL=
|
|
130
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3R4X2NvbnRleHQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMvcHVibGljX3R4X3NpbXVsYXRvci9wdWJsaWNfdHhfY29udGV4dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFOUMsT0FBTyxFQUdMLHNCQUFzQixFQUV0QixVQUFVLEVBQ1gsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQixPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQTZCLEtBQUssc0JBQXNCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUNoRyxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUU1RCxPQUFPLEVBQUUsR0FBRyxFQUFlLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxFQUdMLDhCQUE4QixFQUkvQixNQUFNLHNCQUFzQixDQUFDO0FBSTlCLE9BQU8sRUFDTCxLQUFLLGVBQWUsRUFDcEIsaUJBQWlCLEVBQ2pCLDZCQUE2QixFQUU3QixLQUFLLEVBQUUsRUFDUCxnQkFBZ0IsRUFDaEIsS0FBSyxNQUFNLEVBQ1osTUFBTSxrQkFBa0IsQ0FBQztBQUsxQixPQUFPLEtBQUssRUFBRSwwQkFBMEIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3RFLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLHlCQUF5QixDQ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AEP;IAEK,gBAAgB,kBAMrB;IAEK,kBAAkB,kBAMvB;CACF"}
|
|
@@ -3,6 +3,7 @@ import { padArrayEnd } from '@aztec/foundation/collection';
|
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
5
|
import { AvmAccumulatedData, AvmAccumulatedDataArrayLengths, AvmCircuitPublicInputs, PublicDataWrite, RevertCode } from '@aztec/stdlib/avm';
|
|
6
|
+
import { AllContractDeploymentData } from '@aztec/stdlib/contract';
|
|
6
7
|
import { computeEffectiveGasFees, computeTransactionFee } from '@aztec/stdlib/fees';
|
|
7
8
|
import { Gas } from '@aztec/stdlib/gas';
|
|
8
9
|
import { PrivateToAvmAccumulatedData, PrivateToAvmAccumulatedDataArrayLengths, PublicCallRequest, PublicCallRequestArrayLengths, countAccumulatedItems } from '@aztec/stdlib/kernel';
|
|
@@ -31,6 +32,8 @@ import { getCallRequestsWithCalldataByPhase } from '../utils.js';
|
|
|
31
32
|
setupCallRequests;
|
|
32
33
|
appLogicCallRequests;
|
|
33
34
|
teardownCallRequests;
|
|
35
|
+
nonRevertibleContractDeploymentData;
|
|
36
|
+
revertibleContractDeploymentData;
|
|
34
37
|
nonRevertibleAccumulatedDataFromPrivate;
|
|
35
38
|
revertibleAccumulatedDataFromPrivate;
|
|
36
39
|
feePayer;
|
|
@@ -41,7 +44,7 @@ import { getCallRequestsWithCalldataByPhase } from '../utils.js';
|
|
|
41
44
|
/* Entire transaction execution is done. */ halted;
|
|
42
45
|
/* Where did reverts happen (if at all)? */ revertCode;
|
|
43
46
|
/* What caused a revert (if one occurred)? */ revertReason;
|
|
44
|
-
constructor(txHash, state, startTreeSnapshots, globalVariables, protocolContracts, proverId, gasSettings, gasUsedByPrivate, gasAllocatedToPublic, gasAllocatedToPublicTeardown, setupCallRequests, appLogicCallRequests, teardownCallRequests, nonRevertibleAccumulatedDataFromPrivate, revertibleAccumulatedDataFromPrivate, feePayer, trace){
|
|
47
|
+
constructor(txHash, state, startTreeSnapshots, globalVariables, protocolContracts, proverId, gasSettings, gasUsedByPrivate, gasAllocatedToPublic, gasAllocatedToPublicTeardown, setupCallRequests, appLogicCallRequests, teardownCallRequests, nonRevertibleContractDeploymentData, revertibleContractDeploymentData, nonRevertibleAccumulatedDataFromPrivate, revertibleAccumulatedDataFromPrivate, feePayer, trace){
|
|
45
48
|
this.txHash = txHash;
|
|
46
49
|
this.state = state;
|
|
47
50
|
this.startTreeSnapshots = startTreeSnapshots;
|
|
@@ -55,6 +58,8 @@ import { getCallRequestsWithCalldataByPhase } from '../utils.js';
|
|
|
55
58
|
this.setupCallRequests = setupCallRequests;
|
|
56
59
|
this.appLogicCallRequests = appLogicCallRequests;
|
|
57
60
|
this.teardownCallRequests = teardownCallRequests;
|
|
61
|
+
this.nonRevertibleContractDeploymentData = nonRevertibleContractDeploymentData;
|
|
62
|
+
this.revertibleContractDeploymentData = revertibleContractDeploymentData;
|
|
58
63
|
this.nonRevertibleAccumulatedDataFromPrivate = nonRevertibleAccumulatedDataFromPrivate;
|
|
59
64
|
this.revertibleAccumulatedDataFromPrivate = revertibleAccumulatedDataFromPrivate;
|
|
60
65
|
this.feePayer = feePayer;
|
|
@@ -65,17 +70,20 @@ import { getCallRequestsWithCalldataByPhase } from '../utils.js';
|
|
|
65
70
|
this.revertCode = RevertCode.OK;
|
|
66
71
|
this.log = createLogger(`simulator:public_tx_context`);
|
|
67
72
|
}
|
|
68
|
-
static async create(treesDB, contractsDB, tx, globalVariables, protocolContracts,
|
|
73
|
+
static async create(treesDB, contractsDB, tx, globalVariables, protocolContracts, proverId) {
|
|
74
|
+
const contractDeploymentData = AllContractDeploymentData.fromTx(tx);
|
|
75
|
+
const nonRevertibleContractDeploymentData = contractDeploymentData.getNonRevertibleContractDeploymentData();
|
|
76
|
+
const revertibleContractDeploymentData = contractDeploymentData.getRevertibleContractDeploymentData();
|
|
69
77
|
const nonRevertibleAccumulatedDataFromPrivate = tx.data.forPublic.nonRevertibleAccumulatedData;
|
|
70
78
|
const trace = new SideEffectTrace();
|
|
71
79
|
const firstNullifier = nonRevertibleAccumulatedDataFromPrivate.nullifiers[0];
|
|
72
80
|
// Transaction level state manager that will be forked for revertible phases.
|
|
73
|
-
const txStateManager = PublicPersistableStateManager.create(treesDB, contractsDB, trace,
|
|
81
|
+
const txStateManager = PublicPersistableStateManager.create(treesDB, contractsDB, trace, firstNullifier, globalVariables.timestamp);
|
|
74
82
|
const gasSettings = tx.data.constants.txContext.gasSettings;
|
|
75
83
|
const gasUsedByPrivate = tx.data.gasUsed;
|
|
76
84
|
const gasAllocatedToPublic = gasSettings.gasLimits.sub(gasUsedByPrivate);
|
|
77
85
|
const gasAllocatedToPublicTeardown = gasSettings.teardownGasLimits;
|
|
78
|
-
return new PublicTxContext(tx.getTxHash(), new PhaseStateManager(txStateManager), await txStateManager.getTreeSnapshots(), globalVariables, protocolContracts, proverId, gasSettings, gasUsedByPrivate, gasAllocatedToPublic, gasAllocatedToPublicTeardown, getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.SETUP), getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.APP_LOGIC), getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.TEARDOWN), tx.data.forPublic.nonRevertibleAccumulatedData, tx.data.forPublic.revertibleAccumulatedData, tx.data.feePayer, trace);
|
|
86
|
+
return new PublicTxContext(tx.getTxHash(), new PhaseStateManager(txStateManager), await txStateManager.getTreeSnapshots(), globalVariables, protocolContracts, proverId, gasSettings, gasUsedByPrivate, gasAllocatedToPublic, gasAllocatedToPublicTeardown, getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.SETUP), getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.APP_LOGIC), getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.TEARDOWN), nonRevertibleContractDeploymentData, revertibleContractDeploymentData, tx.data.forPublic.nonRevertibleAccumulatedData, tx.data.forPublic.revertibleAccumulatedData, tx.data.feePayer, trace);
|
|
79
87
|
}
|
|
80
88
|
/**
|
|
81
89
|
* Signal that the entire transaction execution is done.
|