Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 2.03 KB

tip-621.md

File metadata and controls

54 lines (41 loc) · 2.03 KB
TIP: 621
Title: Add code version column to HelloMessage
Author: 317787106@qq.com
Status: Final
Type: Standards Track
discussions-to: https://github.com/tronprotocol/tips/issues/621
Category: Networking
Created: 2023-11-01

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 a codeVersion 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:

message HelloMessage {
  message BlockId {
    bytes hash = 1;
    int64 number = 2;
  }

  Endpoint from = 1;
  int32 version = 2;
  int64 timestamp = 3;
  BlockId genesisBlockId = 4;
  BlockId solidBlockId = 5;
  BlockId headBlockId = 6;
  bytes address = 7;
  bytes signature = 8;
  int32 nodeType = 9;
  int64 lowestBlockNum = 10;
  bytes codeVersion = 11; //new added
}

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.