feat: DatabaseCommitExt + increment_balances#3195
Merged
rakita merged 3 commits intobluealloy:mainfrom Dec 3, 2025
Merged
Conversation
0xForerunner
commented
Nov 27, 2025
0xForerunner
commented
Nov 27, 2025
CodSpeed Performance ReportMerging #3195 will not alter performanceComparing Summary
|
Merged
3 tasks
Collaborator
|
ref alloy-rs/evm#234 |
3 tasks
rakita
reviewed
Dec 2, 2025
crates/database/interface/src/lib.rs
Outdated
| let mut transitions: HashMap<Address, Account> = HashMap::default(); | ||
| transitions.reserve(balances.size_hint().0); | ||
| for (address, balance) in balances { | ||
| if balance == 0 { |
Member
There was a problem hiding this comment.
It would be good to skip this condition, there is assumption (that maybe can not relevant in this case, but it is true to internal evm) that even if balance is zero the account will get touched and read (in case of bal added to reads).
This is just to align that logic.
Contributor
Author
There was a problem hiding this comment.
Gotcha, so just to be clear, I should remove if balance == 0?
Contributor
Author
|
Should be good to go! |
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.
closes #3194
It would be nice for some utility functions like State::increment_balances to be implemented for all types that are DatabaseCommit.
Happy to add some more
Statemethods into this trait as well once I've gotten some initial feedback.