From 85b59acfb7e822895ca5cc7b994a992640656ee4 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 22 Nov 2024 09:47:37 -0700 Subject: [PATCH] Revert "Deeper tracing of self-destructed accounts (#7284)" This reverts commit 264e7d9facffe1c881d6de090ad99e807f4d836b. --- .../evm/worldstate/UpdateTrackingAccount.java | 1 + .../besu/evm/worldstate/WorldUpdater.java | 27 ++----------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java index 9f065aee98b..f571ff2ff03 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java @@ -128,6 +128,7 @@ public A getWrappedAccount() { public void setWrappedAccount(final A account) { if (this.account == null) { this.account = account; + storageWasCleared = false; } else { throw new IllegalStateException("Already tracking a wrapped account"); } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/WorldUpdater.java b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/WorldUpdater.java index 4cbda732798..9b57b6ab9e3 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/WorldUpdater.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/WorldUpdater.java @@ -24,8 +24,6 @@ import java.util.Collection; import java.util.Optional; -import org.apache.tuweni.bytes.Bytes; - /** * An object that buffers updates made over a particular {@link WorldView}. * @@ -75,29 +73,8 @@ default MutableAccount createAccount(final Address address) { * #createAccount(Address)} (and thus all his fields will be zero/empty). */ default MutableAccount getOrCreate(final Address address) { - MutableAccount account = getAccount(address); - if (account == null) { - account = createAccount(address); - if (parentUpdater().isPresent() && parentUpdater().get().isDeleted(address)) { - account.clearStorage(); - account.setCode(Bytes.EMPTY); - } - } - return account; - } - - /** - * Check this and parent updaters to see if an address has been deleted since the last persist - * - * @param address address to check - * @return true if any updaters have marked the address as deleted. - */ - default boolean isDeleted(final Address address) { - if (getDeletedAccountAddresses().contains(address)) { - return true; - } else { - return parentUpdater().map(wu -> wu.isDeleted(address)).orElse(false); - } + final MutableAccount account = getAccount(address); + return account == null ? createAccount(address) : account; } /**