too loud of logging

This commit is contained in:
Bryan Stitt 2022-05-07 04:42:47 +00:00
parent 8d5f0cee69
commit d6f29836c6
2 changed files with 14 additions and 4 deletions

View File

@ -209,7 +209,7 @@ impl Web3Connection {
if let Some(connections) = &connections {
connections.update_synced_rpcs(&self)?;
} else {
info!("new head block from {}: {}", self, block_number);
info!("new head block {} from {}", block_number, self);
}
while let Some(new_block) = stream.next().await {
@ -295,10 +295,20 @@ impl ActiveRequestHandle {
method: &str,
params: &serde_json::value::RawValue,
) -> Result<Box<RawValue>, ethers::prelude::ProviderError> {
match &self.0.provider {
// TODO: this should probably be trace level and use a span
// TODO: it would be nice to have the request id on this
info!("Sending {}({}) to {}", method, params.to_string(), self.0);
let response = match &self.0.provider {
Web3Provider::Http(provider) => provider.request(method, params).await,
Web3Provider::Ws(provider) => provider.request(method, params).await,
}
};
// TODO: i think ethers already has trace logging (and does it much more fancy)
// TODO: at least instrument this with more useful information
info!("Response from {}: {:?}", self.0, response);
response
}
}

View File

@ -216,7 +216,7 @@ impl Web3Connections {
atomic::Ordering::Acquire,
) {
Ok(_) => {
info!("new head block from {}: {}", rpc, new_block);
info!("new head block {} from {}", new_block, rpc);
}
Err(current_best_block_number) => {
// actually, there was a race and this ended up not being the latest block. return now without adding this rpc to the synced list