Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Long Compilation Time for starknet_with_keccak Layout on Certain Machines #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 206 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ swiftness_proof_parser = { package = "ark_swiftness_proof_parser", path = "./pro

static_assertions = "1.1"
cfg-if = "1"

log = "0.4"
env_logger = { version = "0.11.5"}
chrono = "0.4"
jemallocator = "0.5"
hex = "0.4.3"
[profile.release]
overflow-checks = true

[profile.dev]
opt-level = 3
lto = true
overflow-checks = true

Expand Down
2 changes: 2 additions & 0 deletions air/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ swiftness_transcript.workspace = true
swiftness_field = { workspace = true }
swiftness_utils = { workspace = true }
swiftness_hash = { workspace = true }
log = { workspace = true }
env_logger = {workspace = true}
7 changes: 6 additions & 1 deletion air/src/diluted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ use swiftness_hash::poseidon::PoseidonHash;
// q_i = q_{i-1} * (1 + z * x_{i-1}) * p_{i-1} + x_{i-1}^2 * p_{i-1} + q_{i-1}
//
// Now we can compute p_{n_bits} and q_{n_bits} in just n_bits recursive steps and we are done.
pub fn get_diluted_product<F: SimpleField + PoseidonHash>(n_bits: usize, spacing: usize, z: F, alpha: F) -> F {
pub fn get_diluted_product<F: SimpleField + PoseidonHash>(
n_bits: usize,
spacing: usize,
z: F,
alpha: F,
) -> F {
let diff_multiplier = F::two().powers([spacing as u64]);
let mut diff_x: F = diff_multiplier.clone() - F::two();
let mut x: F = F::one();
Expand Down
8 changes: 6 additions & 2 deletions air/src/fixtures/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ pub fn get<F: SimpleField + PoseidonHash>() -> Commitment<InteractionElements<F>
vector_commitment: vector::types::Commitment {
config: vector::config::Config {
height: F::from_stark_felt(Felt::from_hex_unchecked("0x14")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(Felt::from_hex_unchecked("0x64")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(
Felt::from_hex_unchecked("0x64"),
),
},
commitment_hash: unsent_commitment.original,
},
Expand All @@ -26,7 +28,9 @@ pub fn get<F: SimpleField + PoseidonHash>() -> Commitment<InteractionElements<F>
vector_commitment: vector::types::Commitment {
config: vector::config::Config {
height: F::from_stark_felt(Felt::from_hex_unchecked("0x14")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(Felt::from_hex_unchecked("0x64")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(
Felt::from_hex_unchecked("0x64"),
),
},
commitment_hash: unsent_commitment.interaction,
},
Expand Down
8 changes: 6 additions & 2 deletions air/src/fixtures/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ pub fn get<F: SimpleField + PoseidonHash>() -> trace::config::Config<F> {
n_columns: F::from_stark_felt(Felt::from_hex_unchecked("0x7")),
vector: vector::config::Config {
height: F::from_stark_felt(Felt::from_hex_unchecked("0x14")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(Felt::from_hex_unchecked("0x64")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(
Felt::from_hex_unchecked("0x64"),
),
},
},
interaction: table::config::Config {
n_columns: F::from_stark_felt(Felt::from_hex_unchecked("0x3")),
vector: vector::config::Config {
height: F::from_stark_felt(Felt::from_hex_unchecked("0x14")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(Felt::from_hex_unchecked("0x64")),
n_verifier_friendly_commitment_layers: F::from_stark_felt(
Felt::from_hex_unchecked("0x64"),
),
},
},
}
Expand Down
Loading