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

Move trie functions to alloy #11211

Closed
Tracked by #12576
mattsse opened this issue Sep 25, 2024 · 4 comments · Fixed by #12438
Closed
Tracked by #12576

Move trie functions to alloy #11211

mattsse opened this issue Sep 25, 2024 · 4 comments · Fixed by #12438
Assignees
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Sep 25, 2024

Describe the feature

ref #11208

these are beneficial and can be used for things like txroot withdrawals root, etc:

/// Compute a trie root of the collection of rlp encodable items.
pub fn ordered_trie_root<T: Encodable>(items: &[T]) -> B256 {
ordered_trie_root_with_encoder(items, |item, buf| item.encode(buf))
}
/// Compute a trie root of the collection of items with a custom encoder.
pub fn ordered_trie_root_with_encoder<T, F>(items: &[T], mut encode: F) -> B256
where
F: FnMut(&T, &mut Vec<u8>),
{

imo we can move these to alloy-trie or somewhere else @DaniPopes ?

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Sep 25, 2024
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started and removed S-needs-triage This issue needs to be labelled labels Sep 25, 2024
@c0np4nn4
Copy link
Contributor

Hello @mattsse, Can I take this one?

@DaniPopes
Copy link
Member

Why not in alloy-trie?

@mattsse
Copy link
Collaborator Author

mattsse commented Sep 26, 2024

right, lets do alloy-trie @c0np4nn4

@c0np4nn4
Copy link
Contributor

c0np4nn4 commented Oct 9, 2024

@mattsse
I made a PR at alloy-trie, #53.
Please check it out and let me know if there are any corrections needed, and I'll address them ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants