Skip to content

Commit

Permalink
fix: correct rows_to_discard value during post (#1220)
Browse files Browse the repository at this point in the history
* fix: correct rows_to_discard value during post

* fix: point to latest merkle_light release
  • Loading branch information
cryptonemo authored Jul 17, 2020
1 parent 5531d2a commit 0ffa7d8
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fil-proofs-tooling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ blake2s_simd = "0.5.6"
fil_logger = "0.1"
log = "0.4.8"
uom = "0.28"
merkletree = "0.20.0"
merkletree = "0.21.0"
bincode = "1.1.2"
anyhow = "1.0.23"
ff = { version = "0.2.0", package = "fff" }
Expand Down
2 changes: 1 addition & 1 deletion filecoin-proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ blake2s_simd = "0.5.8"
hex = "0.4.0"
tee = "0.1.0"
os_pipe = "0.9.1"
merkletree = "0.20.0"
merkletree = "0.21.0"
bincode = "1.1.2"
anyhow = "1.0.23"
rand_xorshift = "0.2.0"
Expand Down
2 changes: 1 addition & 1 deletion storage-proofs/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bench = false

[dependencies]
rand = "0.7"
merkletree = "0.20.0"
merkletree = "0.21.0"
byteorder = "1"
config = { version = "0.10.1", default-features = false, features = ["toml"] }
itertools = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion storage-proofs/porep/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readme = "README.md"
storage-proofs-core = { path = "../core", version = "4.0.1" }
sha2raw = { path = "../../sha2raw", version = "1.0.0" }
rand = "0.7"
merkletree = "0.20.0"
merkletree = "0.21.0"
memmap = "0.7"
num-bigint = "0.2"
num-traits = "0.2"
Expand Down
4 changes: 3 additions & 1 deletion storage-proofs/porep/src/stacked/vanilla/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,9 @@ impl<'a, Tree: 'static + MerkleTreeTrait, G: 'static + Hasher> StackedDrg<'a, Tr

// A default 'rows_to_discard' value will be chosen for tree_r_last, unless the user overrides this value via the
// environment setting (FIL_PROOFS_ROWS_TO_DISCARD). If this value is specified, no checking is done on it and it may
// result in a broken configuration. Use with caution.
// result in a broken configuration. Use with caution. It must be noted that if/when this unchecked value is passed
// through merkle_light, merkle_light now does a check that does not allow us to discard more rows than is possible
// to discard.
tree_r_last_config.rows_to_discard =
default_rows_to_discard(nodes_count, Tree::Arity::to_usize());
trace!(
Expand Down
2 changes: 1 addition & 1 deletion storage-proofs/post/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "README.md"
[dependencies]
storage-proofs-core = { path = "../core", version = "4.0.1" }
rand = "0.7"
merkletree = "0.20.0"
merkletree = "0.21.0"
byteorder = "1"
crossbeam = "0.7.3"
sha2 = { version = "0.8.3", package = "sha2ni" }
Expand Down
5 changes: 3 additions & 2 deletions storage-proofs/post/src/fallback/vanilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use storage_proofs_core::{
parameter_cache::ParameterSetMetadata,
proof::ProofScheme,
sector::*,
util::NODE_SIZE,
util::{default_rows_to_discard, NODE_SIZE},
};

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -311,6 +311,7 @@ impl<'a, Tree: 'a + MerkleTreeTrait> ProofScheme<'a> for FallbackPoSt<'a, Tree>
let tree = priv_sector.tree;
let sector_id = pub_sector.id;
let tree_leafs = tree.leafs();
let rows_to_discard = default_rows_to_discard(tree_leafs, Tree::Arity::to_usize());

trace!(
"Generating proof for tree leafs {} and arity {}",
Expand All @@ -331,7 +332,7 @@ impl<'a, Tree: 'a + MerkleTreeTrait> ProofScheme<'a> for FallbackPoSt<'a, Tree>
challenge_index,
)?;

tree.gen_cached_proof(challenged_leaf_start as usize, None)
tree.gen_cached_proof(challenged_leaf_start as usize, Some(rows_to_discard))
})
.collect::<Result<Vec<_>>>()?;

Expand Down

0 comments on commit 0ffa7d8

Please sign in to comment.