seal: Fail instantiate if new contract is below subsistence threshold (#6719)

* seal: Fail instantiate if new contract is below subsistence threshold

We need each contract that exists to be above the subsistence threshold
in order to keep up the guarantuee that we always leave a tombstone behind
with the exception of a contract that called `ext_terminate`.

* Fixup executor test

* Bump runtime
This commit is contained in:
Alexander Theißen
2020-07-27 11:45:00 +02:00
committed by GitHub
parent 63bd1d8346
commit bead1becf0
6 changed files with 23 additions and 15 deletions
@@ -617,10 +617,12 @@ define_env!(Env, <E: Ext>,
// This function creates an account and executes the constructor defined in the code specified
// by the code hash. The address of this new account is copied to `address_ptr` and its length
// to `address_len_ptr`. The constructors output buffer is copied to `output_ptr` and its
// length to `output_len_ptr`.
// length to `output_len_ptr`. The copy of the output buffer and address can be skipped by
// supplying the sentinel value of `u32::max_value()` to `output_ptr` or `address_ptr`.
//
// The copy of the output buffer and address can be skipped by supplying the sentinel value
// of `u32::max_value()` to `output_ptr` or `address_ptr`.
// After running the constructor it is verfied that the contract account holds at
// least the subsistence threshold. If that is not the case the instantion fails and
// the contract is not created.
//
// # Parameters
//