Documentation
¶
Index ¶
- type Config
- type Coordinator
- func (c *Coordinator) Consensus() consensus.Coordinator
- func (c *Coordinator) GetActiveTransactions() []*pb.XtID
- func (c *Coordinator) GetCurrentSlot() uint64
- func (c *Coordinator) GetSlotState() slot.State
- func (c *Coordinator) GetStats() map[string]interface{}
- func (c *Coordinator) HandleL2Block(ctx context.Context, from string, l2Block *pb.L2Block) error
- func (c *Coordinator) Logger() *zerolog.Logger
- func (c *Coordinator) Start(ctx context.Context) error
- func (c *Coordinator) StartSCPForAdapter(ctx context.Context, xtReq *pb.XTRequest, xtID []byte, from string) error
- func (c *Coordinator) StateMachine() *slot.StateMachine
- func (c *Coordinator) Stop(ctx context.Context) error
- func (c *Coordinator) SubmitXTRequest(ctx context.Context, from string, request *pb.XTRequest) error
- func (c *Coordinator) Transport() transport.Server
- type ProofsConfig
- type SlotExecution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Slot slot.Config `mapstructure:"slot" yaml:"slot"`
Queue queue.Config `mapstructure:"queue" yaml:"queue"`
Store store.Config `mapstructure:"store" yaml:"store"`
WAL wal.Config `mapstructure:"wal" yaml:"wal"`
L1 l1.Config `mapstructure:"l1" yaml:"l1"`
Proofs ProofsConfig `mapstructure:"proofs" yaml:"proofs"`
// Coordinator-level settings
MaxConcurrentSlots int `mapstructure:"max_concurrent_slots" yaml:"max_concurrent_slots"`
BlockValidationTimeout time.Duration `mapstructure:"block_validation_timeout" yaml:"block_validation_timeout"`
}
Config aggregates configuration for all SBCP components
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns sensible defaults for production deployment
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator orchestrates the Superblock Construction Protocol (SBCP) by managing slot-based execution, cross-chain transactions, and L2 block assembly
func NewCoordinator ¶
func NewCoordinator( config Config, log zerolog.Logger, metrics prometheus.Registerer, registryService registry.Service, l2BlockStore store.L2BlockStore, superblockStore store.SuperblockStore, xtQueue queue.XTRequestQueue, l1Publisher l1.Publisher, walManager wal.Manager, consensusCoord consensus.Coordinator, transport transport.Server, collector apicollector.Service, prover proofs.ProverClient, ) *Coordinator
func (*Coordinator) Consensus ¶
func (c *Coordinator) Consensus() consensus.Coordinator
Consensus returns the underlying consensus coordinator.
func (*Coordinator) GetActiveTransactions ¶
func (c *Coordinator) GetActiveTransactions() []*pb.XtID
func (*Coordinator) GetCurrentSlot ¶
func (c *Coordinator) GetCurrentSlot() uint64
func (*Coordinator) GetSlotState ¶
func (c *Coordinator) GetSlotState() slot.State
func (*Coordinator) GetStats ¶
func (c *Coordinator) GetStats() map[string]interface{}
func (*Coordinator) HandleL2Block ¶
HandleL2Block is an exported wrapper to process incoming L2 block messages.
func (*Coordinator) Logger ¶
func (c *Coordinator) Logger() *zerolog.Logger
Logger exposes the coordinator's logger for external packages (e.g., handlers).
func (*Coordinator) StartSCPForAdapter ¶
func (c *Coordinator) StartSCPForAdapter(ctx context.Context, xtReq *pb.XTRequest, xtID []byte, from string) error
StartSCPForAdapter allows adapter layer to initiate SCP with a constructed request.
func (*Coordinator) StateMachine ¶
func (c *Coordinator) StateMachine() *slot.StateMachine
StateMachine exposes the slot state machine for external observers.
func (*Coordinator) SubmitXTRequest ¶
func (*Coordinator) Transport ¶
func (c *Coordinator) Transport() transport.Server
Transport exposes the transport server for broadcasting messages from adapters.
type ProofsConfig ¶
type ProofsConfig struct {
Enabled bool `mapstructure:"enabled" yaml:"enabled"`
Collector struct {
RequireAllChains bool `mapstructure:"require_all_chains" yaml:"require_all_chains"`
WaitTimeout time.Duration `mapstructure:"wait_timeout" yaml:"wait_timeout"`
RequiredChainIDs []uint32 `mapstructure:"required_chain_ids" yaml:"required_chain_ids"`
} `mapstructure:"collector" yaml:"collector"`
Prover struct {
BaseURL string `mapstructure:"base_url" yaml:"base_url"`
PollInterval time.Duration `mapstructure:"poll_interval" yaml:"poll_interval"`
ProofType string `mapstructure:"proof_type" yaml:"proof_type"`
} `mapstructure:"prover" yaml:"prover"`
// If false, SP may fall back to publishing without a proof on prover failure.
RequireProof bool `mapstructure:"require_proof" yaml:"require_proof"`
}
ProofsConfig controls the optional proof pipeline (collection → proving → L1 publish with proof).
func DefaultProofsConfig ¶
func DefaultProofsConfig() ProofsConfig
DefaultProofsConfig returns sensible defaults.
type SlotExecution ¶
type SlotExecution struct {
Slot uint64 `json:"slot"`
State slot.State `json:"state"`
StartTime time.Time `json:"start_time"`
NextSuperblockNumber uint64 `json:"next_superblock_number"`
LastSuperblockHash []byte `json:"last_superblock_hash"`
ActiveRollups [][]byte `json:"active_rollups"` // Rollups participating in slot
ReceivedL2Blocks map[string]*pb.L2Block `json:"received_l2_blocks"` // Key: chainID
SCPInstances map[string]*slot.SCPInstance `json:"scp_instances"` // Key: xtID
L2BlockRequests map[string]*pb.L2BlockRequest `json:"l2_block_requests"` // Key: chainID
AttemptedRequests map[string]*queue.QueuedXTRequest `json:"attempted_requests"` // xtID hex -> queued request
}
SlotExecution tracks the execution state for a single slot in the SBCP