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

refactor: make configuration more obvious #1716

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
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
16 changes: 6 additions & 10 deletions storage-proofs-porep/src/stacked/vanilla/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1930,16 +1930,12 @@ impl<'a, Tree: 'static + MerkleTreeTrait, G: 'static + Hasher> StackedDrg<'a, Tr
let tree_count = get_base_tree_count::<Tree>();
let nodes_count = leaf_count / tree_count;

let config = StoreConfig::new(
cache_path.as_ref(),
CacheKey::CommRLastTree.to_string(),
default_rows_to_discard(nodes_count, Tree::Arity::to_usize()),
);
let tree_r_last_config = StoreConfig::from_config(
&config,
CacheKey::CommRLastTree.to_string(),
Some(get_merkle_tree_len(nodes_count, Tree::Arity::to_usize())?),
);
let tree_r_last_config = StoreConfig {
path: cache_path.as_ref().into(),
id: CacheKey::CommRLastTree.to_string(),
size: Some(get_merkle_tree_len(nodes_count, Tree::Arity::to_usize())?),
rows_to_discard: default_rows_to_discard(nodes_count, Tree::Arity::to_usize()),
};

// Encode original data into the last layer.
info!("building tree_r_last");
Expand Down