You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] block manager creates empty blocks if there is no batch #2097
When using a sequencer, the block manager creates empty blocks locally when no batch is available. This behavior introduces inconsistency between the local blockchain state and the sequencer's (and underlying DA layer's) understanding of the blockchain.
Current Behavior
In the block package, when no batch is available from the sequencer (ErrNoBatch), the block manager creates empty blocks locally:
When a sequencer is being used, only batches provided by the sequencer should be used to create blocks. The current implementation allows the block manager to create empty blocks locally, which are not visible to the sequencer or the underlying DA layer, leading to divergent views of the blockchain.
Concrete Example
Consider a scenario with batches:
B1, B2, B3, B4, B5: Batches returned by the sequencer
E1, E2, E3: Empty batches created locally by Rollkit
If block production proceeds as follows: B1, B2, E1, B3, E2, E3, B4, B5, this results in 8 blocks produced locally. However, the sequencer (and the underlying DA layer) is only aware of 5 blocks (B1-B5).
Consequences
Inconsistent State: The local node will have a different blockchain state than what's represented on the DA layer.
Synchronization Issues: Other nodes attempting to sync will encounter:
Batch verification failures for empty batches when receiving blocks via P2P
Different total block counts and contents, resulting in different chain states
Time Inconsistency: There's no guarantee that batch times will be monotonically increasing, which may cause additional ordering issues.
Proposed Solution
When using a sequencer, the block manager should not create empty blocks locally. Instead, it should wait for batches from the sequencer, maintaining consistency between local state and the sequencer's view.
If empty blocks are required for liveness, this responsibility should be handled by the sequencer itself, ensuring all nodes have a consistent view of these empty blocks.
Additional Context
This issue affects consensus integrity when using a sequencer with Rollkit. The behavior is a remnant of the pre-sequencer design that needs to be updated to align with the current architecture.
Activity
linear commentedon Mar 20, 2025
ROL-113 [Bug] block manager creates empty blocks if there is no batch
refactor: remove batch queue (#2173)