public_input

package
v0.0.0-...-50d4516 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation struct {
	FinalShnarf                             string
	ParentAggregationFinalShnarf            string
	ParentStateRootHash                     string
	ParentAggregationLastBlockTimestamp     uint
	FinalTimestamp                          uint
	LastFinalizedBlockNumber                uint
	FinalBlockNumber                        uint
	LastFinalizedL1RollingHash              string
	L1RollingHash                           string
	LastFinalizedL1RollingHashMessageNumber uint
	L1RollingHashMessageNumber              uint
	L2MsgRootHashes                         []string
	L2MsgMerkleTreeDepth                    int
	ChainID                                 uint64
	L2MessageServiceAddr                    types.EthAddress
}

Aggregation collects all the field that are used to construct the public input of the finalization proof.

func (Aggregation) GetPublicInputHex

func (p Aggregation) GetPublicInputHex() string

GetPublicInputHex computes the public input of the finalization proof

func (Aggregation) Sum

func (p Aggregation) Sum(hsh hash.Hash) []byte

type AggregationFPI

type AggregationFPI struct {
	ParentShnarf                      [32]byte
	NbDecompression                   uint64
	InitialStateRootHash              [32]byte
	LastFinalizedBlockNumber          uint64
	LastFinalizedBlockTimestamp       uint64
	LastFinalizedRollingHash          [32]byte
	LastFinalizedRollingHashMsgNumber uint64
	ChainID                           uint64 // for now we're forcing all executions to have the same chain ID
	L2MessageServiceAddr              types.EthAddress
	L2MsgMerkleTreeRoots              [][32]byte
	FinalBlockNumber                  uint64
	FinalBlockTimestamp               uint64
	FinalRollingHash                  [32]byte
	FinalRollingHashNumber            uint64
	FinalShnarf                       [32]byte
	L2MsgMerkleTreeDepth              int
}

AggregationFPI holds the same info as public_input.Aggregation, except in parsed form

func NewAggregationFPI

func NewAggregationFPI(fpi *Aggregation) (s *AggregationFPI, err error)

NewAggregationFPI does NOT set all fields, only the ones covered in public_input.Aggregation

func (*AggregationFPI) ToSnarkType

func (pi *AggregationFPI) ToSnarkType() AggregationFPISnark

type AggregationFPIQSnark

type AggregationFPIQSnark struct {
	ParentShnarf                   [32]frontend.Variable
	NbDecompression                frontend.Variable
	InitialStateRootHash           frontend.Variable
	LastFinalizedBlockNumber       frontend.Variable
	LastFinalizedBlockTimestamp    frontend.Variable
	LastFinalizedRollingHash       [32]frontend.Variable
	LastFinalizedRollingHashNumber frontend.Variable
	ChainID                        frontend.Variable // WARNING: Currently not bound in Sum
	L2MessageServiceAddr           frontend.Variable // WARNING: Currently not bound in Sum
}

func (*AggregationFPIQSnark) RangeCheck

func (pi *AggregationFPIQSnark) RangeCheck(api frontend.API)

type AggregationFPISnark

type AggregationFPISnark struct {
	AggregationFPIQSnark
	NbL2Messages           frontend.Variable // TODO not used in hash. delete if not necessary
	L2MsgMerkleTreeRoots   [][32]frontend.Variable
	NbL2MsgMerkleTreeRoots frontend.Variable
	// FinalStateRootHash     frontend.Variable redundant: incorporated into final shnarf
	FinalBlockNumber       frontend.Variable
	FinalBlockTimestamp    frontend.Variable
	FinalShnarf            [32]frontend.Variable
	FinalRollingHash       [32]frontend.Variable
	FinalRollingHashNumber frontend.Variable
	L2MsgMerkleTreeDepth   int
}

func (*AggregationFPISnark) Sum

type Execution

type Execution struct {
	L2MessageServiceAddr         types.EthAddress
	ChainID                      uint64
	InitialBlockTimestamp        uint64
	FinalStateRootHash           [32]byte
	FinalBlockNumber             uint64
	FinalBlockTimestamp          uint64
	LastRollingHashUpdate        [32]byte
	LastRollingHashUpdateNumber  uint64
	InitialRollingHashUpdate     [32]byte
	FirstRollingHashUpdateNumber uint64
	DataChecksum                 [32]byte
	L2MessageHashes              [][32]byte
	InitialStateRootHash         [32]byte
	InitialBlockNumber           uint64
}

func (*Execution) Sum

func (pi *Execution) Sum(hsh hash.Hash) []byte

func (*Execution) SumAsField

func (pi *Execution) SumAsField() field.Element

Jump to

Keyboard shortcuts

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