Skip to content
Closed
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
## 23.1

### Additions and Improvements
- Add access list to Transaction Call Object [#4802](https://github.com/hyperledger/besu/issues/4801)

### Breaking Changes
- GoQuorum-compatible privacy is deprecated and will be removed in 23.4
- IBFT 1.0 is deprecated and will be removed in 23.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ public boolean isSyncing() {
return Optional.ofNullable(syncState.get()).map(s -> !s.isInSync()).orElse(Boolean.TRUE)
// this is necessary for when we do not have a sync target yet, like at startup.
// not being stopped at ttd implies we are syncing.
&& !syncState.get().hasReachedTerminalDifficulty().orElse(Boolean.FALSE);
&& Optional.ofNullable(syncState.get())
.map(s -> !(s.hasReachedTerminalDifficulty().orElse(Boolean.FALSE)))
.orElse(Boolean.TRUE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,32 @@ public void tryingToRetrieveABlockPutButEvictedReturnsEmpty() {
assertThat(postMergeContext.retrieveBlockById(evictedPayloadId)).isEmpty();
}

@Test
public void syncStateNullShouldNotThrowWhenIsSyncingIsCalled() {
// simulate a possible syncState null when we still have got a syncState set yet.
postMergeContext.setSyncState(null);
assertThat(postMergeContext.isSyncing()).isTrue();

// after setting a syncState things should progress as expected.
postMergeContext.setSyncState(mockSyncState);

// Assuming we're not in sync
when(mockSyncState.isInSync()).thenReturn(Boolean.FALSE);

when(mockSyncState.hasReachedTerminalDifficulty()).thenReturn(Optional.empty());
assertThat(postMergeContext.isSyncing()).isTrue();

when(mockSyncState.hasReachedTerminalDifficulty()).thenReturn(Optional.of(Boolean.FALSE));
assertThat(postMergeContext.isSyncing()).isTrue();

when(mockSyncState.hasReachedTerminalDifficulty()).thenReturn(Optional.of(Boolean.TRUE));
assertThat(postMergeContext.isSyncing()).isFalse();

// if we're in sync reached ttd does not matter anymore
when(mockSyncState.isInSync()).thenReturn(Boolean.TRUE);
assertThat(postMergeContext.isSyncing()).isFalse();
}

private static class MergeStateChangeCollector implements MergeStateHandler {
final List<Boolean> stateChanges = new ArrayList<>();

Expand Down