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

Feature: Sync check added to broadcast stage #1856

Merged
merged 2 commits into from
May 12, 2020

Conversation

kwek20
Copy link
Contributor

@kwek20 kwek20 commented May 7, 2020

Description of change

Extracts our sync checker to a service, and uses that service in the BroadcastStage of the Network pipeline.

This is required because if you get all your new transactions from 1 neighbour, and have 1 other neighbour which doesnt have the transaction you need, there is no chance of syncing.

If that second neighbour sends you a very low amount of new transactions(compared to the other neighbour) you will still sync, but very slow.

This has been introduced due to our removal of "ping pong" in #1745

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How the change has been tested

The stuck node got unstuck in the scenario described above

@kwek20 kwek20 force-pushed the sync-check-broadcast branch 3 times, most recently from 05fd88c to 65873be Compare May 7, 2020 17:41
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

Looks awesome

Just one small multi-threaded change

/**
* If this node is currently seen as in sync
*/
private boolean isInSync;
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though currently we have one thread per stage, let's do this correctly and make this variable volatile/atomic.. since supposedly with a small change we can have more than one broadcast thread

@kwek20 kwek20 force-pushed the sync-check-broadcast branch from 2780beb to ae372b3 Compare May 10, 2020 14:09
@kwek20
Copy link
Contributor Author

kwek20 commented May 11, 2020

@GalRogozinski can we merge this, so i can easily merge 1.8.6 onto the progressbar PR?

@GalRogozinski GalRogozinski merged commit 6828cc4 into iotaledger:release-v1.8.6 May 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants