cannon

package
v1.4.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CannonMetricer

type CannonMetricer interface {
	RecordCannonExecutionTime(t float64)
}

type CannonTraceProvider

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

func NewTraceProvider

func NewTraceProvider(logger log.Logger, m CannonMetricer, cfg *config.Config, localContext common.Hash, localInputs LocalGameInputs, dir string, gameDepth uint64) *CannonTraceProvider

func (*CannonTraceProvider) AbsolutePreStateCommitment

func (p *CannonTraceProvider) AbsolutePreStateCommitment(_ context.Context) (common.Hash, error)

func (*CannonTraceProvider) Get

func (*CannonTraceProvider) GetStepData

func (*CannonTraceProvider) SetMaxDepth added in v1.2.0

func (p *CannonTraceProvider) SetMaxDepth(gameDepth uint64)

type Executor

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

func NewExecutor

func NewExecutor(logger log.Logger, m CannonMetricer, cfg *config.Config, inputs LocalGameInputs) *Executor

func (*Executor) GenerateProof

func (e *Executor) GenerateProof(ctx context.Context, dir string, i uint64) error

type GameInputsSource

type GameInputsSource interface {
	L1HeadSource
	GetProposals(ctx context.Context) (agreed contracts.Proposal, disputed contracts.Proposal, err error)
}

type L1HeadSource added in v1.4.2

type L1HeadSource interface {
	GetL1Head(ctx context.Context) (common.Hash, error)
}

type L2HeaderSource added in v1.4.2

type L2HeaderSource interface {
	HeaderByNumber(context.Context, *big.Int) (*ethtypes.Header, error)
}

type LocalGameInputs

type LocalGameInputs struct {
	L1Head        common.Hash
	L2Head        common.Hash
	L2OutputRoot  common.Hash
	L2Claim       common.Hash
	L2BlockNumber *big.Int
}

func FetchLocalInputs added in v1.4.2

func FetchLocalInputs(ctx context.Context, caller GameInputsSource, l2Client L2HeaderSource) (LocalGameInputs, error)

func FetchLocalInputsFromProposals added in v1.4.2

func FetchLocalInputsFromProposals(ctx context.Context, caller L1HeadSource, l2Client L2HeaderSource, agreedOutput contracts.Proposal, claimedOutput contracts.Proposal) (LocalGameInputs, error)

type ProofGenerator

type ProofGenerator interface {
	// GenerateProof executes cannon to generate a proof at the specified trace index in dataDir.
	GenerateProof(ctx context.Context, dataDir string, proofAt uint64) error
}

Jump to

Keyboard shortcuts

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