Skip to content

Commit

Permalink
Updated cargo.toml's + added toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Jun 18, 2024
1 parent 20fdb32 commit 1403aed
Show file tree
Hide file tree
Showing 23 changed files with 130 additions and 98 deletions.
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ members = [
]
resolver = "2"

[workspace.package]
edition = "2021"
rust-version = "1.78"
license = "MIT"
readme = "README.md"
authors = ["Miden contributors"]
homepage = "https://polygon.technology/polygon-miden"
repository = "https://github.com/0xPolygonMiden/miden-vm"
exclude = [".github/"]

[profile.optimized]
inherits = "release"
codegen-units = 1
Expand Down
13 changes: 7 additions & 6 deletions air/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-air"
version = "0.9.2"
description = "Algebraic intermediate representation of Miden VM processor"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-air/0.9.2"
categories = ["cryptography", "no-std"]
keywords = ["air", "arithmetization", "crypto", "miden"]
edition = "2021"
rust-version = "1.75"
readme.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[lib]
bench = false
Expand Down
4 changes: 2 additions & 2 deletions air/src/constraints/chiplets/hasher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ pub fn get_transition_constraint_count() -> usize {

/// Enforces constraints for the hasher chiplet.
///
/// - The `hasher_flag` determines if the hasher chiplet is currently enabled. It should be
/// computed by the caller and set to `Felt::ONE`
/// - The `hasher_flag` determines if the hasher chiplet is currently enabled. It should be computed
/// by the caller and set to `Felt::ONE`
/// - The `transition_flag` indicates whether this is the last row this chiplet's execution trace,
/// and therefore the constraints should not be enforced.
pub fn enforce_constraints<E: FieldElement<BaseField = Felt>>(
Expand Down
12 changes: 6 additions & 6 deletions air/src/constraints/stack/field_ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ pub fn enforce_incr_constraints<E: FieldElement>(
/// in the stack with its bitwise not value. Therefore, the following constraints are
/// enforced:
/// - The top element should be a binary. It is enforced as a general constraint.
/// - The first element of the next frame should be a binary not of the first element of
/// the current frame. s0` + s0 = 1.
/// - The first element of the next frame should be a binary not of the first element of the current
/// frame. s0` + s0 = 1.
pub fn enforce_not_constraints<E: FieldElement>(
frame: &EvaluationFrame<E>,
result: &mut [E],
Expand All @@ -206,8 +206,8 @@ pub fn enforce_not_constraints<E: FieldElement>(

/// Enforces constraints of the AND operation. The AND operation computes the bitwise and of the
/// first two elements in the current trace. Therefore, the following constraints are enforced:
/// - The top two element in the current frame of the stack should be binary. s0^2 - s0 = 0,
/// s1^2 - s1 = 0. The top element is binary or not is enforced as a general constraint.
/// - The top two element in the current frame of the stack should be binary. s0^2 - s0 = 0, s1^2 -
/// s1 = 0. The top element is binary or not is enforced as a general constraint.
/// - The first element of the next frame should be a binary and of the first two elements in the
/// current frame. s0` - s0 * s1 = 0.
pub fn enforce_and_constraints<E: FieldElement>(
Expand All @@ -233,8 +233,8 @@ pub fn enforce_and_constraints<E: FieldElement>(

/// Enforces constraints of the OR operation. The OR operation computes the bitwise or of the
/// first two elements in the current trace. Therefore, the following constraints are enforced:
/// - The top two element in the current frame of the stack should be binary. s0^2 - s0 = 0,
/// s1^2 - s1 = 0. The top element is binary or not is enforced as a general constraint.
/// - The top two element in the current frame of the stack should be binary. s0^2 - s0 = 0, s1^2 -
/// s1 = 0. The top element is binary or not is enforced as a general constraint.
/// - The first element of the next frame should be a binary or of the first two elements in the
/// current frame. s0` - ( s0 + s1 - s0 * s1 ) = 0.
pub fn enforce_or_constraints<E: FieldElement>(
Expand Down
7 changes: 3 additions & 4 deletions air/src/constraints/stack/overflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ pub fn enforce_stack_depth_constraints<E: FieldElement>(

/// Enforces constraints on the overflow flag h0. Therefore, the following constraints
/// are enforced:
/// - If overflow table has values, then, h0 should be set to ONE, otherwise it should
/// be ZERO.
/// - If overflow table has values, then, h0 should be set to ONE, otherwise it should be ZERO.
pub fn enforce_overflow_flag_constraints<E: FieldElement>(
frame: &EvaluationFrame<E>,
result: &mut [E],
Expand All @@ -107,8 +106,8 @@ pub fn enforce_overflow_flag_constraints<E: FieldElement>(
}

/// Enforces constraints on the bookkeeping index `b1`. The following constraints are enforced:
/// - In the case of a right shift operation, the next b1 index should be updated with current
/// `clk` value.
/// - In the case of a right shift operation, the next b1 index should be updated with current `clk`
/// value.
/// - In the case of a left shift operation, the last stack item should be set to ZERO when the
/// depth of the stack is 16.
pub fn enforce_overflow_index_constraints<E: FieldElement>(
Expand Down
8 changes: 4 additions & 4 deletions air/src/constraints/stack/stack_manipulation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ pub fn enforce_pad_constraints<E: FieldElement>(
/// Enforces constraints of the DUPn and MOVUPn operations. The DUPn operation copies the element
/// at depth n in the stack and pushes the copy onto the stack, whereas MOVUPn opearation moves the
/// element at depth n to the top of the stack. Therefore, the following constraints are enforced:
/// - The top element in the next frame should be equal to the element at depth n in the
/// current frame. s0` - sn = 0.
/// - The top element in the next frame should be equal to the element at depth n in the current
/// frame. s0` - sn = 0.
pub fn enforce_dup_movup_n_constraints<E: FieldElement>(
frame: &EvaluationFrame<E>,
result: &mut [E],
Expand Down Expand Up @@ -244,8 +244,8 @@ pub fn enforce_swapwx_constraints<E: FieldElement>(

/// Enforces constraints of the MOVDNn operation. The MOVDNn operation moves the top element
/// to depth n in the stack. Therefore, the following constraints are enforced:
/// - The top element in the current frame should be equal to the element at depth n in the
/// next frame. s0 - sn` = 0.
/// - The top element in the current frame should be equal to the element at depth n in the next
/// frame. s0 - sn` = 0.
pub fn enforce_movdnn_constraints<E: FieldElement>(
frame: &EvaluationFrame<E>,
result: &mut [E],
Expand Down
4 changes: 2 additions & 2 deletions air/src/constraints/stack/u32_ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ pub fn enforce_u32split_constraints<E: FieldElement<BaseField = Felt>>(
/// Enforces constraints of the U32ADD operation. The U32ADD operation adds the top two
/// elements in the current trace of the stack. Therefore, the following constraints are
/// enforced:
/// - The aggregation of limbs from the helper registers is equal to the sum of the top two
/// element in the stack.
/// - The aggregation of limbs from the helper registers is equal to the sum of the top two element
/// in the stack.
pub fn enforce_u32add_constraints<E: FieldElement<BaseField = Felt>>(
frame: &EvaluationFrame<E>,
result: &mut [E],
Expand Down
4 changes: 2 additions & 2 deletions air/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ impl ExecutionOptions {
///
/// In debug mode the VM does the following:
/// - Executes `debug` instructions (these are ignored in regular mode).
/// - Records additional info about program execution (e.g., keeps track of stack state at
/// every cycle of the VM) which enables stepping through the program forward and backward.
/// - Records additional info about program execution (e.g., keeps track of stack state at every
/// cycle of the VM) which enables stepping through the program forward and backward.
pub fn with_debugging(mut self) -> Self {
self.enable_debugging = true;
self
Expand Down
13 changes: 7 additions & 6 deletions assembly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-assembly"
version = "0.9.2"
description = "Miden VM assembly language"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-assembly/0.9.2"
categories = ["compilers", "no-std"]
keywords = ["assembler", "assembly", "language", "miden"]
edition = "2021"
rust-version = "1.76"
readme.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[lib]
bench = false
Expand Down
4 changes: 2 additions & 2 deletions assembly/src/ast/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pub enum ModuleKind {
/// A kernel is like a library module, but is special in a few ways:
///
/// * Its code always executes in the root context, so it is stateful in a way that normal
/// libraries cannot replicate. This can be used to provide core services that would otherwise
/// not be possible to implement.
/// libraries cannot replicate. This can be used to provide core services that would
/// otherwise not be possible to implement.
///
/// * The procedures exported from the kernel may be the target of the `syscall` instruction,
/// and in fact _must_ be called that way.
Expand Down
13 changes: 7 additions & 6 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-core"
version = "0.9.1"
description = "Miden VM core components"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-core/0.9.1"
categories = ["emulators", "no-std"]
keywords = ["instruction-set", "miden", "program"]
edition = "2021"
rust-version = "1.75"
readme.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[lib]
bench = false
Expand Down
13 changes: 7 additions & 6 deletions miden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-vm"
version = "0.9.1"
description="Miden virtual machine"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-vm/0.9.1"
categories = ["cryptography", "emulators", "no-std"]
keywords = ["miden", "stark", "virtual-machine", "zkp"]
edition = "2021"
rust-version = "1.75"
readme.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[[bin]]
name = "miden"
Expand Down
13 changes: 7 additions & 6 deletions processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-processor"
version = "0.9.2"
description = "Miden VM processor"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-processor/0.9.2"
categories = ["emulators", "no-std"]
keywords = ["miden", "virtual-machine"]
edition = "2021"
rust-version = "1.75"
readme.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[lib]
bench = false
Expand Down
30 changes: 15 additions & 15 deletions processor/src/chiplets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,39 @@ mod tests;
/// chiplet selectors.
///
/// The module's trace can be thought of as 5 stacked chiplet segments in the following form:
/// * Hasher segment: contains the trace and selector for the hasher chiplet *
/// This segment fills the first rows of the trace up to the length of the hasher `trace_len`.
/// * Hasher segment: contains the trace and selector for the hasher chiplet * This segment fills
/// the first rows of the trace up to the length of the hasher `trace_len`.
/// - column 0: selector column with values set to ZERO
/// - columns 1-17: execution trace of hash chiplet
///
/// * Bitwise segment: contains the trace and selectors for the bitwise chiplet *
/// This segment begins at the end of the hasher segment and fills the next rows of the trace for
/// the `trace_len` of the bitwise chiplet.
/// * Bitwise segment: contains the trace and selectors for the bitwise chiplet * This segment
/// begins at the end of the hasher segment and fills the next rows of the trace for the
/// `trace_len` of the bitwise chiplet.
/// - column 0: selector column with values set to ONE
/// - column 1: selector column with values set to ZERO
/// - columns 2-14: execution trace of bitwise chiplet
/// - columns 15-17: unused columns padded with ZERO
///
/// * Memory segment: contains the trace and selectors for the memory chiplet *
/// This segment begins at the end of the bitwise segment and fills the next rows of the trace for
/// the `trace_len` of the memory chiplet.
/// * Memory segment: contains the trace and selectors for the memory chiplet * This segment begins
/// at the end of the bitwise segment and fills the next rows of the trace for the `trace_len` of
/// the memory chiplet.
/// - column 0-1: selector columns with values set to ONE
/// - column 2: selector column with values set to ZERO
/// - columns 3-14: execution trace of memory chiplet
/// - columns 15-17: unused column padded with ZERO
///
/// * Kernel ROM segment: contains the trace and selectors for the kernel ROM chiplet *
/// This segment begins at the end of the memory segment and fills the next rows of the trace for
/// the `trace_len` of the kernel ROM chiplet.
/// * Kernel ROM segment: contains the trace and selectors for the kernel ROM chiplet * This segment
/// begins at the end of the memory segment and fills the next rows of the trace for the
/// `trace_len` of the kernel ROM chiplet.
/// - column 0-2: selector columns with values set to ONE
/// - column 3: selector column with values set to ZERO
/// - columns 4-9: execution trace of kernel ROM chiplet
/// - columns 10-17: unused column padded with ZERO
///
/// * Padding segment: unused *
/// This segment begins at the end of the kernel ROM segment and fills the rest of the execution
/// trace minus the number of random rows. When it finishes, the execution trace should have
/// exactly enough rows remaining for the specified number of random rows.
/// * Padding segment: unused * This segment begins at the end of the kernel ROM segment and fills
/// the rest of the execution trace minus the number of random rows. When it finishes, the
/// execution trace should have exactly enough rows remaining for the specified number of random
/// rows.
/// - columns 0-3: selector columns with values set to ONE
/// - columns 3-17: unused columns padded with ZERO
///
Expand Down
4 changes: 2 additions & 2 deletions processor/src/host/advice/injectors/dsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use super::super::{ExecutionError, Felt, Word};
/// 1. The nonce represented as 8 field elements.
/// 2. The expanded public key represented as the coefficients of a polynomial of degree < 512.
/// 3. The signature represented as the coefficients of a polynomial of degree < 512.
/// 4. The product of the above two polynomials in the ring of polynomials with coefficients
/// in the Miden field.
/// 4. The product of the above two polynomials in the ring of polynomials with coefficients in the
/// Miden field.
///
/// # Errors
/// Will return an error if either:
Expand Down
8 changes: 4 additions & 4 deletions processor/src/operations/comb_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ where
/// with common denominator (x - gz).
/// 4. x_addr is the memory address from which we are loading the Ti's using the MSTREAM
/// instruction.
/// 5. z_addr is the memory address to the i-th OOD evaluations at z and gz
/// i.e. T_i(z):= (T_i(z)0, T_i(z)1) and T_i(gz):= (T_i(gz)0, T_i(gz)1).
/// 6. a_addr is the memory address of the i-th random element alpha_i used in batching
/// the trace polynomial quotients.
/// 5. z_addr is the memory address to the i-th OOD evaluations at z and gz i.e. T_i(z):=
/// (T_i(z)0, T_i(z)1) and T_i(gz):= (T_i(gz)0, T_i(gz)1).
/// 6. a_addr is the memory address of the i-th random element alpha_i used in batching the
/// trace polynomial quotients.
///
/// The instruction also makes use of the helper registers to hold the values of T_i(z), T_i(gz)
/// and alpha_i during the course of its execution.
Expand Down
13 changes: 7 additions & 6 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-prover"
version = "0.9.1"
description = "Miden VM prover"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-prover/0.9.1"
categories = ["cryptography", "emulators", "no-std"]
keywords = ["miden", "prover", "stark", "zkp"]
edition = "2021"
rust-version = "1.75"
readme.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[features]
concurrent = ["processor/concurrent", "std", "winter-prover/concurrent"]
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.78
13 changes: 13 additions & 0 deletions scripts/check-rust-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Check rust-toolchain file
TOOLCHAIN_VERSION=$(cat rust-toolchain)

# Check workspace Cargo.toml file
CARGO_VERSION=$(cat Cargo.toml | grep "rust-version" | cut -d '"' -f 2)
if [ "$CARGO_VERSION" != "$TOOLCHAIN_VERSION" ]; then
echo "Mismatch in Cargo.toml: Expected $TOOLCHAIN_VERSION, found $CARGO_VERSION"
exit 1
fi

echo "Rust versions match ✅"
11 changes: 6 additions & 5 deletions stdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
name = "miden-stdlib"
version = "0.9.2"
description = "Miden VM standard library"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-vm"
documentation = "https://docs.rs/miden-stdlib/0.9.2"
categories = ["cryptography", "mathematics"]
keywords = ["miden", "program", "stdlib"]
edition = "2021"
rust-version = "1.75"
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[lib]
bench = false
Expand Down
Loading

0 comments on commit 1403aed

Please sign in to comment.