-
Notifications
You must be signed in to change notification settings - Fork 87
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
Eugene audit 2021 05 11 #74
Merged
Merged
Conversation
This file contains 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
… eugene-audit-2021-05-11
Thanks @evgenykuzyakov for looking into this. |
@evgenykuzyakov Thanks for that! We are addressing your comments both for the current milestone as well as the roadmap going forward. |
artob
approved these changes
May 12, 2021
birchmd
reviewed
May 13, 2021
@@ -328,6 +330,8 @@ pub fn self_deploy(code_key: &[u8]) { | |||
// Remove code from storage and store it in register 1. | |||
exports::storage_remove(code_key.len() as _, code_key.as_ptr() as _, 1); | |||
exports::promise_batch_action_deploy_contract(promise_id, u64::MAX as _, 1); | |||
// TODO: Call upgrade on the same promise to make sure the state has migrated successfully. |
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.
@evgenykuzyakov I don't understand what you mean here. Could you elaborate further?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Something isn't working.
C-docs
Category: Improvements or additions to documentation
C-enhancement
Category: New feature or request
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've decided to comment inline.
Overall I didn't find anything major. I think the biggest issue is
remove_all_storage
. This is a protocol level decision that led to the removal of prefix deletion or iterations. The recent protocol change also restricted account deletion if the storage usage exceeds 10Kb (beyond the contract). This is done to prevent key iteration.Without an ability to remove old storage from the account may result in a storage draining in a longer run that is not covered by the protocol yet. I'd recommend addressing this issue asap, which may require a hardfork of existing addresses/contracts.
Potential implementation is: