execution

package
v0.0.0-...-35a8ded Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeProof

func MakeProof(
	limits *config.TracesLimits,
	setup circuits.Setup,
	comp *wizard.CompiledIOP,
	wproof wizard.Proof,
	funcInputs public_input.Execution,
) string

func NewBuilder

func NewBuilder(z *zkevm.ZkEvm) *builder

Types

type CircuitExecution

type CircuitExecution struct {
	// The wizard verifier circuit
	WizardVerifier wizard.WizardVerifierCircuit `gnark:",secret"`
	// The functional public inputs are the "actual" statement made by the
	// circuit. They are not part of the public input of the circuit for
	// a number of reasons involving efficiency and simplicity in the aggregation
	// process. What is the public input is their hash.
	FuncInputs FunctionalPublicInputSnark `gnark:",secret"`
	// The public input of the proof
	PublicInput frontend.Variable `gnark:",public"`
}

CircuitExecution for the outer-proof

func Allocate

func Allocate(zkevm *zkevm.ZkEvm) CircuitExecution

Allocates the outer-proof circuit

func (*CircuitExecution) Define

func (c *CircuitExecution) Define(api frontend.API) error

Define of the wizard circuit

type FunctionalPublicInputQSnark

type FunctionalPublicInputQSnark struct {
	DataChecksum                 frontend.Variable
	L2MessageHashes              L2MessageHashes
	InitialBlockTimestamp        frontend.Variable
	FinalStateRootHash           frontend.Variable
	FinalBlockNumber             frontend.Variable
	FinalBlockTimestamp          frontend.Variable
	InitialRollingHashUpdate     [32]frontend.Variable
	FirstRollingHashUpdateNumber frontend.Variable
	FinalRollingHashUpdate       [32]frontend.Variable
	LastRollingHashUpdateNumber  frontend.Variable
}

FunctionalPublicInputQSnark the information on this execution that cannot be extracted from other input in the same aggregation batch

func (*FunctionalPublicInputQSnark) Assign

func (*FunctionalPublicInputQSnark) RangeCheck

func (spiq *FunctionalPublicInputQSnark) RangeCheck(api frontend.API)

RangeCheck checks that values are within range

type FunctionalPublicInputSnark

type FunctionalPublicInputSnark struct {
	FunctionalPublicInputQSnark
	InitialStateRootHash frontend.Variable
	InitialBlockNumber   frontend.Variable
	ChainID              frontend.Variable
	L2MessageServiceAddr frontend.Variable
}

func (*FunctionalPublicInputSnark) Assign

func (*FunctionalPublicInputSnark) Sum

type L2MessageHashes

type L2MessageHashes internal.Var32Slice

L2MessageHashes is a wrapper for [Var32Slice] it is use to instantiate the sequence of L2MessageHash that we extract from the arithmetization. The reason we need a wrapper here is that we hash the L2MessageHashes in a specific way.

func (*L2MessageHashes) Assign

func (s *L2MessageHashes) Assign(values [][32]byte) error

func (*L2MessageHashes) CheckSumMiMC

func (s *L2MessageHashes) CheckSumMiMC(api frontend.API) frontend.Variable

CheckSumMiMC returns the hash of the L2MessageHashes. The encoding is done as follows:

  • each L2 hash is decomposed in a hi and lo part: each over 16 bytes
  • they are sequentially hashed in the following order: (hi_0, lo_0, hi_1, lo_1 ...)

The function also performs a consistency check to ensure that the length of the slice if consistent with the number of non-zero elements. And the function also ensures that the non-zero elements are all packed at the beginning of the struct. The function returns zero if the slice encodes zero message hashes (this is what happens if no L2 message events are emitted during the present execution frame).

@alex: it would be nice to make that function compatible with the GKR hasher factory though in practice this function will only create 32 calls to the MiMC permutation which makes it a non-issue.

func (*L2MessageHashes) RangeCheck

func (s *L2MessageHashes) RangeCheck(api frontend.API)

Jump to

Keyboard shortcuts

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