Skip to content

Conversation

@xxo1shine
Copy link
Contributor

@xxo1shine xxo1shine commented Aug 31, 2023

What does this PR do?
Fix failure to process FETCH_INV_DATA message, fix #5439.

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

}
long now = System.currentTimeMillis();
invToFetch.forEach((item, time) -> {
if (time < now - MSG_CACHE_DURATION_IN_BLOCKS * BLOCK_PRODUCED_INTERVAL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't MSG_CACHE_DURATION_IN_BLOCKS * BLOCK_PRODUCED_INTERVAL be replaced with TIMEOUT here?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.45%. Comparing base (b9ab07a) to head (7e2b7fc).
⚠️ Report is 524 commits behind head on develop.

Files with missing lines Patch % Lines
...java/org/tron/core/net/service/adv/AdvService.java 50.00% 4 Missing and 2 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5460   +/-   ##
==========================================
  Coverage      61.45%   61.45%           
+ Complexity      9370     9369    -1     
==========================================
  Files            846      846           
  Lines          50298    50300    +2     
  Branches        5585     5585           
==========================================
+ Hits           30911    30913    +2     
+ Misses         16969    16968    -1     
- Partials        2418     2419    +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

invToFetch.remove(item);
});
peers.stream().filter(peer -> {
Long t = peer.getAdvInvReceive().getIfPresent(item);
Copy link
Contributor

Choose a reason for hiding this comment

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

t(L282) and time(L274) isn't that close to the same?

image image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not the same, times from different caches

Copy link
Contributor

Choose a reason for hiding this comment

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

math.abs(t-time) is very close to 0. Am I getting this right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right.

Copy link
Contributor

Choose a reason for hiding this comment

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

math.abs(t-time) is very close to 0

if time >= now - TIMEOUT, now - t < TIMEOUT when is it false?

long now = System.currentTimeMillis();
invToFetch.forEach((item, time) -> {
if (time < now - MSG_CACHE_DURATION_IN_BLOCKS * BLOCK_PRODUCED_INTERVAL) {
if (time < now - TIMEOUT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an assumption: no more than 2w transactions will be broadcast within 15s?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At present, it is basically impossible to reach 20,000 within 15 seconds. We only focus on time and not TPS.

@xxo1shine xxo1shine merged commit 9f8cebd into tronprotocol:develop Sep 8, 2023
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.3 milestone Sep 12, 2023
@xxo1shine xxo1shine deleted the fix_msg_process branch May 28, 2024 01:16
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.

Failed to process FETCH_INV_DATA message

6 participants