Skip to content

Commit 80aaef8

Browse files
authored
fix(l1): fix queue length log (#5197)
**Motivation** Currently the log incorrectly always shows max_queue_length as 0. **Description** The move closure takes ownership and mutates _a copy_ of the max_queue_length. This is fixed by taking the reference outside.
1 parent 81a0cf3 commit 80aaef8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/blockchain/blockchain.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ impl Blockchain {
216216
let queue_length_ref = &queue_length;
217217
let mut max_queue_length = 0;
218218
let (execution_result, account_updates_list) = std::thread::scope(|s| {
219+
let max_queue_length_ref = &mut max_queue_length;
219220
let (tx, rx) = channel();
220221
let execution_handle = s.spawn(move || -> Result<_, ChainError> {
221222
let execution_result = vm.execute_block_pipeline(block, tx, queue_length_ref)?;
@@ -233,7 +234,7 @@ impl Blockchain {
233234
rx,
234235
&parent_header,
235236
queue_length_ref,
236-
&mut max_queue_length,
237+
max_queue_length_ref,
237238
)?;
238239
let merkle_end_instant = Instant::now();
239240
Ok((account_updates_list, merkle_end_instant))

0 commit comments

Comments
 (0)