Skip to content

Commit

Permalink
fix: inc cumulative gas before post state update (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkaufmann authored Aug 4, 2023
1 parent 66fa2b4 commit 43802a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ fn build_on_state<S: StateProvider, I: Iterator<Item = (BundleId, BundleCompact)

commit_state_changes(&mut db, &mut post_state, block_num, state, true);

cumulative_gas_used += result.gas_used();

post_state.add_receipt(
block_num,
Receipt {
Expand All @@ -534,8 +536,6 @@ fn build_on_state<S: StateProvider, I: Iterator<Item = (BundleId, BundleCompact)
},
);

cumulative_gas_used += result.gas_used();

let miner_fee = tx
.effective_tip_per_gas(base_fee)
.ok_or(InvalidTransaction::GasPriceLessThanBasefee)
Expand Down

0 comments on commit 43802a7

Please sign in to comment.