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
This TIP describes why and how we supplement disconnect reasons in java-tron.
Abstract
We supplement two disconnect reasons in java-tron, including NOT_WITNESS used inRelayService and NO_SUCH_MESSAGE in P2pEventHandlerImpl, so other peers can acquire the reason why we disconnect with it better.
Motivation
Java-tron nodes send DisconnectMessage to peers before stopping the connection. When stopping, the nodes use relatedReasonCode if it exists as DisconnectMessage, otherwise, no message would be sent. Most java-tron logs record the ReasonCode of peer disconnection, but some do not. For example, the reason for disconnection with non-witness nodes in RelayService is not given.
Specification
Unused ReasonCode
We summarize the use of ReasonCode, many of which have been abandoned and some are moved to libp2p, they may get deleted in the future:
So, we can use this ReasonCode here, such as in RelayService.java :
Send ReasonCode to peer before node quits
Any node should notify peers of the reason when it quits, so others can understand the network better:
public static void close() {
...
for (PeerConnection p : new ArrayList<>(peers)) {
if (!p.isDisconnect()) {
p.disconnect(ReasonCode.PEER_QUITING); //added
p.getChannel().close();
}
}
...
}
Compatibility
All of the newly added unrecognized ReasonCode will be converted to UNKNOWN, and no exception will be thrown.
The text was updated successfully, but these errors were encountered:
317787106
changed the title
Supplement Disconnect Reasons in Java-tron
TIP-592: Supplement Disconnect Reasons in Java-tron
Sep 13, 2023
Simple Summary
This TIP describes why and how we supplement disconnect reasons in java-tron.
Abstract
We supplement two disconnect reasons in java-tron, including NOT_WITNESS used inRelayService and NO_SUCH_MESSAGE in P2pEventHandlerImpl, so other peers can acquire the reason why we disconnect with it better.
Motivation
Java-tron nodes send DisconnectMessage to peers before stopping the connection. When stopping, the nodes use relatedReasonCode if it exists as DisconnectMessage, otherwise, no message would be sent. Most java-tron logs record the ReasonCode of peer disconnection, but some do not. For example, the reason for disconnection with non-witness nodes in RelayService is not given.
Specification
Unused ReasonCode
We summarize the use of ReasonCode, many of which have been abandoned and some are moved to libp2p, they may get deleted in the future:
Add new types to Java-tron ReasonCode
Add the following enumeration type to protos/core/Tron.proto
So, we can use this ReasonCode here, such as in RelayService.java :
Send ReasonCode to peer before node quits
Any node should notify peers of the reason when it quits, so others can understand the network better:
Compatibility
All of the newly added unrecognized ReasonCode will be converted to UNKNOWN, and no exception will be thrown.
The text was updated successfully, but these errors were encountered: