Commit Graph
66 Commits
Author SHA1 Message Date
tycho garen 71fa7d7b6c fix test 2022-06-14 08:49:04 -04:00
tycho garen 9532fa4eb7 add metrics 2022-06-14 07:03:07 -04:00
tycho garen 0a0425ae6f fix panic 2022-06-13 12:25:21 -04:00
tycho garen 1dabae273b cleanup peer manager 2022-06-13 10:48:55 -04:00
tycho garen ef0d832f70 fix scoring test
(cherry picked from commit 9abc55f3a0)
2022-06-13 08:56:52 -04:00
tycho garen 470920ad9f test: new scoring
(cherry picked from commit 930fd7f2be)
2022-06-10 16:58:13 -04:00
tycho garen a1ef61b63e comment
(cherry picked from commit 9f604fd2ef)
2022-06-10 16:00:25 -04:00
Sam Kleinman dc148b81d8 Update internal/p2p/peermanager.go
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
(cherry picked from commit 1c02758eaf)
2022-06-10 16:00:25 -04:00
Sam Kleinman fc9ba51b28 Update internal/p2p/peermanager.go
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
(cherry picked from commit f23f6e1089)
2022-06-10 16:00:25 -04:00
tycho garen e38d5b7547 overflows
(cherry picked from commit 4c8651026a)
2022-06-10 16:00:25 -04:00
tycho garen f772dccf3b oops 2022-06-10 16:00:19 -04:00
tycho garen 9f910e6a98 cleanup
(cherry picked from commit eddb23b5af)
2022-06-10 15:54:42 -04:00
tycho garen 60484e7a24 update comment
(cherry picked from commit 31bd396c88)
2022-06-10 15:54:42 -04:00
tycho garen 7ed1236dea make const
(cherry picked from commit e3068b50b2)
2022-06-10 15:54:42 -04:00
tycho garen 3674859836 reduce logging level
(cherry picked from commit 4e2bc8f51e)
2022-06-10 15:54:40 -04:00
tycho garen 029e1925cd remove seed flag
(cherry picked from commit 000aa05485)
2022-06-10 15:54:09 -04:00
tycho garen 8019a49037 fix error message
(cherry picked from commit 86db59f53b)
2022-06-10 15:54:05 -04:00
tycho garen 6833ca805d fix small case
(cherry picked from commit 56a91642dc)
2022-06-10 15:53:18 -04:00
tycho garen dfcd59c367 don't gossip inactive peers
(cherry picked from commit cc28ce298f)
2022-06-10 15:53:18 -04:00
tycho garen 45ad693b23 reduce persistent peer max
(cherry picked from commit b213a2766f)
2022-06-10 15:53:18 -04:00
tycho garen cee254e695 p2p: peer store and dialing changes
(cherry picked from commit 9dbb135152)
2022-06-10 15:53:12 -04:00
mergify[bot]andGitHub 0e3a3fe58b p2p: shed peers from store from other networks (backport #8678) (#8681) 2022-06-02 12:15:55 -04:00
Callum WatersandGitHub e8ac37223f pex: align max address thresholds (#8657) 2022-05-31 14:07:25 -04:00
mergify[bot]andGitHub 4ee91663da p2p: reduce ability of SendError to disconnect peers (backport #8597) (#8603) 2022-05-25 04:12:43 -04:00
mergify[bot]andGitHub 2f8483aa85 p2p: remove unused get height methods (backport #8569) (#8571) 2022-05-17 11:32:13 -04:00
mergify[bot]andGitHub 14f0d60f24 p2p: fix setting in con-tracker (#8370) (#8371)
(cherry picked from commit 889341152a)
2022-04-19 23:32:54 -07:00
Callum WatersandGitHub 308d283241 cli: fix reset command for v0.35 (#8259) 2022-04-07 11:24:46 -07:00
M. J. FrombergerandGitHub a6fd04f1be p2p: update polling interval calculation for PEX requests (backport #8106) (#8118)
A manual cherry-pick of 89b4321af2.
2022-03-14 13:01:00 -07:00
Sam KleinmanandGitHub cc88a31a60 p2p: update shim to transfer information about peers (#8047) 2022-03-02 08:43:47 -05:00
mergify[bot]andGitHub 0e08c66926 p2p: plumb rudamentary service discovery to rectors and update statesync (backport #8030) (#8036) 2022-02-28 20:51:47 -08:00
mergify[bot]andGitHub a281c0bbf1 p2p: retry failed connections slightly more aggressively (backport #8010) (#8012) 2022-02-25 13:53:46 -05:00
Sam KleinmanandGitHub a0321633b0 p2p: backport changes in ping/pong tolerances (#8009) 2022-02-25 12:37:11 -05:00
GuiandGitHub 4b565fe58a p2p: always advertise self, to enable mutual address discovery (#7620)
Fixes #7593
2022-01-19 13:46:30 -05:00
b2c4128ac0 build: Make sure to test packages with external tests (backport #7608) (#7635)
* build: Make sure to test packages with external tests (#7608)

The test filter was looking for "TestGoFiles", which does not include tests in
a separate package (e.g., "package foo_test" for "package foo").
This caused several packages not to be tested in CI, including:

  github.com/tendermint/tendermint/abci/client
  github.com/tendermint/tendermint/crypto
  github.com/tendermint/tendermint/crypto/tmhash
  github.com/tendermint/tendermint/internal/eventbus
  github.com/tendermint/tendermint/internal/evidence
  github.com/tendermint/tendermint/internal/inspect
  github.com/tendermint/tendermint/internal/jsontypes
  github.com/tendermint/tendermint/internal/libs/protoio
  github.com/tendermint/tendermint/internal/libs/sync
  github.com/tendermint/tendermint/internal/p2p/pex
  github.com/tendermint/tendermint/internal/pubsub
  github.com/tendermint/tendermint/internal/pubsub/query
  github.com/tendermint/tendermint/internal/pubsub/query/syntax
  github.com/tendermint/tendermint/internal/state/indexer
  github.com/tendermint/tendermint/internal/state/indexer/block/kv
  github.com/tendermint/tendermint/libs/json
  github.com/tendermint/tendermint/libs/log
  github.com/tendermint/tendermint/libs/os
  github.com/tendermint/tendermint/light
  github.com/tendermint/tendermint/light/provider/http
  github.com/tendermint/tendermint/privval/grpc
  github.com/tendermint/tendermint/proto/tendermint/blocksync
  github.com/tendermint/tendermint/proto/tendermint/consensus
  github.com/tendermint/tendermint/proto/tendermint/statesync
  github.com/tendermint/tendermint/rpc/client
  github.com/tendermint/tendermint/rpc/client/mock
  github.com/tendermint/tendermint/test/e2e/tests
  github.com/tendermint/tendermint/test/fuzz/mempool
  github.com/tendermint/tendermint/test/fuzz/p2p/secretconnection
  github.com/tendermint/tendermint/test/fuzz/rpc/jsonrpc/server

Updates #7626 and #7634.

(cherry picked from commit aea428d322)

* Fix build tags to satisfy Go 1.16.

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-01-18 21:36:33 -08:00
657afc7322 Remove now-unused nolint:lll directives. (backport #7356) (#7358)
(cherry picked from commit 76dea94a01)

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2021-11-30 17:01:51 -05:00
37e0779d6d p2p: reduce peer score for dial failures (backport #7265) (#7271)
* p2p: reduce peer score for dial failures (#7265)

When dialing fails to succeed we should reduce the score of the peer,
which puts the peer at (potentially) greater chances of being removed
from the peer manager, and reduces the chance of the peer being
gossiped by the PEX reactor.

(cherry picked from commit 27560cf7a4)

Co-authored-by: Sam Kleinman <garen@tychoish.com>
2021-11-10 11:10:06 -05:00
Sam KleinmanandGitHub 003d15fa4b lint: cleanup branch lint errors (#7238) 2021-11-04 07:44:13 -04:00
Sam KleinmanandGitHub e40a8468a4 config: backport file writing changes (#7182) 2021-10-29 06:38:52 -04:00
M. J. FrombergerandGitHub 85086d7452 Fix metric cardinality left over from backport (#7180)
One of the patched uses in #7161 missed the message type field,
triggering panic failures from Prometheus.
2021-10-28 15:29:53 -07:00
mergify[bot]andGitHub dd1471da91 p2p: add message type into the send/recv bytes metrics (backport #7155) (#7161)
* p2p: add message type into the send/recv bytes metrics (#7155)

This pull request adds a new "mesage_type" label to the send/recv bytes metrics calculated in the p2p code.

Below is a snippet of the updated metrics that includes the updated label:
```
tendermint_p2p_peer_receive_bytes_total{chID="32",chain_id="ci",message_type="consensus_HasVote",peer_id="2551a13ed720101b271a5df4816d1e4b3d3bd133"} 652
tendermint_p2p_peer_receive_bytes_total{chID="32",chain_id="ci",message_type="consensus_HasVote",peer_id="4b1068420ef739db63377250553562b9a978708a"} 631
tendermint_p2p_peer_receive_bytes_total{chID="32",chain_id="ci",message_type="consensus_HasVote",peer_id="927c50a5e508c747830ce3ba64a3f70fdda58ef2"} 631
tendermint_p2p_peer_receive_bytes_total{chID="32",chain_id="ci",message_type="consensus_NewRoundStep",peer_id="2551a13ed720101b271a5df4816d1e4b3d3bd133"} 393
tendermint_p2p_peer_receive_bytes_total{chID="32",chain_id="ci",message_type="consensus_NewRoundStep",peer_id="4b1068420ef739db63377250553562b9a978708a"} 357
tendermint_p2p_peer_receive_bytes_total{chID="32",chain_id="ci",message_type="consensus_NewRoundStep",peer_id="927c50a5e508c747830ce3ba64a3f70fdda58ef2"} 386
```

(cherry picked from commit b4bc6bb4e8)
2021-10-27 07:34:24 -04:00
M. J. FrombergerandGitHub bdd815ebc9 Align atomic struct field for compatibility in 32-bit ABIs. (#7037)
The layout of struct fields means that interior fields may not be properly
aligned for 64-bit access.

Fixes #7000.
2021-09-30 10:53:05 -07:00
lklimekandGitHub 1bd1593f20 fix: race condition in p2p_switch and pex_reactor (#7015)
Closes https://github.com/tendermint/tendermint/issues/7014
2021-09-28 09:32:14 -04:00
M. J. FrombergerandGitHub cf7537ea5f cleanup: Reduce and normalize import path aliasing. (#6975)
The code in the Tendermint repository makes heavy use of import aliasing.
This is made necessary by our extensive reuse of common base package names, and
by repetition of similar names across different subdirectories.

Unfortunately we have not been very consistent about which packages we alias in
various circumstances, and the aliases we use vary. In the spirit of the advice
in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports,
his change makes an effort to clean up and normalize import aliasing.

This change makes no API or behavioral changes. It is a pure cleanup intended
o help make the code more readable to developers (including myself) trying to
understand what is being imported where.

Only unexported names have been modified, and the changes were generated and
applied mechanically with gofmt -r and comby, respecting the lexical and
syntactic rules of Go.  Even so, I did not fix every inconsistency. Where the
changes would be too disruptive, I left it alone.

The principles I followed in this cleanup are:

- Remove aliases that restate the package name.
- Remove aliases where the base package name is unambiguous.
- Move overly-terse abbreviations from the import to the usage site.
- Fix lexical issues (remove underscores, remove capitalization).
- Fix import groupings to more closely match the style guide.
- Group blank (side-effecting) imports and ensure they are commented.
- Add aliases to multiple imports with the same base package name.
2021-09-23 07:52:07 -07:00
William BanfieldandGitHub 63aeb50665 upgrading: add information into the UPGRADING.md for users of the codebase wishing to upgrade (#6898)
* add information on upgrading to the new p2p library

* clarify p2p backwards compatibility

* reorder p2p queue list

* add demo for p2p selection

* fix spacing in upgrading
2021-09-08 09:41:12 -04:00
William BanfieldandGitHub 4e96c6b234 tools: add mockery to tools.go and remove mockery version strings (#6787)
This change aims to keep versions of mockery consistent across developer laptops.

This change adds mockery to the `tools.go` file so that its version can be managed consistently in the `go.mod` file.

Additionally, this change temporarily disables adding mockery's version number to generated files. There is an outstanding issue against the mockery project related to the version string behavior when running from `go get`. I have created a pull request to fix this issue in the mockery project.
see: https://github.com/vektra/mockery/issues/397
2021-07-30 20:47:15 +00:00
Callum WatersandGitHub 02f8e4c0bd blockstore: fix problem with seen commit (#6782) 2021-07-30 17:37:04 +02:00
M. J. FrombergerandGitHub 6dd8984fef Fix and clarify breaks from select cases. (#6781)
Update those break statements inside case clauses that are intended to reach an
enclosing for loop, so that they correctly exit the loop.

The candidate files for this change were located using:

    % staticcheck -checks SA4011 ./... | cut -d: -f-2

This change is intended to preserve the intended semantics of the code, but
since the code as-written did not have its intended effect, some behaviour may
change. Specifically: Some loops may have run longer than they were supposed
to, prior to this change.

In one case I was not able to clearly determine the intended outcome. That case
has been commented but otherwise left as-written.

Fixes #6780.
2021-07-29 22:28:32 -04:00
William BanfieldandGitHub a751eee7f2 p2p: add test for pqueue dequeue full error (#6760)
This adds a test for closing the `pqueue` while the `pqueue` contains data that has not yet been dequeued.

This issue was found while debugging #6705 

This test will fail until @cmwaters fix for this condition is merged.
2021-07-26 19:22:32 +00:00
Callum WatersandGitHub a341a626e0 p2p: avoid blocking on the dequeCh (#6765) 2021-07-26 09:09:07 -04:00
William BanfieldandGitHub c3ae6f5b58 p2p: add coverage for mConnConnection.TrySendMessage (#6754)
This change adds additional coverage to the `mConnConnection.TrySendMessage` code path. Adds test to ensure it returns `io.EOF` when closed.

Addresses: #6570
2021-07-23 17:29:19 +00:00