Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add network ready event - Closes #4090 #4100

Merged
merged 10 commits into from
Aug 17, 2019
Merged

Conversation

mitsuaki-u
Copy link
Contributor

@mitsuaki-u mitsuaki-u commented Aug 16, 2019

What was the problem?

Node was attempting to load transactions and signatures before it was connected to any peers on p2p network. This caused an error message: RequestFailError: Request failed due to no peers found in peer selection.

How did I solve it?

  1. Created EVENT_NETWORK_READY which the network module listens for before publishing network:bootstrap and calling loader.loadTransactionsAndSignatures.

  2. peerSelectForRequest now simply shuffles peerList and selects one, instead of using height histogram.

How to manually test it?

Start 2.3.0 node and connect to testnet. Observe that there is no RequestFailError.

Review checklist

elements/lisk-p2p/src/peer_pool.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jondubois jondubois left a comment

Choose a reason for hiding this comment

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

Looks good, just one point.

elements/lisk-p2p/src/peer_pool.ts Outdated Show resolved Hide resolved
@shuse2 shuse2 requested a review from jondubois August 16, 2019 19:38
@shuse2 shuse2 merged commit cdb674d into release/2.3.0 Aug 17, 2019
@shuse2 shuse2 deleted the 4090_network_ready branch August 17, 2019 07:43
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.

None yet

5 participants