Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2342] Update discovery logic to trust bootnodes only when out of sync #1039

Merged
merged 12 commits into from
Mar 6, 2019

Conversation

lucassaldanha
Copy link
Contributor

@lucassaldanha lucassaldanha commented Mar 4, 2019

When using smart contract based permissioning, the node will trust only its bootnodes until it reaches a sync'd state for the first time. Peer discovery will be disabled until we reach a sync'd state.

Summary:

  • Created SyncStatusNodePermissioningProvider class that subscribes to the Synchronizer SyncStatus updates to check if the node has ever reached a sync'd state.
  • Added a temporary implementation of NodePermissioningController that may or may not have a SyncStatusNodePermissioningProvider. For now, the default behaviour is to allow anything and never delay peer discovery.
  • Updated PeerDiscoveryController with the NodePermissioningController temporary implementation. It won't change the current behaviour of discovery.

@lucassaldanha lucassaldanha marked this pull request as ready for review March 5, 2019 03:45
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

LGTM

@lucassaldanha lucassaldanha merged commit 7fbbcc9 into PegaSysEng:master Mar 6, 2019
@lucassaldanha lucassaldanha deleted the PAN-2342 branch March 6, 2019 03:59
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.

3 participants