You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS : Linux
JVM : Oracle Corporation 1.8.0_161 amd64
Git : a8ad2a169e58946b5b8de6ecf7b7ef5b8db05aff
Version : 4.7.5
Code : 18306
Expected behaviour
When disconnected, the exact reason for the disconnection can be obtained through the disconnection message.
Actual behaviour
When running Java-tron, I found that if I wanted to disconnect a peer in certain scenarios, the disconnect message sent carried an ambiguous reason code. You can take a look at the example below.
Example:
The node receives the block sent by the peer and then disconnects the peer due to block signature verification failure, but the reason for the disconnection message being sent is UNKNOWN.
Therefore, after receiving the disconnection message, the peer cannot accurately know the specific reason for being disconnected. I think the reason code carried in the disconnect message in this example can be clearer. In addition, do you think it is necessary to check whether there are other disconnection scenarios with similar problems?
Frequency
It occurs every time in the above scenarios.
Steps to reproduce the behaviour
Send a block with an invalid signature to the node.
Backtrace
[backtrace]
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered:
@abn2357 There are many scenarios where the connection with the peer will be disconnected, such as: handshake failure, data acquisition timeout, receiving messages sent by the peer that do not conform to the protocol, etc.
I later discovered a scenario where the reason code was unreasonable:
When handling HelloMessage in processHelloMessage function in HandshakeService, a check is made:
if (!msg.valid()) {
...
peer.disconnect(ReasonCode.UNEXPECTED_IDENTITY);
When an error occurs, the error code of UNEXPECTED_IDENTITY will be returned, but no identity-related validity check is actually performed.
Software Versions
Expected behaviour
When disconnected, the exact reason for the disconnection can be obtained through the disconnection message.
Actual behaviour
When running Java-tron, I found that if I wanted to disconnect a peer in certain scenarios, the disconnect message sent carried an ambiguous reason code. You can take a look at the example below.
Example:
The node receives the block sent by the peer and then disconnects the peer due to block signature verification failure, but the reason for the disconnection message being sent is UNKNOWN.
Therefore, after receiving the disconnection message, the peer cannot accurately know the specific reason for being disconnected. I think the reason code carried in the disconnect message in this example can be clearer. In addition, do you think it is necessary to check whether there are other disconnection scenarios with similar problems?
Frequency
It occurs every time in the above scenarios.
Steps to reproduce the behaviour
Send a block with an invalid signature to the node.
Backtrace
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered: