indexing

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: MIT, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

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

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 EngineController added in v1.13.6

type EngineController interface {
	ForceReset(ctx context.Context, localUnsafe, crossUnsafe, localSafe, crossSafe, finalized eth.L2BlockRef)
	PromoteSafe(ctx context.Context, ref eth.L2BlockRef, source eth.L1BlockRef)
	PromoteFinalized(ctx context.Context, ref eth.L2BlockRef)
}

type IndexingMode

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

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

func NewIndexingMode

func NewIndexingMode(log log.Logger, cfg *rollup.Config, addr string, port int, jwtSecret eth.Bytes32, l1 L1Source, l2 L2Source, m opmetrics.RPCMetricer) *IndexingMode

func (*IndexingMode) AnchorPoint

func (*IndexingMode) AttachEmitter

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

func (*IndexingMode) ChainID

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

func (*IndexingMode) Events

func (*IndexingMode) FetchReceipts

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

func (*IndexingMode) InvalidateBlock

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

func (*IndexingMode) JWTSecret

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

func (*IndexingMode) L2BlockRefByNumber

func (m *IndexingMode) L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error)

func (*IndexingMode) L2BlockRefByTimestamp

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

func (*IndexingMode) OnEvent

func (m *IndexingMode) OnEvent(ctx context.Context, ev event.Event) bool

Outgoing events to supervisor

func (*IndexingMode) OutputV0AtTimestamp

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

func (*IndexingMode) PendingOutputV0AtTimestamp

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

func (*IndexingMode) ProvideL1

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

func (*IndexingMode) PullEvent

func (m *IndexingMode) PullEvent() (*supervisortypes.IndexingEvent, error)

func (*IndexingMode) Reset

func (m *IndexingMode) Reset(ctx context.Context, lUnsafe, xUnsafe, lSafe, xSafe, finalized eth.BlockID) error

func (*IndexingMode) ResetPreInterop

func (m *IndexingMode) ResetPreInterop(ctx context.Context) error

TODO: add ResetPreInterop, called by supervisor if bisection went pre-Interop. Emit ResetEngineRequestEvent.

func (*IndexingMode) SetEngineController added in v1.13.6

func (m *IndexingMode) SetEngineController(engineController EngineController)

func (*IndexingMode) Start

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

func (*IndexingMode) Stop

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

func (*IndexingMode) TestDisableEventDeduplication

func (m *IndexingMode) TestDisableEventDeduplication()

TestDisableEventDeduplication is a test-only function that disables event deduplication. It is necessary to make action tests work.

func (*IndexingMode) UpdateCrossSafe

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

func (*IndexingMode) UpdateCrossUnsafe

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

func (*IndexingMode) UpdateFinalized

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

func (*IndexingMode) WSEndpoint

func (m *IndexingMode) WSEndpoint() string

func (*IndexingMode) WSPort

func (m *IndexingMode) WSPort() (int, error)

type InteropAPI

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

func (*InteropAPI) AnchorPoint

TODO(#16140): remove

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) L2BlockRefByNumber

func (ib *InteropAPI) L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, 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.IndexingEvent, error)

func (*InteropAPI) Reset

func (ib *InteropAPI) Reset(ctx context.Context, lUnsafe, xUnsafe, lSafe, xSafe, finalized eth.BlockID) error

func (*InteropAPI) ResetPreInterop

func (ib *InteropAPI) ResetPreInterop(ctx context.Context) 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)
	L1BlockRefByNumber(ctx context.Context, num uint64) (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)
	L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (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)
}

Jump to

Keyboard shortcuts

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