You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
With O(1) child trie removal not happening anytime soon ( see discussion in #5280 ) we need to cope with the fact that contract removal takes linear time depending on how much storage a contract accumulated. This can be a problem because the removal can take longer than a single block and makes the chain subject to DoS because no-one is there to pay for the removal of an evicted contract.
For that reason we should move to a model where contracts are removed lazily. When the removal of a contract is decided through one of the various entry points (discussed later), we immediately remove the contract itself (ContractInfo) and schedule the actual storage removal to happen asynchronously possibly over multiple blocks. This operation is bounded and not DoSable because every storage item scheduled for removal is subject to rent payment making it expensive to accumulate huge amounts of storage.
The following entry points can trigger the removal of a contract and must transfer to an asynchronous model:
ext_terminate: Contract triggers the removal of an contract
claim_surchargedispatchable: Some external caller triggers the eviction of a contract that did not pay rent