Skip to content

messaging: confirmation_depth defaults to 0 (no reorg protection) #622

Description

@kariy

Summary

MessagingConfig.confirmation_depth defaults to 0, i.e. the collector gathers right up to the settlement chain's latest block with no reorg buffer. If a settlement block that was already gathered reorgs away (or shifts position), the message sequence desyncs.

Where

  • crates/messaging/src/lib.rs (MessagingConfig, confirmation_depth default 0, documented as dev/test only).
  • crates/messaging/src/stream/mod.rssafe_head = latest_block - confirmation_depth.

Impact

For non-dev Starknet settlement this leaves no protection against settlement-chain reorgs, which can drop or reorder L1-handler messages. For reference, the official Apollo sequencer uses a scrape cooldown (new_l1_handler_tx_cooldown_secs) for the same purpose.

Fix idea

Default confirmation_depth to a safer value for non-dev Starknet settlement (and/or document the recommended value clearly), keeping 0 only for dev.

Follow-up split from the L1-handler nonce-gate fix (case B3c in the investigation).

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