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.
76
77// Standalone.
94
95namespace bb::avm2 {
96
97using namespace bb::avm2::simulation;
98
99namespace {
100
101PublicTxEffect extract_public_tx_effect(const TxExecutionResult& tx_execution_result,
103{
104 PublicTxEffect public_tx_effect;
105 const auto& side_effects = side_effect_tracker.get_side_effects();
106 public_tx_effect.transaction_fee = tx_execution_result.transaction_fee;
107 public_tx_effect.note_hashes = side_effects.note_hashes;
108 public_tx_effect.nullifiers = side_effects.nullifiers;
109 public_tx_effect.l2_to_l1_msgs = side_effects.l2_to_l1_messages;
110 public_tx_effect.public_logs = side_effects.public_logs.to_logs();
111
112 // We need to copy the storage writes slot to value in the order of the slots by insertion.
113 const size_t num_storage_writes = side_effects.storage_writes_slots_by_insertion.size();
114 public_tx_effect.public_data_writes.reserve(num_storage_writes);
115 for (size_t i = 0; i < num_storage_writes; i++) {
116 const auto& slot = side_effects.storage_writes_slots_by_insertion[i];
117 const auto& value = side_effects.storage_writes_slot_to_value.at(slot);
118 public_tx_effect.public_data_writes.push_back(PublicDataWrite{ .leaf_slot = slot, .value = value });
119 }
120
121 return public_tx_effect;
122}
123
124} // namespace
125
126// Internal helper function for event-generating simulation (with full gadgets).
127// NOTE: Some of the config parameters are ignored in this function.
128template <template <typename> class DefaultEventEmitter, template <typename> class DefaultDeduplicatingEventEmitter>
130 ContractDBInterface& raw_contract_db,
131 LowLevelMerkleDBInterface& raw_merkle_db,
132 const PublicSimulatorConfig& config,
133 const Tx& tx,
134 const GlobalVariables& global_variables,
135 const ProtocolContracts& protocol_contracts)
136{
137 BB_BENCH_NAME("AvmSimulationHelper::simulate_for_witgen_internal");
138
139 DefaultEventEmitter<ExecutionEvent> execution_emitter;
140 DefaultDeduplicatingEventEmitter<AluEvent> alu_emitter;
141 DefaultDeduplicatingEventEmitter<BitwiseEvent> bitwise_emitter;
142 DefaultEventEmitter<DataCopyEvent> data_copy_emitter;
143 DefaultEventEmitter<MemoryEvent> memory_emitter;
144 DefaultEventEmitter<BytecodeRetrievalEvent> bytecode_retrieval_emitter;
145 DefaultEventEmitter<BytecodeHashingEvent> bytecode_hashing_emitter;
146 DefaultEventEmitter<BytecodeDecompositionEvent> bytecode_decomposition_emitter;
147 DefaultDeduplicatingEventEmitter<InstructionFetchingEvent> instruction_fetching_emitter;
148 DefaultEventEmitter<AddressDerivationEvent> address_derivation_emitter;
149 DefaultEventEmitter<ClassIdDerivationEvent> class_id_derivation_emitter;
150 DefaultEventEmitter<Sha256CompressionEvent> sha256_compression_emitter;
151 DefaultEventEmitter<EccAddEvent> ecc_add_emitter;
152 DefaultEventEmitter<ScalarMulEvent> scalar_mul_emitter;
153 DefaultEventEmitter<EccAddMemoryEvent> ecc_add_memory_emitter;
154 DefaultEventEmitter<Poseidon2HashEvent> poseidon2_hash_emitter;
155 DefaultEventEmitter<Poseidon2PermutationEvent> poseidon2_perm_emitter;
156 DefaultEventEmitter<Poseidon2PermutationMemoryEvent> poseidon2_perm_mem_emitter;
157 DefaultEventEmitter<KeccakF1600Event> keccakf1600_emitter;
158 DefaultEventEmitter<ToRadixEvent> to_radix_emitter;
159 DefaultEventEmitter<ToRadixMemoryEvent> to_radix_memory_emitter;
160 DefaultDeduplicatingEventEmitter<FieldGreaterThanEvent> field_gt_emitter;
161 DefaultEventEmitter<MerkleCheckEvent> merkle_check_emitter;
162 DefaultDeduplicatingEventEmitter<RangeCheckEvent> range_check_emitter;
163 DefaultEventEmitter<ContextStackEvent> context_stack_emitter;
164 DefaultEventEmitter<PublicDataTreeCheckEvent> public_data_tree_check_emitter;
165 DefaultEventEmitter<UpdateCheckEvent> update_check_emitter;
166 DefaultEventEmitter<NullifierTreeCheckEvent> nullifier_tree_check_emitter;
167 DefaultEventEmitter<TxEvent> tx_event_emitter;
168 DefaultEventEmitter<CalldataEvent> calldata_emitter;
169 DefaultEventEmitter<InternalCallStackEvent> internal_call_stack_emitter;
170 DefaultEventEmitter<NoteHashTreeCheckEvent> note_hash_tree_check_emitter;
171 DefaultEventEmitter<WrittenPublicDataSlotsTreeCheckEvent> written_public_data_slots_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 DefaultEventEmitter<RetrievedBytecodesTreeCheckEvent> retrieved_bytecodes_tree_check_emitter;
178
182 GreaterThan greater_than(field_gt, range_check, greater_than_emitter);
183 ToRadix to_radix(execution_id_manager, greater_than, to_radix_emitter, to_radix_memory_emitter);
185 execution_id_manager, greater_than, poseidon2_hash_emitter, poseidon2_perm_emitter, poseidon2_perm_mem_emitter);
187 PublicDataTreeCheck public_data_tree_check(
188 poseidon2, merkle_check, field_gt, execution_id_manager, public_data_tree_check_emitter);
191 field_gt,
193 written_public_data_slots_tree_check_emitter);
196 NullifierTreeCheck nullifier_tree_check(poseidon2, merkle_check, field_gt, nullifier_tree_check_emitter);
197
198 // The protocol requires at least one non-revertible nullifier in the transaction (used for uniqueness of note
199 // hashes).
200 if (tx.non_revertible_accumulated_data.nullifiers.empty()) {
201 throw std::runtime_error("Non-revertible nullifiers are empty in the transaction.");
202 }
203
205 tx.non_revertible_accumulated_data.nullifiers[0], poseidon2, merkle_check, note_hash_tree_check_emitter);
206 L1ToL2MessageTreeCheck l1_to_l2_msg_tree_check(merkle_check, l1_to_l2_msg_tree_check_emitter);
207 EmitPublicLog emit_public_log_component(execution_id_manager, greater_than, emit_public_log_emitter);
209 Bitwise bitwise(bitwise_emitter);
210 Sha256 sha256(execution_id_manager, bitwise, greater_than, sha256_compression_emitter);
212
213 Ecc ecc(execution_id_manager, greater_than, to_radix, ecc_add_emitter, scalar_mul_emitter, ecc_add_memory_emitter);
214 AddressDerivation address_derivation(poseidon2, ecc, address_derivation_emitter);
215 ClassIdDerivation class_id_derivation(poseidon2, class_id_derivation_emitter);
216
217 ContractDB contract_db(raw_contract_db, address_derivation, class_id_derivation, protocol_contracts);
218
219 MerkleDB base_merkle_db(raw_merkle_db,
220 public_data_tree_check,
221 nullifier_tree_check,
224 l1_to_l2_msg_tree_check);
225 base_merkle_db.add_checkpoint_listener(note_hash_tree_check);
226 base_merkle_db.add_checkpoint_listener(nullifier_tree_check);
227 base_merkle_db.add_checkpoint_listener(public_data_tree_check);
228 // This one is only needed for events.
229 base_merkle_db.add_checkpoint_listener(emit_public_log_component);
230
231 // Side effect tracking is only strictly needed for logs and L2-to-L1 messages.
233
235 tx.non_revertible_accumulated_data.nullifiers[0], base_merkle_db, side_effect_tracker);
236
237 UpdateCheck update_check(poseidon2, range_check, greater_than, merkle_db, update_check_emitter, global_variables);
238
239 BytecodeHasher bytecode_hasher(poseidon2, bytecode_hashing_emitter);
241
243 contract_db, merkle_db, update_check, field_gt, protocol_contracts, contract_instance_retrieval_emitter);
244
245 TxBytecodeManager bytecode_manager(contract_db,
246 merkle_db,
251 bytecode_retrieval_emitter,
252 bytecode_decomposition_emitter,
253 instruction_fetching_emitter);
255
256 MemoryProvider memory_provider(range_check, execution_id_manager, memory_emitter);
257 CalldataHashingProvider calldata_hashing_provider(poseidon2, calldata_emitter);
258 InternalCallStackManagerProvider internal_call_stack_manager_provider(internal_call_stack_emitter);
259 ContextProvider context_provider(bytecode_manager,
260 memory_provider,
261 calldata_hashing_provider,
262 internal_call_stack_manager_provider,
263 merkle_db,
267 global_variables);
269
270 // Create GetContractInstance opcode component
272 execution_id_manager, merkle_db, get_contract_instance_emitter, contract_instance_manager);
273
274 NoopDebugLogger debug_log_component;
280
282 bitwise,
283 data_copy,
284 poseidon2,
285 ecc,
286 to_radix,
287 sha256,
288 execution_components,
292 execution_emitter,
293 context_stack_emitter,
297 emit_public_log_component,
298 debug_log_component,
299 merkle_db,
301
305 merkle_db,
309 field_gt,
310 poseidon2,
313
315 public_inputs_builder.extract_inputs(tx, global_variables, protocol_contracts, config.prover_id, raw_merkle_db);
316
317 TxExecutionResult tx_execution_result = tx_execution.simulate(tx);
318
319 public_inputs_builder.extract_outputs(raw_merkle_db,
320 // TODO(MW): Use of billed_gas is a bit misleading - we want public + private
321 // - teardown, which is stored as billed gas here/in ts:
322 tx_execution_result.gas_used.billed_gas,
323 tx_execution_result.transaction_fee,
324 tx_execution_result.revert_code != RevertCode::OK,
325 side_effect_tracker.get_side_effects());
326
327 public_data_tree_check.generate_ff_gt_events_for_squashing(
328 side_effect_tracker.get_side_effects().storage_writes_slots_by_insertion);
329
330 EventsContainer events = {
331 tx_event_emitter.dump_events(),
332 execution_emitter.dump_events(),
333 alu_emitter.dump_events(),
334 bitwise_emitter.dump_events(),
335 memory_emitter.dump_events(),
336 bytecode_retrieval_emitter.dump_events(),
337 bytecode_hashing_emitter.dump_events(),
338 bytecode_decomposition_emitter.dump_events(),
339 instruction_fetching_emitter.dump_events(),
340 address_derivation_emitter.dump_events(),
341 class_id_derivation_emitter.dump_events(),
342 sha256_compression_emitter.dump_events(),
343 ecc_add_emitter.dump_events(),
344 scalar_mul_emitter.dump_events(),
345 ecc_add_memory_emitter.dump_events(),
346 poseidon2_hash_emitter.dump_events(),
347 poseidon2_perm_emitter.dump_events(),
348 poseidon2_perm_mem_emitter.dump_events(),
349 keccakf1600_emitter.dump_events(),
350 to_radix_emitter.dump_events(),
351 to_radix_memory_emitter.dump_events(),
352 field_gt_emitter.dump_events(),
353 greater_than_emitter.dump_events(),
354 merkle_check_emitter.dump_events(),
355 range_check_emitter.dump_events(),
356 context_stack_emitter.dump_events(),
357 public_data_tree_check_emitter.dump_events(),
358 update_check_emitter.dump_events(),
359 nullifier_tree_check_emitter.dump_events(),
360 data_copy_emitter.dump_events(),
361 calldata_emitter.dump_events(),
362 internal_call_stack_emitter.dump_events(),
363 note_hash_tree_check_emitter.dump_events(),
364 written_public_data_slots_tree_check_emitter.dump_events(),
365 contract_instance_retrieval_emitter.dump_events(),
366 get_contract_instance_emitter.dump_events(),
367 l1_to_l2_msg_tree_check_emitter.dump_events(),
368 emit_public_log_emitter.dump_events(),
370 };
371
372 TxSimulationResult tx_simulation_result = {
373 .gas_used = tx_execution_result.gas_used,
374 .revert_code = tx_execution_result.revert_code,
375 .public_tx_effect = extract_public_tx_effect(tx_execution_result, side_effect_tracker),
376 .call_stack_metadata = call_stack_metadata_collector->dump_call_stack_metadata(),
377 .logs = debug_log_component.dump_logs(),
378 .public_inputs =
380 };
381
382 return { std::move(events), std::move(tx_simulation_result) };
383}
384
385// Internal helper function for fast simulation.
387 LowLevelMerkleDBInterface& raw_merkle_db,
388 const PublicSimulatorConfig& config,
389 const Tx& tx,
390 const GlobalVariables& global_variables,
391 const ProtocolContracts& protocol_contracts,
392 CancellationTokenPtr cancellation_token)
393{
394 BB_BENCH_NAME("AvmSimulationHelper::simulate_fast_internal");
395
396 NoopEventEmitter<ExecutionEvent> execution_emitter;
397 NoopEventEmitter<DataCopyEvent> data_copy_emitter;
398 NoopEventEmitter<EccAddEvent> ecc_add_emitter;
399 NoopEventEmitter<ScalarMulEvent> scalar_mul_emitter;
400 NoopEventEmitter<EccAddMemoryEvent> ecc_add_memory_emitter;
404 NoopEventEmitter<ContextStackEvent> context_stack_emitter;
406 NoopEventEmitter<InternalCallStackEvent> internal_call_stack_emitter;
407 NoopEventEmitter<ContractInstanceRetrievalEvent> contract_instance_retrieval_emitter;
408 NoopEventEmitter<GetContractInstanceEvent> get_contract_instance_emitter;
409 NoopEventEmitter<EmitPublicLogEvent> emit_public_log_emitter;
411 NoopEventEmitter<UpdateCheckEvent> update_check_emitter;
412
423 EmitPublicLog emit_public_log_component(execution_id_manager, greater_than, emit_public_log_emitter);
424 PureAlu alu;
428
429 Ecc ecc(execution_id_manager, greater_than, to_radix, ecc_add_emitter, scalar_mul_emitter, ecc_add_memory_emitter);
430
432 PureContractDB contract_db(raw_contract_db);
433
434 // The protocol requires at least one non-revertible nullifier in the transaction (used for uniqueness of note
435 // hashes).
436 if (tx.non_revertible_accumulated_data.nullifiers.empty()) {
437 throw std::runtime_error("Non-revertible nullifiers are empty in the transaction.");
438 }
439
441 tx.non_revertible_accumulated_data.nullifiers[0], raw_merkle_db, written_public_data_slots_tree_check);
443
444 tx.non_revertible_accumulated_data.nullifiers[0], base_merkle_db, side_effect_tracker);
445
448
450 contract_db, merkle_db, update_check, field_gt, protocol_contracts, contract_instance_retrieval_emitter);
452
454
455 PureMemoryProvider memory_provider;
456 NoopCalldataHashingProvider calldata_hashing_provider;
457 InternalCallStackManagerProvider internal_call_stack_manager_provider(internal_call_stack_emitter);
458 ContextProvider context_provider(tx_bytecode_manager,
459 memory_provider,
460 calldata_hashing_provider,
461 internal_call_stack_manager_provider,
462 merkle_db,
466 global_variables);
468
469 // Create GetContractInstance opcode component
471 execution_id_manager, merkle_db, get_contract_instance_emitter, contract_instance_manager);
472
474 if (config.collect_debug_logs) {
475 // TODO(fcarreiro): add debug log level?
476 const DebugLogLevel debug_log_level = DebugLogLevel::INFO;
477 return std::make_unique<DebugLogger>(debug_log_level,
479 [](const std::string& message) { vinfo(message); });
480 } else {
482 }
483 }();
489
491 bitwise,
492 data_copy,
493 poseidon2,
494 ecc,
495 to_radix,
496 sha256,
497 execution_components,
501 execution_emitter,
502 context_stack_emitter,
506 emit_public_log_component,
507 *debug_log_component,
508 merkle_db,
510 std::move(cancellation_token));
514 merkle_db,
518 field_gt,
519 poseidon2,
522 config.skip_fee_enforcement);
523
525 public_inputs_builder.extract_inputs(tx, global_variables, protocol_contracts, config.prover_id, raw_merkle_db);
526
527 // This triggers all the work.
528 TxExecutionResult tx_execution_result = tx_execution.simulate(tx);
529
530 public_inputs_builder.extract_outputs(raw_merkle_db,
531 // TODO(MW): Use of billed_gas is a bit misleading - we want public + private
532 // - teardown, which is stored as billed gas here/in ts:
533 tx_execution_result.gas_used.billed_gas,
534 tx_execution_result.transaction_fee,
535 tx_execution_result.revert_code != RevertCode::OK,
536 side_effect_tracker.get_side_effects());
537
538 return {
539 // Simulation.
540 .gas_used = tx_execution_result.gas_used,
541 .revert_code = tx_execution_result.revert_code,
542 .public_tx_effect = extract_public_tx_effect(tx_execution_result, side_effect_tracker),
543 .call_stack_metadata = call_stack_metadata_collector->dump_call_stack_metadata(),
544 .logs = debug_log_component->dump_logs(),
545 // Proving request data.
546 .public_inputs =
548 .hints = std::nullopt, // NOTE: hints are injected by the caller.
549 };
550}
551
552/************************************
553 * Entry points
554 ************************************/
555
557 simulation::ContractDBInterface& raw_contract_db,
558 const world_state::WorldStateRevision& world_state_revision,
560 const PublicSimulatorConfig& config,
561 const Tx& tx,
562 const GlobalVariables& global_variables,
563 const ProtocolContracts& protocol_contracts,
564 CancellationTokenPtr cancellation_token)
565{
566 // For collecting hints, use the other method.
567 BB_ASSERT(!config.collect_hints && "Use simulate_for_hint_collection instead");
568
569 // Create PureRawMerkleDB with the provided WorldState instance and cancellation token
570 PureRawMerkleDB raw_merkle_db(world_state_revision, ws, /*cache_tree_roots=*/true, cancellation_token);
571
573 raw_contract_db, raw_merkle_db, config, tx, global_variables, protocol_contracts, cancellation_token);
574}
575
577 simulation::ContractDBInterface& raw_contract_db,
578 const world_state::WorldStateRevision& world_state_revision,
580 const PublicSimulatorConfig& config,
581 const Tx& tx,
582 const GlobalVariables& global_variables,
583 const ProtocolContracts& protocol_contracts,
584 CancellationTokenPtr cancellation_token)
585{
586 // If you are not collecting hints, don't use this method.
587 BB_ASSERT(config.collect_hints && "Use simulate_fast_with_existing_ws instead");
588
589 // Create PureRawMerkleDB with the provided WorldState instance and cancellation token
590 PureRawMerkleDB raw_merkle_db(world_state_revision, ws, /*cache_tree_roots=*/true, cancellation_token);
591
592 auto starting_tree_roots = raw_merkle_db.get_tree_roots();
594 HintingRawDB hinting_merkle_db(raw_merkle_db);
595
596 // We use NoopEventEmitters here because we don't want to collect events.
597 auto [/* unused */ events_, tx_result] = simulate_for_witgen_internal<NoopEventEmitter, NoopEventEmitter>(
598 hinting_contract_db, hinting_merkle_db, config, tx, global_variables, protocol_contracts);
599
600 ExecutionHints collected_hints = ExecutionHints{ .global_variables = global_variables,
601 .tx = tx,
602 .protocol_contracts = protocol_contracts,
603 .starting_tree_roots = starting_tree_roots };
604 hinting_contract_db.dump_hints(collected_hints);
605 hinting_merkle_db.dump_hints(collected_hints);
606
607 tx_result.hints = std::move(collected_hints);
608
609 // Need to std::move to avoid copying (due to structured bindings).
610 // This was fixed in C++23 via http://wg21.link/P2266R3.
611 return std::move(tx_result);
612}
613
615{
616 // TODO(fcarreiro): decide if we want to pass a config here.
617 const PublicSimulatorConfig config{};
618
619 HintedRawContractDB raw_contract_db(hints);
620 HintedRawMerkleDB raw_merkle_db(hints);
621
622 // We use EventEmitters and DeduplicatingEventEmitters here because we want to collect events.
623 auto [events, /* unused */ tx_result_] = simulate_for_witgen_internal<EventEmitter, DeduplicatingEventEmitter>(
624 raw_contract_db, raw_merkle_db, config, hints.tx, hints.global_variables, hints.protocol_contracts);
625
626 // Need to std::move to avoid copying (due to structured bindings).
627 // This was fixed in C++23 via http://wg21.link/P2266R3.
628 return std::move(events);
629}
630
632 const PublicSimulatorConfig& config)
633{
634 HintedRawContractDB raw_contract_db(hints);
635 HintedRawMerkleDB raw_merkle_db(hints);
637 raw_contract_db, raw_merkle_db, config, hints.tx, hints.global_variables, hints.protocol_contracts);
638}
639
640} // namespace bb::avm2
GreaterThan greater_than
EventEmitter< AluEvent > alu_emitter
#define BB_ASSERT(expression,...)
Definition assert.hpp:70
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:225
FieldGreaterThan field_gt
EventEmitter< simulation::MerkleCheckEvent > merkle_check_emitter
EventEmitter< simulation::FieldGreaterThanEvent > field_gt_emitter
EventEmitter< simulation::RetrievedBytecodesTreeCheckEvent > retrieved_bytecodes_tree_check_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