Documentation ¶
Index ¶
- Constants
- Variables
- func FindStartingSnapshot(logger log.Logger, snapDir string, absolutePreState string, traceIndex uint64) (string, error)
- func PreimageDir(dir string) string
- func ReadLastStep(dir string) (uint64, error)
- func RunCmd(ctx context.Context, l log.Logger, binary string, args ...string) error
- func WriteLastStep(dir string, proof *ProofData, step uint64) error
- type CmdExecutor
- type GameInputsSource
- type L1HeadSource
- type L2HeaderSource
- type LocalGameInputs
- type PreimageLoader
- type PreimageOpt
- type ProofData
- type ProofGenerator
- type SnapshotSelect
Constants ¶
View Source
const ( SnapsDir = "snapshots" PreimagesDir = "preimages" FinalState = "final.json.gz" )
View Source
const (
ProofsDir = "proofs"
)
Variables ¶
View Source
var ( ErrInvalidScalarValue = errors.New("invalid scalar value") ErrInvalidBlobKeyPreimage = errors.New("invalid blob key preimage") )
Functions ¶
func FindStartingSnapshot ¶
func FindStartingSnapshot(logger log.Logger, snapDir string, absolutePreState string, traceIndex uint64) (string, error)
FindStartingSnapshot finds the closest snapshot before the specified traceIndex in snapDir. If no suitable snapshot can be found it returns absolutePreState.
func PreimageDir ¶
func ReadLastStep ¶
ReadLastStep reads the tracked last step from disk.
Types ¶
type CmdExecutor ¶
type GameInputsSource ¶
type L1HeadSource ¶
type L2HeaderSource ¶
type LocalGameInputs ¶
type LocalGameInputs struct { L1Head common.Hash L2Head common.Hash L2OutputRoot common.Hash L2Claim common.Hash L2BlockNumber *big.Int }
func FetchLocalInputs ¶
func FetchLocalInputs(ctx context.Context, caller GameInputsSource, l2Client L2HeaderSource) (LocalGameInputs, error)
type PreimageLoader ¶
type PreimageLoader struct {
// contains filtered or unexported fields
}
func NewPreimageLoader ¶
func NewPreimageLoader(getPreimage preimageSource) *PreimageLoader
func (*PreimageLoader) LoadPreimage ¶
func (l *PreimageLoader) LoadPreimage(proof *ProofData) (*types.PreimageOracleData, error)
type PreimageOpt ¶
type PreimageOpt func() preimageOpts
func FirstKeccakPreimageLoad ¶
func FirstKeccakPreimageLoad() PreimageOpt
func FirstPrecompilePreimageLoad ¶
func FirstPrecompilePreimageLoad() PreimageOpt
func FirstPreimageLoadOfType ¶
func FirstPreimageLoadOfType(preimageType string) PreimageOpt
func PreimageLargerThan ¶
func PreimageLargerThan(size int) PreimageOpt
func PreimageLoad ¶
func PreimageLoad(key preimage.Key, offset uint32) PreimageOpt
type ProofData ¶
type ProofData struct { ClaimValue common.Hash `json:"post"` StateData hexutil.Bytes `json:"state-data"` ProofData hexutil.Bytes `json:"proof-data"` OracleKey hexutil.Bytes `json:"oracle-key,omitempty"` OracleValue hexutil.Bytes `json:"oracle-value,omitempty"` OracleOffset uint32 `json:"oracle-offset,omitempty"` }
type ProofGenerator ¶
Click to show internal directories.
Click to hide internal directories.