Module bus_mapping::circuit_input_builder
source · Expand description
This module contains the CircuitInputBuilder, which is an object that takes types from geth / web3 and outputs the circuit inputs.
Structs§
- State Access caused by a transaction or an execution step
- State and Code Access set.
- Circuit Input related to a block.
- Context of a
Block
which can mutate in aTransaction
. - Struct that wraps a GethClient and contains methods to perform all the steps necessary to generate the circuit inputs for a block by querying geth for the necessary information and using the CircuitInputBuilder.
- Circuit Input related to an Ethereum Call
- Context of a
Call
. - Context of chunking, used to track the current chunk index and inner rw counter also the global rw counter from start to end.
- Builder to generate a complete circuit input from data gathered from a geth instance. This structure is the centre of the crate and is intended to be the only entry point to it. The
CircuitInputBuilder
works in several steps: - Reference to the internal state of the CircuitInputBuilder in a particular
ExecStep
. - Defines a copy event associated with EVM opcodes such as CALLDATACOPY, CODECOPY, CREATE, etc. More information: https://github.com/privacy-scaling-explorations/zkevm-specs/blob/master/specs/copy-proof.md.
- Defines a single copy step in a copy event. This type is unified over the source/destination row in the copy table.
- Unset Circuits Parameters
- An execution step of the EVM.
- Event representing an exponentiation
a ^ b == d (mod 2^256)
. - Intermediary multiplication step, representing
a * b == d (mod 2^256)
- Runtime Config
- Circuit Setup Parameters
- I/Os from all precompiled contract calls in a block.
- Result of the parsing of an Ethereum Transaction.
- Context of a
Transaction
which can mutate in anExecStep
. - Result of the parsing of an Ethereum Withdrawal.
- Context of a
Withdrawal
.
Enums§
- State and Code Access with “keys/index” used in the access operation.
- Type of a CALL/CREATE* Function.
- Source of the code in the EVM execution.
- Defines the various source/destination types for a copy event.
- Execution state
- Defines an enum type that can hold either a number or a hash value.
- I/O from a precompiled contract call.
Constants§
- The number of bytes taken to represent a pair (G1, G2).
- number of execution state fields
- The number of pairing inputs per pairing operation. If the inputs provided to the precompile call are < 4, we append (G1::infinity, G2::generator) until we have the required no. of inputs.
Traits§
- Circuit Setup Parameters. These can be fixed/concrete or unset/dynamic.
Functions§
- Build a partial StateDB from step 3
- Retrieve the memory offset and length of call.
- Retrieve the init_code from memory for {CREATE, CREATE2}
- Get State Accesses from TxExecTraces
- Return all the keccak inputs used during the processing of the current block.
- Generate the keccak inputs required by the SignVerify Chip from the signature data.
- Generate the keccak inputs required by the Tx Circuit from the transactions.