diff --git a/crates/benches/benches/benchmarks/smt.rs b/crates/benches/benches/benchmarks/smt.rs index dad87f67e..9dd066c98 100644 --- a/crates/benches/benches/benchmarks/smt.rs +++ b/crates/benches/benches/benchmarks/smt.rs @@ -422,7 +422,6 @@ impl BenchExecutionEnvironment { Vec::new(), Default::default(), Vec::new(), - Default::default(), ) .unwrap(); diff --git a/crates/block-producer/src/block_producer.rs b/crates/block-producer/src/block_producer.rs index 246d0259a..1bf7a5833 100644 --- a/crates/block-producer/src/block_producer.rs +++ b/crates/block-producer/src/block_producer.rs @@ -257,6 +257,10 @@ impl BlockProducer { // header_deps, used for obtaining l1 time in the state-validator-script let block_number = block.raw().number().unpack(); if 2 <= rollup_context.determine_global_state_version(block_number) { + // Recover the l1_confirmed_header based on l1_confimed_timestamp. + // The l1_confirmed_header is referenced when producing l2block and GlobalState. + // + // The block producer would reference confirmed headers to avoid L1 reorg issue. let finality_as_duration = rollup_context.rollup_config.finality_as_duration(); let last_finalized_timestamp = match Timepoint::from_full_value( global_state.last_finalized_block_number().unpack(), @@ -277,6 +281,7 @@ impl BlockProducer { l1_confirmed_timestamp, block_number ) }); + tx_skeleton .header_deps_mut() .push(ckb_types::prelude::Unpack::unpack(&l1_confirmed_header.hash()).pack()); diff --git a/crates/tests/src/tests/restore_mem_pool_pending_withdrawal.rs b/crates/tests/src/tests/restore_mem_pool_pending_withdrawal.rs index a8375f71f..d93a1f73e 100644 --- a/crates/tests/src/tests/restore_mem_pool_pending_withdrawal.rs +++ b/crates/tests/src/tests/restore_mem_pool_pending_withdrawal.rs @@ -3,7 +3,7 @@ use std::time::Duration; use crate::testing_tool::chain::{ build_sync_tx, construct_block, construct_block_with_timestamp, into_deposit_info_cell, - produce_empty_block, restart_chain, setup_chain, DEFAULT_FINALITY_BLOCKS, TEST_CHAIN_ID, + restart_chain, setup_chain, DEFAULT_FINALITY_BLOCKS, TEST_CHAIN_ID, }; use crate::testing_tool::common::random_always_success_script; use crate::testing_tool::mem_pool_provider::DummyMemPoolProvider;