Documentation
¶
Index ¶
- type Batcher
- type Challenger
- type ConsensusEngine
- type Health
- type OPStackConfig
- type Proposer
- type Sequencer
- type VM
- func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (vm *VM) BuildBlock(ctx context.Context) (vms.Block, error)
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32) error
- func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error
- func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (vms.Block, error)
- func (vm *VM) HealthCheck(ctx context.Context) (interface{}, error)
- func (vm *VM) Initialize(ctx context.Context, chainCtx *snow.Context, db vms.Database, ...) error
- func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error)
- func (vm *VM) ParseBlock(ctx context.Context, blockBytes []byte) (vms.Block, error)
- func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error
- func (vm *VM) SetState(ctx context.Context, state snow.State) error
- func (vm *VM) Shutdown(ctx context.Context) error
- func (vm *VM) Version(ctx context.Context) (string, error)
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) AppRequest ¶
func (*VM) AppRequestFailed ¶
func (*VM) AppResponse ¶
func (*VM) BuildBlock ¶
BuildBlock builds a new block
func (*VM) CrossChainAppRequest ¶
func (*VM) CrossChainAppRequestFailed ¶
func (*VM) CrossChainAppResponse ¶
func (*VM) HealthCheck ¶
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 ¶
LastAccepted returns the last accepted block ID
func (*VM) ParseBlock ¶
ParseBlock parses a block from bytes