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

fix: change default rows_to_discard for oct trees #1165

Merged
merged 3 commits into from
Jun 15, 2020

Conversation

cryptonemo
Copy link
Collaborator

feat: move default value from merkle_light to internal

@cryptonemo
Copy link
Collaborator Author

An alternative to filecoin-project/merkletree#88, giving this library fuller control over the values going forward.

porcuquine
porcuquine previously approved these changes Jun 15, 2020
Copy link
Collaborator

@porcuquine porcuquine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am approving to expedite a release, but please see comments in case they help shape future direction (or should be considered now, at your discretion).

@@ -21,7 +21,7 @@ pub struct Settings {
pub column_write_batch_size: u32,
pub use_gpu_tree_builder: bool,
pub max_gpu_tree_batch_size: u32,
pub rows_to_discard: u32,
pub oct_rows_to_discard: u32,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to expose the arity here, since we use oct everywhere we discard tree rows.

2 => std::cmp::min(max_rows_to_discard, 7),
4 => std::cmp::min(max_rows_to_discard, 5),
_ => std::cmp::min(max_rows_to_discard, rows_to_discard),
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Along with a single rows_to_discard default, we could probably get rid of this match — unless it simplifies testing.

// environment setting (FIL_PROOFS_ROWS_TO_DISCARD). If this
// value is specified, no checking is done on it and it may
// 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_OCT_ROWS_TO_DISCARD). If this value is specified, no checking is done on it and it may
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still not clear to me whether this is converging on what I think the right answer should be:

  • If nothing is specified by 'settings', default to discarding zero rows.
  • If a setting is specified by the user (env var or config file), use that.
  • If nothing is specified by the user, use a default hard-coded in settings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't address the first case at all, as something is always specified by the settings (either the default value, or a user provided value). The last 2 cases should be satisfied.

@cryptonemo cryptonemo merged commit d0c84ef into master Jun 15, 2020
@cryptonemo cryptonemo deleted the improve-rows-to-discard branch June 15, 2020 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants