Commit Graph

6380 Commits

Author SHA1 Message Date
b4a51871b9 common/IsDirEmpty: do not mask non-existance errors
Currently IsDirEmpty returns true, err if it encounters
any error after trying to os.Open the directory.
I noticed this while studying the code and recalled a bug
from an earlier project in which doing the exact same thing
on code without permissions would trip out and falsely report
that the directory was empty.
Given demo.go in https://play.golang.org/p/vhTPU2RiCJ

* Demo:
```shell
$ mkdir -p sample-demo/1 && touch sample-demo/2
$ echo "1st round" && go run demo.go sample-demo
$ sudo chown root sample-demo && sudo chmod 0700 sample-demo
$ echo "2nd round" && go run demo.go sample-demo
```

That then prints out
```shell
1st round
original:: empty: false err: <nil>
updated::  empty: false err: <nil>
2nd round
original:: empty: true err: open data/: permission denied
updated::  empty: false err: open data/: permission denied
```

where in "2nd round", the original code falsely reports that
the directory is empty but that's a permission error.

I could write a code test for it, but that test requires me to change
users and switch to root as a Go user so no point in complicating our
tests, but otherwise it is a 1-to-1 translation between shell and Go.
2017-08-04 02:22:17 -06:00
1abbb11b44 do not exit from reconnectRoutine! 2017-08-03 22:44:18 -04:00
54903adeff add IsReconnecting and IsActive methods 2017-08-03 19:10:15 -04:00
c08618f7e9 expose latency timer on WSClient 2017-08-03 19:10:14 -04:00
d578f7f81e biff up WS client
What's new:
- auto reconnect
- ping/pong
- colored tests
2017-08-03 19:10:14 -04:00
043c6018b4 Merge pull request #591 from tendermint/heartbeat
broadcast proposer heartbeat msg
2017-08-03 14:35:25 -04:00
d0965cca05 forgot heartbeat file 2017-08-03 13:58:17 -04:00
b8ac67e240 some fixes 2017-08-03 13:25:26 -04:00
75372988e7 Merge pull request #33 from orijtech/http-utils
http: http-utils added after extraction
2017-08-02 19:47:10 +02:00
d67a621715 http: http-utils added after extraction
Found common http utils that were being multiply duplicated across
many libraries and since am moving things in basecoin/unstable to
add for more functionality, it's better to put them in one
place.

Utilities and tests added:
- [X] FparseJSON
- [X] FparseAndValidateJSON
- [X] ParseRequestJSON
- [X] ParseAndValidateRequestJSON
- [X] WriteCode
- [X] WriteError
- [X] WriteSuccess
- [X] ErrorResponse

During review from @ethanfrey, made updates:
* Removed tt.want since it was a distraction/artifact that made
the reviewer think the tests weren't testing for both failed
and passed results.
* Added ErrorWithCode as WithCode is a common options pattern
in Go that could cause confusion:
  ErrorWithCode(error, int) ErrorResponse
* Using json.NewDecoder(io.Reader) error instead of
ioutil.ReadAll(io.Reader) to slurp all the bytes.
* Added more test scenarios to achieve 100% coverage of http.go
2017-08-02 11:38:52 -06:00
350d584af8 docs: tons of minor improvements
closes: https://github.com/zramsay/tendermint/issues/3
closes: https://github.com/zramsay/tendermint/issues/5
2017-08-01 15:52:16 -04:00
e3e75376ec fix mintnet-kubernetes link 2017-08-01 14:31:38 -04:00
f87edb756f any_error fix 2017-07-30 08:31:33 +00:00
cfc1b4f426 Fixed AWS targetting when testnet has dash in the name 2017-07-30 07:46:46 +00:00
8dd9f653f4 Create README.md 2017-07-29 22:11:43 -04:00
ab753abfa0 Proposer->Proposal; sign heartbeats 2017-07-29 17:04:28 -04:00
9bbe30d9ff Added Frey's SSH key 2017-07-29 20:23:17 +00:00
fec7af121a Fixes for build 2017-07-29 19:57:25 +00:00
4240e60612 Added Frey's coins for app_options 2017-07-29 19:07:37 +00:00
fa3864c226 [tm-bench] update deps 2017-07-29 14:52:55 -04:00
d205ae1f98 Merge pull request #41 from tendermint/feature/ws-fix
Fix WS connection errors
2017-07-29 14:49:39 -04:00
9181822f65 [tm-monitor] update deps 2017-07-29 14:48:27 -04:00
bab7877fa1 route links to godoc rather than deprecated internal implementation, closes https://github.com/zramsay/tendermint/issues/1 2017-07-29 14:33:49 -04:00
9f65485b62 [tm-monitor] update docker alpine version 2017-07-29 13:50:09 -04:00
7ab861358a [tm-bench] update alpine version 2017-07-29 12:54:28 -04:00
10f8101314 fix race 2017-07-29 11:45:07 -04:00
530626dab7 broadcast proposer heartbeat msg 2017-07-29 11:45:02 -04:00
5f500ec891 Fixed config.toml deployment 2017-07-29 15:41:17 +00:00
b7dbf4a528 ansible fix 2017-07-29 14:46:31 +00:00
f7e1cb79ee Adding error checking 2017-07-29 09:24:37 +00:00
464b404f48 fixes 2017-07-29 09:08:29 +00:00
6598719e7f fixes 2017-07-29 08:04:29 +00:00
d6e81ff27c Debugging genesis gathering 2017-07-29 07:46:47 +00:00
ca9bad2b04 Debugging genesis gathering 2017-07-29 07:35:30 +00:00
86e9e7d7c5 Debugging genesis gathering 2017-07-29 07:33:51 +00:00
e2f9ffb7ff Another fix 2017-07-29 07:01:19 +00:00
feeffc7836 perfnet fixes 2017-07-29 06:15:53 +00:00
006ed44e48 perfnet fixes 2017-07-29 06:13:01 +00:00
150902a566 perfnet fixes 2017-07-29 06:10:04 +00:00
0ea3e33049 validators fix 2017-07-29 05:46:52 +00:00
d6e2d90d56 Updated ansible variables documentation 2017-07-29 05:25:32 +00:00
b96d28a42b test progress in higher round 2017-07-28 23:43:30 -04:00
3444bee47f fixes from review; use mempool.TxsAvailable() directly 2017-07-28 23:42:43 -04:00
cf3abe5096 consensus: remove rs from handleMsg 2017-07-28 23:42:19 -04:00
e67b298cef Workaround for gaia build 2017-07-29 02:56:52 +00:00
ecdda69fab commit empty blocks when needed to prove app hash 2017-07-28 22:12:11 -04:00
fc3fe9292f fixes from review 2017-07-28 22:12:11 -04:00
d396053872 changelog 2017-07-28 22:11:45 -04:00
e9a2389300 cmd: --consensus.no_empty_blocks 2017-07-28 22:11:45 -04:00
678a9a2e42 TxsAvailable tests 2017-07-28 22:11:45 -04:00