pi_interconnection

package
v0.0.0-...-4af87b5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeShnarfs

func ComputeShnarfs(h keccak.BlockHasher, parent [32]frontend.Variable, iterations []ShnarfIteration) (result [][32]frontend.Variable)

ComputeShnarfs DOES NOT check nbShnarfs ≤ len(s.Iterations)

func GetMaxNbCircuitsSum

func GetMaxNbCircuitsSum(cs constraint.ConstraintSystem) int

GetMaxNbCircuitsSum computes MaxNbDecompression + MaxNbExecution from the compiled constraint system TODO replace with something cleaner, using the config

func InnerCircuitTypesToIndexes

func InnerCircuitTypesToIndexes(cfg *config.PublicInput, types []InnerCircuitType) []int

func MerkleRoot

func MerkleRoot(hsh hash.Hash, treeNbLeaves int, data [][32]byte) [32]byte

MerkleRoot computes the merkle root of data using the given hasher. TODO modify aggregation.PackInMiniTrees to optionally take a hasher instead of reimplementing

func MerkleRootSnark

func MerkleRootSnark(hshK keccak.BlockHasher, leaves [][32]frontend.Variable) [32]frontend.Variable

func NewBuilder

func NewBuilder(c config.PublicInput) circuits.Builder

func WizardCompilationParameters

func WizardCompilationParameters() []func(iop *wizard.CompiledIOP)

Types

type Circuit

type Circuit struct {
	AggregationPublicInput   [2]frontend.Variable `gnark:",public"` // the public input of the aggregation circuit; divided big-endian into two 16-byte chunks
	ExecutionPublicInput     []frontend.Variable  `gnark:",public"`
	DecompressionPublicInput []frontend.Variable  `gnark:",public"`

	DecompressionFPIQ []decompression.FunctionalPublicInputQSnark
	ExecutionFPIQ     []execution.FunctionalPublicInputQSnark

	public_input.AggregationFPIQSnark

	Keccak keccak.StrictHasherCircuit

	// config
	L2MessageMerkleDepth int
	L2MessageMaxNbMerkle int

	// TODO @Tabaie @alexandre.belling remove hard coded values once these are included in aggregation PI sum
	L2MessageServiceAddr types.EthAddress
	ChainID              uint64

	MaxNbCircuits int // possibly useless TODO consider removing
	UseGkrMimc    bool
}

func (*Circuit) Define

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

type Compiled

type Compiled struct {
	Circuit *Circuit
	Keccak  keccak.CompiledStrictHasher
}

func Compile

func Compile(c config.PublicInput, wizardCompilationOpts ...func(iop *wizard.CompiledIOP)) (*Compiled, error)

func (*Compiled) Assign

func (c *Compiled) Assign(r Request) (a Circuit, err error)

type DummyCircuit

type DummyCircuit struct {
	AggregationPublicInput   [2]frontend.Variable `gnark:",public"` // the public input of the aggregation circuit; divided big-endian into two 16-byte chunks
	ExecutionPublicInput     []frontend.Variable  `gnark:",public"`
	DecompressionPublicInput []frontend.Variable  `gnark:",public"`

	NbExecution     frontend.Variable
	NbDecompression frontend.Variable

	DecompressionFPI []frontend.Variable
	ExecutionFPI     []frontend.Variable
}

func (*DummyCircuit) Define

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

type InnerCircuitType

type InnerCircuitType uint8
const (
	Execution     InnerCircuitType = 0
	Decompression InnerCircuitType = 1
)

type Request

type Request struct {
	Decompressions []blobsubmission.Response
	Executions     []public_input.Execution
	Aggregation    public_input.Aggregation
}

type ShnarfIteration

type ShnarfIteration struct {
	BlobDataSnarkHash                          [32]frontend.Variable
	NewStateRootHash                           [32]frontend.Variable
	EvaluationPointBytes, EvaluationClaimBytes [32]frontend.Variable
}

func (*ShnarfIteration) SetZero

func (i *ShnarfIteration) SetZero()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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