Documentation
¶
Overview ¶
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func CheckTrace[F field.Element[F]](ir string, schema sc.AnySchema[F], tf lt.TraceFile, builder ir.TraceBuilder[F], ...) bool
- func Execute()
- func GetFlag(cmd *cobra.Command, flag string) bool
- func GetInt(cmd *cobra.Command, flag string) int
- func GetIntArray(cmd *cobra.Command, flag string) []int
- func GetString(cmd *cobra.Command, flag string) string
- func GetStringArray(cmd *cobra.Command, flag string) []string
- func GetUint(cmd *cobra.Command, flag string) uint
- func InspectTrace[F field.Element[F]](mapping module.LimbsMap, trace tr.Trace[F], public func(tr.ModuleName) bool, ...) []error
- func ReadBatchedTraceFile(filename string) []lt.TraceFile
- func ReadTraceFile(filename string) lt.TraceFile
- func ReportFailures[F field.Element[F]](ir string, failures []sc.Failure, trace tr.Trace[F], mapping module.LimbsMap, ...)
- func WriteBinaryFile(binfile *binfile.BinaryFile, filename string)
- type CheckConfig
- type ColumnSummariser
- type FieldAgnosticCmd
- type ModuleSummariser
- type RawColumn
- type TraceConfig
Constants ¶
const SCHEMA_DEFAULT_AIR = uint(2)
SCHEMA_DEFAULT_AIR indicates a schema must be indicated on the command line, and that the default is for the stack to be lowered to the AIR level.
const SCHEMA_DEFAULT_MIR = uint(1)
SCHEMA_DEFAULT_MIR indicates a schema must be indicated on the command line, and that the default is for the stack to be lowered to the MIR level.
const SCHEMA_OPTIONAL = uint(0)
SCHEMA_OPTIONAL indicates a schema is optional
Variables ¶
var Version string
Version is filled when building with make, but *not* when installing via "go install".
Functions ¶
func CheckTrace ¶
func CheckTrace[F field.Element[F]](ir string, schema sc.AnySchema[F], tf lt.TraceFile, builder ir.TraceBuilder[F], cfg CheckConfig) bool
CheckTrace checks a given set of constraints against a given trace file using a configured trace builder and check configuration.
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetIntArray ¶
GetIntArray gets an expected int array, or panic if an error arises.
func GetStringArray ¶
GetStringArray gets an expected string array, or panic if an error arises.
func InspectTrace ¶ added in v1.2.21
func InspectTrace[F field.Element[F]](mapping module.LimbsMap, trace tr.Trace[F], public func(tr.ModuleName) bool, limbs bool, cellWidth, titleWidth uint) []error
InspectTrace opens the given trace in the interactive inspector using the supplied register mapping, without requiring a corset source map. Columns are shown as computed (low-level) registers. This is intended for callers (e.g. the zkc toolchain) which generate a trace but have no source map available.
The optional "public" predicate determines which modules are publicly visible (shown by default); when nil, all modules are public. Callers use this to hide synthetic modules such as range-check tables.
func ReadBatchedTraceFile ¶
ReadBatchedTraceFile reads a file containing zero or more traces expressed as JSON, where each trace is on a separate line.
func ReadTraceFile ¶
ReadTraceFile reads a trace file (either binary lt or json), and parses it into an array of raw columns. The determination of what kind of trace file (i.e. binary or json) is based on the extension.
func ReportFailures ¶
func ReportFailures[F field.Element[F]](ir string, failures []sc.Failure, trace tr.Trace[F], mapping module.LimbsMap, cfg CheckConfig)
ReportFailures reports constraint failures, whilst providing contextual information (when requested).
func WriteBinaryFile ¶
func WriteBinaryFile(binfile *binfile.BinaryFile, filename string)
WriteBinaryFile writes a binary file (e.g. zkevm.bin) to disk using the given binfile versioning defined in the binfile package.
Types ¶
type CheckConfig ¶
type CheckConfig struct {
// Corset source mapping (maybe nil if non available).
CorsetSourceMap *corset.SourceMap
// Specifies whether to use Coverage testing and, if so, where to write the
// Coverage data.
Coverage util.Option[string]
// Specifies how much front padding to add to each module.
PaddingStrategy ir.PaddingStrategy
// Specifies whether or not to Report details of the failure (e.g. for
// debugging purposes).
Report bool
// Specifies the number of additional rows to show eitherside of the failing
// area. This essentially allows more contextual information to be shown.
ReportPadding uint
// Specifies the width of a cell to show.
ReportCellWidth uint
// Specifies the width of a column title to show.
ReportTitleWidth uint
// Specifies whether or not to show raw limbs
ReportLimbs bool
// Specifies whether or not to show raw computed registers
ReportComputed bool
// Enable ansi escape codes in reports
AnsiEscapes bool
}
CheckConfig encapsulates certain parameters to be used when checking traces.
type ColumnSummariser ¶
type ColumnSummariser struct {
// contains filtered or unexported fields
}
ColumnSummariser abstracts the notion of a function which summarises the contents of a given column.
type FieldAgnosticCmd ¶
FieldAgnosticCmd represents a command to be executed for a given field.
type ModuleSummariser ¶
type ModuleSummariser struct {
// contains filtered or unexported fields
}
ModuleSummariser abstracts the notion of a function which summarises the contents of a given column.
type TraceConfig ¶
type TraceConfig struct {
// contains filtered or unexported fields
}
TraceConfig packages together useful things for the various supported options.