Skip to content

Conversation

@MatheusFranco99
Copy link
Contributor

Overview

This PR introduces SBCP v2 which has the following objectives:

  • Remove the SBCP v1 “slot” coupling: rollups keep independent block times.
  • Define a superblock period aligned with settlement batching (e.g., range/aggregation cadence) and treat composability consistency only at period boundaries.
  • Specify how SCP and CDCP instances are initiated, ordered, and terminated within a period.
  • Enforce sequential execution for instances that share a sequencer, and allow parallelism when participant sets are disjoint.
  • Bound rollbacks to superblock boundaries.

@MatheusFranco99 MatheusFranco99 self-assigned this Oct 21, 2025
@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 01:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces SBCP v2, a revised orchestration layer that removes the strict slot coupling from v1 and replaces it with a superblock period model aligned with settlement batching. The primary goal is to enable independent rollup block times while maintaining composability at period boundaries.

Key Changes:

  • Introduces a 10-epoch superblock period as the fundamental synchronization unit, replacing slot-based coordination
  • Defines new scheduling policies that enforce sequential execution for instances sharing rollups while allowing parallel execution for disjoint sets
  • Establishes rollback boundaries at superblock periods rather than individual slots

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
superblock_construction_protocol_v2.md New specification document defining the complete SBCP v2 protocol including time periods, message formats, sequencing rules, and state machines for the Shared Publisher and sequencers
settlement_layer.md Updated to remove slot-based synchronization details and reference the new SBCP v2 for state synchronization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cutover_time: timestamp # internal cutover time for the current period

# CDCP spanning and blocking
blocked: <InstanceID, Set<ChainID>> # Instance waiting for WSDecided and blocked chains
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The comment is unclear about the map structure. It should clarify whether this maps one instance ID to a set of chains, or if it represents multiple blocked instances. Consider: '# Maps instance ID to the set of chains it blocks' or '# Blocked instance and its associated blocked chains'.

Suggested change
blocked: <InstanceID, Set<ChainID>> # Instance waiting for WSDecided and blocked chains
blocked: <InstanceID, Set<ChainID>> # Maps instance ID to the set of chains it blocks (i.e., instance waiting for WSDecided and its associated blocked chains)

Copilot uses AI. Check for mistakes.
Comment on lines +210 to +211
if blocked.instance.id == inst.id:
blocked <- ⊥
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The code accesses 'blocked.instance.id' but the state definition shows 'blocked' as a map '<InstanceID, Set>' (line 171), not an object with 'instance.id'. This should check if 'inst.id' exists as a key in the blocked map, e.g., 'if inst.id in blocked:'.

Suggested change
if blocked.instance.id == inst.id:
blocked <- ⊥
if inst.id in blocked:
blocked.remove(inst.id)

Copilot uses AI. Check for mistakes.
Comment on lines +212 to +214
else:
active.remove(inst)

Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

Logic error: when an instance terminates, if it matches the blocked instance it's cleared from 'blocked', but not removed from 'active'. If it doesn't match, it's removed from 'active'. This means blocked instances are never removed from 'active'. Both cases should remove from 'active', and the blocked case should additionally clear the blocked state.

Suggested change
else:
active.remove(inst)
active.remove(inst)

Copilot uses AI. Check for mistakes.
Comment on lines +204 to +205
if inst.state == WAIT_WS:
blocked = <inst.id, Participants(inst)>
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The state 'WAIT_WS' is referenced but never defined. Consider adding documentation for CDCP instance states or referencing where they are defined.

Copilot uses AI. Check for mistakes.
finalize(inst, 0) # send Decided(0)
else if inst.type == CDCP:
if inst.state == WAIT_WS:
blocked = <inst.id, Participants(inst)>
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

Type mismatch: 'blocked' is defined as a map but here it's being assigned a tuple '<inst.id, Participants(inst)>'. Should use map insertion syntax, e.g., 'blocked[inst.id] = Participants(inst)'.

Suggested change
blocked = <inst.id, Participants(inst)>
blocked[inst.id] = Participants(inst)

Copilot uses AI. Check for mistakes.
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.

1 participant