Skip to content

Commit

Permalink
Reset p2p intervals to original values (ethereum#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
asaj authored Sep 7, 2018
1 parent b1b3665 commit 1eff362
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions p2p/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ import (
const (
// This is the amount of time spent waiting in between
// redialing a certain node.
dialHistoryExpiration = 10 * time.Second
dialHistoryExpiration = 30 * time.Second

// Discovery lookups are throttled and can only run
// once every few seconds.
lookupInterval = 4 * time.Second

// If no peers are found for this amount of time, the initial bootnodes are
// attempted to be connected.
fallbackInterval = 6 * time.Second
fallbackInterval = 20 * time.Second

// Endpoint resolution is throttled with bounded backoff.
initialResolveDelay = 60 * time.Second
Expand Down
12 changes: 6 additions & 6 deletions p2p/dial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func runDialTest(t *testing.T, test dialtest) {
i, spew.Sdump(new), spew.Sdump(round.new), spew.Sdump(test.init), spew.Sdump(running))
}

// Time advances by 6 seconds on every round.
vtime = vtime.Add(6 * time.Second)
// Time advances by 16 seconds on every round.
vtime = vtime.Add(16 * time.Second)
running += len(new)
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestDialStateDynDial(t *testing.T) {
&dialTask{flags: dynDialedConn, dest: &discover.Node{ID: uintID(5)}},
},
new: []task{
&waitExpireTask{Duration: 4 * time.Second},
&waitExpireTask{Duration: 14 * time.Second},
},
},
// In this round, the peer with id 2 drops off. The query
Expand Down Expand Up @@ -485,7 +485,7 @@ func TestDialStateStaticDial(t *testing.T) {
&dialTask{flags: staticDialedConn, dest: &discover.Node{ID: uintID(5)}},
},
new: []task{
&waitExpireTask{Duration: 4 * time.Second},
&waitExpireTask{Duration: 14 * time.Second},
},
},
// Wait a round for dial history to expire, no new tasks should spawn.
Expand Down Expand Up @@ -542,7 +542,7 @@ func TestDialStaticAfterReset(t *testing.T) {
&dialTask{flags: staticDialedConn, dest: &discover.Node{ID: uintID(2)}},
},
new: []task{
&waitExpireTask{Duration: 10 * time.Second},
&waitExpireTask{Duration: 30 * time.Second},
},
},
}
Expand Down Expand Up @@ -603,7 +603,7 @@ func TestDialStateCache(t *testing.T) {
&dialTask{flags: staticDialedConn, dest: &discover.Node{ID: uintID(3)}},
},
new: []task{
&waitExpireTask{Duration: 4 * time.Second},
&waitExpireTask{Duration: 14 * time.Second},
},
},
// Still waiting for node 3's entry to expire in the cache.
Expand Down

0 comments on commit 1eff362

Please sign in to comment.