diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 28720ab5837..8f59fd0baba 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -2029,7 +2029,7 @@ namespace eosio { // sync need checks; (lib == last irreversible block) // // 0. my head block id == peer head id means we are all caught up block wise - // 1. my head block num < peer lib - start sync locally + // 1. my head block num < peer lib - send handshake (if not sent in handle_message) and wait for receipt of notice message to start syncing // 2. my lib > peer head num - send an last_irr_catch_up notice if not the first generation // // 3 my head block num < peer head block num - update sync state and send a catchup request @@ -2056,6 +2056,9 @@ namespace eosio { ("ep", c->peer_name())("lib", msg.last_irreversible_block_num)("head", msg.head_num) ("id", msg.head_id.str().substr(8,16)) ); c->syncing = false; + if (c->sent_handshake_count > 0) { + c->send_handshake(true); + } return; } if (lib_num > msg.head_num ) { diff --git a/tests/Node.py b/tests/Node.py index b26636af347..645f607f989 100644 --- a/tests/Node.py +++ b/tests/Node.py @@ -559,7 +559,7 @@ def __exit__(self, exc_type, exc_value, exc_traceback): reporter = WaitReporter(self, reportInterval) if reportInterval is not None else None ret=Utils.waitForTruth(lam, timeout, reporter=reporter, sleepTime=sleepTime) - assert ret is not None or errorContext is None, Utils.errorExit("%s." % (errorContext)) + assert ret or errorContext is None, Utils.errorExit("%s." % (errorContext)) return ret def waitForIrreversibleBlock(self, blockNum, timeout=WaitSpec.default()): diff --git a/tests/eosio_blocklog_prune_test.py b/tests/eosio_blocklog_prune_test.py index bd1c433a8e1..a79a68ce45f 100755 --- a/tests/eosio_blocklog_prune_test.py +++ b/tests/eosio_blocklog_prune_test.py @@ -175,7 +175,8 @@ assert headAdvanced or lvnPostInfo["head_block_num"] >= cfTrxBlockNum, "the light validation node stops syncing" - fullValidationNode.waitForBlock(cfTrxBlockNum-1, blockType=BlockType.lib, timeout=WaitSpec.calculate(), errorContext="fullValidationNode LIB did not advance") + #lib will be cfTrxBlockNum-2 and head cfTrxBlockNum-1 because of when we will receive incomplete block we won't advance lib + fullValidationNode.waitForBlock(cfTrxBlockNum-2, blockType=BlockType.lib, timeout=WaitSpec.calculate(leeway=timeForNodesToWorkOutReconnect), errorContext="fullValidationNode LIB did not advance") Utils.Print("Ensure full validation node stops syncing") headAdvanced = fullValidationNode.waitForHeadToAdvance() if headAdvanced: diff --git a/tests/privacy_scenario_3_test.py b/tests/privacy_scenario_3_test.py index d1f05ddca93..8c1f6959338 100755 --- a/tests/privacy_scenario_3_test.py +++ b/tests/privacy_scenario_3_test.py @@ -150,15 +150,7 @@ assert breakTimeout, Print("API Node1 out of sync") apiNode1.waitForTransFinalization(trans["transaction_id"]) - - ####################################################################### - # Workaround. - # Restart shouldn't be needed here but due to bug in nodeos we have to. - # this supposed to be fixed in nodeos and removed - apiNode2.kill(signal.SIGTERM) - apiNode2.relaunch(cachePopen=True) - ####################################################################### - + # after last recorded block number (rbn3) is made irreversible, verify # node2 connects to node1 # node2 starts syncing