Skip to content

Commit

Permalink
Merge branch 'feature/gasPrice0' of github.com:invocamanman/sp1-contr…
Browse files Browse the repository at this point in the history
…act-call into feature/gasPrice0
  • Loading branch information
yuwen01 committed Oct 10, 2024
2 parents baee06f + 5da86e3 commit 0c302e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/client-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ where
header,
total_difficulty,
);
// Set the base fee to 0 to enable 0 gas price transactions.
block_env.basefee = U256::from(0);

let mut evm = EvmBuilder::default()
.with_db(db)
.with_cfg_env_with_handler_cfg(cfg_env)
Expand All @@ -113,8 +116,8 @@ where
tx_env.caller = call.caller_address;
tx_env.data = call.calldata.abi_encode().into();
tx_env.gas_limit = header.gas_limit;
// TODO Make the gas price configurable. Right now, it's always set to the base fee.
tx_env.gas_price = U256::from(header.base_fee_per_gas.unwrap());
// Set the gas price to 0 to avoid lack of funds (0) error.
tx_env.gas_price = U256::from(0);
tx_env.transact_to = TxKind::Call(call.contract_address);

evm
Expand Down

0 comments on commit 0c302e6

Please sign in to comment.