Skip to content

Commit a27db4e

Browse files
committed
fix
1 parent 8d6437e commit a27db4e

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

crates/full-node/sov-sequencer/src/preferred/block_executor.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ pub struct StartBlockData<S: Spec> {
105105
// We pass the node state root explicitly because retrieving it is
106106
// fallible, so it's convenient to front-load the error-checking.
107107
pub node_state_root: <S::Storage as Storage>::Root,
108+
pub minimum_profit_per_tx: u128,
108109
}
109110

110111
#[derive(Clone)]
@@ -372,10 +373,6 @@ impl<S: Spec, Rt: Runtime<S>> RollupBlockExecutor<S, Rt> {
372373
sanity_check_visible_slot_number_after_increase,
373374
visible_increase,
374375
node_state_root: node_state_root.clone(),
375-
};
376-
377-
self.start_rollup_block(
378-
start_block_data,
379376
// When replaying batches, we wish to be deterministic and not
380377
// filter out previously-accepted transactions simply because
381378
// they're not considered profitable enough based on the current
@@ -386,9 +383,10 @@ impl<S: Spec, Rt: Runtime<S>> RollupBlockExecutor<S, Rt> {
386383
// cause the rest of the batch to not have a minimum profit. We
387384
// might want to forcibly close that batch and start a new one, or
388385
// send the new configuration value over a channel.
389-
0,
390-
)
391-
.await;
386+
minimum_profit_per_tx: 0,
387+
};
388+
389+
self.start_rollup_block(start_block_data).await;
392390

393391
trace!("Replaying txs");
394392
}
@@ -428,19 +426,19 @@ impl<S: Spec, Rt: Runtime<S>> RollupBlockExecutor<S, Rt> {
428426
}
429427
}
430428

431-
pub async fn warm_up_cache(
429+
pub async fn start_rollup_block_with_provided_state_roots(
432430
&mut self,
433431
start_block_data: StartBlockData<S>,
434432
checkpoint: StateCheckpoint<S>,
435433
state_roots: BTreeMap<RollupHeight, <S::Storage as Storage>::Root>,
436-
minimum_profit_per_tx: u128,
437434
) {
438435
self.checkpoint = checkpoint;
439436

440437
let StartBlockData {
441438
sanity_check_visible_slot_number_after_increase,
442439
visible_increase,
443440
node_state_root: _,
441+
minimum_profit_per_tx,
444442
} = start_block_data;
445443

446444
assert!(
@@ -511,15 +509,12 @@ impl<S: Spec, Rt: Runtime<S>> RollupBlockExecutor<S, Rt> {
511509
}
512510

513511
#[tracing::instrument(skip_all, level = "trace")]
514-
pub async fn start_rollup_block(
515-
&mut self,
516-
start_blcock_data: StartBlockData<S>,
517-
minimum_profit_per_tx: u128,
518-
) {
512+
pub async fn start_rollup_block(&mut self, start_blcock_data: StartBlockData<S>) {
519513
let StartBlockData {
520514
sanity_check_visible_slot_number_after_increase,
521515
visible_increase,
522516
node_state_root,
517+
minimum_profit_per_tx,
523518
} = start_blcock_data;
524519

525520
assert!(

crates/full-node/sov-sequencer/src/preferred/cache_warm_up_executor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ impl<S: Spec> CacheWarmupExecutor<S> {
145145
executor: &mut RollupBlockExecutor<S, Rt>,
146146
) {
147147
executor
148-
.warm_up_cache(notify.data, notify.checkpoint, notify.state_roots, 0)
148+
.start_rollup_block_with_provided_state_roots(
149+
notify.data,
150+
notify.checkpoint,
151+
notify.state_roots,
152+
)
149153
.await
150154
}
151155
}

crates/full-node/sov-sequencer/src/preferred/inner.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,22 @@ where
267267

268268
// DB operations handled by replica-aware db implementation
269269
let sequence_number = self.get_and_inc_next_sequence_number();
270+
let min_profit_per_tx = self.seq_config.sequencer_kind_config.minimum_profit_per_tx;
270271

271272
let start_block_data = StartBlockData {
272273
sanity_check_visible_slot_number_after_increase: visible_slot_number_after_increase,
273274
visible_increase,
274275
node_state_root: node_state_root.clone(),
276+
minimum_profit_per_tx: min_profit_per_tx,
275277
};
276278

277-
let min_profit_per_tx = self.seq_config.sequencer_kind_config.minimum_profit_per_tx;
278-
279279
let old_checkpoint = self
280280
.executor
281281
.checkpoint
282282
.clone_with_empty_witness_dropping_temp_cache();
283283

284284
self.executor
285-
.start_rollup_block(start_block_data.clone(), min_profit_per_tx)
285+
.start_rollup_block(start_block_data.clone())
286286
.await;
287287

288288
let state_roots = self.executor.state_roots.clone();
@@ -343,17 +343,16 @@ where
343343

344344
let node_state_root = self.node_root_hash()?;
345345
let sequence_number = self.get_and_inc_next_sequence_number();
346+
let min_profit_per_tx = self.seq_config.sequencer_kind_config.minimum_profit_per_tx;
346347

347348
let start_block_data = StartBlockData {
348349
sanity_check_visible_slot_number_after_increase: visible_slot_number_after_increase,
349350
visible_increase: replica_visible_slots_to_advance,
350351
node_state_root: node_state_root.clone(),
352+
minimum_profit_per_tx: min_profit_per_tx,
351353
};
352354

353-
let min_profit_per_tx = self.seq_config.sequencer_kind_config.minimum_profit_per_tx;
354-
self.executor
355-
.start_rollup_block(start_block_data, min_profit_per_tx)
356-
.await;
355+
self.executor.start_rollup_block(start_block_data).await;
357356

358357
self.executor_events_sender
359358
.start_batch(

0 commit comments

Comments
 (0)