Use DBImpl for giga mock balance validation#3750
Draft
codchen wants to merge 1 commit into
Draft
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3750 +/- ##
==========================================
- Coverage 59.91% 59.00% -0.92%
==========================================
Files 2288 2201 -87
Lines 189782 179957 -9825
==========================================
- Hits 113706 106176 -7530
+ Misses 65942 64448 -1494
+ Partials 10134 9333 -801
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Routes giga executor balance validation through the giga EVM
DBImplsomock_balancesbuilds can top off accounts through the existingensureSufficientBalancehook before validation rejects the tx.Root Cause
validateGigaEVMTxwas checking balances withGigaEvmKeeper.GetBalance, bypassingDBImpl. The actual debit path already usedDBImpl, so mock balance support worked for execution but not for manual validation prechecks.Changes
DBImplbefore validation and pass it intovalidateGigaEVMTx.DBImpl.EnsureSufficientBalancewrapper for validation-time affordability checks.GetBalanceduring validation, including the unassociated-address balance case.mock_balancesregression test covering a large unfunded giga transfer.Validation
go test ./giga/deps/xevm/state -run TestSubBalance -count=1go test ./giga/tests -run TestGigaValidation_InsufficientBalance -count=1go test -tags mock_balances ./giga/tests -run TestGigaMockBalancesValidationUsesDBImpl -count=1