Anton Kaliaev
9962e598a0
reconnect to self-reported address if persistent peer is inbound ( #2031 )
* reconnect to self-reported address if persistent peer is inbound
* add a fixme
6 years ago
ValarDragon
c798702764
crypto: Remove Ed25519 and Secp256k1 suffix on GenPrivKey
6 years ago
ValarDragon
99e582d79a
crypto: Refactor to move files out of the top level directory
Currently the top level directory contains basically all of the code
for the crypto package. This PR moves the crypto code into submodules
in a similar manner to what `golang/x/crypto` does. This improves code
organization.
Ref discussion: https://github.com/tendermint/tendermint/pull/1966
Closes #1956
6 years ago
Anton Kaliaev
b31ee798bd
preserve original address and dial it instead of self-reported address ( #1994 )
Refs #1720
6 years ago
Jeremiah Andrews
6c4ca140ed
Add private peer ID tracking to AddrBook ( #1989 )
* Add private peer ID tracking to AddrBook
* Remove private peer tracking/blocking from pex
* debug level msg when we fail to add private address
6 years ago
needkane
449846ccb2
NodeInfo version check: delete redundant code
6 years ago
Dev Ojha
dae7dc30e0
Switch usage of math/rand to cmn's rand ( #1980 )
This commit switches all usage of math/rand to cmn's rand. The only
exceptions are within the random file itself, the tools package, and the
crypto package. In tools you don't want it to lock between the go-routines.
The crypto package doesn't use it so the crypto package have no other
dependencies within tendermint/tendermint for easier portability.
Crypto/rand usage is unadjusted.
Closes #1343
6 years ago
Zach Ramsay
44dad6d70b
Revert "detele everything"
This reverts commit d02c5d1e30
.
6 years ago
Zach Ramsay
d02c5d1e30
detele everything
6 years ago
Anton Kaliaev
a19e857f2e
[pex] switch to MustMarshalBinaryBare and UnmarshalBinaryBare
Refs #646
6 years ago
Anton Kaliaev
9120fd5d14
unexport DecodeMessage functions
Refs #646
6 years ago
Ethan Buchman
c3504c111e
add test
6 years ago
Ethan Buchman
737c5c065d
fixes from review
6 years ago
Ethan Buchman
1c018d3fd2
p2p: external address
* new config option for external address to advertise
* if blank, defaults to best guess from listener
* if laddr ip address is also blank, default to IPv4
6 years ago
Ethan Buchman
d55243f0e6
fix import paths
6 years ago
Anton Kaliaev
9752e059e1
fix nil pointer panic by checking if peer is nil
Fixes #1830
remember that PeerSet#Get can return nil
6 years ago
Anton Kaliaev
61c5791fa3
revert back to Jae's original payload size limit
except now we calculate the max size using the maxPacketMsgSize()
function, which frees developers from having to know amino encoding
details.
plus, 10 additional bytes are added to leave the room for amino upgrades
(both making it more efficient / less efficient)
6 years ago
Anton Kaliaev
ab04201c3d
fix empty packet size calculation
Fixes #1762#issuecomment-398940107
6 years ago
Anton Kaliaev
ada5ef0669
[p2p] add godoc comments to Listener ( #1828 )
* update changelog
* document p2p/listener
* do not expose underlying net.Listener
* add a TODO
* replace todo with a comment
6 years ago
kph7
e556e3336e
Adding IPv6 support to peering ( #1818 )
6 years ago
Dev Ojha
b1d6deaf0b
config: rename skip_upnp to upnp ( #1827 )
* config: rename skip_upnp to upnp
Change default option to enable upnp.
Closes #1806
* doc updates
- fix comment and set UPNP to false in TestP2PConfig
- add UPNP to config template
- update changelog
6 years ago
Ricardo Domingos
e6abdb8b9d
p2p/trust: Fix nil pointer error on TrustMetric Copy() ( #1819 )
6 years ago
Liamsi
a39b2522d5
review comments:
- re-add test
- add TODO
- err instead of panic where possible
7 years ago
Liamsi
d2c05bc5b9
Revert "delete everything" (includes everything non-go-crypto)
This reverts commit 96a3502
7 years ago
Liamsi
96a3502126
delete everything
7 years ago
Anton Kaliaev
205d8b8062
fixes after @xla review
- move prometheus metrics into internal packages
- *Option structs
- misc. format changes
7 years ago
Anton Kaliaev
e4bb3566a0
move metrics constructors to a separate package
7 years ago
Anton Kaliaev
84812145cb
friendly apis for constructors
7 years ago
Anton Kaliaev
b10b0da3fd
bundle imports
7 years ago
Anton Kaliaev
19699d644f
p2p metric, make height and totalTxs gauges
7 years ago
Dev Ojha
b84f788f36
Switch ports 466xx to 266xx ( #1735 )
* Switch ports 466xx to be 266xx
This is done so the default ports aren't in the linux kernel's default ephemeral port range.
* Update ABCI import
* Bump cache on circleci
* Get more verbose output for debugging
* Bump abci dependency
* Fix accidental change of a block header's hash
* pin abci release
7 years ago
Anton Kaliaev
cd3a240c9f
return an error if we fail to parse external IP
```
I[06-08|11:51:57.234] Getting UPNP external address module=p2p
I[06-08|11:51:58.867] Got UPNP external address module=p2p address=
```
Fixes #1717
```
I[06-08|11:51:56.952] Starting multiAppConn module=proxy impl=multiAppConn
I[06-08|11:51:56.952] Starting localClient module=abci-client connection=query impl=localClient
I[06-08|11:51:56.952] Starting localClient module=abci-client connection=mempool impl=localClient
I[06-08|11:51:56.952] Starting localClient module=abci-client connection=consensus impl=localClient
I[06-08|11:51:56.952] ABCI Handshake module=consensus appHeight=0 appHash=
I[06-08|11:51:56.952] ABCI Replay Blocks module=consensus appHeight=0 storeHeight=0 stateHeight=0
I[06-08|11:51:57.053] Completed ABCI Handshake - Tendermint and App are synced module=consensus appHeight=0 appHash=
I[06-08|11:51:57.053] This node is a validator module=consensus addr=6816B5D9BAC32A3CDF07884D9D3D2650694C371D pubKey=PubKeyEd25519{27A40CD032DD2467342D0CF27C5EC92052D966FEC714B6CF2F3BF3146AFD0D51}
I[06-08|11:51:57.234] Starting Node module=main impl=Node
I[06-08|11:51:57.234] Starting EventBus module=events impl=EventBus
I[06-08|11:51:57.234] Local listener module=p2p ip=:: port=46656
I[06-08|11:51:57.234] Getting UPNP external address module=p2p
I[06-08|11:51:58.867] Got UPNP external address module=p2p address=
I[06-08|11:51:58.867] Starting DefaultListener module=p2p impl=Listener(@<nil>:46656)
I[06-08|11:51:58.867] P2P Node ID module=main ID=3629b516392e494ae717ac4c6a1ea7eb0fe421c3 file=/home/tpb/.tendermint/config/node_key.json
I[06-08|11:51:58.868] Add our address to book module=p2p book=/home/tpb/.tendermint/config/addrbook.json addr=null
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x89fb86]
goroutine 1 [running]:
github.com/tendermint/tendermint/p2p.(*NetAddress).String(0x0, 0xc96e24, 0x17)
/home/tpb/code/go/src/github.com/tendermint/tendermint/p2p/netaddress.go:171 +0x26
github.com/tendermint/tendermint/p2p/pex.(*addrBook).AddOurAddress(0xc420190620, 0x0)
/home/tpb/code/go/src/github.com/tendermint/tendermint/p2p/pex/addrbook.go:160 +0x116
github.com/tendermint/tendermint/node.(*Node).OnStart(0xc420286d00, 0xc4201b8010, 0xd)
/home/tpb/code/go/src/github.com/tendermint/tendermint/node/node.go:402 +0x547
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start(0xc420286d00, 0xe51c40, 0xc42000bd40)
/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x3bd
github.com/tendermint/tendermint/cmd/tendermint/commands.NewRunNodeCmd.func1(0xc42022e000, 0xc4200acdc0, 0x0, 0x1, 0x0, 0x0)
/home/tpb/code/go/src/github.com/tendermint/tendermint/cmd/tendermint/commands/run_node.go:58 +0xfe
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).execute(0xc42022e000, 0xc4200acda0, 0x1, 0x1, 0xc42022e000, 0xc4200acda0)
/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:762 +0x468
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1289280, 0xbbdda0, 0xc420015e01, 0xc4201bc640)
/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).Execute(0x1289280, 0xc4201bc640, 0xc420015e98)
/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli.Executor.Execute(0x1289280, 0xde5798, 0x2, 0xc4200332c0)
/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli/setup.go:89 +0x4e
main.main()
/home/tpb/code/go/src/github.com/tendermint/tendermint/cmd/tendermint/main.go:45 +0x24d
```
7 years ago
Ethan Buchman
9481cabd50
fixes from review
7 years ago
Alexander Simmerl
c661a3ec21
Fix race when mutating MConnConfig
Instead of mutating the passed in MConnConfig part of P2PConfig we just
use the default and override the values, the same as before as it was
always the default version. This is yet another good reason to not embed
information and access to config structs in our components and will go
away with the ongoing refactoring in #1325 .
7 years ago
Anton Kaliaev
b8c076ca79
do not drain the channel because there is no channel, duh
Fixes https://github.com/cosmos/cosmos-sdk/issues/1045
7 years ago
Alexander Simmerl
ea896865a7
Collapse PeerConfig into P2PConfig
As both configs are concerned with the p2p packaage and PeerConfig is
only used inside of the package there is no good reason to keep the
couple of fields separate, therefore it is collapsed into the more
general P2PConifg. This is a stepping stone towards a setup where the
components inside of p2p do not have any knowledge about the config.
follow-up to #1325
7 years ago
Anton Kaliaev
0562009275
bring back assert
7 years ago
idoor88
fedd07c522
removed assertion to avoid confusion ( #1626 )
7 years ago
Alexander Simmerl
3255c076e5
Remove auth_enc config option
As we didn't hear any voices requesting this feature, we removed the
option to disable it and always have peer connection auth encrypted.
closes #1518
follow-up #1325
7 years ago
Ethan Buchman
d454b1b25f
SkipDuplicate -> AllowDuplicate; fix p2p test on mac
7 years ago
Alexander Simmerl
5796e879b9
Introduce option to skip duplicate ip check
In some scenarios like tests we want to disable the guard which prevents
peers connecting from the same ip.
Fixes #1632
Closes #1634
7 years ago
Anton Kaliaev
4da81aa0b7
commented out TestPEXReactorRunning
7 years ago
Anton Kaliaev
67068a34f2
log requesting addresses
7 years ago
Anton Kaliaev
2a0e9f93ce
provide arg to error
BEFORE:
```
E[05-24|11:55:37.229] Dialing failed pex=0 addr=022ec801d79025caab3afbbf816d92ff8450d040@127.0.0.2:6593 err="Connect to self: <nil>" attempts=0
```
AFTER:
```
E[05-24|11:55:37.229] Dialing failed pex=0 addr=022ec801d79025caab3afbbf816d92ff8450d040@127.0.0.2:6593 err="Connect to self: 022ec801d79025caab3afbbf816d92ff8450d040@127.0.0.2:6593" attempts=0
```
7 years ago
Zach Ramsay
423fef1416
docs: use absolute links ( #1617 )
7 years ago
Alexander Simmerl
186d38dd8a
Use different loopback addresses for test switch
7 years ago
Alexander Simmerl
01fd102dba
Incoporate review feedback
7 years ago
Alexander Simmerl
e11f3167ff
Fix pex reactor test
7 years ago
Alexander Simmerl
7d98cfd3d6
Test duplicate IP guard in peer set
7 years ago
Alexander Simmerl
4848e88737
Fix persistent peer switch test
7 years ago