Skip to content
  • Alexander Theißen's avatar
    contracts: Lazy storage removal (#7740) · 3ba8fdfc
    Alexander Theißen authored
    * Do not evict a contract from within a call stack
    
    We don't want to trigger contract eviction automatically when
    a contract is called. This is because those changes can be
    reverted due to how storage transactions are used at the moment.
    More Information:
    https://github.com/paritytech/substrate/issues/6439#issuecomment-648754324
    
    It can be re-introduced once the linked issue is resolved. In the meantime
    `claim_surcharge` must be called to evict a contract.
    
    * Lazily delete storage in on_initialize instead of when removing the contract
    
    * Add missing documentation of new error
    
    * Make Module::claim_surcharge public
    
    It being the only dispatchable that is private is an oversight.
    
    * review: Add final newline
    
    * review: Simplify assert statement
    
    * Add test that checks that partial remove of a contract works
    
    * Premote warning to error
    
    * Added missing docs for seal_terminate
    
    * Lazy deletion should only take AVERAGE_ON_INITIALIZE_RATIO of the block
    
    * Added informational about the lazy deletion throughput
    
    * Avoid lazy deletion in case the block is already full
    
    * Prevent queue decoding in case of an already full block
    
    * Add test that checks that on_initialize honors block limits
    3ba8fdfc