• protolambda's avatar
    FP: add KZG point-evaluation preimage-oracle type (#9461) · a0e47e5a
    protolambda authored
    * FP: add KZG point-evaluation preimage-oracle type, to process L2 oracle call with
    
    * op-program: Integrate kzg precompile oracle
    
    * fix PreimageOracle.sol
    
    * store kzg precompile input preimage
    
    * update bindings and go.mod
    
    * fix go.mod
    
    * resolve TODOs
    
    * s/Hex2Bytes/FromHex
    
    * fix typo
    
    * ctb: set kzg preimage length to 1
    
    * op-challenger: Load kzg point evaluations to PreimageOracle (#9497)
    
    * op-challenger: load KZG point evaluation into oracle
    
    Also: increase max game depth for devnet.
    This is a temporary solution to avoid flakes in e2e tests that use the kzg precompile.
    The current execution trace max step of 2**31 steps isn't sufficient.
    
    ---------
    Co-authored-by: default avatarinphi <mlaw2501@gmail.com>
    Co-authored-by: default avatarrefcell <abigger87@gmail.com>
    a0e47e5a
hints.go 1.25 KB
package l1

import (
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/common/hexutil"

	preimage "github.com/ethereum-optimism/optimism/op-preimage"
)

const (
	HintL1BlockHeader        = "l1-block-header"
	HintL1Transactions       = "l1-transactions"
	HintL1Receipts           = "l1-receipts"
	HintL1Blob               = "l1-blob"
	HintL1KZGPointEvaluation = "l1-kzg-point-evaluation"
)

type BlockHeaderHint common.Hash

var _ preimage.Hint = BlockHeaderHint{}

func (l BlockHeaderHint) Hint() string {
	return HintL1BlockHeader + " " + (common.Hash)(l).String()
}

type TransactionsHint common.Hash

var _ preimage.Hint = TransactionsHint{}

func (l TransactionsHint) Hint() string {
	return HintL1Transactions + " " + (common.Hash)(l).String()
}

type ReceiptsHint common.Hash

var _ preimage.Hint = ReceiptsHint{}

func (l ReceiptsHint) Hint() string {
	return HintL1Receipts + " " + (common.Hash)(l).String()
}

type BlobHint []byte

var _ preimage.Hint = BlobHint{}

func (l BlobHint) Hint() string {
	return HintL1Blob + " " + hexutil.Encode(l)
}

type KZGPointEvaluationHint []byte

var _ preimage.Hint = KZGPointEvaluationHint{}

func (l KZGPointEvaluationHint) Hint() string {
	return HintL1KZGPointEvaluation + " " + hexutil.Encode(l)
}