fix: bal binary search cases#3139
Merged
rakita merged 3 commits intobluealloy:rakita/balfrom Nov 3, 2025
Merged
Conversation
CodSpeed Performance ReportMerging #3139 will improve performances by 3.42%Comparing Summary
Benchmarks breakdown
Footnotes |
rakita
approved these changes
Nov 3, 2025
Member
rakita
left a comment
There was a problem hiding this comment.
lgtm, good bug found.
Have slighlty simplified the code
rakita
added a commit
that referenced
this pull request
Dec 18, 2025
* BAL * WIP * bal wip * bal followup * Database::bal and Bal IndexMap for accounts * bal builder and integration with databases * chore: bump eest tests v5.3.0 * bump bal for caller/beneficiary * bal builder from state on commit, alloy included * cleanup * bal integration in btests * wip sys call * fix few bugs, propagate error * remove bal panic from btest * error handling * cleanup bal tests * skip touching beneficiary if reward is 0 * handle local selfdestruct * feat: dont load access list immediatly * nits fmt * bump output as accounts now have original account info * BalDatabase * nit, rm clone * bump tests, add missing imports, cleanup * reause indexmap from alloy with default hasher * typos * add missing serde propagation * dont skip test * Create BalState and add it inside State so that we dont need to use BalDatabase * nits, and deserialization for Account without original info * propagate feature * fix: add bal_builder.commit to state, small cleanup * fix: bal binary search cases (#3139) * fix: bal binary search cases * nit(test): generalize BAL binary search test for any threshold * code cleanup --------- Co-authored-by: rakita <dragan0rakita@gmail.com> * compile tests * Rename BalDatabaseError to EvmDatabaseError * throw error if bal exist but account/storage not * rename storage_id to account_id * rm println * use alloy main, clippy/typo fixes * ark the bytecode * typo * add statis default for Bytecode * use oncelock * try with oncelock * box original acc info
theochap
pushed a commit
to ethereum-optimism/optimism
that referenced
this pull request
Jan 21, 2026
* BAL * WIP * bal wip * bal followup * Database::bal and Bal IndexMap for accounts * bal builder and integration with databases * chore: bump eest tests v5.3.0 * bump bal for caller/beneficiary * bal builder from state on commit, alloy included * cleanup * bal integration in btests * wip sys call * fix few bugs, propagate error * remove bal panic from btest * error handling * cleanup bal tests * skip touching beneficiary if reward is 0 * handle local selfdestruct * feat: dont load access list immediatly * nits fmt * bump output as accounts now have original account info * BalDatabase * nit, rm clone * bump tests, add missing imports, cleanup * reause indexmap from alloy with default hasher * typos * add missing serde propagation * dont skip test * Create BalState and add it inside State so that we dont need to use BalDatabase * nits, and deserialization for Account without original info * propagate feature * fix: add bal_builder.commit to state, small cleanup * fix: bal binary search cases (bluealloy/revm#3139) * fix: bal binary search cases * nit(test): generalize BAL binary search test for any threshold * code cleanup --------- Co-authored-by: rakita <dragan0rakita@gmail.com> * compile tests * Rename BalDatabaseError to EvmDatabaseError * throw error if bal exist but account/storage not * rename storage_id to account_id * rm println * use alloy main, clippy/typo fixes * ark the bytecode * typo * add statis default for Bytecode * use oncelock * try with oncelock * box original acc info
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.
This PR fixes a bug in the BAL lookup method, where the binary search logic could return incorrect results in certain edge cases.
bal_indexdoes not exist in the write list correctly.