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 }
catch (
const std::exception& e) {
48 throw std::runtime_error(std::string(
"CppSimulator threw an exception: ") + e.what());
60 throw std::runtime_error(
"Simulator results are different");
62 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...
static JsSimulator * getInstance()
SimulatorResult simulate(fuzzer::FuzzerWorldStateManager &ws_mgr, fuzzer::FuzzerContractDB &contract_db, const Tx &tx) override
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)
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< std::vector< FuzzInstruction > > instruction_blocks