Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/core/src/provider/evm_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ impl EvmProvider {
let mut request: TransactionRequest = transaction.clone().into();
// need from here else it will fail gas estimating
request.from = Some(from.into_address());
// Omit the gas limit so the node uses the block gas limit as the estimation
// ceiling. Passing a fixed cap risks failing the estimate for heavy transactions.
request.gas = None;

let request_with_other = WithOtherFields::new(request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,9 @@ impl TransactionsQueue {
working_transaction.value = TransactionValue::zero();
}

// Estimate gas limit by creating a temporary transaction with a high gas limit to avoid failing the estimate
let temp_gas_limit = GasLimit::new(10_000_000);
// Build a temporary transaction for gas estimation. The gas limit here is a
// placeholder only — `estimate_gas` omits it so the node uses the block gas limit.
let temp_gas_limit = GasLimit::new(0);

let temp_transaction_request = if working_transaction.is_blob_transaction() {
info!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,9 @@ impl TransactionsQueues {
gas_price: &GasPriceResult,
blob_gas_price: Option<&BlobGasPriceResult>,
) -> Result<GasLimit, AddTransactionError> {
// Use a reasonable temporary limit for gas estimation
const TEMP_GAS_LIMIT: u128 = 1_000_000;
let temp_gas_limit = GasLimit::new(TEMP_GAS_LIMIT);
// Build a temporary transaction for gas estimation. The gas limit here is a
// placeholder only — `estimate_gas` omits it so the node uses the block gas limit.
let temp_gas_limit = GasLimit::new(0);

let current_onchain_nonce = transactions_queue.get_nonce().await.map_err(|e| {
AddTransactionError::CouldNotGetCurrentOnChainNonce(transaction.relayer_id, e)
Expand Down
Loading