diff --git a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/records/impl/BlockRecordManagerImpl.java b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/records/impl/BlockRecordManagerImpl.java index 170956e57f42..f7523a1841b9 100644 --- a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/records/impl/BlockRecordManagerImpl.java +++ b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/records/impl/BlockRecordManagerImpl.java @@ -187,7 +187,7 @@ public boolean startUserTransaction(@NonNull final Instant consensusTime, @NonNu // Also check to see if this is the first transaction we're handling after a freeze restart. If so, we also // start a new block. final var isFirstTransactionAfterFreezeRestart = platformState.freezeTime() != null - && platformState.freezeTimeOrThrow().equals(platformState.freezeTime()); + && platformState.freezeTimeOrThrow().equals(platformState.lastFrozenTime()); if (isFirstTransactionAfterFreezeRestart) { new WritablePlatformStateStore(state.getWritableStates(PlatformStateService.NAME)).setFreezeTime(null); } diff --git a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/regression/system/LifecycleTest.java b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/regression/system/LifecycleTest.java index 08cf5a1c80f3..69c6bb11a785 100644 --- a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/regression/system/LifecycleTest.java +++ b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/regression/system/LifecycleTest.java @@ -18,6 +18,8 @@ import static com.hedera.services.bdd.junit.hedera.MarkerFile.EXEC_IMMEDIATE_MF; import static com.hedera.services.bdd.spec.queries.QueryVerbs.getVersionInfo; +import static com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer; +import static com.hedera.services.bdd.spec.transactions.crypto.HapiCryptoTransfer.tinyBarsFromTo; import static com.hedera.services.bdd.spec.utilops.UtilVerbs.blockingOrder; import static com.hedera.services.bdd.spec.utilops.UtilVerbs.buildUpgradeZipFrom; import static com.hedera.services.bdd.spec.utilops.UtilVerbs.doAdhoc; @@ -33,6 +35,7 @@ import static com.hedera.services.bdd.spec.utilops.UtilVerbs.waitForFrozenNetwork; import static com.hedera.services.bdd.spec.utilops.UtilVerbs.waitForMf; import static com.hedera.services.bdd.spec.utilops.upgrade.BuildUpgradeZipOp.FAKE_UPGRADE_ZIP_LOC; +import static com.hedera.services.bdd.suites.HapiSuite.FUNDING; import static com.hedera.services.bdd.suites.HapiSuite.GENESIS; import static com.hedera.services.bdd.suites.freeze.CommonUpgradeResources.DEFAULT_UPGRADE_FILE_ID; import static com.hedera.services.bdd.suites.freeze.CommonUpgradeResources.FAKE_ASSETS_LOC; @@ -132,7 +135,10 @@ default SpecOperation upgradeToNextConfigVersion() { */ default SpecOperation restartAtNextConfigVersion() { return blockingOrder( - freezeOnly().startingIn(5).seconds().payingWith(GENESIS), + freezeOnly().startingIn(5).seconds().payingWith(GENESIS).deferStatusResolution(), + // Immediately submit a transaction in the same round to ensure freeze time is only + // reset when last frozen time matches it (i.e., in a post-upgrade transaction) + cryptoTransfer(tinyBarsFromTo(GENESIS, FUNDING, 1)), confirmFreezeAndShutdown(), sourcing(() -> FakeNmt.restartNetwork(CURRENT_CONFIG_VERSION.incrementAndGet())), waitForActiveNetwork(RESTART_TIMEOUT));