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

Set trie mask bits directly in the sparse trie #12877

Open
shekhirin opened this issue Nov 26, 2024 · 6 comments · May be fixed by #13153
Open

Set trie mask bits directly in the sparse trie #12877

shekhirin opened this issue Nov 26, 2024 · 6 comments · May be fixed by #13153
Assignees
Labels
A-trie Related to Merkle Patricia Trie implementation C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@shekhirin
Copy link
Collaborator

shekhirin commented Nov 26, 2024

Describe the feature

// TODO(alexey): set the `TrieMask` bits directly
let mut tree_mask_values = Vec::new();
let mut hash_mask_values = Vec::new();
let mut tree_mask_values = tree_mask_values.into_iter().rev();
let mut hash_mask_values = hash_mask_values.into_iter().rev();
let mut tree_mask = TrieMask::default();
let mut hash_mask = TrieMask::default();
for (i, child) in branch_node_ref.children() {
if child.is_some() {
if hash_mask_values.next().unwrap() {
hash_mask.set_bit(i);
}
if tree_mask_values.next().unwrap() {
tree_mask.set_bit(i);
}
}
}

This will likely require changes to alloy-trie

Additional context

No response

@shekhirin shekhirin added A-trie Related to Merkle Patricia Trie implementation C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started labels Nov 26, 2024
@htiennv
Copy link
Contributor

htiennv commented Nov 26, 2024

Hi @shekhirin, i would like to take this issue. Thanks!

@shekhirin
Copy link
Collaborator Author

@htiennv assigned, let me know if you need any pointers or have questions!

@htiennv
Copy link
Contributor

htiennv commented Nov 26, 2024

thanks @shekhirin

@shekhirin
Copy link
Collaborator Author

hey @htiennv, any progress on this?

@mimisavage
Copy link

Can I be assigned to this?

@htiennv
Copy link
Contributor

htiennv commented Dec 5, 2024

Hi @shekhirin, Sorry, i'm not active online for the past few days. I'll make a PR for it

@shekhirin shekhirin assigned mimisavage and htiennv and unassigned htiennv and mimisavage Dec 5, 2024
@htiennv htiennv linked a pull request Dec 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants