-
Notifications
You must be signed in to change notification settings - Fork 992
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
Gas accounting for fee unshielding #2619
Conversation
vp_wasm_cache, | ||
tx_wasm_cache, | ||
), | ||
if namada::ledger::protocol::run_fee_unshielding( |
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.
I'm now using for mempool_validate
, prepare_proposal
and process_proposal
the same function used in finalize_block
. The logic though is a bit different: in the first three cases, if the fee unshielding operation fails, for any reason, the transaction is deemed invalid (won't make it into the block). In finalize_block
, instead, if the fee unshielding fails we still try to get the fee payment from the transparent address of the fee payer: if the funds are not enough we take what we can and reject the tx (won't get executed) otherwise, at least for now, the transaction can go ahead.
It has to be noted that this scenario in finalize_block
should never happen, the check in process_proposal
should prevent such a transaction from being included into the block. We still need to handle this case in case there was a bug and a transaction of this kind could indeed be included. We could also choose, for this case, to still try to get the payment from the transparent address but reject the transaction even if the payment was successful.
aeae08f
to
6936090
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2619 +/- ##
==========================================
- Coverage 59.39% 59.37% -0.02%
==========================================
Files 298 298
Lines 92771 92785 +14
==========================================
- Hits 55104 55095 -9
- Misses 37667 37690 +23 ☔ View full report in Codecov by Sentry. |
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 to me. Thanks!
* grarco/gas-for-fee-unshielding: Propagates gas error in fee unshielding. Updates integration test Updates gas meter method to account for the overflow flag Fixes out of gas masp integration test Clippy + fmt Changelog #2619 Share more code for fee unshielding validation Minor refactor Updates gas meter when verifying fee unshielding Adds integration test for fee unshielding gas Fee unshielding gas check in validation Charges gas for fee unshielding in `finalize_block`
* grarco/gas-for-fee-unshielding: Propagates gas error in fee unshielding. Updates integration test Updates gas meter method to account for the overflow flag Fixes out of gas masp integration test Clippy + fmt Changelog #2619 Share more code for fee unshielding validation Minor refactor Updates gas meter when verifying fee unshielding Adds integration test for fee unshielding gas Fee unshielding gas check in validation Charges gas for fee unshielding in `finalize_block`
Describe your changes
Closes #2592.
Modifies the protocol logic to charge the gas consumed by the fee unshielding operation, which therefore will pay fees. The gas is charged to the
GasLimit
declared by the transaction.Adds an integration test to verify that a fee unshielding operation can run out of gas.
Indicate on which release or other PRs this topic is based on
v0.33.0
Checklist before merging to
draft