super

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepsPerTimestamp = 1024
)

Variables

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

	InvalidTransition     = []byte("invalid")
	InvalidTransitionHash = crypto.Keccak256Hash(InvalidTransition)
)
View Source
var ErrDuplicateChain = errors.New("duplicate chain")

Functions

func NewSuperCannonTraceAccessor

func NewSuperCannonTraceAccessor(
	logger log.Logger,
	m metrics.Metricer,
	cfg vm.Config,
	serverExecutor vm.OracleServerExecutor,
	prestateProvider PreimagePrestateProvider,
	rootProvider RootProvider,
	cannonPrestate string,
	dir string,
	l1Head eth.BlockID,
	splitDepth types.Depth,
	prestateBlock uint64,
	poststateBlock uint64,
) (*trace.Accessor, error)

Types

type ClaimInfo

type ClaimInfo struct {
	AgreedPrestate []byte
	Claim          common.Hash
}

func FetchClaimInfo

func FetchClaimInfo(ctx context.Context, topProvider PreimageTraceProvider, pre types.Claim, post types.Claim) (ClaimInfo, error)

type PreimagePrestateProvider

type PreimagePrestateProvider interface {
	types.PrestateProvider
	AbsolutePreState(ctx context.Context) (eth.Super, error)
}

type PreimageTraceProvider

type PreimageTraceProvider interface {
	AbsolutePreState(ctx context.Context) (eth.Super, error)
	GetPreimageBytes(ctx context.Context, pos types.Position) ([]byte, error)
	ComputeStep(pos types.Position) (timestamp uint64, step uint64, err error)
}

type ProposalTraceProviderCreator

type ProposalTraceProviderCreator func(ctx context.Context, localContext common.Hash, depth types.Depth, claimInfo ClaimInfo) (types.TraceProvider, error)

type ProviderCache

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

func NewProviderCache

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

func (*ProviderCache) GetOrCreate

func (c *ProviderCache) GetOrCreate(ctx context.Context, localContext common.Hash, depth types.Depth, claimInfo ClaimInfo) (types.TraceProvider, error)

type RollupConfigs

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

func NewRollupConfigs

func NewRollupConfigs(vmCfg vm.Config) (*RollupConfigs, error)

func NewRollupConfigsFromParsed

func NewRollupConfigsFromParsed(rollupCfgs ...*rollup.Config) (*RollupConfigs, error)

func (*RollupConfigs) Get

func (c *RollupConfigs) Get(chainID eth.ChainID) (*rollup.Config, bool)

type RootProvider

type RootProvider interface {
	SuperRootAtTimestamp(ctx context.Context, timestamp hexutil.Uint64) (eth.SuperRootResponse, error)
	AllSafeDerivedAt(ctx context.Context, derivedFrom eth.BlockID) (map[eth.ChainID]eth.BlockID, error)
}

type SuperRootPrestateProvider

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

func NewSuperRootPrestateProvider

func NewSuperRootPrestateProvider(provider RootProvider, prestateTimestamp uint64) *SuperRootPrestateProvider

func (*SuperRootPrestateProvider) AbsolutePreState

func (s *SuperRootPrestateProvider) AbsolutePreState(ctx context.Context) (eth.Super, error)

func (*SuperRootPrestateProvider) AbsolutePreStateCommitment

func (s *SuperRootPrestateProvider) AbsolutePreStateCommitment(ctx context.Context) (common.Hash, error)

type SuperTraceProvider

type SuperTraceProvider struct {
	PreimagePrestateProvider
	// contains filtered or unexported fields
}

func NewSuperTraceProvider

func NewSuperTraceProvider(logger log.Logger, rollupCfgs *RollupConfigs, prestateProvider PreimagePrestateProvider, rootProvider RootProvider, l1Head eth.BlockID, gameDepth types.Depth, prestateTimestamp, poststateTimestamp uint64) *SuperTraceProvider

func (*SuperTraceProvider) ComputeStep

func (s *SuperTraceProvider) ComputeStep(pos types.Position) (timestamp uint64, step uint64, err error)

func (*SuperTraceProvider) Get

func (*SuperTraceProvider) GetL2BlockNumberChallenge

func (s *SuperTraceProvider) GetL2BlockNumberChallenge(_ context.Context) (*types.InvalidL2BlockNumberChallenge, error)

func (*SuperTraceProvider) GetPreimageBytes

func (s *SuperTraceProvider) GetPreimageBytes(ctx context.Context, pos types.Position) ([]byte, error)

func (*SuperTraceProvider) GetStepData

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

type SyncStatusProvider

type SyncStatusProvider interface {
	SyncStatus(ctx context.Context) (eth.SupervisorSyncStatus, error)
}

type SyncValidator

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

func NewSyncValidator

func NewSyncValidator(syncStatusProvider SyncStatusProvider) *SyncValidator

func (SyncValidator) ValidateNodeSynced

func (s SyncValidator) ValidateNodeSynced(ctx context.Context, gameL1Head eth.BlockID) error

Jump to

Keyboard shortcuts

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