From 38ced2964bc3a51230d2aafcf5b5cdcbad29379c Mon Sep 17 00:00:00 2001 From: RogerTaule Date: Thu, 10 Oct 2024 14:29:45 +0000 Subject: [PATCH 1/4] Removing unnecessary dependencies --- .github/workflows/ci.yaml | 14 +++++++------- .gitignore | 1 + examples/fibonacci-square/README.md | 6 +----- pil2-stark/Makefile | 2 +- pil2-stark/README.md | 8 +++----- pil2-stark/src/utils/utils.cpp | 5 ----- provers/starks-lib-c/build.rs | 9 --------- 7 files changed, 13 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4855ec3..f5f76836 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ on: push: branches: [main, develop] pull_request: - branches: [main, develop] + branches: [main, develop, sam-monorepo-2] jobs: cargo-test: name: cargo test @@ -14,13 +14,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + run: sudo apt-get update - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Install dependencies run: | sudo apt-get update - sudo apt install -y protobuf-compiler build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev postgresql libpqxx-dev libpqxx-doc nasm libsecp256k1-dev libprotoc-dev libsodium-dev libprotobuf-dev libssl-dev cmake libgrpc++-dev uuid-dev + sudo apt install -y build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev nasm libsodium-dev cmake - name: Check out pil2-stark uses: actions/checkout@v4 @@ -47,7 +47,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + run: sudo apt-get update - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y cargo-fmt: @@ -67,7 +67,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + run: sudo apt-get update - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: cargo fix --workspace @@ -89,7 +89,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + run: sudo apt-get update - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Modify stark-prover-lib @@ -169,7 +169,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt install -y protobuf-compiler build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev postgresql libpqxx-dev libpqxx-doc nasm libsecp256k1-dev libprotoc-dev libsodium-dev libprotobuf-dev libssl-dev cmake libgrpc++-dev uuid-dev + sudo apt install -y build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev nasm libsodium-dev cmake - name: Install pil2-stark working-directory: pil2-stark diff --git a/.gitignore b/.gitignore index 5df5b934..ac9045b0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ pil_helpers build*/ *.pilout run.sh +MyLogFile.log \ No newline at end of file diff --git a/examples/fibonacci-square/README.md b/examples/fibonacci-square/README.md index c2457ef7..585e9a9a 100644 --- a/examples/fibonacci-square/README.md +++ b/examples/fibonacci-square/README.md @@ -41,11 +41,7 @@ git checkout develop_rust_lib # Update package lists and install required system packages sudo apt update -sudo apt install build-essential libbenchmark-dev libomp-dev libgmp-dev \ - nlohmann-json3-dev postgresql libpqxx-dev libpqxx-doc nasm \ - libsecp256k1-dev grpc-proto libsodium-dev libprotobuf-dev \ - libssl-dev cmake libgrpc++-dev protobuf-compiler \ - protobuf-compiler-grpc uuid-dev +sudo apt install -y build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev nasm libsodium-dev cmake # Initialize and update git submodules git submodule init diff --git a/pil2-stark/Makefile b/pil2-stark/Makefile index 7757d275..3c18a042 100644 --- a/pil2-stark/Makefile +++ b/pil2-stark/Makefile @@ -13,7 +13,7 @@ WITNESS_LIB := ./witness_lib CXX := g++ AS := nasm CXXFLAGS := -std=c++17 -Wall -pthread -flarge-source-files -Wno-unused-label -rdynamic #-Wfatal-errors -LDFLAGS := -lprotobuf -lsodium -lgpr -lpthread -lpqxx -lpq -lgmp -lstdc++ -lgmpxx -lsecp256k1 -lcrypto -luuid -fopenmp -liomp5 +LDFLAGS := -lsodium -lpthread -lgmp -lstdc++ -fopenmp -liomp5 CFLAGS := -fopenmp ASFLAGS := -felf64 diff --git a/pil2-stark/README.md b/pil2-stark/README.md index f2fad0b7..a53fa7d2 100644 --- a/pil2-stark/README.md +++ b/pil2-stark/README.md @@ -14,13 +14,11 @@ cd pil2-stark The following packages must be installed. -**Important dependency note**: you must install [`libpqxx` version 6.4.5](https://github.com/jtv/libpqxx/releases/tag/6.4.5). If your distribution installs a newer version, please [compile `libpqxx` 6.4.5](https://github.com/jtv/libpqxx/releases/tag/6.4.5) and install it manually instead. - #### Ubuntu/Debian ```sh apt update -apt install build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev postgresql libpqxx-dev libpqxx-doc nasm libsecp256k1-dev grpc-proto libsodium-dev libprotobuf-dev libssl-dev cmake libgrpc++-dev protobuf-compiler protobuf-compiler-grpc uuid-dev +apt install build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev nasm libsodium-dev cmake ``` #### openSUSE @@ -28,14 +26,14 @@ apt install build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json zypper addrepo https://download.opensuse.org/repositories/network:cryptocurrencies/openSUSE_Tumbleweed/network:cryptocurrencies.repo zypper refresh zypper install -t pattern devel_basis -zypper install libbenchmark1 libomp16-devel libgmp10 nlohmann_json-devel postgresql libpqxx-devel ghc-postgresql-libpq-devel nasm libsecp256k1-devel grpc-devel libsodium-devel libprotobuf-c-devel libssl53 cmake libgrpc++1_57 protobuf-devel uuid-devel llvm llvm-devel libopenssl-devel +zypper install libbenchmark1 libomp16-devel libgmp10 nlohmann_json-devel nasm libsodium-devel cmake ``` #### Fedora ``` dnf group install "C Development Tools and Libraries" "Development Tools" dnf config-manager --add-repo https://terra.fyralabs.com/terra.repo -dnf install google-benchmark-devel libomp-devel gmp gmp-devel gmp-c++ nlohmann-json-devel postgresql libpqxx-devel nasm libsecp256k1-devel grpc-devel libsodium-devel cmake grpc grpc-devel grpc-cpp protobuf-devel protobuf-c-devel uuid-devel libuuid-devel uuid-c++ llvm llvm-devel openssl-devel +dnf install google-benchmark-devel libomp-devel gmp gmp-devel gmp-c++ nlohmann-json-devel nasm libsodium-devel cmake ``` ### Compilation diff --git a/pil2-stark/src/utils/utils.cpp b/pil2-stark/src/utils/utils.cpp index 57871ae7..f2e9ee93 100644 --- a/pil2-stark/src/utils/utils.cpp +++ b/pil2-stark/src/utils/utils.cpp @@ -2,17 +2,12 @@ #include #include #include -#include #include #include #include #include #include -#include #include -#include -#include -#include #include #include #include diff --git a/provers/starks-lib-c/build.rs b/provers/starks-lib-c/build.rs index 8a640b6e..0e6e70da 100644 --- a/provers/starks-lib-c/build.rs +++ b/provers/starks-lib-c/build.rs @@ -55,21 +55,12 @@ fn main() { // Link other required libraries for lib in &[ - "protobuf", "sodium", - "grpc++", - "grpc", - "gpr", - "grpc++_reflection", "pthread", - "pqxx", - "pq", "gmp", "stdc++", "gmpxx", - "secp256k1", "crypto", - "uuid", "iomp5", ] { println!("cargo:rustc-link-lib={}", lib); From 620afff30d7f005b2b9c372f5648760f4452ef67 Mon Sep 17 00:00:00 2001 From: RogerTaule Date: Thu, 10 Oct 2024 14:44:43 +0000 Subject: [PATCH 2/4] Minor fix --- .github/workflows/ci.yaml | 22 ++++++++-------------- provers/starks-lib-c/build.rs | 10 +--------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f5f76836..666e8bc9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,27 +13,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install Dependencies - run: sudo apt-get update - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Install dependencies run: | sudo apt-get update + sudo apt-get install -y protobuf-compiler sudo apt install -y build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev nasm libsodium-dev cmake - - name: Check out pil2-stark - uses: actions/checkout@v4 - with: - repository: 0xPolygonHermez/pil2-stark - token: ${{ secrets.GITHUB_TOKEN }} - ref: develop - path: pil2-stark - - name: Install pil2-stark working-directory: pil2-stark run: | - git submodule init + git submodule update --init --recursive git submodule update make clean make starks_lib -j @@ -47,7 +38,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y cargo-fmt: @@ -67,7 +58,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: cargo fix --workspace @@ -89,7 +80,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Dependencies - run: sudo apt-get update + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Modify stark-prover-lib @@ -102,6 +93,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Dependencies + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Set up Rust Toolchain run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: install cargo-audit @@ -169,6 +162,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update + sudo apt-get install -y protobuf-compiler sudo apt install -y build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev nasm libsodium-dev cmake - name: Install pil2-stark diff --git a/provers/starks-lib-c/build.rs b/provers/starks-lib-c/build.rs index 0e6e70da..c153175f 100644 --- a/provers/starks-lib-c/build.rs +++ b/provers/starks-lib-c/build.rs @@ -54,15 +54,7 @@ fn main() { println!("cargo:rustc-link-lib=static={}", library_short_name); // Link other required libraries - for lib in &[ - "sodium", - "pthread", - "gmp", - "stdc++", - "gmpxx", - "crypto", - "iomp5", - ] { + for lib in &["sodium", "pthread", "gmp", "stdc++", "gmpxx", "crypto", "iomp5"] { println!("cargo:rustc-link-lib={}", lib); } } From 8fd522f706562faa89daec4a2ea339aac13ce4c8 Mon Sep 17 00:00:00 2001 From: RogerTaule Date: Thu, 10 Oct 2024 16:54:03 +0200 Subject: [PATCH 3/4] Removing liomp5 --- pil2-stark/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pil2-stark/Makefile b/pil2-stark/Makefile index 3c18a042..9d1ad412 100644 --- a/pil2-stark/Makefile +++ b/pil2-stark/Makefile @@ -13,7 +13,7 @@ WITNESS_LIB := ./witness_lib CXX := g++ AS := nasm CXXFLAGS := -std=c++17 -Wall -pthread -flarge-source-files -Wno-unused-label -rdynamic #-Wfatal-errors -LDFLAGS := -lsodium -lpthread -lgmp -lstdc++ -fopenmp -liomp5 +LDFLAGS := -lsodium -lpthread -lgmp -lstdc++ -fopenmp CFLAGS := -fopenmp ASFLAGS := -felf64 From e9c6838926f36be035bdb124afba5799b50456af Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Thu, 10 Oct 2024 11:17:51 -0400 Subject: [PATCH 4/4] fix branch PR conditions --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 666e8bc9..b52b1c79 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,6 @@ on: push: branches: [main, develop] pull_request: - branches: [main, develop, sam-monorepo-2] jobs: cargo-test: name: cargo test