Documentation ¶
Index ¶
- type StateDiff
- type StateDiffAssignmentBuilder
- func (builder *StateDiffAssignmentBuilder) AddRows(numRowsAccSegment int, ...)
- func (as *StateDiffAssignmentBuilder) PadAndAssign(run *wizard.ProverRuntime)
- func (as *StateDiffAssignmentBuilder) PushDelete(oldRoot, newRoot, hKey, oldHVal types.Bytes32)
- func (as *StateDiffAssignmentBuilder) PushInsert(oldRoot, newRoot, hKey, newHVal types.Bytes32)
- func (as *StateDiffAssignmentBuilder) PushReadNonZero(root, hKey, hVal types.Bytes32)
- func (as *StateDiffAssignmentBuilder) PushReadZero(root, hkey types.Bytes32)
- func (as *StateDiffAssignmentBuilder) PushUpdate(oldRoot, newRoot, hKey, oldHVal, newHVal types.Bytes32)
- type TestCase
- type TestContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateDiff ¶
type StateDiff struct { // HKey stores the initial and final accumulator's key hashes. HKey ifaces.Column // InitialHVal and FinalHVal store the initial and final accumulator's // hash of values. InitialHVal, FinalHVal ifaces.Column // InitialRoot and FinalRoot store the accumulator's initial and final // root hashes. InitialRoot, FinalRoot ifaces.Column }
StateDiff is a collection of column that appears in several of the modules of the state-manager of Linea.
In state summary, we have a unique tuple of (hKey, initialHVal, finalHVal, initialRoot, finalRoot) for each of the state operations (e.g. INSERT, DELETE, UPDATE, READZERO, and READNONZERO). We want to check that this unique tuple is the same for the state summary and the accumulator module. In the accumulator module, we have six rows for INSERT and DELETE, and two rows for UPDATE, READZERO and READNONZERO. The bridge we call the accumulatorSummary constructs the tuple (hKey, initialHVal, finalHVal, initialRoot, finalRoot) from various rows of the accumulator module. (To exemplify further, depending on the type of state operation on the sparse Merkle tree, hkey will appear on a different row in the segment corresponding to the state operation—and similarly with the other components in the constructed tuple.)
func NewStateDiff ¶
func NewStateDiff(comp *wizard.CompiledIOP, size int, moduleName, name string) StateDiff
NewStateDiff declares all the columns adding up to a StateDiff and returns the corresponding object.
type StateDiffAssignmentBuilder ¶
type StateDiffAssignmentBuilder struct { HKey *common.VectorBuilder InitialHVal, FinalHVal *common.VectorBuilder InitialRoot, FinalRoot *common.VectorBuilder }
StateDiffAssignmentBuilder is a convenience structure storing the column builders relating to an AccumulatorSummary.
func NewStateDiffAssignmentBuilder ¶
func NewStateDiffAssignmentBuilder(as StateDiff) StateDiffAssignmentBuilder
NewStateDiffAssignmentBuilder initializes a fresh StateDiffAssignmentBuilder
func (*StateDiffAssignmentBuilder) AddRows ¶
func (builder *StateDiffAssignmentBuilder) AddRows(numRowsAccSegment int, hKey, initialHVal, finalHVal, initialRoot, finalRoot field.Element)
addRows add rows to the builder that is used to construct an AccumulatorSummary
func (*StateDiffAssignmentBuilder) PadAndAssign ¶
func (as *StateDiffAssignmentBuilder) PadAndAssign(run *wizard.ProverRuntime)
PadAndAssign pads all the column in `as` and assign them into `run`
func (*StateDiffAssignmentBuilder) PushDelete ¶
func (as *StateDiffAssignmentBuilder) PushDelete(oldRoot, newRoot, hKey, oldHVal types.Bytes32)
PushDelete pushes a row representing a deletion onto `as`.
func (*StateDiffAssignmentBuilder) PushInsert ¶
func (as *StateDiffAssignmentBuilder) PushInsert(oldRoot, newRoot, hKey, newHVal types.Bytes32)
PushInsert pushes a row representing an insertion onto `as`.
func (*StateDiffAssignmentBuilder) PushReadNonZero ¶
func (as *StateDiffAssignmentBuilder) PushReadNonZero(root, hKey, hVal types.Bytes32)
PushReadNonZero pushes a row onto `as` for a read-non-zero operation.
func (*StateDiffAssignmentBuilder) PushReadZero ¶
func (as *StateDiffAssignmentBuilder) PushReadZero(root, hkey types.Bytes32)
PushReadZero pushes the relevant row when a ReadZero occurs on the accumulator side.
func (*StateDiffAssignmentBuilder) PushUpdate ¶
func (as *StateDiffAssignmentBuilder) PushUpdate(oldRoot, newRoot, hKey, oldHVal, newHVal types.Bytes32)
PushUpdate pushes a row representing an update onto `as`.
type TestCase ¶
type TestCase struct { Explainer string StateLogsGens func(initState mock.State) [][]mock.StateAccessLog }
type TestContext ¶
type TestContext struct { Addresses []types.EthAddress State mock.State TestCases []TestCase // contains filtered or unexported fields }
func InitializeContext ¶
func InitializeContext(initialBlock int) *TestContext