Commit Graph

364 Commits

Author SHA1 Message Date
Liamsi c96b27136f remove go-crypto from go-crypto:
use tendermint/crypto :-)
2018-06-20 21:05:38 -07:00
Liamsi d2c05bc5b9 Revert "delete everything" (includes everything non-go-crypto)
This reverts commit 96a3502
2018-06-20 17:35:30 -07:00
Liamsi 96a3502126 delete everything 2018-06-20 15:19:08 -07:00
Anton Kaliaev 489d9b9184
more metrics 2018-06-20 12:38:45 +04:00
Ethan Buchman 43745c83db Merge branch 'release/v0.20.1' into develop 2018-06-20 00:08:51 -07:00
Anton Kaliaev aaddf5d32f
set pubsub default capacity to 0
Refs #951

Jae: I don't know a good way to catch these errors in general, but
forcing pubsub's internal channel to have a capacity of 0 will reveal
bugs sooner, if the subscriber also has a 0 or small capacity ch to pull
from.
2018-06-19 17:07:21 +04:00
Ethan Buchman a519825bf8 consensus: fixes #1754
* updateToState exits early if the state isn't new, which happens after
* fast syncing. This results in not sending a NewRoundStep message. The mempool
* reactor depends on PeerState, which is updated by NewRoundStep
* messages. If the peer never sends a NewRoundStep, the mempool reactor
* will think they're behind, and never forward transactions. Note this
* only happens when `create_empty_blocks = false`, because otherwise
* peers will move through the consensus state and send a NewRoundStep
* for a new step soon anyways. Simple fix is just to send the
* NewRoundStep message during updateToState even if exit early
2018-06-18 17:08:09 -07:00
ia b5775b56c6 all: gofmt (#1743)
* all: gofmt

Run 'gofmt -w .' from project root.

* Update changelog to say that I ran gofmt

* Revert "Update changelog to say that I ran gofmt"

This reverts commit 956f133ff0354fd7338e7df7c823e6f98b655da6.
2018-06-15 02:03:50 +02:00
Ethan Buchman 76c82fd433 add more tests 2018-06-06 20:49:00 -07:00
Ethan Buchman 9481cabd50 fixes from review 2018-06-06 20:45:20 -07:00
Ethan Buchman fcf61b8088 check addrs match pubkeys in abci Validator. version bump 2018-06-06 16:35:35 -07:00
Ethan Buchman 8e45348737 update for abci v0.11.0 release. let InitChain update validators 2018-06-06 15:47:04 -07:00
Ethan Buchman 2edc68c59b use all fields in abci types 2018-06-06 13:07:17 -07:00
Ethan Buchman 2897685c57 abci header takes ValidatorsHash 2018-06-06 00:28:12 -07:00
Ethan Buchman 54e61468d4 fixes from review 2018-06-05 22:04:38 -07:00
Ethan Buchman 5c7ccbd4a7 use const for abci type strings 2018-06-05 22:04:38 -07:00
Ethan Buchman aa8be33da1 fix fmt 2018-06-05 22:04:27 -07:00
Ethan Buchman 3d2c4fd309 update Evidence type - requires pubkey and valset to verify and convert to abci.Evidence 2018-06-05 22:04:26 -07:00
Ethan Buchman e1e6878a4d fix state tests 2018-06-05 22:00:25 -07:00
Ethan Buchman e4147b6f1a state test runs 2018-06-05 22:00:25 -07:00
Ethan Buchman 7606b7595f compiles 2018-06-05 22:00:25 -07:00
Ethan Buchman 485b4a0c6f revert gogo 2018-06-05 21:59:52 -07:00
Ethan Buchman ebd2fe7a68 more types 2018-06-05 21:59:52 -07:00
Ethan Buchman f28eae7816 update types 2018-06-05 21:59:52 -07:00
Ethan Buchman 3d33226e80 move types/services.go to state pkg. pass State to evpool.Update 2018-06-04 21:20:23 -07:00
Alexander Simmerl bf370d36c2
Extract priv_validator into first class package
This is a maintenance change to move the private validator package out
of the types and to a top-level location. There is no good reason to
keep it under the types and it will more clearly coommunicate where
additions related to the privval belong. It leaves the interface and the
mock in types for now as it would introduce circular dependency between
privval and types, this should be resolved eventually.

* mv priv_validator to privval pkg
* use consistent `privval` as import

Follow-up to #1255
2018-06-03 13:51:58 +02:00
Anton Kaliaev 6004587347
expect all tags to be strings (#1498)
* expect all tags to be strings

Refs #1369

* port changes from https://github.com/tendermint/tmlibs/pull/204

Refs #1369
2018-05-28 14:37:11 +04:00
Anton Kaliaev bb9aa85d22
copy events and pubsub packages from tmlibs
Refs #847
2018-05-21 10:51:47 +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 e5220360c5 AddPart always verifies 2018-05-17 13:17:50 -04:00
Ethan Buchman 162811476a update some comments 2018-05-14 16:32:19 -04:00
Zarko Milosevic 2c125b6c78 Fix validValue rule 2018-05-14 16:17:21 -04:00
Ethan Buchman e9804d76cf fixes from review 2018-05-14 10:33:31 -04:00
Ethan Buchman 658060150c rpc: add voting power totals to vote bitarrays 2018-05-13 19:22:23 -04:00
Ethan Buchman c45ba2967a fixes from review 2018-04-27 10:29:05 -04:00
Ethan Buchman a2d77cbe4e add MarshalJSON methods to fix dump_consensus_state 2018-04-26 23:43:48 -04:00
Ethan Buchman 94c016a04e use MarshalJSONIndent for init files. closes #1506 2018-04-26 21:32:18 -04:00
Jae Kwon b42d5a2211 blockID -> block_id for JSON 2018-04-21 20:24:50 -07:00
Thomas Corbière 6a48bd0c88 use the tag interface for pubsub. (#1438)
* use the tag interface for pubsub.

* update tmlibs.

* Fix unresolved conflict.
2018-04-10 16:03:03 +02:00
Ethan Buchman 1a1e4e767b check max msg size in DecodeMessage 2018-04-09 15:18:47 +03:00
Ethan Buchman bb1b249e8a types: lock block on MakePartSet 2018-04-09 15:04:59 +03:00
Ethan Buchman c68d406195 fix tests 2018-04-07 19:47:19 +03:00
Ethan Buchman 02c0835e9b fixes post merge 2018-04-07 16:25:10 +03:00
Ethan Buchman c170800fbd Merge branch 'develop' into jae/aminoify 2018-04-07 16:16:53 +03:00
Jae Kwon 02531ca5a3 Fix race testing (cont;) Bump version to 0.19.0 2018-04-06 17:06:46 -07:00
Jae Kwon d24e4cb821 Fix race testing 2018-04-06 17:02:29 -07:00
Jae Kwon 32e1d195a0 Fix cmd and lite 2018-04-05 22:05:30 -07:00
Jae Kwon 3ca5292dc9 Fix rpc tests 2018-04-05 21:19:14 -07:00
Jae Kwon e4492afbad Merge 2018-04-05 08:17:10 -07:00
Jae Kwon 45ec5fd170 WIP consensus 2018-04-05 07:05:45 -07:00
Jae Kwon 5d1c758730 Fix evidence 2018-04-05 05:43:23 -07:00
Jae Kwon 1b9323f105 Fix blockchain tests 2018-04-05 05:17:43 -07: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
Ethan Buchman d14aacf03e
Merge pull request #1300 from tendermint/lite-proxy-hardening-and-tests
lite/proxy: Validation* tests and hardening for nil dereferences
2018-04-03 22:43:38 +03:00
Ethan Buchman 39ff4d22e9 minor cleanup 2018-04-03 22:34:18 +03:00
Jae Kwon 196f8410ba WIP commit; Fix types/results_test 2018-04-03 07:03:08 -07:00
Anton Kaliaev 8462493cbf [rpc] fix subscribing using an abci.ResponseDeliverTx tag
Refs #1369
2018-04-03 15:53:13 +02:00
Anton Kaliaev 47b8bd1728 wrote a test for EventBus#PublishEventTx
Refs #1369
2018-04-03 15:53:13 +02:00
Jae Kwon 89cdde7f1e Fix state tests 2018-04-03 06:50:53 -07: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
Alex Hernandez 575a46d9d4 fix typo on block header (#1387) 2018-03-29 11:28:29 +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 9bf5862def types: fix genesis.AppStateJSON 2018-03-27 11:20:09 -04:00
Anton Kaliaev 4e86835163
update changelog for 0.17.0 release 2018-03-27 09:06:32 +02:00
Anton Kaliaev 1c82281b77
make app_options -> app_state backwards compatible 2018-03-26 21:51:07 +02:00
Ethan Buchman 8c0c8e8e01
Merge pull request #1301 from tendermint/types-data+header+non-nil-panics
types: Hash invoked for nil Data and Header should not panic
2018-03-20 23:38:55 +01:00
Eugene Chung a61130aebb
Remove unnecessary bytes.Compare() call 2018-03-20 23:43:18 +09:00
Constantine 152290db7e Add `\health` rpc endpoint (#1306)
* Init `\health` rpc endpoint

* remove additional info from `\health` rpc endpoint

* Cleanup imports

* Added time threshold for health check

* Update rpc doc

* Remove unnecessary checks for blocktime creation lag

* Clean up of unnecessary config usage
2018-03-19 19:39:37 +03:00
Ethan Buchman ff1ec0260e
Merge pull request #1318 from tendermint/bucky/testnet-cmd-fix
testnet cmd: ensure config dir exists. closes #1290
2018-03-17 00:05:30 +01:00
Emmanuel T Odeke 7cb3188fbc testnet cmd: ensure config dir exists. closes #1290 2018-03-16 14:26:43 +01:00
Alexander Simmerl 9b9022f8df privVal: Improve SocketClient network code (#1315)
Follow-up to feedback from #1286, this change simplifies the connection
handling in the SocketClient and makes the communication via TCP more
robust. It introduces the tcpTimeoutListener to encapsulate accept and
i/o timeout handling as well as connection keep-alive, this type could
likely be upgraded to handle more fine-grained tuning of the tcp stack
(linger, nodelay, etc.) according to the properties we desire. The same
methods should be applied to the RemoteSigner which will be overhauled
when the priv_val_server is fleshed out.

* require private key
* simplify connect logic
* break out conn upgrades to tcpTimeoutListener
* extend test coverage and simplify component setup
2018-03-16 16:32:17 +04:00
Anton Kaliaev b0d8f552c5
return err if peer has sent a vote that does not match our round 2018-03-15 11:58:20 +04:00
Emmanuel T Odeke 8723c91db9
types: Hash invoked for nil Data and Header should not panic
Fixes https://github.com/tendermint/tendermint/issues/1298
Fixes https://github.com/tendermint/tendermint/issues/1299

Found while writing tests in https://github.com/tendermint/tendermint/pull/1300
2018-03-10 21:44:08 -08:00
Alexander Simmerl 589781721a
Invert privVal socket communication
Follow-up to #1255 aligning with the expectation that the external
signing process connects to the node. The SocketClient will block on
start until one connection has been established, support for multiple
signers connected simultaneously is a planned future extension.

* SocketClient accepts connection
* PrivValSocketServer renamed to RemoteSigner
* extend tests
2018-03-07 12:37:05 +01:00
Alexander Simmerl 2aa77025c3
Fix typo 2018-03-06 19:56:31 +01:00
Alexander Simmerl 8e1856a90a
Use builtin panic 2018-03-06 19:56:31 +01:00
Alexander Simmerl ca619c80b6
Stop privVal socket client on node shutdown 2018-03-06 19:56:30 +01:00
Alexander Simmerl 25ff699425
Improve method docs 2018-03-06 19:55:26 +01:00
Alexander Simmerl 879b4c0a2c
Use common method to determine file existence 2018-03-06 19:55:26 +01:00
Alexander Simmerl b7ce89e568
Speed up CircleCI builds
To achieve faster feedback cycles for our feature PRs this change
reduces the average buildtime from 35 to ~6min by utilising their new
2.0 offering based on docker and nomad. We make use of parallel build
steps wherever possible so that the duration is determined by the
slowest test suite (p2p).

This is an intermediate step until we move our CI/CD completely
on-premise for more control and added security.
2018-03-06 17:36:44 +01:00
Ethan Buchman d4e4055d57
PrivValidatorAddr -> PrivValidatorListenAddr. Update ADR008 2018-03-05 17:11:43 +01: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 f9921ae362 types/validator_set_test: move funcs around 2018-03-02 03:52:44 -05:00
Ethan Buchman 6596bff8ec types: bring back json.Marshal/Unmarshal for genesis/priv_val 2018-03-02 02:09:28 -05:00
Ethan Buchman 5378bfc5c7 types.SignBytes -> o.SignBytes 2018-03-02 01:50:17 -05:00
Ethan Buchman abeeeeb611 types: fix validator_set_test issue with UnmarshalBinary into ptr 2018-03-02 01:49:59 -05:00
Ethan Buchman ca3655a409 types: p2pID -> P2PID 2018-03-02 01:42:56 -05:00
Ethan Buchman 6cf5100645 types: working on tests... 2018-03-02 01:34:23 -05:00
Ethan Buchman 51628aea08 types: revert to old wire. builds 2018-03-02 01:33:38 -05:00
Ethan Buchman 3395f5fb0e types: builds 2018-03-02 01:28:38 -05:00
Ethan Buchman d2cd079541 types: tests build 2018-03-02 01:28:21 -05:00
Ethan Buchman fd58645dd2 types: remove dep on p2p 2018-03-02 01:26:03 -05:00
Ethan Buchman 200787ede2 types: update for new go-wire. WriteSignBytes -> SignBytes 2018-03-02 01:25:54 -05:00
Anton Kaliaev 4ce79baac7
rename app_options to app_state in genesis_test 2018-02-28 23:44:10 +04:00
rigelrozanski 4806b3b9bf
AppOptions -> AppStateJSON 2018-02-28 23:44:10 +04:00