Skip to content

Commit

Permalink
fix(en): do not log error when whitelisted_tokens_for_aa is not suppo…
Browse files Browse the repository at this point in the history
…rted (#1600)

## What ❔

Do not log error when whitelisted_tokens_for_aa is not supported

## Why ❔

Old main node doesn't have this method and EN shouldn't spam errors in
this case.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
perekopskiy committed Apr 8, 2024
1 parent 5fe1abe commit 06c87f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use zksync_state::PostgresStorageCaches;
use zksync_storage::RocksDB;
use zksync_types::L2ChainId;
use zksync_utils::wait_for_tasks::ManagedTasks;
use zksync_web3_decl::{client::L2Client, namespaces::EnNamespaceClient};
use zksync_web3_decl::{client::L2Client, jsonrpsee, namespaces::EnNamespaceClient};

use crate::{
config::{observability::observability_config_from_env, ExternalNodeConfig},
Expand Down Expand Up @@ -445,6 +445,11 @@ async fn run_api(
Ok(tokens) => {
*whitelisted_tokens_for_aa_cache_clone.write().await = tokens;
}
Err(jsonrpsee::core::client::Error::Call(error))
if error.code() == jsonrpsee::types::error::METHOD_NOT_FOUND_CODE =>
{
// Method is not supported by the main node, do nothing.
}
Err(err) => {
tracing::error!(
"Failed to query `whitelisted_tokens_for_aa`, error: {err:?}"
Expand Down

0 comments on commit 06c87f5

Please sign in to comment.