Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(en): Minor node fixes #1978

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1019,9 +1019,12 @@ async fn run_node(

let mut tasks = ManagedTasks::new(task_handles);
tokio::select! {
() = tasks.wait_single() => {},
// We don't want to log unnecessary warnings in `tasks.wait_single()` if we have received a stop signal.
biased;

_ = stop_receiver.changed() => {},
};
() = tasks.wait_single() => {},
}

// Reaching this point means that either some actor exited unexpectedly or we received a stop signal.
// Broadcast the stop signal (in case it wasn't broadcast previously) to all actors and exit.
Expand Down
2 changes: 1 addition & 1 deletion core/lib/web3_decl/src/client/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl L2ClientMetrics {
};
let info = &self.info[&network];
if let Err(err) = info.set(config_labels) {
tracing::warn!(
tracing::debug!(
"Error setting configuration info {:?} for L2 client; already set to {:?}",
err.into_inner(),
info.get()
Expand Down
2 changes: 1 addition & 1 deletion core/lib/web3_decl/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl<Net: Network, C: ClientBase> Client<Net, C> {
origin,
&stats,
);
tracing::warn!(
tracing::debug!(
slowli marked this conversation as resolved.
Show resolved Hide resolved
network = network_label,
component = self.component_name,
%origin,
Expand Down
15 changes: 10 additions & 5 deletions core/lib/web3_decl/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
task::{Context, Poll},
};

use jsonrpsee::core::ClientError;
use jsonrpsee::{core::ClientError, types::error::ErrorCode};
use pin_project_lite::pin_project;
use thiserror::Error;
use zksync_types::{api::SerializationTransactionError, L1BatchNumber, L2BlockNumber};
Expand Down Expand Up @@ -85,10 +85,15 @@ impl EnrichedClientError {

/// Whether the error should be considered transient.
pub fn is_transient(&self) -> bool {
matches!(
self.as_ref(),
ClientError::Transport(_) | ClientError::RequestTimeout
)
match self.as_ref() {
ClientError::Transport(_) | ClientError::RequestTimeout => true,
ClientError::Call(err) => {
// At least some RPC providers use "internal error" in case of the server being overloaded
err.code() == ErrorCode::ServerIsBusy.code()
|| err.code() == ErrorCode::InternalError.code()
}
_ => false,
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/node/consensus/src/era.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub async fn run_en(
let en = en::EN {
pool: ConnectionPool(pool),
sync_state: sync_state.clone(),
client: main_node_client,
client: main_node_client.for_component("block_fetcher"),
};
let res = match cfg {
Some((cfg, secrets)) => en.run(ctx, actions, cfg, secrets).await,
Expand Down
Loading