Skip to content

Commit d7a988a

Browse files
authored
chore: remove validate_tx (#76)
1 parent c08eaa4 commit d7a988a

File tree

2 files changed

+9
-389
lines changed

2 files changed

+9
-389
lines changed

crates/ingress-rpc/src/service.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use tracing::{info, warn};
2121

2222
use crate::metrics::{Metrics, record_histogram};
2323
use crate::queue::QueuePublisher;
24-
use crate::validation::{AccountInfoLookup, L1BlockInfoLookup, validate_bundle, validate_tx};
24+
use crate::validation::validate_bundle;
2525
use crate::{Config, TxSubmissionMethod};
2626

2727
#[rpc(server, namespace = "eth")]
@@ -140,7 +140,7 @@ where
140140

141141
async fn send_raw_transaction(&self, data: Bytes) -> RpcResult<B256> {
142142
let start = Instant::now();
143-
let transaction = self.validate_tx(&data).await?;
143+
let transaction = self.get_tx(&data).await?;
144144

145145
let send_to_kafka = matches!(
146146
self.tx_submission_method,
@@ -224,8 +224,7 @@ impl<Queue> IngressService<Queue>
224224
where
225225
Queue: QueuePublisher + Sync + Send + 'static,
226226
{
227-
async fn validate_tx(&self, data: &Bytes) -> RpcResult<Recovered<OpTxEnvelope>> {
228-
let start = Instant::now();
227+
async fn get_tx(&self, data: &Bytes) -> RpcResult<Recovered<OpTxEnvelope>> {
229228
if data.is_empty() {
230229
return Err(EthApiError::EmptyRawTransactionData.into_rpc_err());
231230
}
@@ -237,17 +236,6 @@ where
237236
.clone()
238237
.try_into_recovered()
239238
.map_err(|_| EthApiError::FailedToDecodeSignedTransaction.into_rpc_err())?;
240-
241-
let mut l1_block_info = self.provider.fetch_l1_block_info().await?;
242-
let account = self
243-
.provider
244-
.fetch_account_info(transaction.signer())
245-
.await?;
246-
validate_tx(account, &transaction, data, &mut l1_block_info).await?;
247-
248-
self.metrics
249-
.validate_tx_duration
250-
.record(start.elapsed().as_secs_f64());
251239
Ok(transaction)
252240
}
253241

@@ -263,7 +251,7 @@ where
263251
let mut total_gas = 0u64;
264252
let mut tx_hashes = Vec::new();
265253
for tx_data in &bundle.txs {
266-
let transaction = self.validate_tx(tx_data).await?;
254+
let transaction = self.get_tx(tx_data).await?;
267255
total_gas = total_gas.saturating_add(transaction.gas_limit());
268256
tx_hashes.push(transaction.tx_hash());
269257
}

0 commit comments

Comments
 (0)