Skip to content

Commit

Permalink
Revert "Keep Worldstate Storage open for Bonsai archive latest layer (h…
Browse files Browse the repository at this point in the history
…yperledger#5039)" (hyperledger#5073)

This reverts commit e715010.

Signed-off-by: Simon Dudley <[email protected]>
  • Loading branch information
siladu authored and ensi321 committed Feb 19, 2023
1 parent 6beb63c commit 568441e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 32 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ tests are updated to use EC private keys instead of RSA keys.

### Bug Fixes
- Mitigation fix for stale bonsai code storage leading to log rolling issues on contract recreates [#4906](https://github.com/hyperledger/besu/pull/4906)
- Ensure latest cached layered worldstate is subscribed to storage, fix problem with RPC calls using 'latest' [#5039](https://github.com/hyperledger/besu/pull/5039)


## 23.1.0-RC1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,7 @@ public void persist(final BlockHeader blockHeader) {
final Hash newWorldStateRootHash = rootHash(localUpdater);
archive
.getTrieLogManager()
.saveTrieLog(
archive,
localUpdater,
newWorldStateRootHash,
blockHeader,
(BonsaiPersistedWorldState) this.copy());
.saveTrieLog(archive, localUpdater, newWorldStateRootHash, blockHeader, this);
worldStateRootHash = newWorldStateRootHash;
worldStateBlockHash = blockHeader.getBlockHash();
isPersisted = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,9 @@ public Optional<BonsaiWorldView> getNextWorldView() {
}

public void setNextWorldView(final Optional<BonsaiWorldView> nextWorldView) {
maybeUnSubscribe();
this.nextWorldView = nextWorldView;
}

private void maybeUnSubscribe() {
nextWorldView
.filter(WorldState.class::isInstance)
.map(WorldState.class::cast)
.ifPresent(
ws -> {
try {
ws.close();
} catch (final Exception e) {
// no-op
}
});
}

@Override
public void close() throws Exception {
maybeUnSubscribe();
}

public TrieLogLayer getTrieLog() {
return trieLog;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,7 @@ private TransactionAddedStatus addTransaction(
LOG,
"Transaction {} not added because nonce too far in the future for sender {}",
transaction::toTraceLog,
() ->
maybeSenderAccount
.map(Account::getAddress)
.map(Address::toString)
.orElse("unknown"));
maybeSenderAccount::toString);
return NONCE_TOO_FAR_IN_FUTURE_FOR_SENDER;
}

Expand Down

0 comments on commit 568441e

Please sign in to comment.