Skip to content

Commit

Permalink
graph: change log level for get_block_by_number
Browse files Browse the repository at this point in the history
  • Loading branch information
incrypto32 committed Mar 6, 2025
1 parent 70cd61e commit e727a25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion chain/ethereum/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ async fn fetch_unique_blocks_from_cache(
"Loading {} block(s) not in the block cache",
missing_blocks.len()
);
debug!(logger, "Missing blocks {:?}", missing_blocks);
trace!(logger, "Missing blocks {:?}", missing_blocks.len());
}

(blocks, missing_blocks)
Expand Down Expand Up @@ -878,6 +878,11 @@ impl TriggersAdapterTrait<Chain> for TriggersAdapter {
// even if the firehose is available. If no adapter is available, we will log an error.
// And then fallback to the firehose.
if ENV_VARS.force_rpc_for_block_ptrs {
trace!(
logger,
"Loading blocks from RPC (force_rpc_for_block_ptrs is set)";
"block_numbers" => format!("{:?}", block_numbers)
);
match self.eth_adapters.cheapest_with(&self.capabilities).await {
Ok(adapter) => {
match load_blocks_with_rpc(
Expand Down
2 changes: 1 addition & 1 deletion chain/ethereum/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,6 @@ struct Inner {
genesis_block_number: u64,
#[envconfig(from = "GRAPH_ETH_CALL_NO_GAS", default = "421613,421614")]
eth_call_no_gas: String,
#[envconfig(from = "GRAPH_ETHEREUM_FORCE_RPC_FOR_BLOCK_PTRS", default = "false")]
#[envconfig(from = "GRAPH_ETHEREUM_FORCE_RPC_FOR_BLOCK_PTRS", default = "true")]
force_rpc_for_block_ptrs: EnvVarBoolean,
}
4 changes: 2 additions & 2 deletions graph/src/firehose/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use async_trait::async_trait;
use futures03::{StreamExt, TryStreamExt};
use http0::uri::{Scheme, Uri};
use itertools::Itertools;
use slog::{error, info, Logger};
use slog::{error, info, trace, Logger};
use std::{collections::HashMap, fmt::Display, ops::ControlFlow, sync::Arc, time::Duration};
use tokio::sync::OnceCell;
use tonic::codegen::InterceptedService;
Expand Down Expand Up @@ -451,7 +451,7 @@ impl FirehoseEndpoint {
where
M: prost::Message + BlockchainBlock + Default + 'static,
{
debug!(
trace!(
logger,
"Connecting to firehose to retrieve block for number {}", number;
"provider" => self.provider.as_str(),
Expand Down

0 comments on commit e727a25

Please sign in to comment.