Skip to content

Commit f58d8a6

Browse files
committed
Fix up the Zeth order generator from missed changes in merge
1 parent 01c4d06 commit f58d8a6

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

Diff for: crates/order-generator/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ zeth-preflight = { git = "https://github.com/risc0/zeth", optional = true }
4040
zeth-preflight-ethereum = { git = "https://github.com/risc0/zeth", optional = true }
4141

4242
[dev-dependencies]
43+
boundless-market = { workspace = true, features = ["test-utils"] }
4344
guest-assessor = { workspace = true }
4445
guest-set-builder = { workspace = true }
4546
guest-util = { workspace = true }
@@ -52,4 +53,4 @@ zeth = [
5253
"dep:zeth-guests",
5354
"dep:zeth-preflight",
5455
"dep:zeth-preflight-ethereum"
55-
]
56+
]

Diff for: crates/order-generator/src/bin/zeth.rs

+9-20
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ use alloy::{
1212
},
1313
providers::{Provider, ProviderBuilder},
1414
signers::local::PrivateKeySigner,
15-
transports::Transport,
1615
};
1716
use anyhow::{anyhow, bail, Result};
18-
use balance_alerts_layer::{BalanceAlertConfig, BalanceAlertLayer};
17+
use balance_alerts_layer::BalanceAlertConfig;
1918
use boundless_market::{
2019
client::{Client, ClientBuilder},
2120
contracts::{Input, Offer, Predicate, ProofRequest, Requirements},
@@ -128,10 +127,7 @@ async fn main() -> Result<()> {
128127
error_threshold: args.error_balance_below,
129128
};
130129

131-
let provider = ProviderBuilder::new()
132-
.with_recommended_fillers()
133-
.wallet(wallet)
134-
.on_http(args.zeth_rpc_url.clone());
130+
let provider = ProviderBuilder::new().wallet(wallet).on_http(args.zeth_rpc_url.clone());
135131
let rpc = Some(args.zeth_rpc_url.to_string());
136132
let chain_id = provider.get_chain_id().await?;
137133
let chain = Some(NamedChain::try_from(chain_id).map_err(|_| anyhow!("Unknown chain"))?);
@@ -261,15 +257,14 @@ struct RequestParams {
261257
offchain: bool,
262258
}
263259

264-
async fn submit_request<T, P, S>(
260+
async fn submit_request<P, S>(
265261
build_args: BuildArgs,
266262
chain_id: u64,
267-
boundless_client: Client<T, P, S>,
263+
boundless_client: Client<P, S>,
268264
params: RequestParams,
269265
) -> Result<U256>
270266
where
271-
T: Transport + Clone,
272-
P: Provider<T, Ethereum> + 'static + Clone,
267+
P: Provider<Ethereum> + 'static + Clone,
273268
S: StorageProvider + Clone,
274269
{
275270
// preflight the block building process
@@ -296,16 +291,10 @@ where
296291
default_executor().execute(guest_env.try_into()?, ZETH_GUESTS_RETH_ETHEREUM_ELF)?;
297292

298293
let cycles_count = session_info.segments.iter().map(|segment| 1 << segment.po2).sum::<u64>();
299-
let min_price = args
300-
.min_price_per_mcycle
301-
.checked_mul(U256::from(cycles_count))
302-
.unwrap()
303-
.div_ceil(U256::from(1_000_000));
304-
let max_price = args
305-
.max_price_per_mcycle
306-
.checked_mul(U256::from(cycles_count))
307-
.unwrap()
308-
.div_ceil(U256::from(1_000_000));
294+
let min_price =
295+
params.min.checked_mul(U256::from(cycles_count)).unwrap().div_ceil(U256::from(1_000_000));
296+
let max_price =
297+
params.max.checked_mul(U256::from(cycles_count)).unwrap().div_ceil(U256::from(1_000_000));
309298

310299
tracing::info!(
311300
"{} cycles count {} mcycles count {} min_price in ether {} max_price in ether",

0 commit comments

Comments
 (0)