Commit Graph

7838 Commits

Author SHA1 Message Date
Erik Grinaker
ee9545e971 blockchain/v2: don't broadcast base if height is 0
## Description

Fixes a bug where the reactor would broadcast a base with height=0.

______

For contributor use:

- [ ] Wrote tests
- [ ] Updated CHANGELOG_PENDING.md
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Updated relevant documentation (`docs/`) and code comments
- [x] Re-reviewed `Files changed` in the Github PR explorer
2020-04-16 11:33:59 +00:00
Marko
cadcbb2bf5 docs: amend adr-54 with changes in the sdk (#4684) 2020-04-16 12:00:33 +02:00
Marko
7b717c72df changelog: add entries from secruity releases
______

For contributor use:

- [ ] Wrote tests
- [ ] Updated CHANGELOG_PENDING.md
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Updated relevant documentation (`docs/`) and code comments
- [ ] Re-reviewed `Files changed` in the Github PR explorer
2020-04-15 15:09:10 +00:00
Marko
de2728f6c8 docs/architecture: add adr-55 for proto repo design (#4623) 2020-04-15 16:57:59 +02:00
Marko
d2881d53f9 dep: bump protobuf, cobra, btcutil & std lib deps (#4676) 2020-04-15 10:17:22 +04:00
Anton Kaliaev
11fa625934 evidence: both MaxAgeDuration and MaxAgeNumBlocks need to be surpassed (#4667)
for evidence to be considered expired. otherwise, a cabal group can
  manipulate block time to make a particular evidence too old.

Refs https://github.com/tendermint/tendermint/issues/2565#issuecomment-432896645
Refs https://github.com/tendermint/tendermint/issues/2653
spec PR: tendermint/spec#87
2020-04-14 14:58:50 +04:00
Erik Grinaker
fb35b474ad blockchain/v2: allow setting nil switch, for CustomReactors()
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰    
v    Before smashing the submit button please review the checkboxes.
v    If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

Fixes an issue reported in https://github.com/tendermint/tendermint/issues/4595#issuecomment-612667441.

Not sure if this is sufficient to fully remove the reactor, but it fixes the immediate problem.
______

For contributor use:

- [x] Wrote tests
- [x] ~Updated CHANGELOG_PENDING.md~
- [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [x] ~Updated relevant documentation (`docs/`) and code comments~
- [x] Re-reviewed `Files changed` in the Github PR explorer
2020-04-14 08:48:40 +00:00
Erik Grinaker
ac6519dbf9 mergify: use PR title and body for squash merge commit (#4669) 2020-04-14 10:30:55 +02:00
Alessio Treglia
fcbce21534 cli: add command to generate shell completion scripts (#4665)
How to use it:

```
$ . <(tendermint completion)
```

Note that the completion command does not show up in the help screen,
though it comes with its own --help option.

This is a port of the feature provided by cosmos-sdk.
2020-04-13 16:08:23 +04:00
dependabot-preview[bot]
ef56e66611 build(deps): bump github.com/spf13/viper from 1.6.2 to 1.6.3 (#4664)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.6.2...v1.6.3)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-10 14:46:21 +00:00
Tess Rinearson
6ae0b11756 README: specify supported versions (#4660)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-04-10 07:20:42 +00:00
Anton Kaliaev
4f88071324 update changelog and version 2020-04-09 19:32:00 +02:00
Anton Kaliaev
e2d6859afd p2p: limit the number of incoming connections
to p2p.max_num_inbound_peers + len(p2p.unconditional_peer_ids)
2020-04-09 19:32:00 +02:00
Tess Rinearson
ff87bd912f mempool: reserve IDs in InitPeer instead of AddPeer 2020-04-09 19:32:00 +02:00
Alessio Treglia
dac030d6da Merge pull request #4659 from tendermint/alessio/go-mod-tidy
run go mod tidy
2020-04-08 19:26:20 +02:00
Marko
e4bb464126 Merge branch 'master' into alessio/go-mod-tidy 2020-04-08 18:52:28 +02:00
Denis Fadeev
d14bd944ba Docs website update (#4658) 2020-04-08 18:52:04 +02:00
Alessio Treglia
52f729bb51 run go mod tidy 2020-04-08 18:41:43 +02:00
dependabot-preview[bot]
f70785bc95 build(deps): bump google.golang.org/grpc from 1.28.0 to 1.28.1 (#4653)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.28.0...v1.28.1)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-07 14:01:57 +00:00
Callum Waters
88d7007c3c check evidence hasn't already been stored (#4632)
Add Has function, create better handling of errors when adding evidence, usage of error types.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-04-07 08:42:14 +00:00
Marko
499f9ed153 lint: add review dog (#4652)
* lint: add review dog

- golangci is being deprecated on the 15th

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2020-04-07 10:28:26 +02:00
Callum Waters
6aa469d008 p2p: PEX message abuse should ban as well as disconnect (#4621)
* mark unsolicited and too frequent messaged as bad

* add tests

* update changelog and fix error

* revised error types

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-04-07 04:26:13 +00:00
Alexander Bezobchuk
c11013f094 lite2: Default to http scheme in provider.New (#4649)
Closes: #4643
2020-04-06 21:06:33 +04:00
Callum Waters
379848eab7 lite2: Prevent falsely returned double voting error (#4620)
* prevent faulty double voting error

* create test

* clean tests

* clean tests

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-04-06 06:04:24 +00:00
Erik Grinaker
f51ca72b24 config: allow fastsync.version = v2 (#4639) 2020-04-04 14:33:50 +00:00
Erik Grinaker
61057a8b0a upgrading: add note on rpc/client subpackages (#4636)
* upgrading: add note on rpc/client subpackages

* clarify constructors
2020-04-03 14:57:19 +00:00
Erik Grinaker
4298bbcc4e add support for block pruning via ABCI Commit response (#4588)
* Added BlockStore.DeleteBlock()

* Added initial block pruner prototype

* wip

* Added BlockStore.PruneBlocks()

* Added consensus setting for block pruning

* Added BlockStore base

* Error on replay if base does not have blocks

* Handle missing blocks when sending VoteSetMaj23Message

* Error message tweak

* Properly update blockstore state

* Error message fix again

* blockchain: ignore peer missing blocks

* Added FIXME

* Added test for block replay with truncated history

* Handle peer base in blockchain reactor

* Improved replay error handling

* Added tests for Store.PruneBlocks()

* Fix non-RPC handling of truncated block history

* Panic on missing block meta in needProofBlock()

* Updated changelog

* Handle truncated block history in RPC layer

* Added info about earliest block in /status RPC

* Reorder height and base in blockchain reactor messages

* Updated changelog

* Fix tests

* Appease linter

* Minor review fixes

* Non-empty BlockStores should always have base > 0

* Update code to assume base > 0 invariant

* Added blockstore tests for pruning to 0

* Make sure we don't prune below the current base

* Added BlockStore.Size()

* config: added retain_blocks recommendations

* Update v1 blockchain reactor to handle blockstore base

* Added state database pruning

* Propagate errors on missing validator sets

* Comment tweaks

* Improved error message

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* use ABCI field ResponseCommit.retain_height instead of retain-blocks config option

* remove State.RetainHeight, return value instead

* fix minor issues

* rename pruneHeights() to pruneBlocks()

* noop to fix GitHub borkage

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-04-03 08:38:32 +00:00
Erik Grinaker
ce50dda66c ADR-053: strengthen and simplify the state sync ABCI interface (#4610)
* adr-053: strengthened and simplified ABCI interface

* remove internal_error reason and open questions

* add follow-up task for block backfill

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-04-02 13:37:00 +00:00
Erik Grinaker
fdf9c7ae64 rpc/client: split out client packages (#4628)
* rpc/client: initial split into directories

* lite2: split out test package

* rpc/client: simplify client constructurs

* updated docs

* updated changelog
2020-04-02 13:25:30 +00:00
Anton Kaliaev
6c88d2ba1f lite2: make maxClockDrift an option (#4616)
Closes #4607
2020-03-31 16:33:33 +04:00
Callum Waters
5c380cdacb lite2: use bisection for some of backward verification (#4575)
Closes: #4537

Uses SignedHeaderBefore to find header before unverified header and then bisection to verify the header. Only when header is between first and last trusted header height else if before the first trusted header height then regular backwards verification is used.
2020-03-31 16:20:22 +04:00
Yongwoo Lee
bcf27c2364 rpc: add codespace to ResultBroadcastTx (#4611)
Closes: #4606
2020-03-31 11:49:28 +04:00
Marko
f5651d2b61 proto: use docker to generate stubs (#4615)
* proto: use docker to generate stubs

- provide an option to developers to use docker to generate proto stubs

closes #4579

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2020-03-30 16:48:48 +02:00
dependabot-preview[bot]
9edf17a85c build(deps): bump github.com/tendermint/tm-db from 0.5.0 to 0.5.1 (#4613)
Bumps [github.com/tendermint/tm-db](https://github.com/tendermint/tm-db) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/tendermint/tm-db/releases)
- [Changelog](https://github.com/tendermint/tm-db/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tendermint/tm-db/compare/v0.5.0...v0.5.1)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-30 14:05:42 +00:00
dependabot-preview[bot]
94f5321fa3 build(deps): bump github.com/spf13/cobra from 0.0.6 to 0.0.7 (#4612)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.6 to 0.0.7.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v0.0.6...0.0.7)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-30 13:49:29 +00:00
Tess Rinearson
ccf53a2276 all: name reactors when they are initialized (#4608)
Previously, many reactors were initialized with the name "Reactor," which made it difficult to log which reactor was doing what. This changes those reactors' names to something more descriptive.
2020-03-27 18:30:42 +01:00
Marko
7164c67205 docs: validator setup & Key info (#4604)
- defined what variables needed to be changed in the `config.toml` in order to run a validator.
- Briefly explained how a sentry node archtecture should look
- add section explaing importance of key secruity

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2020-03-27 16:17:23 +00:00
Callum Waters
53aa1ceba5 create style guide and update contributors section (#4576) 2020-03-27 16:26:39 +01:00
Marko
b14c0e579e tools: remove need to install buf (#4605)
* tools: remove need to install buf

- using buf docker image instead of needing devs to install it

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* fix ci for lint and break checking
2020-03-27 06:47:39 +01:00
Callum Waters
a25faed5f0 lite2: cache headers in bisection (#4562)
Closes: #4546

The algorithm uses an array to store the headers and validators and populates it at every bisection (which is an unsuccessful verification). When a successful verification finally occurs it updates the new trusted header, trims that header from the cache (the array) and sets the depth pointer back to 0. Instead of retrieving new headers it will use the cached headers, incrementing in depth until it reaches the end of the cache which by then it will start to retrieve new headers from the provider. 

Mathematically, this method doesn't properly bisect after the first round but it will always choose a pivot header that is within 1/8th of the upper header's height. I.e. if we are trying to jump 128 headers, the maximum offset from bisection height (64) is 64 + 16(128/8) = 80, therefore a better heuristic would be to obtain the new pivot header height as the middle of these two numbers which would therefore mean to multiply it by 9/16ths instead of 1/2  (sorry this might be a bit more complicated in writing but I can try better explain if someone is interested). Therefore I would also, upon consensus, propose that we change the pivot height to 9/16th's of the previous height
2020-03-26 12:38:02 +01:00
Marko
43f3276d6f change link checker to run daily (#4601) 2020-03-25 06:59:52 +00:00
Marko
18d44a0186 blockchain: enable v2 to be set (#4597)
* blockchain: enable v2 to be set

- enable v2 to be set via config params

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* replace tab with space

* correctly spell usability
2020-03-23 19:12:31 +00:00
Marko
130b16529d minor link fixing (#4598) 2020-03-23 17:51:54 +01:00
Marko
044f1bf288 format: add format cmd & goimport repo (#4586)
* format: add format cmd & goimport repo

- replaced format command
- added goimports to format command
- ran goimports

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* fix outliers & undo proto file changes
2020-03-23 09:19:26 +01:00
Greg Szabo
d9c34315d2 Docker image port fix (#4589)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-21 13:37:49 +00:00
Marko
a116dca990 deps: run go mod tidy (#4587)
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2020-03-21 09:57:18 +00:00
dependabot-preview[bot]
a0294fe5b9 build(deps): bump github.com/gorilla/websocket from 1.4.1 to 1.4.2 (#4584)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.4.1...v1.4.2)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-20 11:44:30 +00:00
Greg Szabo
c05b2f2384 Dockerfile updated with defaults (#4577) 2020-03-17 10:31:55 +00:00
Anton Kaliaev
c917c2ddfb rpc: fix panic when Subscribe is called (#4570)
but HTTP client is not running.

`Subscribe`, `Unsubscribe(All)` methods return an error now.

Closes #4568
2020-03-16 22:02:54 +04:00
dependabot-preview[bot]
629dff0f0d build(deps): bump github.com/prometheus/client_golang (#4574)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.5.0...v1.5.1)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-16 12:29:20 +00:00