Skip to content
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

feat(net): add column codeVersion to HelloMessage #5584

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

317787106
Copy link
Contributor

What does this PR do?

  • add column codeVersion to HelloMessage

Why are these changes required?

  • know more information about peer

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@317787106 317787106 changed the title Feature/add code version feat(net): add column codeVersion to HelloMessage Nov 15, 2023
@317787106 317787106 linked an issue Nov 15, 2023 that may be closed by this pull request
builder.append("address:")
.append(StringUtil.encode58Check(address.toByteArray())).append("\n");
}

ByteString signature = helloMessage.getSignature();
if (signature != null && !signature.isEmpty()) {
if (!signature.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this field has some relationship with the codeVersion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this field has some relationship with the codeVersion?

No, only code optimization.

builder.append("signature:")
.append(signature.toByteArray().length).append("\n");
}

ByteString codeVersion = helloMessage.getCodeVersion();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this codeVersion be null when received a HelloMessage from a node with previous version ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every column in proto has default value. codeVersion has default value byte[0], not null.

@codecov-commenter
Copy link

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (de23b55) 64.64% compared to head (54704c2) 66.37%.
Report is 54 commits behind head on develop.

Files Patch % Lines
.../main/java/org/tron/core/db2/common/TxCacheDB.java 84.74% 8 Missing and 1 partial ⚠️
...g/tron/core/net/messagehandler/PbftMsgHandler.java 33.33% 3 Missing and 3 partials ⚠️
...rc/main/java/org/tron/core/services/http/Util.java 0.00% 6 Missing ⚠️
...e/net/messagehandler/SyncBlockChainMsgHandler.java 0.00% 5 Missing ⚠️
...gsfilter/capsule/TransactionLogTriggerCapsule.java 57.14% 0 Missing and 3 partials ⚠️
...rg/tron/core/services/http/RateLimiterServlet.java 25.00% 3 Missing ⚠️
...in/java/org/tron/core/store/CheckPointV2Store.java 71.42% 2 Missing ⚠️
.../tron/core/net/message/handshake/HelloMessage.java 71.42% 0 Missing and 2 partials ⚠️
...n/core/services/http/GetAssetIssueListServlet.java 60.00% 1 Missing and 1 partial ⚠️
...rg/tron/core/services/http/GetNowBlockServlet.java 66.66% 1 Missing and 1 partial ⚠️
... and 5 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #5584      +/-   ##
=============================================
+ Coverage      64.64%   66.37%   +1.72%     
- Complexity      9689    10206     +517     
=============================================
  Files            867      894      +27     
  Lines          51724    53846    +2122     
  Branches        5754     5932     +178     
=============================================
+ Hits           33435    35738    +2303     
+ Misses         15688    15315     -373     
- Partials        2601     2793     +192     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.4 milestone Dec 27, 2023
@halibobo1205 halibobo1205 merged commit 989115a into tronprotocol:develop Dec 27, 2023
6 checks passed
Copy link

@Nouri11190 Nouri11190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix and push through Tron Project

Copy link

@Danyalkasiri Danyalkasiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@@ -99,6 +100,9 @@ public void testOkHelloMessage()
Node node = new Node(NetUtil.getNodeId(), a1.getAddress().getHostAddress(), null, a1.getPort());
HelloMessage helloMessage = new HelloMessage(node, System.currentTimeMillis(),
ChainBaseManager.getChainBaseManager());

Assert.assertEquals(Version.getVersion(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@Danyalkasiri
Copy link

./

@Danyalkasiri
Copy link

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TIP-621: Add code version column to HelloMessage
8 participants