feat: Propagate map-foldhash Feature Through Dependency Chain#3252
Merged
rakita merged 2 commits intobluealloy:mainfrom Dec 24, 2025
Merged
feat: Propagate map-foldhash Feature Through Dependency Chain#3252rakita merged 2 commits intobluealloy:mainfrom
map-foldhash Feature Through Dependency Chain#3252rakita merged 2 commits intobluealloy:mainfrom
Conversation
CodSpeed Performance ReportMerging #3252 will improve performance by 21.91%Comparing Summary
Benchmarks breakdown
|
2184120 to
efc55d6
Compare
Contributor
Author
Benchmark tests resultsCommands# Without map-foldhash feature
cargo bench -p revme --no-fail-fast
# With map-foldhash feature
cargo bench -p revme --features map-foldhash --no-fail-fastFull Benchmark ResultsBenchmark legend:
Without map-foldhash:With map-foldhash: |
rakita
reviewed
Dec 24, 2025
| @@ -43,6 +43,7 @@ csv = "1.1.6" | |||
| [features] | |||
| # Optionally enable gmp because it doesn't work on i686 github actions runners | |||
Member
There was a problem hiding this comment.
Make map-foldhash be default default = ["map-foldhash"]
rakita
approved these changes
Dec 24, 2025
Member
rakita
left a comment
There was a problem hiding this comment.
One nit, but lgtm
In future, try to tell AI to do a summary of all the text in the original PR text, it writes much info.
Benchmark comment, for example, was good and easy to read.
Contributor
Author
|
@rakita Applied your review. Got it. |
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
#3246
This PR completes the
map-foldhashfeature propagation across the revm workspace, enabling users to leverage the faster foldhash algorithm for HashMap operations throughout the entire dependency chain, including therevmebinary andstatetest-typescrate.Problem
The
map-foldhashfeature enables the foldhash algorithm (viaalloy-primitives/map-foldhash) for improved HashMap performance. Previously, this feature was only partially implemented:revm-primitivesandrevmcratesrevm-state,revm-database,revm-context,statetest-types, andrevmeThis incomplete propagation caused the following issues:
Users couldn't enable
map-foldhashwhen buildingrevme:cargo build -p revme --features map-foldhash # error: the package 'revme' does not contain this feature: map-foldhashThe feature didn't propagate through the
statetest-typesdependency chain, limiting its effectiveness when running Ethereum state tests.Intermediate crates (
state,database,context) couldn't forward the feature to their dependencies, breaking the feature propagation chain.Broken Feature Chain (Before)
Solution
Added
map-foldhashfeature definitions to all crates in the dependency chain.Validation Commands
All of the following commands should succeed after this change:
Notes
statetest-types?/map-foldhash) to handle conditional dependencies correctly (crates/revm/Cargo.toml)no_stdcompatibility (feature only affects HashMap implementation, not allocator requirements)