26 [[maybe_unused]]
index_t leaf_index)
const
28 throw_or_abort(
"FuzzerLowLevelDB::get_sibling_path not implemented");
34 for (
size_t i = 0; i < value_sorted_leaves.size(); ++i) {
35 if (value_sorted_leaves[i].first ==
value) {
36 return value_sorted_leaves[i];
38 if (value_sorted_leaves[i].first >
value) {
39 return value_sorted_leaves[i - 1];
43 return value_sorted_leaves.back();
49 case MerkleTreeId::NULLIFIER_TREE: {
54 case MerkleTreeId::PUBLIC_DATA_TREE: {
67 case MerkleTreeId::NULLIFIER_TREE:
69 case MerkleTreeId::PUBLIC_DATA_TREE:
71 case MerkleTreeId::NOTE_HASH_TREE:
84 auto it = std::ranges::find_if(
86 return pair.second == value_index_pair.second;
89 throw_or_abort(
"FuzzerLowLevelDB::get_leaf_preimage_public_data_tree: leaf not found in public_data_slots");
96 auto [next_value, next_index] = *it;
105 auto it = std::ranges::find_if(
107 return pair.second == value_index_pair.second;
110 throw_or_abort(
"FuzzerLowLevelDB::get_leaf_preimage_nullifier_tree: leaf not found in nullifier_values");
119 auto [next_value, next_index] = *it;
181 auto contract_nullifier =
197 .initialization_hash =
FF(0),
199 .nullifier_key = {
FF(0),
FF(0) },
200 .incoming_viewing_key = {
FF(0),
FF(0) },
201 .outgoing_viewing_key = {
FF(0),
FF(0) },
202 .tagging_key = {
FF(0),
FF(0) },
214 .private_functions_root =
FF(0),
257 { simulation::MerkleTreeId::NULLIFIER_TREE, 128 },
258 { simulation::MerkleTreeId::PUBLIC_DATA_TREE, 128 },
260 uint32_t initial_header_generator_point = 28;
291 ws->insert_indexed_leaves<
NullifierLeafValue>(MerkleTreeId::NULLIFIER_TREE, { contract_nullifier }, fork_id);
std::shared_ptr< Napi::ThreadSafeFunction > instance
#define L1_TO_L2_MSG_TREE_HEIGHT
#define NULLIFIER_TREE_HEIGHT
#define CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS
#define NOTE_HASH_TREE_HEIGHT
#define PUBLIC_DATA_TREE_HEIGHT
std::optional< ContractClass > get_contract_class(const ContractClassId &class_id) const override
void add_contracts(const ContractDeploymentData &contract_deployment_data) override
void revert_checkpoint() override
std::optional< ContractInstance > get_contract_instance(const AztecAddress &address) const override
ContractDBInterface methods.
void commit_checkpoint() override
void create_checkpoint() override
std::optional< FF > get_bytecode_commitment(const ContractClassId &class_id) const override
std::optional< std::string > get_debug_function_name(const AztecAddress &address, const FunctionSelector &selector) const override
std::vector< uint8_t > bytecode
simulation::SequentialInsertionResult< NullifierLeafValue > insert_indexed_leaves_nullifier_tree(const NullifierLeafValue &leaf_value) override
std::vector< std::pair< FF, index_t > > public_data_slots
uint32_t get_checkpoint_id() const override
TreeSnapshots get_tree_roots() const override
uint64_t next_available_nullifier_index
std::unordered_map< index_t, PublicDataLeafValue > public_data_leaves
std::vector< FF > note_hash_leaves
void create_checkpoint() override
uint64_t next_available_public_data_index
uint64_t next_available_note_hash_index
void pad_tree(simulation::MerkleTreeId tree_id, size_t num_leaves) override
std::vector< simulation::AppendLeafResult > append_leaves(simulation::MerkleTreeId tree_id, std::span< const FF > leaves) override
simulation::SiblingPath get_sibling_path(simulation::MerkleTreeId tree_id, index_t leaf_index) const override
std::unordered_map< index_t, NullifierLeafValue > nullifier_leaves
FF get_leaf_value(simulation::MerkleTreeId tree_id, index_t leaf_index) const override
std::vector< std::pair< FF, index_t > > nullifier_values
void revert_checkpoint() override
void commit_checkpoint() override
GetLowIndexedLeafResponse get_low_indexed_leaf(simulation::MerkleTreeId tree_id, const FF &value) const override
simulation::IndexedLeaf< PublicDataLeafValue > get_leaf_preimage_public_data_tree(index_t leaf_index) const override
simulation::SequentialInsertionResult< PublicDataLeafValue > insert_indexed_leaves_public_data_tree(const PublicDataLeafValue &leaf_value) override
void insert_contract_address(const AztecAddress &contract_address)
simulation::IndexedLeaf< NullifierLeafValue > get_leaf_preimage_nullifier_tree(index_t leaf_index) const override
std::pair< FF, index_t > get_indexed_low_leaf_helper(const std::vector< std::pair< FF, index_t > > &value_sorted_leaves, const FF &value) const
static constexpr const char * DATA_DIR
std::unique_ptr< world_state::WorldState > ws
void initialize_world_state()
world_state::WorldStateRevision fork()
void register_contract_address(const AztecAddress &contract_address)
static constexpr uint64_t MAP_SIZE_KB
std::stack< uint64_t > fork_ids
static FuzzerWorldStateManager * instance
FuzzerWorldStateManager methods.
world_state::WorldStateRevision get_current_revision() const
AztecAddress contract_address
::bb::crypto::merkle_tree::fr_sibling_path SiblingPath
FF unconstrained_silo_nullifier(const AztecAddress &contract_address, const FF &nullifier)
::bb::crypto::merkle_tree::index_t index_t
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
AppendOnlyTreeSnapshot l1_to_l2_message_tree
void throw_or_abort(std::string const &err)