Skip to content

Commit

Permalink
Merge branch 'main' into qbft-snap
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew1001 authored Jul 2, 2024
2 parents 252c0e8 + 3a73dcc commit 29d9191
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog

## Next Release
## Next release

### Breaking Changes

### Additions and Improvements

### Bug fixes

## 24.7.0

### Upcoming Breaking Changes
- Receipt compaction will be enabled by default in a future version of Besu. After this change it will not be possible to downgrade to the previous Besu version.
Expand Down Expand Up @@ -33,6 +41,8 @@
- Fix "Could not confirm best peer had pivot block" [#7109](https://github.com/hyperledger/besu/issues/7109)
- Fix "Chain Download Halt" [#6884](https://github.com/hyperledger/besu/issues/6884)



## 24.6.0

### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ 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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
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}.
*
Expand Down Expand Up @@ -73,8 +75,29 @@ default MutableAccount createAccount(final Address address) {
* #createAccount(Address)} (and thus all his fields will be zero/empty).
*/
default MutableAccount getOrCreate(final Address address) {
final MutableAccount account = getAccount(address);
return account == null ? createAccount(address) : account;
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);
}
}

/**
Expand Down

0 comments on commit 29d9191

Please sign in to comment.