Skip to content

Commit bd55907

Browse files
authored
fix(eth_sender): Do not fail if execution delay function is absent (#4373)
## 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 4751481 commit bd55907

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

core/node/eth_sender/src/eth_tx_aggregator.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl EthTxAggregator {
305305
.unwrap();
306306
let get_execution_delay_call = Multicall3Call {
307307
target: self.config_timelock_contract_address,
308-
allow_failure: ALLOW_FAILURE,
308+
allow_failure: true,
309309
calldata: get_execution_delay_input,
310310
};
311311

@@ -553,17 +553,17 @@ impl EthTxAggregator {
553553
}
554554

555555
fn parse_execution_delay(data: Token, name: &'static str) -> Result<Duration, EthSenderError> {
556-
let multicall_data = Multicall3Result::from_token(data)?.return_data;
557-
if multicall_data.len() != 32 {
558-
return Err(EthSenderError::Parse(Web3ContractError::InvalidOutputType(
559-
format!(
560-
"multicall3 {name} data is not of the len of 32: {:?}",
561-
multicall_data
562-
),
563-
)));
556+
let multicall_data = Multicall3Result::from_token(data)?;
557+
558+
if !multicall_data.success {
559+
tracing::warn!(
560+
"multicall3 {name} data is not of the len of 32: {:?}, returning zero delay",
561+
multicall_data.return_data
562+
);
563+
return Ok(Duration::ZERO);
564564
}
565565

566-
let delay_seconds = U256::from_big_endian(&multicall_data);
566+
let delay_seconds = U256::from_big_endian(&multicall_data.return_data);
567567
Ok(Duration::from_secs(delay_seconds.as_u64()))
568568
}
569569

0 commit comments

Comments
 (0)