Skip to content

Commit 4751481

Browse files
authored
fix(contracts): force load the contracts for sl (#4371)
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## 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 `zkstack dev fmt` and `zkstack dev lint`. Signed-off-by: Danil <[email protected]>
1 parent 2cb551b commit 4751481

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

core/node/gateway_migrator/src/node/settlement_layer_data.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl WiringLayer for SettlementLayerData<MainNodeConfig> {
106106
// before v26 upgrade not all function for getting addresses are available,
107107
// so we need a fallback and we can load the contracts from configs,
108108
// it's safe only for l1 contracts
109-
.unwrap_or(self.config.l1_sl_specific_contracts.unwrap());
109+
.unwrap_or(self.config.l1_sl_specific_contracts.clone().unwrap());
110110

111111
let mut l1_specific_contracts = self.config.l1_specific_contracts.clone();
112112
// In the future we will be able to load all contracts from the l1 chain. Now for not adding
@@ -158,7 +158,7 @@ impl WiringLayer for SettlementLayerData<MainNodeConfig> {
158158
}
159159
};
160160

161-
let sl_chain_contracts = match &sl_client {
161+
let mut sl_chain_contracts = match &sl_client {
162162
SettlementLayerClient::L1(_) => sl_l1_contracts.clone(),
163163
SettlementLayerClient::Gateway(client) => {
164164
let l2_multicall3 = client
@@ -179,10 +179,20 @@ impl WiringLayer for SettlementLayerData<MainNodeConfig> {
179179
}
180180
};
181181

182+
if self.config.eth_sender_config.force_use_validator_timelock {
183+
sl_chain_contracts
184+
.ecosystem_contracts
185+
.validator_timelock_addr = self
186+
.config
187+
.l1_sl_specific_contracts
188+
.as_ref()
189+
.and_then(|sl_contracts| sl_contracts.ecosystem_contracts.validator_timelock_addr)
190+
}
182191
let eth_sender_config = adjust_eth_sender_config(
183192
self.config.eth_sender_config,
184193
final_settlement_mode.settlement_layer(),
185194
);
195+
186196
Ok(Output {
187197
initial_settlement_mode: SettlementModeResource::new(final_settlement_mode.clone()),
188198
contracts: SettlementLayerContractsResource(sl_chain_contracts),

0 commit comments

Comments
 (0)