Commit Graph

8266 Commits

Author SHA1 Message Date
Callum Waters
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
Thane Thomson
309e29c245 rpc: revert JSON-RPC/WebSocket response batching (#5378)
Revert the JSON-RPC/WebSocket response serialization format to the
standard way (i.e. a single RPC response per WebSocket text message) to
avoid breaking clients.

Serialization format changes will be discussed in an upcoming ADR.

Closes: #5373
2020-09-22 10:47:43 +04:00
Callum Waters
019d2a3689 ADR 047 - Light client evidence handling revision (#5273) 2020-09-22 07:23:37 +02:00
Erik Grinaker
8e4c41eb99 adr: add API stability ADR (#5341)
[Rendered](https://github.com/tendermint/tendermint/blob/erik/adr-api-stability/docs/architecture/adr-059-go-api-stability.md)
2020-09-17 16:52:03 +00:00
dependabot[bot]
5e09fb2d5e build(deps): Bump github.com/minio/highwayhash from 1.0.0 to 1.0.1 (#5370)
Bumps [github.com/minio/highwayhash](https://github.com/minio/highwayhash) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/minio/highwayhash/releases)
- [Commits](https://github.com/minio/highwayhash/compare/v1.0.0...v1.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-17 17:56:53 +02:00
Marko
ed046966bd upgrading: state store change (#5364)
## Description

Adding a section explaining the state store interface change. I wasn't aware this was used externally. Our infamous API strikes again.


<img width="462" alt="Screen Shot 2020-09-16 at 2 57 12 PM" src="https://user-images.githubusercontent.com/24299864/93342053-2835fe80-f82f-11ea-9296-9484c2931d9a.png">

Closes: #XXX
2020-09-16 16:03:49 +00:00
Erik Grinaker
531fa07ad2 rpc: fix test data races (#5363)
Fixes a couple of test data races. `testing.T` is not concurrency-safe and should not be used in goroutines at all.
2020-09-16 08:48:28 +00:00
Erik Grinaker
817646a88e rpc: fix openapi spec syntax error (#5358)
Broke in #5356.
2020-09-15 08:58:58 +00:00
Marko
cbe72db7be makefile: add options for other DBs (#5357)
## Description

This PR adds support for badgerdb, rocksdb and boltdb within the build options. 

RocksDB builds correctly.

```
 make build TENDERMINT_BUILD_OPTIONS=rocksdb    
CGO_ENABLED=1 go build -mod=readonly -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w " -trimpath -tags 'tendermint rocksdb' -o build/tendermint ./cmd/tendermint/

tendermint on  master [$!] via 🐹 v1.15.2 took 19s 
```

Closes: #5355
2020-09-15 08:27:14 +00:00
Anton Kaliaev
8aac1d1333 docs: document max entries for /blockchain RPC (#5356)
Closes #5339
2020-09-15 07:55:27 +00:00
Marko
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
Marko
bf6bd2cefa docs: make rfc section disppear (#5353)
## Description

Hide the RFC section from the docs website. 

Closes: #XXX
2020-09-14 09:33:24 +00:00
Erik Grinaker
d1a88fe39f markdownlint: ignore .github directory (#5351) 2020-09-11 10:04:22 +00:00
Marko
226af0ad2d docs: add more description to initial_height (#5350)
## Description

Add a sentence on `initial_height`.

There will be a section in the spec repo explaining the genesis more in depth as this is something that will affect both clients

Closes: #XXX
2020-09-11 06:36:56 +00:00
Marko
5069a8822c crypto: reword readme (#5349)
## Description

Reword the readme of the crypto package. 

Closes: #XXX
2020-09-10 12:52:32 +00:00
Erik Grinaker
8571b2ee9a rfc: add end-to-end testing RFC (#5337)
[Rendered](https://github.com/tendermint/tendermint/blob/erik/rfc-e2e-testing/docs/rfc/rfc-001-end-to-end-testing.md).

Related to #5291.
2020-09-09 15:53:43 +00:00
dependabot[bot]
72d832ff6c build(deps): Bump google.golang.org/grpc from 1.31.1 to 1.32.0 (#5346)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.31.1 to 1.32.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.31.1...v1.32.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-09 13:42:47 +02:00
Marko
098ebaee22 p2p: reduce log severity (#5338)
## Description

This PR aims to reduce the amount of `Logger.Error(..)` calls. Many of these calls are benign and do not need any intervention. 

Went from: 
```
node1    | E[2020-09-08|14:32:48.407] Connection failed @ recvRoutine (reading byte) module=p2p peer=af8747a81383f40583ae8790d2cc1f92cc7e4a35@192.167.10.4:26656 conn=MConn{192.167.10.4:26656} err="read tcp 192.167.10.3:48614->192.167.10.4:26656: read: connection reset by peer"
node1    | E[2020-09-08|14:32:48.407] Stopping peer for error                      module=p2p peer="Peer{MConn{192.167.10.4:26656} af8747a81383f40583ae8790d2cc1f92cc7e4a35 out}" err="read tcp 192.167.10.3:48614->192.167.10.4:26656: read: connection reset by peer"
node1    | E[2020-09-08|14:32:48.407] Error while stopping peer                    module=p2p peer=af8747a81383f40583ae8790d2cc1f92cc7e4a35@192.167.10.4:26656 err="already stopped"
node1    | E[2020-09-08|14:32:48.408] MConnection flush failed                     module=p2p peer=af8747a81383f40583ae8790d2cc1f92cc7e4a35@192.167.10.4:26656 err="write tcp 192.167.10.3:48614->192.167.10.4:26656: use of closed network connection"
```
To: 
```
node1    | E[2020-09-08|14:42:54.023] Stopping peer for error                      module=p2p peer="Peer{MConn{192.167.10.5:37844} e3d01d1795464a356227d0cba6567d6b94381e55 in}" err=EOF
```

Closes: #4937
2020-09-09 10:21:34 +00:00
Marko
6ab2a19088 header: check block protocol (#5340)
## Description

Check block protocol version in header validate basic. 

I tried searching for where we check the P2P protocol version but was unable to find it. When we check compatibility with a node we check we both have the same block protocol and are on the same network, but we do not check if we are on the same P2P protocol. It makes sense if there is a handshake change because we would not be able to establish a secure connection, but a p2p protocol version bump may be because of a p2p message change, which would go unnoticed until that message is sent over the wire.  Is this purposeful?

Closes: #4790
2020-09-09 09:13:18 +00:00
Marko
c237e06078 ci: fix net run (#5343) 2020-09-08 20:57:36 +02:00
Callum Waters
a88f031b1b ADR 59 evidence composition and lifecycle (#5331) 2020-09-08 14:17:14 +02:00
Marko
0ed8dba991 lint: enable errcheck (#5336)
## Description

Enable errcheck linter throughout the codebase

Closes: #5059
2020-09-07 15:03:18 +00:00
Callum Waters
3359e0bf2f resurrect consensus tests (#5334) 2020-09-07 09:54:13 +04:00
Tess Rinearson
2eda1798a6 CODEOWNERS: specify more precise codeowners (#5333) 2020-09-04 15:30:00 +02:00
Marko
b8d08b9ef4 lint: add errchecks (#5316)
## Description

Work towards enabling errcheck

ref #5059
2020-09-04 11:58:03 +00:00
Anton Kaliaev
59ec3d91e4 rpc/jsonrpc/server: ws server optimizations (#5312)
* docs: goleveldb is much more stable now

Refs https://github.com/syndtr/goleveldb/issues/226#issuecomment-682495490

* rpc/core/events: make sure WS client receives every event

previously, if the write buffer was full, the response would've been
lost without any trace (log msg, etc.)

* rpc/jsonrpc/server: set defaultWSWriteChanCapacity to 1

Refs #3905
Closes #3829

setting write buffer capacity to 1 makes transactions count per block
more stable and also reduces the pauses length by 20s.

before: https://github.com/tendermint/tendermint/issues/3905#issuecomment-681854328 net.Read - 20s
after: net.Read - 0.66s

* rpc/jsonrpc/server: buffer writes and avoid io.ReadAll during read
2020-09-04 10:58:47 +04:00
Erik Grinaker
39d2ac4dbc statesync: fix the validator set heights (again) (#5330)
This reverts the "fix" in #5311, after the real fix in #5328.
2020-09-03 15:05:04 +00:00
Marko
4787c5b61a metrics: switch from gauge to histogram (#5326)
## Description

Part of the issue is to add metrics to the websocket connection. It seems this would require some moving around of things in the node pkg. I opted to not make this change now, and wait for when we do a node pkg refactor. 

If someone disagrees with this appraoch please let me know, I can attempt to get metrics into the rpc layer.

There is not a need to update documentation as it already states this metric is a histogram..

Closes: #1791
2020-09-03 13:08:13 +00:00
Erik Grinaker
63ea4f1d26 consensus: fix wrong proposer schedule for InitChain validators (#5329)
Fixes #5328.
2020-09-03 12:58:09 +00:00
Marko
f7d4fafa73 docs: add missing metrics (#5325)
## Description

Add missing metrics. 

`Blockchain/v2` exposes metrics for events. I don't find these as something a node operator should utilize as it does not bring insight. 

Closes: #XXX
2020-09-03 07:50:31 +00:00
Callum Waters
e2927d2088 light: move dropout handling and invalid data to the provider (#5308) 2020-09-02 18:28:48 +02:00
Callum Waters
c752e2e586 abci: update evidence (#5324) 2020-09-02 18:17:59 +02:00
Marko
c2ce5e6f35 docs: move subscription to tendermint-core (#5323)
## Description

- Move subscriptions to tendermint-core section. 

- Remove unused photot

Closes: #XXX
2020-09-02 14:53:29 +00:00
Marko
710a97d850 evidence: remove amnesia & POLC (#5319)
## Description

remove unneeded types 

![](https://media1.giphy.com/media/fSAyceY3BCgtiQGnJs/giphy.gif)

ref #5288
2020-09-02 13:05:15 +00:00
Erik Grinaker
2f4c1f60c7 statesync: broadcast snapshot request to all peers on startup (#5320)
On startup, the peer-to-peer stack may have peers connected before the state sync process begins, causing these to not trigger `AddPeer` events and thus not be used for snapshot discovery. Broadcasting a snapshot request to these explicitly makes sure we discover snapshots from existing peers as well.
2020-09-02 08:16:08 +00:00
Marko
82011ee7ab evidence: remove lunatic (#5318)
## Description

remove lunaticEvidence
2020-09-01 16:56:26 +00:00
Marko
e0140e4beb evidence: remove ConflictingHeaders type (#5317)
## Description

Remove ConflictingHeaders & compositeEvidence types


Ref #5288
2020-09-01 16:34:37 +00:00
Callum Waters
2b58a62721 light: implement light block (#5298) 2020-09-01 17:45:55 +02:00
Marko
b6a5f7b126 rpc: add private & unconditional to /dial_peer (#5293)
## Description

Allow dialing of private and unconditional peers through the RPC

Closes: #1705
2020-09-01 12:43:23 +00:00
Anton Kaliaev
43c3e4265b config: rename prof_laddr to pprof_laddr and move it to rpc (#5315)
* config: rename prof_laddr to pprof_laddr and move it to rpc

also, remove `/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler`
and `/unsafe_write_heap_profile` in favor of pprof server functionality.

Closes #5303

* update changelog

* log start
2020-09-01 11:54:21 +04:00
Anton Kaliaev
8a1404b70e mempool: return an error when WAL fails (#5292)
Closes #2319
2020-09-01 10:21:11 +04:00
Marko
8e21b7dc79 docs: add doc on state sync configuration (#5304)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-08-31 18:11:37 +02:00
Erik Grinaker
686361ff3e statesync: fix valset off-by-one causing consensus failures (#5311) 2020-08-31 13:31:00 +02:00
Callum Waters
86707862d4 fix validator set proposer priorities in light client provider (#5307) 2020-08-31 12:47:38 +02:00
Cyrus Goh
55cd49ad08 docs: add algolia docsearch configs (#5309) 2020-08-31 09:07:31 +02:00
Erik Grinaker
49efd44faa node: fix genesis state propagation to state sync (#5302)
State sync broke in #5231 since the genesis state is not propagated explicitly from `NewNode()` to `Node.OnStart()` and further into the state sync initialization. This is a hack until we can clean up the node startup process.
2020-08-28 10:32:37 +00:00
dependabot[bot]
f2f60181a9 build(deps): Bump github.com/tendermint/tm-db from 0.6.1 to 0.6.2 (#5296)
* build(deps): Bump github.com/tendermint/tm-db from 0.6.1 to 0.6.2

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
2020-08-28 12:06:24 +02:00
Marko
e8eef85619 crypto: remove proto privatekey (#5301)
## Description

This type was used for json but was never removed once we migrated to tmjson. 


Closes: #XXX
2020-08-28 09:51:26 +00:00
Marko
0fafffcd5a config: trust period consistency (#5297)
## Description

make state sync trust period consistent with the default in the `tendermint light` cmd

Closes: #XXX
2020-08-27 14:44:47 +00:00
dongsam
e30b125725 consensus: double-sign risk reduction (ADR-51) (#5147)
Implementation spec of Double Signing Risk Reduction [ADR-51](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-051-double-signing-risk-reduction.md) by B-Harvest
- Add `DoubleSignCheckHeight` config variable to ConsensusConfig for "How many blocks looks back to check existence of the node's consensus votes when before joining consensus"
- Add `consensus.double_sign_check_height` to `config.toml` and `tendermint node` as flag for set `DoubleSignCheckHeight`
- Set default `consensus.double_sign_check_height` to `0`  ( it could be adjustable in this PR, disable when 0  )

Refs

- [ADR-51](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-051-double-signing-risk-reduction.md)
- [https://github.com/tendermint/tendermint/issues/4059](https://github.com/tendermint/tendermint/issues/4059)
- [https://github.com/tendermint/tendermint/pull/4262](https://github.com/tendermint/tendermint/pull/4262)
2020-08-27 08:57:36 +04:00