Skip to content

Commit 7a629ff

Browse files
committed
use interface 0.0.9
1 parent f3939b3 commit 7a629ff

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ keywords = ["blockchain", "zksync", "zk", "risc-v"]
5353
categories = ["cryptography"]
5454

5555
[workspace.dependencies]
56-
zksync_os_evm_errors = { version = "=0.0.7", default-features = false }
57-
zksync_os_interface = { version = "=0.0.7" }
56+
zksync_os_evm_errors = { version = "=0.0.9", default-features = false }
57+
zksync_os_interface = { version = "=0.0.9" }
5858

5959
risc_v_simulator = { git = "https://github.com/matter-labs/zksync-airbender", tag = "v0.4.3"}
6060
blake2s_u32 = { git = "https://github.com/matter-labs/zksync-airbender", tag = "v0.4.3"}

forward_system/src/run/interface_impl.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ use crate::run::tracing_impl::TracerWrapped;
55
use crate::run::{run_block, simulate_tx};
66
use zk_ee::system::metadata::BlockMetadataFromOracle;
77
use zksync_os_interface::tracing::AnyTracer;
8-
use zksync_os_interface::traits::{
9-
PreimageSource, ReadStorage, RunBlock, SimulateTx, TxResultCallback, TxSource,
10-
};
8+
use zksync_os_interface::traits::{EncodedTx, PreimageSource, ReadStorage, RunBlock, SimulateTx, TxResultCallback, TxSource};
119
use zksync_os_interface::types::BlockContext;
1210
use zksync_os_interface::types::BlockOutput;
1311

@@ -56,15 +54,19 @@ impl SimulateTx for RunBlockForward {
5654
fn simulate_tx<Storage: ReadStorage, PreimgSrc: PreimageSource, Tracer: AnyTracer>(
5755
&self,
5856
_config: (),
59-
transaction: Vec<u8>,
57+
transaction: EncodedTx,
6058
block_context: BlockContext,
6159
storage: Storage,
6260
preimage_source: PreimgSrc,
6361
tracer: &mut Tracer,
6462
) -> Result<TxResult, Self::Error> {
6563
let evm_tracer = tracer.as_evm().expect("only EVM tracers are supported");
64+
let abi_tx = match transaction {
65+
EncodedTx::Abi(b) => b,
66+
_ => panic!("only ABI-encoded transactions are supported"),
67+
};
6668
simulate_tx(
67-
transaction,
69+
abi_tx,
6870
BlockMetadataFromOracle::from_interface(block_context),
6971
storage,
7072
preimage_source,

forward_system/src/run/oracle.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::run::{NextTxResponse, PreimageSource, ReadStorageTree, TxSource};
22
use basic_system::system_implementation::flat_storage_model::*;
33
use serde::{Deserialize, Serialize};
4+
use zksync_os_interface::traits::EncodedTx;
45
use zk_ee::common_structs::derive_flat_storage_key;
56
use zk_ee::common_structs::ProofData;
67
use zk_ee::internal_error;
@@ -56,7 +57,11 @@ impl<T: ReadStorageTree, PS: PreimageSource, TS: TxSource> ForwardRunningOracle<
5657
let next_tx_len = next_tx.len();
5758
// `0` interpreted as seal batch
5859
assert_ne!(next_tx_len, 0);
59-
self.next_tx = Some(next_tx);
60+
let abi_tx = match next_tx {
61+
EncodedTx::Abi(b) => b,
62+
_ => panic!("only ABI-encoded transactions are supported"),
63+
};
64+
self.next_tx = Some(abi_tx);
6065
next_tx_len
6166
}
6267
}
@@ -228,7 +233,11 @@ impl<S: ReadStorage, PS: PreimageSource, TS: TxSource> CallSimulationOracle<S, P
228233
let next_tx_len = next_tx.len();
229234
// `0` interpreted as seal batch
230235
assert_ne!(next_tx_len, 0);
231-
self.next_tx = Some(next_tx);
236+
let abi_tx = match next_tx {
237+
EncodedTx::Abi(b) => b,
238+
_ => panic!("only ABI-encoded transactions are supported"),
239+
};
240+
self.next_tx = Some(abi_tx);
232241
next_tx_len
233242
}
234243
}

forward_system/src/run/test_impl/tx_source.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::run::{NextTxResponse, TxSource};
22
use std::collections::VecDeque;
3+
use zksync_os_interface::traits::EncodedTx;
34

45
#[derive(Clone, serde::Serialize, serde::Deserialize)]
56
pub struct TxListSource {
@@ -9,7 +10,7 @@ pub struct TxListSource {
910
impl TxSource for TxListSource {
1011
fn get_next_tx(&mut self) -> NextTxResponse {
1112
match self.transactions.pop_front() {
12-
Some(tx) => NextTxResponse::Tx(tx),
13+
Some(tx) => NextTxResponse::Tx(EncodedTx::Abi(tx)),
1314
None => NextTxResponse::SealBlock,
1415
}
1516
}

0 commit comments

Comments
 (0)