execution

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: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAddresses

func FromAddresses(block *ethtypes.Block) []types.EthAddress

Returns the list of the From addresses for each transaction in the block

func RlpTransactions

func RlpTransactions(block *ethtypes.Block) []string

Returns the transactions RLP encoded

Types

type BlockData

type BlockData struct {

	// BlockHash is the Eths block hash
	BlockHash types.FullBytes32 `json:"blockHash"`

	// T Transaction in 0x-prefixed hex format
	RlpEncodedTransactions []string `json:"rlpEncodedTransactions"`

	// L2 to L1 message hashes
	L2ToL1MsgHashes []types.FullBytes32 `json:"l2ToL1MsgHashes"`

	// List of the N timestamps for each blocks. To optimize
	// for space we put the timestamps in uint64 form
	TimeStamp uint64 `json:"timestamp"`

	// List of the n+1 root hashes in chronological order
	// The first root hash is the initial root hash before
	// execution of the first block in the conflated batch
	// and the last one is the final root hash of the state
	// after execution of the last block in the conflated batch.
	RootHash types.Bytes32 `json:"rootHash"`

	// The from addresses of the transactions in the block all concatenated
	// in a single hex string.
	FromAddresses []types.EthAddress `json:"fromAddresses"`

	// Not part of the inputs to hash. Flag indicating whether the block
	// contains a BatchL1MsgReceiptConfirmation
	BatchReceptionIndices []uint16 `json:"batchReceptionIndices"`

	// Last rolling hash update event
	LastRollingHashUpdatedEvent bridge.RollingHashUpdated `json:"lastRollingHashUpdatedEvent"`
}

type PerBlockDebugData

type PerBlockDebugData struct {

	// TxHashes in 0x prefixed format
	TxHashes []string `json:"txHashes"`

	// Hash of the txHashes
	HashOfTxHashes string `json:"hashOfTxHashes"`

	// Hash of the log hashes
	HashOfLogHashes string `json:"hashOfLogHashes"`

	// Hash of the L1 reception txs positions
	HashOfPositions string `json:"hashOfPositions"`

	// Hash of the from addresses
	HashOfFromAddresses string `json:"hashOfFromAddresses"`

	// Final resulting hash obtained after all inputs have been hashed
	HashForBlock string `json:"HashForBlock"`
}

type Request

type Request struct {
	ZkParentStateRootHash        types.Bytes32                 `json:"zkParentStateRootHash"`
	ConflatedExecutionTracesFile string                        `json:"conflatedExecutionTracesFile"`
	TracesEngineVersion          string                        `json:"tracesEngineVersion"`
	Type2StateManagerVersion     string                        `json:"type2StateManagerVersion"`
	ZkStateMerkleProof           [][]statemanager.DecodedTrace `json:"zkStateMerkleProof"`
	BlocksData                   []struct {
		Rlp        string         `json:"rlp"`
		BridgeLogs []ethtypes.Log `json:"bridgeLogs"`
	} `json:"blocksData"`
}

func (*Request) Blocks

func (req *Request) Blocks() []ethtypes.Block

Returns the parsed block data

func (*Request) ConflatedExecTraceFilepath

func (req *Request) ConflatedExecTraceFilepath(traceDir string) string

ConflatedExecTraceFilepath returns the filepath of the conflated execution trace files to pass to the witness.

func (*Request) GetRawSignaturesVerificationInputs

func (req *Request) GetRawSignaturesVerificationInputs() (txHashes [][32]byte, pubKeys [][64]byte, signatures [][65]byte)

GetRawSignaturesVerification returns the raw signatures verification claims

func (*Request) LogsForBlock

func (req *Request) LogsForBlock(i int) []ethtypes.Log

Returns the array of logs

func (*Request) StateManagerTraces

func (req *Request) StateManagerTraces() [][]statemanager.DecodedTrace

Returns the parsed state-manager traces

type Response

type Response struct {

	// Proof in 0x prefixed hexstring format
	Proof      string            `json:"proof"`
	ProverMode config.ProverMode `json:"proverMode"`

	// VerifierIndex is a deprecated field indicating which verifier contract to
	// verify the proof.
	//
	// Deprecated: the execution proof is no longer verified on-chain.
	VerifierIndex uint `json:"verifierIndex"`

	// The shasum of the verifier key to use to verify the proof. This is used
	// by the aggregation circuit to identify the circuit ID to use in the proof.
	VerifyingKeyShaSum string `json:"verifyingKeyShaSum"`

	// Block dependant inputs for the proof
	BlocksData []BlockData `json:"blocksData"`

	// Initial root hash before executing the conflated block
	ParentStateRootHash string `json:"parentStateRootHash"`

	// Boolean flag indicating whether the parent root hash mismatches what we
	// found in the shomei proof for the first block. This field is only set
	// when the config field `tolerate_parent_state_root_hash_mismatch` is set
	// to true.
	HasParentStateRootHashMismatch bool `json:"hasParentStateRootHashMismatch"`

	// Version format: "vX.X.X"
	Version string `json:"proverVersion"`

	// First block number
	FirstBlockNumber int `json:"firstBlockNumber"`

	// ExecDataChecksum stores the mimc hash of the execution data. It is also
	// part of the public inputs of the related compression proof.
	ExecDataChecksum types.Bytes32 `json:"execDataChecksum"`
	// ChainID indicates which ChainID was used during the execution.
	ChainID uint `json:"chainID"`
	// L2BridgeAddress indicates which ChainID was used during the execution.
	L2BridgeAddress types.EthAddress `json:"l2BridgeAddress"`
	// MaxNbL2MessageHashes indicates the max number of L2 Message hashes that
	// can be processed by the execution prover at once in the config.
	MaxNbL2MessageHashes int `json:"maxNbL2MessageHashes"`

	// AllRollingHash stores the collection of all the rolling hash events
	// occurring during the execution frame.
	AllRollingHashEvent []bridge.RollingHashUpdated `json:"allRollingHashEvent"`
	// AllL2L1MessageHashes stores the collection of all the L2 to L1 message's
	// hashes.
	AllL2L1MessageHashes []types.FullBytes32 `json:"allL2L1MessageHashes"`
	// PublicInput is the final value public input of the current proof. This
	// field is used for debugging in case one of the proofs don't pass at the
	// aggregation level.
	PublicInput types.Bytes32 `json:"publicInput"`
}

JSON schema of the message to return as an output of the prover Notations:

  • N denotes the number of conflated blocks.
  • Ti, denotes the number of transactions in the block i
  • T denotes the total number of transactions (nimaltogether
  • L denotes the total number of L2 to L1 logs in the conflated

func CraftProverOutput

func CraftProverOutput(
	cfg *config.Config,
	req *Request,
) Response

Craft prover's functional inputs

func Prove

func Prove(cfg *config.Config, req *Request, large bool) (*Response, error)

func (*Response) FuncInput

func (rsp *Response) FuncInput() *public_input.Execution

FuncInput are all the relevant fields parsed by the prover that are functionally useful to contextualize what the proof is proving. This is used by the aggregation circuit to ensure that the execution proofs relate to consecutive Linea block execution.

type Witness

type Witness struct {
	FuncInp *public_input.Execution
	ZkEVM   *zkevm.Witness
}

func NewWitness

func NewWitness(cfg *config.Config, req *Request, rsp *Response) *Witness

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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