Skip to content

Commit 5d0c237

Browse files
committed
log provider name when fetching receipts
1 parent d2c5af5 commit 5d0c237

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,12 +1416,19 @@ impl EthereumAdapterTrait for EthereumAdapter {
14161416
)
14171417
.await;
14181418

1419-
fetch_receipts_with_retry(web3, hashes, block_hash, logger, supports_block_receipts)
1420-
.await
1421-
.map(|transaction_receipts| EthereumBlock {
1422-
block: Arc::new(block),
1423-
transaction_receipts,
1424-
})
1419+
fetch_receipts_with_retry(
1420+
web3,
1421+
hashes,
1422+
block_hash,
1423+
logger,
1424+
supports_block_receipts,
1425+
&self.provider,
1426+
)
1427+
.await
1428+
.map(|transaction_receipts| EthereumBlock {
1429+
block: Arc::new(block),
1430+
transaction_receipts,
1431+
})
14251432
}
14261433

14271434
async fn block_hash_by_block_number(
@@ -2331,11 +2338,12 @@ async fn fetch_receipts_with_retry(
23312338
block_hash: H256,
23322339
logger: Logger,
23332340
supports_block_receipts: bool,
2341+
provider: &str,
23342342
) -> Result<Vec<Arc<TransactionReceipt>>, IngestorError> {
23352343
if supports_block_receipts {
23362344
return fetch_block_receipts_with_retry(web3, hashes, block_hash, logger).await;
23372345
}
2338-
fetch_individual_receipts_with_retry(web3, hashes, block_hash, logger).await
2346+
fetch_individual_receipts_with_retry(web3, hashes, block_hash, logger, provider).await
23392347
}
23402348

23412349
// Fetches receipts for each transaction in the block individually.
@@ -2344,6 +2352,7 @@ async fn fetch_individual_receipts_with_retry(
23442352
hashes: Vec<H256>,
23452353
block_hash: H256,
23462354
logger: Logger,
2355+
provider: &str,
23472356
) -> Result<Vec<Arc<TransactionReceipt>>, IngestorError> {
23482357
if ENV_VARS.fetch_receipts_in_batches {
23492358
return fetch_transaction_receipts_in_batch_with_retry(web3, hashes, block_hash, logger)
@@ -2359,6 +2368,7 @@ async fn fetch_individual_receipts_with_retry(
23592368
tx_hash,
23602369
block_hash,
23612370
logger.cheap_clone(),
2371+
provider,
23622372
)
23632373
})
23642374
.buffered(ENV_VARS.block_ingestor_max_concurrent_json_rpc_calls);
@@ -2419,11 +2429,12 @@ async fn fetch_transaction_receipt_with_retry(
24192429
transaction_hash: H256,
24202430
block_hash: H256,
24212431
logger: Logger,
2432+
provider: &str,
24222433
) -> Result<Arc<TransactionReceipt>, IngestorError> {
24232434
let logger = logger.cheap_clone();
24242435
let retry_log_message = format!(
2425-
"eth_getTransactionReceipt RPC call for transaction {:?}",
2426-
transaction_hash
2436+
"eth_getTransactionReceipt RPC call for transaction {:?} from provider {}",
2437+
transaction_hash, provider
24272438
);
24282439
retry(retry_log_message, &logger)
24292440
.redact_log_urls(true)
@@ -2602,6 +2613,7 @@ async fn get_transaction_receipts_for_transaction_hashes(
26022613
*transaction_hash,
26032614
*block_hash,
26042615
logger.cheap_clone(),
2616+
&adapter.provider,
26052617
);
26062618
receipt_futures.push(receipt_future)
26072619
}

0 commit comments

Comments
 (0)