Documentation
¶
Index ¶
- Variables
- func FaultProofProgram(ctx context.Context, logger log.Logger, cfg *config.Config, opts ...ProgramOpt) error
- func NewL2KeyValueStore(kv kvstore.KV) *l2KeyValueStore
- func PreimageServer(ctx context.Context, logger log.Logger, cfg *config.Config, ...) error
- type L2Client
- type L2ClientConfig
- type L2Source
- func (l *L2Source) CodeByHash(ctx context.Context, hash common.Hash) ([]byte, error)
- func (l *L2Source) ExperimentalEnabled() bool
- func (l *L2Source) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
- func (l *L2Source) GetProof(ctx context.Context, address common.Address, storage []common.Hash, ...) (*eth.AccountResult, error)
- func (l *L2Source) InfoAndTxsByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Transactions, error)
- func (l *L2Source) NodeByHash(ctx context.Context, hash common.Hash) ([]byte, error)
- func (l *L2Source) OutputByNumber(ctx context.Context, blockNum uint64) (eth.Output, error)
- func (l *L2Source) OutputByRoot(ctx context.Context, blockRoot common.Hash) (eth.Output, error)
- func (l *L2Source) PayloadExecutionWitness(ctx context.Context, parentHash common.Hash, ...) (*eth.ExecutionWitness, error)
- func (s *L2Source) RollupConfig() *rollup.Config
- type L2Sources
- type Prefetcher
- type PrefetcherCreator
- type ProgramOpt
Constants ¶
This section is empty.
Variables ¶
var ( ErrExperimentalPrefetchFailed = errors.New("experimental prefetch failed") ErrExperimentalPrefetchDisabled = errors.New("experimental prefetch disabled") )
Functions ¶
func FaultProofProgram ¶
func FaultProofProgram(ctx context.Context, logger log.Logger, cfg *config.Config, opts ...ProgramOpt) error
FaultProofProgram is the programmatic entry-point for the fault proof program
func NewL2KeyValueStore ¶
NewL2KeyValueStore creates a l2.KeyValueStore compatible database that's backed by a kvstore.KV
func PreimageServer ¶
func PreimageServer(ctx context.Context, logger log.Logger, cfg *config.Config, preimageChannel preimage.FileChannel, hintChannel preimage.FileChannel, prefetcherCreator PrefetcherCreator) error
PreimageServer reads hints and preimage requests from the provided channels and processes those requests. This method will block until both the hinter and preimage handlers complete. If either returns an error both handlers are stopped. The supplied preimageChannel and hintChannel will be closed before this function returns.
Types ¶
type L2ClientConfig ¶
type L2ClientConfig struct {
*sources.L2ClientConfig
}
type L2Source ¶
type L2Source struct {
// contains filtered or unexported fields
}
L2Source is a source of L2 data, it abstracts away the details of how to fetch L2 data between canonical and experimental sources. It also tracks metrics for each of the apis. Once experimental sources are stable, this will only route to the "experimental" source.
func NewL2SourceFromRPC ¶
func NewL2SourceWithClient ¶
func NewL2SourceWithClient(logger log.Logger, canonicalL2Client *L2Client, canonicalDebugClient *sources.DebugClient) *L2Source
NewL2SourceWithClient creates a new L2 source with the given client as the canonical client. This doesn't configure the experimental source, but is useful for testing.
func (*L2Source) CodeByHash ¶
CodeByHash implements prefetcher.L2Source.
func (*L2Source) ExperimentalEnabled ¶
func (*L2Source) FetchReceipts ¶
func (l *L2Source) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
FetchReceipts implements prefetcher.L2Source.
func (*L2Source) GetProof ¶
func (l *L2Source) GetProof(ctx context.Context, address common.Address, storage []common.Hash, blockTag string) (*eth.AccountResult, error)
GetProof implements prefetcher.L2Source.
func (*L2Source) InfoAndTxsByHash ¶
func (l *L2Source) InfoAndTxsByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Transactions, error)
InfoAndTxsByHash implements prefetcher.L2Source.
func (*L2Source) NodeByHash ¶
NodeByHash implements prefetcher.L2Source.
func (*L2Source) OutputByNumber ¶
OutputByBlockNumber implements prefetcher.L2Source.
func (*L2Source) OutputByRoot ¶
OutputByRoot implements prefetcher.L2Source.
func (*L2Source) PayloadExecutionWitness ¶ added in v1.11.2
func (l *L2Source) PayloadExecutionWitness(ctx context.Context, parentHash common.Hash, payloadAttributes eth.PayloadAttributes) (*eth.ExecutionWitness, error)
PayloadExecutionWitness implements prefetcher.L2Source.
func (*L2Source) RollupConfig ¶
type L2Sources ¶
func NewL2Sources ¶
type Prefetcher ¶
type PrefetcherCreator ¶
type ProgramOpt ¶
type ProgramOpt func(c *programCfg)
func WithDB ¶
func WithDB(db l2.KeyValueStore) ProgramOpt
WithDB sets the backing state database used by the program. If not set, the program will use an in-memory database.
func WithPrefetcher ¶
func WithPrefetcher(creator PrefetcherCreator) ProgramOpt
WithPrefetcher configures the prefetcher used by the preimage server.
func WithSkipValidation ¶
func WithSkipValidation(skip bool) ProgramOpt
WithSkipValidation controls whether the program will skip validation of the derived block.
func WithStoreBlockData ¶
func WithStoreBlockData(store bool) ProgramOpt
WithStoreBlockData controls whether block data, including intermediate trie nodes from transactions and receipts of the derived block should be stored in the database.