39 FF fee_required_da =
FF(
tx.effective_gas_fees.fee_per_da_gas) *
FF(
tx.gas_settings.gas_limits.da_gas);
40 FF fee_required_l2 =
FF(
tx.effective_gas_fees.fee_per_l2_gas) *
FF(
tx.gas_settings.gas_limits.l2_gas);
47 cpp_result = cpp_simulator.simulate(*
ws_mgr,
55 }
catch (
const std::exception& e) {
56 throw std::runtime_error(std::string(
"CppSimulator threw an exception: ") + e.what());
74 throw std::runtime_error(
"Simulator results are different");
76 fuzz_info(
"Simulator results match successfully");
const bool IS_STATIC_CALL
std::shared_ptr< Napi::ThreadSafeFunction > bytecode
StrictMock< MockContractDB > contract_db
uses barretenberg/vm2 to simulate the bytecode
uses the yarn-project/simulator to simulate the bytecode Singleton, because initializing the simulato...
SimulatorResult simulate(fuzzer::FuzzerWorldStateManager &ws_mgr, fuzzer::FuzzerContractDB &contract_db, const Tx &tx, const GlobalVariables &globals, const std::vector< bb::crypto::merkle_tree::PublicDataLeafValue > &public_data_writes, const std::vector< FF > ¬e_hashes, const ProtocolContracts &protocol_contracts) override
static JsSimulator * getInstance()
static FuzzerWorldStateManager * getInstance()
void write_fee_payer_balance(const AztecAddress &fee_payer, const FF &balance)
AztecAddress contract_address
SimulatorResult fuzz_against_ts_simulator(FuzzerData &fuzzer_data, FuzzerContext &context)
fuzz CPP vs JS simulator with the given fuzzer data
FuzzerWorldStateManager * ws_mgr
bool compare_simulator_results(SimulatorResult &result1, SimulatorResult &result2)
Tx create_default_tx(const AztecAddress &contract_address, const AztecAddress &sender_address, const std::vector< FF > &calldata, const FF &transaction_fee, bool is_static_call, const Gas &gas_limit)
GlobalVariables create_default_globals()
describes the data which will be used for fuzzing Should contain instructions, calldata,...
ReturnOptions return_options
std::vector< bb::avm2::FF > calldata
std::vector< CFGInstruction > cfg_instructions
std::vector< InstructionBlock > instruction_blocks