diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs
index 821df0a06de6..dad2f3a87f60 100644
--- a/core/bin/external_node/src/config/mod.rs
+++ b/core/bin/external_node/src/config/mod.rs
@@ -111,7 +111,7 @@ pub(crate) struct RemoteENConfig {
// a different name, with names adapted only for consistency.
pub l1_shared_bridge_proxy_addr: Option
,
pub l2_shared_bridge_addr: Option,
- pub l2_legacy_shared_bridge_addr: Option,
+ pub l2_token_deployer_addr: Option,
pub l1_erc20_bridge_proxy_addr: Option,
pub l2_erc20_bridge_addr: Option,
pub l1_weth_bridge_addr: Option,
@@ -122,7 +122,6 @@ pub(crate) struct RemoteENConfig {
pub dummy_verifier: bool,
pub user_facing_bridgehub: Option,
- pub l2_native_token_vault_proxy_addr: Option,
}
impl RemoteENConfig {
@@ -135,14 +134,6 @@ impl RemoteENConfig {
.get_testnet_paymaster()
.rpc_context("get_testnet_paymaster")
.await?;
- let l2_native_token_vault_proxy_addr = client
- .get_native_token_vault_proxy_addr()
- .rpc_context("get_native_token_vault")
- .await?;
- let l2_legacy_shared_bridge_addr = client
- .get_legacy_shared_bridge()
- .rpc_context("get_legacy_shared_bridge")
- .await?;
let genesis = client.genesis_config().rpc_context("genesis").await.ok();
let ecosystem_contracts = client
.get_ecosystem_contracts()
@@ -208,7 +199,7 @@ impl RemoteENConfig {
l2_erc20_bridge_addr: l2_erc20_default_bridge,
l1_shared_bridge_proxy_addr: bridges.l1_shared_default_bridge,
l2_shared_bridge_addr: l2_erc20_shared_bridge,
- l2_legacy_shared_bridge_addr,
+ l2_token_deployer_addr: bridges.l2_token_deployer,
l1_weth_bridge_addr: bridges.l1_weth_bridge,
l2_weth_bridge_addr: bridges.l2_weth_bridge,
base_token_addr,
@@ -220,7 +211,6 @@ impl RemoteENConfig {
.as_ref()
.map(|a| a.dummy_verifier)
.unwrap_or_default(),
- l2_native_token_vault_proxy_addr,
})
}
@@ -240,10 +230,9 @@ impl RemoteENConfig {
l1_shared_bridge_proxy_addr: Some(Address::repeat_byte(5)),
l1_weth_bridge_addr: None,
l2_shared_bridge_addr: Some(Address::repeat_byte(6)),
- l2_legacy_shared_bridge_addr: Some(Address::repeat_byte(7)),
+ l2_token_deployer_addr: Some(Address::repeat_byte(6)),
l1_batch_commit_data_generator_mode: L1BatchCommitmentMode::Rollup,
dummy_verifier: true,
- l2_native_token_vault_proxy_addr: Some(Address::repeat_byte(7)),
}
}
}
@@ -1417,6 +1406,7 @@ impl From<&ExternalNodeConfig> for InternalApiConfig {
l2_shared_default_bridge: config.remote.l2_shared_bridge_addr,
l1_weth_bridge: config.remote.l1_weth_bridge_addr,
l2_weth_bridge: config.remote.l2_weth_bridge_addr,
+ l2_token_deployer: config.remote.l2_token_deployer_addr,
},
bridgehub_proxy_addr: config.remote.bridgehub_proxy_addr,
state_transition_proxy_addr: config.remote.state_transition_proxy_addr,
@@ -1430,8 +1420,6 @@ impl From<&ExternalNodeConfig> for InternalApiConfig {
filters_disabled: config.optional.filters_disabled,
dummy_verifier: config.remote.dummy_verifier,
l1_batch_commit_data_generator_mode: config.remote.l1_batch_commit_data_generator_mode,
- l2_native_token_vault_proxy_addr: config.remote.l2_native_token_vault_proxy_addr,
- l2_legacy_shared_bridge_addr: config.remote.l2_legacy_shared_bridge_addr,
}
}
}
diff --git a/core/bin/external_node/src/node_builder.rs b/core/bin/external_node/src/node_builder.rs
index 70912552d93d..4a5c143b275f 100644
--- a/core/bin/external_node/src/node_builder.rs
+++ b/core/bin/external_node/src/node_builder.rs
@@ -192,18 +192,7 @@ impl ExternalNodeBuilder {
const OPTIONAL_BYTECODE_COMPRESSION: bool = true;
let persistence_layer = OutputHandlerLayer::new(
- self.config
- .remote
- .l2_shared_bridge_addr
- .expect("L2 shared bridge address is not set"),
- self.config
- .remote
- .l2_native_token_vault_proxy_addr
- .expect("L2 native token vault proxy address is not set"),
- self.config
- .remote
- .l2_legacy_shared_bridge_addr
- .expect("L2 legacy shared bridge address is not set"),
+ self.config.remote.l2_token_deployer_addr,
self.config.optional.l2_block_seal_queue_capacity,
)
.with_pre_insert_txs(true) // EN requires txs to be pre-inserted.
diff --git a/core/bin/zksync_server/src/node_builder.rs b/core/bin/zksync_server/src/node_builder.rs
index 763fd600e6fa..01eea137b575 100644
--- a/core/bin/zksync_server/src/node_builder.rs
+++ b/core/bin/zksync_server/src/node_builder.rs
@@ -240,15 +240,7 @@ impl MainNodeBuilder {
let wallets = self.wallets.clone();
let sk_config = try_load_config!(self.configs.state_keeper_config);
let persistence_layer = OutputHandlerLayer::new(
- self.contracts_config
- .l2_shared_bridge_addr
- .context("L2 shared bridge address")?,
- self.contracts_config
- .l2_native_token_vault_proxy_addr
- .context("L2 native token vault proxy address")?,
- self.contracts_config
- .l2_legacy_shared_bridge_addr
- .context("L2 legacy shared bridge address")?,
+ self.contracts_config.l2_shared_bridge_addr,
sk_config.l2_block_seal_queue_capacity,
)
.with_protective_reads_persistence_enabled(sk_config.protective_reads_persistence_enabled);
diff --git a/core/lib/config/src/configs/contracts.rs b/core/lib/config/src/configs/contracts.rs
index bf88c100cce9..d96983c9719b 100644
--- a/core/lib/config/src/configs/contracts.rs
+++ b/core/lib/config/src/configs/contracts.rs
@@ -30,7 +30,6 @@ pub struct ContractsConfig {
pub validator_timelock_addr: Address,
pub l1_shared_bridge_proxy_addr: Option,
pub l2_shared_bridge_addr: Option,
- pub l2_legacy_shared_bridge_addr: Option,
pub l1_erc20_bridge_proxy_addr: Option,
pub l2_erc20_bridge_addr: Option,
pub l1_weth_bridge_proxy_addr: Option,
@@ -44,7 +43,6 @@ pub struct ContractsConfig {
// FIXME: maybe refactor
pub user_facing_bridgehub_proxy_addr: Option,
pub user_facing_diamond_proxy_addr: Option,
- pub l2_native_token_vault_proxy_addr: Option,
pub l2_da_validator_addr: Option,
@@ -62,7 +60,6 @@ impl ContractsConfig {
l2_erc20_bridge_addr: Some(Address::repeat_byte(0x0c)),
l1_shared_bridge_proxy_addr: Some(Address::repeat_byte(0x0e)),
l2_shared_bridge_addr: Some(Address::repeat_byte(0x0f)),
- l2_legacy_shared_bridge_addr: Some(Address::repeat_byte(0x10)),
l1_weth_bridge_proxy_addr: Some(Address::repeat_byte(0x0b)),
l2_weth_bridge_addr: Some(Address::repeat_byte(0x0c)),
l2_testnet_paymaster_addr: Some(Address::repeat_byte(0x11)),
@@ -72,7 +69,6 @@ impl ContractsConfig {
ecosystem_contracts: Some(EcosystemContracts::for_tests()),
user_facing_bridgehub_proxy_addr: Some(Address::repeat_byte(0x15)),
user_facing_diamond_proxy_addr: Some(Address::repeat_byte(0x16)),
- l2_native_token_vault_proxy_addr: Some(Address::repeat_byte(0x0d)),
chain_admin_addr: Some(Address::repeat_byte(0x18)),
l2_da_validator_addr: Some(Address::repeat_byte(0x19)),
}
diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs
index f8a1105fe705..b8ad2bc8cd2d 100644
--- a/core/lib/config/src/testonly.rs
+++ b/core/lib/config/src/testonly.rs
@@ -252,7 +252,6 @@ impl Distribution for EncodeDist {
l2_erc20_bridge_addr: self.sample_opt(|| rng.gen()),
l1_shared_bridge_proxy_addr: self.sample_opt(|| rng.gen()),
l2_shared_bridge_addr: self.sample_opt(|| rng.gen()),
- l2_legacy_shared_bridge_addr: self.sample_opt(|| rng.gen()),
l1_weth_bridge_proxy_addr: self.sample_opt(|| rng.gen()),
l2_weth_bridge_addr: self.sample_opt(|| rng.gen()),
l2_testnet_paymaster_addr: self.sample_opt(|| rng.gen()),
@@ -260,7 +259,6 @@ impl Distribution for EncodeDist {
ecosystem_contracts: self.sample(rng),
user_facing_bridgehub_proxy_addr: rng.gen(),
user_facing_diamond_proxy_addr: rng.gen(),
- l2_native_token_vault_proxy_addr: rng.gen(),
l2_da_validator_addr: rng.gen(),
base_token_addr: self.sample_opt(|| rng.gen()),
chain_admin_addr: self.sample_opt(|| rng.gen()),
diff --git a/core/lib/dal/src/consensus/mod.rs b/core/lib/dal/src/consensus/mod.rs
index 763c13cc387c..2a2df0adb45f 100644
--- a/core/lib/dal/src/consensus/mod.rs
+++ b/core/lib/dal/src/consensus/mod.rs
@@ -142,7 +142,7 @@ pub struct Payload {
pub fair_pubdata_price: Option,
pub virtual_blocks: u32,
pub operator_address: Address,
- pub pubdata_params: PubdataParams,
+ pub pubdata_params: Option,
pub transactions: Vec,
pub last_in_batch: bool,
}
@@ -180,9 +180,19 @@ impl ProtoFmt for Payload {
}
}
- let pubdata_params = required(&r.pubdata_params)
- .context("pubdata_params")?
- .clone();
+ let pubdata_params = if let Some(pubdata_params) = &r.pubdata_params {
+ Some(PubdataParams {
+ l2_da_validator_address: required(&pubdata_params.l2_da_validator_address)
+ .and_then(|a| parse_h160(a))
+ .context("operator_address")?,
+ pubdata_type: required(&pubdata_params.pubdata_type)
+ .and_then(|x| Ok(proto::L1BatchCommitDataGeneratorMode::try_from(*x)?))
+ .context("l1_batch_commit_data_generator_mode")?
+ .parse(),
+ })
+ } else {
+ None
+ };
Ok(Self {
protocol_version,
@@ -202,15 +212,7 @@ impl ProtoFmt for Payload {
.context("operator_address")?,
transactions,
last_in_batch: *required(&r.last_in_batch).context("last_in_batch")?,
- pubdata_params: PubdataParams {
- l2_da_validator_address: required(&pubdata_params.l2_da_validator_address)
- .and_then(|a| parse_h160(a))
- .context("operator_address")?,
- pubdata_type: required(&pubdata_params.pubdata_type)
- .and_then(|x| Ok(proto::L1BatchCommitDataGeneratorMode::try_from(*x)?))
- .context("l1_batch_commit_data_generator_mode")?
- .parse(),
- },
+ pubdata_params,
})
}
@@ -229,17 +231,16 @@ impl ProtoFmt for Payload {
transactions: vec![],
transactions_v25: vec![],
last_in_batch: Some(self.last_in_batch),
- pubdata_params: Some(proto::PubdataParams {
- l2_da_validator_address: Some(
- self.pubdata_params
- .l2_da_validator_address
- .as_bytes()
- .into(),
- ),
- pubdata_type: Some(proto::L1BatchCommitDataGeneratorMode::new(
- &self.pubdata_params.pubdata_type,
- ) as i32),
- }),
+ pubdata_params: self
+ .pubdata_params
+ .map(|pubdata_params| proto::PubdataParams {
+ l2_da_validator_address: Some(
+ pubdata_params.l2_da_validator_address.as_bytes().into(),
+ ),
+ pubdata_type: Some(proto::L1BatchCommitDataGeneratorMode::new(
+ &pubdata_params.pubdata_type,
+ ) as i32),
+ }),
};
match self.protocol_version {
v if v >= ProtocolVersionId::Version25 => {
diff --git a/core/lib/dal/src/consensus/proto/mod.proto b/core/lib/dal/src/consensus/proto/mod.proto
index 24a8297031d2..6083ad029109 100644
--- a/core/lib/dal/src/consensus/proto/mod.proto
+++ b/core/lib/dal/src/consensus/proto/mod.proto
@@ -27,7 +27,7 @@ message Payload {
// Set for protocol_version >= 25.
repeated TransactionV25 transactions_v25 = 12;
optional bool last_in_batch = 10; // required
- optional PubdataParams pubdata_params = 13; // required
+ optional PubdataParams pubdata_params = 13; // optional
}
message PubdataParams {
diff --git a/core/lib/dal/src/consensus/tests.rs b/core/lib/dal/src/consensus/tests.rs
index c99f8a37f7c5..e50ff5b1caeb 100644
--- a/core/lib/dal/src/consensus/tests.rs
+++ b/core/lib/dal/src/consensus/tests.rs
@@ -53,13 +53,13 @@ fn payload(rng: &mut impl Rng, protocol_version: ProtocolVersionId) -> Payload {
})
.collect(),
last_in_batch: rng.gen(),
- pubdata_params: PubdataParams {
+ pubdata_params: Some(PubdataParams {
pubdata_type: match rng.gen_range(0..2) {
0 => L1BatchCommitmentMode::Rollup,
_ => L1BatchCommitmentMode::Validium,
},
l2_da_validator_address: rng.gen(),
- },
+ }),
}
}
diff --git a/core/lib/dal/src/models/storage_sync.rs b/core/lib/dal/src/models/storage_sync.rs
index b9ef075f9859..7bb3c228748b 100644
--- a/core/lib/dal/src/models/storage_sync.rs
+++ b/core/lib/dal/src/models/storage_sync.rs
@@ -117,7 +117,7 @@ impl SyncBlock {
virtual_blocks: Some(self.virtual_blocks),
hash: Some(self.hash),
protocol_version: self.protocol_version,
- pubdata_params: self.pubdata_params,
+ pubdata_params: Some(self.pubdata_params),
}
}
@@ -134,7 +134,7 @@ impl SyncBlock {
operator_address: self.fee_account_address,
transactions,
last_in_batch: self.last_in_batch,
- pubdata_params: self.pubdata_params,
+ pubdata_params: Some(self.pubdata_params),
}
}
}
diff --git a/core/lib/env_config/src/contracts.rs b/core/lib/env_config/src/contracts.rs
index d1c6a252b028..01756fd2fd98 100644
--- a/core/lib/env_config/src/contracts.rs
+++ b/core/lib/env_config/src/contracts.rs
@@ -95,10 +95,6 @@ mod tests {
user_facing_diamond_proxy_addr: Some(addr(
"0xF00B988a98Ca742e7958DeF9F7823b5908715f4a",
)),
- l2_native_token_vault_proxy_addr: Some(addr(
- "0xfc073319977e314f251eae6ae6be76b0b3baeecf",
- )),
- l2_legacy_shared_bridge_addr: Some(addr("0x8656770FA78c830456B00B4fFCeE6b1De0e1b888")),
chain_admin_addr: Some(addr("0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
l2_da_validator_addr: Some(addr("0xed6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
}
@@ -131,7 +127,6 @@ CONTRACTS_USER_FACING_DIAMOND_PROXY_ADDR="0xF00B988a98Ca742e7958DeF9F7823b590871
CONTRACTS_L2_NATIVE_TOKEN_VAULT_PROXY_ADDR="0xfc073319977e314f251eae6ae6be76b0b3baeecf"
CONTRACTS_L2_DA_VALIDATOR_ADDR="0xed6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
CONTRACTS_CHAIN_ADMIN_ADDR="0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
-CONTRACTS_L2_LEGACY_SHARED_BRIDGE_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888"
"#;
lock.set_env(config);
diff --git a/core/lib/protobuf_config/src/contracts.rs b/core/lib/protobuf_config/src/contracts.rs
index a022c9aa1a1a..616334b056ca 100644
--- a/core/lib/protobuf_config/src/contracts.rs
+++ b/core/lib/protobuf_config/src/contracts.rs
@@ -76,12 +76,6 @@ impl ProtoRepr for proto::Contracts {
.map(|x| parse_h160(x))
.transpose()
.context("l2_shared_bridge_addr")?,
- l2_legacy_shared_bridge_addr: l2
- .l2_legacy_shared_bridge_addr
- .as_ref()
- .map(|x| parse_h160(x))
- .transpose()
- .context("l2_legacy_shared_bridge_addr")?,
l1_weth_bridge_proxy_addr: weth_bridge
.as_ref()
.and_then(|bridge| bridge.l1_address.as_ref().map(|x| parse_h160(x)))
@@ -119,12 +113,6 @@ impl ProtoRepr for proto::Contracts {
.map(|x| parse_h160(x))
.transpose()
.context("base_token_addr")?,
- l2_native_token_vault_proxy_addr: l2
- .l2_native_token_vault_proxy_addr
- .as_ref()
- .map(|x| parse_h160(x))
- .transpose()
- .context("l2_native_token_vault_proxy_addr")?,
l2_da_validator_addr: l2
.l2_da_validator_addr
.as_ref()
@@ -172,13 +160,7 @@ impl ProtoRepr for proto::Contracts {
}),
l2: Some(proto::L2 {
testnet_paymaster_addr: this.l2_testnet_paymaster_addr.map(|a| format!("{:?}", a)),
- l2_native_token_vault_proxy_addr: this
- .l2_native_token_vault_proxy_addr
- .map(|a| format!("{:?}", a)),
l2_da_validator_addr: this.l2_da_validator_addr.map(|a| format!("{:?}", a)),
- l2_legacy_shared_bridge_addr: this
- .l2_legacy_shared_bridge_addr
- .map(|a| format!("{:?}", a)),
}),
bridges: Some(proto::Bridges {
shared: Some(proto::Bridge {
diff --git a/core/lib/protobuf_config/src/proto/config/contracts.proto b/core/lib/protobuf_config/src/proto/config/contracts.proto
index 63e5eb1a3e9b..655c67b003de 100644
--- a/core/lib/protobuf_config/src/proto/config/contracts.proto
+++ b/core/lib/protobuf_config/src/proto/config/contracts.proto
@@ -21,9 +21,7 @@ message L1 {
message L2 {
optional string testnet_paymaster_addr = 1; // optional; H160
- optional string l2_native_token_vault_proxy_addr = 2; // optional; H160
- optional string l2_da_validator_addr = 3; // optional; H160
- optional string l2_legacy_shared_bridge_addr = 4; // optional; H160
+ optional string l2_da_validator_addr = 2; // optional; H160
}
message Bridge {
diff --git a/core/lib/types/src/api/en.rs b/core/lib/types/src/api/en.rs
index 4a847b99e3df..52d66a29458d 100644
--- a/core/lib/types/src/api/en.rs
+++ b/core/lib/types/src/api/en.rs
@@ -43,7 +43,7 @@ pub struct SyncBlock {
/// Version of the protocol used for this block.
pub protocol_version: ProtocolVersionId,
/// Pubdata params used for this batch
- pub pubdata_params: PubdataParams,
+ pub pubdata_params: Option,
}
/// Global configuration of the consensus served by the main node to the external nodes.
diff --git a/core/lib/types/src/api/mod.rs b/core/lib/types/src/api/mod.rs
index 65249f9bab61..75bcc6387aa3 100644
--- a/core/lib/types/src/api/mod.rs
+++ b/core/lib/types/src/api/mod.rs
@@ -264,6 +264,7 @@ pub struct BridgeAddresses {
pub l2_erc20_default_bridge: Option,
pub l1_weth_bridge: Option,
pub l2_weth_bridge: Option,
+ pub l2_token_deployer: Option,
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
diff --git a/core/lib/web3_decl/src/namespaces/zks.rs b/core/lib/web3_decl/src/namespaces/zks.rs
index b27bf2628773..169d27aac1d9 100644
--- a/core/lib/web3_decl/src/namespaces/zks.rs
+++ b/core/lib/web3_decl/src/namespaces/zks.rs
@@ -52,12 +52,6 @@ pub trait ZksNamespace {
#[method(name = "getTestnetPaymaster")]
async fn get_testnet_paymaster(&self) -> RpcResult