From 3d5cefc05b47a226cf159de1fac8882e58f92071 Mon Sep 17 00:00:00 2001 From: Oleh Date: Wed, 13 Mar 2024 18:56:50 +0000 Subject: [PATCH] #1774 change hwm limits for zmq broadcast --- libskale/broadcaster.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libskale/broadcaster.cpp b/libskale/broadcaster.cpp index 3b971c2aa..746e8c9cb 100644 --- a/libskale/broadcaster.cpp +++ b/libskale/broadcaster.cpp @@ -97,10 +97,8 @@ void* ZmqBroadcaster::server_socket() const { val = 60000; zmq_setsockopt( m_zmq_server_socket, ZMQ_HEARTBEAT_TTL, &val, sizeof( val ) ); - - val = 16; - zmq_setsockopt( m_zmq_server_socket, ZMQ_RCVHWM, &val, sizeof( val ) ); - val = 16; + // remove limits to prevent txns from being dropped out + val = 0; zmq_setsockopt( m_zmq_server_socket, ZMQ_SNDHWM, &val, sizeof( val ) ); @@ -136,9 +134,6 @@ void* ZmqBroadcaster::client_socket() const { value = 16; zmq_setsockopt( m_zmq_client_socket, ZMQ_RCVHWM, &value, sizeof( value ) ); - value = 16; - zmq_setsockopt( m_zmq_client_socket, ZMQ_SNDHWM, &value, sizeof( value ) ); - const dev::eth::ChainParams& ch = m_client.chainParams(); @@ -254,6 +249,8 @@ void ZmqBroadcaster::broadcast( const std::string& _rlp ) { int res = zmq_send( server_socket(), const_cast< char* >( _rlp.c_str() ), _rlp.size(), 0 ); if ( res <= 0 ) { + clog( dev::VerbosityWarning, "zmq-broadcaster" ) + << "Got error " << res << " in zmq_send: " << zmq_strerror( res ); throw std::runtime_error( "Zmq can't send data" ); } }