-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Access] Add check if tx payer has sufficient amount of flow to pay fee #6004
[Access] Add check if tx payer has sufficient amount of flow to pay fee #6004
Conversation
According to #5823
Do you know if we still need to check it? We don't use script executor |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6004 +/- ##
==========================================
+ Coverage 41.48% 41.52% +0.03%
==========================================
Files 1978 1980 +2
Lines 140843 140986 +143
==========================================
+ Hits 58433 58546 +113
- Misses 76335 76337 +2
- Partials 6075 6103 +28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d6db45d
to
19d3d0d
Compare
* Removed code that extended VM interface. * Made use of `GenerateVerifyPayerBalanceForTxExecution` to create a script which will be executed to figure out if payer has sufficient balance
5efdd5f
to
b72cbb8
Compare
How to test it manually:
The transaction should fail due to the storage limit check but the fees will be taken anyway thus the account balance will become insufficient.
You should see an error that Alice doesn't have sufficient balance to pay for tx.
You should see no errors. The transaction should be executed successfully. |
@peterargue Access node's tx validator uses this script to see if balance is sufficient for tx. @janezpodhostnik what do you suggest doing in such a case? Is there some cadence code for me to include storage limit check in tx validator's script? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a couple last comments. sorry for the confusion on the get balance part. after that this should be ready to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'll approve when the emulator and core contracts are updated.
@illia-malachyn to get this PR ready to merge please:
|
Looks good. please fix the conflicts again, and we merge tomorrow |
Add an invocation of system contract to check if tx payer has enough balance to pay for tx
core contracts PR: onflow/flow-core-contracts#435
emulator PR: onflow/flow-emulator#699