fix: sequencer does not submit newly created blocks & fix to resubmit first pending block logic

This commit is contained in:
Sergio Chouhy 2026-02-13 17:57:43 -03:00 committed by Daniil Polyakov
parent 91e57bbf1b
commit 439392cf26
3 changed files with 11 additions and 24 deletions

View File

@ -173,24 +173,10 @@ impl<BC: BlockSettlementClientTrait, IC: IndexerClientTrait> SequencerCore<BC, I
Ok(tx)
}
pub async fn produce_new_block_and_post_to_settlement_layer(&mut self) -> Result<u64> {
{
let (tx, msg_id) = self
.produce_new_block_with_mempool_transactions()
.context("Failed to produce new block with mempool transactions")?;
match self
.block_settlement_client
.submit_inscribe_tx_to_bedrock(tx)
.await
{
Ok(()) => {
info!("Posted block data to Bedrock, msg_id: {msg_id:?}");
}
Err(err) => {
error!("Failed to post block data to Bedrock with error: {err:#}");
}
}
}
pub async fn produce_new_block(&mut self) -> Result<u64> {
let (_tx, _msg_id) = self
.produce_new_block_with_mempool_transactions()
.context("Failed to produce new block with mempool transactions")?;
Ok(self.chain_height)
}

View File

@ -5,8 +5,8 @@
"is_genesis_random": true,
"max_num_tx_in_block": 20,
"mempool_max_size": 1000,
"block_create_timeout_millis": 5000,
"retry_pending_blocks_timeout_millis": 7000,
"block_create_timeout_millis": 12000,
"retry_pending_blocks_timeout_millis": 6000,
"port": 3040,
"bedrock_config": {
"backoff": {

View File

@ -147,9 +147,7 @@ async fn main_loop(seq_core: Arc<Mutex<SequencerCore>>, block_timeout: Duration)
let id = {
let mut state = seq_core.lock().await;
state
.produce_new_block_and_post_to_settlement_layer()
.await?
state.produce_new_block().await?
};
info!("Block with id {id} created");
@ -174,7 +172,10 @@ async fn retry_pending_blocks_loop(
(pending_blocks, client)
};
if let Some(block) = pending_blocks.first() {
if let Some(block) = pending_blocks
.iter()
.min_by_key(|block| block.header.block_id)
{
info!(
"Resubmitting pending block with id {}",
block.header.block_id