nodetype

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: AGPL-3.0 Imports: 24 Imported by: 0

README

The Service package

This package contains the different service types, currently Sequencer and Validator. It should only contain the driving logic built on top of the different components from the components package. Those services expect that the state would already be preinitialized when they are created so the responsibility for this for now sits within the enclave. Example of this is resynchronising the stateDB upon a restart.

Documentation

Index

Constants

View Source
const RollupDelay = 2 // number of L1 blocks to exclude when creating a rollup. This will minimize compression reorg issues.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveSequencer added in v1.0.0

type ActiveSequencer interface {
	// CreateBatch - creates a new head batch for the latest known L1 head block.
	CreateBatch(ctx context.Context, skipBatchIfEmpty bool) error

	// CreateRollup - creates a new rollup from the latest recorded rollup in the head l1 chain
	// and adds as many batches to it as possible.
	CreateRollup(ctx context.Context, lastBatchNo uint64) (*common.ExtRollup, []*kzg4844.Blob, error)

	NodeType
}

func NewSequencer

func NewSequencer(
	blockProcessor components.L1BlockProcessor,
	batchExecutor components.BatchExecutor,
	registry components.BatchRegistry,
	rollupProducer components.RollupProducer,
	rollupCompression *components.RollupCompression,
	gethEncodingService gethencoding.EncodingService,
	logger gethlog.Logger,
	chainConfig *params.ChainConfig,
	enclaveKeyService *crypto.EnclaveAttestedKeyService,
	mempool *components.TxPool,
	storage storage.Storage,
	dataCompressionService compression.DataCompressionService,
	settings SequencerSettings,
) ActiveSequencer

type NodeType

type NodeType interface {
	// OnL1Fork - logic to be performed when there is an L1 Fork
	OnL1Fork(ctx context.Context, fork *common.ChainFork) error

	// OnL1Block - performed after the block was processed
	OnL1Block(ctx context.Context, block *types.Header, result *components.BlockIngestionType) error

	Close() error
}

NodeType - the interface for any service type running in Obscuro nodes. Should only contain the shared functionality that every service type needs to have.

type SequencerSettings

type SequencerSettings struct {
	MaxBatchSize      uint64
	MaxRollupSize     uint64
	GasPaymentAddress gethcommon.Address
	BatchGasLimit     uint64
	BaseFee           *big.Int
}

type Validator added in v1.0.0

type Validator interface {
	// ExecuteStoredBatches - try to execute all stored by unexecuted batches
	ExecuteStoredBatches(context.Context) error

	VerifySequencerSignature(*core.Batch) error

	NodeType
}

func NewValidator

func NewValidator(
	consumer components.L1BlockProcessor,
	batchExecutor components.BatchExecutor,
	registry components.BatchRegistry,
	chainConfig *params.ChainConfig,
	storage storage.Storage,
	sigValidator components.SequencerSignatureVerifier,
	mempool *components.TxPool,
	logger gethlog.Logger,
) Validator

Jump to

Keyboard shortcuts

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