Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
simulation_helper.cpp
Go to the documentation of this file.
2
3#include <cstdint>
4
10
23
24// Events.
47
48// Gadgets.
77
78// Standalone.
95
96namespace bb::avm2 {
97
98using namespace bb::avm2::simulation;
99
100namespace {
101
102PublicTxEffect extract_public_tx_effect(const TxExecutionResult& tx_execution_result,
104{
105 PublicTxEffect public_tx_effect;
106 const auto& side_effects = side_effect_tracker.get_side_effects();
107 public_tx_effect.transaction_fee = tx_execution_result.transaction_fee;
108 public_tx_effect.note_hashes = side_effects.note_hashes;
109 public_tx_effect.nullifiers = side_effects.nullifiers;
110 public_tx_effect.l2_to_l1_msgs = side_effects.l2_to_l1_messages;
111 public_tx_effect.public_logs = side_effects.public_logs.to_logs();
112
113 // We need to copy the storage writes slot to value in the order of the slots by insertion.
114 const size_t num_storage_writes = side_effects.storage_writes_slots_by_insertion.size();
115 public_tx_effect.public_data_writes.reserve(num_storage_writes);
116 for (size_t i = 0; i < num_storage_writes; i++) {
117 const auto& slot = side_effects.storage_writes_slots_by_insertion[i];
118 const auto& value = side_effects.storage_writes_slot_to_value.at(slot);
119 public_tx_effect.public_data_writes.push_back(PublicDataWrite{ .leaf_slot = slot, .value = value });
120 }
121
122 return public_tx_effect;
123}
124
125} // namespace
126
127// Internal helper function for event-generating simulation (with full gadgets).
128// NOTE: Some of the config parameters are ignored in this function.
129template <template <typename> class DefaultEventEmitter, template <typename> class DefaultDeduplicatingEventEmitter>
131 ContractDBInterface& raw_contract_db,
132 LowLevelMerkleDBInterface& raw_merkle_db,
133 const PublicSimulatorConfig& config,
134 const Tx& tx,
135 const GlobalVariables& global_variables,
136 const ProtocolContracts& protocol_contracts)
137{
138 BB_BENCH_NAME("AvmSimulationHelper::simulate_for_witgen_internal");
139
140 DefaultEventEmitter<ExecutionEvent> execution_emitter;
141 DefaultDeduplicatingEventEmitter<AluEvent> alu_emitter;
142 DefaultDeduplicatingEventEmitter<BitwiseEvent> bitwise_emitter;
143 DefaultEventEmitter<DataCopyEvent> data_copy_emitter;
144 DefaultEventEmitter<MemoryEvent> memory_emitter;
145 DefaultEventEmitter<BytecodeRetrievalEvent> bytecode_retrieval_emitter;
146 DefaultEventEmitter<BytecodeHashingEvent> bytecode_hashing_emitter;
147 DefaultEventEmitter<BytecodeDecompositionEvent> bytecode_decomposition_emitter;
148 DefaultDeduplicatingEventEmitter<InstructionFetchingEvent> instruction_fetching_emitter;
149 DefaultEventEmitter<AddressDerivationEvent> address_derivation_emitter;
150 DefaultEventEmitter<ClassIdDerivationEvent> class_id_derivation_emitter;
151 DefaultEventEmitter<Sha256CompressionEvent> sha256_compression_emitter;
152 DefaultEventEmitter<EccAddEvent> ecc_add_emitter;
153 DefaultEventEmitter<ScalarMulEvent> scalar_mul_emitter;
154 DefaultEventEmitter<EccAddMemoryEvent> ecc_add_memory_emitter;
155 DefaultEventEmitter<Poseidon2HashEvent> poseidon2_hash_emitter;
156 DefaultEventEmitter<Poseidon2PermutationEvent> poseidon2_perm_emitter;
157 DefaultEventEmitter<Poseidon2PermutationMemoryEvent> poseidon2_perm_mem_emitter;
158 DefaultEventEmitter<KeccakF1600Event> keccakf1600_emitter;
159 DefaultEventEmitter<ToRadixEvent> to_radix_emitter;
160 DefaultEventEmitter<ToRadixMemoryEvent> to_radix_memory_emitter;
161 DefaultDeduplicatingEventEmitter<FieldGreaterThanEvent> field_gt_emitter;
162 DefaultEventEmitter<MerkleCheckEvent> merkle_check_emitter;
163 DefaultDeduplicatingEventEmitter<RangeCheckEvent> range_check_emitter;
164 DefaultEventEmitter<ContextStackEvent> context_stack_emitter;
165 DefaultEventEmitter<PublicDataTreeCheckEvent> public_data_tree_check_emitter;
166 DefaultEventEmitter<UpdateCheckEvent> update_check_emitter;
167 DefaultEventEmitter<IndexedTreeCheckEvent> indexed_tree_check_emitter;
168 DefaultEventEmitter<TxEvent> tx_event_emitter;
169 DefaultEventEmitter<CalldataEvent> calldata_emitter;
170 DefaultEventEmitter<InternalCallStackEvent> internal_call_stack_emitter;
171 DefaultEventEmitter<NoteHashTreeCheckEvent> note_hash_tree_check_emitter;
172 DefaultDeduplicatingEventEmitter<GreaterThanEvent> greater_than_emitter;
173 DefaultEventEmitter<ContractInstanceRetrievalEvent> contract_instance_retrieval_emitter;
174 DefaultEventEmitter<GetContractInstanceEvent> get_contract_instance_emitter;
175 DefaultEventEmitter<L1ToL2MessageTreeCheckEvent> l1_to_l2_msg_tree_check_emitter;
176 DefaultEventEmitter<EmitPublicLogEvent> emit_public_log_emitter;
177
181 GreaterThan greater_than(field_gt, range_check, greater_than_emitter);
182 ToRadix to_radix(execution_id_manager, greater_than, to_radix_emitter, to_radix_memory_emitter);
184 execution_id_manager, greater_than, poseidon2_hash_emitter, poseidon2_perm_emitter, poseidon2_perm_mem_emitter);
186
187 PublicDataTreeCheck public_data_tree_check(
188 poseidon2, merkle_check, field_gt, execution_id_manager, public_data_tree_check_emitter);
190 poseidon2, merkle_check, field_gt, DOM_SEP__NULLIFIER_MERKLE, indexed_tree_check_emitter);
191 IndexedTreeCheck indexed_tree_check_written_slots(
192 poseidon2, merkle_check, field_gt, DOM_SEP__WRITTEN_SLOTS_MERKLE, indexed_tree_check_emitter);
193 IndexedTreeCheck indexed_tree_check_retrieved_bytecodes(
195
198 RetrievedBytecodesTreeCheck retrieved_bytecodes_tree_check(indexed_tree_check_retrieved_bytecodes,
200
201 // The protocol requires at least one non-revertible nullifier in the transaction (used for uniqueness of note
202 // hashes).
203 if (tx.non_revertible_accumulated_data.nullifiers.empty()) {
204 throw std::runtime_error("Non-revertible nullifiers are empty in the transaction.");
205 }
206
208 tx.non_revertible_accumulated_data.nullifiers[0], poseidon2, merkle_check, note_hash_tree_check_emitter);
209 L1ToL2MessageTreeCheck l1_to_l2_msg_tree_check(merkle_check, l1_to_l2_msg_tree_check_emitter);
210 EmitPublicLog emit_public_log_component(execution_id_manager, greater_than, emit_public_log_emitter);
212 Bitwise bitwise(bitwise_emitter);
213 Sha256 sha256(execution_id_manager, bitwise, greater_than, sha256_compression_emitter);
215
216 Ecc ecc(execution_id_manager, greater_than, to_radix, ecc_add_emitter, scalar_mul_emitter, ecc_add_memory_emitter);
217 AddressDerivation address_derivation(poseidon2, ecc, address_derivation_emitter);
218 ClassIdDerivation class_id_derivation(poseidon2, class_id_derivation_emitter);
219
220 ContractDB contract_db(raw_contract_db, address_derivation, class_id_derivation, protocol_contracts);
221
222 MerkleDB base_merkle_db(raw_merkle_db,
223 public_data_tree_check,
227 l1_to_l2_msg_tree_check);
228 base_merkle_db.add_checkpoint_listener(note_hash_tree_check);
229 base_merkle_db.add_checkpoint_listener(indexed_tree_check);
230 base_merkle_db.add_checkpoint_listener(public_data_tree_check);
231 // This one is only needed for events.
232 base_merkle_db.add_checkpoint_listener(emit_public_log_component);
233
234 // Side effect tracking is only strictly needed for logs and L2-to-L1 messages.
236
238 tx.non_revertible_accumulated_data.nullifiers[0], base_merkle_db, side_effect_tracker);
239
240 UpdateCheck update_check(poseidon2, range_check, greater_than, merkle_db, update_check_emitter, global_variables);
241
242 BytecodeHasher bytecode_hasher(poseidon2, bytecode_hashing_emitter);
244
246 contract_db, merkle_db, update_check, field_gt, protocol_contracts, contract_instance_retrieval_emitter);
247
248 TxBytecodeManager bytecode_manager(contract_db,
249 merkle_db,
254 bytecode_retrieval_emitter,
255 bytecode_decomposition_emitter,
256 instruction_fetching_emitter);
258
259 MemoryProvider memory_provider(range_check, execution_id_manager, memory_emitter);
260 CalldataHashingProvider calldata_hashing_provider(poseidon2, calldata_emitter);
261 InternalCallStackManagerProvider internal_call_stack_manager_provider(internal_call_stack_emitter);
262 ContextProvider context_provider(bytecode_manager,
263 memory_provider,
264 calldata_hashing_provider,
265 internal_call_stack_manager_provider,
266 merkle_db,
270 global_variables);
272
273 // Create GetContractInstance opcode component
275 execution_id_manager, merkle_db, get_contract_instance_emitter, contract_instance_manager);
276
277 NoopDebugLogger debug_log_component;
283
285 bitwise,
286 data_copy,
287 poseidon2,
288 ecc,
289 to_radix,
290 sha256,
291 execution_components,
295 execution_emitter,
296 context_stack_emitter,
300 emit_public_log_component,
301 debug_log_component,
302 merkle_db,
304
308 merkle_db,
312 field_gt,
313 poseidon2,
316
318 public_inputs_builder.extract_inputs(tx, global_variables, protocol_contracts, config.prover_id, raw_merkle_db);
319
320 TxExecutionResult tx_execution_result = tx_execution.simulate(tx);
321
322 public_inputs_builder.extract_outputs(raw_merkle_db,
323 // TODO(MW): Use of billed_gas is a bit misleading - we want public + private
324 // - teardown, which is stored as billed gas here/in ts:
325 tx_execution_result.gas_used.billed_gas,
326 tx_execution_result.transaction_fee,
327 tx_execution_result.revert_code != RevertCode::OK,
328 side_effect_tracker.get_side_effects());
329
330 public_data_tree_check.generate_ff_gt_events_for_squashing(
331 side_effect_tracker.get_side_effects().storage_writes_slots_by_insertion);
332
333 EventsContainer events = {
334 tx_event_emitter.dump_events(),
335 execution_emitter.dump_events(),
336 alu_emitter.dump_events(),
337 bitwise_emitter.dump_events(),
338 memory_emitter.dump_events(),
339 bytecode_retrieval_emitter.dump_events(),
340 bytecode_hashing_emitter.dump_events(),
341 bytecode_decomposition_emitter.dump_events(),
342 instruction_fetching_emitter.dump_events(),
343 address_derivation_emitter.dump_events(),
344 class_id_derivation_emitter.dump_events(),
345 sha256_compression_emitter.dump_events(),
346 ecc_add_emitter.dump_events(),
347 scalar_mul_emitter.dump_events(),
348 ecc_add_memory_emitter.dump_events(),
349 poseidon2_hash_emitter.dump_events(),
350 poseidon2_perm_emitter.dump_events(),
351 poseidon2_perm_mem_emitter.dump_events(),
352 keccakf1600_emitter.dump_events(),
353 to_radix_emitter.dump_events(),
354 to_radix_memory_emitter.dump_events(),
355 field_gt_emitter.dump_events(),
356 greater_than_emitter.dump_events(),
357 merkle_check_emitter.dump_events(),
358 range_check_emitter.dump_events(),
359 context_stack_emitter.dump_events(),
360 public_data_tree_check_emitter.dump_events(),
361 update_check_emitter.dump_events(),
362 indexed_tree_check_emitter.dump_events(),
363 data_copy_emitter.dump_events(),
364 calldata_emitter.dump_events(),
365 internal_call_stack_emitter.dump_events(),
366 note_hash_tree_check_emitter.dump_events(),
367 contract_instance_retrieval_emitter.dump_events(),
368 get_contract_instance_emitter.dump_events(),
369 l1_to_l2_msg_tree_check_emitter.dump_events(),
370 emit_public_log_emitter.dump_events(),
371 };
372
373 TxSimulationResult tx_simulation_result = {
374 .gas_used = tx_execution_result.gas_used,
375 .revert_code = tx_execution_result.revert_code,
376 .public_tx_effect = extract_public_tx_effect(tx_execution_result, side_effect_tracker),
377 .call_stack_metadata = call_stack_metadata_collector->dump_call_stack_metadata(),
378 .logs = debug_log_component.dump_logs(),
379 .public_inputs =
381 };
382
383 return { std::move(events), std::move(tx_simulation_result) };
384}
385
386// Internal helper function for fast simulation.
388 LowLevelMerkleDBInterface& raw_merkle_db,
389 const PublicSimulatorConfig& config,
390 const Tx& tx,
391 const GlobalVariables& global_variables,
392 const ProtocolContracts& protocol_contracts,
393 CancellationTokenPtr cancellation_token)
394{
395 BB_BENCH_NAME("AvmSimulationHelper::simulate_fast_internal");
396
397 NoopEventEmitter<ExecutionEvent> execution_emitter;
398 NoopEventEmitter<DataCopyEvent> data_copy_emitter;
399 NoopEventEmitter<EccAddEvent> ecc_add_emitter;
400 NoopEventEmitter<ScalarMulEvent> scalar_mul_emitter;
401 NoopEventEmitter<EccAddMemoryEvent> ecc_add_memory_emitter;
405 NoopEventEmitter<ContextStackEvent> context_stack_emitter;
407 NoopEventEmitter<InternalCallStackEvent> internal_call_stack_emitter;
408 NoopEventEmitter<ContractInstanceRetrievalEvent> contract_instance_retrieval_emitter;
409 NoopEventEmitter<GetContractInstanceEvent> get_contract_instance_emitter;
410 NoopEventEmitter<EmitPublicLogEvent> emit_public_log_emitter;
411 NoopEventEmitter<UpdateCheckEvent> update_check_emitter;
412 NoopEventEmitter<IndexedTreeCheckEvent> indexed_tree_check_emitter;
413
422 IndexedTreeCheck indexed_tree_check_retrieved_bytecodes(
424 RetrievedBytecodesTreeCheck retrieved_bytecodes_tree_check(indexed_tree_check_retrieved_bytecodes,
426 EmitPublicLog emit_public_log_component(execution_id_manager, greater_than, emit_public_log_emitter);
427 PureAlu alu;
431
432 Ecc ecc(execution_id_manager, greater_than, to_radix, ecc_add_emitter, scalar_mul_emitter, ecc_add_memory_emitter);
433
435 PureContractDB contract_db(raw_contract_db);
436
437 // The protocol requires at least one non-revertible nullifier in the transaction (used for uniqueness of note
438 // hashes).
439 if (tx.non_revertible_accumulated_data.nullifiers.empty()) {
440 throw std::runtime_error("Non-revertible nullifiers are empty in the transaction.");
441 }
442
444 tx.non_revertible_accumulated_data.nullifiers[0], raw_merkle_db, written_public_data_slots_tree_check);
446
447 tx.non_revertible_accumulated_data.nullifiers[0], base_merkle_db, side_effect_tracker);
448
451
453 contract_db, merkle_db, update_check, field_gt, protocol_contracts, contract_instance_retrieval_emitter);
455
457
458 PureMemoryProvider memory_provider;
459 NoopCalldataHashingProvider calldata_hashing_provider;
460 InternalCallStackManagerProvider internal_call_stack_manager_provider(internal_call_stack_emitter);
461 ContextProvider context_provider(tx_bytecode_manager,
462 memory_provider,
463 calldata_hashing_provider,
464 internal_call_stack_manager_provider,
465 merkle_db,
469 global_variables);
471
472 // Create GetContractInstance opcode component
474 execution_id_manager, merkle_db, get_contract_instance_emitter, contract_instance_manager);
475
477 if (config.collect_debug_logs) {
478 // TODO(fcarreiro): add debug log level?
479 const DebugLogLevel debug_log_level = DebugLogLevel::INFO;
480 return std::make_unique<DebugLogger>(debug_log_level,
482 [](const std::string& message) { vinfo(message); });
483 } else {
485 }
486 }();
492
494 bitwise,
495 data_copy,
496 poseidon2,
497 ecc,
498 to_radix,
499 sha256,
500 execution_components,
504 execution_emitter,
505 context_stack_emitter,
509 emit_public_log_component,
510 *debug_log_component,
511 merkle_db,
513 std::move(cancellation_token));
517 merkle_db,
521 field_gt,
522 poseidon2,
525 config.skip_fee_enforcement);
526
528 public_inputs_builder.extract_inputs(tx, global_variables, protocol_contracts, config.prover_id, raw_merkle_db);
529
530 // This triggers all the work.
531 TxExecutionResult tx_execution_result = tx_execution.simulate(tx);
532
533 public_inputs_builder.extract_outputs(raw_merkle_db,
534 // TODO(MW): Use of billed_gas is a bit misleading - we want public + private
535 // - teardown, which is stored as billed gas here/in ts:
536 tx_execution_result.gas_used.billed_gas,
537 tx_execution_result.transaction_fee,
538 tx_execution_result.revert_code != RevertCode::OK,
539 side_effect_tracker.get_side_effects());
540
541 return {
542 // Simulation.
543 .gas_used = tx_execution_result.gas_used,
544 .revert_code = tx_execution_result.revert_code,
545 .public_tx_effect = extract_public_tx_effect(tx_execution_result, side_effect_tracker),
546 .call_stack_metadata = call_stack_metadata_collector->dump_call_stack_metadata(),
547 .logs = debug_log_component->dump_logs(),
548 // Proving request data.
549 .public_inputs =
551 .hints = std::nullopt, // NOTE: hints are injected by the caller.
552 };
553}
554
555/************************************
556 * Entry points
557 ************************************/
558
560 simulation::ContractDBInterface& raw_contract_db,
561 const world_state::WorldStateRevision& world_state_revision,
563 const PublicSimulatorConfig& config,
564 const Tx& tx,
565 const GlobalVariables& global_variables,
566 const ProtocolContracts& protocol_contracts,
567 CancellationTokenPtr cancellation_token)
568{
569 // For collecting hints, use the other method.
570 BB_ASSERT(!config.collect_hints && "Use simulate_for_hint_collection instead");
571
572 // Create PureRawMerkleDB with the provided WorldState instance and cancellation token
573 PureRawMerkleDB raw_merkle_db(world_state_revision, ws, /*cache_tree_roots=*/true, cancellation_token);
574
576 raw_contract_db, raw_merkle_db, config, tx, global_variables, protocol_contracts, cancellation_token);
577}
578
580 simulation::ContractDBInterface& raw_contract_db,
581 const world_state::WorldStateRevision& world_state_revision,
583 const PublicSimulatorConfig& config,
584 const Tx& tx,
585 const GlobalVariables& global_variables,
586 const ProtocolContracts& protocol_contracts,
587 CancellationTokenPtr cancellation_token)
588{
589 // If you are not collecting hints, don't use this method.
590 BB_ASSERT(config.collect_hints && "Use simulate_fast_with_existing_ws instead");
591
592 // Create PureRawMerkleDB with the provided WorldState instance and cancellation token
593 PureRawMerkleDB raw_merkle_db(world_state_revision, ws, /*cache_tree_roots=*/true, cancellation_token);
594
595 auto starting_tree_roots = raw_merkle_db.get_tree_roots();
597 HintingRawDB hinting_merkle_db(raw_merkle_db);
598
599 // We use NoopEventEmitters here because we don't want to collect events.
600 auto [/* unused */ events_, tx_result] = simulate_for_witgen_internal<NoopEventEmitter, NoopEventEmitter>(
601 hinting_contract_db, hinting_merkle_db, config, tx, global_variables, protocol_contracts);
602
603 ExecutionHints collected_hints = ExecutionHints{ .global_variables = global_variables,
604 .tx = tx,
605 .protocol_contracts = protocol_contracts,
606 .starting_tree_roots = starting_tree_roots };
607 hinting_contract_db.dump_hints(collected_hints);
608 hinting_merkle_db.dump_hints(collected_hints);
609
610 tx_result.hints = std::move(collected_hints);
611
612 // Need to std::move to avoid copying (due to structured bindings).
613 // This was fixed in C++23 via http://wg21.link/P2266R3.
614 return std::move(tx_result);
615}
616
618{
619 // TODO(fcarreiro): decide if we want to pass a config here.
620 const PublicSimulatorConfig config{};
621
622 HintedRawContractDB raw_contract_db(hints);
623 HintedRawMerkleDB raw_merkle_db(hints);
624
625 // We use EventEmitters and DeduplicatingEventEmitters here because we want to collect events.
626 auto [events, /* unused */ tx_result_] = simulate_for_witgen_internal<EventEmitter, DeduplicatingEventEmitter>(
627 raw_contract_db, raw_merkle_db, config, hints.tx, hints.global_variables, hints.protocol_contracts);
628
629 // Need to std::move to avoid copying (due to structured bindings).
630 // This was fixed in C++23 via http://wg21.link/P2266R3.
631 return std::move(events);
632}
633
635 const PublicSimulatorConfig& config)
636{
637 HintedRawContractDB raw_contract_db(hints);
638 HintedRawMerkleDB raw_merkle_db(hints);
640 raw_contract_db, raw_merkle_db, config, hints.tx, hints.global_variables, hints.protocol_contracts);
641}
642
643} // namespace bb::avm2
GreaterThan greater_than
EventEmitter< AluEvent > alu_emitter
#define BB_ASSERT(expression,...)
Definition assert.hpp:70
#define DOM_SEP__WRITTEN_SLOTS_MERKLE
#define DOM_SEP__NULLIFIER_MERKLE
#define DOM_SEP__RETRIEVED_BYTECODES_MERKLE
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:264
FieldGreaterThan field_gt
EventEmitter< simulation::MerkleCheckEvent > merkle_check_emitter
RetrievedBytecodesTreeCheck retrieved_bytecodes_tree_check
EventEmitter< simulation::FieldGreaterThanEvent > field_gt_emitter
EventEmitter< simulation::RangeCheckEvent > range_check_emitter
BytecodeHasher bytecode_hasher
StrictMock< MockHighLevelMerkleDB > merkle_db
StrictMock< MockContractDB > contract_db
StrictMock< MockContractInstanceManager > contract_instance_manager
TxSimulationResult simulate_fast_internal(simulation::ContractDBInterface &raw_contract_db, simulation::LowLevelMerkleDBInterface &raw_merkle_db, const PublicSimulatorConfig &config, const Tx &tx, const GlobalVariables &global_variables, const ProtocolContracts &protocol_contracts, simulation::CancellationTokenPtr cancellation_token=nullptr)
std::tuple< simulation::EventsContainer, TxSimulationResult > simulate_for_witgen_internal(simulation::ContractDBInterface &raw_contract_db, simulation::LowLevelMerkleDBInterface &raw_merkle_db, const PublicSimulatorConfig &config, const Tx &tx, const GlobalVariables &global_variables, const ProtocolContracts &protocol_contracts)
TxSimulationResult simulate_for_hint_collection(simulation::ContractDBInterface &raw_contract_db, const world_state::WorldStateRevision &world_state_revision, world_state::WorldState &ws, const PublicSimulatorConfig &config, const Tx &tx, const GlobalVariables &global_variables, const ProtocolContracts &protocol_contracts, simulation::CancellationTokenPtr cancellation_token=nullptr)
TxSimulationResult simulate_fast_with_hinted_dbs(const ExecutionHints &hints, const PublicSimulatorConfig &config)
TxSimulationResult simulate_fast_with_existing_ws(simulation::ContractDBInterface &raw_contract_db, const world_state::WorldStateRevision &world_state_revision, world_state::WorldState &ws, const PublicSimulatorConfig &config, const Tx &tx, const GlobalVariables &global_variables, const ProtocolContracts &protocol_contracts, simulation::CancellationTokenPtr cancellation_token=nullptr)
simulation::EventsContainer simulate_for_witgen(const ExecutionHints &hints)
Witness-generating implementation of bitwise AND/OR/XOR operations.
Definition bitwise.hpp:13
std::vector< DebugLog > dump_logs() override
Definition debug_log.hpp:19
void generate_ff_gt_events_for_squashing(const std::vector< FF > &written_leaf_slots)
Generates ff_gt events for squashing.
PublicInputsBuilder & extract_inputs(const Tx &tx, const GlobalVariables &global_variables, const ProtocolContracts &protocol_contracts, const FF &prover_id, const LowLevelMerkleDBInterface &merkle_db)
TreeSnapshots get_tree_roots() const override
const TrackedSideEffects & get_side_effects() const override
A high-level merkle db that tracks side effects.
Holds the Merkle trees responsible for storing the state of the Aztec protocol.
ExecutionIdManager execution_id_manager
InstructionInfoDB instruction_info_db
HintingContractsDB hinting_contract_db
HintedRawMerkleDB base_merkle_db
HintingRawDB hinting_merkle_db
AVM range check gadget for witness generation.
crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams > poseidon2
RetrievedBytecodesTree build_retrieved_bytecodes_tree()
std::shared_ptr< CancellationToken > CancellationTokenPtr
WrittenPublicDataSlotsTree build_public_data_slots_tree()
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
GlobalVariables global_variables
Definition avm_io.hpp:359
ProtocolContracts protocol_contracts
Definition avm_io.hpp:362
CollectionLimitsConfig collection_limits
Definition avm_io.hpp:451
std::vector< FF > note_hashes
Definition avm_io.hpp:537
std::vector< PublicLog > public_logs
Definition avm_io.hpp:540
std::vector< FF > nullifiers
Definition avm_io.hpp:538
std::vector< PublicDataWrite > public_data_writes
Definition avm_io.hpp:541
std::vector< ScopedL2ToL1Message > l2_to_l1_msgs
Definition avm_io.hpp:539
tracegen::PublicInputsTraceBuilder public_inputs_builder
Definition tx.test.cpp:81
SideEffectTracker side_effect_tracker
TxExecution tx_execution
NiceMock< MockContextProvider > context_provider
NoopCallStackMetadataCollector call_stack_metadata_collector
EventEmitter< TxEvent > tx_event_emitter
NiceMock< MockWrittenPublicDataSlotsTreeCheck > written_public_data_slots_tree_check