Skip to content

Commit

Permalink
Existing Hedera semantics for SELFDESTRUCT will be preserved
Browse files Browse the repository at this point in the history
Update to specify that existing Hedera semantics for SELFDESTRUCT will be
preserved in some cases where they involve the Hedera security model. And
this leads to known EVM non-equivalence.  (Which already exists.)

Signed-off-by: David S Bakin <117694041+david-bakin-sl@users.noreply.github.com>
  • Loading branch information
david-bakin-sl committed Feb 20, 2024
1 parent ae09dc4 commit 92c3ce1
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions HIP/hip-868.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ contract will not be marked for removal.

### Hedera Services

Hedera services may need to be changed to ensure that the transaction processing
does not leave a "shadow" account number for transient self-destructs. Such
transient self-destructs will also need to be tested to ensure all HTS tokens
are properly swept during the sweep as well as the transient contract modes.
This HIP addresses only EVM changes with respect to self-destruct, and thus,
only involves changes to the case where a SELFDESTRUCT is done as a sweep
(the contract being destructed existed prior to the transaction in which it is
destructed). When it is a transient self-destruct no changes to existing
Hedera behavior will be made.

* For a transient self-destruct the record file will record the EVM address
of the contract and not any Hedera contract id.

## Backwards Compatibility

Expand Down Expand Up @@ -142,7 +146,15 @@ out-of-date features within Hedera.

## Open Issues

// NONE
There will be EVM non-equivalences where self-destructed contracts hold HTS tokens
and/or use Hedera system contracts, especially in the transient case (where the HTS
tokens are transferred to the contract in the same transaction as it has been
self-destructed), where the Hedera security model interacts with the sweeping of
tokens and balances. For example, if, the beneficiary account doesn't have an
allowance for a token held by the contract. In this case (and similar situations)
the SELFDESTRUCT will fail, where in the EVM it never fails. These non-equivalences
already exist and will not be resolved by this HIP (but can be reconsidered in
the future.)

## References

Expand All @@ -152,4 +164,4 @@ out-of-date features within Hedera.
## Copyright/license

This document is licensed under the Apache License, Version 2.0 --
see [LICENSE](../LICENSE) or (https://www.apache.org/licenses/LICENSE-2.0)
see [LICENSE](../LICENSE) or (https://www.apache.org/licenses/LICENSE-2.0)

0 comments on commit 92c3ce1

Please sign in to comment.