Skip to content

Commit 776897b

Browse files
authored
chore: account for auths in 7702 min estimated gas (#10512)
1 parent 58297d3 commit 776897b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/anvil/src/eth/api.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ use futures::{
9494
StreamExt,
9595
};
9696
use parking_lot::RwLock;
97-
use revm::primitives::Bytecode;
97+
use revm::primitives::{eip7702::PER_EMPTY_ACCOUNT_COST, Bytecode};
9898
use std::{future::Future, sync::Arc, time::Duration};
9999
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver};
100100

@@ -3208,7 +3208,10 @@ fn determine_base_gas_by_kind(request: &WithOtherFields<TransactionRequest>) ->
32083208
TxKind::Call(_) => MIN_TRANSACTION_GAS,
32093209
TxKind::Create => MIN_CREATE_GAS,
32103210
},
3211-
TypedTransactionRequest::EIP7702(_) => MIN_TRANSACTION_GAS,
3211+
TypedTransactionRequest::EIP7702(req) => {
3212+
MIN_TRANSACTION_GAS +
3213+
req.authorization_list.len() as u128 * PER_EMPTY_ACCOUNT_COST as u128
3214+
}
32123215
TypedTransactionRequest::EIP2930(req) => match req.to {
32133216
TxKind::Call(_) => MIN_TRANSACTION_GAS,
32143217
TxKind::Create => MIN_CREATE_GAS,

0 commit comments

Comments
 (0)