Commit Graph

54 Commits

Author SHA1 Message Date
Anton Kaliaev 6a85aecfb7
fix linter issues 2018-07-12 22:40:07 +04:00
Anton Kaliaev 17e1df0cbd
test validator set more thoroughly
Refs #693
2018-07-12 22:40:06 +04:00
Ethan Buchman ec710395b7 RIPEMD160 -> SHA256 2018-07-02 14:27:43 -04:00
Ethan Buchman d55243f0e6 fix import paths 2018-07-01 22:36:49 -04:00
Ethan Buchman bf6527fc59
Merge pull request #1382 from EugeneChung/develop
remove Heap.Update() call when setting Proposer field
2018-05-20 19:32:13 -04:00
Ethan Buchman 94c016a04e use MarshalJSONIndent for init files. closes #1506 2018-04-26 21:32:18 -04:00
Ethan Buchman c170800fbd Merge branch 'develop' into jae/aminoify 2018-04-07 16:16:53 +03:00
Anton Kaliaev ed782e7508
include validator's voting power in /status
Refs #581
2018-04-04 11:34:59 +02:00
Anton Kaliaev 0732526465
use more relaxing < and >= ops instead of !=
an example of Search from godocs:

```
package main

import (
	"fmt"
	"sort"
)

func main() {
	a := []int{1, 3, 6, 10, 15, 21, 28, 36, 45, 55}
	x := 6

	i := sort.Search(len(a), func(i int) bool { return a[i] >= x })
	if i < len(a) && a[i] == x {
		fmt.Printf("found %d at index %d in %v\n", x, i, a)
	} else {
		fmt.Printf("%d not found in %v\n", x, a)
	}
}
```
2018-04-04 10:42:35 +02:00
Anton Kaliaev 39a4963782
document funcs in validator_set.go 2018-04-04 10:42:35 +02:00
Anton Kaliaev 37ce6b195a
ValidatorSet#GetByAddress: return -1 if no validator was found 2018-04-04 10:42:34 +02:00
Thomas Corbière 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
Jae Kwon 34974e3932 Make types use Amino; Refactor PrivValidator* to FilePV/SocketPV 2018-03-31 00:18:43 +02:00
Eugene Chung 34f5d439ee
remove Heap.Update() call when setting Proposer field
In for loop of IncrementAccum(), Heap.Update() call is unnecessary when i == times - 1.
2018-03-28 12:58:53 +09:00
Ethan Buchman ff8c648c23 types: uncomment some tests 2018-03-02 09:26:37 -05:00
Ethan Buchman c394eef7b8 types: TestValidatorSetVerifyCommit 2018-03-02 04:21:23 -05:00
Ethan Buchman 200787ede2 types: update for new go-wire. WriteSignBytes -> SignBytes 2018-03-02 01:25:54 -05:00
Ethan Buchman 4e3488c677 update types 2018-02-03 03:23:10 -05:00
Ethan Buchman ee674f919f StopPeerForError in blockchain and consensus 2018-01-21 13:32:04 -05:00
Anton Kaliaev 1339a44402
add safe*Clip funcs 2017-12-26 14:13:12 -06:00
Anton Kaliaev 69c3a7640b
add safeAdd & safeSub plus quickcheck tests 2017-12-25 18:39:14 -06:00
Anton Kaliaev e8b0458f16
check for overflow and underflow while choosing proposer
Refs #919
2017-12-25 18:39:14 -06:00
Anton Kaliaev 10f7858453
use rand.Int63n, remove underflow check, remove unnecessary cast 2017-12-01 19:22:18 -06:00
Anton Kaliaev 922af7c405
int64 height
uint64 is considered dangerous. the details will follow in a blog post.
2017-12-01 19:04:53 -06:00
Anton Kaliaev b3492356e6 uint64 height (Refs #911) 2017-12-01 17:17:22 -05:00
Ethan Buchman 5466720d75 minor changes from @odeke-em PR #725 2017-10-31 15:32:07 -04:00
Ethan Buchman e76ef2a8a1 types: unexpose valset.To/FromBytes 2017-10-26 00:27:02 -04:00
Ethan Frey 94b36bb65e Move VerifyCommitAny into the types package 2017-10-25 16:13:04 +02:00
Ethan Buchman 97e9802255 fix out of range error in VoteSet.addVote 2017-10-02 23:34:06 -04:00
Ethan Buchman d1a00c684e types: comments 2017-09-22 12:00:37 -04:00
Ethan Buchman 944ebccfe9 more PrivValidator interface 2017-09-21 15:51:20 -04:00
Ethan Buchman fd1b0b997a PrivValidator interface 2017-09-21 15:51:20 -04:00
zramsay cf31f8d06f core: apply megacheck vet tool (unused, gosimple, staticcheck) 2017-05-29 23:11:40 -04:00
Ethan Buchman 6d83c60c40 [types] dont hash validator.Accum 2017-05-17 00:16:38 +02:00
Ethan Frey 926fb83e33 Re-added comment 2017-05-14 19:10:58 +02:00
Ethan Frey 157ec8af2d Add json tags to validator set 2017-05-14 19:06:33 +02:00
Ethan Buchman d5b524e309 go-merkle -> merkleeyes/iavl and tmlibs/merkle 2017-04-21 18:16:05 -04:00
Ethan Buchman d1926bcad1 use tmlibs 2017-04-21 18:12:54 -04:00
Ethan Buchman 5da9b3a803 postmerge 2017-04-21 18:09:47 -04:00
Ethan Buchman 0017fb7ffe premerge 2017-04-21 17:38:40 -04:00
Ethan Buchman b1cd677711 types: valSet LastProposer->Proposer and Proposer()->GetProposer() 2017-03-05 23:28:42 -05:00
Ethan Buchman 0fa34f7f67 fix ProposerSelection by persisting proposer 2017-03-05 19:45:24 -05:00
Ethan Buchman de0153a1c4 consensus: some more informative logging 2017-03-05 02:15:46 -05:00
Jae Kwon 67ab574e98 Cleanup, add stub for VerifyCommitAny 2017-01-29 13:50:53 -08:00
Ethan Buchman 4360c360a4 move handshake to state, use Handshaker, more tests 2016-11-16 13:29:22 -05:00
Jae Kwon 1173a85c85 Use BlockID everywhere 2016-11-15 18:34:58 -05:00
Jae Kwon 3c5a2f55c2 Add validator index and address to Vote. 2016-11-15 18:33:16 -05:00
Jae Kwon f17c4c1d57 s/Validation/Commit/g 2016-04-02 09:10:16 -07:00
Jae Kwon 9247b0fbd2 Fix HeightVoteSet bug where first catchup vote doesn't get added 2015-12-31 15:11:51 -08:00
Ethan Buchman 209bcf905e proposer selection tests. closes #53 2015-11-10 13:41:49 -08:00