Commit Graph

7897 Commits

Author SHA1 Message Date
Marko
059d43f626 backport ci migration (#5759) 2020-12-09 16:00:29 +01:00
Anton Kaliaev
1baf670c60 use fmt.Sprint for string to int conversion v0.33.9 2020-11-16 16:49:41 +04:00
Anton Kaliaev
b59ecd68ab bump version and update changelog 2020-11-16 16:49:41 +04:00
Anton Kaliaev
24193dd817 privval: increase read/write timeout to 5s and calculate ping interval based on it (#5638)
Partially closes #5550
2020-11-16 16:49:41 +04:00
Anton Kaliaev
b1de0c24f6 consensus: only call privValidator.GetPubKey once per block (#5143)
Closes #4865
2020-11-16 16:49:41 +04:00
Joe Bowman
6e375c2923 only retrieve pubkey once for all validators (partially fixes #4865) (#4895)
in consensus/state.go, when calulating metrics, retrieve address (ergo, pubkey) once prior to iterating over validatorset to ensure we do not make excessive calls to signer.

Partially closes: #4865
2020-11-16 16:49:41 +04:00
Marko
1a8e42d41e changelog: rc0/33.8 (#5222) v0.33.8 2020-08-11 13:35:25 +02:00
Erik Grinaker
1b1fe4d7cc prepare 0.33.7 release (#5202) v0.33.7 2020-08-04 13:21:05 +02:00
Anton Kaliaev
8026fd3cc9 privval: if remote signer errors, don't retry (#5140)
Closes #5112
2020-08-04 13:21:05 +02:00
Tess Rinearson
606d0a89cc changelog: tweak 0.33.6 entry v0.33.6 2020-07-02 15:41:49 +02:00
Anton Kaliaev
cefeab0fbb update changelog and bump version 2020-07-02 15:41:49 +02:00
Anton Kaliaev
8ccfdb96d0 consensus: Do not allow signatures for a wrong block in commits
Closes #4926

The dump consensus state had this:

      "last_commit": {
        "votes": [
          "Vote{0:04CBBF43CA3E 385085/00/2(Precommit) 1B73DA9FC4C8 42C97B86D89D @ 2020-05-27T06:46:51.042392895Z}",
          "Vote{1:055799E028FA 385085/00/2(Precommit) 652B08AD61EA 0D507D7FA3AB @ 2020-06-28T04:57:29.20793209Z}",
          "Vote{2:056024CFA910 385085/00/2(Precommit) 652B08AD61EA C8E95532A4C3 @ 2020-06-28T04:57:29.452696998Z}",
          "Vote{3:0741C95814DA 385085/00/2(Precommit) 652B08AD61EA 36D567615F7C @ 2020-06-28T04:57:29.279788593Z}",

Note there's a precommit in there from the first val from May (2020-05-27) while the rest are from today (2020-06-28). It suggests there's a validator from an old instance of the network at this height (they're using the same chain-id!). Obviously a single bad validator shouldn't be an issue. But the Commit refactor work introduced a bug.

When we propose a block, we get the block.LastCommit by calling MakeCommit on the set of precommits we saw for the last height. This set may include precommits for a different block, and hence the block.LastCommit we propose may include precommits that aren't actually for the last block (but of course +2/3 will be). Before v0.33, we just skipped over these precommits during verification. But in v0.33, we expect all signatures for a blockID to be for the same block ID! Thus we end up proposing a block that we can't verify.
2020-07-02 15:41:49 +02:00
Anton Kaliaev
5e52a6ec55 types: verify commit fully
Since the light client work introduced in v0.33 it appears full nodes
are no longer fully verifying commit signatures during block execution -
they stop after +2/3. See in VerifyCommit:
0c7fd316eb/types/validator_set.go (L700-L703)

This means proposers can propose blocks that contain valid +2/3
signatures and then the rest of the signatures can be whatever they
want. They can claim that all the other validators signed just by
including a CommitSig with arbitrary signature data. While this doesn't
seem to impact safety of Tendermint per se, it means that Commits may
contain a lot of invalid data. This is already true of blocks, since
they can include invalid txs filled with garbage, but in that case the
application knows they they are invalid and can punish the proposer. But
since applications dont verify commit signatures directly (they trust
tendermint to do that), they won't be able to detect it.

This can impact incentivization logic in the application that depends on
the LastCommitInfo sent in BeginBlock, which includes which validators
signed. For instance, Gaia incentivizes proposers with a bonus for
including more than +2/3 of the signatures. But a proposer can now claim
that bonus just by including arbitrary data for the final -1/3 of
validators without actually waiting for their signatures. There may be
other tricks that can be played because of this.

In general, the full node should be a fully verifying machine. While
it's true that the light client can avoid verifying all signatures by
stopping after +2/3, the full node can not. Thus the light client and
full node should use distinct VerifyCommit functions if one is going to
stop after +2/3 or otherwise perform less validation (for instance light
clients can also skip verifying votes for nil while full nodes can not).

See a commit with a bad signature that verifies here: 56367fd. From what
I can tell, Tendermint will go on to think this commit is valid and
forward this data to the app, so the app will think the second validator
actually signed when it clearly did not.
2020-07-02 15:41:49 +02:00
Tess Rinearson
e22acc0f45 prepare v0.33.5 RC2 v0.33.5 2020-05-28 12:41:32 +02:00
Marko
d9c2f01bb5 proto: add proto files for ibc unblock (#4853) (#4906)
these proto files are meant to help unblock ibc in their quest of migrating the ibc module to proto.
2020-05-28 12:41:32 +02:00
Callum Waters
64c7771966 lite2: fix pivot height during bisection
fix bug with assigning the new pivot height during bisection. PR: #4850
2020-05-28 12:41:32 +02:00
Anton Kaliaev
e40602502f p2p: return masked IP (not the actual IP) in addrbook#groupKey
Closes #4846 
Spec https://github.com/tendermint/spec/pull/96
2020-05-28 12:41:32 +02:00
Anton Kaliaev
69b6e0eccb rpc/core: do not lock ConsensusState mutex
in /validators, /consensus_params and /status

Closes #3161
2020-05-28 12:41:32 +02:00
Anton Kaliaev
e8b4226b17 rpc: refactor lib folder (#4836)
Closes https://github.com/tendermint/tendermint/issues/3857

Moves `lib/` folder to `jsonrpc/`.

Renames:

**packages**

`rpc` package -> `jsonrpc` package
`rpcclient` package -> `client` package
`rpcserver` package -> `server` package

**structs and interfaces**

```
JSONRPCClient to Client
JSONRPCRequestBatch to RequestBatch
JSONRPCCaller to Caller
```

**functions**

```
StartHTTPServer to Serve
StartHTTPAndTLSServer to ServeTLS

rpc/jsonrpc/client: rename NewURIClient to NewURI

NewJSONRPCClient to New
NewJSONRPCClientWithHTTPClient to NewWithHTTPClient
NewWSClient to NewWS
```

**misc**

- unexpose `ResponseWriterWrapper`
- remove unused http_params.go
2020-05-28 12:41:32 +02:00
Anton Kaliaev
7772cdc4a4 rpc: use a struct to wrap all the global objects
Closes #3433
2020-05-28 12:41:32 +02:00
Anton Kaliaev
cba24382ac privval: retry GetPubKey/SignVote/SignProposal N times before
returning an error

Closes #4707
2020-05-28 12:41:32 +02:00
Anton Kaliaev
e4e4bf6d6d pex: use highwayhash for pex bucket
Closes #2998

Spec PR: https://github.com/tendermint/spec/pull/94
2020-05-28 12:41:32 +02:00
Anton Kaliaev
62018d90df mempool: allow ReapX and CheckTx functions to run in parallel
allow ReapX and CheckTx functions to run in parallel, making it not possible to block certain proposers from creating a new block.

Closes: #2972
2020-05-28 12:41:32 +02:00
Erik Grinaker
29035985c6 rpc: handle panics during panic handling (#4888)
Fixes #4802. The Go HTTP server has a global panic handler for requests, so it was not as severe as first thought.

This fix can still panic, since we try to send a `500` response - if that happens, the Go HTTP server will terminate the connection. Otherwise, the client will get a 200 response, which we should avoid. I'm sort of torn on whether it's even necessary to include this fix, instead of just letting the HTTP server deal with it.
2020-05-28 12:41:32 +02:00
Anton Kaliaev
e1b3903a7f types: return an error if voting power overflows
in VerifyCommitTrusting

Closes #4755
2020-05-28 12:41:32 +02:00
Erik Grinaker
901ce19cc6 blockchain/v2: backport fixes (#4887)
* blockchain/v2: fix excessive CPU usage due to spinning on closed channels (#4761)

The event loop uses a `select` on multiple channels. However, reading from a closed channel in Go always yields the channel's zero value. The processor and scheduler close their channels when done, and since these channels are always ready to receive, the event loop keeps spinning on them.

This changes `routine.terminate()` to not close the channel, and also removes `stopDemux` and instead uses `events` channel closure to signal event loop termination.

Fixes #4687.

* blockchain/v2: respect fast_sync option (#4772)

Not thoroughly tested, but seems to work. Will do further testing as this is integrated with state sync.

Fixes #4688.
2020-05-28 12:41:32 +02:00
Anton Kaliaev
e080280d34 privval: remove deprecated OldFilePV (#4889)
* privval: remove deprecated `OldFilePV`

The old format was deprecated in v0.28. It's time we remove it.

* fix changelog
2020-05-28 12:41:32 +02:00
Erik Grinaker
642dcd4a12 lite: fix HTTP provider error handling (#4882)
* lite: fix HTTP provider error handling

Fixes #4739, kind of. See #4740 for the proper fix.

---

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
- [x] Applied Appropriate Labels

* adapt tests to missing pull request

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-05-28 12:41:32 +02:00
Erik Grinaker
24c39aa3c3 Makefile: parse TENDERMINT_BUILD_OPTIONS (#4738) (#4883)
Reduce the number of targets and make the buildsystem more
flexible by parsing the TENDERMINT_BUILD_OPTIONS command
line variable (a-la Debian, inspired by dpkg-buildpackage's
DEB_BUILD_OPTIONS), e.g:

 $ make install TENDERMINT_BUILD_OPTIONS='cleveldb'

replaces the old:

 $ make install_c

Options can be mix&match'd, e.g.:

 $ make install TENDERMINT_BUILD_OPTIONS='cleveldb race nostrip'

Three options are available:
- nostrip: don't strip debugging symbols nor DWARF tables.
- cleveldb: use cleveldb as db backend instead of goleveldb;
  it switches on the CGO_ENABLED Go environment variale.
- race: pass -race to go build and enable data race detection.

This changeset is a port of gaia pull request: cosmos/gaia#363.

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-28 12:41:32 +02:00
Anton Kaliaev
9550e8a54d lite2: fix TestVerifyAdjacentHeaders (#4884) 2020-05-28 12:41:32 +02:00
Alexander Bezobchuk
4ddf549e36 types: implement Header#ValidateBasic (#4638)
- Move core stateless validation of the Header type to a ValidateBasic method.
- Call header.ValidateBasic during a SignedHeader validation.
- Call header.ValidateBasic during a PhantomValidatorEvidence validation.
- Call header.ValidateBasic during a LunaticValidatorEvidence validation.

lite tests are skipped since the package is deprecated, no need to waste time on it

closes: #4572

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-05-28 12:41:32 +02:00
Erik Grinaker
ea2d3f4889 test: fix p2p test build breakage caused by Debian testing (#4880) 2020-05-28 12:41:32 +02:00
Anton Kaliaev
8f4080e0cc abci/server: print panic & stack trace to STDERR if logger is not set
Closes #4382
2020-05-28 12:41:32 +02:00
Tess Rinearson
70a4b5ea08 Merge pull request #4714 from tendermint/release/v0.33.4
release: v0.33.4
v0.33.4
2020-04-21 15:47:36 +02:00
Tess Rinearson
6018f2d1a5 kick CI 2020-04-21 15:00:22 +02:00
Tess Rinearson
31a0f48c4a Merge branch 'v0.33' into release/v0.33.4 2020-04-21 14:44:33 +02:00
Marko
727c15e5e2 rc1/v0.33.4
Prepare release 0.33.4
2020-04-21 12:36:33 +00:00
Anton Kaliaev
349556c6d9 lite2/rpc: verify block results and validators (#4703)
Closes: #4695

Verify /block_results and /validators responses from an HTTP client using the light client.

Added count and total to /validators response.

Refs #3113
2020-04-20 16:38:34 +04:00
Anton Kaliaev
ec1c657d5a p2p/pex: fix DATA RACE
in TestPEXReactorDialsPeerUpToMaxAttemptsInSeedMode

Closes #4668

______

For contributor use:

- [x] Wrote tests
- [ ] ~~Updated CHANGELOG_PENDING.md~~
- [x] 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-20 11:03:31 +00:00
Marko
62feafb6bd ci: transition some ci to github actions
## Description

move tests for abci_cli, abci_app and app_tests to github actions


______

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-20 10:30:06 +00:00
Erik Grinaker
82b585cd5e blockstore: allow initial SaveBlock() at any height
Followup from #4588. Allow the first `SaveBlock()` call in an empty block store to be at any height, to start from a truncated block history. Subsequent `SaveBlock()` calls must be for contiguous blocks.

______

For contributor use:

- [x] Wrote tests
- [ ] ~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-20 10:18:03 +00:00
Erik Grinaker
66b0ec0af1 clarify service logging
The service logging can be a bit unclear. For example, with state sync it would log:

```
I[2020-04-20|08:40:47.366] Starting StateSync     module=statesync impl=Reactor
I[2020-04-20|08:40:47.834] Starting state sync    module=statesync
```

Where the first message is the reactor service startup, and the second message is the start of the actual state sync process. This clarifies the first message by changing it to `Starting StateSync service`.

______

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-20 09:23:46 +00:00
Erik Grinaker
b79602981a fix linter warnings 2020-04-20 08:55:51 +00:00
Erik Grinaker
cd19471c49 bump ABCI version to 0.16.2 due to ResponseCommit.retain_height
See #4588 for original change.

I believe this is appropriate. Anything else that needs to be updated?

______

For contributor use:

- [ ] ~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.
- [ ] ~Updated relevant documentation (`docs/`) and code comments~
- [x] Re-reviewed `Files changed` in the Github PR explorer
2020-04-20 08:15:56 +00:00
Callum Waters
55909aac68 docs/architecture: create adr 56: prove amnesia attack
## Description

ADR to address the process for proving an amnesia attack (as a form of global evidence) from `PotentialAmnesiaEvidence` detected by light clients


______

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-20 07:08:57 +00:00
Anton Kaliaev
26c9134f35 lite2: verify ConsensusHash in rpc client
______

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-20 05:56:18 +00:00
Marko
832bf56f77 minor release process change
## Description

The minor release process is changing in order to not have major release changes sitting in the pull request tab.

This changes from taking master and releasing from master to creating a branch that you cherry-pick commits into. 

There are two options on labeling which pull requests to include in a minor release:
1. Use the label `R:minor` to know which pull requests to include then remove the label when those pull requests have been included in a release.
2. Create an Issue where pull request numbers are added. then the issue is closed when the release is done.

this process should be followed after 0.33.3

______

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-17 16:21:25 +00:00
dependabot-preview[bot]
9e0d6a9958 build(deps): bump @vuepress/plugin-google-analytics in /docs (#4692)
Bumps [@vuepress/plugin-google-analytics](https://github.com/vuejs/vuepress/tree/HEAD/packages/@vuepress/plugin-google-analytics) from 1.3.1 to 1.4.1.
- [Release notes](https://github.com/vuejs/vuepress/releases)
- [Changelog](https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vuepress/commits/v1.4.1/packages/@vuepress/plugin-google-analytics)

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-17 10:34:46 +02:00
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