Skip to content

[ZkTracer] decouple reported line counts from lt file generation #1955

@DavePearce

Description

@DavePearce

Description

Currently, the reported line counts are always used to determine the height of modules in the generated lt file. There are two competing issues here:

  • (Silent Errors) When the reported line counts differ from the actual line counts for some module m, the lt file ends up with null rows at the end of the trace for m. This happens without warning, and which can then lead to a constraint failure.
  • (Inaccurate Counts) The other issue is that the line counts are used as a metric to estimate the cost of a given operation. But, the cost of one call (i.e. row) to a zkasm function may result in multiple rows in the final (expanded) trace. Thus, if we counted only one row, then our cost metric is not very accurate.

NOTE: there are two reasons one row for a zkasm function can lead to multiple rows in the final trace: (i) for multi-line functions, that one row will be expanded into potentially multiple lines during trace expansion; (ii) that zkasm function may call other functions (which hence add more cells).

Approach

The proposed approach is to decouple line counts from the lt file generation. That is, the lt file is generated using the actual rows inserted, and does not consider the reported line counts. This may require a go-corset update since it currently uses the ColumnHeader to determine the module height.

@letypequividelespoubelles FYI

Metadata

Metadata

Assignees

Labels

ArithmetizationArithmetization team is in charge or involved in this task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions