Documentation
¶
Index ¶
- Variables
- func NewFetchingEngine(ctx context.Context, logger log.Logger, cfg *config.Config) (derive.Engine, error)
- type BlockSource
- type CallContext
- type FetchingL2Oracle
- type Oracle
- type OracleBackedL2Chain
- func (o *OracleBackedL2Chain) Config() *params.ChainConfig
- func (o *OracleBackedL2Chain) CurrentFinalBlock() *types.Header
- func (o *OracleBackedL2Chain) CurrentHeader() *types.Header
- func (o *OracleBackedL2Chain) CurrentSafeBlock() *types.Header
- func (o *OracleBackedL2Chain) Engine() consensus.Engine
- func (o *OracleBackedL2Chain) GetBlock(hash common.Hash, number uint64) *types.Block
- func (o *OracleBackedL2Chain) GetBlockByHash(hash common.Hash) *types.Block
- func (o *OracleBackedL2Chain) GetCanonicalHash(n uint64) common.Hash
- func (o *OracleBackedL2Chain) GetHeader(hash common.Hash, u uint64) *types.Header
- func (o *OracleBackedL2Chain) GetHeaderByHash(hash common.Hash) *types.Header
- func (o *OracleBackedL2Chain) GetHeaderByNumber(n uint64) *types.Header
- func (o *OracleBackedL2Chain) GetTd(hash common.Hash, number uint64) *big.Int
- func (o *OracleBackedL2Chain) GetVMConfig() *vm.Config
- func (o *OracleBackedL2Chain) HasBlockAndState(hash common.Hash, number uint64) bool
- func (o *OracleBackedL2Chain) InsertBlockWithoutSetHead(block *types.Block) error
- func (o *OracleBackedL2Chain) SetCanonical(head *types.Block) (common.Hash, error)
- func (o *OracleBackedL2Chain) SetFinalized(header *types.Header)
- func (o *OracleBackedL2Chain) SetSafe(header *types.Header)
- func (o *OracleBackedL2Chain) StateAt(root common.Hash) (*state.StateDB, error)
- type OracleEngine
- func (o OracleEngine) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (o OracleEngine) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)
- func (o OracleEngine) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
- func (o OracleEngine) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L2BlockRef, error)
- func (o OracleEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
- func (o OracleEngine) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayload, error)
- func (o OracleEngine) PayloadByNumber(ctx context.Context, n uint64) (*eth.ExecutionPayload, error)
- func (o OracleEngine) SystemConfigByL2Hash(ctx context.Context, hash common.Hash) (eth.SystemConfig, error)
- type OracleKeyValueStore
- func (o *OracleKeyValueStore) Close() error
- func (o *OracleKeyValueStore) Compact(start []byte, limit []byte) error
- func (o *OracleKeyValueStore) Delete(key []byte) error
- func (o *OracleKeyValueStore) Get(key []byte) ([]byte, error)
- func (o *OracleKeyValueStore) Has(key []byte) (bool, error)
- func (o *OracleKeyValueStore) NewBatch() ethdb.Batch
- func (o *OracleKeyValueStore) NewBatchWithSize(size int) ethdb.Batch
- func (o *OracleKeyValueStore) NewIterator(prefix []byte, start []byte) ethdb.Iterator
- func (o *OracleKeyValueStore) NewSnapshot() (ethdb.Snapshot, error)
- func (o *OracleKeyValueStore) Put(key []byte, value []byte) error
- func (o *OracleKeyValueStore) Stat(property string) (string, error)
- type StateOracle
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidKeyLength = errors.New("pre-images must be identified by 32-byte hash keys")
)
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
Types ¶
type BlockSource ¶
type CallContext ¶
type FetchingL2Oracle ¶
type FetchingL2Oracle struct {
// contains filtered or unexported fields
}
func NewFetchingL2Oracle ¶
func (*FetchingL2Oracle) BlockByHash ¶
func (*FetchingL2Oracle) CodeByHash ¶
func (o *FetchingL2Oracle) CodeByHash(hash common.Hash) ([]byte, error)
func (*FetchingL2Oracle) NodeByHash ¶
func (o *FetchingL2Oracle) NodeByHash(hash common.Hash) ([]byte, error)
type Oracle ¶
type Oracle interface {
StateOracle
// BlockByHash retrieves the block with the given hash.
// Returns an error if the block is not available.
BlockByHash(blockHash common.Hash) (*types.Block, error)
}
Oracle defines the high-level API used to retrieve L2 data. The returned data is always the preimage of the requested hash.
type OracleBackedL2Chain ¶
type OracleBackedL2Chain struct {
// contains filtered or unexported fields
}
func NewOracleBackedL2Chain ¶
func NewOracleBackedL2Chain(logger log.Logger, oracle Oracle, chainCfg *params.ChainConfig, l2Head common.Hash) (*OracleBackedL2Chain, error)
func (*OracleBackedL2Chain) Config ¶
func (o *OracleBackedL2Chain) Config() *params.ChainConfig
func (*OracleBackedL2Chain) CurrentFinalBlock ¶
func (o *OracleBackedL2Chain) CurrentFinalBlock() *types.Header
func (*OracleBackedL2Chain) CurrentHeader ¶
func (o *OracleBackedL2Chain) CurrentHeader() *types.Header
func (*OracleBackedL2Chain) CurrentSafeBlock ¶
func (o *OracleBackedL2Chain) CurrentSafeBlock() *types.Header
func (*OracleBackedL2Chain) Engine ¶
func (o *OracleBackedL2Chain) Engine() consensus.Engine
func (*OracleBackedL2Chain) GetBlockByHash ¶
func (o *OracleBackedL2Chain) GetBlockByHash(hash common.Hash) *types.Block
func (*OracleBackedL2Chain) GetCanonicalHash ¶
func (o *OracleBackedL2Chain) GetCanonicalHash(n uint64) common.Hash
func (*OracleBackedL2Chain) GetHeaderByHash ¶
func (o *OracleBackedL2Chain) GetHeaderByHash(hash common.Hash) *types.Header
func (*OracleBackedL2Chain) GetHeaderByNumber ¶
func (o *OracleBackedL2Chain) GetHeaderByNumber(n uint64) *types.Header
func (*OracleBackedL2Chain) GetVMConfig ¶
func (o *OracleBackedL2Chain) GetVMConfig() *vm.Config
func (*OracleBackedL2Chain) HasBlockAndState ¶
func (o *OracleBackedL2Chain) HasBlockAndState(hash common.Hash, number uint64) bool
func (*OracleBackedL2Chain) InsertBlockWithoutSetHead ¶
func (o *OracleBackedL2Chain) InsertBlockWithoutSetHead(block *types.Block) error
func (*OracleBackedL2Chain) SetCanonical ¶
func (*OracleBackedL2Chain) SetFinalized ¶
func (o *OracleBackedL2Chain) SetFinalized(header *types.Header)
func (*OracleBackedL2Chain) SetSafe ¶
func (o *OracleBackedL2Chain) SetSafe(header *types.Header)
type OracleEngine ¶
type OracleEngine struct {
// contains filtered or unexported fields
}
func NewOracleEngine ¶
func NewOracleEngine(rollupCfg *rollup.Config, logger log.Logger, backend engineapi.EngineBackend) *OracleEngine
func (OracleEngine) ForkchoiceUpdate ¶
func (o OracleEngine) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
func (OracleEngine) GetPayload ¶
func (o OracleEngine) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)
func (OracleEngine) L2BlockRefByHash ¶
func (o OracleEngine) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
func (OracleEngine) L2BlockRefByLabel ¶
func (o OracleEngine) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L2BlockRef, error)
func (OracleEngine) NewPayload ¶
func (o OracleEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
func (OracleEngine) PayloadByHash ¶
func (o OracleEngine) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayload, error)
func (OracleEngine) PayloadByNumber ¶
func (o OracleEngine) PayloadByNumber(ctx context.Context, n uint64) (*eth.ExecutionPayload, error)
func (OracleEngine) SystemConfigByL2Hash ¶
func (o OracleEngine) SystemConfigByL2Hash(ctx context.Context, hash common.Hash) (eth.SystemConfig, error)
type OracleKeyValueStore ¶
type OracleKeyValueStore struct {
// contains filtered or unexported fields
}
func NewOracleBackedDB ¶
func NewOracleBackedDB(oracle StateOracle) *OracleKeyValueStore
func (*OracleKeyValueStore) Close ¶
func (o *OracleKeyValueStore) Close() error
func (*OracleKeyValueStore) Compact ¶
func (o *OracleKeyValueStore) Compact(start []byte, limit []byte) error
func (*OracleKeyValueStore) Delete ¶
func (o *OracleKeyValueStore) Delete(key []byte) error
func (*OracleKeyValueStore) NewBatch ¶
func (o *OracleKeyValueStore) NewBatch() ethdb.Batch
func (*OracleKeyValueStore) NewBatchWithSize ¶
func (o *OracleKeyValueStore) NewBatchWithSize(size int) ethdb.Batch
func (*OracleKeyValueStore) NewIterator ¶
func (o *OracleKeyValueStore) NewIterator(prefix []byte, start []byte) ethdb.Iterator
func (*OracleKeyValueStore) NewSnapshot ¶
func (o *OracleKeyValueStore) NewSnapshot() (ethdb.Snapshot, error)
type StateOracle ¶
type StateOracle interface {
// NodeByHash retrieves the merkle-patricia trie node pre-image for a given hash.
// Trie nodes may be from the world state trie or any account storage trie.
// Contract code is not stored as part of the trie and must be retrieved via CodeByHash
// Returns an error if the pre-image is unavailable.
NodeByHash(nodeHash common.Hash) ([]byte, error)
// CodeByHash retrieves the contract code pre-image for a given hash.
// codeHash should be retrieved from the world state account for a contract.
// Returns an error if the pre-image is unavailable.
CodeByHash(codeHash common.Hash) ([]byte, error)
}
StateOracle defines the high-level API used to retrieve L2 state data pre-images The returned data is always the preimage of the requested hash.
Click to show internal directories.
Click to hide internal directories.