-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 some more typos #7750
base: RC_2_0
Are you sure you want to change the base?
Fix some more typos #7750
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,9 +58,9 @@ std::vector<sha256_hash> g_tree; | |
int const piece_size = 1024 * 1024; | ||
int const blocks_per_piece = piece_size / lt::default_block_size; | ||
int const num_pieces = 10; | ||
int const num_leafs = merkle_num_leafs(num_pieces * blocks_per_piece); | ||
int const num_nodes = merkle_num_nodes(num_leafs); | ||
int const first_leaf = merkle_first_leaf(num_leafs); | ||
int const num_leaves = merkle_num_leaves(num_pieces * blocks_per_piece); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about this change. "leaf" is a term of art in computer science. Perhaps mostly used as adjective to describe the leaf nodes. I hesitate to call them "leaves" as that implies actual leaves on actual trees (not the computer science data structure "tree"). They are currently (as far as I know) consistently referred to as "leafs". I kind of see the "node" as implied in that name. Perhaps this is a controversial perspective. I would rather rename these "leaf_nodes" over "leaves". But I also think the current acronym is quite reasonable. I think the change is controversial mostly because it's already internally consistent, and a rename would have to make sure it's consistently renamed everywhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. so some decision has to be made then. do you think "leaves" is preferred over "lefs"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think changing to "leaves" would be ok, but it's up to you really. https://en.wikipedia.org/wiki/Merkle_tree#Overview
|
||
int const num_nodes = merkle_num_nodes(num_leaves); | ||
int const first_leaf = merkle_first_leaf(num_leaves); | ||
|
||
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) | ||
{ | ||
|
@@ -113,7 +113,7 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) | |
t.set_hash2(file_index_t{0}, piece_index_t::diff_type(i), r); | ||
} | ||
|
||
merkle_fill_tree(g_tree, num_leafs); | ||
merkle_fill_tree(g_tree, num_leaves); | ||
|
||
std::vector<char> buf; | ||
bencode(std::back_inserter(buf), t.generate()); | ||
|
@@ -159,7 +159,7 @@ lt::add_torrent_params generate_atp(std::uint8_t const* data, size_t size) | |
ret.merkle_trees.resize(1); | ||
ret.merkle_tree_mask.resize(1); | ||
ret.verified_leaf_hashes.resize(1); | ||
ret.verified_leaf_hashes[0].resize(num_leafs, true); | ||
ret.verified_leaf_hashes[0].resize(num_leaves, true); | ||
|
||
auto& t = ret.merkle_trees[0]; | ||
auto& mask = ret.merkle_tree_mask[0]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
fing
is supposed to refer to "fingerprint"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will exclude....(another thing to be added to exclusion list from my other PR)