Marko
dcc67642fa
proto: remove amino proto tests ( #4982 )
...
## Description
These tests were made to test the compatibility of amino and protobuf. Since we are moving to protobuf they are not needed anymore.
The proto3 directory was created to be used only in these tests
Closes: #XXX
2020-06-08 09:49:47 +00:00
Marko
4a87d60736
light: migrate to proto ( #4964 )
2020-06-08 09:14:58 +02:00
Marko
f9f4916bc3
store: proto migration ( #4974 )
...
## Description
migrate store to protobuf
Closes: #XXX
2020-06-08 06:43:29 +00:00
Marko
9ef266b88f
types: migrate params to protobuf ( #4962 )
2020-06-05 15:29:53 +02:00
Anton Kaliaev
245794a3fd
types: remove VerifyFutureCommit ( #4961 )
...
It was previously used by the now removed `lite` package.
2020-06-05 12:31:30 +00:00
Marko
b4aca980e9
proto: change to use gogofaster ( #4957 )
2020-06-05 14:18:44 +02:00
Marko
b9af87c4ea
state: proto migration ( #4951 )
2020-06-05 10:47:16 +02:00
Marko
ee91312d34
proto: add more to/from ( #4956 )
...
## Description
adding in some more to/from methods/functions
Closes: #XXX
2020-06-05 04:42:04 +00:00
Marko
dc49dcc1c1
evidence: json tags for DuplicateVoteEvidence ( #4959 )
...
## Description
Add json tags to duplicate evidence
Closes : #4958
2020-06-04 22:41:16 +00:00
Marko
a88537bb88
ints: stricter numbers ( #4939 )
2020-06-04 16:34:56 +02:00
Marko
7c576f02ab
keys: change to []bytes ( #4950 )
2020-06-04 15:32:42 +02:00
Marko
c2578e2262
light: rename lite2 to light & remove lite ( #4946 )
...
This PR removes lite & renames lite2 to light throughout the repo
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com >
Closes : #4944
2020-06-03 10:13:42 +00:00
Marko
99d88cbe2f
crypto: remove key suffixes ( #4941 )
...
## Description
- remove keyname suffix from keys
Closes : #2228
2020-06-03 05:46:29 +00: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
8cd3dec102
types: create ValidateBasic() funcs for validator and validator set ( #4905 )
2020-05-28 11:40:39 +02:00
Erik Grinaker
f1000794f2
types/test: remove slow test cases in TestValSetUpdatePriorityOrderTests ( #4903 )
...
These test cases are extremely slow when running with the race detector, often taking more that 2 minutes on my local machine. I can easily see them timing out on the much slower CI machines, causing these failures:
```
panic: test timed out after 5m0s
goroutine 234 [running]:
testing.(*M).startAlarm.func1()
/usr/local/go/src/testing/testing.go:1460 +0x11c
created by time.goFunc
/usr/local/go/src/time/sleep.go:168 +0x52
goroutine 1 [chan receive, 4 minutes]:
testing.(*T).Run(0xc000172c60, 0x107a5a2, 0x22, 0x11bfc68, 0x1)
/usr/local/go/src/testing/testing.go:1044 +0x699
testing.runTests.func1(0xc000172c60)
/usr/local/go/src/testing/testing.go:1285 +0xa7
testing.tRunner(0xc000172c60, 0xc00012bcc8)
/usr/local/go/src/testing/testing.go:992 +0x1ec
testing.runTests(0xc00000e2c0, 0x1901500, 0x72, 0x72, 0x0)
/usr/local/go/src/testing/testing.go:1283 +0x528
testing.(*M).Run(0xc000214380, 0x0)
/usr/local/go/src/testing/testing.go:1200 +0x300
github.com/tendermint/tendermint/types.TestMain(0xc000214380)
/go/src/github.com/tendermint/tendermint/types/block_test.go:30 +0x59
main.main()
_testmain.go:380 +0x334
goroutine 255 [runnable]:
bytes.Equal(...)
/usr/local/go/src/bytes/bytes.go:20
github.com/tendermint/tendermint/types.(*ValidatorSet).GetByAddress(0xc005499020, 0xc006056650, 0x5, 0x8, 0x13af, 0xc005514100)
/go/src/github.com/tendermint/tendermint/types/validator_set.go:253 +0xfd
github.com/tendermint/tendermint/types.verifyUpdates.func1(0xc00614b940, 0xc005499020, 0x47cd)
/go/src/github.com/tendermint/tendermint/types/validator_set.go:415 +0x84
github.com/tendermint/tendermint/types.verifyUpdates(0xc006110000, 0x11b7, 0x1780, 0xc005499020, 0xb52ff, 0x0, 0x0, 0x5c9)
/go/src/github.com/tendermint/tendermint/types/validator_set.go:429 +0x220
github.com/tendermint/tendermint/types.(*ValidatorSet).updateWithChangeSet(0xc005499020, 0xc00602c000, 0x1780, 0x1780, 0xc006098201, 0xc00608d4b8, 0xc006037bf8)
/go/src/github.com/tendermint/tendermint/types/validator_set.go:600 +0x2f3
github.com/tendermint/tendermint/types.(*ValidatorSet).UpdateWithChangeSet(0xc005499020, 0xc00602c000, 0x1780, 0x1780, 0x1780, 0x1780)
/go/src/github.com/tendermint/tendermint/types/validator_set.go:636 +0x78
github.com/tendermint/tendermint/types.applyChangesToValSet(0xc0005c8ea0, 0x0, 0x0, 0xc005499020, 0xc0005d1160, 0x3, 0x3)
/go/src/github.com/tendermint/tendermint/types/validator_set_test.go:1169 +0x1bb
github.com/tendermint/tendermint/types.verifyValSetUpdatePriorityOrder(0xc0005c8ea0, 0xc005499020, 0x0, 0x0, 0xc005600000, 0x2710, 0x2710, 0xc0055c8000, 0x5c9, 0x5c9, ...)
/go/src/github.com/tendermint/tendermint/types/validator_set_test.go:1239 +0x217
github.com/tendermint/tendermint/types.TestValSetUpdatePriorityOrderTests(0xc0005c8ea0)
/go/src/github.com/tendermint/tendermint/types/validator_set_test.go:1228 +0x1205
testing.tRunner(0xc0005c8ea0, 0x11bfc68)
/usr/local/go/src/testing/testing.go:992 +0x1ec
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:1043 +0x661
FAIL github.com/tendermint/tendermint/types 300.677s
FAIL
```
2020-05-27 11:10:49 +00:00
Callum Waters
2014357a19
evidence: remove header from phantom evidence ( #4892 )
2020-05-27 09:20:45 +02:00
Anton Kaliaev
187120a04d
types: remove unnecessary sort call ( #4876 )
...
in TestValSetUpdatePriorityOrderTests https://app.circleci.com/pipelines/github/tendermint/tendermint/3849/workflows/6d241fc8-72a8-4a3b-b3fc-887a48518f82/jobs/114996
also, reduce the number of reactors in TestReactorBroadcastTxMessage https://app.circleci.com/pipelines/github/tendermint/tendermint/3797/workflows/935cda34-dfb3-46e9-8257-92277171c91b/jobs/114562
2020-05-26 13:16:58 +00:00
Marko
e03b61abd2
proto: add proto files for ibc unblock ( #4853 )
...
## Description
these proto files are meant to help unblock ibc in their quest of migrating the ibc module to proto.
Closes: #XXX
2020-05-25 15:52:34 +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
84b9bde9cd
types: assert specific error in TestValSetUpdateOverflowRelated
...
Closes #4183
2020-05-12 17:56:02 +00: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
Marko
8d63d7192f
abci: regenerate proto files
...
## Description
regenerate proto stubs
I do find max_num to be vague. possibly renaming to max_entries or max_evidence_entries may be more descriptive?
Closes: #XXX
2020-05-11 16:54:54 +00:00
Callum Waters
7cb3d90e01
evidence: create proof of lock change and implement it in evidence store ( #4746 )
...
creates a proof of lock change which is an array of votes that proves the validator was permitted to change locked block and vote again. This proof is stored in the evidence pool and is used as a part of amnesia evidence
2020-05-11 17:06:01 +02: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
d202fab478
types: simplify VerifyCommitTrusting
...
Closes #4783
It looks like we're validating Commit twice. Also, height and blockID params were coming from the commit, so no need to pass them separately.
2020-05-07 09:24:31 +00:00
Anton Kaliaev
8b2ed8933a
consensus: fix TestSimulateValidatorsChange
...
* consensus: fix TestSimulateValidatorsChange
* fix selfIndex calculation
* exit from goroutine after 1 sec
* reuse the function
2020-05-07 09:14:21 +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
Marko
b7c2d7a977
lint: enable nolintlinter, disable on tests
...
## Description
- enable nolintlint
- disable linting on tests
Closes: #XXX
2020-05-04 07:49:53 +00:00
Anton Kaliaev
336b929eaa
types: return an error if voting power overflows
...
in VerifyCommitTrusting
Closes #4755
2020-05-04 07:35:47 +00:00
Marko
a5a84e11f1
evidence: remove pubkey from duplicate vote evidence
...
this pr brings over the removal of pubkey from duplicatevote evidence from proto-breakage
ref #4580
2020-04-28 05:47:20 +00:00
Alexander Bezobchuk
9f29672e23
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-04-24 11:45:38 +04:00
Marko
7a6ca0c1bf
evidence: remove unused param ( #4726 )
...
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com >
2020-04-22 17:18:24 +02:00
Diep Pham
843d63f935
indexer: allow indexing an event at runtime ( #4466 )
...
The PR added a new field `index` to event attribute, that will cause indexer service to index the event if set to true.
2020-04-22 12:07:03 +02:00
Anton Kaliaev
41c11ad2c1
evidence: handling evidence from light client(s) ( #4532 )
...
Closes : #4530
This PR contains logic for both submitting an evidence by the light client (lite2 package) and receiving it on the Tendermint side (/broadcast_evidence RPC and/or EvidenceReactor#Receive). Upon receiving the ConflictingHeadersEvidence (introduced by this PR), the Tendermint validates it, then breaks it down into smaller pieces (DuplicateVoteEvidence, LunaticValidatorEvidence, PhantomValidatorEvidence, PotentialAmnesiaEvidence). Afterwards, each piece of evidence is verified against the state of the full node and added to the pool, from which it's reaped upon block creation.
* rpc/client: do not pass height param if height ptr is nil
* rpc/core: validate incoming evidence!
* only accept ConflictingHeadersEvidence if one
of the headers is committed from this full node's perspective
This simplifies the code. Plus, if there are multiple forks, we'll
likely to receive multiple ConflictingHeadersEvidence anyway.
* swap CommitSig with Vote in LunaticValidatorEvidence
Vote is needed to validate signature
* no need to embed client
http is a provider and should not be used as a client
2020-04-22 11:29:05 +04:00
Anton Kaliaev
0d6e28cb56
docs: mention unbonding period in MaxAgeNumBlocks/MaxAgeDuration
...
Closes #4670
2020-04-21 13:10:15 +00:00
Erik Grinaker
b79602981a
fix linter warnings
2020-04-20 08:55:51 +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
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
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
Marko
fdc2efc083
fix: fix spelling of comment ( #4566 )
...
- :P
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com >
2020-03-13 16:21:09 +00:00
Marko
48f073d796
privval: return error on getpubkey ( #4534 )
...
closes #3602
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com >
2020-03-12 11:10:36 +04:00
Shivani Joshi
78144306dd
JSON tests related changes ( #4461 )
...
* test functions take time.Now and other minor changes
* updated remaining test files
* Update validation_test.go
* fix typo
* go fmt
* import time
Co-authored-by: Marko <marbar3778@yahoo.com >
2020-02-28 09:57:00 +01:00
Alessio Treglia
25d92d05f8
types: VerifyCommitX return when +2/3 sigs are verified ( #4445 )
...
Closes #4417
2020-02-25 10:04:24 +01:00
Erik Grinaker
8f48c49543
Fix some golangci-lint warnings ( #4448 )
2020-02-20 13:43:40 +01:00
Marko
9a9e8c5bb3
proto: minor linting to proto files ( #4386 )
...
* proto: minor linting
minor linting after working with the proto files in the sdk.
there is no logic change just spacing fixes
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com >
* hardcore linting
2020-02-11 15:07:05 +01:00
Erik Grinaker
5ac81eb198
docs: fix incorrect link ( #4377 )
2020-02-07 15:00:19 +01:00
Erik Grinaker
66a544a640
Fix broken /docs/spec links ( #4376 )
2020-02-07 12:53:28 +01:00
Anton Kaliaev
86adc2c89f
lite: follow up from #3989 ( #4209 )
...
* rename adjusted to adjacent
Refs https://github.com/tendermint/tendermint/pull/3989#discussion_r352140829
* rename ErrTooMuchChange to ErrNotEnoughVotingPowerSigned
Refs https://github.com/tendermint/tendermint/pull/3989#discussion_r352142785
* verify commit is properly signed
* remove no longer trusted headers
* restore trustedHeader and trustedNextVals
* check trustedHeader using options
Refs https://github.com/tendermint/tendermint/pull/4209#issuecomment-562462165
* use correct var when checking if headers are adjacent
in bisection func
+ replace TODO with a comment
https://github.com/tendermint/tendermint/pull/3989#discussion_r352125455
* return header in VerifyHeaderAtHeight
because that way we avoid DB call
+ add godoc comments
+ check if there are no headers yet in AutoClient
https://github.com/tendermint/tendermint/pull/3989#pullrequestreview-315454506
* TestVerifyAdjacentHeaders: add 2 more test-cases
+ add TestVerifyReturnsErrorIfTrustLevelIsInvalid
* lite: avoid overflow when parsing key in db store!
* lite: rename AutoClient#Err to Errs
* lite: add a test for AutoClient
* lite: fix keyPattern and call itr.Next in db store
* lite: add two tests for db store
* lite: add TestClientRemovesNoLongerTrustedHeaders
* lite: test Client#Cleanup
* lite: test restoring trustedHeader
https://github.com/tendermint/tendermint/pull/4209#issuecomment-562462165
* lite: comment out unused code in test_helpers
* fix TestVerifyReturnsErrorIfTrustLevelIsInvalid after merge
* change defaultRemoveNoLongerTrustedHeadersPeriod
and add docs
* write more doc
* lite: uncomment testable examples
* use stdlog.Fatal to stop AutoClient tests
* make lll linter happy
* separate errors for 2 cases
- the validator set of a skipped header cannot be trusted, i.e. <1/3rd
of h1 validator set has signed (new error, something like
ErrNewValSetCantBeTrusted)
- the validator set is trusted but < 2/3rds has signed
(ErrNewHeaderCantBeTrusted)
https://github.com/tendermint/tendermint/pull/4209#discussion_r360331253
* remove all headers (even the last one) that are outside
of the trusting period. By doing this, we avoid checking the
trustedHeader's hash in checkTrustedHeaderUsingOptions (case #1 ).
https://github.com/tendermint/tendermint/pull/4209#discussion_r360332460
* explain restoreTrustedHeaderAndNextVals better
https://github.com/tendermint/tendermint/pull/4209#discussion_r360602328
* add ConfirmationFunction option
for optionally prompting for user input Y/n before removing headers
Refs https://github.com/tendermint/tendermint/pull/4209#discussion_r360602945
* make cleaning optional
https://github.com/tendermint/tendermint/pull/4209#discussion_r364838189
* return error when user refused to remove headers
* check for double votes in VerifyCommitTrusting
* leave only ErrNewValSetCantBeTrusted error
to differenciate between h2Vals.VerifyCommit and
h1NextVals.VerifyCommitTrusting
* fix example tests
* remove unnecessary if condition
https://github.com/tendermint/tendermint/pull/4209#discussion_r365171847
It will be handled by the above switch.
* verifyCommitBasic does not depend on vals
Co-authored-by: Marko <marbar3778@yahoo.com >
2020-01-13 11:56:48 +04:00