diff --git a/contracts b/contracts
index 84d5e3716f6..9fb1264fce8 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit 84d5e3716f645909e8144c7d50af9dd6dd9ded62
+Subproject commit 9fb1264fce8c0ebeefe8bf1846e89876027161d2
diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs
index 70803a66311..0a94f993656 100644
--- a/core/bin/external_node/src/config/mod.rs
+++ b/core/bin/external_node/src/config/mod.rs
@@ -1,6 +1,7 @@
use std::{
env,
ffi::OsString,
+ future::Future,
num::{NonZeroU32, NonZeroU64, NonZeroUsize},
path::PathBuf,
time::Duration,
@@ -24,7 +25,7 @@ use zksync_core_leftovers::temp_config_store::read_yaml_repr;
use zksync_dal::{ConnectionPool, Core};
use zksync_metadata_calculator::MetadataCalculatorRecoveryConfig;
use zksync_node_api_server::{
- tx_sender::TxSenderConfig,
+ tx_sender::{TimestampAsserterParams, TxSenderConfig},
web3::{state::InternalApiConfig, Namespace},
};
use zksync_protobuf_config::proto;
@@ -121,6 +122,7 @@ pub(crate) struct RemoteENConfig {
pub l1_weth_bridge_addr: Option
,
pub l2_weth_bridge_addr: Option,
pub l2_testnet_paymaster_addr: Option,
+ pub l2_timestamp_asserter_addr: Option,
pub base_token_addr: Address,
pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode,
pub dummy_verifier: bool,
@@ -146,22 +148,19 @@ impl RemoteENConfig {
.get_main_contract()
.rpc_context("get_main_contract")
.await?;
- let base_token_addr = match client.get_base_token_l1_address().await {
- Err(ClientError::Call(err))
- if [
- ErrorCode::MethodNotFound.code(),
- // This what `Web3Error::NotImplemented` gets
- // `casted` into in the `api` server.
- ErrorCode::InternalError.code(),
- ]
- .contains(&(err.code())) =>
- {
- // This is the fallback case for when the EN tries to interact
- // with a node that does not implement the `zks_baseTokenL1Address` endpoint.
- ETHEREUM_ADDRESS
- }
- response => response.context("Failed to fetch base token address")?,
- };
+
+ let timestamp_asserter_address = handle_rpc_response_with_fallback(
+ client.get_timestamp_asserter(),
+ None,
+ "Failed to fetch timestamp asserter address".to_string(),
+ )
+ .await?;
+ let base_token_addr = handle_rpc_response_with_fallback(
+ client.get_base_token_l1_address(),
+ ETHEREUM_ADDRESS,
+ "Failed to fetch base token address".to_string(),
+ )
+ .await?;
// These two config variables should always have the same value.
// TODO(EVM-578): double check and potentially forbid both of them being `None`.
@@ -206,6 +205,7 @@ impl RemoteENConfig {
.as_ref()
.map(|a| a.dummy_verifier)
.unwrap_or_default(),
+ l2_timestamp_asserter_addr: timestamp_asserter_address,
})
}
@@ -227,10 +227,36 @@ impl RemoteENConfig {
l2_legacy_shared_bridge_addr: Some(Address::repeat_byte(7)),
l1_batch_commit_data_generator_mode: L1BatchCommitmentMode::Rollup,
dummy_verifier: true,
+ l2_timestamp_asserter_addr: None,
}
}
}
+async fn handle_rpc_response_with_fallback(
+ rpc_call: F,
+ fallback: T,
+ context: String,
+) -> anyhow::Result
+where
+ F: Future