Commit Graph

153 Commits

Author SHA1 Message Date
tycho garen
37cce2542a merge 2022-07-08 13:14:01 -04:00
Sam Kleinman
636320f901 p2p: delete cruft (#8958)
I think the decision in #8806 is that we shouldn't do this yet, so I think it's best to just drop this.
2022-07-07 16:29:50 +00:00
Sam Kleinman
d1a16e8ff0 p2p: simpler priority queue (#8929) 2022-07-07 12:13:52 -04:00
Ian Jungyong Um
1d96faa35a p2p: fix typo (#8922)
Fix minor typos in peermanager
2022-07-01 12:44:39 +00:00
William Banfield
921530c352 p2p: use correct context error (#8916)
handshakeCtx is the internal context carrying the timeout. Its error should be used for the error return.
2022-06-30 22:02:59 +00:00
William Banfield
5274f80de4 p2p: fix flakey test due to disconnect cooldown (#8917)
This test was made flakey by #8839. The cooldown period means that the node in the test will not try to reconnect as quickly as the test expects. This change makes the cooldown shorter in the test so that the node quickly reconnects.
2022-06-30 21:48:10 +00:00
Sam Kleinman
60881f1d06 p2p: stop mconn channel sends without timeout (#8906) 2022-06-30 09:01:02 -04:00
Sam Kleinman
52b6dc19ba p2p: remove dial sleep and provide disconnect cooldown (#8839)
Alternative proposal for #8826
2022-06-24 17:57:49 +00:00
William Banfield
5f5e74798b p2p: set empty timeouts to small values. (#8847)
These timeouts default to 'do not time out' if they are not set. This times up resources, potentially indefinitely. If node on the other side of the the handshake is up but unresponsive, the[ handshake call](edec79448a/internal/p2p/router.go (L720)) will _never_ return.

These are proposed values that have not been validated. I intend to validate them in a production setting.
2022-06-23 22:33:21 +00:00
Sam Kleinman
436a38f876 p2p: track peers by address (#8841) 2022-06-23 10:03:10 -04:00
Ian Jungyong Um
2e11760fbe p2p: fix typo (#8836) 2022-06-22 09:30:11 +02:00
William Banfield
8860e027a8 p2p: more dial routines (#8827)
The dial routines perform network i/o, which is a blocking call into the kernel. These routines are completely unable to do anything else while the dial occurs, so for most of their lifecycle they are sitting idle waiting for the tcp stack to hand them data. We should increase this value by _a lot_ to enable more concurrent dials. This is unlikely to cause CPU starvation because these routines sit idle most of the time. The current value causes dials to occur _way_ too slowly. 

Below is a graph demonstrating the before and after of this change in a testnetwork with many dead peers. You can observe that the rate that we connect to new, valid peers, is _much_ higher than previously. Change was deployed around the 31 minute mark on the graph.

![image](https://user-images.githubusercontent.com/4561443/174919007-50e4453a-edd8-41d0-97ee-dea8853d57f7.png)
2022-06-22 00:51:09 +00:00
Sam Kleinman
cfd13825e2 p2p: add eviction metrics and cleanup dialing error handling (#8819) 2022-06-21 20:44:14 +00:00
Sam Kleinman
28d3239958 p2p: wake dialing thread after sleep (#8803) 2022-06-20 15:47:56 +00:00
Ian Jungyong Um
e3e162ff10 p2p: fix typo (#8793)
Fix the typo in router
2022-06-19 15:26:25 +00:00
Sam Kleinman
4d820ff4f5 p2p: peer score should not wrap around (#8790) 2022-06-17 22:27:38 +00:00
Sam Kleinman
0ac03468d8 p2p: track peers stored on startup (#8787) 2022-06-17 18:10:10 +00:00
Sam Kleinman
9e5b13725d p2p: peer store and dialing changes (#8737) 2022-06-17 08:02:10 -04:00
Sam Kleinman
51b3f111dc p2p: fix mconn transport accept test (#8762)
Fix minor test incongruency missed earlier.
2022-06-14 23:48:48 +00:00
Sam Kleinman
979a6a1b13 p2p: accept should not abort on first error (#8759) 2022-06-14 19:12:53 -04:00
Sam Kleinman
bf1cb89bb7 Revert "p2p: self-add node should not error (tendermint#8753)" (#8757) 2022-06-14 20:55:10 +00:00
Sam Kleinman
7971f4a2fc p2p: self-add node should not error (#8753) 2022-06-14 16:45:05 +00:00
tycho garen
1cc4509029 fix: merge error 2022-06-09 09:42:13 -04:00
tycho garen
9456b7975f Merge remote-tracking branch 'origin/master' into main/libp2p 2022-06-09 09:21:41 -04:00
Sam Kleinman
666d93338a p2p: shed peers from store from other networks (#8678) 2022-06-02 11:14:25 -04:00
tycho garen
2994fe00e4 Merge remote-tracking branch 'origin/master' into main/libp2p 2022-05-26 05:06:38 -04:00
M. J. Fromberger
a988cefe5d Update generated mocks after #8607. (#8612) 2022-05-25 15:48:56 +00:00
Sam Kleinman
d59a53be01 p2p: reduce ability of SendError to disconnect peers (#8597) 2022-05-24 11:19:32 -04:00
Sam Kleinman
86cf79a9d9 p2p: libp2p constructor scafolding (#8592) 2022-05-24 04:44:26 -04:00
tycho garen
fff97326a1 Merge remote-tracking branch 'origin/master' into main/libp2p 2022-05-23 08:32:12 -04:00
Sam Kleinman
2897b75853 p2p: remove unused get height methods (#8569) 2022-05-17 10:56:26 -04:00
Sam Kleinman
6dd0e8d83a p2p: use more appropriate context (#8563) 2022-05-16 21:56:17 -04:00
Sam Kleinman
2cecf7f9c7 p2p: cache libp2p streams (#8562) 2022-05-16 10:31:55 -04:00
Sam Kleinman
ffa7af3c36 p2p: collect errors from channel (#8544) 2022-05-16 09:40:29 -04:00
Sam Kleinman
9db41016ab p2p: avoid sending errors after context is canceled (#8548) 2022-05-14 08:28:09 -04:00
tycho garen
b43336b706 Merge remote-tracking branch 'origin/master' into main/libp2p 2022-05-13 11:17:40 -04:00
William Banfield
92811b9153 metrics: transition all metrics to using metricsgen generated constructors. (#8488)
## What does this change do?

This pull request completes the change to the `metricsgen` metrics. It adds `go generate` directives to all of the files containing the `Metrics` structs.

Using the outputs of `metricsdiff` between these generated metrics and `master`, we can see that there is not a diff between the two sets of metrics when run locally.
```
[william@sidewinder] tendermint[wb/metrics-gen-transition]:. ◆ ./scripts/metricsgen/metricsdiff/metricsdiff metrics_master metrics_generated
[william@sidewinder] tendermint[wb/metrics-gen-transition]:. ◆
```

This change also adds parsing for a `metrics:` key in a field comment. If a comment line begins with `//metrics:` the rest of the line is interpreted to be the metric help text. Additionally, a bug where lists of labels were not properly quoted in the `metricsgen` rendered output was fixed.
2022-05-12 18:39:12 +00:00
Sam Kleinman
b7ccee6240 p2p: simple request and response framework (#8500) 2022-05-11 14:43:54 -04:00
Sam Kleinman
f1c9a56d57 p2p: base implementation of libp2p channel (#8476) 2022-05-09 10:34:02 -04:00
tycho garen
6e16cd1ff8 Merge remote-tracking branch 'origin/master' into main/libp2p 2022-05-02 12:51:14 -04:00
Sam Kleinman
37287ead94 p2p: remove message type from channel implementation (#8452) 2022-05-02 10:52:57 -04:00
Sam Kleinman
03879849d9 p2p: make p2p.Channel an interface (#8446) 2022-04-29 21:33:15 -04:00
tycho garen
82f66026a5 Merge remote-tracking branch 'origin/master' into main/libp2p 2022-04-29 17:22:42 -04:00
Sam Kleinman
cf2a00b398 p2p: avoid using p2p.Channel internals (#8444) 2022-04-29 17:21:36 -04:00
Sam Kleinman
9f94161163 p2p: scope and add libp2p components (#8443) 2022-04-29 11:57:40 -04:00
Sam Kleinman
4844af2b8d p2p: move transport options into struct (#8432) 2022-04-28 17:51:00 -04:00
tycho garen
72405b450f Merge remote-tracking branch 'origin/master' into main/libp2p 2022-04-28 08:45:10 -04:00
Sam Kleinman
2a58ea3ab2 p2p: use nodeinfo less often (#8427) 2022-04-27 21:13:38 +00:00
Sam Kleinman
385ad1e1e3 p2p: remove support for multiple transports and endpoints (#8420) 2022-04-27 15:57:30 -04:00
Sam Kleinman
8670678291 p2p: remove support for multiple transports and endpoints (#8420) 2022-04-27 14:29:19 -04:00