feat(net): fix failure to process FETCH_INV_DATA message#5460
feat(net): fix failure to process FETCH_INV_DATA message#5460xxo1shine merged 2 commits intotronprotocol:developfrom
Conversation
| } | ||
| long now = System.currentTimeMillis(); | ||
| invToFetch.forEach((item, time) -> { | ||
| if (time < now - MSG_CACHE_DURATION_IN_BLOCKS * BLOCK_PRODUCED_INTERVAL) { |
There was a problem hiding this comment.
Shouldn't MSG_CACHE_DURATION_IN_BLOCKS * BLOCK_PRODUCED_INTERVAL be replaced with TIMEOUT here?
|
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
| invToFetch.remove(item); | ||
| }); | ||
| peers.stream().filter(peer -> { | ||
| Long t = peer.getAdvInvReceive().getIfPresent(item); |
There was a problem hiding this comment.
Not the same, times from different caches
There was a problem hiding this comment.
math.abs(t-time) is very close to 0. Am I getting this right?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Is there an assumption: no more than 2w transactions will be broadcast within 15s?
There was a problem hiding this comment.
At present, it is basically impossible to reach 20,000 within 15 seconds. We only focus on time and not TPS.


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:
Follow up
Extra details