Commit Graph

687 Commits

Author SHA1 Message Date
Marko
0ed8dba991 lint: enable errcheck (#5336)
## Description

Enable errcheck linter throughout the codebase

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

Work towards enabling errcheck

ref #5059
2020-09-04 11:58:03 +00:00
Marko
fbdf8b098e mocks: update with 2.2.1 (#5294)
## Description

When downloading mockery I ran into an issue where we were using the old version. This PR updates to a more recent version.

changelog?

Closes: #XXX
2020-08-26 15:28:46 +00:00
Callum Waters
b7f6e47a42 evidence: modularise evidence by moving verification function into evidence package (#5234) 2020-08-20 18:11:21 +02:00
Erik Grinaker
feaa1ed17e state: don't save genesis state in database when loaded (#5231)
Fixes #5138. I don't have a strong opinion on this, but find it sort of odd that `Load` functions actually save as well.
2020-08-12 08:24:44 +00:00
Erik Grinaker
cc247c091b genesis: add support for arbitrary initial height (#5191)
Adds a genesis parameter `initial_height` which specifies the initial block height, as well as ABCI `RequestInitChain.InitialHeight` to pass it to the ABCI application, and `State.InitialHeight` to keep track of the initial height throughout the code. Fixes #2543, based on [RFC-002](https://github.com/tendermint/spec/pull/119). Spec changes in https://github.com/tendermint/spec/pull/135.
2020-08-11 17:03:28 +00:00
Callum Waters
312c4f8fe1 evidence: change evidence time to block time (#5219)
adds blockstore interface to evidence and adds fix to byzantine test
2020-08-11 14:39:07 +02:00
Callum Waters
68468fb024 evidence: fix usage of time field in abci evidence (#5201)
* fix usage of time in abci evidence

* update changelong and upgrading

* add test cases
2020-08-04 12:58:48 +02:00
Callum Waters
3c21c3546c evidence: remove phantom validator evidence (#5181) 2020-07-31 12:23:58 +02:00
Anton Kaliaev
4d43bfe3bd state: revert event hashing (#5159)
See ADR 058

Closes #5113

Spec PR: https://github.com/tendermint/spec/pull/122
2020-07-30 09:15:08 +00:00
Marko
dc71f265aa types: check if nil or empty valset (#5167)
Solves #5138 in the way that if a validatorSet is nil or empty it will not try to transform it to protobug

Co-authored-by: Callum Michael Waters <cmwaters19@gmail.com>
2020-07-29 20:16:42 +02:00
Callum Waters
b5a5f9274d evidence: minor correction to potential amnesia ev validate basic (#5151)
ValidateBasic() for PotentialAmnesiaEvidence checks that the rounds of the two votes are different and does not check Vote Type

ValidateBasic() now also ensures that the first block is not a nil block (else the validator hasn't actually locked onto a block)
2020-07-27 16:12:42 +02: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
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
Callum Waters
37545bab88 evidence: new evidence event subscription (#5108) 2020-07-13 11:06:44 +02:00
Callum Waters
a97d05be4d evidence: check lunatic vote matches header (#5093) 2020-07-08 17:58:03 +02: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
Erik Grinaker
04b8cf7879 deps: bump tm-db to 0.6.0 (#5058) 2020-06-29 16:07:37 +02:00
Callum Waters
3ecc0ffe7e evidence: replace mock evidence with mocked duplicate vote evidence (#5036) 2020-06-24 07:24:30 +02:00
Marko
5412426ae8 indexer: remove index filtering (#5006)
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-06-23 17:42:10 +02:00
Callum Waters
65d7ce9c9c evidence: improve amnesia evidence handling (#5003)
fix bug so that PotentialAmnesiaEvidence is being gossiped

handle inbound amnesia evidence correctly

add method to check if potential amnesia evidence is on trial

fix a bug with the height when we upgrade to amnesia evidence

change evidence to using just pointers.

More logging in the evidence module

Co-authored-by: Marko <marbar3778@yahoo.com>
2020-06-23 17:09:14 +02:00
Anton Kaliaev
ceac02b891 types: add AppVersion to ConsensusParams (#5031)
Co-authored-by: JamesRay <66258875@qq.com>

making it possible to change app version via EndBlock
2020-06-23 12:14:16 +04:00
Marko
dedf0d2350 proto: folder structure adhere to buf (#5025) 2020-06-22 10:00:51 +02:00
Marko
51da4fe356 types: rename partsheader to partsetheader (#5029)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-22 09:38:03 +02:00
Marko
b8b50733f0 encoding: remove codecs (#4996)
## Description

This pr removes amino from tendermint. 

Closes: #4278
2020-06-15 11:17:12 +00:00
Marko
74cae49c3b proto: leftover amino (#4986) 2020-06-15 11:14:36 +02:00
Anton Kaliaev
a8d8600308 [block#LastResultsHash] add Events + GasWanted/Used (#4845)
Closes #1007
2020-06-12 12:49:14 +04:00
Marko
bdac0818ac p2p: proto leftover (#4995)
## Description

removing codec.go from p2p pkg and some leftover amino encoding

Closes: #XXX
2020-06-11 14:37:29 +00:00
Marko
f6243d8b9e privval: migrate to protobuf (#4985) 2020-06-11 11:54:02 +02:00
Marko
31a361d119 proto: move keys to oneof (#4983) 2020-06-11 11:10:37 +02:00
Callum Waters
5697e144a7 evidence: adr56 form amnesia evidence (#4821)
Creates Amnesia Evidence which is formed from Potential Amnesia Evidence with either a matching proof or after a period of time denoted as the Amnesia Trial Period. This also adds the code necessary so that Amnesia Evidence can be validated and committed on a block
2020-06-10 13:53:55 +02:00
Anton Kaliaev
6ec58f1560 rpc: support EXISTS operator in /tx_search query (#4979)
Closes #4763

* check for Error after for loop ends

so we don't silently ignore errors, which would lead to clients getting
incomplete results

Refs https://github.com/tendermint/tendermint/pull/4979/files#r436511572
2020-06-09 09:30:05 +04:00
Marko
7a8224f8a3 state: proto migration (#4972)
## Description

the second part of state proto migration

Closes: #XXX
2020-06-08 10:16:35 +00:00
Marko
9ef266b88f types: migrate params to protobuf (#4962) 2020-06-05 15:29:53 +02:00
Marko
b9af87c4ea state: proto migration (#4951) 2020-06-05 10:47:16 +02:00
Marko
a88537bb88 ints: stricter numbers (#4939) 2020-06-04 16:34:56 +02:00
Marko
0da7d87351 proto: move mempool to proto (#4940)
* proto: move mempool to proto

- changes according to moving the mempool reactor to proto

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

Closes: #2883
2020-06-03 05:30:52 +00:00
Callum Waters
26bea83694 evidence: retrieve header at height of evidence for validation (#4870)
validation of lunatic evidence requires that the node retrieve the header at the height of the infringement from the block store for comparison
2020-06-03 06:44:06 +02:00
Marko
9149ee7d8b lint: various fixes
## Description

various linitng fixes
2020-05-18 10:20:06 +00:00
Callum Waters
c0682a3bed evidence: prevent proposer from proposing duplicate pieces of evidence (#4839)
prevent proposer from proposing duplicate pieces of evidence
2020-05-13 18:46:30 +02:00
Anton Kaliaev
b7b721c484 change use of errors.Wrap to fmt.Errorf with %w verb
Closes #4603

Commands used (VIM):

```
:args `rg -l errors.Wrap`
:argdo normal @q | update
```

where q is a macros rewriting the `errors.Wrap` to `fmt.Errorf`.
2020-05-12 03:35:47 +00:00
Callum Waters
a620e5fd96 evidence: cap evidence to an absolute number (#4780)
The number of evidence that can be committed in a single block is capped by a new evidence parameter called MaxNum
2020-05-11 15:28:08 +02:00
Anton Kaliaev
826a7150b7 types: remove extra validation in VerifyCommit
plus make sure LastCommit is always non-nil
2020-05-07 09:49:51 +00:00
Anton Kaliaev
25890a6635 types: sort validators by voting power
thus enabling faster commit verification assuming non uniform distribution of power.

Closes #2478

spec: https://github.com/tendermint/spec/pull/91
2020-05-06 07:37:36 +00:00
Callum Waters
47cfadb0aa evidence: refactor evidence mocks throughout packages (#4787)
Predominantly following the discussions regarding the conventions of using mocks, I have decided to revert back to the previous state where mocks were specialized and stored in the separate packages that used them rather then have a generalized mock in the evidence package.

This also was a problem as the state package were running tests too slow and occasionally timing out unnecessarily.

For the replay file I renamed mockEvidencePool to emptyEvidencePool to illustrate that it was intentionally like this and not give the impression that testing software was being used in production

Closes: #4786
2020-05-05 13:11:44 +04:00
Erik Grinaker
663243c446 state: export InitStateVersion
This is useful for custom state sync `StateProvider` implementations that need to build new states for bootstrapping the node. It will also be useful when implementing other mechanisms to bootstrap nodes, e.g. #4642 and #3713.
2020-04-30 11:29:04 +00:00
Callum
15a9f1760d move mempool mock directory 2020-04-29 15:25:01 +02:00
Callum Waters
ba967c077b Merge branch 'master' into callum/4728-check-evidence 2020-04-29 14:04:04 +02:00
Erik Grinaker
511ab6717c add state sync reactor (#4705)
Fixes #828. Adds state sync, as outlined in [ADR-053](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-053-state-sync-prototype.md). See related PRs in Cosmos SDK (https://github.com/cosmos/cosmos-sdk/pull/5803) and Gaia (https://github.com/cosmos/gaia/pull/327).

This is split out of the previous PR #4645, and branched off of the ABCI interface in #4704. 

* Adds a new P2P reactor which exchanges snapshots with peers, and bootstraps an empty local node from remote snapshots when requested.

* Adds a new configuration section `[statesync]` that enables state sync and configures the light client. Also enables `statesync:info` logging by default.

* Integrates state sync into node startup. Does not support the v2 blockchain reactor, since it needs some reorganization to defer startup.
2020-04-29 10:47:00 +02:00
Callum
6dc971052a replace old mocks with new mock 2020-04-28 12:59:18 +02:00