Improve eth1 fallback logging (#2096)
## Issue Addressed N/A ## Proposed Changes There seemed to be confusion among discord users on the eth1 fallback logging ``` WARN Error connecting to eth1 node. Trying fallback ..., endpoint: http://127.0.0.1:8545/, service: eth1_rpc ``` The assumption users seem to be making here is that it is trying the fallback and fallback=endpoint in the log. This PR improves the logging to be like ``` WARN Error connecting to eth1 node endpoint, endpoint: http://127.0.0.1:8545/, action: trying fallbacks, service: eth1_rpc ``` I think this is a bit more clear that the endpoint that failed is the one in the log.
This commit is contained in:
parent
11c299cbf6
commit
63eeb14a81
@ -139,8 +139,9 @@ async fn endpoint_state(
|
|||||||
let error_connecting = |_| {
|
let error_connecting = |_| {
|
||||||
warn!(
|
warn!(
|
||||||
log,
|
log,
|
||||||
"Error connecting to eth1 node. Trying fallback ...";
|
"Error connecting to eth1 node endpoint";
|
||||||
"endpoint" => endpoint,
|
"endpoint" => endpoint,
|
||||||
|
"action" => "trying fallbacks"
|
||||||
);
|
);
|
||||||
EndpointError::NotReachable
|
EndpointError::NotReachable
|
||||||
};
|
};
|
||||||
@ -150,9 +151,9 @@ async fn endpoint_state(
|
|||||||
if &network_id != config_network_id {
|
if &network_id != config_network_id {
|
||||||
warn!(
|
warn!(
|
||||||
log,
|
log,
|
||||||
"Invalid eth1 network id. Please switch to correct network id. Trying \
|
"Invalid eth1 network id on endpoint. Please switch to correct network id";
|
||||||
fallback ...";
|
|
||||||
"endpoint" => endpoint,
|
"endpoint" => endpoint,
|
||||||
|
"action" => "trying fallbacks",
|
||||||
"expected" => format!("{:?}",config_network_id),
|
"expected" => format!("{:?}",config_network_id),
|
||||||
"received" => format!("{:?}",network_id),
|
"received" => format!("{:?}",network_id),
|
||||||
);
|
);
|
||||||
@ -168,15 +169,16 @@ async fn endpoint_state(
|
|||||||
log,
|
log,
|
||||||
"Remote eth1 node is not synced";
|
"Remote eth1 node is not synced";
|
||||||
"endpoint" => endpoint,
|
"endpoint" => endpoint,
|
||||||
|
"action" => "trying fallbacks"
|
||||||
);
|
);
|
||||||
return Err(EndpointError::FarBehind);
|
return Err(EndpointError::FarBehind);
|
||||||
}
|
}
|
||||||
if &chain_id != config_chain_id {
|
if &chain_id != config_chain_id {
|
||||||
warn!(
|
warn!(
|
||||||
log,
|
log,
|
||||||
"Invalid eth1 chain id. Please switch to correct chain id. Trying \
|
"Invalid eth1 chain id. Please switch to correct chain id on endpoint";
|
||||||
fallback ...";
|
|
||||||
"endpoint" => endpoint,
|
"endpoint" => endpoint,
|
||||||
|
"action" => "trying fallbacks",
|
||||||
"expected" => format!("{:?}",config_chain_id),
|
"expected" => format!("{:?}",config_chain_id),
|
||||||
"received" => format!("{:?}", chain_id),
|
"received" => format!("{:?}", chain_id),
|
||||||
);
|
);
|
||||||
@ -215,16 +217,22 @@ async fn get_remote_head_and_new_block_ranges(
|
|||||||
if remote_head_block.timestamp + node_far_behind_seconds < now {
|
if remote_head_block.timestamp + node_far_behind_seconds < now {
|
||||||
warn!(
|
warn!(
|
||||||
service.log,
|
service.log,
|
||||||
"Eth1 endpoint is far behind. Trying fallback ...";
|
"Eth1 endpoint is not synced";
|
||||||
"endpoint" => endpoint,
|
"endpoint" => endpoint,
|
||||||
"last_seen_block_unix_timestamp" => remote_head_block.timestamp
|
"last_seen_block_unix_timestamp" => remote_head_block.timestamp,
|
||||||
|
"action" => "trying fallback"
|
||||||
);
|
);
|
||||||
return Err(SingleEndpointError::EndpointError(EndpointError::FarBehind));
|
return Err(SingleEndpointError::EndpointError(EndpointError::FarBehind));
|
||||||
}
|
}
|
||||||
|
|
||||||
let handle_remote_not_synced = |e| {
|
let handle_remote_not_synced = |e| {
|
||||||
if let SingleEndpointError::RemoteNotSynced { .. } = e {
|
if let SingleEndpointError::RemoteNotSynced { .. } = e {
|
||||||
warn!(service.log, "Eth1 node not synced. Trying fallback..."; "endpoint" => endpoint);
|
warn!(
|
||||||
|
service.log,
|
||||||
|
"Eth1 endpoint is not synced";
|
||||||
|
"endpoint" => endpoint,
|
||||||
|
"action" => "trying fallbacks"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
e
|
e
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user