Versions in this module Expand all Collapse all v0 v0.1.0 Jan 28, 2022 Changes in this version + var DepositContractAddr = common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001") + var DepositEventABI = "TransactionDeposited(address,address,uint256,uint256,uint256,bool,bytes)" + var DepositEventABIHash = crypto.Keccak256Hash([]byte(DepositEventABI)) + var L1InfoFuncBytes4 = crypto.Keccak256([]byte(L1InfoFuncSignature))[:4] + var L1InfoFuncSignature = "setL1BlockValues(uint256 _number, uint256 _timestamp, uint256 _basefee, bytes32 _hash)" + var L1InfoPredeployAddr = common.HexToAddress("0x4242424242424242424242424242424242424242") + var WrongChainErr = errors.New("wrong chain") + func CheckReceipts(block ReceiptHash, receipts []*types.Receipt) bool + func DeriveL1InfoDeposit(block L1Info) *types.DepositTx + func DeriveUserDeposits(height uint64, receipts []*types.Receipt) ([]*types.DepositTx, error) + func DriverStep(ctx context.Context, log log.Logger, rpc DriverAPI, dl Downloader, ...) (out eth.BlockID, err error) + func Execute(ctx context.Context, rpc DriverAPI, payload *ExecutionPayload) error + func FindSyncStart(ctx context.Context, reference SyncReference, genesis *Genesis) (nextRefL1, refL2 eth.BlockID, err error) + func ForkchoiceUpdate(ctx context.Context, rpc DriverAPI, l2BlockHash common.Hash, ...) error + func NewDriverLoop(ctx context.Context, state StateMachine, log log.Logger, ...) func(quit <-chan struct{}) error + func ParseBlockReferences(refL2Block Block, genesis *Genesis) (refL1 eth.BlockID, refL2 eth.BlockID, parentL2 common.Hash, err error) + func ParseL1InfoDepositTxData(data []byte) (nr uint64, time uint64, baseFee *big.Int, blockHash common.Hash, err error) + func UnmarshalLogEvent(blockNum uint64, txIndex uint64, ev *types.Log) (*types.DepositTx, error) + type Block interface + Hash func() common.Hash + NumberU64 func() uint64 + ParentHash func() common.Hash + Transactions func() types.Transactions + type BlockInput interface + MixDigest func() common.Hash + type BlockPreparer interface + ForkchoiceUpdated func(ctx context.Context, state *ForkchoiceState, attr *PayloadAttributes) (ForkchoiceUpdatedResult, error) + GetPayload func(ctx context.Context, payloadId PayloadID) (*ExecutionPayload, error) + type Bytes256 [256]byte + func (b *Bytes256) UnmarshalJSON(text []byte) error + func (b *Bytes256) UnmarshalText(text []byte) error + func (b Bytes256) MarshalText() ([]byte, error) + func (b Bytes256) String() string + type Bytes32 [32]byte + func (b *Bytes32) UnmarshalJSON(text []byte) error + func (b *Bytes32) UnmarshalText(text []byte) error + func (b Bytes32) MarshalText() ([]byte, error) + func (b Bytes32) String() string + type BytesMax32 []byte + func (b *BytesMax32) UnmarshalJSON(text []byte) error + func (b *BytesMax32) UnmarshalText(text []byte) error + func (b BytesMax32) MarshalText() ([]byte, error) + func (b BytesMax32) String() string + type Data = hexutil.Bytes + type Downloader interface + Fetch func(ctx context.Context, id eth.BlockID) (*types.Block, []*types.Receipt, error) + type Driver interface + type DriverAPI interface + type EngineAPI interface + Close func() + ExecutePayload func(ctx context.Context, payload *ExecutionPayload) (*ExecutePayloadResult, error) + ForkchoiceUpdated func(ctx context.Context, state *ForkchoiceState, attr *PayloadAttributes) (ForkchoiceUpdatedResult, error) + GetPayload func(ctx context.Context, payloadId PayloadID) (*ExecutionPayload, error) + type EngineClient struct + Log log.Logger + func (el *EngineClient) Close() + func (el *EngineClient) ExecutePayload(ctx context.Context, payload *ExecutionPayload) (*ExecutePayloadResult, error) + func (el *EngineClient) ForkchoiceUpdated(ctx context.Context, state *ForkchoiceState, attr *PayloadAttributes) (ForkchoiceUpdatedResult, error) + func (el *EngineClient) GetPayload(ctx context.Context, payloadId PayloadID) (*ExecutionPayload, error) + type EngineDriver struct + DL Downloader + Log log.Logger + RPC DriverAPI + SyncRef SyncReference + func (e *EngineDriver) Close() + func (e *EngineDriver) Drive(ctx context.Context, l1Heads <-chan eth.HeadSignal) ethereum.Subscription + type EngineDriverState struct + Genesis Genesis + func (e *EngineDriverState) Head() (l1Head eth.BlockID, l2Head eth.BlockID) + func (e *EngineDriverState) L1Head() eth.BlockID + func (e *EngineDriverState) L2Head() eth.BlockID + func (e *EngineDriverState) NotifyL1Head(ctx context.Context, log log.Logger, l1HeadSig eth.HeadSignal, driver Driver) (l2Updated bool) + func (e *EngineDriverState) RequestSync(ctx context.Context, log log.Logger, driver Driver) (l2Updated bool) + func (e *EngineDriverState) RequestUpdate(ctx context.Context, log log.Logger, driver Driver) (l2Updated bool) + func (e *EngineDriverState) UpdateHead(l1Head eth.BlockID, l2Head eth.BlockID) + type ErrorCode int + const UnavailablePayload + type EthBackend interface + type ExecutePayloadResult struct + LatestValidHash common.Hash + Status ExecutePayloadStatus + ValidationError string + type ExecutePayloadStatus string + const ExecutionInvalid + const ExecutionSyncing + const ExecutionValid + type ExecutionPayload struct + BaseFeePerGas Uint256Quantity + BlockHash common.Hash + BlockNumber Uint64Quantity + ExtraData BytesMax32 + FeeRecipient common.Address + GasLimit Uint64Quantity + GasUsed Uint64Quantity + LogsBloom Bytes256 + ParentHash common.Hash + Random Bytes32 + ReceiptsRoot Bytes32 + StateRoot Bytes32 + Timestamp Uint64Quantity + Transactions []Data + func BlockToPayload(bl *types.Block, random Bytes32) (*ExecutionPayload, error) + func DeriveBlockOutputs(ctx context.Context, engine BlockPreparer, l2Parent common.Hash, ...) (*ExecutionPayload, error) + func (payload *ExecutionPayload) ID() eth.BlockID + type ForkchoiceState struct + FinalizedBlockHash common.Hash + HeadBlockHash common.Hash + SafeBlockHash common.Hash + type ForkchoiceUpdatedResult struct + PayloadID *PayloadID + Status ForkchoiceUpdatedStatus + type ForkchoiceUpdatedStatus string + const UpdateSuccess + const UpdateSyncing + type Genesis struct + L1 eth.BlockID + L2 eth.BlockID + type L1Info interface + BaseFee func() *big.Int + Hash func() common.Hash + NumberU64 func() uint64 + Time func() uint64 + type PayloadAttributes struct + Random Bytes32 + SuggestedFeeRecipient common.Address + Timestamp Uint64Quantity + Transactions []Data + func DeriveBlockInputs(block BlockInput, receipts []*types.Receipt) (*PayloadAttributes, error) + type PayloadID = hexutil.Bytes + type RPCBackend interface + CallContext func(ctx context.Context, result interface{}, method string, args ...interface{}) error + Close func() + type ReceiptHash interface + ReceiptHash func() common.Hash + type StateMachine interface + NotifyL1Head func(ctx context.Context, log log.Logger, l1HeadSig eth.HeadSignal, driver Driver) (l2Updated bool) + RequestSync func(ctx context.Context, log log.Logger, driver Driver) (l2Updated bool) + RequestUpdate func(ctx context.Context, log log.Logger, driver Driver) (l2Updated bool) + type SyncReference interface + RefByL1Num func(ctx context.Context, l1Num uint64) (self eth.BlockID, parent eth.BlockID, err error) + RefByL2Hash func(ctx context.Context, l2Hash common.Hash, genesis *Genesis) (refL1 eth.BlockID, refL2 eth.BlockID, parentL2 common.Hash, err error) + RefByL2Num func(ctx context.Context, l2Num *big.Int, genesis *Genesis) (refL1 eth.BlockID, refL2 eth.BlockID, parentL2 common.Hash, err error) + type SyncSource struct + L1 eth.BlockLinkByNumber + L2 eth.BlockSource + func (src SyncSource) RefByL1Num(ctx context.Context, l1Num uint64) (self eth.BlockID, parent eth.BlockID, err error) + func (src SyncSource) RefByL2Hash(ctx context.Context, l2Hash common.Hash, genesis *Genesis) (refL1 eth.BlockID, refL2 eth.BlockID, parentL2 common.Hash, err error) + func (src SyncSource) RefByL2Num(ctx context.Context, l2Num *big.Int, genesis *Genesis) (refL1 eth.BlockID, refL2 eth.BlockID, parentL2 common.Hash, err error) + type Uint256Quantity = uint256.Int + type Uint64Quantity = hexutil.Uint64 v0.1.0-rc.1 Jan 21, 2022