sequencer

package
v0.0.0-...-5cda5f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Ctx           context.Context
	Cfg           *DriverConfig
	WalletAddr    common.Address
	FeeWalletAddr common.Address
	GraphClient   *graphView.GraphClient
	DtlClient     client.DtlClient

	LevelDBStore *db.Store
	FeeCh        chan *FeePipline
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(ctx context.Context, cfg *DriverConfig) (*Driver, error)

func (*Driver) CalcUserFeeByRules

func (d *Driver) CalcUserFeeByRules(rollupDateSize *big.Int) (*big.Int, error)

func (*Driver) CheckConfirmedWorker

func (d *Driver) CheckConfirmedWorker()

func (*Driver) ConfirmData

func (d *Driver) ConfirmData(ctx context.Context, callData []byte, searchData rc.IDataLayrServiceManagerDataStoreSearchData, startL2BlockNumber, endL2BlockNumber *big.Int, originDataStoreId uint32, reConfirmedBatchIndex *big.Int, isReRollup bool) (*types.Transaction, error)

func (*Driver) ConfirmStoredData

func (d *Driver) ConfirmStoredData(txHash []byte, params common2.StoreParams, startl2BlockNumber, endl2BlockNumber *big.Int, originDataStoreId uint32, reConfirmedBatchIndex *big.Int, isReRollup bool) (*types.Receipt, error)

func (*Driver) DisperseStoreData

func (d *Driver) DisperseStoreData(data []byte, startl2BlockNumber *big.Int, endl2BlockNumber *big.Int, isReRollup bool) (common2.StoreParams, *types.Receipt, error)

func (*Driver) GetBatchBlockRange

func (d *Driver) GetBatchBlockRange(ctx context.Context) (*big.Int, *big.Int, error)

func (*Driver) GetBatchBlockRangeWithTimeout

func (d *Driver) GetBatchBlockRangeWithTimeout(ctx context.Context) (*big.Int, *big.Int, error)

func (*Driver) GetEigenLayerNode

func (d *Driver) GetEigenLayerNode() (int, error)

func (*Driver) IsMaxPriorityFeePerGasNotFoundError

func (d *Driver) IsMaxPriorityFeePerGasNotFoundError(err error) bool

func (*Driver) RollUpFeeWorker

func (d *Driver) RollUpFeeWorker()

func (*Driver) RollupMainWorker

func (d *Driver) RollupMainWorker()

func (*Driver) SendTransaction

func (d *Driver) SendTransaction(ctx context.Context, tx *types.Transaction) error

func (*Driver) ServiceInit

func (d *Driver) ServiceInit() error

func (*Driver) Start

func (d *Driver) Start() error

func (*Driver) Stop

func (d *Driver) Stop()

func (*Driver) StoreData

func (d *Driver) StoreData(ctx context.Context, uploadHeader []byte, duration uint8, blockNumber uint32, startL2BlockNumber *big.Int, endL2BlockNumber *big.Int, totalOperatorsIndex uint32, isReRollup bool) (*types.Transaction, error)

func (*Driver) TxAggregator

func (d *Driver) TxAggregator(ctx context.Context, start, end *big.Int) (transactionData []byte, startL2BlockNumber *big.Int, endL2BlockNumber *big.Int)

func (*Driver) UpdateFee

func (d *Driver) UpdateFee(ctx context.Context, l2Block, daFee *big.Int) (*types.Transaction, error)

func (*Driver) UpdateGasPrice

func (d *Driver) UpdateGasPrice(ctx context.Context, tx *types.Transaction, feeModelEnable bool) (*types.Transaction, error)

func (*Driver) UpdateUserDaFee

func (d *Driver) UpdateUserDaFee(l2Block, daFee *big.Int) (*types.Receipt, error)

type DriverConfig

type DriverConfig struct {
	L1Client                  *ethclient.Client
	L2Client                  *l2ethclient.Client
	L1ChainID                 *big.Int
	DtlClientUrl              string
	EigenDaContract           *bindings.BVMEigenDataLayrChain
	RawEigenContract          *bind.BoundContract
	EigenFeeContract          *bindings.BVMEigenDataLayrFee
	RawEigenFeeContract       *bind.BoundContract
	Logger                    *logging.Logger
	PrivKey                   *ecdsa.PrivateKey
	FeePrivKey                *ecdsa.PrivateKey
	BlockOffset               uint64
	RollUpMinTxn              uint64
	RollUpMaxSize             uint64
	EigenLayerNode            int
	DataStoreDuration         uint64
	DataStoreTimeout          uint64
	DisperserSocket           string
	FeeWorkerPollInterval     time.Duration
	MainWorkerPollInterval    time.Duration
	CheckerWorkerPollInterval time.Duration
	GraphPollingDuration      time.Duration
	GraphProvider             string
	EigenLogConfig            logging.Config
	ResubmissionTimeout       time.Duration
	NumConfirmations          uint64
	SafeAbortNonceTooLowCount uint64
	DbPath                    string
	CheckerBatchIndex         uint64
	CheckerEnable             bool
	FeeSizeSec                string
	FeePerBytePerTime         uint64
	FeeModelEnable            bool
	MinTimeoutRollupTxn       uint64
	RollupTimeout             time.Duration
	Metrics                   metrics.MtBatchMetrics

	EnableHsm     bool
	HsmAddress    string
	HsmFeeAddress string
	HsmAPIName    string
	HsmFeeAPIName string
	HsmCreden     string
}

type FeePipline

type FeePipline struct {
	RollUpFee        *big.Int
	EndL2BlockNumber *big.Int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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