31 .current_contract_class_id =
instance->current_contract_class_id,
32 .original_contract_class_id =
instance->original_contract_class_id,
33 .initialization_hash =
instance->initialization_hash,
36 .master_incoming_viewing_public_key =
instance->public_keys.incoming_viewing_key,
37 .master_outgoing_viewing_public_key =
instance->public_keys.outgoing_viewing_key,
38 .master_tagging_public_key =
instance->public_keys.tagging_key }
51 if (klass.has_value()) {
56 .artifact_hash = klass->artifact_hash,
57 .private_functions_root = klass->private_functions_root,
59 .packed_bytecode = klass->packed_bytecode,
69 if (commitment.has_value()) {
73 .commitment = commitment.value() };
83 if (name.has_value()) {
108 .old_checkpoint_id = old_checkpoint_id,
126 .old_checkpoint_id = old_checkpoint_id,
144 .old_checkpoint_id = old_checkpoint_id,
161 [](
const auto& mapped_contract_instance) { return mapped_contract_instance.second; });
165 [](
const auto& mapped_contract_class) { return mapped_contract_class.second; });
169 [](
const auto& mapped_bytecode_commitment) { return mapped_bytecode_commitment.second; });
173 [](
const auto& mapped_debug_function_name) { return mapped_debug_function_name.second; });
175 std::ranges::transform(
178 [](
const auto& mapped_create_checkpoint_hint) { return mapped_create_checkpoint_hint.second; });
180 std::ranges::transform(
183 [](
const auto& mapped_commit_checkpoint_hint) { return mapped_commit_checkpoint_hint.second; });
185 std::ranges::transform(
188 [](
const auto& mapped_revert_checkpoint_hint) { return mapped_revert_checkpoint_hint.second; });
259 .
hint_key = tree_info, .index = leaf_index, .leaf_preimage = preimage
272 .
hint_key = tree_info, .index = leaf_index, .leaf_preimage = preimage
294 .state_after = state_after
316 .state_after = state_after
332 .old_checkpoint_id = old_checkpoint_id,
348 .old_checkpoint_id = old_checkpoint_id,
366 .old_checkpoint_id = old_checkpoint_id,
368 .state_before = state_before,
369 .state_after = state_after,
389 for (uint32_t i = 0; i < leaves.size(); i++) {
390 FF root_after = i == leaves.size() - 1 ?
get_tree_info(tree_id).
root : results[i + 1].root;
392 tree_info =
appendLeafInternal(tree_info, results[i].path, root_after, tree_id, leaves[i]);
400 const FF& root_after,
413 .
hint_key = state_before, .state_after = state_after, .tree_id = tree_id, .leaves = { leaf }
427 std::ranges::transform(
430 [](
const auto& mapped_get_sibling_path_hint) { return mapped_get_sibling_path_hint.second; });
432 std::ranges::transform(
435 [](
const auto& mapped_get_previous_value_index_hint) { return mapped_get_previous_value_index_hint.second; });
437 std::ranges::transform(
440 [](
const auto& mapped_get_leaf_preimage_hint) { return mapped_get_leaf_preimage_hint.second; });
442 std::ranges::transform(
445 [](
const auto& mapped_get_leaf_preimage_hint) { return mapped_get_leaf_preimage_hint.second; });
449 [](
const auto& mapped_get_leaf_value_hint) { return mapped_get_leaf_value_hint.second; });
451 std::ranges::transform(
454 [](
const auto& mapped_sequential_insert_hint) { return mapped_sequential_insert_hint.second; });
456 std::ranges::transform(
459 [](
const auto& mapped_sequential_insert_hint) { return mapped_sequential_insert_hint.second; });
463 [](
const auto& mapped_append_leaves_hint) { return mapped_append_leaves_hint.second; });
465 std::ranges::transform(
468 [](
const auto& mapped_create_checkpoint_hint) { return mapped_create_checkpoint_hint.second; });
470 std::ranges::transform(
473 [](
const auto& mapped_commit_checkpoint_hint) { return mapped_commit_checkpoint_hint.second; });
475 std::ranges::transform(
478 [](
const auto& mapped_revert_checkpoint_hint) { return mapped_revert_checkpoint_hint.second; });
std::shared_ptr< Napi::ThreadSafeFunction > instance
virtual void commit_checkpoint()=0
virtual void revert_checkpoint()=0
virtual void add_contracts(const ContractDeploymentData &contract_deployment_data)=0
virtual std::optional< FF > get_bytecode_commitment(const ContractClassId &class_id) const =0
virtual std::optional< std::string > get_debug_function_name(const AztecAddress &address, const FunctionSelector &selector) const =0
virtual void create_checkpoint()=0
virtual std::optional< ContractInstance > get_contract_instance(const AztecAddress &address) const =0
virtual std::optional< ContractClass > get_contract_class(const ContractClassId &class_id) const =0
std::optional< std::string > get_debug_function_name(const AztecAddress &address, const FunctionSelector &selector) const override
std::optional< ContractClass > get_contract_class(const ContractClassId &class_id) const override
uint32_t get_checkpoint_id() const
uint32_t next_checkpoint_id
void commit_checkpoint() override
std::optional< FF > get_bytecode_commitment(const ContractClassId &class_id) const override
void add_contracts(const ContractDeploymentData &contract_deployment_data) override
MappedContractHints contract_hints
void create_checkpoint() override
uint32_t checkpoint_action_counter
void dump_hints(ExecutionHints &hints)
std::optional< ContractInstance > get_contract_instance(const AztecAddress &address) const override
void revert_checkpoint() override
std::stack< uint32_t > checkpoint_stack
AppendOnlyTreeSnapshot appendLeafInternal(const AppendOnlyTreeSnapshot &state_before, const SiblingPath &path, const FF &root_after, MerkleTreeId tree_id, const FF &leaf)
void create_checkpoint() override
void dump_hints(ExecutionHints &hints)
SequentialInsertionResult< NullifierLeafValue > insert_indexed_leaves_nullifier_tree(const NullifierLeafValue &leaf_value) override
IndexedLeaf< NullifierLeafValue > get_leaf_preimage_nullifier_tree(index_t leaf_index) const override
SiblingPath get_sibling_path(MerkleTreeId tree_id, index_t leaf_index) const override
std::vector< AppendLeafResult > append_leaves(MerkleTreeId tree_id, std::span< const FF > leaves) override
GetLowIndexedLeafResponse get_low_indexed_leaf(MerkleTreeId tree_id, const FF &value) const override
LowLevelMerkleDBInterface & db
void revert_checkpoint() override
void commit_checkpoint() override
MappedMerkleHints merkle_hints
uint32_t checkpoint_action_counter
FF get_leaf_value(MerkleTreeId tree_id, index_t leaf_index) const override
IndexedLeaf< PublicDataLeafValue > get_leaf_preimage_public_data_tree(index_t leaf_index) const override
SequentialInsertionResult< PublicDataLeafValue > insert_indexed_leaves_public_data_tree(const PublicDataLeafValue &leaf_value) override
AppendOnlyTreeSnapshot get_tree_info(MerkleTreeId tree_id) const
void pad_tree(MerkleTreeId tree_id, size_t num_leaves) override
virtual IndexedLeaf< PublicDataLeafValue > get_leaf_preimage_public_data_tree(index_t leaf_index) const =0
virtual void revert_checkpoint()=0
virtual void commit_checkpoint()=0
virtual void create_checkpoint()=0
virtual std::vector< AppendLeafResult > append_leaves(MerkleTreeId tree_id, std::span< const FF > leaves)=0
virtual TreeSnapshots get_tree_roots() const =0
virtual void pad_tree(MerkleTreeId tree_id, size_t num_leaves)=0
virtual IndexedLeaf< NullifierLeafValue > get_leaf_preimage_nullifier_tree(index_t leaf_index) const =0
virtual SequentialInsertionResult< NullifierLeafValue > insert_indexed_leaves_nullifier_tree(const NullifierLeafValue &leaf_value)=0
virtual GetLowIndexedLeafResponse get_low_indexed_leaf(MerkleTreeId tree_id, const FF &value) const =0
virtual SiblingPath get_sibling_path(MerkleTreeId tree_id, index_t leaf_index) const =0
virtual uint32_t get_checkpoint_id() const =0
virtual SequentialInsertionResult< PublicDataLeafValue > insert_indexed_leaves_public_data_tree(const PublicDataLeafValue &leaf_value)=0
virtual FF get_leaf_value(MerkleTreeId tree_id, index_t leaf_index) const =0
auto & get_tree_info_helper(world_state::MerkleTreeId tree_id, auto &tree_roots)
::bb::crypto::merkle_tree::fr_sibling_path SiblingPath
std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, index_t > GetSiblingPathKey
std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, index_t > GetLeafValueKey
std::tuple< uint32_t, ContractClassId > GetBytecodeCommitmentKey
std::tuple< AztecAddress, FunctionSelector > GetDebugFunctionNameKey
std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafValue > SequentialInsertHintNullifierTreeKey
std::tuple< AppendOnlyTreeSnapshot, index_t > GetLeafPreimageKey
std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, PublicDataLeafValue > SequentialInsertHintPublicDataTreeKey
std::tuple< uint32_t, AztecAddress > GetContractInstanceKey
std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, FF > GetPreviousValueIndexKey
std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, std::vector< FF > > AppendLeavesHintKey
::bb::crypto::merkle_tree::index_t index_t
std::tuple< uint32_t, ContractClassId > GetContractClassKey
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
AppendOnlyTreeSnapshot hint_key
uint64_t next_available_leaf_index
std::vector< SequentialInsertHint< crypto::merkle_tree::NullifierLeafValue > > sequential_insert_hints_nullifier_tree
std::vector< GetSiblingPathHint > get_sibling_path_hints
std::vector< DebugFunctionNameHint > debug_function_names
std::vector< ContractDBCreateCheckpointHint > contract_db_create_checkpoint_hints
std::vector< ContractDBCommitCheckpointHint > contract_db_commit_checkpoint_hints
std::vector< CommitCheckpointHint > commit_checkpoint_hints
std::vector< SequentialInsertHint< crypto::merkle_tree::PublicDataLeafValue > > sequential_insert_hints_public_data_tree
std::vector< RevertCheckpointHint > revert_checkpoint_hints
std::vector< ContractDBRevertCheckpointHint > contract_db_revert_checkpoint_hints
std::vector< GetPreviousValueIndexHint > get_previous_value_index_hints
std::vector< GetLeafPreimageHint< crypto::merkle_tree::IndexedLeaf< crypto::merkle_tree::PublicDataLeafValue > > > get_leaf_preimage_hints_public_data_tree
std::vector< GetLeafPreimageHint< crypto::merkle_tree::IndexedLeaf< crypto::merkle_tree::NullifierLeafValue > > > get_leaf_preimage_hints_nullifier_tree
std::vector< CreateCheckpointHint > create_checkpoint_hints
std::vector< GetLeafValueHint > get_leaf_value_hints
std::vector< AppendLeavesHint > append_leaves_hints
std::vector< ContractInstanceHint > contract_instances
std::vector< ContractClassHint > contract_classes
std::vector< BytecodeCommitmentHint > bytecode_commitments
AppendOnlyTreeSnapshot hint_key
AppendOnlyTreeSnapshot hint_key
AppendOnlyTreeSnapshot hint_key
AppendOnlyTreeSnapshot hint_key
AffinePoint master_nullifier_public_key
AppendOnlyTreeSnapshot hint_key
AppendOnlyTreeSnapshot public_data_tree
AppendOnlyTreeSnapshot nullifier_tree
unordered_flat_map< GetContractClassKey, ContractClassHint > contract_classes
unordered_flat_map< uint32_t, ContractDBRevertCheckpointHint > revert_checkpoint_hints
unordered_flat_map< uint32_t, ContractDBCreateCheckpointHint > create_checkpoint_hints
unordered_flat_map< uint32_t, ContractDBCommitCheckpointHint > commit_checkpoint_hints
unordered_flat_map< GetDebugFunctionNameKey, DebugFunctionNameHint > debug_function_names
unordered_flat_map< GetContractInstanceKey, ContractInstanceHint > contract_instances
unordered_flat_map< GetBytecodeCommitmentKey, BytecodeCommitmentHint > bytecode_commitments
unordered_flat_map< uint32_t, CreateCheckpointHint > create_checkpoint_hints
unordered_flat_map< uint32_t, CommitCheckpointHint > commit_checkpoint_hints
unordered_flat_map< uint32_t, RevertCheckpointHint > revert_checkpoint_hints
unordered_flat_map< AppendLeavesHintKey, AppendLeavesHint > append_leaves_hints
unordered_flat_map< SequentialInsertHintPublicDataTreeKey, SequentialInsertHint< PublicDataLeafValue > > sequential_insert_hints_public_data_tree
unordered_flat_map< GetLeafPreimageKey, GetLeafPreimageHint< PublicDataTreeLeafPreimage > > get_leaf_preimage_hints_public_data_tree
unordered_flat_map< SequentialInsertHintNullifierTreeKey, SequentialInsertHint< NullifierLeafValue > > sequential_insert_hints_nullifier_tree
unordered_flat_map< GetSiblingPathKey, GetSiblingPathHint > get_sibling_path_hints
unordered_flat_map< GetLeafPreimageKey, GetLeafPreimageHint< NullifierTreeLeafPreimage > > get_leaf_preimage_hints_nullifier_tree
unordered_flat_map< GetLeafValueKey, GetLeafValueHint > get_leaf_value_hints
unordered_flat_map< GetPreviousValueIndexKey, GetPreviousValueIndexHint > get_previous_value_index_hints
std::vector< crypto::merkle_tree::LeafUpdateWitnessData< LeafValueType > > low_leaf_witness_data
std::vector< crypto::merkle_tree::LeafUpdateWitnessData< LeafValueType > > insertion_witness_data