-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIP-621: Add code version column to HelloMessage #621
Comments
Suppose one peer sends a message to the local node, but this local node with the latest code fails to process it. If the peer runs an older version, this failure could be expected. So, we can close the connection directly when we received a HelloMessage which contains an older version, is this right? |
Not exactly, there is an prerequisites, namely one bug exist in code with old version. Connection will be closed if node fails to process to message. |
Is that reasonable to close the connection when it fails to process the message? So, will it be easier to recognize this situation? |
@lurais The current design is that the newly added field is only used to carry additional information and is not used for logical judgment. In addition, protobuf is compatible with newly added fields and will not cause message parsing issues between new and old code. I hope my answer can resolve your doubts. |
So, why should add this additional information? what will it be used for ? |
@lurais This information helps to resolve problem, some issue only exist when interaction with different version of java-tron |
Simple Summary
This TIP describes why the code version column needs to be added to
HelloMessage
when node handshakes with peers.Abstract
A new column code version is added to the proto message
HelloMessage
so that the local node can learn more information about peers when handshaking.Motivation
There have been 73 release versions of Java-tron until 2023-11-01. In the mainnet or Nile network, nodes running different versions may exist at the same time. Generally, each new version fixes some bugs from the previous one. How to verify that we have fixed this bug? Suppose one peer sends a message to the local node, but this local node with the latest code fails to process it. If the peer runs an older version, this failure could be expected.
The key point is that the peer's code version can not be acquired easily. One possible way is to get it through the
/wallet/getnodeinfo
API, but in most cases, we cannot access HTTP services. Another solution is to add acodeVersion
field in the HelloMessage when handshaking with peers. This does not rely on HTTP and can be easily implemented. Please find the details below.Specification
In the proto file protos/core/Tron.proto, add one column codeVersion:
The column codeVersion comes from
Version
of org.tron.program.Version, latest value is "4.7.3".Compatibility
If the node parses the message without columncodeVersion, it uses default null. This column will only be logged.
The text was updated successfully, but these errors were encountered: