Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -126,7 +126,7 @@ public void applyBlocks(

// To make sure that VirtualMapMetadata is persisted after all changes from the block stream were applied
state.copy();
state.getHash();
state.computeHash();
final var rootHash = requireNonNull(state.getHash()).getBytes();

if (!expectedRootHash.isEmpty() && !expectedRootHash.equals(rootHash.toString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ public static VirtualMap hashAndTestSynchronization(
System.out.println("desired: " + desiredTree);

if (startingTree != null) {
// calculate hash
startingTree.getHash();
startingTree.computeHash();
}
if (desiredTree != null) {
// calculate hash
desiredTree.getHash();
desiredTree.computeHash();
}
return testSynchronization(
startingTree,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public Integer call() throws IOException, ExecutionException, InterruptedExcepti
((CommittableWritableStates) writableStates).commit();
}
System.out.printf("Hashing state %n");
reservedSignedState.get().getState().getHash(); // calculate hash
reservedSignedState.get().getState().computeHash();
System.out.printf("Writing modified state to %s %n", outputDir.toAbsolutePath());
writeSignedStateFilesToDirectory(
platformContext, NO_NODE_ID, outputDir, reservedSignedState.get(), stateLifecycleManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static RecoveredState reapplyTransactions(
}

logger.info(STARTUP.getMarker(), "Hashing resulting signed state");
signedState.get().getState().getHash();
signedState.get().getState().computeHash();
logger.info(STARTUP.getMarker(), "Hashing complete");

// Let the application know about the recovered state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public static void initializeState(
signedState.getState(), platform, trigger, previousSoftwareVersion);

// calculate hash
abortAndThrowIfInterrupted(
initialState::getHash, // calculate hash
"interrupted while attempting to hash the state");
abortAndThrowIfInterrupted(initialState::computeHash, "interrupted while attempting to hash the state");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
abortAndThrowIfInterrupted(initialState::computeHash, "interrupted while attempting to hash the state");
abortAndThrowIfInterrupted(initialState::computeHash, "interrupted while attempting to compute the hash of the state");


// If our hash changes as a result of the new address book then our old signatures may become invalid.
if (trigger != GENESIS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void run() {
logger.info(RECONNECT.getMarker(), "Queues have been cleared");

final State currentState = stateLifecycleManager.getMutableState();
currentState.getHash(); // hash the state
currentState.computeHash();
int failedReconnectsInARow = 0;
do {
final AttemptReconnectResult result = attemptReconnect(currentState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public DefaultStateHasher(@NonNull final PlatformContext platformContext) {
public ReservedSignedState hashState(@NonNull final StateWithHashComplexity stateWithHashComplexity) {
final ReservedSignedState reservedSignedState = stateWithHashComplexity.reservedSignedState();
final Instant start = Instant.now();
reservedSignedState.get().getState().getHash();
reservedSignedState.get().getState().computeHash();
metrics.reportHashingTime(Duration.between(start, Instant.now()));

return reservedSignedState;
Expand Down
Loading