Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix: testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko committed Sep 6, 2023
1 parent 99ff3ef commit 0dee923
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion geth-utils/gethutil/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
executionResults := make([]*ExecutionResult, len(config.Transactions))
for i, message := range messages {
tracer := logger.NewStructLogger(config.LoggerConfig)
evm := vm.NewEVM(blockCtx, core.NewEVMTxContext(&message), stateDB, &chainConfig, vm.Config{Tracer: tracer, NoBaseFee: true})
evm := vm.NewEVM(blockCtx, core.NewEVMTxContext(&message), stateDB, &chainConfig, vm.Config{Tracer: tracer})

result, err := core.ApplyMessage(evm, &message, new(core.GasPool).AddGas(message.GasLimit))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion mock/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Default for MockTransaction {
max_priority_fee_per_gas: *MOCK_GASTIPCAP,
max_fee_per_gas: *MOCK_GASFEECAP,
chain_id: *MOCK_CHAIN_ID,
enable_skipping_invalid_tx: false,
enable_skipping_invalid_tx: true,
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions zkevm-circuits/src/evm_circuit/execution/begin_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,16 +675,10 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
call.is_persistent,
)?;

let intrinsic_gas = select::value(
F::from(tx.is_create as u64),
F::from(GasCost::CREATION_TX.as_u64()),
F::from(GasCost::TX.as_u64()),
) + F::from(tx.call_data_gas_cost)
+ F::from(tx.access_list_gas_cost);

let intrinsic_gas = if tx.invalid_tx { 0 } else { step.gas_cost.0 };
// Check gas_left is sufficient
self.is_gas_not_enough
.assign(region, offset, F::from(tx.gas), intrinsic_gas)?;
.assign(region, offset, F::from(tx.gas), F::from(intrinsic_gas))?;

// Transfer value from caller to callee, creating account if necessary.
let (intrinsic_tx_value, intrinsic_gas_fee) = if !tx.invalid_tx {
Expand Down Expand Up @@ -1188,7 +1182,7 @@ mod test {
let to = MOCK_ACCOUNTS[0];
let from = MOCK_ACCOUNTS[1];

let balance = gwei(1) + Word::from(10u64.pow(5));
let balance = Word::from(1) + Word::from(10u64.pow(5));
let ctx = TestContext::<2, 2>::new(
None,
|accs| {
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/end_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ mod test {
// EndBlocks at the end after the trace steps
#[test]
fn end_block_padding() {
test_circuit(50);
test_circuit(55);
}
}

0 comments on commit 0dee923

Please sign in to comment.