Skip to content

Ambiguous Reason Code in Disconnection Message #5989

Open
@jwrct

Description

@jwrct

Software Versions

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.

10:17:39.014 WARN  [peerWorker-1] [net](P2pEventHandlerImpl.java:258) Message from /172.31.0.220:10850 process failed, type: BLOCK Num:58698013,ID:00000000037fa91d2bbac58ad77bd462a2878178e730eb93a4d3e00e21cbe52e, trx size: 4 type: (15, block sign error), detail: valid signature failed.

10:17:39.014 INFO  [peerWorker-1] [net](PeerConnection.java:175) Send peer /172.31.0.220:10850 message type: P2P_DISCONNECT reason: 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions