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: VID take iterator instead of slice #381

Merged
merged 30 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ca5b7e5
derive common bounds for VidDisperse
ggutoski Sep 29, 2023
b1238f3
more downstream-friendly derivations for VidDisperse
ggutoski Sep 29, 2023
6de7877
make itertools a workspace dep
ggutoski Sep 26, 2023
b0d49ce
WIP can't use itertools because https://github.com/rust-itertools/ite…
ggutoski Sep 27, 2023
bb8dc03
BytesToField and FieldToBytes iterators pass tests, lots of cleanup todo
ggutoski Sep 28, 2023
1056b05
add large test length 5000, separate test for bytes_field_elems2, rem…
ggutoski Oct 4, 2023
4e43741
make bytes_to_field2 generic over Borrow<u8>
ggutoski Oct 4, 2023
e67f68f
rename bytes_to_field2 -> bytes_to_field, etc
ggutoski Oct 4, 2023
ca72b0a
cargo fmt, cargo clippy
ggutoski Oct 4, 2023
e7fdb10
comments
ggutoski Oct 4, 2023
813ebfe
test for zero-length input
ggutoski Oct 4, 2023
89b9bcc
0-length input -> 0-length output
ggutoski Oct 4, 2023
175cbf9
refactor elem_to_usize
ggutoski Oct 4, 2023
f41a36a
refactor elem_to_bytes_iter
ggutoski Oct 4, 2023
e73ee11
make bytes_from_field generic over Borrow<F>
ggutoski Oct 4, 2023
a8ab070
test for iterators over both (u8, F) and (&u8, &F)
ggutoski Oct 4, 2023
89c0ee7
fix infallibility test for bytes_from_field
ggutoski Oct 5, 2023
1328fd8
WIP disperse() take iterator, tests fail because commit() still does not
ggutoski Oct 5, 2023
f2dde8b
WIP commit() take iterator, tests fail because recover() still does not
ggutoski Oct 5, 2023
e256ec5
WIP recover_payload() use bytes_from_field, tests fail due to a bug
ggutoski Oct 5, 2023
71ff65c
rename: add 'invertible'
ggutoski Oct 5, 2023
03d7d87
new alternate simpler bytes_to_field
ggutoski Oct 5, 2023
279d7e1
fix: add elems_len to common so as to discard excess elements returne…
ggutoski Oct 5, 2023
6d21112
remove simpler bytes_to_field (boo)
ggutoski Oct 5, 2023
474fcdf
rename: remove invertible from bytes_to_field name
ggutoski Oct 5, 2023
5dbc66b
update CHANGELOG
ggutoski Oct 5, 2023
4ca08ab
update flake.lock, fix flake.nix
ggutoski Oct 6, 2023
befa38d
clippy appeasement
ggutoski Oct 6, 2023
8d2a83d
iterate elems directly into polynomials in commit_only
ggutoski Oct 6, 2023
da87289
iterate elems directly into polynomials in disperse_from_elems
ggutoski Oct 6, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and follow [semantic versioning](https://semver.org/) for our releases.
- [#341](https://github.com/EspressoSystems/jellyfish/pull/341) Port VDF from another repo
- [#343](https://github.com/EspressoSystems/jellyfish/pull/343) Rescue parameter for `ark_bn254::Fq`
- [#362](https://github.com/EspressoSystems/jellyfish/pull/362) Derive Eq, Hash at a bunch of places
- [#381](https://github.com/EspressoSystems/jellyfish/pull/381) VID take iterator instead of slice

### Changed

Expand Down
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[workspace]
members = [
"plonk",
"primitives",
"relation",
"utilities",
]
members = ["plonk", "primitives", "relation", "utilities"]

[workspace.package]
version = "0.4.0-pre.0"
Expand All @@ -15,3 +10,6 @@ rust-version = "1.64.0"
homepage = "https://github.com/EspressoSystems/jellyfish"
documentation = "https://jellyfish.docs.espressosys.com"
repository = "https://github.com/EspressoSystems/jellyfish"

[workspace.dependencies]
itertools = { version = "0.10.1", default-features = false }
30 changes: 15 additions & 15 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
buildInputs = [
argbash
openssl
pkgconfig
pkg-config
git

stableToolchain
Expand Down
32 changes: 24 additions & 8 deletions plonk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rust-version = { workspace = true }

[dependencies]
ark-ec = "0.4.0"
ark-ff = { version = "0.4.0", features = [ "asm" ] }
ark-ff = { version = "0.4.0", features = ["asm"] }
ark-poly = "0.4.0"
ark-serialize = "0.4.0"
ark-std = { version = "0.4.0", default-features = false }
Expand All @@ -21,7 +21,7 @@ downcast-rs = { version = "1.2.0", default-features = false }
dyn-clone = "^1.0"
espresso-systems-common = { git = "https://github.com/espressosystems/espresso-systems-common", tag = "0.4.0" }
hashbrown = "0.13.2"
itertools = { version = "0.10.1", default-features = false }
itertools = { workspace = true }
jf-primitives = { path = "../primitives", default-features = false }
jf-relation = { path = "../relation", default-features = false }
jf-utils = { path = "../utilities" }
Expand Down Expand Up @@ -52,14 +52,30 @@ harness = false
[features]
default = ["parallel"]
std = [
"ark-std/std", "ark-serialize/std", "ark-ff/std", "ark-ec/std", "ark-poly/std",
"downcast-rs/std", "itertools/use_std", "jf-primitives/std", "jf-relation/std",
"jf-utils/std", "num-bigint/std", "rand_chacha/std", "sha3/std"
"ark-std/std",
"ark-serialize/std",
"ark-ff/std",
"ark-ec/std",
"ark-poly/std",
"downcast-rs/std",
"itertools/use_std",
"jf-primitives/std",
"jf-relation/std",
"jf-utils/std",
"num-bigint/std",
"rand_chacha/std",
"sha3/std",
]
test_apis = [] # exposing apis for testing purpose
parallel = ["ark-ff/parallel", "ark-ec/parallel", "ark-poly/parallel",
"jf-utils/parallel", "jf-relation/parallel", "jf-primitives/parallel",
"dep:rayon" ]
parallel = [
"ark-ff/parallel",
"ark-ec/parallel",
"ark-poly/parallel",
"jf-utils/parallel",
"jf-relation/parallel",
"jf-primitives/parallel",
"dep:rayon",
]
test-srs = []

[[example]]
Expand Down
2 changes: 1 addition & 1 deletion plonk/src/circuit/plonk_verifier/gadgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ where
}
// ensure all the buffer has been consumed
if v_and_uv_basis.next().is_some() {
return Err(PlonkError::IteratorOutOfRange)?;
Err(PlonkError::IteratorOutOfRange)?;
}
Ok(result)
}
Expand Down
6 changes: 3 additions & 3 deletions plonk/src/circuit/plonk_verifier/poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ where
let pi = public_inputs[0];
for &pi_i in public_inputs.iter().skip(1) {
if pi != pi_i {
return Err(PlonkError::PublicInputsDoNotMatch)?;
Err(PlonkError::PublicInputsDoNotMatch)?;
}
}

Expand Down Expand Up @@ -462,7 +462,7 @@ where
}
// ensure all the buffer has been consumed
if alpha_bases_elem_var.next().is_some() {
return Err(PlonkError::IteratorOutOfRange)?;
Err(PlonkError::IteratorOutOfRange)?;
}
// =====================================================
// second statement
Expand Down Expand Up @@ -690,7 +690,7 @@ where

// ensure all the buffer has been consumed
if alpha_bases_elem_var.next().is_some() {
return Err(PlonkError::IteratorOutOfRange)?;
Err(PlonkError::IteratorOutOfRange)?;
}
// ============================================
// Add splitted quotient commitments
Expand Down
4 changes: 1 addition & 3 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ digest = { version = "0.10.1", default-features = false, features = ["alloc"] }
displaydoc = { version = "0.2.3", default-features = false }
espresso-systems-common = { git = "https://github.com/espressosystems/espresso-systems-common", tag = "0.4.0" }
hashbrown = "0.13.1"
itertools = { version = "0.10.1", default-features = false, features = [
"use_alloc",
] }
itertools = { workspace = true, features = ["use_alloc"] }
jf-relation = { path = "../relation", default-features = false }
jf-utils = { path = "../utilities" }
merlin = { version = "3.0.0", default-features = false }
Expand Down
4 changes: 4 additions & 0 deletions primitives/src/merkle_tree/hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
//! Use [`GenericHasherMerkleTree`] if you prefer to specify your own `Arity`
//! and node [`Index`] types.

// clippy is freaking out about `HasherNode` and this is the only thing I
// could do to stop it
#![allow(clippy::incorrect_partial_ord_impl_on_ord_type)]

use crate::errors::PrimitivesError;

use super::{append_only::MerkleTree, DigestAlgorithm, Element, Index};
Expand Down
Loading
Loading