Commit Graph
851 Commits
Author SHA1 Message Date
Sam KleinmanandGitHub e9928f6186 p2p: limit rate of dialing new peers (#6485) 2021-05-26 14:39:04 -04:00
MarkoandGitHub 719e028e00 libs: internalize some packages (#6366)
## Description

Internalize some libs. This reduces the amount ot public API tendermint is supporting. The moved libraries are mainly ones that are used within Tendermint-core.
2021-05-25 16:25:31 +00:00
Sam KleinmanandGitHub 0781ca3f50 p2p/pex: cleanup to pex internals and peerManager interface (#6476) 2021-05-17 17:05:44 -04:00
Sam KleinmanandGitHub ee230cd0f6 p2p: revert change to routePeer (#6475) 2021-05-17 12:52:57 -04:00
Sam KleinmanandGitHub fa891c5a4b node: cleanup pex initialization (#6467) 2021-05-14 10:05:59 -04:00
Callum WatersandGitHub 230abbe676 fix pex test to handle too many addresses (#6451) 2021-05-12 15:35:28 +02:00
Callum WatersandGitHub 64e7b5efea p2p: add channel descriptors to open channel (#6440) 2021-05-10 22:22:07 +02:00
Callum WatersandGitHub 4dded9c852 pex: fix send requests too often test (#6437) 2021-05-10 09:48:24 +02:00
Callum WatersandGitHub ec5e3b0b02 p2p: wire pex v2 reactor to router (#6407) 2021-05-05 18:46:51 +02:00
Aleksandr BezobchukandGitHub bc643b19c4 p2p: support private peer IDs in new p2p stack (#6409)
Pass a set of private peer ids to the `PeerManager` and any node that exists in this set is not returned in the `Advertise` method.

closes: #6405
2021-04-30 20:37:17 +00:00
Callum WatersandGitHub 9efc20c963 p2p: improve PEX reactor (#6305) 2021-04-26 13:03:19 +02:00
Ismail KhoffiandGitHub ee70430255 libs: remove most of libs/rand (#6364) 2021-04-23 16:00:35 +02:00
MarkoandGitHub 990504cd07 crypto: add sr25519 as a validator key (#6376)
## Description

Add sr25519 as a validator key option. We support the crypto in tendermint and added batch verification recently.
2021-04-22 10:37:38 +00:00
Callum WatersandGitHub 5bafedff17 evidence: fix bug with hashes (#6375) 2021-04-21 18:50:39 +02:00
Sam KleinmanandGitHub fce665ef06 p2p: fix network update test (#6361) 2021-04-19 18:02:21 -04:00
Aleksandr BezobchukandGitHub 47b28fd6aa p2p: minor cleanup + update router options (#6353) 2021-04-14 09:35:43 -04:00
Sam KleinmanandGitHub 3a690568ae p2p: make peer scoring test more resilient (#6322) 2021-04-08 16:06:54 -04:00
Sam KleinmanandGitHub 0f41f7465c p2p: extend e2e tests for new p2p framework (#6323) 2021-04-08 11:09:21 -04:00
Sam KleinmanandGitHub bcdf923cb8 p2p: improve router test stability (#6310) 2021-04-05 10:54:32 -04:00
Sam KleinmanandGitHub d0b513c182 p2p: filter peers by IP address and ID (#6300) 2021-03-30 18:00:43 -04:00
Sam KleinmanandGitHub 3ed8f14bf9 p2p: connect max inbound peers configuration to new router (#6296) 2021-03-30 10:04:14 -04:00
Sam KleinmanandGitHub c62e320ffd p2p: rate-limit incoming connections by IP (#6286) 2021-03-29 17:07:05 -04:00
Sam KleinmanandGitHub 91506bf25d p2p: simple peer scoring (#6277) 2021-03-29 16:12:23 -04:00
Aleksandr BezobchukandGitHub b5e4147e5a p2p: metrics (#6278) 2021-03-26 09:01:41 -04:00
Aleksandr BezobchukandGitHub a554005136 p2p: revised router message scheduling (#6126) 2021-03-25 16:58:46 -04:00
Sam KleinmanandGitHub 2ceb816721 test infra: make memory network test buffers configurable (#6275) 2021-03-25 16:19:11 -04:00
Sam KleinmanandGitHub 99c73dd3c1 refactor blockchain/v0 tests to use p2ptest (#6256) 2021-03-19 16:40:43 -04:00
Callum WatersandGitHub 6f6083dae3 linter: fix nolintlint warnings (#6257) 2021-03-19 10:59:14 +01:00
Sam KleinmanandGitHub acbe3f6570 P2P: Evidence Reactor Test Refactor (#6238) 2021-03-17 11:01:04 -04:00
MarkoandGitHub 8c539f7c2b logs: cleanup (#6198) 2021-03-04 10:09:08 +00:00
Anton KaliaevandGitHub 089b314bdb test/fuzz: fix PEX reactor test (#6188)
* test/fuzz: fix PEX reactor test

* .github: [fuzz] increase retention period for crashers
2021-03-01 20:18:51 +04:00
Callum WatersandGitHub 42f6c40751 p2p: enable scheme-less parsing of IPv6 strings (#6158) 2021-02-22 16:24:56 +01:00
Erik GrinakerandGitHub b6be889b97 node: feature flag for legacy p2p support (#6056) 2021-02-16 11:57:16 -05:00
Aleksandr BezobchukandGitHub 16bbe8c862 consensus: p2p refactor (#5969) 2021-02-16 11:02:52 -05:00
Callum WatersandGitHub 162f67cf26 correct spelling to US english (#6077) 2021-02-11 18:59:18 +01:00
Erik GrinakerandGitHub 9b6d6a3ad0 p2p: tighten up Router and add tests (#6044)
This cleans up the `Router` code and adds a bunch of tests. These sorts of systems are a real pain to test, since they have a bunch of asynchronous goroutines living their own lives, so the test coverage is decent but not fantastic. Luckily we've been able to move all of the complex peer management and transport logic outside of the router, as synchronous components that are much easier to test, so the core router logic is fairly small and simple.

This also provides some initial test tooling in `p2p/p2ptest` that automatically sets up in-memory networks and channels for use in integration tests. It also includes channel-oriented test asserters in `p2p/p2ptest/require.go`, but these have primarily been written for router testing and should probably be adapted or extended for reactor testing.
2021-02-03 23:03:02 +00:00
Erik GrinakerandGitHub 2aad26e2f1 p2p: tighten up and test PeerManager (#6034)
This tightens up the `PeerManager` and related code, adds a ton of tests, and fixes a bunch of inconsistencies and bugs.
2021-02-03 06:15:23 +00:00
Erik GrinakerandGitHub fc71882f74 p2p: add tests and fix bugs for NodeAddress and NodeID (#6021)
This renames `PeerAddress` to `NodeAddress`, moves it and `NodeID` into a separate file `address.go`, adds tests for them, and fixes a bunch of bugs and inconsistencies.
2021-02-01 09:03:41 +00:00
Erik GrinakerandGitHub 1f39f808e1 p2p: tighten up and test Transport API (#6020)
This tightens up the new P2P `Transport` API and infrastructure, fixes a bunch of bugs and inconsistencies, and adds tests.
2021-02-01 08:24:31 +00:00
Erik GrinakerandGitHub 50b8907581 p2p: clean up new Transport infrastructure (#6017)
This revises the new P2P `Transport` interface and does some preliminary code cleanups and simplifications.

The major change here is to add `Connection.Handshake()` for performing node handshakes (once the stream transport API is implemented, this can be done entirely independent of the transport).  This moves most of the handshaking logic into the `Router`, such as prevention of head-of-line blocking, validation of peer's `NodeInfo`, controlling timeouts, and so on. This significantly simplifies transports, completely removes the need for internal goroutines, and shares common logic across all transports. This also allows varying the handshake `NodeInfo` across peers, e.g. to vary `ListenAddr`. Similarly, connection filtering is also moved into the switch/router so that it can be shared between transports.
2021-01-30 10:51:22 +00:00
MarkoandGitHub 1f01e5d726 params: remove blockTimeIota (#5987)
## Description

- removes blocktimeiota 
- merges block params in abci and core state
- spec change: https://github.com/tendermint/spec/pull/248


Closes: #5939
2021-01-28 13:47:24 +00:00
Erik GrinakerandGitHub c900303ac6 test: fix flaky router broadcast test (#6006)
Fixes #6004 by reordering test to avoid race condition. Will redesign router tests to be resistant to this later.
2021-01-28 11:26:43 +00:00
Erik GrinakerandGitHub 363804ac21 test: fix TestRouter to take into account PeerManager reconnects (#6002)
Fixes #5981, which was caused by changes in Router behavior after the introduction of the peer manager, leading to a race condition that could halt the test.

This is a temporary measure, I'll start tightening up the new P2P core tomorrow and write "real" tests with better test infrastructure.
2021-01-27 21:40:28 +00:00
Erik GrinakerandGitHub 5a9b740acb test: fix TestSwitchAcceptRoutine by ignoring spurious error (#6001)
Another fix for `TestSwitchAcceptRoutine` following from #6000, since the `SetDeadline()` call also errors when the connection has been closed.
2021-01-27 21:31:31 +00:00
Erik GrinakerandGitHub aead4ab555 test: fix test data race in p2p.MemoryTransport with logger (#5995)
This patches over a test data race where the logger would try to read struct internals via `reflect` while these were concurrently modified (specifically `MemoryTransport.closeOnce`).
2021-01-27 21:05:48 +00:00
Erik GrinakerandGitHub 4dca066aab test: disable TestPEXReactorSeedModeFlushStop due to flake (#5996)
This test occasionally fails because the peer is already stopped. It is unclear to me exactly what this test is supposed to do, since calling `FlushStop()` will stop the peer, but the test asserts that the peer shouldn't have been stopped by `FlushStop()` since calling `Stop()` afterwards will error in that case.

The current PEX reactor will be removed in the new P2P stack anyway.
2021-01-27 20:05:37 +00:00
Erik GrinakerandGitHub 6e3c58204a test: fix TestSwitchAcceptRoutine flake by ignoring error type (#6000)
Fixes #5998. Sometimes the connection returns "use of closed network connection" instead, so for now we just accept any error. The switch is not long for this world anyway.
2021-01-27 19:53:07 +00:00
Erik GrinakerandGitHub 06de7459c9 p2p: use stopCtx when dialing peers in Router (#5983)
This ensures we don't leak dial goroutines when shutting down the router.
2021-01-26 19:47:03 +01:00
Erik GrinakerandGitHub 937a18468a test/p2p: close transports to avoid goroutine leak failures (#5982) 2021-01-26 17:49:37 +01:00
Erik GrinakerandGitHub fe5b312337 p2p: resolve PEX addresses in PEX reactor (#5980)
This changes the new prototype PEX reactor to resolve peer address URLs into IP/port PEX addresses itself. Branched off of #5974.

I've spent some time thinking about address handling in the P2P stack. We currently use `PeerAddress` URLs everywhere, except for two places: when dialing a peer, and when exchanging addresses via PEX. We had two options:

1. Resolve addresses to endpoints inside `PeerManager`. This would introduce a lot of added complexity: we would have to track connection statistics per endpoint, have goroutines that asynchronously resolve and refresh these endpoints, deal with resolve scheduling before dialing (which is trickier than it sounds since it involves multiple goroutines in the peer manager and router and messes with peer rating order), handle IP address visibility issues, and so on.

2. Resolve addresses to endpoints (IP/port) only where they're used: when dialing, and in PEX. Everywhere else we use URLs.

I went with 2, because this significantly simplifies the handling of hostname resolution, and because I really think the PEX reactor should migrate to exchanging URLs instead of IP/port numbers anyway -- this allows operators to use DNS names for validators (and can easily migrate them to new IPs and/or load balance requests), and also allows different protocols (e.g. QUIC and `MemoryTransport`). Happy to discuss this.
2021-01-26 15:58:33 +00:00