diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index c610d9b5b6..4d4c7d4741 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -772,9 +772,9 @@ class producer_plugin_impl : public std::enable_shared_from_thischain().head_block_num() + 1)); // abort the pending block abort_block(); - schedule_production_loop(); } diff --git a/tests/TestHarness/Node.py b/tests/TestHarness/Node.py index b529990b6f..41afbd43da 100644 --- a/tests/TestHarness/Node.py +++ b/tests/TestHarness/Node.py @@ -550,6 +550,35 @@ def findInLog(self, searchStr): return True return False + # verify only one 'Starting block' per block number unless block is restarted + def verifyOnlyOneStartingBlock(self): + dataDir=Utils.getNodeDataDir(self.nodeId) + files=Node.findStderrFiles(dataDir) + for f in files: + blockNumbers = set() + duplicatesFound = False + lastRestartBlockNum = 0 + + with open(f, 'r') as file: + for line in file: + match = re.match(r".*Restarting exhausted speculative block #(\d+)", line) + if match: + lastRestartBlockNum = match.group(1) + if re.match(r".*unlinkable_block_exception", line): + lastRestartBlockNum = blockNumber + match = re.match(r".*Starting block #(\d+)", line) + if match: + blockNumber = match.group(1) + if blockNumber != lastRestartBlockNum and blockNumber in blockNumbers: + print(f"Duplicate Staring block found: {blockNumber} in {f}") + duplicatesFound = True + blockNumbers.add(blockNumber) + + if duplicatesFound: + return False + + return True + def analyzeProduction(self, specificBlockNum=None, thresholdMs=500): dataDir=Utils.getNodeDataDir(self.nodeId) files=Node.findStderrFiles(dataDir) diff --git a/tests/distributed-transactions-test.py b/tests/distributed-transactions-test.py index d95dbf64df..62df717e2a 100755 --- a/tests/distributed-transactions-test.py +++ b/tests/distributed-transactions-test.py @@ -111,6 +111,11 @@ cluster.compareBlockLogs() + # verify only one start block per block unless interrupted + for node in cluster.getAllNodes(): + if not node.verifyOnlyOneStartingBlock(): + errorExit("Found more than one Starting block in logs") + testSuccessful=True finally: TestHelper.shutdown(cluster, walletMgr, testSuccessful, dumpErrorDetails)