fix: ensure transactions succeed when balance check is disabled#2286
Merged
rakita merged 1 commit intobluealloy:mainfrom Mar 25, 2025
Merged
fix: ensure transactions succeed when balance check is disabled#2286rakita merged 1 commit intobluealloy:mainfrom
rakita merged 1 commit intobluealloy:mainfrom
Conversation
This was referenced Mar 21, 2025
CodSpeed Performance ReportMerging #2286 will not alter performanceComparing Summary
|
rakita
reviewed
Mar 24, 2025
crates/handler/src/validation.rs
Outdated
| balance: Box::new(account.balance), | ||
| }); | ||
| if balance_check > account.balance { | ||
| if context.cfg().is_balance_check_disabled() { |
Member
There was a problem hiding this comment.
Previous code did remove balance check, but it would in deduct_caller reduce it to zero, is there a need for the balance to remain unchanged?
Contributor
Author
There was a problem hiding this comment.
The current implementation causes an OutOfFunds when deducting the balance, in later execution calls.
I can try to find all missed checks there?
Member
There was a problem hiding this comment.
hm it is about value that is sent.
Member
There was a problem hiding this comment.
Lets introduce a logic inside deduc_caller that would leave at least value amount of balance if cfg is enabled
a72d2d1 to
885b273
Compare
This was referenced Mar 25, 2025
Closed
Closed
Closed
Closed
Closed
Closed
Merged
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.
I discovered that code for the "disable balance check" feature was removed in the previous refactors, here.
This PR fixes the functionality.
[edit] I moved this to a draft as I need to validate a failing test on the Hardhat side