Skip to content

Commit 19770a3

Browse files
committed
fmt + clippy
1 parent f6321f9 commit 19770a3

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,8 @@ impl BuilderConfig {
340340
/// Returns the maximum host gas to use for block building based on the configured max host gas coefficient.
341341
pub fn max_host_gas(&self, gas_limit: u64) -> u64 {
342342
// Set max host gas to a percentage of the host block gas limit
343-
let max_host_gas = ((gas_limit as u128
344-
* (self.max_host_gas_coefficient.unwrap_or(80) as u128))
345-
/ 100u128) as u64;
346-
max_host_gas
343+
((gas_limit as u128 * (self.max_host_gas_coefficient.unwrap_or(80) as u128)) / 100u128)
344+
as u64
347345
}
348346

349347
/// Spawn a submit task, either Flashbots or BuilderHelper depending on

src/tasks/block/sim.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,10 @@ impl Simulator {
134134
sim_env: SimEnv,
135135
) -> eyre::Result<BuiltBlock> {
136136
let concurrency_limit = self.config.concurrency_limit();
137+
let max_host_gas = self.config.max_host_gas(sim_env.prev_host.gas_limit);
137138

138139
let (rollup_env, host_env) = self.create_envs(constants, &sim_env).await;
139140

140-
let max_host_gas = self.config.max_host_gas(sim_env.prev_host.gas_limit);
141-
142141
let block_build = BlockBuild::new(
143142
rollup_env,
144143
host_env,

tests/block_builder_test.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use alloy::{
88
signers::local::PrivateKeySigner,
99
};
1010
use builder::{
11-
tasks::{block::sim::Simulator, env::{EnvTask, SimEnv}},
11+
tasks::{
12+
block::sim::Simulator,
13+
env::{EnvTask, SimEnv},
14+
},
1215
test_utils::{new_signed_tx, setup_logging, setup_test_config, test_block_env},
1316
};
1417
use signet_sim::SimCache;
@@ -51,7 +54,8 @@ async fn test_handle_build() {
5154
.spawn()
5255
.0;
5356

54-
let block_builder = Simulator::new(&config, host_provider.clone(), ru_provider.clone(), block_env);
57+
let block_builder =
58+
Simulator::new(&config, host_provider.clone(), ru_provider.clone(), block_env);
5559

5660
// Setup a sim cache
5761
let sim_items = SimCache::new();

0 commit comments

Comments
 (0)