fix a problem where the private world state is not found in GoQuorum mode (#2041)

* fix #2041

Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>
pull/2042/head
Stefan Pingel 4 years ago committed by Joshua Fernandes
parent a030235e3a
commit 6dc740e4ec
  1. 6
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/goquorum/GoQuorumBlockValidator.java
  2. 8
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/goquorum/GoQuorumPrivateStateUtil.java

@ -61,7 +61,11 @@ public class GoQuorumBlockValidator extends MainnetBlockValidator {
protected Result processBlock(
final ProtocolContext context, final MutableWorldState worldState, final Block block) {
final MutableWorldState privateWorldState =
getPrivateWorldState(goQuorumPrivateStorage, goQuorumWorldStateArchive, block.getHeader());
getPrivateWorldState(
goQuorumPrivateStorage,
goQuorumWorldStateArchive,
worldState.rootHash(),
block.getHash());
return ((GoQuorumBlockProcessor) blockProcessor)
.processBlock(context.getBlockchain(), worldState, privateWorldState, block);

@ -37,15 +37,15 @@ public class GoQuorumPrivateStateUtil {
goQuorumPrivacyParameters.orElseThrow().privateStorage();
final WorldStateArchive goQuorumWorldStateArchive =
goQuorumPrivacyParameters.orElseThrow().worldStateArchive();
return getPrivateWorldState(goQuorumPrivateStorage, goQuorumWorldStateArchive, header);
return getPrivateWorldState(
goQuorumPrivateStorage, goQuorumWorldStateArchive, header.getStateRoot(), header.getHash());
}
public static MutableWorldState getPrivateWorldState(
final GoQuorumPrivateStorage goQuorumPrivateStorage,
final WorldStateArchive goQuorumWorldStateArchive,
final BlockHeader header) {
final Hash worldStateRootHash = header.getStateRoot();
final Hash publicBlockHash = header.getHash();
final Hash worldStateRootHash,
final Hash publicBlockHash) {
final Hash privateStateRootHash =
goQuorumPrivateStorage
.getPrivateStateRootHash(worldStateRootHash)

Loading…
Cancel
Save