-
Notifications
You must be signed in to change notification settings - Fork 130
perf(l1): use our keccak implementation for receipt blooms #5454
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
Conversation
Lines of code reportTotal lines added: Detailed view |
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.
Pull request overview
This PR optimizes receipt bloom computation by switching from tiny_keccak (used internally by BloomInput::Raw) to the codebase's custom keccak implementation. The changes also include preallocation optimization for receipt encoding and improved variable naming.
Key Changes
- Switched bloom filter computation to use custom
keccak_hashfunction withBloomInput::Hashinstead ofBloomInput::Raw - Added preallocation (512 bytes) to
encode_inner_with_bloomto reduce allocations - Improved variable naming from
encode_bufftoencode_buf - Added comprehensive test to verify bloom computation correctness
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Benchmark Block Execution Results Comparison Against Main
|
Motivation
Receipts computation is ~3% of block execution. It's not much, but it should be easy to optimize, since we didn't touch it much.
Description
This PR changes the receipt bloom computation to use our keccak implementation (before it was using
tiny_keccakinsideBloom::accrue). It also adds some preallocation to the receipt encoding, which should account for the smallest transactions, at least.