Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Network testing framework simulations fixes#119

Closed
zelig wants to merge 6 commits into
p2p-simulationsfrom
network-testing-framework-simulations
Closed

Network testing framework simulations fixes#119
zelig wants to merge 6 commits into
p2p-simulationsfrom
network-testing-framework-simulations

Conversation

@zelig
Copy link
Copy Markdown
Member

@zelig zelig commented Sep 18, 2017

This PR is fixing some of the issues that prevents network simulations from working properly
causing deadlocks or failing redials

the last commit is a hack!

overall the PR causes 3 tests to fail:

  • TestProtocolHandshake related to SetWriteDeadline error check
  • TestMsgFilterPassWildcard and TestMsgFilterPassMultiple

@zelig zelig self-assigned this Sep 18, 2017
@zelig zelig requested review from fjl and lmars September 18, 2017 12:07
 * refactor simulations/network connection getters
   to support avoiding simultaneous dials between two peers
   If two peers dial simultaneously, the connection will be dropped
   to help avoid that, we essentially lock the connection object
   with a timestamp which serves as a ban on dialing for
   a period of time (dialBanTimeout).

 * The connection getter InitConn can be wrapped and passed to
   the nodes via adapters.NodeConfig#Reachable field and then
   used by the respective services when they initiate connections.

   This massively stablise the emerging connectivity when running
   with hundreds of nodes bootstrapping a network

 * introduce EnableMsgEvents boolean field in NodeConfig
 rlpx tries to send discreason to disconnected peer
 if the connection is net.Pipe (in-memory simulation)
 it hangs forever, since net.Pipe does not implement
 a write deadline. This commit adds error checking
 on the SetWriteDeadline call and only tries to send
 the disconnect reason message if there is no error
 to support debugging in-memory network simulations
 multiple peers are logging
  the server refuses to redial static peers if using
  dialstate.addstatic call

  instead the dialtask is directly appended to the queue
  this fixes the no redial problem but is clearly a hack
* SetupConn now returns error
* dial checks the error and calls resolve on failed dial only
@zelig zelig force-pushed the network-testing-framework-simulations branch from ed2cc12 to 00e9d62 Compare September 18, 2017 14:54
@lmars
Copy link
Copy Markdown

lmars commented Sep 25, 2017

We are going to PR this to master, closing.

@lmars lmars closed this Sep 25, 2017
@lmars lmars deleted the network-testing-framework-simulations branch September 25, 2017 09:41
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