Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

net_plugin fix for privacy groups corner case #10390

Merged
merged 3 commits into from
May 26, 2021
Merged
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
5 changes: 4 additions & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
brianjohnson5972 marked this conversation as resolved.
Show resolved Hide resolved
c->send_handshake(true);
}
return;
}
if (lib_num > msg.head_num ) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()):
Expand Down
3 changes: 2 additions & 1 deletion tests/eosio_blocklog_prune_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 1 addition & 9 deletions tests/privacy_scenario_3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down