Skip to content

fix: Allow for stream event redrive#2283

Open
sergerad wants to merge 3 commits into
nextfrom
sergerad-stream-redrive
Open

fix: Allow for stream event redrive#2283
sergerad wants to merge 3 commits into
nextfrom
sergerad-stream-redrive

Conversation

@sergerad

@sergerad sergerad commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Validator may sometimes redrive a committed / streamed block (N). Currently the stream subscription logic ignores N being redriven because it is less than the expected next (N+1).

This PR adds support for redriving historic events.

Replaces #2270.

Changelog

changelog = "none"
reason    = "Internal change only."

@sergerad sergerad changed the title Sergerad stream redrive fix: Allow for stream event redrive Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is true.

What is true is that the validator allows replacing the latest block it has personally signed. But such a "replaced" block is never committed and therefore should never be considered the chain tip.

As an example:

  1. Block N is proposed and
    1. submitted to the validator for signing
    2. signed by the validator
    3. committed by the sequencer
    4. N is now the new committed chain tip and may be sent to downstream subscribers
  2. Block N+1 is proposed
    1. submitted to the validator for signing
    2. signed by the validator
    3. the sequencer has some problem and discards it
    4. this block is never committed and is never streamed out
  3. A new N+1 is proposed
    1. submitted to the validator for signing
    2. signed by the validator, overwriting its local last signed block
    3. committed by the sequencer
    4. N+1 is now the new committed chain tip and may be sent to downstream

In other words, the validators chain tip is irrelevant. It is never streamed. Only the sequencer's committed chain tip is streamed.


A separate concern is what happens if we discover that some block M proof fails, or is rejected by L1. Then we need some sort of rollback mechanism but that is a different issue.

@sergerad sergerad Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, the validators chain tip is irrelevant. It is never streamed. Only the sequencer's committed chain tip is streamed.

We use the same machinery for streaming blocks for the validator backup stream and the RPC replica streams. This PR is trying to solve the problem we have ATM where a redriven Validator block would be ignored. So we would potentially have a bad backup (backup contains the wrong version of a block that was overwritten).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validator should be used for sequencer recovery. In other words, there cannot be a redriven block because there is no sequencer and therefore no new blocks.

Or if you prefer a stricter model - the validator should reject all new blocks while it has a subscription active. But I don't think we need to go that route because, again, this is intended as a last resort data recovery.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though maybe that isn't such a bad idea. Reject all block signing requests with cannot sign, recovery in progress.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there cannot be a redriven block because there is no sequencer and therefore no new blocks.

I don't understand what this means. The redrive is made by the sequencer in the first place - overwriting the N'th block (next-1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants