Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support throttling block syncing to peers. #1540

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e68743a
Support throttling block syncing to peers. WIP
jgiszczak Aug 22, 2023
303c3d6
Add exponential backoff to throttle. Fix wretched math.
jgiszczak Aug 23, 2023
3789d17
Merge branch 'main' into p2p-peer-throttle
jgiszczak Aug 23, 2023
70b530b
Experiment: How many tests fail if waitForObj default times out
jgiszczak Aug 24, 2023
b92d84c
Address review comments in net_plugin.
jgiszczak Aug 24, 2023
dc54d46
Further tweak the sync throttle test for machines faster than mine.
jgiszczak Aug 24, 2023
3a50864
Move block sync throttling to the correct layer in the call stack.
jgiszczak Aug 25, 2023
e1c1d42
Move block sync rate limit parsing to plugin initialize.
jgiszczak Aug 25, 2023
92e4e7c
Require IPv6 addresses to be in square bracket format.
jgiszczak Aug 30, 2023
28bb38d
Added throttle exception for configured p2p-peer-addresses.
jgiszczak Aug 30, 2023
1eb1e44
Merge branch 'main' into p2p-peer-throttle
jgiszczak Sep 1, 2023
1983d90
Merge branch 'main' into p2p-peer-throttle
jgiszczak Sep 7, 2023
e998cc6
Debug commit, doesn't build.
jgiszczak Sep 11, 2023
92e4022
Fix build error. Lambda captures by value are const.
jgiszczak Sep 11, 2023
b24f8e3
Fix bare numeric value for peer throttle.
jgiszczak Sep 11, 2023
3f67034
Update supplied_peers only once per configured peer and once per API …
jgiszczak Sep 12, 2023
e59451d
Remove encapsulation violation.
jgiszczak Sep 15, 2023
ec2d36d
Restored connection reconnect method. WIP
jgiszczak Sep 18, 2023
777c8d8
Remove stacktrace additions
heifner Sep 18, 2023
e88c259
Merge branch 'p2p-peer-throttle' of github.com:AntelopeIO/leap into p…
jgiszczak Sep 18, 2023
05be825
Update netApi connect test.
jgiszczak Sep 20, 2023
f8763ae
Merge branch 'main' into p2p-peer-throttle
jgiszczak Sep 20, 2023
24f4aad
GH-1295 Project index to default iterator
heifner Sep 20, 2023
97591fe
Use reconnect method as intended, and avoid threading issue.
jgiszczak Sep 20, 2023
ffee0df
Use std::any_of when finding supplied peers to unlimit a connection.
jgiszczak Sep 20, 2023
fb740ef
Change language in p2p_multiple_listen_test for clarity.
jgiszczak Sep 23, 2023
453bfcf
Tolerate duplicate (empty) peer addresses in connection manager.
jgiszczak Sep 23, 2023
99f02c0
Add rate limit parse unittest.
jgiszczak Sep 27, 2023
b16184a
Tolerate node running with no listen endpoints.
jgiszczak Sep 27, 2023
df6d948
Restore lock of connections mutex when connecting configured peers.
jgiszczak Sep 27, 2023
733849b
Don't pass around iterators that may be invalidated by an erase.
jgiszczak Sep 27, 2023
ed69238
Renamed method.
jgiszczak Sep 27, 2023
2f80663
Break encapsulation less.
jgiszczak Sep 27, 2023
7019b65
Thread safety.
jgiszczak Sep 27, 2023
4d136e3
Revert "Restore lock of connections mutex when connecting configured …
jgiszczak Sep 27, 2023
3708418
Restore lock of connections mutex when connecting configured peers.
jgiszczak Sep 27, 2023
4baec72
Accept suggested refactoring.
jgiszczak Sep 27, 2023
8d2c1c2
Remove some unused machine-generated variables from custom shape file.
jgiszczak Sep 27, 2023
7e37de1
Convert connections mutex to resursive_mutex and update locks.
jgiszczak Sep 28, 2023
669ed0f
Revert mutex and lock type changes.
jgiszczak Sep 29, 2023
a6f7761
Revise connection_monitor for thread safety.
jgiszczak Oct 2, 2023
2ef3a6c
Merge branch 'main' into p2p-peer-throttle
jgiszczak Oct 2, 2023
7acac0c
Misc cleanups
heifner Oct 2, 2023
ff7a8a1
Add block sync bytes received metric and use it in sync throttle test.
jgiszczak Oct 4, 2023
6b2fe63
Add requests module for test.
oschwaldp-oci Oct 4, 2023
a6ed57d
Merge branch 'main' into p2p-peer-throttle
oschwaldp-oci Oct 4, 2023
d1ad2cf
Merge branch 'main' into p2p-peer-throttle
jgiszczak Oct 5, 2023
1e5b427
Add throttling flag to Prometheus peer data and use it in sync test.
jgiszczak Oct 6, 2023
db34bbf
Revise for better repeatability.
jgiszczak Oct 6, 2023
6db4ad8
Customize plugin_config_exception handling in net_plugin.
jgiszczak Oct 6, 2023
d8610c6
Merge branch 'main' into p2p-peer-throttle
jgiszczak Oct 7, 2023
5576604
Merge branch 'main' into p2p-peer-throttle
jgiszczak Oct 9, 2023
b41dd96
Merge branch 'main' into p2p-peer-throttle
jgiszczak Oct 10, 2023
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
1 change: 1 addition & 0 deletions plugins/net_plugin/include/eosio/net_plugin/net_plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace eosio {
std::chrono::nanoseconds last_bytes_received{0};
size_t bytes_sent{0};
std::chrono::nanoseconds last_bytes_sent{0};
size_t block_sync_bytes_sent{0};
std::chrono::nanoseconds connection_start_time{0};
std::string log_p2p_address;
};
Expand Down
3 changes: 2 additions & 1 deletion plugins/net_plugin/include/eosio/net_plugin/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ namespace eosio {

// Longest domain name is 253 characters according to wikipedia.
// Addresses include ":port" where max port is 65535, which adds 6 chars.
// Addresses may also include ":bitrate" with suffix and separators, which adds 30 chars.
heifner marked this conversation as resolved.
Show resolved Hide resolved
// We also add our own extentions of "[:trx|:blk] - xxxxxxx", which adds 14 chars, total= 273.
// Allow for future extentions as well, hence 384.
constexpr size_t max_p2p_address_length = 253 + 6;
constexpr size_t max_p2p_address_length = 253 + 6 + 30;
constexpr size_t max_handshake_str_length = 384;

struct handshake_message {
Expand Down
104 changes: 85 additions & 19 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <cmath>
#include <memory>
#include <new>
#include <regex>

// should be defined for c++17, but clang++16 still has not implemented it
#ifdef __cpp_lib_hardware_interference_size
Expand Down Expand Up @@ -475,6 +476,7 @@ namespace eosio {
std::function<void()> increment_dropped_trxs;

private:
static const std::map<std::string, int> prefix_multipliers;
heifner marked this conversation as resolved.
Show resolved Hide resolved
alignas(hardware_destructive_interference_size)
mutable fc::mutex chain_info_mtx; // protects chain_info_t
chain_info_t chain_info GUARDED_BY(chain_info_mtx);
Expand Down Expand Up @@ -529,14 +531,15 @@ namespace eosio {

constexpr static uint16_t to_protocol_version(uint16_t v);

size_t parse_connection_limit(const string& limit_str);
void plugin_initialize(const variables_map& options);
void plugin_startup();
void plugin_shutdown();
bool in_sync() const;
fc::logger& get_logger() { return logger; }

void create_session(tcp::socket&& socket, const string listen_address);
};
void create_session(tcp::socket&& socket, const string listen_address, size_t limit);
}; //net_plugin_impl

// peer_[x]log must be called from thread in connection strand
#define peer_dlog( PEER, FORMAT, ... ) \
Expand Down Expand Up @@ -771,7 +774,7 @@ namespace eosio {
/// @brief ctor
/// @param socket created by boost::asio in fc::listener
/// @param address identifier of listen socket which accepted this new connection
explicit connection( tcp::socket&& socket, const string& listen_address );
explicit connection( tcp::socket&& socket, const string& listen_address, size_t block_sync_rate_limit );
~connection() = default;

connection( const connection& ) = delete;
Expand Down Expand Up @@ -800,6 +803,7 @@ namespace eosio {
std::chrono::nanoseconds get_last_bytes_received() const { return last_bytes_received.load(); }
size_t get_bytes_sent() const { return bytes_sent.load(); }
std::chrono::nanoseconds get_last_bytes_sent() const { return last_bytes_sent.load(); }
size_t get_block_sync_bytes_sent() const { return block_sync_bytes_sent.load(); }
boost::asio::ip::port_type get_remote_endpoint_port() const { return remote_endpoint_port.load(); }
void set_heartbeat_timeout(std::chrono::milliseconds msec) {
hb_timeout = msec;
Expand Down Expand Up @@ -827,6 +831,8 @@ namespace eosio {
blocks_only
};

size_t block_sync_rate_limit{0}; // bytes/second, default unlimited

std::atomic<connection_types> connection_type{both};
std::atomic<uint32_t> peer_start_block_num{0};
std::atomic<uint32_t> peer_head_block_num{0};
Expand All @@ -835,6 +841,7 @@ namespace eosio {
std::atomic<size_t> bytes_received{0};
std::atomic<std::chrono::nanoseconds> last_bytes_received{0ns};
std::atomic<size_t> bytes_sent{0};
std::atomic<size_t> block_sync_bytes_sent{0};
std::atomic<std::chrono::nanoseconds> last_bytes_sent{0ns};
std::atomic<boost::asio::ip::port_type> remote_endpoint_port{0};

Expand Down Expand Up @@ -962,10 +969,11 @@ namespace eosio {
void send_time(const time_message& msg);
/** \brief Read system time and convert to a 64 bit integer.
*
* There are five calls to this routine in the program. One
* There are six calls to this routine in the program. One
* when a packet arrives from the network, one when a packet
* is placed on the send queue, one during start session, and
* one each when data is counted as received or sent.
* is placed on the send queue, one during start session, one
* when a sync block is queued and one each when data is
* counted as received or sent.
* Calls the kernel time of day routine and converts to
* a (at least) 64 bit integer.
*/
Expand All @@ -980,7 +988,7 @@ namespace eosio {
void stop_send();

void enqueue( const net_message &msg );
void enqueue_block( const signed_block_ptr& sb, bool to_sync_queue = false);
size_t enqueue_block( const signed_block_ptr& sb, bool to_sync_queue = false);
void enqueue_buffer( const std::shared_ptr<std::vector<char>>& send_buffer,
go_away_reason close_after_send,
bool to_sync_queue = false);
Expand Down Expand Up @@ -1055,6 +1063,10 @@ namespace eosio {
}; // class connection

const string connection::unknown = "<unknown>";
const std::map<std::string, int> net_plugin_impl::prefix_multipliers{
{"",1},{"K",pow(10,3)},{"M",pow(10,6)},{"G",pow(10, 9)},{"T",pow(10, 12)},
{"Ki",pow(2,10)},{"Mi",pow(2,20)},{"Gi",pow(2,30)},{"Ti",pow(2,40)}
};

// called from connection strand
struct msg_handler : public fc::visitor<void> {
Expand Down Expand Up @@ -1185,9 +1197,10 @@ namespace eosio {
fc_ilog( logger, "created connection ${c} to ${n}", ("c", connection_id)("n", endpoint) );
}

connection::connection(tcp::socket&& s, const string& listen_address)
connection::connection(tcp::socket&& s, const string& listen_address, size_t block_sync_rate_limit)
: listen_address( listen_address ),
peer_addr(),
block_sync_rate_limit(block_sync_rate_limit),
strand( my_impl->thread_pool.get_executor() ),
socket( new tcp::socket( std::move(s) ) ),
connection_id( ++my_impl->current_connection_id ),
Expand All @@ -1199,7 +1212,6 @@ namespace eosio {
fc_dlog( logger, "new connection object created for peer ${address}:${port} from listener ${addr}", ("address", log_remote_endpoint_ip)("port", log_remote_endpoint_port)("addr", listen_address) );
}

// called from connection strand
void connection::update_endpoints() {
boost::system::error_code ec;
boost::system::error_code ec2;
Expand Down Expand Up @@ -1649,7 +1661,7 @@ namespace eosio {
} else {
peer_dlog( this, "enqueue sync block ${num}", ("num", peer_requested->last + 1) );
}
uint32_t num = ++peer_requested->last;
uint32_t num = peer_requested->last + 1;
if(num == peer_requested->end_block) {
peer_requested.reset();
peer_dlog( this, "completing enqueue_sync_block ${num}", ("num", num) );
Expand All @@ -1661,14 +1673,25 @@ namespace eosio {
sb = cc.fetch_block_by_number( num ); // thread-safe
} FC_LOG_AND_DROP();
if( sb ) {
enqueue_block( sb, true );
if( block_sync_rate_limit > 0 ) {
auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(get_time() - connection_start_time);
auto current_rate = double(block_sync_bytes_sent) / elapsed.count();
if( current_rate < block_sync_rate_limit ) {
block_sync_bytes_sent += enqueue_block( sb, true );
++peer_requested->last;
} else {
return false;
}
} else {
block_sync_bytes_sent += enqueue_block( sb, true );
++peer_requested->last;
}
heifner marked this conversation as resolved.
Show resolved Hide resolved
} else {
peer_ilog( this, "enqueue sync, unable to fetch block ${num}, sending benign_other go away", ("num", num) );
peer_requested.reset(); // unable to provide requested blocks
no_retry = benign_other;
enqueue( go_away_message( benign_other ) );
}

return true;
}

Expand Down Expand Up @@ -1781,14 +1804,15 @@ namespace eosio {
}

// called from connection strand
void connection::enqueue_block( const signed_block_ptr& b, bool to_sync_queue) {
size_t connection::enqueue_block( const signed_block_ptr& b, bool to_sync_queue) {
peer_dlog( this, "enqueue block ${num}", ("num", b->block_num()) );
verify_strand_in_this_thread( strand, __func__, __LINE__ );

block_buffer_factory buff_factory;
auto sb = buff_factory.get_send_buffer( b );
latest_blk_time = std::chrono::system_clock::now();
enqueue_buffer( sb, no_reason, to_sync_queue);
return sb->size();
}

// called from connection strand
Expand Down Expand Up @@ -2719,7 +2743,7 @@ namespace eosio {
}


void net_plugin_impl::create_session(tcp::socket&& socket, const string listen_address) {
void net_plugin_impl::create_session(tcp::socket&& socket, const string listen_address, size_t limit) {
uint32_t visitors = 0;
uint32_t from_addr = 0;
boost::system::error_code rec;
Expand All @@ -2745,7 +2769,7 @@ namespace eosio {
visitors < connections.get_max_client_count())) {
fc_ilog(logger, "Accepted new connection: " + paddr_str);

connection_ptr new_connection = std::make_shared<connection>(std::move(socket), listen_address);
connection_ptr new_connection = std::make_shared<connection>(std::move(socket), listen_address, limit);
new_connection->strand.post([new_connection, this]() {
if (new_connection->start_session()) {
connections.add(new_connection);
Expand Down Expand Up @@ -3927,7 +3951,15 @@ namespace eosio {
void net_plugin::set_program_options( options_description& /*cli*/, options_description& cfg )
{
cfg.add_options()
( "p2p-listen-endpoint", bpo::value< vector<string> >()->default_value( vector<string>(1, string("0.0.0.0:9876")) ), "The actual host:port used to listen for incoming p2p connections. May be used multiple times.")
( "p2p-listen-endpoint", bpo::value< vector<string> >()->default_value( vector<string>(1, string("0.0.0.0:9876:0")) ), "The actual host:port[:<rate-cap>] used to listen for incoming p2p connections. May be used multiple times. "
" The optional rate cap will limit block sync bandwidth to the specified rate. A number alone will be "
" interpreted as bytes per second. The number may be suffixed with units. Supported units are: "
" 'B/s', 'KB/s', 'MB/s, 'GB/s', 'TB/s', 'KiB/s', 'MiB/s', 'GiB/s', 'TiB/s'."
" Transactions and blocks outside of sync mode are not throttled."
" Examples:\n"
" 192.168.0.100:9876:1MiB/s\n"
" node.eos.io:9876:250KB/s\n"
" node.eos.io:9876:0.5GB/s")
( "p2p-server-address", bpo::value< vector<string> >(), "An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint. May be used as many times as p2p-listen-endpoint. If provided, the first address will be used in handshakes with other nodes. Otherwise the default is used.")
( "p2p-peer-address", bpo::value< vector<string> >()->composing(),
"The public endpoint of a peer node to connect to. Use multiple p2p-peer-address options as needed to compose a network.\n"
Expand Down Expand Up @@ -3983,6 +4015,29 @@ namespace eosio {
return fc::json::from_string(s).as<T>();
}

size_t net_plugin_impl::parse_connection_limit( const std::string& limit_str) {
heifner marked this conversation as resolved.
Show resolved Hide resolved
std::istringstream in(limit_str);
fc_dlog( logger, "parsing connection endpoint with locale ${l}", ("l", std::locale("").name()));
heifner marked this conversation as resolved.
Show resolved Hide resolved
in.imbue(std::locale(""));
double limit{0};
in >> limit;
size_t block_sync_rate_limit = 0;
if( limit > 0.0f ) {
std::string units;
in >> units;
std::regex units_regex{"([KMGT]?[i]?)B/s"};
std::smatch units_match;
std::regex_match(units, units_match, units_regex);
try {
block_sync_rate_limit = boost::numeric_cast<size_t>(limit * prefix_multipliers.at(units_match[1].str()));
heifner marked this conversation as resolved.
Show resolved Hide resolved
fc_dlog( logger, "setting block_sync_rate_limit to ${limit}", ("limit", block_sync_rate_limit));
heifner marked this conversation as resolved.
Show resolved Hide resolved
} catch (boost::numeric::bad_numeric_cast&) {
EOS_ASSERT(false, plugin_config_exception, "block sync limit specification overflowed: ${limit}", ("limit", limit_str));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use EOS_THROW instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to EOS_THROW.

}
}
heifner marked this conversation as resolved.
Show resolved Hide resolved
return block_sync_rate_limit;
}

void net_plugin_impl::plugin_initialize( const variables_map& options ) {
try {
fc_ilog( logger, "Initialize net plugin" );
Expand Down Expand Up @@ -4192,10 +4247,20 @@ namespace eosio {

std::string extra_listening_log_info =
", max clients is " + std::to_string(my->connections.get_max_client_count());


auto listen_addr = address;
auto limit = string("0");
if( std::count(address.begin(), address.end(), ':') > 1 ) {
heifner marked this conversation as resolved.
Show resolved Hide resolved
auto last_colon_location = address.rfind(':');
listen_addr = std::string(address, 0, last_colon_location);
limit = std::string(address, last_colon_location+1);
}

auto block_sync_rate_limit = my->parse_connection_limit(limit);

fc::create_listener<tcp>(
my->thread_pool.get_executor(), logger, accept_timeout, address, extra_listening_log_info,
[my = my, addr = p2p_addr](tcp::socket&& socket) { my->create_session(std::move(socket), addr); });
my->thread_pool.get_executor(), logger, accept_timeout, listen_addr, extra_listening_log_info,
[my = my, addr = p2p_addr, block_sync_rate_limit = block_sync_rate_limit](tcp::socket&& socket) { fc_dlog( logger, "start listening on ${addr} with peer sync throttle ${limit}", ("addr", addr)("limit", block_sync_rate_limit)); my->create_session(std::move(socket), addr, block_sync_rate_limit); });
} catch (const std::exception& e) {
fc_elog( logger, "net_plugin::plugin_startup failed to listen on ${addr}, ${what}",
("addr", address)("what", e.what()) );
Expand Down Expand Up @@ -4479,6 +4544,7 @@ namespace eosio {
, .last_bytes_received = (*it)->get_last_bytes_received()
, .bytes_sent = (*it)->get_bytes_sent()
, .last_bytes_sent = (*it)->get_last_bytes_sent()
, .block_sync_bytes_sent = (*it)->get_block_sync_bytes_sent()
, .connection_start_time = (*it)->connection_start_time
, .log_p2p_address = (*it)->log_p2p_address
};
Expand Down
1 change: 1 addition & 0 deletions plugins/prometheus_plugin/metrics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ struct catalog_type {
add_and_set_gauge("last_bytes_received", peer.last_bytes_received.count());
add_and_set_gauge("bytes_sent", peer.bytes_sent);
add_and_set_gauge("last_bytes_sent", peer.last_bytes_sent.count());
add_and_set_gauge("block_sync_bytes_sent", peer.block_sync_bytes_sent);
add_and_set_gauge("connection_start_time", peer.connection_start_time.count());
add_and_set_gauge(peer.log_p2p_address, 0); // Empty gauge; we only want the label
}
Expand Down
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/http_plugin_test.py ${CMAKE_CURRENT_B
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_high_latency_test.py ${CMAKE_CURRENT_BINARY_DIR}/p2p_high_latency_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_multiple_listen_test.py ${CMAKE_CURRENT_BINARY_DIR}/p2p_multiple_listen_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_no_listen_test.py ${CMAKE_CURRENT_BINARY_DIR}/p2p_no_listen_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_sync_throttle_test.py ${CMAKE_CURRENT_BINARY_DIR}/p2p_sync_throttle_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_sync_throttle_test_shape.json ${CMAKE_CURRENT_BINARY_DIR}/p2p_sync_throttle_test_shape.json COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compute_transaction_test.py ${CMAKE_CURRENT_BINARY_DIR}/compute_transaction_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/subjective_billing_test.py ${CMAKE_CURRENT_BINARY_DIR}/subjective_billing_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/get_account_test.py ${CMAKE_CURRENT_BINARY_DIR}/get_account_test.py COPYONLY)
Expand Down Expand Up @@ -186,6 +188,8 @@ add_test(NAME p2p_multiple_listen_test COMMAND tests/p2p_multiple_listen_test.py
set_property(TEST p2p_multiple_listen_test PROPERTY LABELS nonparallelizable_tests)
add_test(NAME p2p_no_listen_test COMMAND tests/p2p_no_listen_test.py -v ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST p2p_no_listen_test PROPERTY LABELS nonparallelizable_tests)
add_test(NAME p2p_sync_throttle_test COMMAND tests/p2p_sync_throttle_test.py -v -d 2 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST p2p_sync_throttle_test PROPERTY LABELS nonparallelizable_tests)

# needs iproute-tc or iproute2 depending on platform
#add_test(NAME p2p_high_latency_test COMMAND tests/p2p_high_latency_test.py -v WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down
3 changes: 3 additions & 0 deletions tests/TestHarness/testUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ def waitForObj(lam, timeout=None, sleepTime=1, reporter=None):
if reporter is not None:
reporter()
time.sleep(sleepTime)
else:
if timeout == 60:
raise RuntimeError('waitForObj reached 60 second timeout')
finally:
if needsNewLine:
Utils.Print()
Expand Down
2 changes: 1 addition & 1 deletion tests/block_log_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def verifyBlockLog(expected_block_num, trimmedBlockLog):
node0.kill(signal.SIGTERM)

Print("Wait for node0's head block to become irreversible")
node1.waitForBlock(headBlockNum, blockType=BlockType.lib)
node1.waitForBlock(headBlockNum, blockType=BlockType.lib, timeout=90)
infoAfter=node1.getInfo(exitOnError=True)
headBlockNumAfter=infoAfter["head_block_num"]

Expand Down
Loading