Skip to content

Commit 4057eb7

Browse files
Add interop center to service tx whitelist
1 parent b722dbb commit 4057eb7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

basic_bootloader/src/bootloader/transaction/rlp_encoded/transaction_types/service_tx.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use crate::bootloader::errors::InvalidTransaction;
22
use crate::bootloader::transaction::rlp_encoded::rlp::minimal_rlp_parser::{Rlp, RlpListDecode};
33
use crate::bootloader::transaction::rlp_encoded::transaction_types::EthereumTxType;
44
use ruint::aliases::B160;
5-
use system_hooks::addresses_constants::{L2_INTEROP_ROOT_STORAGE_ADDRESS, SYSTEM_CONTEXT_ADDRESS};
5+
use system_hooks::addresses_constants::{
6+
L2_INTEROP_CENTER_ADDRESS, L2_INTEROP_ROOT_STORAGE_ADDRESS, SYSTEM_CONTEXT_ADDRESS,
7+
};
68

79
/// ZKsync OS service (type 0x7d) transaction .
810
/// Used for system operations, such as importing interop roots.
@@ -18,8 +20,11 @@ pub(crate) struct ServiceTx<'a> {
1820
salt: u64, // Some salt used by the server to identify service transactions. Ignored by ZKsync OS.
1921
}
2022

21-
const SERVICE_DESTINATION_WHITELIST: &[B160] =
22-
&[L2_INTEROP_ROOT_STORAGE_ADDRESS, SYSTEM_CONTEXT_ADDRESS];
23+
const SERVICE_DESTINATION_WHITELIST: &[B160] = &[
24+
L2_INTEROP_ROOT_STORAGE_ADDRESS,
25+
SYSTEM_CONTEXT_ADDRESS,
26+
L2_INTEROP_CENTER_ADDRESS,
27+
];
2328

2429
pub const SERVICE_TX_TYPE: u8 = 0x7d;
2530

system_hooks/src/addresses_constants.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ pub const L2_INTEROP_ROOT_STORAGE_ADDRESS_LOW: u32 = 0x10008;
3838
pub const L2_INTEROP_ROOT_STORAGE_ADDRESS: B160 =
3939
B160::from_limbs([L2_INTEROP_ROOT_STORAGE_ADDRESS_LOW as u64, 0, 0]);
4040

41+
// L2 interop center system contract
42+
pub const L2_INTEROP_CENTER_ADDRESS_LOW: u32 = 0x1000d;
43+
pub const L2_INTEROP_CENTER_ADDRESS: B160 =
44+
B160::from_limbs([L2_INTEROP_CENTER_ADDRESS_LOW as u64, 0, 0]);
45+
4146
// Treasury contract used for "minting" base tokens on L2
4247
pub const BASE_TOKEN_HOLDER_ADDRESS_LOW: u32 = 0x10011;
4348
pub const BASE_TOKEN_HOLDER_ADDRESS: B160 =

0 commit comments

Comments
 (0)