Commit Graph

7392 Commits

Author SHA1 Message Date
992c54253f fixes from gometalinter review 2017-07-18 11:53:41 +03:00
695ad5fe2d Merge pull request #588 from tendermint/comments_cleanup
Comments and cleanup
2017-07-17 13:32:23 -04:00
d8ca0580a8 rpc: move grpc_test from test/ to grpc/ 2017-07-17 12:58:15 -04:00
525fc0ae5b types: block comments 2017-07-17 12:58:15 -04:00
311f18bebf mempool: comments 2017-07-17 12:58:10 -04:00
d49a5166ac scripts/txs: add 0x and randomness 2017-07-17 12:57:30 -04:00
e560dd839f Merge pull request #587 from ramilexe/feature/sync_status
fast sync status
2017-07-17 11:51:44 -04:00
6f8d385dfa fast sync status 2017-07-17 09:44:23 +03:00
17d6091ef4 updates as per Bucky's comments 2017-07-15 13:33:47 +03:00
e664f9c688 use context to provide timeouts! 2017-07-14 14:49:25 +03:00
0006bfc359 return ErrorOverflow on Subscribe if server is overflowed
> why we need it?

most of our subscribers will be RPC WS subscribers, so if there are too
many, nothing wrong with rejecting to subscribe.

however, consensus reactor must be the first to subscribe, since its
work depends on the pubsub package.
2017-07-14 13:02:32 +03:00
13207a5927 remove overflow options 2017-07-14 12:32:01 +03:00
3c1a1a8bf5 Merge pull request #38 from tendermint/bugfix/non-zero-code-for-404-errors
take into account status codes by leveraging `--fail` curl option
2017-07-13 19:03:35 +04:00
1e033b6051 Removed dependency on rpmmacros 2017-07-12 21:47:36 +00:00
4aa024d843 add more info to error messages 2017-07-12 23:10:36 +03:00
e4f3f9d9bf remove comment about LRU cache (see comments below)
I've tried https://github.com/hashicorp/golang-lru/tree/master/simplelru today and here are
the results:

with LRU cache:

```
Benchmark10Clients-2                               50000             29021 ns/op         3976 B/op         105 allocs/op
Benchmark100Clients-2                               3000            363432 ns/op        36382 B/op        1005 allocs/op
Benchmark1000Clients-2                               500           2473752 ns/op       360500 B/op       10009 allocs/op
Benchmark10ClientsUsingTheSameQuery-2             300000              4059 ns/op          773 B/op          15 allocs/op
Benchmark100ClientsUsingTheSameQuery-2            500000              4360 ns/op          773 B/op          15 allocs/op
Benchmark1000ClientsUsingTheSameQuery-2           300000              4204 ns/op          773 B/op          15 allocs/op
```

without LRU cache:

```
Benchmark10Clients-2                      200000              5267 ns/op             616 B/op       25 allocs/op
Benchmark100Clients-2                      30000             42134 ns/op            2776 B/op      205 allocs/op
Benchmark1000Clients-2                      3000            552648 ns/op           24376 B/op     2005 allocs/op
Benchmark10ClientsOneQuery-2             1000000              2127 ns/op             462 B/op        9 allocs/op
Benchmark100ClientsOneQuery-2             500000              2353 ns/op             462 B/op        9 allocs/op
Benchmark1000ClientsOneQuery-2            500000              2339 ns/op             462 B/op        9 allocs/op
```

> How were you using the lru cache exactly?

I was adding a KV pair each time there is a match plus checking if
`lru.Contains(key)` before running the actual check (`q.Matches(tags)`).

```
key = fmt.Sprintf("%s/%v", query + tags)
```
2017-07-12 22:52:13 +03:00
4a9d237c8e gitignore update 2017-07-12 18:54:10 +00:00
eeab55dc07 Build makefile fix: build rpm and deb can be done in one go 2017-07-12 18:44:25 +00:00
516e872346 Package build refactor: removed dependency on rpmbuild for DEB packages, cleaned up folder structure 2017-07-12 18:05:50 +00:00
8062ade787 remove all clients (including closing all channels) on shutdown 2017-07-12 13:10:36 +03:00
a99b8a6210 new events package
query parser

use parser compiler to generate query parser

I used https://github.com/pointlander/peg which has a nice API and seems
to be the most popular Golang compiler parser using PEG on Github.

More about PEG:

- https://en.wikipedia.org/wiki/Parsing_expression_grammar
- https://github.com/PhilippeSigaud/Pegged/wiki/PEG-Basics
- https://github.com/PhilippeSigaud/Pegged/wiki/Grammar-Examples

rename

implement query match function

match function

