diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d58ce428..a6c49f4b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: nightly-toolchain: type: string - default: "nightly-2022-03-10" + default: "nightly-2022-05-09" executors: default: @@ -131,6 +131,7 @@ jobs: at: "." - restore_rustup_cache - restore_parameter_cache + - run: rustup install << pipeline.parameters.nightly-toolchain >> - run: name: Test with use_multicore_sdr command: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b299a762..0c4635e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://book.async.rs/overview ## Unreleased +## [11.1.1] - 2022-06-15 + +- Lock versions to the correct minor number [#1614](https://github.com/filecoin-project/rust-fil-proofs/pull/1614) + +## [11.1.0] - 2022-06-13 + +- Updates for aggregate proof versioning support [#1612](https://github.com/filecoin-project/rust-fil-proofs/pull/1612) + ## [11.0.2] - 2022-02-09 - Fix cache clearing by resetting the cache path first [#1563](https://github.com/filecoin-project/rust-fil-proofs/pull/1563) @@ -316,7 +324,9 @@ mainnet ready and will be replaced in a future version. This release is intende - Initial stable release -[Unreleased]: https://github.com/filecoin-project/rust-fil-proofs/compare/v11.0.2...HEAD +[Unreleased]: https://github.com/filecoin-project/rust-fil-proofs/compare/v11.1.1...HEAD +[11.1.1]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v11.1.1 +[11.1.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v11.1.0 [11.0.2]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v11.0.2 [11.0.1]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v11.0.1 [11.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v11.0.0 diff --git a/fil-proofs-param/Cargo.toml b/fil-proofs-param/Cargo.toml index 93eabbf87..0ae7d57e7 100644 --- a/fil-proofs-param/Cargo.toml +++ b/fil-proofs-param/Cargo.toml @@ -9,11 +9,11 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -storage-proofs-core = { path = "../storage-proofs-core", version = "^11.0.0", default-features = false} -storage-proofs-porep = { path = "../storage-proofs-porep", version = "^11.0.0", default-features = false } -storage-proofs-post = { path = "../storage-proofs-post", version = "^11.0.0", default-features = false } -storage-proofs-update = { path = "../storage-proofs-update", version = "^11.0.0", default-features = false } -filecoin-proofs = { version = "^11.0.0", path = "../filecoin-proofs", default-features = false } +storage-proofs-core = { path = "../storage-proofs-core", version = "~11.0.0", default-features = false} +storage-proofs-porep = { path = "../storage-proofs-porep", version = "~11.0.0", default-features = false } +storage-proofs-post = { path = "../storage-proofs-post", version = "~11.0.0", default-features = false } +storage-proofs-update = { path = "../storage-proofs-update", version = "~11.0.0", default-features = false } +filecoin-proofs = { version = "~11.0.0", path = "../filecoin-proofs", default-features = false } rand = "0.8" lazy_static = "1.2" pbr = "1.0" diff --git a/fil-proofs-param/src/bin/paramfetch.rs b/fil-proofs-param/src/bin/paramfetch.rs index da3d7a2b3..e6b447073 100644 --- a/fil-proofs-param/src/bin/paramfetch.rs +++ b/fil-proofs-param/src/bin/paramfetch.rs @@ -23,8 +23,7 @@ use tar::Archive; lazy_static! { static ref CLI_ABOUT: String = format!( - "Downloads missing or outdated Groth parameter files from ipfs using ipget.\n\ - \n\ + "Downloads missing or outdated Groth parameter files from ipfs using ipget.\n\n Set the $FIL_PROOFS_PARAMETER_CACHE env-var to specify the path to the parameter cache directory (location where params are written), otherwise params will be written to '{}'.", parameter_cache_dir_name(), @@ -32,7 +31,7 @@ lazy_static! { } const DEFAULT_JSON: &str = include_str!("../../parameters.json"); -const DEFAULT_IPGET_VERSION: &str = "v0.6.0"; +const DEFAULT_IPGET_VERSION: &str = "v0.8.1"; #[inline] fn get_ipget_dir(version: &str) -> String { diff --git a/fil-proofs-tooling/Cargo.toml b/fil-proofs-tooling/Cargo.toml index 98d4d20b5..1a676835c 100644 --- a/fil-proofs-tooling/Cargo.toml +++ b/fil-proofs-tooling/Cargo.toml @@ -10,11 +10,11 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -storage-proofs-core = { path = "../storage-proofs-core", version = "^11.0.0", default-features = false} -storage-proofs-porep = { path = "../storage-proofs-porep", version = "^11.0.0", default-features = false } -storage-proofs-post = { path = "../storage-proofs-post", version = "^11.0.0", default-features = false } -filecoin-proofs = { path = "../filecoin-proofs", default-features = false } -filecoin-hashers = { path = "../filecoin-hashers", default-features = false, features = ["poseidon", "blake2s", "sha256"] } +storage-proofs-core = { path = "../storage-proofs-core", version = "~11.0.0", default-features = false} +storage-proofs-porep = { path = "../storage-proofs-porep", version = "~11.0.0", default-features = false } +storage-proofs-post = { path = "../storage-proofs-post", version = "~11.0.0", default-features = false } +filecoin-proofs = { path = "../filecoin-proofs", version = "~11.0.0", default-features = false } +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["poseidon", "blake2s", "sha256"] } clap = { version = "3.1.6", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -22,7 +22,7 @@ regex = "1.3.7" commandspec = "0.12.2" chrono = { version = "0.4.7", features = ["serde"] } memmap = "0.7.0" -bellperson = "0.18.0" +bellperson = "0.22.0" rand = "0.8" tempfile = "3.0.8" cpu-time = "1.0.0" @@ -32,7 +32,7 @@ async-std = "1.6" blake2s_simd = "1.0.0" fil_logger = "0.1.6" log = "0.4.8" -merkletree = "0.21.0" +merkletree = "0.22.0" bincode = "1.1.2" anyhow = "1.0.23" rand_xorshift = "0.3.0" @@ -46,7 +46,7 @@ fdlimit = "0.2.0" dialoguer = "0.10.0" structopt = "0.3.12" humansize = "1.1.0" -blstrs = "0.4.0" +blstrs = "0.5.0" time = "0.3.9" [features] diff --git a/filecoin-hashers/Cargo.toml b/filecoin-hashers/Cargo.toml index 287866b16..638b710f7 100644 --- a/filecoin-hashers/Cargo.toml +++ b/filecoin-hashers/Cargo.toml @@ -9,16 +9,16 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -bellperson = "0.18.0" -blstrs = "0.4.0" +bellperson = "0.22.0" +blstrs = "0.5.0" generic-array = "0.14.4" -merkletree = "0.21.0" -ff = "0.11.0" +merkletree = "0.22.0" +ff = "0.12.0" anyhow = "1.0.34" serde = "1.0.117" rand = "0.8.0" -neptune = { version = "5.1.0", optional = true, features = ["arity2", "arity4", "arity8", "arity11", "arity16", "arity24", "arity36"] } +neptune = { version = "~7.0.0", optional = true, features = ["bls", "arity2", "arity4", "arity8", "arity11", "arity16", "arity24", "arity36"] } lazy_static = { version = "1.4.0", optional = true } blake2s_simd = { version = "1.0.0", optional = true } sha2 = { version = "0.10.2", optional = true } diff --git a/filecoin-proofs/Cargo.toml b/filecoin-proofs/Cargo.toml index ea5cdb900..4a9249001 100644 --- a/filecoin-proofs/Cargo.toml +++ b/filecoin-proofs/Cargo.toml @@ -9,36 +9,36 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -storage-proofs-core = { path = "../storage-proofs-core", version = "^11.0.0", default-features = false} -storage-proofs-porep = { path = "../storage-proofs-porep", version = "^11.0.0", default-features = false } -storage-proofs-post = { path = "../storage-proofs-post", version = "^11.0.0", default-features = false } -storage-proofs-update = { path = "../storage-proofs-update", version = "^11.0.0", default-features = false } -filecoin-hashers = { version = "^6.0.0", path = "../filecoin-hashers", default-features = false, features = ["poseidon", "sha256"] } +storage-proofs-core = { path = "../storage-proofs-core", version = "~11.0.0", default-features = false} +storage-proofs-porep = { path = "../storage-proofs-porep", version = "~11.0.0", default-features = false } +storage-proofs-post = { path = "../storage-proofs-post", version = "~11.0.0", default-features = false } +storage-proofs-update = { path = "../storage-proofs-update", version = "~11.0.0", default-features = false } +filecoin-hashers = { version = "~6.0.0", path = "../filecoin-hashers", default-features = false, features = ["poseidon", "sha256"] } rand = "0.8" lazy_static = "1.2" memmap = "0.7" serde = { version = "1.0", features = ["rc", "derive"] } serde_json = "1.0" blake2b_simd = "1.0.0" -bellperson = "0.18.0" +bellperson = "0.22.0" log = "0.4.7" rayon = "1.1.0" hex = "0.4.0" -merkletree = "0.21.0" +merkletree = "0.22.0" bincode = "1.1.2" anyhow = "1.0.23" sha2 = "0.10.2" typenum = "1.11.2" gperftools = { version = "0.2", optional = true } generic-array = "0.14.4" -fr32 = { path = "../fr32", version = "^4.0.0", default-features = false } +fr32 = { path = "../fr32", version = "~4.0.0", default-features = false } once_cell = "1.8.0" -blstrs = "0.4.0" +blstrs = "0.5.0" [dev-dependencies] criterion = "0.3" tempfile = "3" -ff = "0.11.0" +ff = "0.12.0" fil_logger = "0.1.6" rand_xorshift = "0.3.0" diff --git a/filecoin-proofs/src/api/seal.rs b/filecoin-proofs/src/api/seal.rs index e12a56564..79b6e5e8f 100644 --- a/filecoin-proofs/src/api/seal.rs +++ b/filecoin-proofs/src/api/seal.rs @@ -724,6 +724,7 @@ pub fn aggregate_seal_commit_proofs( comm_rs: &[[u8; 32]], seeds: &[[u8; 32]], commit_outputs: &[SealCommitOutput], + aggregate_version: groth16::aggregate::AggregateVersion, ) -> Result { info!("aggregate_seal_commit_proofs:start"); @@ -784,6 +785,7 @@ pub fn aggregate_seal_commit_proofs( &srs_prover_key, &hashed_seeds_and_comm_rs, proofs.as_slice(), + aggregate_version, )?; let mut aggregate_proof_bytes = Vec::new(); aggregate_proof.write(&mut aggregate_proof_bytes)?; @@ -809,6 +811,7 @@ pub fn verify_aggregate_seal_commit_proofs( comm_rs: &[[u8; 32]], seeds: &[[u8; 32]], commit_inputs: Vec>, + aggregate_version: groth16::aggregate::AggregateVersion, ) -> Result { info!("verify_aggregate_seal_commit_proofs:start"); @@ -878,6 +881,7 @@ pub fn verify_aggregate_seal_commit_proofs( &hashed_seeds_and_comm_rs, commit_inputs.as_slice(), &aggregate_proof, + aggregate_version, )?; trace!("end verifying aggregate proof"); diff --git a/filecoin-proofs/tests/api.rs b/filecoin-proofs/tests/api.rs index 7ac87cecb..7243cb15d 100644 --- a/filecoin-proofs/tests/api.rs +++ b/filecoin-proofs/tests/api.rs @@ -335,15 +335,7 @@ fn test_seal_proof_aggregation_1_2kib_porep_id_v1_1_base_8() -> Result<()> { let mut porep_id = [0u8; 32]; porep_id[..8].copy_from_slice(&porep_id_v1_1.to_le_bytes()); assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_2_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_2_KIB, &porep_id, proofs_to_aggregate) } #[test] @@ -353,15 +345,7 @@ fn test_seal_proof_aggregation_3_2kib_porep_id_v1_1_base_8() -> Result<()> { let porep_id = ARBITRARY_POREP_ID_V1_1_0; assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_2_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_2_KIB, &porep_id, proofs_to_aggregate) } #[test] @@ -371,15 +355,7 @@ fn test_seal_proof_aggregation_5_2kib_porep_id_v1_1_base_8() -> Result<()> { let porep_id = ARBITRARY_POREP_ID_V1_1_0; assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_2_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_2_KIB, &porep_id, proofs_to_aggregate) } #[test] @@ -389,15 +365,7 @@ fn test_seal_proof_aggregation_257_2kib_porep_id_v1_1_base_8() -> Result<()> { let porep_id = ARBITRARY_POREP_ID_V1_1_0; assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_2_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_2_KIB, &porep_id, proofs_to_aggregate) } #[test] @@ -407,15 +375,7 @@ fn test_seal_proof_aggregation_2_4kib_porep_id_v1_1_base_8() -> Result<()> { let porep_id = ARBITRARY_POREP_ID_V1_1_0; assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_4_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_4_KIB, &porep_id, proofs_to_aggregate) } #[test] @@ -425,15 +385,7 @@ fn test_seal_proof_aggregation_1_32kib_porep_id_v1_1_base_8() -> Result<()> { let porep_id = ARBITRARY_POREP_ID_V1_1_0; assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_32_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_32_KIB, &porep_id, proofs_to_aggregate) } #[test] @@ -443,15 +395,7 @@ fn test_seal_proof_aggregation_818_32kib_porep_id_v1_1_base_8() -> Result<()> { let porep_id = ARBITRARY_POREP_ID_V1_1_0; assert!(!is_legacy_porep_id(porep_id)); - let verified = aggregate_proofs::( - SECTOR_SIZE_32_KIB, - &porep_id, - ApiVersion::V1_1_0, - proofs_to_aggregate, - )?; - assert!(verified); - - Ok(()) + aggregate_proofs::(SECTOR_SIZE_32_KIB, &porep_id, proofs_to_aggregate) } //#[test] @@ -507,44 +451,73 @@ fn test_seal_proof_aggregation_818_32kib_porep_id_v1_1_base_8() -> Result<()> { fn aggregate_proofs( sector_size: u64, porep_id: &[u8; 32], - api_version: ApiVersion, num_proofs_to_aggregate: usize, -) -> Result { +) -> Result<()> { let mut rng = XorShiftRng::from_seed(TEST_SEED); let prover_fr: DefaultTreeDomain = Fr::random(&mut rng).into(); let mut prover_id = [0u8; 32]; prover_id.copy_from_slice(AsRef::<[u8]>::as_ref(&prover_fr)); - let mut commit_outputs = Vec::with_capacity(num_proofs_to_aggregate); - let mut commit_inputs = Vec::with_capacity(num_proofs_to_aggregate); - let mut seeds = Vec::with_capacity(num_proofs_to_aggregate); - let mut comm_rs = Vec::with_capacity(num_proofs_to_aggregate); + let api_version = ApiVersion::V1_1_0; + let aggregate_versions = vec![ + groth16::aggregate::AggregateVersion::V1, + groth16::aggregate::AggregateVersion::V2, + ]; + for aggregate_version in aggregate_versions { + let mut commit_outputs = Vec::with_capacity(num_proofs_to_aggregate); + let mut commit_inputs = Vec::with_capacity(num_proofs_to_aggregate); + let mut seeds = Vec::with_capacity(num_proofs_to_aggregate); + let mut comm_rs = Vec::with_capacity(num_proofs_to_aggregate); + + let (commit_output, commit_input, seed, comm_r) = create_seal_for_aggregation::<_, Tree>( + &mut rng, + sector_size, + prover_id, + porep_id, + api_version, + )?; - let (commit_output, commit_input, seed, comm_r) = create_seal_for_aggregation::<_, Tree>( - &mut rng, - sector_size, - prover_id, - porep_id, - api_version, - )?; + for _ in 0..num_proofs_to_aggregate { + commit_outputs.push(commit_output.clone()); + commit_inputs.extend(commit_input.clone()); + seeds.push(seed); + comm_rs.push(comm_r); + } - for _ in 0..num_proofs_to_aggregate { - commit_outputs.push(commit_output.clone()); - commit_inputs.extend(commit_input.clone()); - seeds.push(seed); - comm_rs.push(comm_r); + let config = porep_config(sector_size, *porep_id, api_version); + let aggregate_proof = aggregate_seal_commit_proofs::( + config, + &comm_rs, + &seeds, + commit_outputs.as_slice(), + aggregate_version, + )?; + assert!(verify_aggregate_seal_commit_proofs::( + config, + aggregate_proof.clone(), + &comm_rs, + &seeds, + commit_inputs.clone(), + aggregate_version, + )?); + + // This ensures that once we generate an snarkpack proof + // with one version, it cannot verify with another. + let conflicting_aggregate_version = match aggregate_version { + groth16::aggregate::AggregateVersion::V1 => groth16::aggregate::AggregateVersion::V2, + groth16::aggregate::AggregateVersion::V2 => groth16::aggregate::AggregateVersion::V1, + }; + assert!(!verify_aggregate_seal_commit_proofs::( + config, + aggregate_proof, + &comm_rs, + &seeds, + commit_inputs, + conflicting_aggregate_version, + )?); } - let config = porep_config(sector_size, *porep_id, api_version); - let aggregate_proof = - aggregate_seal_commit_proofs::(config, &comm_rs, &seeds, commit_outputs.as_slice())?; - verify_aggregate_seal_commit_proofs::( - config, - aggregate_proof, - &comm_rs, - &seeds, - commit_inputs, - ) + Ok(()) } fn get_layer_file_paths(cache_dir: &tempfile::TempDir) -> Vec { @@ -803,7 +776,7 @@ fn test_winning_post_empty_sector_challenge() -> Result<()> { challenge_count: WINNING_POST_CHALLENGE_COUNT, typ: PoStType::Winning, priority: false, - api_version: ApiVersion::V1_0_0, + api_version, }; assert!(generate_winning_post_sector_challenge::( @@ -928,34 +901,19 @@ fn test_window_post_single_partition_smaller_2kib_base_8() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - sector_count / 2, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - sector_count / 2, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - sector_count / 2, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - sector_count / 2, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::( + sector_size, + sector_count / 2, + sector_count, + false, + version, + )?; + window_post::(sector_size, sector_count / 2, sector_count, true, version)?; + } + + Ok(()) } #[test] @@ -968,34 +926,19 @@ fn test_window_post_two_partitions_matching_2kib_base_8() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::( + sector_size, + 2 * sector_count, + sector_count, + false, + version, + )?; + window_post::(sector_size, 2 * sector_count, sector_count, true, version)?; + } + + Ok(()) } #[test] @@ -1008,34 +951,19 @@ fn test_window_post_two_partitions_matching_4kib_sub_8_2() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::( + sector_size, + 2 * sector_count, + sector_count, + false, + version, + )?; + window_post::(sector_size, 2 * sector_count, sector_count, true, version)?; + } + + Ok(()) } #[test] @@ -1048,34 +976,25 @@ fn test_window_post_two_partitions_matching_16kib_sub_8_8() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::( + sector_size, + 2 * sector_count, + sector_count, + false, + version, + )?; + window_post::( + sector_size, + 2 * sector_count, + sector_count, + true, + version, + )?; + } + + Ok(()) } #[test] @@ -1088,34 +1007,25 @@ fn test_window_post_two_partitions_matching_32kib_top_8_8_2() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - 2 * sector_count, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::( + sector_size, + 2 * sector_count, + sector_count, + false, + version, + )?; + window_post::( + sector_size, + 2 * sector_count, + sector_count, + true, + version, + )?; + } + + Ok(()) } #[test] @@ -1128,34 +1038,25 @@ fn test_window_post_two_partitions_smaller_2kib_base_8() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - 2 * sector_count - 1, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count - 1, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - 2 * sector_count - 1, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - 2 * sector_count - 1, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::( + sector_size, + 2 * sector_count - 1, + sector_count, + false, + version, + )?; + window_post::( + sector_size, + 2 * sector_count - 1, + sector_count, + true, + version, + )?; + } + + Ok(()) } #[test] @@ -1168,34 +1069,13 @@ fn test_window_post_single_partition_matching_2kib_base_8() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - window_post::( - sector_size, - sector_count, - sector_count, - false, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - sector_count, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - window_post::( - sector_size, - sector_count, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - window_post::( - sector_size, - sector_count, - sector_count, - true, - ApiVersion::V1_1_0, - ) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + window_post::(sector_size, sector_count, sector_count, false, version)?; + window_post::(sector_size, sector_count, sector_count, true, version)?; + } + + Ok(()) } #[test] @@ -1207,28 +1087,19 @@ fn test_window_post_partition_matching_2kib_base_8() -> Result<()> { .get(§or_size) .expect("unknown sector size"); - partition_window_post::( - sector_size, - 3, // Validate the scenarios of two partition - sector_count, - false, - ApiVersion::V1_0_0, - )?; - partition_window_post::( - sector_size, - 3, - sector_count, - true, - ApiVersion::V1_0_0, - )?; - partition_window_post::( - sector_size, - 3, - sector_count, - false, - ApiVersion::V1_1_0, - )?; - partition_window_post::(sector_size, 3, sector_count, true, ApiVersion::V1_1_0) + let versions = vec![ApiVersion::V1_0_0, ApiVersion::V1_1_0]; + for version in versions { + partition_window_post::( + sector_size, + 3, // Validate the scenarios of two partition + sector_count, + false, + version, + )?; + partition_window_post::(sector_size, 3, sector_count, true, version)?; + } + + Ok(()) } fn partition_window_post( diff --git a/fr32/Cargo.toml b/fr32/Cargo.toml index 58d91db85..78c808edb 100644 --- a/fr32/Cargo.toml +++ b/fr32/Cargo.toml @@ -11,9 +11,9 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" anyhow = "1.0.23" byte-slice-cast = "1.0.0" byteorder = "1" -ff = "0.11.0" +ff = "0.12.0" thiserror = "1.0.6" -blstrs = "0.4.0" +blstrs = "0.5.0" [dev-dependencies] bitvec = "0.17" diff --git a/storage-proofs-core/Cargo.toml b/storage-proofs-core/Cargo.toml index 8fc361a9c..42a2e3aea 100644 --- a/storage-proofs-core/Cargo.toml +++ b/storage-proofs-core/Cargo.toml @@ -12,9 +12,9 @@ readme = "README.md" bench = false [dependencies] -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["sha256", "poseidon"] } +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["sha256", "poseidon"] } rand = "0.8" -merkletree = "0.21.0" +merkletree = "0.22.0" byteorder = "1" config = { version = "0.12.0", default-features = false, features = ["toml"] } itertools = "0.10.3" @@ -26,8 +26,8 @@ fs2 = "0.4" rayon = "1.0.0" serde = { version = "1.0", features = ["derive"]} blake2b_simd = "1.0.0" -ff = "0.11.0" -bellperson = "0.18.0" +ff = "0.12.0" +bellperson = "0.22.0" serde_json = "1.0" log = "0.4.7" rand_chacha = "0.3" @@ -38,8 +38,8 @@ cpu-time = { version = "1.0", optional = true } gperftools = { version = "0.2", optional = true } num_cpus = "1.10.1" semver = "1.0.6" -fr32 = { path = "../fr32", version = "^4.0.0"} -blstrs = "0.4.0" +fr32 = { path = "../fr32", version = "~4.0.0"} +blstrs = "0.5.0" cbc = { version = "0.1.2", features = ["std"] } [dev-dependencies] @@ -47,8 +47,8 @@ proptest = "1.0.0" criterion = "0.3" rand_xorshift = "0.3.0" pretty_assertions = "1.2.0" -sha2raw = { path = "../sha2raw", version = "^6.0.0"} -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["blake2s", "sha256", "poseidon"] } +sha2raw = { path = "../sha2raw", version = "~6.0.0"} +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["blake2s", "sha256", "poseidon"] } tempfile = "3" blake2s_simd = "1.0.0" diff --git a/storage-proofs-core/src/api_version.rs b/storage-proofs-core/src/api_version.rs index 4bc2ec0c3..45cf85748 100644 --- a/storage-proofs-core/src/api_version.rs +++ b/storage-proofs-core/src/api_version.rs @@ -63,4 +63,8 @@ fn test_fmt() { fn test_as_semver() { assert_eq!(ApiVersion::V1_0_0.as_semver().major, 1); assert_eq!(ApiVersion::V1_1_0.as_semver().major, 1); + assert_eq!(ApiVersion::V1_0_0.as_semver().minor, 0); + assert_eq!(ApiVersion::V1_1_0.as_semver().minor, 1); + assert_eq!(ApiVersion::V1_0_0.as_semver().patch, 0); + assert_eq!(ApiVersion::V1_1_0.as_semver().patch, 0); } diff --git a/storage-proofs-core/src/compound_proof.rs b/storage-proofs-core/src/compound_proof.rs index 526a0ff0a..6d7b92e11 100644 --- a/storage-proofs-core/src/compound_proof.rs +++ b/storage-proofs-core/src/compound_proof.rs @@ -280,11 +280,13 @@ where prover_srs: &ProverSRS, hashed_seeds_and_comm_rs: &[u8], proofs: &[groth16::Proof], + version: groth16::aggregate::AggregateVersion, ) -> Result> { Ok(aggregate_proofs::( prover_srs, hashed_seeds_and_comm_rs, proofs, + version, )?) } @@ -301,6 +303,7 @@ where hashed_seeds_and_comm_rs: &[u8], public_inputs: &[Vec], aggregate_proof: &groth16::aggregate::AggregateProof, + version: groth16::aggregate::AggregateVersion, ) -> Result { let mut rng = OsRng; @@ -311,6 +314,7 @@ where public_inputs, aggregate_proof, hashed_seeds_and_comm_rs, + version, )?) } diff --git a/storage-proofs-porep/Cargo.toml b/storage-proofs-porep/Cargo.toml index 8a11b48a7..17294041b 100644 --- a/storage-proofs-porep/Cargo.toml +++ b/storage-proofs-porep/Cargo.toml @@ -10,23 +10,23 @@ readme = "README.md" [dependencies] crossbeam = "0.8" -storage-proofs-core = { path = "../storage-proofs-core", version = "^11.0.0", default-features = false} -sha2raw = { path = "../sha2raw", version = "^6.0.0"} -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["poseidon", "sha256"]} -merkletree = "0.21.0" +storage-proofs-core = { path = "../storage-proofs-core", version = "~11.0.0", default-features = false} +sha2raw = { path = "../sha2raw", version = "~6.0.0"} +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["poseidon", "sha256"]} +merkletree = "0.22.0" mapr = "0.8.0" num-bigint = "0.4.3" num-traits = "0.2" rayon = "1.0.0" serde = { version = "1.0", features = ["derive"]} serde_json = "1.0" -ff = "0.11.0" -bellperson = "0.18.0" +ff = "0.12.0" +bellperson = "0.22.0" log = "0.4.7" pretty_assertions = "1.2.0" generic-array = "0.14.4" anyhow = "1.0.23" -neptune = { version = "5.1.0", features = ["arity2", "arity4", "arity8", "arity11", "arity16", "arity24", "arity36"] } +neptune = { version = "~7.0.0", features = ["bls", "arity2", "arity4", "arity8", "arity11", "arity16", "arity24", "arity36"] } num_cpus = "1.10.1" hex = "0.4.2" bincode = "1.1.2" @@ -36,9 +36,9 @@ byte-slice-cast = "1.0.0" hwloc = { version = "0.5.0", optional = true } libc = "0.2" fdlimit = "0.2.0" -fr32 = { path = "../fr32", version = "^4.0.0", default-features = false } +fr32 = { path = "../fr32", version = "~4.0.0", default-features = false } yastl = "0.1.2" -blstrs = "0.4.0" +blstrs = "0.5.0" [target."cfg(target_arch = \"aarch64\")".dependencies] sha2 = { version = "0.10.2", features = ["compress", "asm"] } @@ -51,7 +51,7 @@ rand = "0.8" rand_xorshift = "0.3.0" criterion = "0.3.2" glob = "0.3.0" -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["poseidon", "sha256", "blake2s"]} +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["poseidon", "sha256", "blake2s"]} fil_logger = "0.1.6" [features] diff --git a/storage-proofs-porep/src/stacked/vanilla/proof.rs b/storage-proofs-porep/src/stacked/vanilla/proof.rs index 33749d891..dd64fa085 100644 --- a/storage-proofs-porep/src/stacked/vanilla/proof.rs +++ b/storage-proofs-porep/src/stacked/vanilla/proof.rs @@ -638,7 +638,7 @@ impl<'a, Tree: 'static + MerkleTreeTrait, G: 'static + Hasher> StackedDrg<'a, Tr None } }; - let mut column_tree_builder = ColumnTreeBuilder::::new( + let mut column_tree_builder = ColumnTreeBuilder::::new( column_batcher, tree_batcher, nodes_count, @@ -1083,7 +1083,7 @@ impl<'a, Tree: 'static + MerkleTreeTrait, G: 'static + Hasher> StackedDrg<'a, Tr None } }; - let mut tree_builder = TreeBuilder::::new( + let mut tree_builder = TreeBuilder::::new( batcher, nodes_count, tree_r_last_config.rows_to_discard, @@ -1543,7 +1543,7 @@ impl<'a, Tree: 'static + MerkleTreeTrait, G: 'static + Hasher> StackedDrg<'a, Tr None } }; - let mut tree_builder = TreeBuilder::::new( + let mut tree_builder = TreeBuilder::::new( batcher, nodes_count, tree_r_last_config.rows_to_discard, diff --git a/storage-proofs-post/Cargo.toml b/storage-proofs-post/Cargo.toml index 0143f01a2..0b2f7625d 100644 --- a/storage-proofs-post/Cargo.toml +++ b/storage-proofs-post/Cargo.toml @@ -9,26 +9,26 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -storage-proofs-core = { path = "../storage-proofs-core", version = "^11.0.0", default-features = false} -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["poseidon", "sha256"]} +storage-proofs-core = { path = "../storage-proofs-core", version = "~11.0.0", default-features = false} +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["poseidon", "sha256"]} byteorder = "1" sha2 = "0.10.2" rayon = "1.0.0" serde = { version = "1.0", features = ["derive"]} blake2b_simd = "1.0.0" -ff = "0.11.0" -bellperson = "0.18.0" +ff = "0.12.0" +bellperson = "0.22.0" log = "0.4.7" hex = "0.4.0" generic-array = "0.14.4" anyhow = "1.0.23" -fr32 = { path = "../fr32", version = "^4.0.0", default-features = false } -blstrs = "0.4.0" +fr32 = { path = "../fr32", version = "~4.0.0", default-features = false } +blstrs = "0.5.0" [dev-dependencies] tempfile = "3" pretty_assertions = "1.2.0" -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["poseidon", "sha256", "blake2s"]} +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["poseidon", "sha256", "blake2s"]} rand = "0.8" rand_xorshift = "0.3.0" diff --git a/storage-proofs-update/Cargo.toml b/storage-proofs-update/Cargo.toml index 49b8cb429..d0397cf44 100644 --- a/storage-proofs-update/Cargo.toml +++ b/storage-proofs-update/Cargo.toml @@ -9,21 +9,21 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -storage-proofs-core = { path = "../storage-proofs-core", version = "^11.0.0", default-features = false} -storage-proofs-porep = { path = "../storage-proofs-porep", version = "^11.0.0", default-features = false} -filecoin-hashers = { path = "../filecoin-hashers", version = "^6.0.0", default-features = false, features = ["poseidon", "sha256"]} -merkletree = "0.21.0" +storage-proofs-core = { path = "../storage-proofs-core", version = "~11.0.0", default-features = false} +storage-proofs-porep = { path = "../storage-proofs-porep", version = "~11.0.0", default-features = false} +filecoin-hashers = { path = "../filecoin-hashers", version = "~6.0.0", default-features = false, features = ["poseidon", "sha256"]} +merkletree = "0.22.0" rayon = "1.0.0" serde = { version = "1.0", features = ["derive"]} -ff = "0.11.0" -bellperson = "0.18.0" -blstrs = "0.4.0" +ff = "0.12.0" +bellperson = "0.22.0" +blstrs = "0.5.0" log = "0.4.7" generic-array = "0.14.4" anyhow = "1.0.23" -neptune = { version = "5.1.0", features = ["arity2", "arity4", "arity8", "arity11", "arity16", "arity24", "arity36"] } +neptune = { version = "~7.0.0", features = ["bls", "arity2", "arity4", "arity8", "arity11", "arity16", "arity24", "arity36"] } lazy_static = "1.2" -fr32 = { path = "../fr32", version = "^4.0.0", default-features = false } +fr32 = { path = "../fr32", version = "~4.0.0", default-features = false } memmap = "0.7" [dev-dependencies]