Documentation
¶
Index ¶
- Constants
- Variables
- func AttributesToReplaceInvalidBlock(invalidatedBlock *eth.ExecutionPayloadEnvelope) *eth.PayloadAttributes
- func DecodeInvalidatedBlockTx(tx *types.Transaction) (*eth.OutputV0, error)
- func DecodeInvalidatedBlockTxFromReplacement(txs []eth.Data) (*eth.OutputV0, error)
- func InvalidatedBlockSourceDepositTx(outputRootPreimage []byte) *types.Transaction
- type EngineController
- type IndexingMode
- func (m *IndexingMode) AnchorPoint(ctx context.Context) (supervisortypes.DerivedBlockRefPair, error)
- func (m *IndexingMode) AttachEmitter(em event.Emitter)
- func (m *IndexingMode) ChainID(ctx context.Context) (eth.ChainID, error)
- func (m *IndexingMode) Events(ctx context.Context) (*gethrpc.Subscription, error)
- func (m *IndexingMode) FetchReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)
- func (m *IndexingMode) InvalidateBlock(ctx context.Context, seal supervisortypes.BlockSeal) error
- func (m *IndexingMode) JWTSecret() eth.Bytes32
- func (m *IndexingMode) L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error)
- func (m *IndexingMode) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error)
- func (m *IndexingMode) OnEvent(ctx context.Context, ev event.Event) bool
- func (m *IndexingMode) OutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)
- func (m *IndexingMode) PendingOutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)
- func (m *IndexingMode) ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error
- func (m *IndexingMode) PullEvent() (*supervisortypes.IndexingEvent, error)
- func (m *IndexingMode) Reset(ctx context.Context, lUnsafe, xUnsafe, lSafe, xSafe, finalized eth.BlockID) error
- func (m *IndexingMode) ResetPreInterop(ctx context.Context) error
- func (m *IndexingMode) SetEngineController(engineController EngineController)
- func (m *IndexingMode) Start(ctx context.Context) error
- func (m *IndexingMode) Stop(ctx context.Context) error
- func (m *IndexingMode) TestDisableEventDeduplication()
- func (m *IndexingMode) UpdateCrossSafe(ctx context.Context, derived eth.BlockID, derivedFrom eth.BlockID) error
- func (m *IndexingMode) UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error
- func (m *IndexingMode) UpdateFinalized(ctx context.Context, id eth.BlockID) error
- func (m *IndexingMode) WSEndpoint() string
- func (m *IndexingMode) WSPort() (int, error)
- type InteropAPI
- func (ib *InteropAPI) AnchorPoint(ctx context.Context) (supervisortypes.DerivedBlockRefPair, error)
- func (ib *InteropAPI) ChainID(ctx context.Context) (eth.ChainID, error)
- func (ib *InteropAPI) Events(ctx context.Context) (*gethrpc.Subscription, error)
- func (ib *InteropAPI) FetchReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)
- func (ib *InteropAPI) InvalidateBlock(ctx context.Context, seal supervisortypes.BlockSeal) error
- func (ib *InteropAPI) L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error)
- func (ib *InteropAPI) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error)
- func (ib *InteropAPI) OutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)
- func (ib *InteropAPI) PendingOutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)
- func (ib *InteropAPI) ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error
- func (ib *InteropAPI) PullEvent() (*supervisortypes.IndexingEvent, error)
- func (ib *InteropAPI) Reset(ctx context.Context, lUnsafe, xUnsafe, lSafe, xSafe, finalized eth.BlockID) error
- func (ib *InteropAPI) ResetPreInterop(ctx context.Context) error
- func (ib *InteropAPI) UpdateCrossSafe(ctx context.Context, derived eth.BlockID, derivedFrom eth.BlockID) error
- func (ib *InteropAPI) UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error
- func (ib *InteropAPI) UpdateFinalized(ctx context.Context, id eth.BlockID) error
- type L1Source
- type L2Source
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 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 (*IndexingMode) AnchorPoint ¶
func (m *IndexingMode) AnchorPoint(ctx context.Context) (supervisortypes.DerivedBlockRefPair, error)
func (*IndexingMode) AttachEmitter ¶
func (m *IndexingMode) AttachEmitter(em event.Emitter)
func (*IndexingMode) Events ¶
func (m *IndexingMode) Events(ctx context.Context) (*gethrpc.Subscription, error)
func (*IndexingMode) FetchReceipts ¶
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) OutputV0AtTimestamp ¶
func (*IndexingMode) PendingOutputV0AtTimestamp ¶
func (*IndexingMode) PullEvent ¶
func (m *IndexingMode) PullEvent() (*supervisortypes.IndexingEvent, 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) 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 (*IndexingMode) UpdateCrossUnsafe ¶
func (*IndexingMode) UpdateFinalized ¶
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 ¶
func (ib *InteropAPI) AnchorPoint(ctx context.Context) (supervisortypes.DerivedBlockRefPair, error)
TODO(#16140): remove
func (*InteropAPI) Events ¶
func (ib *InteropAPI) Events(ctx context.Context) (*gethrpc.Subscription, error)
func (*InteropAPI) FetchReceipts ¶
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 (*InteropAPI) PendingOutputV0AtTimestamp ¶
func (*InteropAPI) PullEvent ¶
func (ib *InteropAPI) PullEvent() (*supervisortypes.IndexingEvent, error)
func (*InteropAPI) ResetPreInterop ¶
func (ib *InteropAPI) ResetPreInterop(ctx context.Context) error
func (*InteropAPI) UpdateCrossSafe ¶
func (*InteropAPI) UpdateCrossUnsafe ¶
func (*InteropAPI) UpdateFinalized ¶
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)
}
Click to show internal directories.
Click to hide internal directories.