outputs

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetStepData = errors.New("GetStepData not supported")
	ErrIndexTooBig = errors.New("trace index is greater than max uint64")
)

Functions

func CreateLocalContext added in v1.5.0

func CreateLocalContext(pre types.Claim, post types.Claim) common.Hash

func FetchProposals added in v1.5.0

func FetchProposals(ctx context.Context, topProvider *OutputTraceProvider, pre types.Claim, post types.Claim) (contracts.Proposal, contracts.Proposal, error)

func NewOutputAlphabetTraceAccessor added in v1.4.2

func NewOutputAlphabetTraceAccessor(
	logger log.Logger,
	m metrics.Metricer,
	prestateProvider types.PrestateProvider,
	rollupClient OutputRollupClient,
	l1Head eth.BlockID,
	splitDepth types.Depth,
	prestateBlock uint64,
	poststateBlock uint64,
) (*trace.Accessor, error)

func NewOutputAsteriscTraceAccessor added in v1.7.4

func NewOutputAsteriscTraceAccessor(
	logger log.Logger,
	m metrics.Metricer,
	cfg *config.Config,
	l2Client utils.L2HeaderSource,
	prestateProvider types.PrestateProvider,
	rollupClient OutputRollupClient,
	dir string,
	l1Head eth.BlockID,
	splitDepth types.Depth,
	prestateBlock uint64,
	poststateBlock uint64,
) (*trace.Accessor, error)

func NewOutputCannonTraceAccessor added in v1.4.2

func NewOutputCannonTraceAccessor(
	logger log.Logger,
	m metrics.Metricer,
	cfg *config.Config,
	l2Client utils.L2HeaderSource,
	prestateProvider types.PrestateProvider,
	rollupClient OutputRollupClient,
	dir string,
	l1Head eth.BlockID,
	splitDepth types.Depth,
	prestateBlock uint64,
	poststateBlock uint64,
) (*trace.Accessor, error)

func OutputRootSplitAdapter added in v1.4.2

func OutputRootSplitAdapter(topProvider *OutputTraceProvider, creator ProposalTraceProviderCreator) split.ProviderCreator

Types

type OutputPrestateProvider added in v1.4.2

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

func NewPrestateProvider added in v1.4.2

func NewPrestateProvider(rollupClient OutputRollupClient, prestateBlock uint64) *OutputPrestateProvider

func (*OutputPrestateProvider) AbsolutePreStateCommitment added in v1.4.2

func (o *OutputPrestateProvider) AbsolutePreStateCommitment(ctx context.Context) (hash common.Hash, err error)

type OutputRollupClient

type OutputRollupClient interface {
	OutputAtBlock(ctx context.Context, blockNum uint64) (*eth.OutputResponse, error)
	SafeHeadAtL1Block(ctx context.Context, l1BlockNum uint64) (*eth.SafeHeadResponse, error)
}

type OutputTraceProvider

type OutputTraceProvider struct {
	types.PrestateProvider
	// contains filtered or unexported fields
}

OutputTraceProvider is a types.TraceProvider implementation that uses output roots for given L2 Blocks as a trace.

func NewTraceProvider

func NewTraceProvider(logger log.Logger, prestateProvider types.PrestateProvider, rollupProvider OutputRollupClient, l1Head eth.BlockID, gameDepth types.Depth, prestateBlock, poststateBlock uint64) *OutputTraceProvider

func (*OutputTraceProvider) ClaimedBlockNumber added in v1.7.2

func (o *OutputTraceProvider) ClaimedBlockNumber(pos types.Position) (uint64, error)

ClaimedBlockNumber returns the block number for a position restricted only by the claimed L2 block number. The returned block number may be after the safe head reached by processing batch data up to the game's L1 head

func (*OutputTraceProvider) Get

func (*OutputTraceProvider) GetStepData

func (o *OutputTraceProvider) GetStepData(_ context.Context, _ types.Position) (prestate []byte, proofData []byte, preimageData *types.PreimageOracleData, err error)

GetStepData is not supported in the OutputTraceProvider.

func (*OutputTraceProvider) HonestBlockNumber added in v1.7.2

func (o *OutputTraceProvider) HonestBlockNumber(ctx context.Context, pos types.Position) (uint64, error)

HonestBlockNumber returns the block number for a position in the game restricted to the minimum of the claimed L2 block number or the safe head reached by processing batch data up to the game's L1 head. This is used when posting honest output roots to ensure that only roots supported by L1 data are posted

type ProposalTraceProviderCreator added in v1.4.2

type ProposalTraceProviderCreator func(ctx context.Context, localContext common.Hash, depth types.Depth, agreed contracts.Proposal, claimed contracts.Proposal) (types.TraceProvider, error)

type ProviderCache added in v1.4.2

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

func NewProviderCache added in v1.4.2

func NewProviderCache(m caching.Metrics, metricsLabel string, creator ProposalTraceProviderCreator) *ProviderCache

func (*ProviderCache) GetOrCreate added in v1.4.2

func (c *ProviderCache) GetOrCreate(ctx context.Context, localContext common.Hash, depth types.Depth, agreed contracts.Proposal, claimed contracts.Proposal) (types.TraceProvider, error)

Jump to

Keyboard shortcuts

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