Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder;
import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.mainnet.BodyValidation;
Expand All @@ -42,6 +41,7 @@
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams;
import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult;
import org.hyperledger.besu.ethereum.referencetests.BonsaiReferenceTestWorldState;
import org.hyperledger.besu.ethereum.referencetests.ReferenceTestBlockchain;
import org.hyperledger.besu.ethereum.referencetests.ReferenceTestEnv;
import org.hyperledger.besu.ethereum.referencetests.ReferenceTestProtocolSchedules;
Expand Down Expand Up @@ -238,7 +238,9 @@ static T8nResult runTest(
ReferenceTestProtocolSchedules.create(
new StubGenesisConfigOptions().chainId(BigInteger.valueOf(chainId)));

final MutableWorldState worldState = initialWorldState.copy();
final BonsaiReferenceTestWorldState worldState =
(BonsaiReferenceTestWorldState) initialWorldState.copy();
worldState.disableRootHashVerification();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


final ProtocolSchedule protocolSchedule = referenceTestProtocolSchedules.getByName(fork);
if (protocolSchedule == null) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class BonsaiReferenceTestWorldState extends BonsaiWorldState
private final BonsaiReferenceTestWorldStateStorage refTestStorage;
private final BonsaiPreImageProxy preImageProxy;

private boolean disableRootHashVerification;

protected BonsaiReferenceTestWorldState(
final BonsaiReferenceTestWorldStateStorage worldStateStorage,
final CachedMerkleTrieLoader cachedMerkleTrieLoader,
Expand Down Expand Up @@ -87,7 +89,7 @@ public ReferenceTestWorldState copy() {
*/
@Override
protected void verifyWorldStateRoot(final Hash calculatedStateRoot, final BlockHeader header) {
if (!header.getStateRoot().equals(Hash.ZERO)) {
if (!disableRootHashVerification) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to do it this way, we should probably also set disableRootHashVerification in the retesteth subcommand. I don't think it is being used currently, but we shouldn't leave it broken

Nevermind - it looks like retesteth subcommand is still using forest

super.verifyWorldStateRoot(calculatedStateRoot, header);
}
}
Expand Down Expand Up @@ -125,6 +127,10 @@ public Stream<StreamableAccount> streamAccounts(final Bytes32 startKeyHash, fina
return this.refTestStorage.streamAccounts(this, startKeyHash, limit);
}

public void disableRootHashVerification() {
disableRootHashVerification = true;
}

static class NoOpTrieLogManager implements TrieLogManager {
private final Subscribers<TrieLogEvent.TrieLogObserver> trieLogObservers = Subscribers.create();
private final TrieLogFactory trieLogFactory = new TrieLogFactoryImpl();
Expand Down