producer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyProofProducer

type DummyProofProducer struct {
	RandomDummyProofDelayLowerBound *time.Duration
	RandomDummyProofDelayUpperBound *time.Duration
}

DummyProofProducer always returns a dummy proof.

func (*DummyProofProducer) RequestProof

func (d *DummyProofProducer) RequestProof(
	opts *ProofRequestOptions,
	blockID *big.Int,
	meta *bindings.TaikoDataBlockMetadata,
	header *types.Header,
	resultCh chan *ProofWithHeader,
) error

RequestProof implements the ProofProducer interface.

type ProofProducer

type ProofProducer interface {
	RequestProof(
		opts *ProofRequestOptions,
		blockID *big.Int,
		meta *bindings.TaikoDataBlockMetadata,
		header *types.Header,
		resultCh chan *ProofWithHeader,
	) error
}

type ProofRequestOptions

type ProofRequestOptions struct {
	Height *big.Int // the block number
}

ProofRequestOptions contains all options that need to be passed to zkEVM rpcd service.

type ProofWithHeader

type ProofWithHeader struct {
	BlockID *big.Int
	Meta    *bindings.TaikoDataBlockMetadata
	Header  *types.Header
	ZkProof []byte
}

type ProverCmdOutput added in v0.3.0

type ProverCmdOutput struct {
	Instances []string `json:"instances"`
	Proof     []byte   `json:"proof"`
}

type RequestProofBody added in v0.3.0

type RequestProofBody struct {
	JsonRPC string                   `json:"jsonrpc"`
	ID      *big.Int                 `json:"id"`
	Method  string                   `json:"method"`
	Params  []*RequestProofBodyParam `json:"params"`
}

RequestProofBody represents the JSON body for requesting the proof.

type RequestProofBodyParam added in v0.3.0

type RequestProofBodyParam struct {
	Circuit     string   `json:"circuit"`
	Block       *big.Int `json:"block"`
	RPC         string   `json:"rpc"`
	Retry       bool     `json:"retry"`
	Param       string   `json:"param"`
	VerifyProof bool     `json:"verify_proof"`
	Mock        bool     `json:"mock"`
	Aggregate   bool     `json:"aggregate"`
}

RequestProofBody represents the JSON body of RequestProofBody's `param` field.

type RequestProofBodyResponse added in v0.3.0

type RequestProofBodyResponse struct {
	JsonRPC string      `json:"jsonrpc"`
	ID      *big.Int    `json:"id"`
	Result  *RpcdOutput `json:"result"`
}

RequestProofBodyResponse represents the JSON body of the response of the proof requests.

type RpcdOutput added in v0.3.0

type RpcdOutput struct {
	Circuit struct {
		Instances []string `json:"instance"`
		Proof     string   `json:"proof"`
	} `json:"circuit"`
}

RpcdOutput represents the JSON body of RequestProofBodyResponse's `result` field.

type ZkevmCmdProducer added in v0.3.0

type ZkevmCmdProducer struct {
	CmdPath    string
	L2Endpoint string // a L2 execution engine's RPC endpoint
}

ZkevmCmdProducer is responsible for generating zk proofs from the given command line binary file.

func NewZkevmCmdProducer added in v0.3.0

func NewZkevmCmdProducer(
	cmdPath string,
	l2Endpoint string,
) (*ZkevmCmdProducer, error)

NewZkevmCmdProducer creates a new NewZkevmCmdProducer instance.

func (*ZkevmCmdProducer) ExecProverCmd added in v0.3.0

func (d *ZkevmCmdProducer) ExecProverCmd(height *big.Int) ([]byte, error)

func (*ZkevmCmdProducer) RequestProof added in v0.3.0

func (d *ZkevmCmdProducer) RequestProof(
	opts *ProofRequestOptions,
	blockID *big.Int,
	meta *bindings.TaikoDataBlockMetadata,
	header *types.Header,
	resultCh chan *ProofWithHeader,
) error

RequestProof implements the ProofProducer interface.

type ZkevmRpcdProducer

type ZkevmRpcdProducer struct {
	RpcdEndpoint    string                 // a proverd RPC endpoint
	Param           string                 // parameter file to use
	L2Endpoint      string                 // a L2 execution engine's RPC endpoint
	Retry           bool                   // retry proof computation if error
	CustomProofHook func() ([]byte, error) // only for testing purposes
}

ZkevmRpcdProducer is responsible for requesting zk proofs from the given proverd endpoint.

func NewZkevmRpcdProducer

func NewZkevmRpcdProducer(
	rpcdEndpoint string,
	param string,
	l2Endpoint string,
	retry bool,
) (*ZkevmRpcdProducer, error)

NewZkevmRpcdProducer creates a new `ZkevmRpcdProducer` instance.

func (*ZkevmRpcdProducer) RequestProof

func (d *ZkevmRpcdProducer) RequestProof(
	opts *ProofRequestOptions,
	blockID *big.Int,
	meta *bindings.TaikoDataBlockMetadata,
	header *types.Header,
	resultCh chan *ProofWithHeader,
) error

RequestProof implements the ProofProducer interface.

Jump to

Keyboard shortcuts

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