fix(runtime): action_delete_account subtracts global id storage#15752
Conversation
…thub.com:vaporif/nearcore into action_delete_account-subtract-global-id-storage
| let account_storage_usage = if ProtocolFeature::FixDeleteAccountGlobalContractStorageUsage | ||
| .enabled(current_protocol_version) | ||
| { | ||
| clear_account_contract_storage_usage( |
There was a problem hiding this comment.
I've looked into this a bit more and found another issue: clear_account_contract_storage_usage modifies account internally and then on the error path we are going to leave it in a dirty state. This might not be an issues right now, but could be in the future. Could you please update the code here to avoid mutating the account? I suggest splitting out get_contract_storage_usage out of clear_account_contract_storage_usage and using the return value of that instead of account_mut.storage_usage()
There was a problem hiding this comment.
fixed, added test covering this just in case
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15752 +/- ##
========================================
Coverage 69.83% 69.84%
========================================
Files 940 940
Lines 199100 199236 +136
Branches 199100 199236 +136
========================================
+ Hits 139038 139152 +114
- Misses 55413 55433 +20
- Partials 4649 4651 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pugachAG
left a comment
There was a problem hiding this comment.
LGTM, thanks for your contribution to nearcore!
please address the last nit and then I will merge this
|
@pugachAG done |
Fixes #15431
The check gates whether a
DeleteAccountsucceeds, so the change is consensus-visible and is gated behind a new nightly protocol featureFixDeleteAccountGlobalContractStorageUsage(v154)