Skip to content

[Derivation Pipeline] Consider finality in the reconciliation function #425

@frisitano

Description

@frisitano

Overview

We must consider the case of the finalized head in the derivation pipeline reconciliation function. It appears that it's possible that it's possible that safe_block_info.number < finalized_block_info.number.

// Check if the block matches the derived attributes.
if block_matches_attributes(&attributes.attributes, &current_block) {
// Extract the block info with L1 messages.
let block_info: L2BlockInfoWithL1Messages = (&current_block).into();
// The block matches the derived attributes and the block is below or equal to the
// safe current safe head.
if attributes.block_number <= fcs.safe_block_info().number {
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::Skip(block_info))
} else {
// The block matches the derived attributes, no action is needed.
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::UpdateSafeHead(
block_info,
))
}
} else {
// The block does not match the derived attributes, a reorg is needed.
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::Reorg(attributes))
}
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions