Skip to content

Commit

Permalink
skip block error
Browse files Browse the repository at this point in the history
  • Loading branch information
musitdev committed Feb 23, 2025
1 parent 605dc52 commit f37c117
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion networks/movement/movement-full-node/src/node/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Manager {

let node = MovementPartialNode::try_from_config(config)
.await
.context("Failed to create the executor")?;
.context("Full node manager, Failed to create the executor")?;

let join_handle = tokio::spawn(node.run());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ where
{
// To allow for DA migrations we accept both sequenced and passed through blobs
blob_response::BlobType::SequencedBlobBlock(blob) => {
tracing::info!("Receive SequencedBlobBlock blob");
(blob.data, blob.timestamp, blob.blob_id, blob.height)
}
// To allow for DA migrations we accept both sequenced and passed through blobs
blob_response::BlobType::PassedThroughBlob(blob) => {
tracing::info!("Receive PassedThroughBlob blob");
(blob.data, blob.timestamp, blob.blob_id, blob.height)
}
blob_response::BlobType::HeartbeatBlob(_) => {
Expand Down Expand Up @@ -149,6 +151,14 @@ where
let span = info_span!(target: "movement_timing", "execute_block", id = ?block_id);
let commitment =
self.execute_block_with_retries(block, block_timestamp).instrument(span).await?;
let commitment = match commitment {
Some(commitment) => commitment,
// No commitment, skip block.
None => {
tracing::warn!("BLock can't be executed, skipping block:{}", hex::encode(block_id));
return Ok(());
}
};

// decrement the number of transactions in flight on the executor
self.executor.decrement_transactions_in_flight(transactions_count as u64);
Expand Down Expand Up @@ -198,15 +208,16 @@ where
&mut self,
block: Block,
mut block_timestamp: u64,
) -> anyhow::Result<BlockCommitment> {
) -> anyhow::Result<Option<BlockCommitment>> {
for _ in 0..self.execution_extension.block_retry_count {
// we have to clone here because the block is supposed to be consumed by the executor
match self.execute_block(block.clone(), block_timestamp).await {
Ok(commitment) => return Ok(commitment),
Ok(commitment) => return Ok(Some(commitment)),
Err(e) => {
info!("Failed to execute block: {:?}. Retrying", e);
block_timestamp += self.execution_extension.block_retry_increment_microseconds;
// increase the timestamp by 5 ms (5000 microseconds)
return Ok(None);
}
}
}
Expand Down

0 comments on commit f37c117

Please sign in to comment.