Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Remove ping pong from reply stage #1745

Merged
merged 3 commits into from
Feb 6, 2020

Conversation

DyrellC
Copy link
Contributor

@DyrellC DyrellC commented Feb 6, 2020

Description

There has been a syncing issue that arose from the internal tests that resulted in a flood of back and forth gossiping of the latest milestone. It fills the queues and stops the node from processing relevant transactions in a timely manner. This issue self corrects at times, but in other cases it stalls out for hours. It is possible that this is caused by the continued pushing of these transactions to the neighbors through the reply stage.

Type of change

  • Bug fix (a non-breaking change which fixes an issue)

How Has This Been Tested?

  • After running a node with this change I did not experience the sync issue

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

Comment on lines -149 to -158
// we didn't have the requested transaction (random or explicit) from the neighbor but we will immediately reply
// with the latest known milestone and a needed transaction hash, to keep up the ping-pong
try {
final TransactionViewModel msTVM = TransactionViewModel.fromHash(tangle,
latestMilestoneTracker.getLatestMilestoneHash());
neighborRouter.gossipTransactionTo(neighbor, msTVM, false);
} catch (Exception e) {
e.printStackTrace();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I am trying to think...
Intuitively I would think that there is an else is missing above the try...
This is because this is what the comment says. But let's think critically about this.

If we delete this code it means that if we request a non-existing tx the ping-pong would stop.
If I am a non-synced node and I am getting requests for transactions that I don't have then I won't request transactions that are missing from those nodes, and the ping pong would stop.

However if a neighbor is requesting from me transactions that I don't have then the neighbor is:

  1. Also out of sync
  2. Malicious

In case of (1) it means that I am sending the same transactions over and over again, thus slowing down an not helping with the sync. This will stop the ping pong between them but newly broadcasted txs should liven it up

In case of (2) we obviously shouldn't send a message

As long as there is 1 synced node in the network it should be able to sync the rest of the nodes eventually
So I support deleting and not adding else

@GalRogozinski GalRogozinski merged commit eb4e1a4 into iotaledger:dev Feb 6, 2020
DyrellC added a commit to DyrellC/iri that referenced this pull request Mar 9, 2020
acha-bill added a commit to DyrellC/iri that referenced this pull request Mar 9, 2020
acha-bill added a commit to DyrellC/iri that referenced this pull request Mar 11, 2020
DyrellC pushed a commit to DyrellC/iri that referenced this pull request Mar 17, 2020
@GalRogozinski GalRogozinski mentioned this pull request May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants