Skip to content

Commit

Permalink
fixing merge conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Wertz <edward@swirldslabs.com>
  • Loading branch information
edward-swirldslabs committed Dec 28, 2023
1 parent af1ae0d commit 9d43e8e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import com.swirlds.platform.components.transaction.system.PreconsensusSystemTransactionManager;
import com.swirlds.platform.config.ThreadConfig;
import com.swirlds.platform.consensus.ConsensusConfig;
import com.swirlds.platform.consensus.NonAncientEventWindow;
import com.swirlds.platform.crypto.CryptoStatic;
import com.swirlds.platform.crypto.KeysAndCerts;
import com.swirlds.platform.crypto.PlatformSigner;
Expand Down Expand Up @@ -904,7 +905,13 @@ public class SwirldsPlatform implements Platform {
if (eventConfig.useLegacyIntake()) {
eventLinker.loadFromSignedState(initialState);
} else {
platformWiring.updateMinimumGenerationNonAncient(initialMinimumGenerationNonAncient);
platformWiring.updateNonAncientEventWindow(NonAncientEventWindow.createUsingRoundsNonAncient(
initialState.getRound(),
initialMinimumGenerationNonAncient,
platformContext
.getConfiguration()
.getConfigData(ConsensusConfig.class)
.roundsNonAncient()));
}

// We don't want to invoke these callbacks until after we are starting up.
Expand Down Expand Up @@ -1054,8 +1061,13 @@ private void loadStateIntoEventCreator(@NonNull final SignedState signedState) {
}

try {
eventCreator.setMinimumGenerationNonAncient(
signedState.getState().getPlatformState().getMinimumGenerationNonAncient());
eventCreator.setNonAncientEventWindow(NonAncientEventWindow.createUsingRoundsNonAncient(
signedState.getRound(),
signedState.getState().getPlatformState().getMinimumGenerationNonAncient(),
platformContext
.getConfiguration()
.getConfigData(ConsensusConfig.class)
.roundsNonAncient()));
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("interrupted while loading state into event creator", e);
Expand Down Expand Up @@ -1152,7 +1164,13 @@ private void loadReconnectState(final SignedState signedState) {
.inject(new AddressBookUpdate(
signedState.getState().getPlatformState().getPreviousAddressBook(),
signedState.getState().getPlatformState().getAddressBook()));
platformWiring.updateMinimumGenerationNonAncient(signedState.getMinRoundGeneration());
platformWiring.updateNonAncientEventWindow(NonAncientEventWindow.createUsingRoundsNonAncient(
signedState.getRound(),
signedState.getMinRoundGeneration(),
platformContext
.getConfiguration()
.getConfigData(ConsensusConfig.class)
.roundsNonAncient()));
}
} finally {
intakeQueue.resume();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public class NonAncientEventWindow {
* @throws IllegalArgumentException if the latestConsensusRound is less than the first round of consensus or if the
* minGenNonAncient value is less than the first generation for events.
*/
public NonAncientEventWindow(final long latestConsensusRound, final long minRoundNonAncient, final long minGenNonAncient) {
public NonAncientEventWindow(
final long latestConsensusRound, final long minRoundNonAncient, final long minGenNonAncient) {
if (latestConsensusRound < ConsensusConstants.ROUND_FIRST) {
throw new IllegalArgumentException(
"The latest consensus round cannot be less than the first round of consensus.");
Expand Down

0 comments on commit 9d43e8e

Please sign in to comment.