Commit Graph

8123 Commits

Author SHA1 Message Date
Marko
2ac5a559b4 libs: wrap mutexes for build flag with godeadlock (#5126)
## Description

This PR wraps the stdlib sync.(RW)Mutex & godeadlock.(RW)Mutex. This enables using go-deadlock via a build flag instead of using sed to replace sync with godeadlock in all files

Closes: #3242
2020-07-20 07:55:09 +00:00
Anton Kaliaev
8cdb53c811 docs: EventAttribute#Index is not deterministic (#5132)
Closes #5125
2020-07-19 09:36:01 +00:00
Anton Kaliaev
5223cbac27 light: return if target header is invalid (#5124)
Closes #5120
2020-07-17 06:13:00 +00:00
Marko
16d2fa62eb jsonrpc: change log to debug (#5131)
## Description

this log message was marked as not useful and in the issue it was proposed to move it to debug. I am going with this path for now. After we have refactored the logger we shold go through the codebase in order to clean our log statements. 

Closes: #2101
2020-07-16 21:06:22 +00:00
dependabot-preview[bot]
7e8a7c2c41 build(deps): [Security] Bump lodash from 4.17.15 to 4.17.19 in /docs
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. **This update includes a security fix.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-16 11:37:37 +00:00
Marko
7c8c356f71 ci: version linter fix (#5128)
## Description
linter version fix and run make format to have all ci run

Closes: #XXX
2020-07-16 09:01:02 +00:00
Marko
bba966458a bump versiion of ci linter (#5127) 2020-07-16 09:16:32 +01:00
Anton Kaliaev
a08316f16a light: use bisection (not VerifyCommitTrusting) when verifying a head… (#5119)
Closes #4934

* light: do not compare trusted header w/ witnesses

we don't have trusted state to bisect from

* check header before checking height

otherwise you can get nil panic
2020-07-15 15:44:30 +04:00
Marko
9695690861 docs: modify needed proto files for guides (#5123)
## Description

This pr modifies the needed proto files for the java and kotlin guides. 

Closes: #5034
2020-07-15 08:36:40 +00:00
Tess Rinearson
685e19df80 docs: tweak light client documentation (#5121)
Updates the docs for the website to be a little bit clearer on how to run a light client, which is, I suspect, what most people will be looking for.
2020-07-15 07:23:09 +00:00
Marko
6ccccb0933 lint: errcheck (#5091)
## Description

add more error checks to tests


gonna do a third PR that tackles the non test cases
2020-07-14 11:04:41 +00:00
Anton Kaliaev
0825d57cf7 proto/tendermint/abci: fix Request oneof numbers (#5116)
- the sequence does not start with 1
- RequestDeliverTx has out-of-order field number

Closes #5115
2020-07-14 08:24:08 +00:00
Anton Kaliaev
730e16566e proto: change type + a cleanup (#5107)
- drop Height & Base from StatusRequest
It does not make sense nor it's used anywhere currently. Also, there
seem to be no trace of these fields in the ADR-40 (blockchain reactor
v2).

- change PacketMsg#EOF type from int32 to bool
2020-07-13 10:24:17 +00:00
Callum Waters
37545bab88 evidence: new evidence event subscription (#5108) 2020-07-13 11:06:44 +02:00
Callum Waters
8b460786de docs: added further documentation to the subscribing to events page (#5110) 2020-07-11 11:12:14 +02:00
Callum Waters
c552a5b21e rpc: /broadcast_evidence nil evidence check (#5109) 2020-07-10 17:33:14 +02:00
Callum Waters
de8cb8c16d light: fix rpc calls: /block_results & /validators (#5104) 2020-07-10 14:20:31 +02:00
Erik Grinaker
0b1722d78e proto: minor cleanups (#5105)
Removes the unused `NetAddress.str` field, and fixes some comments.
2020-07-09 12:36:39 +00:00
Tess Rinearson
526f45d2f4 CHANGELOG_PENDING: fix the upcoming release number (#5103) 2020-07-09 14:16:24 +02:00
Callum Waters
a97d05be4d evidence: check lunatic vote matches header (#5093) 2020-07-08 17:58:03 +02:00
Erik Grinaker
66ed8ec39d proto: reorganize Protobuf schemas (#5102)
Reorganizes the Protobuf schemas. It is mostly bikeshedding, so if something is contentious or causes a lot of extra work then I'm fine with reverting. Some Protobuf and Go import paths will change.

* Move `abci/types/types.proto` to `abci/types.proto`.

* Move `crypto/keys/types.proto` and `crypto/merkle/types.proto` to `crypto/keys.proto` and `crypto/proof.proto`.

* Drop the use of `msgs` in filenames, as "message" is a very overloaded term (all Protobuf types are messages, and we also have `message Message`). Use `types.proto` as a catch-all, and otherwise name files by conceptual grouping instead of message kind.
2020-07-08 15:47:01 +00:00
Erik Grinaker
59a17b28a7 proto: improve enums (#5099)
Fixes some minor issues with Protobuf enums, not likely to break anything.

Branched off of #5096, rebase to `master` before merging.
2020-07-08 13:49:50 +00:00
Erik Grinaker
bf3c87c864 test: deflake TestAddAndRemoveListenerConcurrency and TestSyncer_SyncAny (#5101)
Fixes #5094.
2020-07-08 13:33:50 +00:00
Erik Grinaker
ab20f3520f proto: increase lint level to basic and fix lint warnings (#5096)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-08 13:27:09 +00:00
Erik Grinaker
58113e31ae evidence: fix data race in Pool.updateValToLastHeight() (#5100)
Fixes #5098.

Is this out in a public release? If so, I'll add a changelog entry as well, for backporting.
2020-07-08 13:19:18 +00:00
Marko
fca788a4e1 ci: only run tests when go files are touched (#5097)
## Description

_Please add a description of the changes that this PR introduces and the files that
are the most critical to review._ 

Closes: #XXX
2020-07-08 12:38:39 +00:00
Anton Kaliaev
16216028a1 proxy: improve ABCI app connection handling (#5078)
Closes #5074 

Old code does not work when --consensus.create_empty_blocks=false
(because it only calls tmos.Kill when ApplyBlock fails). New code is
listening ABCI clients for Quit and kills TM process if there were any
errors.
2020-07-08 12:07:11 +00:00
Marko
ea946fabe0 ci: try to fix codecov (#5095)
## Description

codecov is having issues on upload so upgrade to 1.0.7 where they claim it works better and dont fail ci on failure to upload coverage file

Closes: #XXX
2020-07-08 12:00:18 +00:00
Ismail Khoffi
ebd2cbec97 Rework Docker image (#5087)
* fix #5086

* fixes #5082

- run tendermint init on runtime (if necessary)

* Address some feedback:

 - restrict the entrypoint to only run `tendermint`
 - script into /usr/local/bin

* make it also possible to run ``ith unmodified config again via:

`docker run -v $HOME/.tendermint:/tendermint tendermint/tendermint init

* Update DOCKER/docker-entrypoint.sh

Co-authored-by: Greg Szabo <16846635+greg-szabo@users.noreply.github.com>

Co-authored-by: Greg Szabo <16846635+greg-szabo@users.noreply.github.com>
2020-07-07 19:17:57 +02:00
Lei Wang
430162f8a1 Update reactor.go (#5088)
check bcR.fastSync flag when "OnStop"

fix "service/service.go:161	Not stopping BlockPool -- have not been started yet	{"impl": "BlockPool"}" error when kill process
2020-07-07 09:47:49 +00:00
Marko
be12bb5bb7 ADR-057: RPC (#4857)
## Description

This adr is meant to weight the pros and cons of gRPC and JSON-RPC. It is fairly incomplete on the JSON-RPC side. 

EDIT: Thank you to erik on filling out the pros and cons!!

Work Towards: #3367
2020-07-06 11:27:17 +00:00
Ethan Buchman
bccc7fbca1 .github/issue_template: Update /dump_consensus_state request. (#5060)
Clarify how to get the `/dump_consensus_state` data. 

Eg. https://github.com/tendermint/tendermint/issues/4926 indicated: "Not sure how to do this."
2020-07-06 08:43:09 +00:00
Marko
c33fab961b changelog: reorgranize (#5065)
[**RENDERED**](9a7b139a72/CHANGELOG_PENDING.md (v0336))

Closes #5057
2020-07-06 08:04:53 +00:00
Marko
4f91eaefb8 adjust stale action settings (#5080)
## Description

adjustment of stale action settings, making it a tad more strict

Closes: #XXX
2020-07-03 10:47:43 +00:00
Anton Kaliaev
6e434338ec abci/types: add comment for TotalVotingPower (#5081)
Refs #4581
2020-07-03 10:24:12 +00:00
Marko
003ead851a remove stalebot (#5079)
## Description

- remove stale bot (bad bot 👎 )
- add github action to do bots job

Closes: #XXX
2020-07-03 08:41:47 +00:00
Marko
22b395ed30 consensus: msg testvectors (#5076)
## Description

_Please add a description of the changes that this PR introduces and the files that
are the most critical to review._ 

Closes: #XXX
2020-07-02 17:13:34 +00:00
Tess Rinearson
43c44deae8 changelog: note breaking change in the 0.33.6 release (#5077) 2020-07-02 14:50:05 +00:00
Marko
f508459d80 changelog: update 0.33.6 (#5075)
## Description

update changelog on master and bump version

Closes: #XXX
2020-07-02 14:05:11 +00:00
Marko
943bbd75a4 blockchain: test vectors for proto encoding (#5073)
## Description

this PR adds test vectors for proto encoding. the main difference from amino was the removal of four bytes due to interface encoding.

should i add more cases?

Closes: #XXX
2020-07-02 13:48:31 +00:00
Anton Kaliaev
480b995a31 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
42be533129 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
Pau
137025ca73 mempool: add RemoveTxByKey function (#5066)
In order to have more control over the mempool implementation,
introduce a new exported function RemoveTxByKey.

Export also TxKey() and TxKeySize. Use TxKeySize const instead of
sha256.size, so future changes on the hash function won't break the API.

Allows using a TxKey (32 bytes reference) as parameter instead of
the complete array set. So the application layer does not need to
keep track of the whole transaction but only of the sha256 hash (32 bytes).

This function is useful when mempool.Recheck is disabled.
Allows the Application layer to implement its own cleaning mechanism
without having to re-implement the whole mempool interface.

Mempool.Update() would probably also need to change from txBytes to txKey,
but that would require to change the Interface thus will break backwards
compatibility. For now RemoveTxByKey() looks like a good compromise,
it won't break anything and will help to solve some mempool issues from the
application layer.

Signed-off-by: p4u <pau@dabax.net>
2020-07-01 17:04:19 +00:00
Marko
7e2cc1db5e linter: (1/2) enable errcheck (#5064)
## Description

partially cleanup in preparation for errcheck

i ignored a bunch of defer errors in tests but with the update to go 1.14 we can use `t.Cleanup(func() { if err := <>; err != nil {..}}` to cover those errors, I will do this in pr number two of enabling errcheck.

ref #5059
2020-07-01 15:13:11 +00:00
Marko
8ec8385427 docs: add warning for chainid (#5072)
## Description

add extra warning about chainID

Closes: #XXX
2020-07-01 13:01:00 +00:00
Erik Grinaker
f4a19ea166 README: update chat link with Discord instead of Riot (#5071)
Assuming we don't use Riot anymore.
2020-07-01 10:57:05 +00:00
Marko
66003d7bd1 bump go version (#5070)
## Description

since 0.34 is breaking we should bump the go version to 1.14

Closes: #XXX
2020-07-01 08:36:16 +00:00
Cyrus Goh
5d4eee2eea docs: update .vuepress/config.js (#5043)
## Description

![image](https://user-images.githubusercontent.com/1021101/86193320-7aa13200-bb00-11ea-95ac-aa6468ab7f46.png)


### Next steps:
- [x] bump vuepress-theme-cosmos version
- [x] tweak config.js
- [x] update color variables
- [x] sh, shell → bash for syntax highlighting
2020-07-01 06:43:35 +00:00
Marko
92a361b1e3 mempool: use oneof (#5063)
## Description

To provide the ability to add more message types without needing to cause a breaking change the mempool message was migrated to a oneof.


Closes: #XXX
2020-06-30 09:35:27 +00:00
Anton Kaliaev
9b7f260bbb types: simplify safeMul (#5061)
Refs https://github.com/tendermint/tendermint/pull/4764#discussion_r446488731

also, multiplication using * should be more efficient.
2020-06-29 16:26:14 +00:00