uncomment test lines

add more test cases for query#Matches

fix int case

rename events to pubsub

add comment about cache

assertReceive helper to not block on receive in tests

fix bug with multiple conditions

uncomment benchmark

first results:

```
Benchmark10Clients-2                1000           1305493 ns/op         3957519 B/op     355 allocs/op
Benchmark100Clients-2                100          12278304 ns/op        39571751 B/op    3505 allocs/op
Benchmark1000Clients-2                10         124120909 ns/op        395714004 B/op   35005 allocs/op
```

124ms to publish message to 1000 clients. A lot.

use AST from query.peg.go

separate pubsub and query packages by using Query interface in pubsub

wrote docs and refactor code

updates from Frey's review

refactor type assertion to use type switch

cleanup during shutdown

subscriber should create output channel, not the server

overflow strategies, server buffer capacity

context as the first argument for Publish

log error

introduce Option type

update NewServer comment

move helpers into pubsub_test

increase assertReceive timeout

add query.MustParse

add more false tests for parser

add more false tests for query.Matches

parse numbers as int64 / float64

try our best to convert from other types

add number to panic output

add more comments

save commit

introduce client argument as first argument to Subscribe

> Why we do not specify buffer size on the output channel in Subscribe?

The choice of buffer size of N here depends on knowing the number of
messages server will receive and the number of messages downstream
subscribers will consume. This is fragile: if we publish an additional
message, or if one of the downstream subscribers reads any fewer
messages, we will again have blocked goroutines.

save commit

remove reference counting

fix test

test client resubscribe

test UnsubscribeAll

client options

[pubsub/query] fuzzy testing

do not print msg as it creates data race!
2017-07-12 09:48:01 +03:00
f529684277 Build workarounds were fixed for trackomatron and gaia. 2017-07-11 17:48:30 +00:00
aff0fe5c5c take into account status codes by leveraging --fail curl option (Refs #37) 2017-07-11 16:23:33 +03:00
086544e367 p2p: sw.peers.List() is empty in sw.OnStart 2017-07-10 20:43:38 -04:00
eed0297ed5 Merge pull request #538 from zramsay/docs-rework
rework docs
2017-07-10 20:32:03 -04:00
b467515719 Merge pull request #576 from tendermint/release-v0.10.2
Release v0.10.2
v0.10.2
2017-07-10 16:22:09 -04:00
75df0d91ba comments from review 2017-07-10 13:39:23 -04:00
05c0dfac12 First crack it providing fast-sync endpoint 2017-07-10 19:30:54 +02:00
bcde80fc4f changelog 2017-07-09 18:49:22 -04:00
5f6b996d22 breakup some long lines; add more comments to consensus reactor 2017-07-09 18:38:59 -04:00
74a3a2b56a fix comments 2017-07-09 18:01:25 -04:00
b07d01f102 Add more comments on public functions and extra logging during 'enterPrevote'
Signed-off-by: Adrian Brink <adrian@brink-holdings.com>
2017-07-09 20:35:48 +02:00
eed3959749 version bump 2017-07-09 13:17:01 -04:00
278b2344fe move docs/architechture to docs/hidden 2017-07-08 14:25:15 -04:00
05095954c9 use official golang site for installing 2017-07-08 14:09:56 -04:00
6fef4b080e docs: add docs from website 2017-07-08 14:05:24 -04:00
259111d0e8 address adrian's comment 2017-07-08 14:05:24 -04:00
a707748893 add roadmap.md from site 2017-07-08 14:05:24 -04:00
130ae133c1 fix link in changelog 2017-07-08 14:05:24 -04:00
1d387d7452 contributing: use full version from site 2017-07-08 14:05:24 -04:00
d0b990bfdd Moved Tendermint-specific terraform to devops repo 2017-07-08 02:29:25 +00:00
612726d9f6 consensus: better logging 2017-07-07 16:58:16 -04:00
5888ddaab1 consensus: improve logging for conflicting votes 2017-07-07 13:41:50 -04:00
e6cecb9595 p2p: fix test 2017-07-07 13:33:15 -04:00
e36e507463 changelog 2017-07-07 13:30:30 -04:00
3c10f7a122 add p2p flush throttle to config 2017-07-07 13:08:52 -04:00
ca8c34f966 add consensus reactor sleep durations to the config 2017-07-07 12:39:40 -04:00
f46d0444e1 Fix for workaround #2 2017-07-07 14:06:26 +00:00
a607ff5789 Workaround for gaia packaging until issue #2 is resolved 2017-07-07 13:58:46 +00:00
88b4ca3bc3 Gaia packaging added 2017-07-07 12:20:35 +00:00