aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulation
diff options
context:
space:
mode:
authorlash <nolash@users.noreply.github.com>2018-11-27 00:13:59 +0800
committerAnton Evangelatov <anton.evangelatov@gmail.com>2018-11-27 00:13:59 +0800
commit1cd007ecae437f5cc54a026e592edfad642a0b69 (patch)
tree07f5b68365cca5d8be1ba69d9ab1b475ff4613e0 /swarm/network/simulation
parentbba5fd81921ee700388b4db72db3240d32576b6c (diff)
downloaddexon-1cd007ecae437f5cc54a026e592edfad642a0b69.tar
dexon-1cd007ecae437f5cc54a026e592edfad642a0b69.tar.gz
dexon-1cd007ecae437f5cc54a026e592edfad642a0b69.tar.bz2
dexon-1cd007ecae437f5cc54a026e592edfad642a0b69.tar.lz
dexon-1cd007ecae437f5cc54a026e592edfad642a0b69.tar.xz
dexon-1cd007ecae437f5cc54a026e592edfad642a0b69.tar.zst
dexon-1cd007ecae437f5cc54a026e592edfad642a0b69.zip
swarm/network: Correct neighborhood depth (#18066)
Diffstat (limited to 'swarm/network/simulation')
-rw-r--r--swarm/network/simulation/example_test.go4
-rw-r--r--swarm/network/simulation/kademlia.go1
-rw-r--r--swarm/network/simulation/kademlia_test.go1
3 files changed, 6 insertions, 0 deletions
diff --git a/swarm/network/simulation/example_test.go b/swarm/network/simulation/example_test.go
index bacc64d53..7b6204617 100644
--- a/swarm/network/simulation/example_test.go
+++ b/swarm/network/simulation/example_test.go
@@ -33,6 +33,10 @@ import (
// BucketKeyKademlia key. This allows to use WaitTillHealthy to block until
// all nodes have the their Kadmlias healthy.
func ExampleSimulation_WaitTillHealthy() {
+
+ log.Error("temporarily disabled as simulations.WaitTillHealthy cannot be trusted")
+ return
+
sim := simulation.New(map[string]simulation.ServiceFunc{
"bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
addr := network.NewAddr(ctx.Config.Node())
diff --git a/swarm/network/simulation/kademlia.go b/swarm/network/simulation/kademlia.go
index f895181d9..7982810ca 100644
--- a/swarm/network/simulation/kademlia.go
+++ b/swarm/network/simulation/kademlia.go
@@ -33,6 +33,7 @@ var BucketKeyKademlia BucketKey = "kademlia"
// WaitTillHealthy is blocking until the health of all kademlias is true.
// If error is not nil, a map of kademlia that was found not healthy is returned.
+// TODO: Check correctness since change in kademlia depth calculation logic
func (s *Simulation) WaitTillHealthy(ctx context.Context, kadMinProxSize int) (ill map[enode.ID]*network.Kademlia, err error) {
// Prepare PeerPot map for checking Kademlia health
var ppmap map[string]*network.PeerPot
diff --git a/swarm/network/simulation/kademlia_test.go b/swarm/network/simulation/kademlia_test.go
index 285644a0f..024830315 100644
--- a/swarm/network/simulation/kademlia_test.go
+++ b/swarm/network/simulation/kademlia_test.go
@@ -28,6 +28,7 @@ import (
)
func TestWaitTillHealthy(t *testing.T) {
+
sim := New(map[string]ServiceFunc{
"bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
addr := network.NewAddr(ctx.Config.Node())