Commit Graph

55 Commits

Author SHA1 Message Date
70592cc4d8 libs/common: remove deprecated PanicXXX functions (#3595)
* Remove deprecated PanicXXX functions from codebase

As per discussion over
[here](https://github.com/tendermint/tendermint/pull/3456#discussion_r278423492),
we need to remove these `PanicXXX` functions and eliminate our
dependence on them. In this PR, each and every `PanicXXX` function call
is replaced with a simple `panic` call.

* add a changelog entry
2019-04-26 14:23:43 +04:00
d470945503 update gometalinter to 3.0.0 (#3233)
in the attempt to fix https://circleci.com/gh/tendermint/tendermint/43165

also

    code is simplified by running gofmt -s .
    remove unused vars
    enable linters we're currently passing
    remove deprecated linters
2019-01-30 12:24:26 +04:00
ec53ce359b Simple merkle rfc compatibility (#2713)
* Begin simple merkle compatibility PR

* Fix query_test

* Use trillian test vectors

* Change the split point per RFC 6962

* update spec

* refactor innerhash to match spec

* Update changelog

* Address @liamsi's comments

* Write the comment requested by @liamsi
2019-01-13 18:02:38 -05:00
1f68318875 fix order of BlockID and Timestamp in Vote and Proposal (#3078)
* Consistent order fields of Timestamp/BlockID fields in CanonicalVote and
CanonicalProposal

* update spec too

* Introduce and use IsZero & IsComplete:
 - update IsZero method according to spec and introduce IsComplete
 - use methods in validate basic to validate: proposals come with a
 "complete" blockId and votes are either complete or empty
 - update spec: BlockID.IsNil() -> BlockID.IsZero() and fix typo

* BlockID comes first

* fix tests
2019-01-13 17:56:36 -05:00
fe3b97fd66 It's better read from genDoc than from state.validators when appHeight==0 in replay (#2893)
* optimize addProposalBlockPart

* optimize addProposalBlockPart

* if ProposalBlockParts and LockedBlockParts both exist,let LockedBlockParts overwrite ProposalBlockParts.

* fix tryAddBlock

* broadcast lockedBlockParts in higher priority

* when appHeight==0, it's better fetch genDoc than state.validators.
2018-11-26 08:03:08 -05:00
fb91ef7462 validate reactor messages (#2711)
* validate reactor messages

Refs #2683

* validate blockchain messages

Refs #2683

* validate evidence messages

Refs #2683

* todo

* check ProposalPOL and signature sizes

* add a changelog entry

* check addr is valid when we add it to the addrbook

* validate incoming netAddr (not just nil check!)

* fixes after Bucky's review

* check timestamps

* beef up block#ValidateBasic

* move some checks into bcBlockResponseMessage

* update Gopkg.lock

Fix

```
grouped write of manifest, lock and vendor: failed to export github.com/tendermint/go-amino: fatal: failed to unpack tree object 6dcc6ddc143e116455c94b25c1004c99e0d0ca12
```

by running `dep ensure -update`

* bump year since now we check it

* generate test/p2p/data on the fly using tendermint testnet

* allow sync chains older than 1 year

* use full path when creating a testnet

* move testnet gen to test/docker/Dockerfile

* relax LastCommitRound check

Refs #2737

* fix conflicts after merge

* add small comment

* some ValidateBasic updates

* fixes

* AppHash length is not fixed
2018-11-01 02:07:18 -04:00
12fa9d1cab crypto/merkle: Remove byter in favor of plain byte slices (#2595)
* crypto/merkle: Remove byter in favor of plain byte slices

This PR is fully backwards compatible in terms of function output!
(The Go API differs though) The only test case changes was to refactor
it to be table driven.

* Update godocs per review comments
2018-10-10 12:46:09 -04:00
71a34adfe5 General Merkle Proof (#2298)
* first commit

finalize rebase

add protoc_merkle to Makefile

* in progress

* fix kvstore

* fix tests

* remove iavl dependency

* fix tx_test

* fix test_abci_cli

fix test_apps

* fix test_apps

* fix test_cover

* rm rebase residue

* address comment in progress

* finalize rebase
2018-09-28 20:03:19 -04:00
ec710395b7 RIPEMD160 -> SHA256 2018-07-02 14:27:43 -04:00
d55243f0e6 fix import paths 2018-07-01 22:36:49 -04:00
e5220360c5 AddPart always verifies 2018-05-17 13:17:50 -04:00
c45ba2967a fixes from review 2018-04-27 10:29:05 -04:00
a2d77cbe4e add MarshalJSON methods to fix dump_consensus_state 2018-04-26 23:43:48 -04:00
2644a529f0 Fix lint errors (#1390)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix package comment with leading space.

* fix receiver names.

* fix error strings.

* remove omittable code.

* remove redundant return statement.

* Revert changes (code is generated.)

* use cfg as receiver name for all config-related types.

* use lsi as the receiver name for the LastSignedInfo type.
2018-04-02 10:21:17 +02:00
200787ede2 types: update for new go-wire. WriteSignBytes -> SignBytes 2018-03-02 01:25:54 -05:00
7a5060dc52 replace data.Bytes with cmn.HexBytes 2018-02-03 03:47:01 -05:00
4e3488c677 update types 2018-02-03 03:23:10 -05:00
9529f12c28 more linting 2017-11-27 22:39:12 +00:00
478a10aa41 Write doesn't need error checked 2017-11-27 22:39:12 +00:00
d7cb291fb2 errcheck; sort some stuff out 2017-11-27 22:39:11 +00:00
68e7983c70 linting errors: afew more 2017-11-27 22:39:11 +00:00
8f0237610e linting errors: clean it all up 2017-11-27 22:39:11 +00:00
b75d4f73e7 errcheck: PR comment fixes 2017-11-27 22:39:11 +00:00
57ea4987f7 linting: apply errcheck part1 2017-11-27 22:39:11 +00:00
bdb34f9f4e types: []byte -> data.Bytes 2017-04-27 19:01:18 -04:00
d5b524e309 go-merkle -> merkleeyes/iavl and tmlibs/merkle 2017-04-21 18:16:05 -04:00
d1926bcad1 use tmlibs 2017-04-21 18:12:54 -04:00
5da9b3a803 postmerge 2017-04-21 18:09:47 -04:00
0017fb7ffe premerge 2017-04-21 17:38:40 -04:00
8ba79252c8 types: use mtx on PartSet.String() 2017-03-02 23:50:59 -05:00
1b3766d802 types: canonical_json.go 2016-12-17 21:21:27 -05:00
da8b043612 sign bytes w struct literals 2016-12-17 21:21:27 -05:00
d83fc02597 MakePartSet takes partSize from config. fix replay test 2016-11-16 01:23:16 -05:00
1173a85c85 Use BlockID everywhere 2016-11-15 18:34:58 -05:00
501c4e4bac fixes from review 2016-04-26 22:17:13 -04:00
922f720cf6 cswal_light logs own votes; fix tests 2016-04-19 20:45:33 -04:00
a34f9e082e lazy part_set reader 2016-04-19 20:45:33 -04:00
79c9a9f03a don't verify own block parts 2016-04-19 20:45:33 -04:00
5e42c96267 crank the part size; prioritize data channel 2016-04-19 20:45:33 -04:00
0316dfc6f2 Update code.google.com to use golang.org 2015-12-17 13:27:30 -08:00
34f6f50a07 Conform to go-merkle SimpleProof.Aunts 2015-12-10 11:09:25 -08:00
ab1e8a35c6 Shorten consensus log events 2015-12-09 17:09:06 -08:00
d69b5c5ab6 Conform to go-wire 1.0 2015-11-10 13:10:43 -08:00
c4ed55d801 Refactor to move common libraries out of project 2015-10-22 17:39:06 -07:00
3be3647dc8 tendermint/binary -> tendermint/wire 2015-07-28 12:18:17 -07:00
8e50bf15de panic wrapper functions 2015-07-21 10:46:05 -04:00
2e1d8ba054 Make Ripemd160 the default 2015-07-10 12:15:46 -07:00
9965dd5de6 uint* to int* whereever appropriate; https://www.reddit.com/r/golang/comments/2q5vdu/int_vs_uint/ 2015-06-25 20:28:34 -07:00
1a652a1cbb Fix usage of SimpleProof for PartSet 2015-06-18 22:08:22 -07:00
da73e001ad BitArray takes a pointer receiver. More logging 2015-05-05 23:01:19 -07:00