Skip to content

Commit

Permalink
Revert "persist accounts that have storage updates, but no nonce, bal…
Browse files Browse the repository at this point in the history
…ance nor code"

This reverts commit 9c9121a.

Signed-off-by: Daniel Lehrner <[email protected]>
  • Loading branch information
daniellehrner committed Jul 16, 2024
1 parent 227b923 commit 8316302
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ public TransactionProcessingResult processTransaction(
coinbaseCalculator.price(usedGas, transactionGasPrice, blockHeader.getBaseFee());

coinbase.incrementBalance(coinbaseWeiDelta);
authorizedCodeService.resetAuthorities();

operationTracer.traceEndTransaction(
worldUpdater,
Expand All @@ -515,13 +516,8 @@ public TransactionProcessingResult processTransaction(
initialFrame.getSelfDestructs().forEach(worldState::deleteAccount);

if (clearEmptyAccounts) {
// TODO remove for devnet-2 and later as in the new version of 7702 the nonce of the
// authorities is increased
// and will not be cleared anymore in case of storage change only
worldState.clearAccountsThatAreEmpty(authorizedCodeService.getAuthorities());
// worldState.clearAccountsThatAreEmpty();
worldState.clearAccountsThatAreEmpty();
}
authorizedCodeService.resetAuthorities();

if (initialFrame.getState() == MessageFrame.State.COMPLETED_SUCCESS) {
return TransactionProcessingResult.successful(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;

import org.apache.tuweni.bytes.Bytes;

Expand Down Expand Up @@ -176,19 +175,6 @@ default void clearAccountsThatAreEmpty() {
.stream().filter(Account::isEmpty).forEach(a -> deleteAccount(a.getAddress()));
}

/**
* Clears any accounts that are empty, excluding those in the provided set
*
* @param excludedAddresses the addresses to exclude from deletion
*/
default void clearAccountsThatAreEmpty(final Set<Address> excludedAddresses) {
new ArrayList<>(getTouchedAccounts())
.stream()
.filter(a -> !excludedAddresses.contains(a.getAddress()))
.filter(Account::isEmpty)
.forEach(a -> deleteAccount(a.getAddress()));
}

/** Mark transaction boundary. */
default void markTransactionBoundary() {
// default is to ignore
Expand Down

0 comments on commit 8316302

Please sign in to comment.