fix(examples): use real keccak256 for StorageWritten event topic - #3876
Open
cuiweixie wants to merge 5 commits into
Open
fix(examples): use real keccak256 for StorageWritten event topic#3876cuiweixie wants to merge 5 commits into
cuiweixie wants to merge 5 commits into
Conversation
The custom precompile journal example used a placeholder byte array for topic0 while documenting keccak256("StorageWritten(address,uint256)"). Emit the real signature hash and assert it in the log regression test.
Merging this PR will degrade performance by 3.12%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | ecrecover precompile |
392.1 µs | 404.8 µs | -3.12% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cuiweixie:fix/example-storage-written-event-topic (8611359) with main (8ca4052)
Footnotes
-
9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Format the keccak256 import in the custom precompile example. Also switch Stack::push_slice_ to slice.as_chunks::<32>() so clippy on rustc 1.98 (-Dwarnings) passes.
Stable 1.98 clippy denies chunks_exact_to_as_chunks under -Dwarnings. Update the remaining call sites in interpreter and precompile so CI clippy passes.
Last chunks_exact_to_as_chunks hit under cargo clippy --all-targets.
cuiweixie
force-pushed
the
fix/example-storage-written-event-topic
branch
from
August 27, 2026 23:36
def9253 to
072f1bb
Compare
Resolve as_chunks conflicts in BLS MSM precompiles by keeping main's style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
topic0bytes in the custom precompile journal example withkeccak256(b"StorageWritten(address,uint256)").Test plan
cargo nextest run -p example-custom-precompile-journal --libcargo clippy --workspace --all-targets --all-features