Skip to content

Conversation

@zjb0807
Copy link
Contributor

@zjb0807 zjb0807 commented Nov 3, 2021

Closes: #612 #1459

@zjb0807 zjb0807 requested a review from xlc November 4, 2021 05:43
@zjb0807 zjb0807 marked this pull request as ready for review November 4, 2021 05:43
Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now delete contract is not atomic action. is it possible to create a contract with same address of a deleting one? I think that's possible and we need to make sure that action will fail, instead of overriding storages.

@ermalkaleci
Copy link
Contributor

we need to make sure it's not possible to deploy at the same address until everything is wiped out

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 4, 2021

we need to make sure it's not possible to deploy at the same address until everything is wiped out

if !self.state.storage_size(address).is_zero() {
let _ = self.exit_substate(StackExitKind::Failed);
return Capture::Exit((ExitError::CreateCollision.into(), None, Vec::new()));
}

I checked the storage_size and remove it at

ContractStorageSizes::<T>::take(contract);

I'll add a test case.

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 4, 2021

In order to avoid adding extra storage_size, delay deleting account to check the same address deployment problem

@zjb0807 zjb0807 requested review from ermalkaleci and xlc November 4, 2021 15:17
@zjb0807 zjb0807 merged commit 76dc027 into master Nov 6, 2021
@zjb0807 zjb0807 deleted the idle-evm-remove branch November 6, 2021 07:46
syan095 pushed a commit that referenced this pull request Nov 8, 2021
* origin/master:
  Feature/homa lite periodic update (#1538)
  Fix/repatriate emit event (#1586)
  Update Dex Benchmaking (#1588)
  clear unused modules dependencies and rpc for runtimes (#1593)
  Idle schedule evm task (#1583)
  update acala genesis
  update devcontainer Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EVM: Lazy contract removal

4 participants