diff options
author | lash <nolash@users.noreply.github.com> | 2019-01-10 19:33:51 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2019-01-10 19:33:51 +0800 |
commit | 7240f4d800d3ffb97cf23a27d13746428d761cec (patch) | |
tree | 7a632be60e304e1aed98a826dc526df48c3a1c0e /swarm/network/simulations | |
parent | 7ca40306af9da68a0d31439117246de8247f99d6 (diff) | |
download | dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.gz dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.zst dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.zip |
swarm/network: Rename minproxbinsize, add as member of simulation (#18408)
* swarm/network: Rename minproxbinsize, add as member of simulation
* swarm/network: Deactivate WaitTillHealthy, unreliable pending suggestpeer
Diffstat (limited to 'swarm/network/simulations')
-rw-r--r-- | swarm/network/simulations/discovery/discovery_test.go | 10 | ||||
-rw-r--r-- | swarm/network/simulations/overlay.go | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/swarm/network/simulations/discovery/discovery_test.go b/swarm/network/simulations/discovery/discovery_test.go index bd8686522..e5121c477 100644 --- a/swarm/network/simulations/discovery/discovery_test.go +++ b/swarm/network/simulations/discovery/discovery_test.go @@ -46,7 +46,7 @@ import ( // serviceName is used with the exec adapter so the exec'd binary knows which // service to execute const serviceName = "discovery" -const testMinProxBinSize = 2 +const testNeighbourhoodSize = 2 const discoveryPersistenceDatadir = "discovery_persistence_test_store" var discoveryPersistencePath = path.Join(os.TempDir(), discoveryPersistenceDatadir) @@ -268,7 +268,7 @@ func discoverySimulation(nodes, conns int, adapter adapters.NodeAdapter) (*simul wg.Wait() log.Debug(fmt.Sprintf("nodes: %v", len(addrs))) // construct the peer pot, so that kademlia health can be checked - ppmap := network.NewPeerPotMap(network.NewKadParams().MinProxBinSize, addrs) + ppmap := network.NewPeerPotMap(network.NewKadParams().NeighbourhoodSize, addrs) check := func(ctx context.Context, id enode.ID) (bool, error) { select { case <-ctx.Done(): @@ -404,7 +404,7 @@ func discoveryPersistenceSimulation(nodes, conns int, adapter adapters.NodeAdapt } healthy := &network.Health{} addr := id.String() - ppmap := network.NewPeerPotMap(network.NewKadParams().MinProxBinSize, addrs) + ppmap := network.NewPeerPotMap(network.NewKadParams().NeighbourhoodSize, addrs) if err := client.Call(&healthy, "hive_healthy", ppmap); err != nil { return fmt.Errorf("error getting node health: %s", err) } @@ -492,7 +492,7 @@ func discoveryPersistenceSimulation(nodes, conns int, adapter adapters.NodeAdapt return false, fmt.Errorf("error getting node client: %s", err) } healthy := &network.Health{} - ppmap := network.NewPeerPotMap(network.NewKadParams().MinProxBinSize, addrs) + ppmap := network.NewPeerPotMap(network.NewKadParams().NeighbourhoodSize, addrs) if err := client.Call(&healthy, "hive_healthy", ppmap); err != nil { return false, fmt.Errorf("error getting node health: %s", err) @@ -566,7 +566,7 @@ func newService(ctx *adapters.ServiceContext) (node.Service, error) { addr := network.NewAddr(ctx.Config.Node()) kp := network.NewKadParams() - kp.MinProxBinSize = testMinProxBinSize + kp.NeighbourhoodSize = testNeighbourhoodSize if ctx.Config.Reachable != nil { kp.Reachable = func(o *network.BzzAddr) bool { diff --git a/swarm/network/simulations/overlay.go b/swarm/network/simulations/overlay.go index 284ae6398..63938809e 100644 --- a/swarm/network/simulations/overlay.go +++ b/swarm/network/simulations/overlay.go @@ -86,7 +86,7 @@ func (s *Simulation) NewService(ctx *adapters.ServiceContext) (node.Service, err addr := network.NewAddr(node) kp := network.NewKadParams() - kp.MinProxBinSize = 2 + kp.NeighbourhoodSize = 2 kp.MaxBinSize = 4 kp.MinBinSize = 1 kp.MaxRetries = 1000 |