From 8af0d85b94cc74f691eb21b59556c0cd6084db01 Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:03:33 +0200 Subject: [PATCH] fix(eth-sender): Correct ABI for get_verification_key (#445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Use correct contract ABI with `get_verification_key` function ## Why ❔ Fix eth-sender for pre-boojum ## Checklist - [x] 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. - [x] Code has been formatted via `zk fmt` and `zk lint`. --- .../zksync_core/src/eth_sender/eth_tx_aggregator.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs b/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs index 9e55de888a15..130a50b2309b 100644 --- a/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs +++ b/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs @@ -10,7 +10,7 @@ use zksync_types::{ aggregated_operations::AggregatedOperation, contracts::{Multicall3Call, Multicall3Result}, eth_sender::EthTx, - ethabi::Token, + ethabi::{Contract, Token}, protocol_version::{L1VerifierConfig, VerifierParams}, vk_transform::l1_vk_commitment, web3::contract::{tokens::Tokenizable, Error, Options}, @@ -311,6 +311,15 @@ impl EthTxAggregator { // New verifier returns the hash of the verification key tracing::debug!("Calling get_verification_key"); if contracts_are_pre_boojum { + let abi = Contract { + functions: vec![( + self.functions.get_verification_key.name.clone(), + vec![self.functions.get_verification_key.clone()], + )] + .into_iter() + .collect(), + ..Default::default() + }; let vk = eth_client .call_contract_function( &self.functions.get_verification_key.name, @@ -319,7 +328,7 @@ impl EthTxAggregator { Default::default(), None, verifier_address, - self.functions.verifier_contract.clone(), + abi, ) .await?; Ok(l1_vk_commitment(vk))