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
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 ¶
- Variables
- func CompileSourceFiles(field field.Config, filenames ...string) ast.Program
- 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 ParseInputFile(filename string) map[string][]byte
- func PrintCompileStats[F field.Element[F]](air schema.AnySchema[F], ir vm.Program[vm.Uint], order string)
- func ReadBinaryFile[F field.Element[F]](filename string) *constraints.BinaryFile[F]
- func ValidStatsOrder(order string) bool
- func WriteBinaryFile[F field.Element[F]](binfile *constraints.BinaryFile[F], filename string)
- func WriteTraceFile(filename string, tracefile lt.TraceFile)
- type BuildArtifacts
- type BuildConfig
- type CompileConfig
- type Debugger
- type FieldAgnosticCmd
- type FlagChecks
- type VerboseLevel
Constants ¶
This section is empty.
Variables ¶
var Version string
Version is filled when building with make, but *not* when installing via "go install".
Functions ¶
func CompileSourceFiles ¶
CompileSourceFiles accepts a set of source files and compiles them into a program. This can result, for example, in one or more syntax errors, etc.
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 ParseInputFile ¶
ParseInputFile parses a given input file (which is currently assumed to be JSON). An input file contains the input bytes for each ROM in the given program.
func PrintCompileStats ¶ added in v1.2.21
func PrintCompileStats[F field.Element[F]](air schema.AnySchema[F], ir vm.Program[vm.Uint], order string)
PrintCompileStats prints summary statistics about the modules of a generated AIR schema, one row per module. Register widths (pre-splitting) and constraint degrees are gathered from the pre-split bytecode program (ir) and the post-split AIR schema respectively. The order argument determines how the modules are ordered (see orderModules).
func ReadBinaryFile ¶
func ReadBinaryFile[F field.Element[F]](filename string) *constraints.BinaryFile[F]
ReadBinaryFile reads a binary constraints file from disk
func ValidStatsOrder ¶ added in v1.2.21
ValidStatsOrder reports whether order is a recognised --stats ordering key.
func WriteBinaryFile ¶
func WriteBinaryFile[F field.Element[F]](binfile *constraints.BinaryFile[F], filename string)
WriteBinaryFile writes a binary file (e.g. zkvm.bin) to disk using the given binfile versioning defined in the binfile package.
func WriteTraceFile ¶
WriteTraceFile writes a given lt trace file to disk, either in JSON or LT formats.
Types ¶
type BuildArtifacts ¶
type BuildArtifacts struct {
// contains filtered or unexported fields
}
BuildArtifacts captures the set of outputs generated from compiling a given ZkC program (e.g. AIR constraints). Whilst the AIR artifact might be considered the primary goal of compilation, the other artifacts are needed to support other features. For example, the FIR artifact is needed for trace expansion, whilst the AST artifact allows the AST to be printed for debugging purposes.
func Build ¶ added in v1.2.21
func Build[F field.Element[F]](build BuildConfig, args ...string) BuildArtifacts
Build applies a build configuration with a given set of source files.
type BuildConfig ¶
type BuildConfig struct {
// contains filtered or unexported fields
}
BuildConfig packages up all the requirements for building the set of target artifacts.
func GetBuildConfig ¶
GetBuildConfig constructs a build configuration from the provided command-line arguments. The purpose of this is to provide a consistent mechanism for compiling constraint files across the various sub-commands.
type CompileConfig ¶ added in v1.2.21
type CompileConfig struct {
// contains filtered or unexported fields
}
CompileConfig brings together various configuration options specific to this command.
type Debugger ¶ added in v1.2.21
Debugger renders an execution trace to stdout using the bytecode interpreter's debug facility (see vm.BootAndDebug). It prints one line per executed trace line (bytecode vector), rendered against the enclosing function's environment, with register values shown inline (see valueEnv).
func NewDebugger ¶ added in v1.2.21
NewDebugger constructs a trace observer for the given (lowered) bytecode program.
type FieldAgnosticCmd ¶
type FieldAgnosticCmd struct {
Field field.Config
Function func(*cobra.Command, []string, field.Config)
}
FieldAgnosticCmd represents a command to be executed for a given field.
type FlagChecks ¶ added in v1.2.21
type FlagChecks struct {
// contains filtered or unexported fields
}
FlagChecks provides some additional feature over the base flags package used in Cobra. Specifically, it allows to ensure certain flags are only used in conjunction with others or, conversely, that certain flags cannot be used in conjunction with others.
func (*FlagChecks) Exclude ¶ added in v1.2.21
func (p *FlagChecks) Exclude(flag1, flag2 string)
Exclude asserts that two given flags cannot be used together.
func (*FlagChecks) Require ¶ added in v1.2.21
func (p *FlagChecks) Require(flag, required string)
Require asserts that a given flag requires another flag to be set.
type VerboseLevel ¶ added in v1.2.23
type VerboseLevel int
VerboseLevel captures how much diagnostic output the zkc tooling produces. The levels are ordered, so higher levels are supersets of lower ones.
const ( // VERBOSE_NONE is the default level: no extra output, only warnings and // errors are logged. VERBOSE_NONE VerboseLevel = iota // VERBOSE_INFO enables ordinary informational logging. VERBOSE_INFO // VERBOSE_DEBUG enables debug logging, notably the machine execution steps // reported during execution. VERBOSE_DEBUG // VERBOSE_PRINTF enables full output, additionally retaining and emitting // printf statements. VERBOSE_PRINTF )
func GetVerboseLevel ¶ added in v1.2.23
func GetVerboseLevel(cmd *cobra.Command) VerboseLevel
GetVerboseLevel derives the verbosity from the repeatable "verbose" (-v) flag: absent selects NONE, -v selects INFO, -vv selects DEBUG, and -vvv selects PRINTF.