managed

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalErrorRPCErrcode    = -32603
	BlockNotFoundRPCErrCode    = -39001
	ConflictingBlockRPCErrCode = -39002
)

Variables

View Source
var (
	OptimisticBlockDepositSenderAddress = common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddead0002")

	ErrNotReplacementBlock = errors.New("not a replacement block")
)

Functions

func AttributesToReplaceInvalidBlock

func AttributesToReplaceInvalidBlock(invalidatedBlock *eth.ExecutionPayloadEnvelope) *eth.PayloadAttributes

AttributesToReplaceInvalidBlock builds the payload-attributes to replace an invalidated block. See https://github.com/ethereum-optimism/specs/blob/main/specs/interop/derivation.md#replacing-invalid-blocks

func DecodeInvalidatedBlockTx

func DecodeInvalidatedBlockTx(tx *types.Transaction) (*eth.OutputV0, error)

func DecodeInvalidatedBlockTxFromReplacement

func DecodeInvalidatedBlockTxFromReplacement(txs []eth.Data) (*eth.OutputV0, error)

func InvalidatedBlockSourceDepositTx

func InvalidatedBlockSourceDepositTx(outputRootPreimage []byte) *types.Transaction

Types

type InteropAPI

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

func (*InteropAPI) AnchorPoint

func (*InteropAPI) BlockRefByNumber

func (ib *InteropAPI) BlockRefByNumber(ctx context.Context, num uint64) (eth.BlockRef, error)

func (*InteropAPI) ChainID

func (ib *InteropAPI) ChainID(ctx context.Context) (eth.ChainID, error)

func (*InteropAPI) Events

func (ib *InteropAPI) Events(ctx context.Context) (*gethrpc.Subscription, error)

func (*InteropAPI) FetchReceipts

func (ib *InteropAPI) FetchReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)

func (*InteropAPI) InvalidateBlock

func (ib *InteropAPI) InvalidateBlock(ctx context.Context, seal supervisortypes.BlockSeal) error

func (*InteropAPI) L2BlockRefByTimestamp

func (ib *InteropAPI) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error)

func (*InteropAPI) OutputV0AtTimestamp

func (ib *InteropAPI) OutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)

func (*InteropAPI) PendingOutputV0AtTimestamp

func (ib *InteropAPI) PendingOutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)

func (*InteropAPI) ProvideL1

func (ib *InteropAPI) ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error

func (*InteropAPI) PullEvent

func (ib *InteropAPI) PullEvent() (*supervisortypes.ManagedEvent, error)

func (*InteropAPI) Reset

func (ib *InteropAPI) Reset(ctx context.Context, unsafe, safe, finalized eth.BlockID) error

func (*InteropAPI) UpdateCrossSafe

func (ib *InteropAPI) UpdateCrossSafe(ctx context.Context, derived eth.BlockID, derivedFrom eth.BlockID) error

func (*InteropAPI) UpdateCrossUnsafe

func (ib *InteropAPI) UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error

func (*InteropAPI) UpdateFinalized

func (ib *InteropAPI) UpdateFinalized(ctx context.Context, id eth.BlockID) error

type L1Source

type L1Source interface {
	L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
}

type L2Source

type L2Source interface {
	L2BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L2BlockRef, error)
	L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error)
	BlockRefByHash(ctx context.Context, hash common.Hash) (eth.BlockRef, error)
	PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayloadEnvelope, error)
	BlockRefByNumber(ctx context.Context, num uint64) (eth.BlockRef, error)
	FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
	OutputV0AtBlock(ctx context.Context, blockHash common.Hash) (*eth.OutputV0, error)
}

type ManagedMode

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

ManagedMode makes the op-node managed by an op-supervisor, by serving sync work and updating the canonical chain based on instructions.

func NewManagedMode

func NewManagedMode(log log.Logger, cfg *rollup.Config, addr string, port int, jwtSecret eth.Bytes32, l1 L1Source, l2 L2Source) *ManagedMode

func (*ManagedMode) AnchorPoint

func (*ManagedMode) AttachEmitter

func (m *ManagedMode) AttachEmitter(em event.Emitter)

func (*ManagedMode) BlockRefByNumber

func (m *ManagedMode) BlockRefByNumber(ctx context.Context, num uint64) (eth.BlockRef, error)

func (*ManagedMode) ChainID

func (m *ManagedMode) ChainID(ctx context.Context) (eth.ChainID, error)

func (*ManagedMode) Events

func (m *ManagedMode) Events(ctx context.Context) (*gethrpc.Subscription, error)

func (*ManagedMode) FetchReceipts

func (m *ManagedMode) FetchReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)

func (*ManagedMode) InvalidateBlock

func (m *ManagedMode) InvalidateBlock(ctx context.Context, seal supervisortypes.BlockSeal) error

func (*ManagedMode) JWTSecret

func (m *ManagedMode) JWTSecret() eth.Bytes32

func (*ManagedMode) L2BlockRefByTimestamp

func (m *ManagedMode) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error)

func (*ManagedMode) OnEvent

func (m *ManagedMode) OnEvent(ev event.Event) bool

func (*ManagedMode) OutputV0AtTimestamp

func (m *ManagedMode) OutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)

func (*ManagedMode) PendingOutputV0AtTimestamp

func (m *ManagedMode) PendingOutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)

func (*ManagedMode) ProvideL1

func (m *ManagedMode) ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error

func (*ManagedMode) PullEvent

func (m *ManagedMode) PullEvent() (*supervisortypes.ManagedEvent, error)

func (*ManagedMode) Reset

func (m *ManagedMode) Reset(ctx context.Context, unsafe, safe, finalized eth.BlockID) error

func (*ManagedMode) Start

func (m *ManagedMode) Start(ctx context.Context) error

func (*ManagedMode) Stop

func (m *ManagedMode) Stop(ctx context.Context) error

func (*ManagedMode) UpdateCrossSafe

func (m *ManagedMode) UpdateCrossSafe(ctx context.Context, derived eth.BlockID, derivedFrom eth.BlockID) error

func (*ManagedMode) UpdateCrossUnsafe

func (m *ManagedMode) UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error

func (*ManagedMode) UpdateFinalized

func (m *ManagedMode) UpdateFinalized(ctx context.Context, id eth.BlockID) error

func (*ManagedMode) WSEndpoint

func (m *ManagedMode) WSEndpoint() string

Jump to

Keyboard shortcuts

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