Commit Graph
521 Commits
Author SHA1 Message Date
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
Sam KleinmanandGitHub 8eccaf9535 mempool: remove vestigal mempool wal (#6396) 2021-04-29 15:33:59 -04:00
Callum WatersandGitHub 9efc20c963 p2p: improve PEX reactor (#6305) 2021-04-26 13:03:19 +02:00
Callum WatersandGitHub 36d8cb09df config: create BootstrapPeers p2p config parameter (#6372) 2021-04-22 12:55:50 +02:00
JayT106andGitHub 43eacd159f state/indexer: reconstruct indexer, move txindex into the indexer package (#6382) 2021-04-21 16:37:44 -04:00
Callum WatersandGitHub 8e8de2b2fb node: use db provider instead of mem db (#6362) 2021-04-16 19:07:18 +02:00
Aleksandr BezobchukandGitHub 47b28fd6aa p2p: minor cleanup + update router options (#6353) 2021-04-14 09:35:43 -04:00
Nate WilliamsandGitHub b517dd5685 Expose getter for txIndexer (#6327) 2021-04-12 14:47:20 +02:00
Sam KleinmanandGitHub 0f41f7465c p2p: extend e2e tests for new p2p framework (#6323) 2021-04-08 11:09:21 -04:00
Sam KleinmanandGitHub 6d9372bd39 test: improve cleanup for data and disk use (#6311) 2021-04-05 12:39:04 -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
Aleksandr BezobchukandGitHub a554005136 p2p: revised router message scheduling (#6126) 2021-03-25 16:58:46 -04:00
Aleksandr BezobchukandGitHub 003f394512 rpc: index block events to support block event queries (#6226) 2021-03-22 11:47:35 -04:00
9f7051d38a node: implement tendermint modes (#6241)
Co-authored-by: dongsam <dongsamb@gmail.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2021-03-18 11:17:53 +01:00
MarkoandGitHub efd2fde474 privval: add ctx to privval interface (#6240)
## Description

- Add `context.Context` to Privval interface

This pr does not introduce context into our custom privval connection protocol because this will be removed in the next release. When this pr is released.
2021-03-16 14:41:03 +00:00
9498cd80bd Normalise GenesisDoc before saving to state (#6059)
Co-authored-by: Callum <cmwaters19@gmail.com>
2021-02-23 13:27:42 +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 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
Erik GrinakerandGitHub a741314c97 p2p: improve peerStore prototype (#5954)
This improves the `peerStore` prototype by e.g.:

* Using a database with Protobuf for persistence, but also keeping full peer set in memory for performance.
* Simplifying the API, by taking/returning struct copies for safety, and removing errors for in-memory operations.
* Caching the ranked peer set, as a temporary solution until a better data structure is implemented.
* Adding `PeerManagerOptions.MaxPeers` and pruning the peer store (based on rank) when it's full.
* Rewriting `PeerAddress` to be independent of `url.URL`, normalizing it and tightening semantics.
2021-01-25 17:27:44 +00:00
Aleksandr BezobchukandGitHub 68bd2116f0 mempool: p2p refactor (#5919) 2021-01-22 09:34:12 -05:00
CallumandTess Rinearson af723eca8a use correct source of evidence time
Conflicting votes are now sent to the evidence pool to form duplicate vote evidence only once
the height of the evidence is finished and the time of the block finalised.
2021-01-19 16:00:02 +01:00
Aleksandr BezobchukandGitHub 62d7a5d028 blockchain v0: p2p refactor (#5858) 2021-01-18 16:35:11 -05:00
MarkoandGitHub f05788e632 privval: Query validator key (#5876)
## Description

- Query validator key when a remote signer is used. This is supported gRPC remote signing and filePV only. 


Closes: #3009
2021-01-12 10:06:33 +00:00
09cf0bcb01 privval: add grpc (#5725)
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2021-01-06 10:49:30 -08:00
Aleksandr BezobchukandGitHub e986602649 evidence: p2p refactor (#5747) 2021-01-06 11:53:18 -05:00
Erik GrinakerandErik Grinaker b4ce1de44a p2p: rename NodeInfo.DefaultNodeID to NodeID 2021-01-04 11:25:20 +01:00
Callum WatersandGitHub ebff8a96a5 docs: use hyphens instead of snake case (#5802) 2020-12-17 08:59:58 +01:00
Erik GrinakerandGitHub e198edf20e p2p: remove NodeInfo interface and rename DefaultNodeInfo struct (#5799)
The `NodeInfo` interface does not appear to serve any purpose at all, so I removed it and renamed the `DefaultNodeInfo` struct to `NodeInfo` (including the Protobuf representations). Let me know if this is actually needed for anything.

Only the Protobuf rename is listed in the changelog, since we do not officially support API stability of the `p2p` package (according to `README.md`). The on-wire protocol remains compatible.
2020-12-15 18:54:25 +00:00
Erik GrinakerandGitHub bcfc889f25 p2p: implement new Transport interface (#5791)
This implements a new `Transport` interface and related types for the P2P refactor in #5670. Previously, `conn.MConnection` was very tightly coupled to the `Peer` implementation -- in order to allow alternative non-multiplexed transports (e.g. QUIC), MConnection has now been moved below the `Transport` interface, as `MConnTransport`, and decoupled from the peer. Since the `p2p` package is not covered by our Go API stability, this is not considered a breaking change, and not listed in the changelog.

The initial approach was to implement the new interface in its final form (which also involved possible protocol changes, see https://github.com/tendermint/spec/pull/227). However, it turned out that this would require a large amount of changes to existing P2P code because of the previous tight coupling between `Peer` and `MConnection` and the reliance on subtleties in the MConnection behavior. Instead, I have broadened the `Transport` interface to expose much of the existing MConnection interface, preserved much of the existing MConnection logic and behavior in the transport implementation, and tried to make as few changes to the rest of the P2P stack as possible. We will instead reduce this interface gradually as we refactor other parts of the P2P stack.

The low-level transport code and protocol (e.g. MConnection, SecretConnection and so on) has not been significantly changed, and refactoring this is not a priority until we come up with a plan for QUIC adoption, as we may end up discarding the MConnection code entirely.

There are no tests of the new `MConnTransport`, as this code is likely to evolve as we proceed with the P2P refactor, but tests should be added before a final release. The E2E tests are sufficient for basic validation in the meanwhile.
2020-12-15 15:08:16 +00:00
Anton KaliaevandGitHub 28e79a4d02 cmd: modify gen_node_key to print key to STDOUT (#5772)
closes: #5770
closes: #5769

also, include node ID in the output (#5769) and modify NodeKey to use
value semantics (it makes perfect sense for NodeKey to not be a
pointer).
2020-12-10 11:02:35 +04:00
Aleksandr BezobchukandGitHub a879eb444d p2p: state sync reactor refactor (#5671) 2020-12-09 09:31:06 -05:00
Callum WatersandGitHub b35e9ff53e node: improve test coverage on proposal block (#5748)
## Description

Closes: #3156
2020-12-07 21:16:18 +00:00
Anton KaliaevandGitHub 243ff4b43d blockchain/v1: remove in favor of v2 (#5728) 2020-12-03 09:35:47 +04:00
Anton KaliaevandGitHub e13b4386ff abci: modify Client interface and socket client (#5673)
`abci.Client`:

- Sync and Async methods now accept a context for cancellation
    * grpc client uses context to cancel both Sync and Async requests
    * local client ignores context parameter
    * socket client uses context to cancel Sync requests and to drop Async requests before sending them if context was cancelled prior to that

- Async methods return an error
    * socket client returns an error immediately if queue is full for Async requests
    * local client always returns nil error
    * grpc client returns an error if context was cancelled before we got response or the receiving queue had a space for response (do not confuse with the sending queue from the socket client)

- specify clients semantics in [doc.go](https://raw.githubusercontent.com/tendermint/tendermint/27112fffa62276bc016d56741f686f0f77931748/abci/client/doc.go)

`mempool.TxInfo`

- add optional `Context` to `TxInfo`, which can be used to cancel `CheckTx` request

Closes #5190
2020-11-30 16:46:16 +04:00
bf35cc6443 cmd: add support for --key (#5612)
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-11-09 15:22:36 +01:00
Callum WatersandGitHub 3922dde05d evidence: structs can independently form abci evidence (#5610) 2020-11-04 17:14:48 +01:00
Callum WatersandGitHub 55e8ccab21 block: use commit sig size instead of vote size (#5490) 2020-10-13 17:21:37 +02:00
MarkoandGitHub 346aa14db5 fix lint failures with 1.31 (#5489) 2020-10-13 10:22:53 +02:00
Callum WatersandGitHub 6a2a71be07 correctly calculate evidence data size (#5482) 2020-10-12 11:28:41 +02:00
Callum WatersandGitHub 302aec6dcc evidence: use bytes instead of quantity to limit size (#5449)
## Description

Closes: #5432
2020-10-07 09:29:52 +00:00
Erik GrinakerandGitHub f83ecdad1d config: add state sync discovery_time setting (#5399)
Reduces the state sync discovery time from 20 to 15 seconds, and makes it configurable.
2020-09-24 16:01:45 +02:00
Anton KaliaevandGitHub 85a4be87a7 rpc/client: take context as first param (#5347)
Closes #5145

also applies to light/client
2020-09-23 09:21:57 +04:00
Callum WatersandGitHub ed002cea7e evidence: introduction of LightClientAttackEvidence and refactor of evidence lifecycle (#5361)
evidence: modify evidence types (#5342)

light: detect light client attacks (#5344)

evidence: refactor evidence pool (#5345)

abci: application evidence prepared by evidence pool (#5354)
2020-09-22 10:22:54 +02:00
MarkoandGitHub 56911ee352 state: define interface for state store (#5348)
## Description

Make an interface for the state store. 

Closes: #5213
2020-09-15 07:45:48 +00:00
MarkoandGitHub 0ed8dba991 lint: enable errcheck (#5336)
## Description

Enable errcheck linter throughout the codebase

Closes: #5059
2020-09-07 15:03:18 +00:00
MarkoandGitHub b8d08b9ef4 lint: add errchecks (#5316)
## Description

Work towards enabling errcheck

ref #5059
2020-09-04 11:58:03 +00:00