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

feat: Forward ports #150

Merged
merged 35 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
047474a
fix: memory finalize duplicate address attack from audit (#934)
erabinov Jun 14, 2024
a1fa81d
fix: mock verifier (#936)
ctian1 Jun 14, 2024
0de2ec0
fix: recursion audit fixes for Issues 7-10 (#937)
erabinov Jun 16, 2024
c4d322d
fix: range check for shard number in recursion (#952)
erabinov Jun 18, 2024
6c5edb2
fix: frifold flag column consistency (#946)
erabinov Jun 18, 2024
b0648a4
feat: (breaking changes to SDK API) use builder pattern for SDK execu…
tqn Jun 18, 2024
971732f
feat: optimized cpu tracegen
jtguibas Jun 17, 2024
5a61530
fix: re-compile examples & tests
huitseeker Aug 10, 2024
3692526
fix: set sponge state to be zero (#951)
erabinov Aug 10, 2024
dccf66d
refactor: elide book
huitseeker Aug 10, 2024
6802b7e
fix: some informational fixes from veridise audit (#953)
erabinov Aug 10, 2024
4e608c1
feat: Add example program to test patches (#950)
ratankaliani Aug 10, 2024
70f7348
feat: optimize byte trace gen
jtguibas Jun 18, 2024
cb1d2de
cleanup
jtguibas Jun 18, 2024
1d5aa48
fix crhsi comments
jtguibas Jun 19, 2024
fb9e89d
fix: p3 audit change (#964)
erabinov Jun 20, 2024
b5946ef
fix: close unclosed file streams (#954)
erabinov Jun 20, 2024
734384a
feat: poseidon2 hash (#885)
kevjue Aug 13, 2024
7d67ca2
fix: changed fixed size for multi table (#966)
kevjue Aug 13, 2024
ce8e745
feat: put hook results in the front of the input stream (#973)
tqn Aug 13, 2024
565969d
fix: recursion runtime
ctian1 Jun 22, 2024
19648df
fix(contracts): check verifier success (#983)
mattstam Jun 26, 2024
c8ea0d8
fix: apply plonky3's keccak air fix (#984)
kevjue Jun 26, 2024
4ce73d9
feat: plonk circuit optimizations (#972)
kevjue Jun 27, 2024
96881ad
cli informative logging
ratankaliani Jun 17, 2024
43652d7
feat(cli): only template contracts when --evm is used (#1004)
mattstam Jul 2, 2024
48f6e61
fix overflow when compile to wasm32
flyq May 26, 2024
706ebac
feat(sdk): finish mock prover implementation (#1008)
mattstam Jul 2, 2024
d1859b6
feat(cli): check for rust usage during installation (#1006)
mattstam Jul 2, 2024
b558232
feat: improve network prover error output (#991)
mattstam Jul 2, 2024
c81f46b
chore: local allow
huitseeker Aug 14, 2024
223c186
chore: adjust doc
huitseeker Aug 14, 2024
d4ccc62
ci: remove docker CI
huitseeker Aug 14, 2024
4ef2043
chore: move working plonky3 branch to final branch
huitseeker Aug 15, 2024
229d6c6
chore: recompile examples & adapt lcs, lcs2, sum examples
huitseeker Aug 15, 2024
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
49 changes: 27 additions & 22 deletions Cargo.lock

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

36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ debug = true
debug-assertions = true

[workspace.dependencies]
p3-air = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-field = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-commit = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-matrix = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-baby-bear = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new", features = [
p3-air = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-field = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-commit = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-matrix = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-baby-bear = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1", features = [
"nightly-features",
]}
p3-util = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-challenger = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-dft = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-fri = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-keccak = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-keccak-air = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-blake3 = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-merkle-tree = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-poseidon2 = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-symmetric = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-uni-stark = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-maybe-rayon = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-bn254-fr = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1-new" }
p3-util = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-challenger = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-dft = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-fri = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-keccak = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-keccak-air = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-blake3 = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-merkle-tree = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-poseidon2 = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-symmetric = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-uni-stark = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-maybe-rayon = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
p3-bn254-fr = { git = "https://github.com/argumentcomputer/Plonky3.git", branch = "sp1" }
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "bfd0fda" }
anstyle = "1.0.8"
anyhow = "1.0.86"
Expand Down
7 changes: 0 additions & 7 deletions book/developers/building-plonk-artifacts.md

This file was deleted.

13 changes: 13 additions & 0 deletions cli/src/commands/install_toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ pub struct InstallToolchainCmd {}

impl InstallToolchainCmd {
pub fn run(&self) -> Result<()> {
// Check if rust is installed.
if Command::new("rustup")
.arg("--version")
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()
.is_err()
{
return Err(anyhow::anyhow!(
"Rust is not installed. Please install Rust from https://rustup.rs/ and try again."
));
}

// Setup client.
let client = Client::builder().user_agent("Mozilla/5.0").build()?;

Expand Down
21 changes: 17 additions & 4 deletions cli/src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ use yansi::Paint;
#[derive(Parser)]
#[command(name = "new", about = "Setup a new project that runs inside the SP1.")]
pub struct NewCmd {
/// The name of the project.
name: String,

/// Whether to create the project with template EVM contracts.
#[arg(long, action)]
evm: bool,
}

const TEMPLATE_REPOSITORY_URL: &str = "https://github.com/succinctlabs/sp1-project-template";
Expand Down Expand Up @@ -37,12 +42,20 @@ impl NewCmd {
// Remove the .git directory.
fs::remove_dir_all(root.join(".git"))?;

// Check if the user has `foundry` installed.
if Command::new("foundry").arg("--version").output().is_err() {
println!(
" \x1b[1m{}\x1b[0m Make sure to install Foundry to use contracts: https://book.getfoundry.sh/getting-started/installation.",
if self.evm {
// Check if the user has `foundry` installed.
if Command::new("foundry").arg("--version").output().is_err() {
println!(
" \x1b[1m{}\x1b[0m Make sure to install Foundry to use contracts: https://book.getfoundry.sh/getting-started/installation",
Paint::yellow("Warning:"),
);
}
} else {
// Remove the `contracts` directory.
fs::remove_dir_all(root.join("contracts"))?;

// Remove the `.gitmodules` file.
fs::remove_file(root.join(".gitmodules"))?;
}

println!(
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl ProveCmd {
let start_time = Instant::now();
let client = ProverClient::new();
let (pk, _) = client.setup(&elf);
let proof = client.prove(&pk, stdin).unwrap();
let proof = client.prove(&pk, stdin).run().unwrap();

if let Some(ref path) = self.output {
proof
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub async fn get_toolchain_download_url(client: &Client, target: String) -> Stri
.json::<serde_json::Value>()
.await
.unwrap();
let tag = json["tag_name"].as_str().unwrap();
let tag = json["tag_name"].as_str().expect("Failed to download Succinct toolchain. Likely caused by GitHub rate limiting. Please try again.");

let url = format!(
"https://github.com/succinctlabs/rust/releases/download/{}/rust-toolchain-{}.tar.gz",
Expand Down
5 changes: 5 additions & 0 deletions core/src/air/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ pub trait BaseAirBuilder: AirBuilder + MessageBuilder<AirInteraction<Self::Expr>
}
}

/// Asserts that an iterator of expressions are all zero.
fn assert_all_zero<I: Into<Self::Expr>>(&mut self, iter: impl IntoIterator<Item = I>) {
iter.into_iter().for_each(|expr| self.assert_zero(expr));
}

/// Will return `a` if `condition` is 1, else `b`. This assumes that `condition` is already
/// checked to be a boolean.
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion core/src/alu/divrem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl<F: PrimeField> MachineAir<F> for DivRemChip {
}
let mut alu_events = HashMap::new();
alu_events.insert(Opcode::ADD, add_events);
output.add_alu_events(&mut alu_events);
output.add_alu_events(alu_events);
}

let mut lower_word = 0;
Expand Down
Loading
Loading