Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Initial support for asynchronous suiciding #1212

Merged
merged 9 commits into from
Oct 5, 2023
Merged

Conversation

sorpaas
Copy link
Member

@sorpaas sorpaas commented Oct 1, 2023

Add initial support for async suiciding. We might also want to add a governance dispatchable in the future so that storages can be cleared, if needed.

sorpaas and others added 2 commits October 2, 2023 01:21
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
@crystalin
Copy link
Collaborator

crystalin commented Oct 2, 2023

I think an additional extrinsic like hotfix_suicied_contract_storages could be implement with this logic:

- For each provided address 
  - if contract is empty delete up to 1000 storage items associated total (not per contract address)
  - If more than 1 sotrage item has been deleted, refund the cost for that address

@librelois
Copy link
Contributor

@sorpaas can you also add a check to prevent to redeploy a contract if the contract address is suicided?

I think an additional extrinsic like hotfix_suicied_contract_storages could be implement with this logic:

That can be part of another PR (I can work on it). Note that we can also implement this extrinsic directly on moonbeam.

@sorpaas sorpaas merged commit aea5281 into master Oct 5, 2023
@sorpaas sorpaas deleted the sp-async-suicide branch October 5, 2023 08:19
boundless-forest pushed a commit to darwinia-network/frontier that referenced this pull request Oct 7, 2023
* Initial support for asynchronous suiciding

* Use contains_key instead of is_some

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* Fix compile

* Remove unnecessary Suicided check

* Don't call dec_sufficients

* Handle pre-EIP161 case

* Add extra safeguard

* Always inc nonce

* Fix tests

---------

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
koushiro pushed a commit to alt-research/frontier that referenced this pull request Oct 13, 2023
* Initial support for asynchronous suiciding

* Use contains_key instead of is_some

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* Fix compile

* Remove unnecessary Suicided check

* Don't call dec_sufficients

* Handle pre-EIP161 case

* Add extra safeguard

* Always inc nonce

* Fix tests

---------

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
ahmadkaouk pushed a commit to moonbeam-foundation/frontier that referenced this pull request Nov 2, 2023
* Initial support for asynchronous suiciding

* Use contains_key instead of is_some

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* Fix compile

* Remove unnecessary Suicided check

* Don't call dec_sufficients

* Handle pre-EIP161 case

* Add extra safeguard

* Always inc nonce

* Fix tests

---------

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
boundless-forest pushed a commit to darwinia-network/frontier that referenced this pull request Nov 8, 2023
* Initial support for asynchronous suiciding

* Use contains_key instead of is_some

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* Fix compile

* Remove unnecessary Suicided check

* Don't call dec_sufficients

* Handle pre-EIP161 case

* Add extra safeguard

* Always inc nonce

* Fix tests

---------

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
sorpaas added a commit that referenced this pull request Nov 9, 2023
* Initial support for asynchronous suiciding

* Use contains_key instead of is_some



* Fix compile

* Remove unnecessary Suicided check

* Don't call dec_sufficients

* Handle pre-EIP161 case

* Add extra safeguard

* Always inc nonce

* Fix tests

---------

Co-authored-by: Wei Tang <wei@pacna.org>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants