SkipDuplicate -> AllowDuplicate; fix p2p test on mac
This commit is contained in:
parent
432f21452d
commit
d454b1b25f
|
@ -10,12 +10,16 @@ BREAKING:
|
|||
FEATURES
|
||||
|
||||
- [rpc] the RPC documentation is now published to https://tendermint.github.io/slate
|
||||
- [p2p] AllowDuplicateIP config option to refuse connections from same IP.
|
||||
- true by default for now, false by default in next breaking release
|
||||
- [docs] Add docs for query, tx indexing, events, pubsub
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
- [consensus] consensus reactor now receives events from a separate event bus,
|
||||
which is not dependant on external RPC load
|
||||
- [consensus/wal] do not look for height in older files if we've seen height - 1
|
||||
- [docs] Various cleanup and link fixes
|
||||
|
||||
## 0.19.6
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ type P2PConfig struct {
|
|||
PrivatePeerIDs string `mapstructure:"private_peer_ids"`
|
||||
|
||||
// Toggle to disable guard against peers connecting from the same ip.
|
||||
SkipDuplicatePeerIPCheck bool `mapstructure:"skip_duplicate_peer_ip_check"`
|
||||
AllowDuplicateIP bool `mapstructure:"allow_duplicate_ip"`
|
||||
}
|
||||
|
||||
// DefaultP2PConfig returns a default configuration for the peer-to-peer layer
|
||||
|
@ -311,6 +311,7 @@ func DefaultP2PConfig() *P2PConfig {
|
|||
PexReactor: true,
|
||||
SeedMode: false,
|
||||
AuthEnc: true,
|
||||
AllowDuplicateIP: true, // so non-breaking yet
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,7 +321,7 @@ func TestP2PConfig() *P2PConfig {
|
|||
cfg.ListenAddress = "tcp://0.0.0.0:36656"
|
||||
cfg.SkipUPNP = true
|
||||
cfg.FlushThrottleTimeout = 10
|
||||
cfg.SkipDuplicatePeerIPCheck = true
|
||||
cfg.AllowDuplicateIP = true
|
||||
return cfg
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ var (
|
|||
func init() {
|
||||
config = cfg.DefaultP2PConfig()
|
||||
config.PexReactor = true
|
||||
config.SkipDuplicatePeerIPCheck = true
|
||||
config.AllowDuplicateIP = true
|
||||
}
|
||||
|
||||
func TestPEXReactorBasic(t *testing.T) {
|
||||
|
|
|
@ -577,7 +577,7 @@ func (sw *Switch) addPeer(pc peerConn) error {
|
|||
}
|
||||
|
||||
// Check for duplicate connection or peer info IP.
|
||||
if !sw.config.SkipDuplicatePeerIPCheck &&
|
||||
if !sw.config.AllowDuplicateIP &&
|
||||
(sw.peers.HasIP(pc.RemoteIP()) ||
|
||||
sw.peers.HasIP(peerNodeInfo.NetAddress().IP)) {
|
||||
return ErrSwitchDuplicatePeerIP{pc.RemoteIP()}
|
||||
|
|
|
@ -25,6 +25,7 @@ var (
|
|||
func init() {
|
||||
config = cfg.DefaultP2PConfig()
|
||||
config.PexReactor = true
|
||||
config.AllowDuplicateIP = true
|
||||
}
|
||||
|
||||
type PeerMessage struct {
|
||||
|
@ -180,7 +181,7 @@ func TestConnAddrFilter(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSwitchFiltersOutItself(t *testing.T) {
|
||||
s1 := MakeSwitch(config, 1, "127.0.0.2", "123.123.123", initSwitchFunc)
|
||||
s1 := MakeSwitch(config, 1, "127.0.0.1", "123.123.123", initSwitchFunc)
|
||||
// addr := s1.NodeInfo().NetAddress()
|
||||
|
||||
// // add ourselves like we do in node.go#427
|
||||
|
@ -322,7 +323,7 @@ func TestSwitchReconnectsToPersistentPeer(t *testing.T) {
|
|||
Config: DefaultPeerConfig(),
|
||||
// Use different interface to prevent duplicate IP filter, this will break
|
||||
// beyond two peers.
|
||||
listenAddr: "127.0.0.2:0",
|
||||
listenAddr: "127.0.0.1:0",
|
||||
}
|
||||
rp.Start()
|
||||
defer rp.Stop()
|
||||
|
|
Loading…
Reference in New Issue