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

Implement direct RLP hashing #698

Open
arnetheduck opened this issue Jun 11, 2024 · 0 comments
Open

Implement direct RLP hashing #698

arnetheduck opened this issue Jun 11, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers rlp

Comments

@arnetheduck
Copy link
Member

Hashing of RLP is critical for execution client performance and will become even more important when we start using more efficient encodings than RLP in the client.

Currently, to compute the hash of an RLP-encoded item we first serialize the data to a seq[byte] then perform the hashing. This creates a short-lived memory allocation for every hash we compute which is unfortunate and unnecessary.

Instead, we should create a new RlpHashWriter type that keeps a hashing context open and constructs the hash on the fly without writing the bytes to a seq first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers rlp
Projects
None yet
Development

No branches or pull requests

1 participant