opstack

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher struct {
	// contains filtered or unexported fields
}

Batcher batches transactions for L1 submission

type Challenger

type Challenger struct {
	// contains filtered or unexported fields
}

Challenger handles fraud proofs

type ConsensusEngine

type ConsensusEngine interface {
	ValidateBlock(block *types.Block) error
	FinalizeBlock(block *types.Block) error
	GetFinalizationProof(blockHash common.Hash) ([]byte, error)
}

ConsensusEngine defines the consensus mechanism

func NewHybridConsensus

func NewHybridConsensus(config *OPStackConfig) ConsensusEngine

NewHybridConsensus creates a hybrid consensus engine

func NewOptimisticConsensus

func NewOptimisticConsensus(config *OPStackConfig) ConsensusEngine

NewOptimisticConsensus creates an optimistic rollup consensus engine

func NewZKConsensus

func NewZKConsensus(config *OPStackConfig) ConsensusEngine

NewZKConsensus creates a ZK rollup consensus engine

type Health

type Health struct {
	SequencerHealthy  bool   `json:"sequencerHealthy"`
	BatcherHealthy    bool   `json:"batcherHealthy"`
	ProposerHealthy   bool   `json:"proposerHealthy"`
	ChallengerHealthy bool   `json:"challengerHealthy"`
	BlockHeight       uint64 `json:"blockHeight"`
	PendingTxs        int    `json:"pendingTxs"`
}

Health represents the health status of the VM

type OPStackConfig

type OPStackConfig struct {
	// Sequencer configuration
	SequencerPrivateKey string
	SequencerAddress    common.Address

	// L1 configuration
	L1RPCEndpoint   string
	L1ChainID       uint64
	L1Confirmations uint64

	// OP Stack parameters
	BlockTime        time.Duration
	MaxBlockGas      uint64
	DataAvailability string // "ethereum" or "luxda"

	// Rollup configuration
	ChallengeWindow    time.Duration
	FinalizationPeriod time.Duration
	ProofSubmissionGas uint64

	// Multi-consensus support
	ConsensusType    string // "optimistic", "zk", "hybrid"
	ZKProverEndpoint string
}

OPStackConfig contains configuration for OP Stack based subnets

type Proposer

type Proposer struct {
	// contains filtered or unexported fields
}

Proposer proposes state roots to L1

type Sequencer

type Sequencer struct {
	// contains filtered or unexported fields
}

Sequencer handles transaction ordering and block production

type VM

type VM struct {
	// contains filtered or unexported fields
}

VM implements an OP Stack based subnet VM

func (*VM) AppGossip

func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error

func (*VM) AppRequest

func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte) error

func (*VM) AppRequestFailed

func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error

func (*VM) AppResponse

func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error

func (*VM) BuildBlock

func (vm *VM) BuildBlock(ctx context.Context) (vms.Block, error)

BuildBlock builds a new block

func (*VM) Connected

func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error

func (*VM) CrossChainAppRequest

func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, request []byte) error

func (*VM) CrossChainAppRequestFailed

func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32) error

func (*VM) CrossChainAppResponse

func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error

func (*VM) Disconnected

func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error

func (*VM) GetBlock

func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (vms.Block, error)

GetBlock retrieves a block by ID

func (*VM) HealthCheck

func (vm *VM) HealthCheck(ctx context.Context) (interface{}, error)

HealthCheck performs a health check

func (*VM) Initialize

func (vm *VM) Initialize(
	ctx context.Context,
	chainCtx *snow.Context,
	db vms.Database,
	genesisBytes []byte,
	upgradeBytes []byte,
	configBytes []byte,
	toEngine chan<- vms.Message,
	fxs []*vms.Fx,
	appSender vms.AppSender,
) error

Initialize initializes the VM

func (*VM) LastAccepted

func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error)

LastAccepted returns the last accepted block ID

func (*VM) ParseBlock

func (vm *VM) ParseBlock(ctx context.Context, blockBytes []byte) (vms.Block, error)

ParseBlock parses a block from bytes

func (*VM) SetPreference

func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error

func (*VM) SetState

func (vm *VM) SetState(ctx context.Context, state snow.State) error

Additional VM methods for compatibility

func (*VM) Shutdown

func (vm *VM) Shutdown(ctx context.Context) error

Shutdown shuts down the VM

func (*VM) Version

func (vm *VM) Version(ctx context.Context) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL