Repository navigation
v7.2.6
Fix connection issue and improve handshake debugging
The problem stemmed from the incorrect use of non-blocking sockets in the connection setup. Additionally, comprehensive logging has been added to the perform_handshake function to facilitate easier debugging of future handshake issues.
Changes:
- Removed
sock.set_nonblocking(true);fromconfigure_tcp_socket. This ensures the use of blocking sockets, which is essential for the current handshake implementation usingread_exactandwrite_all. - Implemented extensive logging within
perform_handshake:- Logs the raw bytes of serialized messages before sending and after receiving.
- Logs the deserialized
HandshakeMessageobjects. - Logs any errors encountered during serialization or deserialization.
- Added logging to
validate_handshakefor key values and signature verification.
Testing:
- Manual testing of node connections has been conducted to verify successful communication following these changes.
Additional Notes:
- The detailed logging introduced in this PR will be instrumental in diagnosing any future handshake-related problems.