Commit Graph

4341 Commits

Author SHA1 Message Date
Liamsi d2c05bc5b9 Revert "delete everything" (includes everything non-go-crypto)
This reverts commit 96a3502
2018-06-20 17:35:30 -07:00
Liamsi 587505d4d2 fix crypto tests 2018-06-20 17:34:28 -07:00
Liamsi eedd20f4d5 Revert "delete everything"
This reverts commit 96a3502126.

# Conflicts:
#	CHANGELOG.md
#	Gopkg.lock
#	Gopkg.toml
#	LICENSE
#	Makefile
#	README.md
2018-06-20 15:37:45 -07:00
Liamsi 368c236c75 mv go-crypto files to crypto dir 2018-06-20 15:30:44 -07:00
Liamsi 96a3502126 delete everything 2018-06-20 15:19:08 -07:00
Christopher Goes edb36d38b2
Merge PR #142: Delete keys package & Ledger integration; update tests 2018-06-20 23:33:33 +02:00
Christopher Goes c7a842a4e2 Update Gopkg.lock 2018-06-20 23:31:57 +02:00
Liamsi 7ebc7c08e7 delete keys package
- also delete ledger code and deps (thx cwgoes)

Signed-off-by: Liamsi <Liamsi@users.noreply.github.com>
2018-06-20 14:30:57 -07:00
Liamsi a589e0eabd delete keys package
- it will be moved to cosmos-sdk
2018-06-20 14:09:24 -07:00
Ismail Khoffi 4634063698
keys package: fundraiser compatibility and HD keys (BIP 39 & BIP 32 / BIP 44) (#118)
- fundraiser compatibility for HD keys (BIP 39 & BIP 32 / BIP 44)
2018-06-20 13:30:22 -07:00
Alexander Simmerl 37385cb1d4
Merge pull request #1737 from tendermint/986-monitoring
metrics
2018-06-20 20:43:20 +02:00
Anton Kaliaev 8c1ca9d64a
updates to docs/specification/configuration.md after rebase 2018-06-20 12:42:43 +04:00
Anton Kaliaev 205d8b8062
fixes after @xla review
- move prometheus metrics into internal packages
- *Option structs
- misc. format changes
2018-06-20 12:40:25 +04:00
Anton Kaliaev e4bb3566a0
move metrics constructors to a separate package 2018-06-20 12:40:25 +04:00
Anton Kaliaev 829342a82d
make StartPrometheusServer func private
we don't really need to export it
2018-06-20 12:40:25 +04:00
Anton Kaliaev 84812145cb
friendly apis for constructors 2018-06-20 12:40:25 +04:00
Anton Kaliaev cd11a54f7a
add since column to list of available metrics table 2018-06-20 12:40:25 +04:00
Anton Kaliaev d8fea3ec9d
separate http server for metrics 2018-06-20 12:40:23 +04:00
Anton Kaliaev b10b0da3fd
bundle imports 2018-06-20 12:40:11 +04:00
Anton Kaliaev bba2862498
add one useful query 2018-06-20 12:40:11 +04:00
Anton Kaliaev e90cb4f5fa
add docs 2018-06-20 12:40:11 +04:00
Anton Kaliaev 1bdff076ad
add config option 2018-06-20 12:40:08 +04:00
Anton Kaliaev c958b5319c
update ADR 2018-06-20 12:38:45 +04:00
Anton Kaliaev 7efb73aa18
mempool size metric 2018-06-20 12:38:45 +04:00
Anton Kaliaev 19699d644f
p2p metric, make height and totalTxs gauges 2018-06-20 12:38:45 +04:00
Anton Kaliaev 0cb50c05fc
add rounds metric 2018-06-20 12:38:45 +04:00
Anton Kaliaev e58d674f4c
add validators power gauges 2018-06-20 12:38:45 +04:00
Anton Kaliaev fad76e103b
extract metrics to provider, remove height label 2018-06-20 12:38:45 +04:00
Anton Kaliaev 489d9b9184
more metrics 2018-06-20 12:38:45 +04:00
Anton Kaliaev 3cdf3b670d
serve metrics under /metrics 2018-06-20 12:38:45 +04:00
Anton Kaliaev 5c869b5888
validator metrics 2018-06-20 12:38:45 +04:00
Anton Kaliaev 9e14dc21a9
add labels column 2018-06-20 12:38:45 +04:00
Anton Kaliaev 5c7093cc9f
go-kit metrics plus prometheus: one metric 2018-06-20 12:38:45 +04:00
Anton Kaliaev 03079185d4
metrics ADR
Refs #986
2018-06-20 12:38:45 +04:00
Zach 63e2f43b72 updates to docs for vuepress (#1763)
* fix docs for vue, #1640

* docs: clean up re-install instructions
2018-06-20 11:51:16 +04:00
Ethan Buchman c793a72ac5
Merge pull request #1769 from tendermint/1755-possible-memory-leak
Memory leak in Websocket
2018-06-19 23:57:29 -07:00
Dev Ojha fed8807a32 Switch xchachapoly to hkdfchachapoly (#135)
* Switch from xchachapoly to hkdfchachapoly
2018-06-19 22:18:36 -07:00
Anton Kaliaev cfff83fa3d
update changelog 2018-06-19 20:20:30 +04:00
Anton Kaliaev 4fc06e9d2a
[libs/pubsub] fix memory leak
Refs #1755

I started with writing a test for wsConnection (WebsocketManager) where
I:

- create a WS connection
- do a simple echo call
- close it

No leaking goroutines, nor any leaking memory were detected.

For useful shortcuts see my blog post
https://blog.cosmos.network/debugging-the-memory-leak-in-tendermint-210186711420

Then I went to the rpc tests to see if calling Subscribe results in
memory growth. It did.

I used a slightly modified version of TestHeaderEvents function:

```
func TestHeaderEvents(t *testing.T) {
	// memory heap before
	f, err := os.Create("/tmp/mem1.mprof")
	if err != nil {
		t.Fatal(err)
	}
	pprof.WriteHeapProfile(f)
	f.Close()

	for i := 0; i < 100; i++ {
		c := getHTTPClient()
		err = c.Start()
		require.Nil(t, err)

		evtTyp := types.EventNewBlockHeader
		evt, err := client.WaitForOneEvent(c, evtTyp, waitForEventTimeout)
		require.Nil(t, err)
		_, ok := evt.(types.EventDataNewBlockHeader)
		require.True(t, ok)

		c.Stop()
		c = nil
	}

	runtime.GC()

	// memory heap before
	f, err = os.Create("/tmp/mem2.mprof")
	if err != nil {
		t.Fatal(err)
	}
	pprof.WriteHeapProfile(f)
	f.Close()

	// dump all running goroutines
	time.Sleep(10 * time.Second)
	pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
}
```

```
Showing nodes accounting for 35159.16kB, 100% of 35159.16kB total
Showing top 10 nodes out of 48
      flat  flat%   sum%        cum   cum%
32022.23kB 91.08% 91.08% 32022.23kB 91.08%  github.com/tendermint/tendermint/libs/pubsub/query.(*QueryParser).Init
 1056.33kB  3.00% 94.08%  1056.33kB  3.00%  bufio.NewReaderSize
  528.17kB  1.50% 95.58%   528.17kB  1.50%  bufio.NewWriterSize
  528.17kB  1.50% 97.09%   528.17kB  1.50%  github.com/tendermint/tendermint/consensus.NewConsensusState
  512.19kB  1.46% 98.54%   512.19kB  1.46%  runtime.malg
  512.08kB  1.46%   100%   512.08kB  1.46%  syscall.ByteSliceFromString
         0     0%   100%   512.08kB  1.46%  github.com/tendermint/tendermint/consensus.(*ConsensusState).(github.com/tendermint/tendermint/consensus.defaultDecideProposal)-fm
         0     0%   100%   512.08kB  1.46%  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote
         0     0%   100%   512.08kB  1.46%  github.com/tendermint/tendermint/consensus.(*ConsensusState).defaultDecideProposal
         0     0%   100%   512.08kB  1.46%  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterNewRound
```

100 subscriptions produce 32MB.

Again, no additional goroutines are running after the end of the test
(wsConnection readRoutine and writeRoutine both finishes). **It means
that some exiting goroutine or object is holding a reference to the
*Query objects, which are leaking.**

One of them is pubsub#loop. It's using state.queries to map queries to
clients and state.clients to map clients to queries.

Before this commit, we're not thoroughly cleaning state.queries, which
was the reason for memory leakage.
2018-06-19 19:59:21 +04: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
Anton Kaliaev 26b2e808f7
[rpc/lib/server] wrote a basic test for WebsocketManager 2018-06-19 17:06:48 +04:00
Ethan Buchman d457887dd6
Merge pull request #1759 from tendermint/bucky/readme
update README
2018-06-16 22:56:35 -07:00
Ethan Buchman adb6a94f18 contact us at riot 2018-06-16 23:05:24 -07:00
Ethan Buchman b8bfc041d3 update README 2018-06-16 19:00:42 -07:00
Ethan Buchman 9bad770f21
Merge pull request #1757 from tendermint/bucky/update-spec
docs/spec: some organizational cleanup
2018-06-16 13:03:00 -07:00
Ethan Buchman d3b53e62a5 fix circle 2018-06-15 23:46:43 -07:00
Ethan Buchman 506cf6c9c7 docs/spec: DuplicateVoteEvidence 2018-06-15 23:19:42 -07:00
Ethan Buchman b8f340afd0 docs/spec: some organizational cleanup 2018-06-15 22:56:26 -07:00
Ismail Khoffi 1a2f468695
fix circleci 2.0 config (#139) 2018-06-15 15:17:40 -07:00
Ethan Buchman c84be3b8dd
Merge pull request #1751 from tendermint/bucky/codeowner-alex
add xla as codeowner
2018-06-14 20:22:04 -07:00