Skip to content

Commit

Permalink
New version 0.7.0 (#123)
Browse files Browse the repository at this point in the history
* Remove hardcoded rust toolchain (#122)

* Remove hardcoded rust toolchain and use new
gingerlib: we should update pk/vk for old circuits

* Fix version in README

* Update crossbeam-channel that was yanked

* Remove fixed version of dependencies (#109)

---------

Co-authored-by: nicholas-mainardi <[email protected]>
  • Loading branch information
la10736 and nicholas-mainardi authored Jul 3, 2023
1 parent 26d3d11 commit b101ffe
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 118 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ script:

jobs:
include:
- name: rust_1.51_asm_target-feature_cargo_test
env: IMAGE_TAG='bionic_rust-1.51.0_jdk-11_latest' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm' TESTS='000,002'
- name: rust_1.51_asm_target-feature_mvn_test
env: IMAGE_TAG='bionic_rust-1.51.0_jdk-11_latest' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm' TESTS='001,003'
- name: rust_1.51_asm_target-feature_mvn_release
- name: rust-stable_latest_asm_target-feature_cargo_test
env: IMAGE_TAG='bionic_rust-stable_jdk-11_latest' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm' TESTS='000,002'
- name: rust-stable_latest_asm_target-feature_mvn_test
env: IMAGE_TAG='bionic_rust-stable_jdk-11_latest' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm' TESTS='001,003'
- name: rust-stable_latest_asm_target-feature_mvn_release
if: tag IS present
env: PUBLISH_BUILD=true IMAGE_TAG='bionic_rust-1.51.0_jdk-11_latest' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm' TESTS='000,001,002,003'
env: PUBLISH_BUILD=true IMAGE_TAG='bionic_rust-stable_jdk-11_latest' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm' TESTS='000,001,002,003'

deploy:
provider: script
Expand Down
13 changes: 9 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Build guide

The library compiles on the `1.51.0 stable` toolchain of the Rust compiler. To install Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the appropriate Rust toolchain by invoking:
```bash
rustup install 1.51.0
```
The library compiles on the `stable` Rust toolchain.
To install Rust, just install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager.

After that, use `cargo`, the standard Rust build tool, to build the library:

```bash
git clone https://github.com/HorizenOfficial/zendoo-sc-cryptolib.git
cd zendoo-sc-cryptolib
cargo build --release
```

This library comes with unit tests for each of the provided crates. Run the tests with:

```bash
cargo test --all-features
```

Compiling with `adcxq`, `adoxq` and `mulxq` instructions can lead to a 30-70% speedup. These are available on most `x86_64` platforms (Broadwell onwards for Intel and Ryzen onwards for AMD). Run the following command:

```bash
RUSTFLAGS="-C target-feature=+bmi2,+adx" cargo test/build/bench --features asm
```

Tip: If optimising for performance, your mileage may vary with passing `--emit=asm` to `RUSTFLAGS`.

## Java Jar build guide
Expand Down
70 changes: 32 additions & 38 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ Support has been introduced to create *Final Darlin* proofs, as per last step of

## Build guide

The library compiles on the `1.51.0 stable` toolchain of the Rust compiler.
To install Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager.
Once `rustup` is installed, install the appropriate Rust toolchain by invoking:
```bash
rustup install 1.51.0
```
The library compiles on the `stable` Rust toolchain.
To install Rust, just install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager.

After that, use `cargo`, the standard Rust build tool, to build the library:

```bash
git clone https://github.com/HorizenOfficial/zendoo-sc-cryptolib.git
cd zendoo-sc-cryptolib
cargo build --release
```

This library comes with unit tests for each of the provided crates. Run the tests with:

```bash
cargo test
```

More detailed build guide, as well as instructions to build the .jar, can be found in our [build guide](BUILD.md).

## Extras
Expand Down
48 changes: 30 additions & 18 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api"
version = "0.6.0"
version = "0.7.0"
authors = [
"DanieleDiBenedetto <[email protected]>",
"Oleksandr Iozhytsia <[email protected]>",
Expand All @@ -9,38 +9,50 @@ authors = [
"Luigi Varriale <[email protected]>",
"cronicc <[email protected]>",
"Paolo Tagliaferri <[email protected]>",
"Michael Lodder <[email protected]>"
"Michael Lodder <[email protected]>",
"Michele d'Amico <[email protected]>",
"Nicholas Mainardi <[email protected]>",
]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
algebra = {features = ["tweedle"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0"}
primitives = {features = ["tweedle", "merkle_tree"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0"}
algebra = { features = [
"tweedle",
], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.6.0" }
primitives = { features = [
"tweedle",
"merkle_tree",
], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.6.0" }

cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", tag = "0.2.0" }
r1cs-core = {git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0"}
cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", tag = "0.2.1" }
r1cs-core = { git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.6.0" }
#ouroboros = {path = "../ouroboros"}
demo-circuit = {path = "../demo-circuit"}
demo-circuit = { path = "../demo-circuit" }

jni = "=0.19.0"
derivative = "=2.2.0"
lazy_static = "=1.4.0"
radix_trie = "=0.2.1"
rand = { version = "=0.8.4" }
rand_xorshift = { version = "=0.3.0" }
rand_chacha = { version = "=0.3.1" }
blake2 = { version = "=0.8.1", default-features = false }
jni = "0.19.0"
derivative = "2.2.0"
lazy_static = "1.4.0"
radix_trie = "0.2.1"
rand = { version = "0.8.4" }
rand_xorshift = { version = "0.3.0" }
rand_chacha = { version = "0.3.1" }
blake2 = { version = "0.8.1", default-features = false }

[dev-dependencies]
serial_test = "=0.5.1"
serial_test = "0.5.1"

[lib]
name = "zendoo_sc"
path = "src/lib.rs"
crate_type = ["cdylib"]

[features]
default = [ "asm" ]
asm = [ "algebra/llvm_asm", "primitives/llvm_asm", "cctp_primitives/asm", "demo-circuit/asm" ]
default = ["asm"]
asm = [
"algebra/asm",
"primitives/asm",
"cctp_primitives/asm",
"demo-circuit/asm",
]
4 changes: 2 additions & 2 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ Before starting the build process use `set_version.sh` script if needed by provi

---
## How to refer
- Find all the existing versions of [0.6.0-SNAPSHOT package](https://oss.sonatype.org/content/repositories/snapshots/io/horizen/zendoo-sc-cryptolib/0.6.0-SNAPSHOT/)
- Find all the existing versions of [0.7.0](https://oss.sonatype.org/content/repositories/snapshots/io/horizen/zendoo-sc-cryptolib/0.7.0/)
- Use the full version of SNAPSHOT package as a dependency in the following format for your project.
```
<dependency>
<groupId>io.horizen</groupId>
<artifactId>zendoo-sc-cryptolib</artifactId>
<version>0.5.1-20220623.010409-1</version>
<version>0.7.0</version>
</dependency>
```
2 changes: 1 addition & 1 deletion ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ workdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )"
# defaults if not provided via env
DOCKER_ORG="${DOCKER_ORG:-zencash}"
IMAGE_NAME="${IMAGE_NAME:-sc-ci-base}"
IMAGE_TAG="${IMAGE_TAG:-bionic_rust-1.51.0_jdk-11_latest}"
IMAGE_TAG="${IMAGE_TAG:-bionic_rust-stable_jdk-11_latest}"
image="${DOCKER_ORG}/${IMAGE_NAME}:${IMAGE_TAG}"
export CARGO_AUDIT_EXIT_ON_ERROR="${CARGO_AUDIT_EXIT_ON_ERROR:-true}"
export DISABLE_JAVADOC_LINT="${DISABLE_JAVADOC_LINT:-false}"
Expand Down
Loading

0 comments on commit b101ffe

Please sign in to comment.