Skip to content

Commit

Permalink
eth-bytecode-db: Add tracing info into 'search_all_sources' request
Browse files Browse the repository at this point in the history
  • Loading branch information
rimrakhimov committed Oct 12, 2023
1 parent 00692ca commit 98d248e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions eth-bytecode-db/eth-bytecode-db-server/src/services/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ impl Database for DatabaseService {
let chain_id = request.chain;
let contract_address = request.address;

tracing::debug!(
contract_address = contract_address,
chain_id = chain_id,
bytecode_type = ?bytecode_type,
bytecode = bytecode,
"search all sources request"
);

let search_sources_task = self.search_sources(bytecode_type, &bytecode);
let search_sourcify_sources_task =
self.search_sourcify_sources(&chain_id, &contract_address);
Expand All @@ -87,6 +95,12 @@ impl Database for DatabaseService {
// Importing contracts from etherscan may be quite expensive operation.
// For that reason, we try to use that approach only if no other sources have been found.
if eth_bytecode_db_sources.is_empty() && sourcify_source.is_none() {
tracing::info!(
contract_address = contract_address,
chain_id = chain_id,
"no sources have been found neither in eth-bytecode-db nor in sourcify.\
Trying to verify from etherscan"
);
let verification_request = sourcify_from_etherscan::VerificationRequest {
address: contract_address,
chain: chain_id,
Expand Down

0 comments on commit 98d248e

Please sign in to comment.