diff --git a/crates/core/src/provider/evm_provider.rs b/crates/core/src/provider/evm_provider.rs index 7036f38c..cbbbea76 100644 --- a/crates/core/src/provider/evm_provider.rs +++ b/crates/core/src/provider/evm_provider.rs @@ -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); diff --git a/crates/core/src/transaction/queue_system/transactions_queue.rs b/crates/core/src/transaction/queue_system/transactions_queue.rs index f1ccee2a..c931cb2c 100644 --- a/crates/core/src/transaction/queue_system/transactions_queue.rs +++ b/crates/core/src/transaction/queue_system/transactions_queue.rs @@ -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!( diff --git a/crates/core/src/transaction/queue_system/transactions_queues.rs b/crates/core/src/transaction/queue_system/transactions_queues.rs index cdbdbcdb..9c9f9281 100644 --- a/crates/core/src/transaction/queue_system/transactions_queues.rs +++ b/crates/core/src/transaction/queue_system/transactions_queues.rs @@ -523,9 +523,9 @@ impl TransactionsQueues { gas_price: &GasPriceResult, blob_gas_price: Option<&BlobGasPriceResult>, ) -> Result { - // 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)