Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainContainer ¶
type ChainContainer interface {
Start(ctx context.Context) error
Stop(ctx context.Context) error
Pause(ctx context.Context) error
Resume(ctx context.Context) error
ID() eth.ChainID
LocalSafeBlockAtTimestamp(ctx context.Context, ts uint64) (eth.L2BlockRef, error)
SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
VerifiedAt(ctx context.Context, ts uint64) (l2, l1 eth.BlockID, err error)
OptimisticAt(ctx context.Context, ts uint64) (l2, l1 eth.BlockID, err error)
OutputRootAtL2BlockNumber(ctx context.Context, l2BlockNum uint64) (eth.Bytes32, error)
OptimisticOutputAtTimestamp(ctx context.Context, ts uint64) (*eth.OutputResponse, error)
// RewindEngine rewinds the engine to the highest block with timestamp less than or equal to the given timestamp.
// invalidatedBlock is the block that triggered the rewind and is passed to reset callbacks.
RewindEngine(ctx context.Context, timestamp uint64, invalidatedBlock eth.BlockRef) error
RegisterVerifier(v activity.VerificationActivity)
// FetchReceipts fetches the receipts for a given block by hash.
// Returns block info and receipts, or an error if the block or receipts cannot be fetched.
FetchReceipts(ctx context.Context, blockHash eth.BlockID) (eth.BlockInfo, types.Receipts, error)
// BlockTime returns the block time in seconds for this chain.
BlockTime() uint64
// InvalidateBlock adds a block to the deny list and triggers a rewind if the chain
// currently uses that block at the specified height.
// Returns true if a rewind was triggered, false otherwise.
InvalidateBlock(ctx context.Context, height uint64, payloadHash common.Hash) (bool, error)
// IsDenied checks if a block hash is on the deny list at the given height.
IsDenied(height uint64, payloadHash common.Hash) (bool, error)
// SetResetCallback sets a callback that is invoked when the chain resets.
// The supernode uses this to notify activities about chain resets.
SetResetCallback(cb ResetCallback)
}
func NewChainContainer ¶
func NewChainContainer( chainID eth.ChainID, vncfg *opnodecfg.Config, log gethlog.Logger, cfg config.CLIConfig, initOverload *rollupNode.InitializationOverrides, rpcHandler *oprpc.Handler, setHandler func(chainID string, h http.Handler), addMetricsRegistry func(key string, g prometheus.Gatherer), ) ChainContainer
type DenyList ¶ added in v1.16.7
type DenyList struct {
// contains filtered or unexported fields
}
DenyList provides persistence for invalid block payload hashes using bbolt. Blocks are keyed by block height, with each height potentially having multiple denied hashes.
func OpenDenyList ¶ added in v1.16.7
OpenDenyList opens or creates a DenyList at the given data directory.
func (*DenyList) Add ¶ added in v1.16.7
Add adds a payload hash to the deny list at the given block height. Multiple hashes can be denied at the same height.
type ResetCallback ¶ added in v1.16.7
ResetCallback is called when the chain container resets due to an invalidated block. The supernode uses this to notify activities about the reset. invalidatedBlock is the block that was invalidated and triggered the reset.
Click to show internal directories.
Click to hide internal directories.