Compare commits

...

5714 Commits

Author SHA1 Message Date
4ac6c1defc cleaner test 2019-08-15 12:53:59 -07:00
d8aaaf63fb fix typos 2019-08-15 12:49:44 -07:00
7c11fc4116 complete reverting state and blockstore 2019-08-15 12:43:34 -07:00
22e2484878 start revert logic 2019-08-13 16:58:06 -07:00
7fe02a04db store: register block amino, not just crypto (#3894)
* store: register block amino, not just crypto

Fixes #3893

* update changelog
2019-08-13 12:32:40 +04:00
2e39418124 docs: "Writing a Tendermint Core application in Java (gRPC)" guide (#3887)
* add abci grpc java guide

* fix grammar and spelling
2019-08-12 14:39:11 +04:00
c962567814 ValidateBasic tests (#3879)
* Add test for bcBlockRequestMessage ValidateBasic method

* Add test for bcNoBlockResponseMessage ValidateBasic method

* Add test for bcStatusRequestMessage ValidateBasic method

* Add test for bcStatusResponseMessage ValidateBasic method

* Add blockchain v1 reactor ValidateBasic tests

* Add test for NewRoundStepMessage ValidateBasic method

* Add test for NewValidBlockMessage ValidateBasic method

* Test BlockParts Size

* Import cmn package

* Add test for ProposalPOLMessage ValidateBasic method

* Add test for BlockPartMessage ValidateBasic method

* Add test for HasVoteMessage ValidateBasic method

* Add test for VoteSetMaj23Message ValidateBasic method

* Add test for VoteSetBitsMessage ValidateBasic method

* Fix linter errors

* Improve readability

* Add test for BaseConfig ValidateBasic method

* Add test for RPCConfig ValidateBasic method

* Add test for P2PConfig ValidateBasic method

* Add test for MempoolConfig ValidateBasic method

* Add test for FastSyncConfig ValidateBasic method

* Add test for ConsensusConfig ValidateBasic method

* Add test for InstrumentationConfig ValidateBasic method

* Add test for BlockID ValidateBasic method

* Add test for SignedHeader ValidateBasic method

* Add test for MockGoodEvidence and MockBadEvidence ValidateBasic methods

* Remove debug logging

Co-Authored-By: Marko <marbar3778@yahoo.com>

* Update MempoolConfig field

* Test a single struct field at a time, for maintainability

Fixes #2740
2019-08-11 22:27:03 +04:00
8a282a5fee replace errors.go with github.com/pkg/errors (2/2) (#3890)
* init of (2/2) common errors

* Remove instances of cmn.Error (2/2)

- Replace usage of cmnError and errorWrap
- ref #3862

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* comment wording

* simplify IsErrXXX functions

* log panic along with stopping the MConnection
2019-08-11 21:03:40 +04:00
8dc39b69b7 replace errors.go with github.com/pkg/errors (1/2) (#3888)
* (1/2) of replace errors.go with github.com/pkg/errors

ref #3862

- step one in removing instances of errors.go in favor of github.com/pkg/errors

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* gofmt

* add in /store
2019-08-08 14:31:13 +04:00
d70135ec71 [ADR - 42] State-sync (#3769)
* init adr 042: state sync

* link to blockchain reactor

* brapse proposal

* formatting

* response to feedback

* Update docs/architecture/adr-042-state-sync.md

Co-Authored-By: Aditya <adityasripal@gmail.com>

* Update security models and more

* clarify compression

* typo

* Update docs/architecture/adr-042-state-sync.md

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
2019-08-06 10:25:24 +02:00
e179787d40 mempool: make max_tx_bytes configurable instead of max_msg_bytes (#3877)
Fix #3868 (comment)

Commits:

* mempool: make `max_tx_bytes` configurable instead of `max_msg_bytes`

* update CHANGELOG_PENDING

* apply suggestions from code review
2019-08-05 20:01:30 +04:00
0cf8812b17 [blockchain] v2 riri Schedule composit data structure (#3848)
* Add Schedule:

    + The schedule is a data structure used to determine the optimal
      schedule of requests to the optimal set of peers in order to perform
      fast-sync as fast and efficiently as possible.

* Add some doc strings

* fix golangci

* Add Schedule:

    + The schedule is a data structure used to determine the optimal
      schedule of requests to the optimal set of peers in order to perform
      fast-sync as fast and efficiently as possible.

* Add some doc strings

* remove globals from tests
2019-08-05 17:26:46 +02:00
f7f034a8be privval: refactor Remote signers (#3370)
This PR is related to #3107 and a continuation of #3351

It is important to emphasise that in the privval original design, client/server and listening/dialing roles are inverted and do not follow a conventional interaction.

Given two hosts A and B:

    Host A is listener/client
    Host B is dialer/server (contains the secret key)
    When A requires a signature, it needs to wait for B to dial in before it can issue a request.
    A only accepts a single connection and any failure leads to dropping the connection and waiting for B to reconnect.

The original rationale behind this design was based on security.

    Host B only allows outbound connections to a list of whitelisted hosts.
    It is not possible to reach B unless B dials in. There are no listening/open ports in B.

This PR results in the following changes:

    Refactors ping/heartbeat to avoid previously existing race conditions.
    Separates transport (dialer/listener) from signing (client/server) concerns to simplify workflow.
    Unifies and abstracts away the differences between unix and tcp sockets.
    A single signer endpoint implementation unifies connection handling code (read/write/close/connection obj)
    The signer request handler (server side) is customizable to increase testability.
    Updates and extends unit tests

A high level overview of the classes is as follows:

Transport (endpoints): The following classes take care of establishing a connection

    SignerDialerEndpoint
    SignerListeningEndpoint
    SignerEndpoint groups common functionality (read/write/timeouts/etc.)

Signing (client/server): The following classes take care of exchanging request/responses

    SignerClient
    SignerServer

This PR also closes #3601

Commits:

* refactoring - work in progress

* reworking unit tests

* Encapsulating and fixing unit tests

* Improve tests

* Clean up

* Fix/improve unit tests

* clean up tests

* Improving service endpoint

* fixing unit test

* fix linter issues

* avoid invalid cache values (improve later?)

* complete implementation

* wip

* improved connection loop

* Improve reconnections + fixing unit tests

* addressing comments

* small formatting changes

* clean up

* Update node/node.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_client.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_client_test.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* check during initialization

* dropping connecting when writing fails

* removing break

* use t.log instead

* unifying and using cmn.GetFreePort()

* review fixes

* reordering and unifying drop connection

* closing instead of signalling

* refactored service loop

* removed superfluous brackets

* GetPubKey can return errors

* Revert "GetPubKey can return errors"

This reverts commit 68c06f19b4650389d7e5ab1659b318889028202c.

* adding entry to changelog

* Update CHANGELOG_PENDING.md

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_client.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_dialer_endpoint.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_dialer_endpoint.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_dialer_endpoint.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_dialer_endpoint.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* Update privval/signer_listener_endpoint_test.go

Co-Authored-By: jleni <juan.leni@zondax.ch>

* updating node.go

* review fixes

* fixes linter

* fixing unit test

* small fixes in comments

* addressing review comments

* addressing review comments 2

* reverting suggestion

* Update privval/signer_client_test.go

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Update privval/signer_client_test.go

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Update privval/signer_listener_endpoint_test.go

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* do not expose brokenSignerDialerEndpoint

* clean up logging

* unifying methods

shorten test time
signer also drops

* reenabling pings

* improving testability + unit test

* fixing go fmt + unit test

* remove unused code

* Addressing review comments

* simplifying connection workflow

* fix linter/go import issue

* using base service quit

* updating comment

* Simplifying design + adjusting names

* fixing linter issues

* refactoring test harness + fixes

* Addressing review comments

* cleaning up

* adding additional error check
2019-08-05 19:09:10 +04:00
4da3de79a7 consensus: reduce "Error attempting to add vote" message severity (Er… (#3871)
* consensus: reduce "Error attempting to add vote" message severity (Error -> Info)

Fixes #3839

* add missing changelog entry
2019-08-03 00:00:18 +04:00
f5b116c687 config: move max_msg_bytes into mempool section (#3869)
* config: move max_msg_bytes into mempool section

It was incorrectly placed in fastsync section during
4d7cd8055b (diff-092cdc48047eeb4c0bca311a2e1b8ae6)
merge.

Fixes #3868

* add changelog entry
2019-08-02 23:42:17 +04:00
be06316c84 Merge pull request #3870 from tendermint/release/v0.32.2
Merge v0.32.2 release back to master
2019-08-02 23:30:37 +04:00
8ba8497ac8 Merge branch 'master' into release/v0.32.2 2019-08-02 08:52:21 -07:00
f9cce282da gocritic (2/2) (#3864)
Refs #3262
2019-08-02 10:53:52 +04:00
23fa2e1f1b Merge PR #3860: Update log v0.32.2
* changelog updates

* pr comments
2019-08-01 09:33:27 -07:00
ba9cdeaed9 Merge branch 'v0.32' into release/v0.32.2 2019-07-31 17:26:40 -04:00
8ed1400949 release for v0.32.2 2019-07-31 17:30:11 +02:00
14fa800773 txindexer: Refactor Tx Search Aggregation (#3851)
- Replace the previous intersect call, which was called at each query condition, with a map intersection.
- Replace fmt.Sprintf with string()

closes: #3076

Benchmarks

```
Old
goos: darwin
goarch: amd64
pkg: github.com/tendermint/tendermint/state/txindex/kv
BenchmarkTxSearch-4   	     200	 103641206 ns/op	 7998416 B/op	   71171 allocs/op
PASS
ok  	github.com/tendermint/tendermint/state/txindex/kv	26.019s

New
goos: darwin
goarch: amd64
pkg: github.com/tendermint/tendermint/state/txindex/kv
BenchmarkTxSearch-4   	    1000	  38615024 ns/op	13515226 B/op	  166460 allocs/op
PASS
ok  	github.com/tendermint/tendermint/state/txindex/kv	53.618s
```

~62% performance improvement

Commits:

* Refactor tx search

* Add pending changelog entry

* Add tx search benchmarking

* remove intermediate hashes list

also reset timer in BenchmarkTxSearch
and fix other benchmark

* fix import

* Add test cases

* Fix searching

* Replace fmt.Sprintf with string

* Update state/txindex/kv/kv.go

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Rename params

* Cleanup

* Check error in benchmarks
2019-07-31 19:01:55 +04:00
f3ab967a46 version tmdb (#3854) 2019-07-31 16:17:09 +02:00
a1eb2f6c6b tm-cmn to tm-db (#3850)
* tm-cmn to tm-db

* go.mod changes

* go.mod changes

* more go.mod

* fix tm-db

* ci fix, pending change
2019-07-31 11:34:17 +02:00
41bf54a906 gocritic (1/2) (#3836)
Add gocritic as a linter

    The linting is not complete, but should i complete in this PR or in a following.

    23 files have been touched so it may be better to do in a following PR


Commits:

* Add gocritic to linting

- Added gocritic to linting

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* gocritic

* pr comments

* remove switch in cmdBatch
2019-07-30 18:13:35 +04:00
88e0973f7d node: allow replacing existing p2p.Reactor(s) (#3846)
* node: allow replacing existing p2p.Reactor(s)

using [`CustomReactors`
option](https://godoc.org/github.com/tendermint/tendermint/node#CustomReactors).
Warning: beware of accidental name clashes. Here is the list of existing
reactors: MEMPOOL, BLOCKCHAIN, CONSENSUS, EVIDENCE, PEX.

* check the absence of "CUSTOM" prefix

* merge 2 tests

* add doc.go to node package
2019-07-30 15:08:11 +02:00
1e3364a014 docs: "Writing a Tendermint Core application in Kotlin (gRPC)" guide (#3838)
* add abci grpc kotlin guide

* Update docs/guides/kotlin.md

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Update docs/guides/kotlin.md

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Update docs/guides/kotlin.md

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Update kotlin.md
2019-07-29 21:48:11 +04:00
a4e0a46b73 docs: add a footer to guides (#3835) 2019-07-25 20:39:39 +04:00
3ee7c0bfba p2p: Do not write 'Couldn't connect to any seeds' if there are no seeds (#3834)
* Do not write 'Couldn't connect to any seeds' if there are no seeds

* changelog

* remove privValUpgrade

* Fix typo in changelog

* Update CHANGELOG_PENDING.md

Co-Authored-By: Marko <marbar3778@yahoo.com>

I'm setting up all peers dynamically by calling dial_peers, so p2p.seeds in configs is empty, and I'm seeing error log a lot in logs.
2019-07-25 15:58:14 +04:00
af77077f3c p2p: Fix error logging for connection stop (#3824)
* p2p: fix false-positive error logging when stopping connections

This changeset fixes two types of false-positive errors occurring during
connection shutdown.

The first occurs when the process invokes FlushStop() or Stop() on a
connection. While the previous behavior did properly wait for the sendRoutine
to finish, it did not notify the recvRoutine that the connection was shutting
down. This would cause the recvRouting to receive and error when reading and
log this error. The changeset fixes this by notifying the recvRoutine that
the connection is shutting down.

The second occurs when the connection is terminated (gracefully) by the other side.
The recvRoutine would get an EOF error during the read, log it, and stop the connection
with an error. The changeset detects EOF and gracefully shuts down the connection.

* bring back the comment about flushing

* add changelog entry

* listen for quitRecvRoutine too

* we have to call stopForError

Otherwise peer won't be removed from the peer set and maybe readded
later.
2019-07-25 15:06:18 +04:00
4b9e8505cb types: move MakeVote / MakeBlock functions (#3819)
to the types package

Paritally Fixes #3584
2019-07-25 12:13:19 +04:00
98cb8c9783 add staticcheck linting (#3828)
cleanup to add linter

    grpc change:
        https://godoc.org/google.golang.org/grpc#WithContextDialer
        https://godoc.org/google.golang.org/grpc#WithDialer
        grpc/grpc-go#2627
    prometheous change:
        due to UninstrumentedHandler, being deprecated in the future
    empty branch = empty if or else statement
        didn't delete them entirely but commented
        couldn't find a reason to have them
    could not replicate the issue #3406
        but if want to keep it commented then we should comment out the if statement as well
2019-07-25 09:35:30 +04:00
3a1f876802 docs: add guides to docs (#3830) 2019-07-24 23:05:00 +04:00
362729c2bb Renamed wire.go to codec.go (#3827)
* Renamed wire.go to codec.go

- Wire was the previous name of amino
- Codec describes the file better than `wire` & `amino`

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* ide error

* rename amino.go to codec.go
2019-07-23 15:35:36 +02:00
4d7cd8055b blockchain: Reorg reactor (#3561)
* go routines in blockchain reactor

* Added reference to the go routine diagram

* Initial commit

* cleanup

* Undo testing_logger change, committed by mistake

* Fix the test loggers

* pulled some fsm code into pool.go

* added pool tests

* changes to the design

added block requests under peer

moved the request trigger in the reactor poolRoutine, triggered now by a ticker

in general moved everything required for making block requests smarter in the poolRoutine

added a simple map of heights to keep track of what will need to be requested next

added a few more tests

* send errors to FSM in a different channel than blocks

send errors (RemovePeer) from switch on a different channel than the
one receiving blocks
renamed channels
added more pool tests

* more pool tests

* lint errors

* more tests

* more tests

* switch fast sync to new implementation

* fixed data race in tests

* cleanup

* finished fsm tests

* address golangci comments :)

* address golangci comments :)

* Added timeout on next block needed to advance

* updating docs and cleanup

* fix issue in test from previous cleanup

* cleanup

* Added termination scenarios, tests and more cleanup

* small fixes to adr, comments and cleanup

* Fix bug in sendRequest()

If we tried to send a request to a peer not present in the switch, a
missing continue statement caused the request to be blackholed in a peer
that was removed and never retried.

While this bug was manifesting, the reactor kept asking for other
blocks that would be stored and never consumed. Added the number of
unconsumed blocks in the math for requesting blocks ahead of current
processing height so eventually there will be no more blocks requested
until the already received ones are consumed.

* remove bpPeer's didTimeout field

* Use distinct err codes for peer timeout and FSM timeouts

* Don't allow peers to update with lower height

* review comments from Ethan and Zarko

* some cleanup, renaming, comments

* Move block execution in separate goroutine

* Remove pool's numPending

* review comments

* fix lint, remove old blockchain reactor and duplicates in fsm tests

* small reorg around peer after review comments

* add the reactor spec

* verify block only once

* review comments

* change to int for max number of pending requests

* cleanup and godoc

* Add configuration flag fast sync version

* golangci fixes

* fix config template

* move both reactor versions under blockchain

* cleanup, golint, renaming stuff

* updated documentation, fixed more golint warnings

* integrate with behavior package

* sync with master

* gofmt

* add changelog_pending entry

* move to improvments

* suggestion to changelog entry
2019-07-23 10:58:52 +02:00
756440e0a2 rpc: return err if page is incorrect (less than 0 or greater than tot… (#3825)
* rpc: return err if page is incorrect (less than 0 or greater than total pages)

Fixes #3813

* fix rpc_test
2019-07-23 12:25:59 +04:00
5398420103 mempool: make max_msg_bytes configurable (#3826)
* mempool: make max_msg_bytes configurable

* apply suggestions from code review

* update changelog pending

* apply suggestions from code review again
2019-07-22 17:17:09 +02:00
c6daa48368 rpc: /broadcast_evidence (#3481)
* implement broadcast_duplicate_vote endpoint

* fix test_cover

* address comments

* address comments

* Update abci/example/kvstore/persistent_kvstore.go

Co-Authored-By: mossid <torecursedivine@gmail.com>

* Update rpc/client/main_test.go

Co-Authored-By: mossid <torecursedivine@gmail.com>

* address comments in progress

* reformat the code

* make linter happy

* make tests pass

* replace BroadcastDuplicateVote with BroadcastEvidence

* fix test

* fix endpoint name

* improve doc

* fix TestBroadcastEvidenceDuplicateVote

* Update rpc/core/evidence.go

Co-Authored-By: Thane Thomson <connect@thanethomson.com>

* add changelog entry

* fix TestBroadcastEvidenceDuplicateVote
2019-07-22 12:15:29 +04:00
657832a95a p2p/conn: Add Bufferpool (#3664)
* use byte buffer pool to decreass allocs

* wrap to put buffer in defer

* wapper defer

* add dependency

* remove Gopkg,*

* add change log
2019-07-22 09:37:41 +02:00
51b3428f5c rpc: make max_body_bytes and max_header_bytes configurable (#3818)
* rpc: make max_body_bytes and max_header_bytes configurable

* update changelog pending
2019-07-20 09:44:42 +02:00
9e4cd19878 docs: add A TOC to the Readme.md of ADR Section (#3820)
* ADR TOC in readme.md

* Added A TOC to the Readme.md of ADR Section

- Added table of contents to the Readme of the architecture section.
	- Easier to traverse and when you know what is there.
	- If the Adr's become viewable online it would help guide the user

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* add tm-cmn to subprojects

* normalize word
2019-07-19 21:29:33 +04:00
816dfce8fe libs: Remove db from tendermint in favor of tendermint/tm-cmn (#3811)
* Remove db from tendemrint in favor of tendermint/tm-cmn

- remove db from `libs`
- update dependancy, there have been no breaking changes in the updated deps
	- https://github.com/grpc/grpc-go/releases
	- https://github.com/golang/protobuf/releases

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* changelog add

* gofmt

* more gofmt
2019-07-19 09:54:45 +04:00
71862b7b8d docs: "Writing a built-in Tendermint Core application in Go" guide (#3608)
* docs: go built-in guide

* fix package imports, add badger db, simplify Query

* newTendermint function

* working example

* finish the first guide

* add one more note

* add the second Golang guide - external ABCI app

* fix typos
2019-07-18 15:15:14 +04:00
1844bff613 abci/client: fix DATA RACE in gRPC client (#3798)
* Remove go func {}()

closes #357

- Remove go func(){}() that caused race condiditon

- To reproduce
	- add -race in make file to `install_abci`
	- Remove `CGO_ENABLED=0` & add -race to `install`

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* remove -race

* fix data race

also, reorder callbacks similarly to socket client
2019-07-17 11:49:01 +04:00
a76c503dc6 abci/server: recover from app panics in socket server (#3809)
fixes #3800
2019-07-17 08:37:27 +04:00
fee26405e8 docs: fix consensus spec formatting (#3804) 2019-07-15 23:04:06 +04:00
dbf4062acd Merge pull request #3807 from tendermint/release/v0.32.1
Release/v0.32.1
2019-07-15 12:25:35 -04:00
06a57baa59 Release/v0.32.1 (#3801)
* Release branch for v0.32.1

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* add links to changelog

* wording change

* Apply suggestions from code review

Comment from PR

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>

* add link bump abci Version

* include doc change for abci/app

* moved abci change to features as it doesnt break the abci

* pr comments (#3803)

* pr comments

* abci changelog change

* Marko/update release1 (#3806)

* pr comments

* remove empty space
2019-07-15 12:16:52 -04:00
79e924b34f Merge branch 'master' into release/v0.32.1 2019-07-15 11:42:36 -04:00
0c9a284f8d Marko/update release1 (#3806)
* pr comments

* remove empty space
2019-07-15 11:42:08 -04:00
245e1c9ef7 pr comments (#3803)
* pr comments

* abci changelog change
2019-07-15 11:31:50 -04:00
86f7089396 add a changelog entry (#3802)
Refs https://github.com/tendermint/tendermint/pull/3758#issuecomment-510738955
2019-07-15 11:31:35 -04:00
470f1efcc8 merge master 2019-07-15 11:34:01 +02:00
e0b9298134 libs: minor cleanup (#3794)
* more minor cleanup of libs

Remove unused `version.go`, `assert.go` and `libs/circle.yml`

* Update types/vote_set_test.go

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* spelling change
2019-07-14 18:02:48 +04:00
5d1459b584 libs/fail: clean up fail.go (#3785)
* Clean up `fail.go`

- Clean up fail.go
- Remove unneeded Func `FailRand()`

closes #2729

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* add in commented lines
2019-07-14 17:50:33 +04:00
4e3b6bfb26 Merge remote-tracking branch 'origin' into marko/v0.32.1 2019-07-13 13:40:04 +02:00
7a86e49312 moved abci change to features as it doesnt break the abci 2019-07-13 13:39:11 +02:00
78e634dd5c tm-monitor: add Context to RPC handlers (#3792)
* Fix rpc handle for tm-monitor

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* go imports file

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* go imports file

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* fix RPCUnmonitor too

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
2019-07-13 10:09:27 +04:00
6d96cf4f05 tm-monitor: update build-docker Makefile target (#3790)
- build docker needs go111module on
- switch to golang:1.12 to have git available

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
2019-07-13 09:57:43 +04:00
744d65f173 Merge branch 'master' into marko/v0.32.1 2019-07-12 19:30:11 +02:00
e7ac73177e upgrade go.mod (#3793)
upgrade levelDB to latest master
2019-07-12 19:29:36 +02:00
1b69c6b56b include doc change for abci/app 2019-07-12 15:59:53 +02:00
e5084a4787 Merge branch 'master' into marko/v0.32.1 2019-07-12 15:51:14 +02:00
eddb433d7c abci: Fix documentation regarding CheckTx type update (#3789)
* Update ABCI docs to reflect latest changes on PR #3744

* Add note about new Type parameter for CheckTx
2019-07-12 15:43:03 +02:00
0787b79347 add link bump abci Version 2019-07-12 11:17:20 +02:00
823d916a11 Apply suggestions from code review
Comment from PR

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>
2019-07-12 11:06:27 +02:00
378a0e51bf docs: replace priv_validator.json with priv_validator_key.json (#3786) 2019-07-11 23:31:42 +04:00
e8926867d8 wording change 2019-07-11 21:22:14 +02:00
0f076e5fbe add links to changelog 2019-07-11 18:37:46 +02:00
ac232caef3 Release branch for v0.32.1
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-07-11 18:34:21 +02:00
e9c9c558d7 libs/common: remove unused functions (#3784)
- The removed functions are not used in Iavl, Cosmos-sdk and tendermint repos
- Code-hygenie `whoop whoop`

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-07-10 18:40:20 +04:00
f05c2a9558 p2p: extract ID validation into a separate func (#3754)
* p2p: extract ID validation into a separate func

- NewNetAddress panics if ID is invalid
- NetAddress#Valid returns an error
- remove ErrAddrBookInvalidAddrNoID

Fixes #2722

* p2p: remove repetitive check in ReceiveAddrs

* fix netaddress test
2019-07-10 13:36:48 +04:00
d70871f41b testnet: add consensus_params to testnet config generation (#3781)
Also, document time_iota_ms.

Closes #3723

Commits:

* config: Add ConsensusParams when generating testnet config (#3723)

* docs: Add explanation of time_iota_ms (#3723)

* Update changelog_pending (#3723)
2019-07-10 13:27:17 +04:00
fc1eb46587 libs/common: remove heap.go (#3780)
* Remove file heap.go

- cmn.Heap is not being used in cosmos-sdk, iavl nor tendermint repo.

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* changelog entry

* Update CHANGELOG_PENDING.md

closes #2432
2019-07-10 13:06:03 +04:00
ddee2d641f infrastructure for reproducible builds (#3770)
* Add deterministic buildsystem

* Update CircleCI config

* Enable build on all branches for testing purposes

* Revert "Enable build on all branches for testing purposes"

This reverts commit bf5cf66da94bf9c23787b42995b0409492805f03.

* Remove develop from branch filters

* Remove dangling reference to develop

* Upload binaries too

* Build for stable branches too
2019-07-10 12:48:31 +04:00
f2ada0a604 docs: quick link fixes throughout docs and repo (#3776)
* Quick link fixes throughout docs and repo

- used markdown link tester to find broken links

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* minor change remove slash

* pr comments

* minor fix

* remove docker.develop

* remove master tag
2019-07-08 21:54:24 +04:00
1d5fcc2281 adr: [43] blockchain riri-org (#3753)
* [adr] First draft on adr-042

* fix diagram urls

* Update docs/architecture/adr-042-blockchain-riri-org.md

Co-Authored-By: Marko <marbar3778@yahoo.com>

* Update docs/architecture/adr-042-blockchain-riri-org.md

Co-Authored-By: Marko <marbar3778@yahoo.com>

* Update docs/architecture/adr-042-blockchain-riri-org.md

Co-Authored-By: Marko <marbar3778@yahoo.com>

* add go syntax highlight

* more highlighting

* consistency fixes

* Add references

* new adr number

* Fixes based on feedback

* aditional state info

* Add details on getSchedule

* replace spaces with tabs

* fixes based on feedback

* add clarity around r.msgs

* clarify block processing

* fix off by one error

* additional details on ioRoutine

* Update docs/architecture/adr-043-blockchain-riri-org.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>
2019-07-08 21:45:52 +04:00
94e0176ac2 behaviour: return correct reason in MessageOutOfOrder (#3772) 2019-07-04 11:26:13 +04:00
f76684a05c node: allow registration of custom reactors while creating node (#3771)
* change invocation of NewNode across

* custom reactor name are prefixed with CUSTOM_

* upgate changelog pending

* improve comments

* node: refactor NewNode to use functional options
2019-07-03 17:17:59 +04:00
e645442c9b abci: minor cleanups in the socket client (#3758)
Follow up from #3512

Specifically:

    cli.conn.Close() need not be under the mutex (#3512 (comment))
    call the reqRes callback after the resCb so they always happen in the same order (#3512)

Fixes #3513
2019-07-02 22:01:29 +04:00
d041476819 p2p: dial addrs which came from seed instead of calling ensurePeers (#3762)
Calling ensurePeers outside of ensurePeersRoutine can lead to nodes
disconnecting from us due to "sent next PEX request too soon" error.

Solution is to just dial addrs we got from src instead of calling
ensurePeers.

Refs #2093

Fixes #3338
2019-07-02 21:19:58 +04:00
62f97a69e9 abci: Refactor CheckTx to notify of recheck (#3744)
As per #2127, this refactors the RequestCheckTx ProtoBuf struct to allow for a flag indicating whether a query is a recheck or not (and allows for possible future, more nuanced states).

In order to pass this extended information through to the ABCI app, the proxy.AppConnMempool (and, for consistency, the proxy.AppConnConsensus) interface seems to need to be refactored along with abcicli.Client.

And, as per this comment, I've made the following modification to the protobuf definition for the RequestCheckTx structure:

enum CheckTxType {
  New = 0;
  Recheck = 1;
}

message RequestCheckTx {
  bytes tx = 1;
  CheckTxType type = 2;
}

* Refactor ABCI CheckTx to notify of recheck

As per #2127, this refactors the `RequestCheckTx` ProtoBuf struct to allow for:

1. a flag indicating whether a query is a recheck or not (and allows for
   possible future, more nuanced states)
2. an `additional_data` bytes array to provide information for those more
   nuanced states.

In order to pass this extended information through to the ABCI app, the
`proxy.AppConnMempool` (and, for consistency, the
`proxy.AppConnConsensus`) interface seems to need to be refactored.

Commits:

* Fix linting issue

* Add CHANGELOG_PENDING entry

* Remove extraneous explicit initialization

* Update ABCI spec doc to include new CheckTx params

* Rename method param for consistency

* Rename CheckTxType enum values and remove additional_data param
2019-07-02 18:14:53 +04:00
d9481e3648 config: make possible to set absolute paths for TLS cert and key (#3765) 2019-07-01 12:48:54 +04:00
d4cf204087 libs: remove commented and unneeded code (#3757)
- libs/errors: commented out errors.go
- libs/common: unused colors.go
- libs/db: unused debugDB

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-06-30 11:56:24 +04:00
d069eb62df docs: remove confusing statement from contributing.md (#3764) 2019-06-30 11:46:31 +04:00
b2afc65908 docs: add readme image (#3763) 2019-06-29 11:06:44 +04:00
1014f8c84b docs: update to contributing.md (#3760)
* Update to contributing.md

- Add in section for Draft PR, instead of WIP
- Add make lint as part of the commit process.

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* mistake

* minor word change
2019-06-28 19:32:15 +04:00
b73cfe8786 Merge pull request #3756 from tendermint/v0.32
V0.32
2019-06-26 11:27:24 -04:00
747f99fdc1 changelog and version (#3750)
* changelog and version

* Add section on ABCI changes

* Update ABCI upgrade section to include events examples

* update upgrading

* more upgrading and changelog

* update changelog from pending

* refer to #rpc_changes

* minor word changes
2019-06-25 07:57:50 -04:00
eb08609de1 docs: update JS section of abci-cli.md (#3747) 2019-06-25 10:56:03 +04:00
e93e8e730d Added a disclaimer so the user is aware of binary (#3751)
* Added a disaclaimer so the user is aware of binary

- added disclaimer for `-s -w`

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* move up to compile
2019-06-24 14:13:25 -04:00
4c4bf0f131 Added flags '-s -w' to buildflags (#3742)
* Added flags '-s -w' to buildflags

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* added a condition for no strip

* minor changes

* on call discussions

* on call discussion v2
2019-06-24 10:32:24 -04:00
d88a639838 Make RPC bind to localhost by default (#3746)
* Make RPC bind to localhost by default

* Add CHANGELOG_PENDING entry

* Allow testnet command to override RPC listen address

* Update localnet test to bind RPC to 0.0.0.0

* Update p2p test to bind RPC to 0.0.0.0

* Remove rpc-laddr parameter

* Update localnet to use config template with RPC listen address override

* Use config template override method for RPC listen address

* Build config template into localnode image

* Build localnode image locally before starting localnet

* Move testnet config overrides into templates

* Revert deletion of config overrides

* Remove extraneous config parameter overrides
2019-06-24 10:32:12 -04:00
c37faf3ac1 docs: (rpc/broadcast_tx_*) write expectations for a client (#3749)
Refs #3322
2019-06-24 09:49:49 -04:00
a44c621d2d Remove double lint (#3748)
- Circel CI and Golangci were doing linting jobs, removed circleci

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-06-24 09:48:21 -04:00
3e7752c29d cs: exit if SwitchToConsensus fails (#3706)
Refs #3656
2019-06-22 11:48:01 -04:00
1b77bf6f20 rpc/lib: write a test for TLS server (#3703)
* rpc/lib: write a test for TLS server

Refs #3700

* do not regenerate certificates

* add nolint
2019-06-22 11:44:12 -04:00
8fc8368438 node: run whole func in goroutine, not just logger.Error fn (#3743)
* node: run whole func in goroutine, not just logger.Error fn

Fixes #3741

* add a changelog entry
2019-06-22 10:30:23 +04:00
228bba799d state: add more tests for block validation (#3674)
* Expose priv validators for use in testing

* Generalize block header validation test past height 1

* Remove ineffectual assignment

* Remove redundant SaveState call

* Reorder comment for clarity

* Use the block executor ApplyBlock function instead of implementing a stripped-down version of it

* Remove commented-out code

* Remove unnecessary test

The required tests already appear to be implemented (implicitly) through
the TestValidateBlockHeader test.

* Allow for catching of specific error types during TestValidateBlockCommit

* Make return error testable

* Clean up and add TestValidateBlockCommit code

* Fix formatting

* Extract function to create a new mock test app

* Update comment for clarity

* Fix comment

* Add skeleton code for evidence-related test

* Allow for addressing priv val by address

* Generalize test beyond a single validator

* Generalize TestValidateBlockEvidence past first height

* Reorder code to clearly separate tests and utility code

* Use a common constant for stop height for testing in state/validation_test.go

* Refactor errors to resemble existing conventions

* Fix formatting

* Extract common helper functions

Having the tests littered with helper functions makes them less easily
readable imho, so I've pulled them out into a separate file. This also
makes it easier to see what helper functions are available during
testing, so we minimize the chance of duplication when writing new
tests.

* Remove unused parameter

* Remove unused parameters

* Add field keys

* Remove unused height constant

* Fix typo

* Fix incorrect return error

* Add field keys

* Use separate package for tests

This refactors all of the state package's tests into a state_test
package, so as to keep any usage of the state package's internal methods
explicit.

Any internal methods/constants used by tests are now explicitly exported
in state/export_test.go

* Refactor: extract helper function to make, validate, execute and commit a block

* Rename state function to makeState

* Remove redundant constant for number of validators

* Refactor mock evidence registration into TestMain

* Remove extraneous nVals variable

* Replace function-level TODOs with file-level TODO and explanation

* Remove extraneous comment

* Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
2019-06-21 17:29:29 -04:00
59497c362b Prepare nuking develop (#3726)
* Update Readme and contrib. guidelines: remove traces of master

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* add simple example

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* update contributing.md

* add link

* Update CONTRIBUTING.md

* add a note on master and releases

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* update readme
2019-06-21 16:29:16 -04:00
2e5b2a9537 abci/examples: switch from hex to base64 pubkey in kvstore (#3641)
* abci/example: use base64 for update validator set

* update kvstore/README.md

* update CHANGELOG_PENDING.md and abci/example/kvstore/README.md
2019-06-21 15:18:49 +04:00
866b343c0c Changes to files that had linting issue (#3731)
- Govet issues fixed
- 1 gosec issue solved using nolint

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-06-21 09:58:32 +04:00
9d5ba576ee abci: Refactor ABCI CheckTx and DeliverTx signatures (#3735)
* Refactor signature of Application.CheckTx

* Refactor signature of Application.DeliverTx

* Refactor example variable names for clarity and consistency

* Rename method variables for consistency

* Rename method variables for consistency

* add a changelog entry

* update docs
2019-06-21 09:56:27 +04:00
1b5110e91f node: fix a bug where nil is recorded as node's address (#3740)
* node: fix a bug where `nil` is recorded as node's address

Solution

  AddOurAddress when we know it
  sw.NetAddress is nil in createAddrBookAndSetOnSwitch
  it's set by n.transport.Listen function, which is called during start

Fixes #3716

* use addr instead of n.sw.NetAddress

* add both ExternalAddress and ListenAddress as our addresses
2019-06-21 09:30:32 +04:00
60827f7562 docs: fix some language issues and deprecated link (#3733) 2019-06-19 21:35:53 +03:00
ed18ffdca3 p2p: refactor Switch#OnStop (#3729) 2019-06-17 13:30:12 +02:00
0e1c492d3e docs: missing 'b' in python command (#3728)
In Python 3 the command outlined in this doc `import codecs; codecs.decode("YWJjZA==", 'base64').decode('ascii')` throws an error:
TypeError: decoding with 'base64' codec failed (TypeError: expected bytes-like object, not str), needs to add 'b' before the encoded string
`import codecs; codecs.decode(b"YWJjZA==", 'base64').decode('ascii')` to make it work
2019-06-17 12:51:12 +02:00
9010ff5f96 types: do not ignore errors returned by PublishWithEvents (#3722)
Follow up to #3643

* update changelog

* do not ignore errors returned by PublishWithEvents
2019-06-12 15:25:47 +02:00
ab0835463f abci: Refactor tagging events using list of lists (#3643)
## PR

This PR introduces a fundamental breaking change to the structure of ABCI response and tx tags and the way they're processed. Namely, the SDK can support more complex and aggregated events for distribution and slashing. In addition, block responses can include duplicate keys in events.

    Implement new Event type. An event has a type and a list of KV pairs (ie. list-of-lists). Typical events may look like:

"rewards": [{"amount": "5000uatom", "validator": "...", "recipient": "..."}]
"sender": [{"address": "...", "balance": "100uatom"}]

The events are indexed by {even.type}.{even.attribute[i].key}/.... In this case a client would subscribe or query for rewards.recipient='...'

    ABCI response types and related types now include Events []Event instead of Tags []cmn.KVPair.
    PubSub logic now publishes/matches against map[string][]string instead of map[string]string to support duplicate keys in response events (from #1385). A match is successful if the value is found in the slice of strings.

closes: #1859
closes: #2905

## Commits:

* Implement Event ABCI type and updates responses to use events

* Update messages_test.go

* Update kvstore.go

* Update event_bus.go

* Update subscription.go

* Update pubsub.go

* Update kvstore.go

* Update query logic to handle slice of strings in events

* Update Empty#Matches and unit tests

* Update pubsub logic

* Update EventBus#Publish

* Update kv tx indexer

* Update godocs

* Update ResultEvent to use slice of strings; update RPC

* Update more tests

* Update abci.md

* Check for key in validateAndStringifyEvents

* Fix KV indexer to skip empty keys

* Fix linting errors

* Update CHANGELOG_PENDING.md

* Update docs/spec/abci/abci.md

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update abci/types/types.proto

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>

* Update docs/spec/abci/abci.md

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>

* Update libs/pubsub/query/query.go

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>

* Update match function to match if ANY value matches

* Implement TestSubscribeDuplicateKeys

* Update TestMatches to include multi-key test cases

* Update events.go

* Update Query interface godoc

* Update match godoc

* Add godoc for matchValue

* DRY-up tx indexing

* Return error from PublishWithEvents in EventBus#Publish

* Update PublishEventNewBlockHeader to return an error

* Fix build

* Update events doc in ABCI

* Update ABCI events godoc

* Implement TestEventBusPublishEventTxDuplicateKeys

* Update TestSubscribeDuplicateKeys to be table-driven

* Remove mod file

* Remove markdown from events godoc

* Implement TestTxSearchDeprecatedIndexing test
2019-06-12 14:03:45 +02:00
8b7ca8fd99 switch to go mod (#3613)
* Update to using go mod from dep

* Remove references to make get_vendor_deps

* Specify go version

* Set GO111MODULE=on and add -mod=readonly

* Fix exported env

* switch to using go1.12 everywhere

* Fix test scripts

* Typo:

* Prepend GO111MODULE=on

* remove dep cache

* Revert "remove dep cache"

This reverts commit 45117bda

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* bring back the dependency cache and change it to cache modules instead
of vendored deps; also:

 - bump version for dependency cache
 - bump version on pkg-cache (includes modules directory)

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* remove some more traces of dep:
 - remove Gopkg.(toml | lock)
 - update contributing guidlines
 - set global default in circleci (GO111MODULE=on)

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* global var failed for `test_cover` with
`go: unknown environment setting GO111MODULE=true`
although the var was `GO111MODULE: on`

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* Changelog pending entry

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* Add bbolt dependency to go.mod

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* move -mod=readonly to build flags
2019-06-09 16:27:48 +04:00
ed896f508b Merge pull request #3720 from Yawning/boltdb-fixes
Fix fundemental BoltDB backend correctness issues.
2019-06-07 10:43:32 +02:00
319ecb3005 libs/db: Fix the BoltDB Get and Iterator
BoltDB's accessors will return slices that are only valid for the
lifetime of the transaction.  This adds copies where required to prevent
hard to debug crashes (among other things).
2019-06-07 08:26:58 +00:00
f46ed4aac8 libs/db: Fix the BoltDB Batch.Delete
`Delete` should queue a delete operation that targets the entire
database, and not just keys that happen to be in the current batch.
2019-06-07 08:26:20 +00:00
6a7d4182b4 p2p: Peerbehaviour follow up (#3653) (#3663)
* Move peer behaviour into it's own package
* refactor wip
* Adjust API and fix tests
* remove unused test struct
* Better error message
* Restructure:
    + Now behaviour is it's own package, we don't need to include
    PeerBehaviour in every type.
    + Split up behaviours and reporters into seperate files

* doc string fixes
* Fix minor typos
* Update behaviour/reporter.go
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Update behaviour/reporter.go
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
2019-06-06 22:33:39 +02:00
c1f264822a p2p: remove NewNetAddressStringWithOptionalID (#3711)
Fixes #3521

The function NewNetAddressStringWithOptionalID is from a time when peer
IDs were optional. They're not anymore. So this should be renamed to
NewNetAddressString and should ensure the ID is provided.

* update changelog
* use NewNetAddress in transport tests
* use NewNetAddress in TestTransportMultiplexAcceptMultiple
2019-06-05 17:39:28 +02:00
a7e8fbf3a7 rpc: Use Wrap instead of Errorf error (#3686)
So we can have an error code when rpc fails.

* Update CHANGELOG_PENDING.md
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* wrap correct error
* format code
2019-06-05 11:23:53 +02:00
c9ef824ddf p2p: Per channel metrics (#3666) (#3677)
* Add `chID` label to sent/receive byte mtrics
* add changelog pending entry
2019-06-05 11:22:00 +02:00
2a23eca368 docs: update /block_results RPC docs (#3708)
Fixes #3616
2019-06-05 10:36:16 +09:00
c69ec87f67 Merge pull request #3715 from tendermint/v0.31
V0.31
2019-06-03 23:15:23 -04:00
8fb2c2a0e8 Merge pull request #3712 from tendermint/release/v0.31.7
Release/v0.31.7
2019-06-03 23:14:37 -04:00
96e132b4b0 libs/db: remove deprecated LevelDBBackend const (#3632) 2019-06-04 12:12:43 +09:00
99c9a35982 docs: update RPC docs for /subscribe & /unsubscribe (#3705)
Fixes #3678

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>
2019-06-04 10:05:22 +09:00
65a3dfe235 changelog and version (#3709) 2019-06-03 11:34:21 -04:00
048ac8d94b remove invalid transactions from the mempool (#3701)
Otherwise, we'll be trying to include them in each consecutive block.

The downside is that evil proposers will be able to drop valid
transactions (see #3322).

Reverts https://github.com/tendermint/tendermint/pull/3625

Fixes #3699
2019-06-03 08:46:02 -04:00
21bfd7fba9 Add check for version/version.go TMCoreSemVer (#3704) 2019-06-03 08:41:27 -04:00
77e711f70b Merge pull request #3695 from tendermint/release/v0.31.6
Release/v0.31.6
2019-05-30 19:15:48 -04:00
0dd6b92a64 Relocate GenesisDocProvider and DefaultGenesisDocProviderFunc (#3693)
* Move GenesisDocProvider and DefaultGenesisDocProviderFunc

GenesisDocProvider, being a provider of *types.GenesisDoc, makes sense
to be part of the types package.

DefaultGenesisDocProviderFunc, which relies on *config.Config to produce
a types.GenesisDocProvider, makes sense being part of the config
package.

* Add aliases to avoid breaking node package API

* Revert to original structure

After discussion, it appears as though the best place for the relocated
structures is still in the node package. This means that for the v0.31.6
release and into the future, there will be no changes two these two
entities' APIs.
2019-05-30 18:40:17 -04:00
9dcee69ac2 v0.31.6 changelog (#3688)
* update changelog

* Update changelog

- less detail about internal stuff like the `mempool`
- focus BUG FIX entries more on what was fixed rather than how

* minor cleanup.

- remove entry for GenesisDocProvider, it's being undone

* minor fix
2019-05-30 18:25:21 -04:00
b522ad0052 docs: fix minor typo (#3681) 2019-05-29 17:32:34 +09:00
b9508ffecb [p2p] Peer behaviour test tweaks (#3662)
* Peer behaviour test tweaks:

    Address the remaining test issues mentioned in ##3552 notably:
    + switch to p2p_test package
    + Use `Error` instead of `Errorf` when not using formatting
    + Add expected/got errors to
    `TestMockPeerBehaviourReporterConcurrency` test

* Peer behaviour equal behaviours test

    + slices of PeerBehaviours should be compared as histograms to
    ensure they have the same set of PeerBehaviours at the same
    freequncy.

* TestEqualPeerBehaviours:

    + Add tests for the equivalence between sets of PeerBehaviours
2019-05-27 15:44:56 -04:00
a6ac611e77 tendermint testnet: Allow for better hostname control (#3661)
* Allow testnet hostnames to be overridden

This allows one to specify the `--hostname` flag multiple times, each
time providing an additional custom hostname for a respective peer
(validator or non-validator). This overrides any of the
`--hostname-prefix` or `--starting-ip-address` flags.

The string array approach is taken instead of the string slice approach
(see the pflag docs:
https://godoc.org/github.com/spf13/pflag#StringArray) because the string
slice approach (a comma-separated string) doesn't allow for cleaner
multi-line BASH scripts - where this feature is intended to be used.

* Reorder conditional for clarity with simpler earlier return

* Allow for specifying peer hostname suffix

* Quote values in help strings for greater clarity

* Fix command switch

* Add CHANGELOG_PENDING entry for PR

* Allow for unique monikers

The current approach to generating monikers for testnet nodes assigns
the local hostname of the machine on which the testnet config was
generated to all nodes. This results in the same moniker for each and
every node.

This commit makes use of the supplied `--hostname-prefix` and
`--hostname-suffix`, or `--hostname` parameters to generate unique
monikers for each node. Alternatively, another parameter
(`--random-monikers`) allows one to forcibly override all of the other
options with random hexadecimal strings.

* Update CHANGELOG_PENDING entry for new command line switch
2019-05-27 15:33:41 -04:00
e7bf25844f update PULL_REQUEST_TEMPLATE and CONTRIBUTING (#3655)
* update PULL_REQUEST_TEMPLATE and CONTRIBUTING

* Update .github/PULL_REQUEST_TEMPLATE.md

Co-Authored-By: Thane Thomson <connect@thanethomson.com>

* note ADRs
2019-05-27 14:45:27 -04:00
bcf10d5bae p2p: peer state init too late and pex message too soon (#3634)
* fix peer state init to late

Peer does not have a state yet. We set it in AddPeer.
We need an new interface before mconnection is started

* pex message to soon

fix reconnection pex send too fast,
error is caused lastReceivedRequests is still
not deleted when a peer reconnected

* add test case for initpeer

* add prove case

* remove potentially infinite loop

* Update consensus/reactor.go

Co-Authored-By: guagualvcha <baifudong@lancai.cn>

* Update consensus/reactor_test.go

Co-Authored-By: guagualvcha <baifudong@lancai.cn>

* document Reactor interface better

* refactor TestReactorReceiveDoesNotPanicIfAddPeerHasntBeenCalledYet

* fix merge conflicts

* blockchain: remove peer's ID from the pool in InitPeer

Refs #3338

* pex: resetPeersRequestsInfo both upon InitPeer and RemovePeer

* ensure RemovePeer is always called before InitPeer

by removing the peer from the switch last (after we've stopped it and
removed from all reactors)

* add some comments for ConsensusReactor#InitPeer

* fix pex reactor

* format code

* fix spelling

* update changelog

* remove unused methods

* do not clear lastReceivedRequests upon error

only in RemovePeer

* call InitPeer before we start the peer!

* add a comment to InitPeer

* write a test

* use waitUntilSwitchHasAtLeastNPeers func

* bring back timeouts

* Test to ensure Receive panics if InitPeer has not been called
2019-05-27 14:39:58 -04:00
5997e75c84 fix integration script (#3667) 2019-05-23 12:56:57 -04:00
97ceeed054 Merge pull request #3670 from yutianwu/fix_proxy
[R4R] Fix missing context parameter in proxy
2019-05-23 10:09:52 +02:00
3ef9e453b7 update change log 2019-05-23 14:26:11 +08:00
c7b324d3f2 Merge pull request #3675 from alexanderbez/bez/3672-improve-AddSignatureFromPubKey-error
Improve error message returned from AddSignatureFromPubKey
2019-05-23 07:45:05 +02:00
cfd42be0fe Improve error and tests 2019-05-22 20:02:00 -04:00
f1f243d749 p2p/pex: consult seeds in crawlPeersRoutine (#3647)
* p2p/pex: consult seeds in crawlPeersRoutine

This changeset alters the startup behavior for crawlPeersRoutine. Previously
the routine would crawl a random selection of peers on startup. For a
new seed node, there are no peers. As a result, new seed nodes are unable
to bootstrap themselves with a list of peers until another node with a list
of peers connects to the seed. If this node relies on the seed node for peers,
then the two will not discover more peers.

This changeset makes the startup behavior for crawlPeersRoutine connect to
any seed nodes. Upon connecting, a request for peers will be sent to the seed node
thus helping bootstrap our seed node.

* p2p/pex: Adjust error message for no peers

Co-Authored-By: Ethan Buchman <ethan@coinculture.info>
2019-05-21 17:05:56 -04:00
fcce9ed4db fix lint 2019-05-21 14:23:50 +08:00
c21b4fcc93 fix bug of proxy 2019-05-21 14:12:40 +08:00
86cf8ee3f9 p2p: PeerBehaviour implementation (#3539) (#3552)
* p2p: initial implementation of peer behaviour

* [p2p] re-use newMockPeer

* p2p: add inline docs for peer_behaviour interface

* [p2p] Align PeerBehaviour interface (#3558)

* [p2p] make switchedPeerHebaviour private

* [p2p] make storePeerHebaviour private

* [p2p] Add CHANGELOG_PENDING entry for PeerBehaviour

* [p2p] Adjustment naming for PeerBehaviour

* [p2p] Add coarse lock around storedPeerBehaviour

* [p2p]: Fix non-pointer methods in storedPeerBehaviour

    + Structs with embeded locks must specify all methods with pointer
     receivers to avoid creating a copy of the embeded lock.

* [p2p] Thorough refactoring based on comments in #3552

    + Decouple PeerBehaviour interface from Peer by parametrizing
    methods with `p2p.ID` instead of `p2p.Peer`
    + Setter methods wrapped in a write lock
    + Getter methods wrapped in a read lock
    + Getter methods on storedPeerBehaviour now take a `p2p.ID`
    + Getter methods return a copy of underlying stored behaviours
    + Add doc strings to public types and methods

* [p2p] make structs public

* [p2p] Test empty StoredPeerBehaviour

* [p2p] typo fix

* [p2p] add TestStoredPeerBehaviourConcurrency

    + Add a test which uses StoredPeerBehaviour in multiple goroutines
      to ensure thread-safety.

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour_test.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* Update p2p/peer_behaviour.go

Co-Authored-By: brapse <brapse@gmail.com>

* [p2p] field ordering convention

* p2p: peer behaviour refactor

    + Change naming of reporting behaviour to `Report`
    + Remove the responsibility of distinguishing between the categories
    of good and bad behaviour and instead focus on reporting behaviour.

* p2p: rename PeerReporter -> PeerBehaviourReporter
2019-05-10 13:45:50 -04:00
6f1ccb6c49 [ADR] ADR-36: blockchain reactor refactor spec (#3506)
* Add blockchain reactor refactor ADR

* docs: Correct markdown and go syntax in adr-036

* Update docs/architecture/adr-036-blockchain-reactor-refactor.md

Co-Authored-By: milosevic <zarko@interchain.io>

* Add comments and address reviewer comments

* Improve formating

* Small improvements

* adr-036 -> adr-040
2019-05-10 13:37:21 -04:00
a076b48202 libs/db: boltdb: use slice instead of sync.Map (#3633)
for storing batch keys and values in boltDBBatch.

NOTE: batch does not have to be safe for concurrent access. Delete may
be slow, but given it should not be used often, it's ok.

Fixes #3631
2019-05-07 14:06:20 +04:00
a7358bc69f libs/db: conditional compilation (#3628)
* libs/db: conditional compilation

For cleveldb: go build -tags cleveldb
For boltdb: go build -tags boltdb

Fixes #3611

* document db_backend param better

* remove deprecated LevelDBBackend

* update changelog

* add missing lines

* add new line

* fix TestRemoteDB

* add a line about boltdb tag

* Revert "remove deprecated LevelDBBackend"

This reverts commit 1aa85453f76605e0c4d967601bbe26240e668d51.

* make PR non breaking

* change DEPRECATED label format

https://stackoverflow.com/a/36360323/820520
2019-05-07 12:33:47 +04:00
27909e5d2a mempool: remove only valid (Code==0) txs on Update (#3625)
* mempool: remove only valid (Code==0) txs on Update

so evil proposers can't drop valid txs in Commit stage.

Also remove invalid (Code!=0) txs from the cache so they can be
resubmitted.

Fixes #3322

@rickyyangz:

In the end of commit stage, we will update mempool to remove all the txs
in current block.

// Update mempool.
err = blockExec.mempool.Update(
	block.Height,
	block.Txs,
	TxPreCheck(state),
	TxPostCheck(state),
)

Assum an account has 3 transactions in the mempool, the sequences are
100, 101 and 102 separately, So an evil proposal can only package the
101 and 102 transactions into its proposal block, and leave 100 still in
mempool, then the two txs will be removed from all validators' mempool
when commit. So the account lost the two valid txs.

@ebuchman:

In the longer term we may want to do something like #2639 so we can
validate txs before we commit the block. But even in this case we'd only
want to run the equivalent of CheckTx, which means the DeliverTx could
still fail even if the CheckTx passes depending on how the app handles
the ABCI Code semantics. So more work will be required around the ABCI
code. See also #2185

* add changelog entry and tests

* improve changelog message

* reformat code
2019-05-07 12:25:35 +04:00
1e073817de rpc: /dial_peers: only mark peers as persistent if flag is on (#3620)
## Description

also

    handle errors from DialPeersAsync
    remove nil addr from log msg
    fix TestPEXReactorDoesNotDisconnectFromPersistentPeerInSeedMode

This is a follow-up from
#3593 (review)

Fixes most of the #3617, except #3593 (comment)

## Commits

* rpc: /dial_peers: only mark peers as persistent if flag is on

also

- handle errors from DialPeersAsync
- remove nil addr from log msg
- fix TestPEXReactorDoesNotDisconnectFromPersistentPeerInSeedMode

This is a follow-up from
https://github.com/tendermint/tendermint/pull/3593#pullrequestreview-233556909

* remove a call to AddPersistentPeers

TestDialFail will trigger a reconnect
2019-05-07 11:09:06 +04:00
2bb1a87d41 Merge pull request #3629 from leoluk/fix-boltdb-batch
libs/db: fix boltdb batching
2019-05-07 09:03:49 +02:00
Leo
d0d9ef16f7 libs/db: fix boltdb batching
`[]byte` is unhashable and needs to be casted to a string.

See https://github.com/tendermint/tendermint/pull/3610#discussion_r280995538

Ref https://github.com/tendermint/tendermint/issues/3626
2019-05-06 20:10:39 +00:00
60b833403c libs/db: close boltDBIterator (#3627)
Refs https://github.com/tendermint/tendermint/pull/3610#discussion_r281201274

If we do not close, other txs will be stuck forever.
2019-05-06 21:37:41 +04:00
debf8f70c9 libs/db: bbolt (etcd's fork of bolt) (#3610)
Description:

    add boltdb implement for db interface.

    The boltdb is safe and high performence embedded KV database. It is based on B+tree and Mmap.
    Now it is maintained by etcd-io org. https://github.com/etcd-io/bbolt
    It is much better than LSM tree (levelDB) when RANDOM and SCAN read.

Replaced #3604
Refs #1835

Commits:

* add boltdb for storage

* update boltdb in gopkg.toml

* update bbolt in Gopkg.lock

* dep update  Gopkg.lock

* add boltdb'bucket when create Boltdb

* some modifies

* address my own comments

* fix most of the Iterator tests for boltdb

* bolt does not support concurrent writes while iterating

* add WARNING word

* note that ReadOnly option is not supported

* fixes after Ismail's review

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* panic if View returns error

plus specify bucket in the top comment
2019-05-06 13:42:21 +04:00
4519ef3109 adr renames (#3622) 2019-05-05 12:42:26 -04:00
86f2765b32 Add adr-36 (#3324) 2019-05-05 12:19:41 -04:00
e2f5471545 ADR-037: DeliverBlock (#3420)
* ADR 037 Initial draft

* Add link to initial conversation

* Update initial draft

* Fix indentations

* Change negative consequences

* Fix indentations

* Change ADR id

* Add one more positive consequence

* Rollback ADR number
2019-05-05 12:19:19 -04:00
4905640e9b types: CommitVotes struct as last step towards #1648 (#3298)
* VoteSignBytes builds CanonicalVote

* CommitVotes implements VoteSetReader

- new CommitVotes struct holds both the Commit and the ValidatorSet and
  implements VoteSetReader
- ToVote takes a ValidatorSet

* fix TestCommit

* use CommitSig.BlockID

Commits may include votes for a different BlockID, could be nil,
or different altogether. This means we can't use `commit.BlockID`
for reconstructing the sign bytes, since up to -1/3 of the commits
might be for independent BlockIDs. This means CommitSig will need to
include an indicator for what BlockID it signed - if it's not the
committed one or nil, it will need to include it fully in order to be
verified. This is unfortunate but unavoidable so long as we include
votes for non-committed BlockIDs (which we do to track validator
liveness)

* fixes from review

* remove CommitVotes. CommitSig contains address

* remove commit.canonicalVote method

* toVote -> getVote, takes valIdx

* update adr-025

* commit.ToVoteSet -> CommitToVoteSet

* add test

* fix from review
2019-05-05 18:01:35 +02:00
4c60ab83c8 Update apps.md (#3621) 2019-05-05 10:23:41 -04:00
5051a1f7bc mempool: move interface into mempool package (#3524)
## Description

Refs #2659

Breaking changes in the mempool package:

[mempool] #2659 Mempool now an interface
    old Mempool renamed to CListMempool
    NewMempool renamed to NewCListMempool
    Option renamed to CListOption
    MempoolReactor renamed to Reactor
    NewMempoolReactor renamed to NewReactor
    unexpose TxID method
    TxInfo.PeerID renamed to SenderID
    unexpose MempoolReactor.Mempool

Breaking changes in the state package:

[state] #2659 Mempool interface moved to mempool package
    MockMempool moved to top-level mock package and renamed to Mempool

Non Breaking changes in the node package:

[node] #2659 Add Mempool method, which allows you to access mempool

## Commits

* move Mempool interface into mempool package

Refs #2659

Breaking changes in the mempool package:

- Mempool now an interface
- old Mempool renamed to CListMempool

Breaking changes to state package:

- MockMempool moved to mempool/mock package and renamed to Mempool
- Mempool interface moved to mempool package

* assert CListMempool impl Mempool

* gofmt code

* rename MempoolReactor to Reactor

- combine everything into one interface
- rename TxInfo.PeerID to TxInfo.SenderID
- unexpose MempoolReactor.Mempool

* move mempool mock into top-level mock package

* add a fixme

TxsFront should not be a part of the Mempool interface
because it leaks implementation details. Instead, we need to come up
with general interface for querying the mempool so the MempoolReactor
can fetch and broadcast txs to peers.

* change node#Mempool to return interface

* save commit = new reactor arch

* Revert "save commit = new reactor arch"

This reverts commit 1bfceacd9d65a720574683a7f22771e69af9af4d.

* require CListMempool in mempool.Reactor

* add two changelog entries

* fixes after my own review

* quote interfaces, structs and functions

* fixes after Ismail's review

* make node's mempool an interface

* make InitWAL/CloseWAL methods a part of Mempool interface

* fix merge conflicts

* make node's mempool an interface
2019-05-04 10:41:31 +04:00
8711af608f p2p: make persistent prop independent of conn direction (#3593)
## Description

Previously only outbound peers can be persistent.

Now, even if the peer is inbound, if it's marked as persistent, when/if conn is lost,
Tendermint will try to reconnect. This part is actually optional and can be reverted.

Plus, seed won't disconnect from inbound peer if it's marked as
persistent. Fixes #3362

## Commits

* make persistent prop independent of conn direction

Previously only outbound peers can be persistent. Now, even if the peer
is inbound, if it's marked as persistent, when/if conn is lost,
Tendermint will try to reconnect.

Plus, seed won't disconnect from inbound peer if it's marked as
persistent. Fixes #3362

* fix TestPEXReactorDialPeer test

* add a changelog entry

* update changelog

* add two tests

* reformat code

* test UnsafeDialPeers and UnsafeDialSeeds

* add TestSwitchDialPeersAsync

* spec: update p2p/config spec

* fixes after Ismail's review

* Apply suggestions from code review

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* fix merge conflict

* remove sleep from TestPEXReactorDoesNotDisconnectFromPersistentPeerInSeedMode

We don't need it actually.
2019-05-03 17:21:56 +04:00
9926ae768e abci/types: update comment (#3612)
Fixes #3607
2019-05-02 09:53:33 +02:00
5df6cf563a p2p: session should terminate on nonce wrapping (#3531) (#3609)
Refs #3531
2019-05-02 10:09:56 +04:00
2c26d95ab9 cs/replay: execCommitBlock should not read from state.lastValidators (#3067)
* execCommitBlock should not read from state.lastValidators

* fix height 1

* fix blockchain/reactor_test

* fix consensus/mempool_test

* fix consensus/reactor_test

* fix consensus/replay_test

* add CHANGELOG

* fix consensus/reactor_test

* fix consensus/replay_test

* add a test for replay validators change

* fix mem_pool test

* fix byzantine test

* remove a redundant code

* reduce validator change blocks to 6

* fix

* return peer0 config

* seperate testName

* seperate testName 1

* seperate testName 2

* seperate app db path

* seperate app db path 1

* add a lock before startNet

* move the lock to reactor_test

* simulate just once

* try to find problem

* handshake only saveState when app version changed

* update gometalinter to 3.0.0 (#3233)

in the attempt to fix https://circleci.com/gh/tendermint/tendermint/43165

also

    code is simplified by running gofmt -s .
    remove unused vars
    enable linters we're currently passing
    remove deprecated linters
(cherry picked from commit d470945503)

* gofmt code

* goimport code

* change the bool name to testValidatorsChange

* adjust receive kvstore.ProtocolVersion

* adjust receive kvstore.ProtocolVersion 1

* adjust receive kvstore.ProtocolVersion 3

* fix merge execution.go

* fix merge develop

* fix merge develop 1

* fix run cleanupFunc

* adjust code according to reviewers' opinion

* modify the func name match the convention

* simplify simulate a chain containing some validator change txs 1

* test CI error

* Merge remote-tracking branch 'upstream/develop' into fixReplay 1

* fix pubsub_test

* subscribeUnbuffered vote channel
2019-05-01 17:15:53 -04:00
a2a68df521 cli: add option to not clear address book with unsafe reset (#3606)
Fixes #3585
2019-05-01 10:01:41 +04:00
43348022d6 pex: various follow-ups (#3605)
* p2p: merge switch cases

also improve the error msg in privval

* pex: refactor code plus update specification

follow-up to https://github.com/tendermint/tendermint/pull/3603

* Update docs/spec/reactors/pex/pex.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>
2019-05-01 09:38:26 +04:00
40dbad9915 pex: dial seeds when address book needs more addresses (#3603)
If we are low on addresses for peering, we need to discover more peers. The
previous behavior would query existing peers; however, if an existing peer
does not participate in peer exchange, then our node will not discover more peers.

This change consults both existing peers as well as seeds when there is a deficit
in address book addresses. This allows for discovering peers though existing channels
as well as via seeds if existing peers do not share addresses.
2019-04-30 10:17:57 +04:00
2585187880 Merge pull request #3597 from tendermint/bucky/merge-master
Bucky/merge master
2019-04-26 19:14:54 -04:00
d76952c674 Merge branch 'master' into bucky/merge-master 2019-04-26 17:49:28 -04:00
7b162f5c54 node: refactor node.NewNode (#3456)
The node.NewNode method is pretty complex at the moment, an in order to address issues like #3156, we need to simplify the interface for partial node instantiation. In some places, we don't need to build up a full node (like in the node.TestCreateProposalBlock test), but the complexity of such partial instantiation needs to be reduced.

This PR aims to eventually make this easier/simpler.

See also this gist https://gist.github.com/thanethomson/56e1640d057a26186e38ad678a1d114c for some background work done when starting to refactor here.

## Commits:

* [WIP] Refactor node.NewNode to simplify

The `node.NewNode` method is pretty complex at the moment, an in order
to address issues like #3156, we need to simplify the interface for
partial node instantiation. In some places, we don't need to build up a
full node (like in the `node.TestCreateProposalBlock` test), but the
complexity of such partial instantiation needs to be reduced.

This PR aims to eventually make this easier/simpler.

* Refactor state loading and genesis doc provider into state package

* Refactor for clarity of return parameters

* Fix incorrect capitalization of error messages

* Simplify extracted functions' names

* Document optionally-prefixed functions

* Refactor optionallyFastSync for clarity of separation of concerns

* Restructure function for early return

* Restructure function for early return

* Remove dependence on deprecated panic functions

* refactor code a bit more

plus, expose PEXReactor on node

* align logger names

* add a changelog entry

* align logger names 2

* add a note about PEXReactor returning nil
2019-04-26 16:05:39 +04:00
70592cc4d8 libs/common: remove deprecated PanicXXX functions (#3595)
* Remove deprecated PanicXXX functions from codebase

As per discussion over
[here](https://github.com/tendermint/tendermint/pull/3456#discussion_r278423492),
we need to remove these `PanicXXX` functions and eliminate our
dependence on them. In this PR, each and every `PanicXXX` function call
is replaced with a simple `panic` call.

* add a changelog entry
2019-04-26 14:23:43 +04:00
90997ab1b5 docs: update contributing.md (#3503)
Minor updates to reflect squash merging and how to prepare releases
2019-04-23 13:34:14 +04:00
b738add80c cs: fix nondeterministic tests (#3582)
Should fix #3451, #2723 and #3317.

Test TestResetTimeoutPrecommitUponNewHeight is simplified so it reduces a risk of timeout failure. Furthermore, timeout we wait for TimeoutEvents is increased, and the timeout value is more precisely computed. This should hopefully decrease a chance of non-deterministic test failures.

This assertion is problematic to ensure consistently due to dependency on scheduler. On the other hand, if I am not wrong, order in which messages are read from the channel respects order in which messages are written. Therefore, process will receive 2f+1 precommits that are not all for v (one is for nil) so TriggeredTimeoutPrecommit would be set to true. So we don't need to assert it. I know that it would be better to still assert to it but I don't know how to do it without sleep and that is ugly and is causing us nondeterministic failures.
2019-04-23 13:19:16 +04:00
968e955c46 testnet cmd: add config option (#3559)
Option to explicitly provide the -config in the testnet command, closing #3160.
2019-04-23 12:52:46 +04:00
ebf815ee57 cs/replay: check appHash for each block (#3579)
* check every block appHash

Fixes #3460

Not really needed, but it would detect if the app changed in a way it
shouldn't have.

* add a changelog entry

* no need to return an error if we panic

* rename methods

* rename methods once again

* add a test

* correct error msg

plus fix a few go-lint warnings

* better panic msg
2019-04-23 12:22:40 +04:00
8db7e74b87 privval: increase timeout to mitigate non-deterministic test failure (#3580)
This should fix #3576 (ran it many times locally but only time will tell). The test actually only checked for the opcode of the error. From the name of the test we actually want to test if we see a timeout after a pre-defined time.

## Commits:

* increase readWrite timeout as it is also used in the `Accept` of the tcp
listener:

 - before this caused the readWriteTimeout to kick in (rarely) while Accept
 - as a side-effect: remove obsolete time.Sleep: in both listener cases
 the Accept will only return after successfully accepting and the timeout
 that is supposed to be tested here will be triggered because there is a
 read without a write
 - see if we actually run into a timeout error (the whole purpose of
 this test AFAIU)

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* makee local test-vars `const`

Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>

## Additional comments:

@xla: Confusing how an accept could take longer than that, but assuming a noisy environment full of little docker whales will be slower than what 50 years of silicon are capable of. The only thing I'd be vary of is that we mask structural issues with the code by just bumping the timeout, if we are sensitive towards that it warrants invesigation, but again this might only be true in the environment our CI runs in.
2019-04-22 12:04:04 +04:00
4253e67c07 Merge pull request #3571 from tendermint/v0.31
V0.31.5
2019-04-19 07:46:11 -04:00
671c5c9b84 crypto: Proof of Concept for iterative version of SimpleHashFromByteSlices (#2611) (#3530)
(#2611) had suggested that an iterative version of
SimpleHashFromByteSlice would be faster, presumably because
 we can envision some overhead accumulating from stack
frames and function calls. Additionally, a recursive algorithm risks
hitting the stack limit and causing a stack overflow should the tree
be too large.

Provided here is an iterative alternative, a simple test to assert
correctness and a benchmark. On the performance side, there appears to
be no overall difference:

```
BenchmarkSimpleHashAlternatives/recursive-4                20000 77677 ns/op
BenchmarkSimpleHashAlternatives/iterative-4                20000 76802 ns/op
```

On the surface it might seem that the additional overhead is due to
the different allocation patterns of the implementations. The recursive
version uses a single `[][]byte` slices which it then re-slices at each level of the tree.
The iterative version reproduces `[][]byte` once within the function and
then rewrites sub-slices of that array at each level of the tree.

Eexperimenting by modifying the code to simply calculate the
hash and not store the result show little to no difference in performance.

These preliminary results suggest:
1. The performance of the current implementation is pretty good
2. Go has low overhead for recursive functions
3. The performance of the SimpleHashFromByteSlice routine is dominated
by the actual hashing of data

Although this work is in no way exhaustive, point #3 suggests that
optimizations of this routine would need to take an alternative
approach to make significant improvements on the current performance.

Finally, considering that the recursive implementation is easier to
read, it might not be worthwhile to switch to a less intuitive
implementation for so little benefit.

* re-add slice re-writing
* [crypto] Document SimpleHashFromByteSlicesIterative
2019-04-18 17:31:36 +02:00
f2aa1bf50e bandaid for non-deterministic clist test (#3575)
* add a deterministic timeout

Co-Authored-By: kevlubkcm <36485490+kevlubkcm@users.noreply.github.com>
2019-04-17 18:14:01 +02:00
90465f727f rpc: add support for batched requests/responses (#3534)
Continues from #3280 in building support for batched requests/responses in the JSON RPC (as per issue #3213).

* Add JSON RPC batching for client and server

As per #3213, this adds support for [JSON RPC batch requests and
responses](https://www.jsonrpc.org/specification#batch).

* Add additional checks to ensure client responses are the same as results

* Fix case where a notification is sent and no response is expected

* Add test to check that JSON RPC notifications in a batch are left out in responses

* Update CHANGELOG_PENDING.md

* Update PR number now that PR has been created

* Make errors start with lowercase letter

* Refactor batch functionality to be standalone

This refactors the batching functionality to rather act in a standalone
way. In light of supporting concurrent goroutines making use of the same
client, it would make sense to have batching functionality where one
could create a batch of requests per goroutine and send that batch
without interfering with a batch from another goroutine.

* Add examples for simple and batch HTTP client usage

* Check errors from writer and remove nolinter directives

* Make error strings start with lowercase letter

* Refactor examples to make them testable

* Use safer deferred shutdown for example Tendermint test node

* Recompose rpcClient interface from pre-existing interface components

* Rename WaitGroup for brevity

* Replace empty ID string with request ID

* Remove extraneous test case

* Convert first letter of errors.Wrap() messages to lowercase

* Remove extraneous function parameter

* Make variable declaration terse

* Reorder WaitGroup.Done call to help prevent race conditions in the face of failure

* Swap mutex to value representation and remove initialization

* Restore empty JSONRPC string ID in response to prevent nil

* Make JSONRPCBufferedRequest private

* Revert PR hard link in CHANGELOG_PENDING

* Add client ID for JSONRPCClient

This adds code to automatically generate a randomized client ID for the
JSONRPCClient, and adds a check of the IDs in the responses (if one was
set in the requests).

* Extract response ID validation into separate function

* Remove extraneous comments

* Reorder fields to indicate clearly which are protected by the mutex

* Refactor for loop to remove indexing

* Restructure and combine loop

* Flatten conditional block for better readability

* Make multi-variable declaration slightly more readable

* Change for loop style

* Compress error check statements

* Make function description more generic to show that we support different protocols

* Preallocate memory for request and result objects
2019-04-17 19:10:12 +04:00
621c0e629d docs: fix typo in clist readme (#3574) 2019-04-17 19:09:17 +04:00
c0e8fb5085 p2p: (seed mode) limit the number of attempts to connect to a peer (#3573)
* use dialPeer function in a seed mode

Fixes #3532

by storing a number of attempts we've tried to connect in-memory and
removing the address from addrbook when number of attempts > 16
2019-04-17 16:44:26 +04:00
d2eab536ac Merge pull request #3568 from tendermint/anton/release-v0.31.5
v0.31.5 changelog and version updates
2019-04-16 16:51:18 -04:00
18bd5b627a Apply suggestions from code review
Co-Authored-By: melekes <anton.kalyaev@gmail.com>
2019-04-16 15:13:30 +04:00
4474a5ec70 bump version 2019-04-16 13:38:54 +04:00
3cb7013c38 update changelog 2019-04-16 13:38:54 +04:00
5b8888b01b common: CMap: slight optimization in Keys() and Values(). (#3567) 2019-04-16 12:04:08 +04:00
439312b9c0 blockchain: dismiss request channel delay (#3459)
Fixes #3457

The topic of the issue is that : write a BlockRequest int requestsCh channel will create an timer at the same time that stop the peer 15s later if no block have been received . But pop a BlockRequest from requestsCh and send it out may delay more than 15s later. So that the peer will be stopped for error("send nothing to us").
Extracting requestsCh into its own goroutine can make sure that every BlockRequest been handled timely.

Instead of the requestsCh handling, we should probably pull the didProcessCh handling in a separate go routine since this is the one "starving" the other channel handlers. I believe the way it is right now, we still have issues with high delays in errorsCh handling that might cause sending requests to invalid/ disconnected peers.
2019-04-16 11:54:19 +04:00
f1cf10150a gitignore: add .vendor-new (#3566) 2019-04-16 08:49:03 +04:00
50b87c3445 state: Use last height changed if validator set is empty (#3560)
What happened:

New code was supposed to fall back to last height changed when/if it
failed to find validators at checkpoint height (to make release
non-breaking).

But because we did not check if validator set is empty, the fall back
logic was never executed => resulting in LoadValidators returning an
empty validator set for cases where `lastStoredHeight` is checkpoint
height (i.e. almost all heights if the application does not change
validator set often).

How it was found:

one of our users - @sunboshan reported a bug here
https://github.com/tendermint/tendermint/pull/3537#issuecomment-482711833

* use last height changed in validator set is empty
* add a changelog entry
2019-04-15 16:53:38 +02:00
f2119c35de adr: PeerBehaviour updates (#3558)
* [adr] Peer behaviour adr updates
* [docs] fix Behaved function signature
* [adr] typo fix in code example
2019-04-15 16:38:45 +02:00
d35c08724c Merge pull request #3563 from tendermint/master
Merge master to develop
2019-04-15 08:16:37 -04:00
1c6d9d20e4 Merge pull request #3553 from tendermint/v0.31
V0.31
2019-04-15 08:16:00 -04:00
4695414393 Merge pull request #3548 from tendermint/release/v0.31.4
Release/v0.31.4
2019-04-12 10:56:03 -04:00
def5c8cf12 address review comments: (#3550)
- mention ADR in release summary
 - remove [p2p] api changes
 - amend v0.31.3 log to contain note about breaking change
2019-04-12 10:48:34 -04:00
b6da8880c2 prepare v0.31.4 release:
- prep changelog
 - add missing changelog entries
 - fix minor glitch in existing changelog (v0.31.2)
 - bump versions
2019-04-12 14:24:51 +02:00
a453628c4e Fix a couple of typos (#3547)
Fix some typos in p2p/transport.go
2019-04-12 13:25:14 +02:00
4e4224213f adr: Peer Behaviour (#3539)
* [adr] ADR 037: Peer Behaviour inital draft
* Update docs/architecture/adr-037-peer-behaviour.md

Co-Authored-By: brapse <brapse@gmail.com>

* Update docs/architecture/adr-037-peer-behaviour.md
Co-Authored-By: brapse <brapse@gmail.com>

* [docs] adr-037 Better footnote styling
* [ADR] ADR-037 adjust Footnotes for github markdown
* [ADR] ADR-037 fix numbered list
2019-04-12 12:32:00 +02:00
b5b3b85697 Bring back NodeInfo NetAddress form the dead (#3545)
A prior change to address accidental DNS lookups introduced the
SocketAddr on peer, which was then used to add it to the addressbook.
Which in turn swallowed the self reported port of the peer, which is
important on a reconnect. This change revives the NetAddress on NodeInfo
which the Peer carries, but now returns an error to avoid nil
dereferencing another issue observed in the past. Additionally we could
potentially address #3532, yet the original problem statemenf of that
issue stands.

As a drive-by optimisation `MarkAsGood` now takes only a `p2p.ID` which
makes it interface a bit stricter and leaner.
2019-04-12 12:31:02 +02:00
18d2c45c33 rpc: Fix response time grow over time (#3537)
* rpc: store validator info periodly

* increase ValidatorSetStoreInterval

also

- unexpose it
- add a comment
- refactor code
- add a benchmark, which shows that 100000 results in ~ 100ms to get 100
validators

* make the change non-breaking

* expand comment

* rename valSetStoreInterval to valSetCheckpointInterval

* change the panic msg

* add a test and changelog entry

* update changelog entry

* update changelog entry

* add a link to PR

* fix test

* Update CHANGELOG_PENDING.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* update comment

* use MaxInt64 func
2019-04-12 10:46:07 +02:00
c3df21fe82 add missing changelog entry (#3544)
* add missing changelog entry
2019-04-11 17:59:14 +02:00
bcec8be035 p2p: do not log err if peer is private (#3474)
* add actionable advice for ErrAddrBookNonRoutable err

Should replace https://github.com/tendermint/tendermint/pull/3463

* reorder checks in addrbook#addAddress so

ErrAddrBookPrivate is returned first

and do not log error in DialPeersAsync if the address is private
because it's not an error
2019-04-11 15:32:16 +02:00
9a415b0572 docs: abci#Commit: better explain the possible deadlock (#3536) 2019-04-09 18:21:35 +02:00
40da355234 docs: fix block.Header.Time description (#3529)
It's not proposer local time anymore, but a weighted median

Fixes #3514
2019-04-03 14:56:51 +02:00
f965a4db15 p2p: seed mode refactoring (#3011)
ListOfKnownAddresses is removed
panic if addrbook size is less than zero
CrawlPeers does not attempt to connect to existing or peers we're currently dialing
various perf. fixes
improved tests (though not complete)
move IsDialingOrExistingAddress check into DialPeerWithAddress (Fixes #2716)


* addrbook: preallocate memory when saving addrbook to file

* addrbook: remove oldestFirst struct and check for ID

* oldestFirst replaced with sort.Slice
* ID is now mandatory, so no need to check

* addrbook: remove ListOfKnownAddresses

GetSelection is used instead in seed mode.

* addrbook: panic if size is less than 0

* rewrite addrbook#saveToFile to not use a counter

* test AttemptDisconnects func

* move IsDialingOrExistingAddress check into DialPeerWithAddress

* save and cleanup crawl peer data

* get rid of DefaultSeedDisconnectWaitPeriod

* make linter happy

* fix TestPEXReactorSeedMode

* fix comment

* add a changelog entry

* Apply suggestions from code review

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* rename ErrDialingOrExistingAddress to ErrCurrentlyDialingOrExistingAddress

* lowercase errors

* do not persist seed data

pros:
- no extra files
- less IO

cons:
- if the node crashes, seed might crawl a peer too soon

* fixes after Ethan's review

* add a changelog entry

* we should only consult Switch about peers

checking addrbook size does not make sense since only PEX reactor uses
it for dialing peers!

https://github.com/tendermint/tendermint/pull/3011#discussion_r270948875
2019-04-03 11:22:52 +02:00
75ffa2bf1c Merge pull request #3528 from tendermint/v0.31
Merge v0.31.3 to master
2019-04-02 19:18:57 -04:00
086d6cbe8c Merge pull request #3527 from tendermint/v0.31
Merge V0.31.3 back to develop
2019-04-02 16:49:44 -04:00
6cc3f4d87c Merge pull request #3525 from tendermint/release/v0.31.3
Release/v0.31.3
2019-04-02 16:45:04 -04:00
3cfd9757a7 changelog and version v0.31.3 2019-04-02 09:14:33 -04:00
882622ec10 Fixes tendermint/tendermint#3522
* OriginalAddr -> SocketAddr

OriginalAddr records the originally dialed address for outbound peers,
rather than the peer's self reported address. For inbound peers, it was
nil. Here, we rename it to SocketAddr and for inbound peers, set it to
the RemoteAddr of the connection.

* use SocketAddr

Numerous places in the code call peer.NodeInfo().NetAddress().
However, this call to NetAddress() may perform a DNS lookup if the
reported NodeInfo.ListenAddr includes a name. Failure of this lookup
returns a nil address, which can lead to panics in the code.

Instead, call peer.SocketAddr() to return the static address of the
connection.

* remove nodeInfo.NetAddress()

Expose `transport.NetAddress()`, a static result determined
when the transport is created. Removing NetAddress() from the nodeInfo
prevents accidental DNS lookups.

* fixes from review

* linter

* fixes from review
2019-04-01 19:59:57 -04:00
1ecf814838 Fixes tendermint/tendermint#3439
* make sure we create valid private keys:

 - genPrivKey samples and rejects invalid fieldelems (like libsecp256k1)
 - GenPrivKeySecp256k1 uses `(sha(secret) mod (n − 1)) + 1`
 - fix typo, rename test file: s/secpk256k1/secp256k1/

* Update crypto/secp256k1/secp256k1.go
2019-04-01 19:45:57 -04:00
e4a03f249d Release message changelog link fix (#3519) 2019-04-01 14:18:18 -04:00
56d8aa42b3 Merge pull request #3520 from tendermint/v0.31
Merge v0.31.2 release back to develop
2019-04-01 14:17:58 -04:00
79e9f20578 Merge pull request #3518 from tendermint/prepare-release-v0.31.2
Release v0.31.2
2019-04-01 17:58:28 +02:00
ab24925c94 prepare changelog and bump versions to v0.31.2 2019-04-01 17:49:34 +02:00
0ae41cc663 Fix for wrong version tag (#3517)
* Fix for wrong version tag (tag on the release branch instead of master)
2019-04-01 17:47:00 +02:00
422d04c8ba Bucky/mempool txsmap (#3512)
* mempool: resCb -> globalCb

* reqResCb takes an externalCb

* failing test for #3509

* txsMap is sync.Map

* update changelog
2019-03-31 13:14:18 +02:00
2233dd45bd libs: remove useless code in group (#3504)
* lib: remove useless code in group
* update change log
* Update CHANGELOG_PENDING.md

Co-Authored-By: guagualvcha <baifudong@lancai.cn>
2019-03-29 18:47:53 +01:00
9199f3f613 Release management using CircleCI (#3498)
* Release management using CircleCI

* Changelog updated
2019-03-29 12:57:16 +01:00
6c1a4b5137 blockchain: comment out logger in test code that causes a race condition (#3500) 2019-03-28 17:39:09 +01:00
c7bb998497 Merge pull request #3502 from tendermint/bucky/merge-master
Bucky/merge master
2019-03-28 08:07:59 -04:00
7b72436c75 Merge branch 'master' into bucky/merge-master 2019-03-28 08:12:05 -04:00
a0234affb6 Merge pull request #3489 from tendermint/release/v0.31.1
Release/v0.31.1
2019-03-28 07:57:42 -04:00
9390a810eb minor changelog updates (#3499) 2019-03-27 21:03:28 -04:00
a49d80b89c catch up with develop and rebase on current release to include #3482 2019-03-27 23:14:57 +01:00
ccfe75ec4a docs: Fix broken links (#3482) (#3488)
* docs: fix broken links (#3482)

A bunch of links were broken in the documentation s they included the
`docs` prefix.

* Update CHANGELOG_PENDING

* docs: switch to relative links for github compatitibility (#3482)
2019-03-27 23:14:57 +01:00
d586945d69 docs: Fix broken links (#3482) (#3488)
* docs: fix broken links (#3482)

A bunch of links were broken in the documentation s they included the
`docs` prefix.

* Update CHANGELOG_PENDING

* docs: switch to relative links for github compatitibility (#3482)
2019-03-27 18:51:57 +01:00
ae88965ff6 changelog: add summary & fix link & add external contributor (#3490) 2019-03-27 17:46:29 +01:00
2338134836 bump versions 2019-03-27 16:52:19 +01:00
1b33a50e6d Merge remote-tracking branch 'remotes/origin/develop' into release/v0.31.1 2019-03-27 16:50:59 +01:00
3c7bb6b571 Add some numbers for #2778 2019-03-27 16:50:42 +01:00
5fa540bdc9 mempool: add a safety check, write tests for mempoolIDs (#3487)
* mempool: add a safety check, write tests for mempoolIDs

and document 65536 limit in the mempool reactor spec

follow-up to https://github.com/tendermint/tendermint/pull/2778

* rename the test

* fixes after Ismail's review
2019-03-27 16:45:34 +01:00
52727863e1 add external contributors 2019-03-27 16:07:03 +01:00
e3f840e6a6 reset CHANGELOG_PENDING.md 2019-03-27 16:04:43 +01:00
ed63e1f378 Add more entries to the Changelog, fix formatting, linkify 2019-03-27 16:03:25 +01:00
55b7118c98 Prep changelog: copy from pending & update version 2019-03-27 15:35:32 +01:00
5a25b75b1d p2p: refactor GetSelectionWithBias for addressbook (#3475)
Why submit this pr:

    we have suffered from infinite loop in addrbook bug which takes us a long time to find out why process become a zombie peer. It have been fixed in #3232. But the ADDRS_LOOP is still there, risk of infinite loop is still exist.
    The algorithm that to random pick a bucket is not stable, which means the peer may unluckily always choose the wrong bucket for a long time, the time and cpu cost is meaningless.

A simple improvement:
shuffle bucketsNew and bucketsOld, and pick necessary number of address from them. A stable
algorithm.
2019-03-26 17:13:14 +01:00
a4d9539544 rpc/client: include NetworkClient interface into Client interface (#3473)
I think it's nice when the Client interface has all the methods. If someone does not need a particular method/set of methods, she can use individual interfaces (e.g. NetworkClient, MempoolClient) or write her own interface.

technically breaking

Fixes #3458
2019-03-26 09:44:49 +01:00
1bb8e02a96 mempool: fix broadcastTxRoutine leak (#3478)
Refs #3306, irisnet@fdbb676

I ran an irishub validator. After the validator node ran several days, I dump the whole goroutine stack. I found that there were hundreds of broadcastTxRoutine. However, the connected peer quantity was less than 30. So I belive that there must be broadcastTxRoutine leakage issue.

According to my analysis, I think the root cause of this issue locate in below code:

		select {
		case <-next.NextWaitChan():
			// see the start of the for loop for nil check
			next = next.Next()
		case <-peer.Quit():
			return
		case <-memR.Quit():
			return
		}

As we know, if multiple paths are avaliable in the same time, then a random path will be selected. Suppose that next.NextWaitChan() and peer.Quit() are both avaliable, and next.NextWaitChan() is chosen.

                // send memTx
		msg := &TxMessage{Tx: memTx.tx}
		success := peer.Send(MempoolChannel, cdc.MustMarshalBinaryBare(msg))
		if !success {
			time.Sleep(peerCatchupSleepIntervalMS * time.Millisecond)
			continue
		}

Then next will be non-empty and the peer send operation won't be success. As a result, this go routine will be track into infinite loop and won't be released.

My proposal is to check peer.Quit() and memR.Quit() in every loop no matter whether next is nil.
2019-03-26 09:29:06 +01:00
6de7effb05 mempool no gossip back (#2778)
Closes #1798

This is done by making every mempool tx maintain a list of peers who its received the tx from. Instead of using the 20byte peer ID, it instead uses a local map from peerID to uint16 counter, so every peer adds 2 bytes. (Word aligned to probably make it 8 bytes)

This also required resetting the callback function on every CheckTx. This likely has performance ramifications for instruction caching. The actual setting operation isn't costly with the removal of defers in this PR.

* Make the mempool not gossip txs back to peers its received it from

* Fix adversarial memleak

* Don't break interface

* Update changelog

* Forgot to add a mtx

* forgot a mutex

* Update mempool/reactor.go

Co-Authored-By: ValarDragon <ValarDragon@users.noreply.github.com>

* Update mempool/mempool.go

Co-Authored-By: ValarDragon <ValarDragon@users.noreply.github.com>

* Use unknown peer ID

Co-Authored-By: ValarDragon <ValarDragon@users.noreply.github.com>

* fix compilation

* use next wait chan logic when skipping

* Minor fixes

* Add TxInfo

* Add reverse map

* Make activeID's auto-reserve 0

* 0 -> UnknownPeerID

Co-Authored-By: ValarDragon <ValarDragon@users.noreply.github.com>

* Switch to making the normal case set a callback on the reqres object

The recheck case is still done via the global callback, and stats
are also set via global callback

* fix merge conflict

* Addres comments

* Add cache tests

* add cache tests

* minor fixes

* update metrics in reqResCb and reformat code

* goimport -w mempool/reactor.go

* mempool: update memTx senders

I had to introduce txsMap for quick mempoolTx lookups.

* change senders type from []uint16 to sync.Map

Fixes DATA RACE:

```
Read at 0x00c0013fcd3a by goroutine 183:
  github.com/tendermint/tendermint/mempool.(*MempoolReactor).broadcastTxRoutine()
      /go/src/github.com/tendermint/tendermint/mempool/reactor.go:195 +0x3c7

Previous write at 0x00c0013fcd3a by D[2019-02-27|10:10:49.058] Read PacketMsg                               switch=3 peer=35bc1e3558c182927b31987eeff3feb3d58a0fc5@127.0.0.1
:46552 conn=MConn{pipe} packet="PacketMsg{30:2B06579D0A143EB78F3D3299DE8213A51D4E11FB05ACE4D6A14F T:1}"
goroutine 190:
  github.com/tendermint/tendermint/mempool.(*Mempool).CheckTxWithInfo()
      /go/src/github.com/tendermint/tendermint/mempool/mempool.go:387 +0xdc1
  github.com/tendermint/tendermint/mempool.(*MempoolReactor).Receive()
      /go/src/github.com/tendermint/tendermint/mempool/reactor.go:134 +0xb04
  github.com/tendermint/tendermint/p2p.createMConnection.func1()
      /go/src/github.com/tendermint/tendermint/p2p/peer.go:374 +0x25b
  github.com/tendermint/tendermint/p2p/conn.(*MConnection).recvRoutine()
      /go/src/github.com/tendermint/tendermint/p2p/conn/connection.go:599 +0xcce

Goroutine 183 (running) created at:
D[2019-02-27|10:10:49.058] Send                                         switch=2 peer=1efafad5443abeea4b7a8155218e4369525d987e@127.0.0.1:46193 channel=48 conn=MConn{pipe} m
sgBytes=2B06579D0A146194480ADAE00C2836ED7125FEE65C1D9DD51049
  github.com/tendermint/tendermint/mempool.(*MempoolReactor).AddPeer()
      /go/src/github.com/tendermint/tendermint/mempool/reactor.go:105 +0x1b1
  github.com/tendermint/tendermint/p2p.(*Switch).startInitPeer()
      /go/src/github.com/tendermint/tendermint/p2p/switch.go:683 +0x13b
  github.com/tendermint/tendermint/p2p.(*Switch).addPeer()
      /go/src/github.com/tendermint/tendermint/p2p/switch.go:650 +0x585
  github.com/tendermint/tendermint/p2p.(*Switch).addPeerWithConnection()
      /go/src/github.com/tendermint/tendermint/p2p/test_util.go:145 +0x939
  github.com/tendermint/tendermint/p2p.Connect2Switches.func2()
      /go/src/github.com/tendermint/tendermint/p2p/test_util.go:109 +0x50

I[2019-02-27|10:10:49.058] Added good transaction                       validator=0 tx=43B4D1F0F03460BD262835C4AA560DB860CFBBE85BD02386D83DAC38C67B3AD7 res="&{CheckTx:gas_w
anted:1 }" height=0 total=375
Goroutine 190 (running) created at:
  github.com/tendermint/tendermint/p2p/conn.(*MConnection).OnStart()
      /go/src/github.com/tendermint/tendermint/p2p/conn/connection.go:210 +0x313
  github.com/tendermint/tendermint/libs/common.(*BaseService).Start()
      /go/src/github.com/tendermint/tendermint/libs/common/service.go:139 +0x4df
  github.com/tendermint/tendermint/p2p.(*peer).OnStart()
      /go/src/github.com/tendermint/tendermint/p2p/peer.go:179 +0x56
  github.com/tendermint/tendermint/libs/common.(*BaseService).Start()
      /go/src/github.com/tendermint/tendermint/libs/common/service.go:139 +0x4df
  github.com/tendermint/tendermint/p2p.(*peer).Start()
      <autogenerated>:1 +0x43
  github.com/tendermint/tendermint/p2p.(*Switch).startInitPeer()
```

* explain the choice of a map DS for senders

* extract ids pool/mapper to a separate struct

* fix literal copies lock value from senders: sync.Map contains sync.Mutex

* use sync.Map#LoadOrStore instead of Load

* fixes after Ismail's review

* rename resCbNormal to resCbFirstTime
2019-03-26 09:27:29 +01:00
25a3c8b172 rpc: support tls rpc (#3469)
Refs #3419
2019-03-23 18:08:15 +01:00
85be2a554e tools/tm-signer-harness: update height and round for test harness (#3466)
In order to re-enable the test harness for the KMS (see
tendermint/kms#227), we need some marginally more realistic proposals
and votes. This is because the KMS does some additional sanity checks
now to ensure the height and round are increasing over time.
2019-03-22 14:16:38 +01:00
1d4afb179b replace PB2TM.ConsensusParams with a call to params#Update (#3448)
Fixes #3444
2019-03-21 11:05:39 +01:00
660bd4a53e fix comment (#3454) 2019-03-20 08:30:49 -04:00
81b9bdf400 comments on validator ordering (#3452)
* comments on validator ordering

* NextValidatorsHash
2019-03-20 08:29:40 -04:00
926127c774 blockchain: update the maxHeight when a peer is removed (#3350)
* blockchain: update the maxHeight when a peer is removed

Refs #2699

* add a changelog entry

* make linter pass
2019-03-19 20:59:33 -04:00
03085c2da2 rpc: client disable compression (#3430) 2019-03-19 20:18:18 -04:00
7af4b5086a Remove RepeatTimer and refactor Switch#Broadcast (#3429)
* p2p: refactor Switch#Broadcast func

- call wg.Add only once
- do not call peers.List twice!
  * bad for perfomance
  * peers list can change in between calls!

Refs #3306

* p2p: use time.Ticker instead of RepeatTimer

no need in RepeatTimer since we don't Reset them

Refs #3306

* libs/common: remove RepeatTimer (also TimerMaker and Ticker interface)

"ancient code that’s caused no end of trouble" Ethan

I believe there's much simplier way to write a ticker than can be reset
https://medium.com/@arpith/resetting-a-ticker-in-go-63858a2c17ec
2019-03-19 20:10:54 -04:00
60b2ae5f5a crypto: delete unused code (#3426) 2019-03-19 20:00:53 -04:00
a6349f5063 Formalize proposer election algorithm properties (#3140)
* Update proposer-selection.md

* Fixed typos

* fixed typos

* Attempt to address some comments

* Update proposer-selection.md

* Update proposer-selection.md

* Update proposer-selection.md

Added the normalization step.

* Addressed review comments

* New example for normalization section

Added a new example to better show the need for normalization
Added requirement for changing validator set
Addressed review comments

* Fixed problem with R2

* fixed the math for new validator

* test

* more small updates

* Moved the centering above the round-robin election

- the centering is now done before the actual round-robin block
- updated examples
- cleanup

* change to reflect new implementation for new validator
2019-03-19 19:56:13 -04:00
22bcfca87a Merge pull request #3450 from tendermint/master
Merge master back to develop
2019-03-19 19:54:09 -04:00
0d985ede28 Merge pull request #3417 from tendermint/release/v0.31.0
Release/v0.31.0
2019-03-19 19:53:37 -04:00
1e3469789d Ensure WriteTimeout > TimeoutBroadcastTxCommit (#3443)
* Make sure config.TimeoutBroadcastTxCommit < rpcserver.WriteTimeout()

* remove redundant comment

* libs/rpc/http_server: move Read/WriteTimeout into Config

* increase defaults for read/write timeouts

Based on this article
https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration

* WriteTimeout should be larger than TimeoutBroadcastTxCommit

* set a deadline for subscribing to txs

* extract duration into const

* add two changelog entries

* Update CHANGELOG_PENDING.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* Update CHANGELOG_PENDING.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* 12 -> 10

* changelog

* changelog
2019-03-19 19:45:51 -04:00
5f68fbae37 Merge pull request #3449 from tendermint/ismail/merge_develop_into_release/0.31.0
Merge develop into release/0.31.0
2019-03-19 19:25:26 -04:00
e276f35f86 remove 3421 from changelog 2019-03-19 14:36:42 +01:00
8e62a3d62a Add #3421 to changelog and reorder alphabetically 2019-03-19 12:19:02 +01:00
48aaccab8f Merge in develop and update CHANGELOG.md 2019-03-19 12:09:26 +01:00
4162ebe8b5 types: refactor PB2TM.ConsensusParams to take BlockTimeIota as an arg (#3442)
See https://github.com/tendermint/tendermint/pull/3403/files#r266208947

In #3403 we unexposed BlockTimeIota from the ABCI, but it's still part
of the ConsensusParams struct, so we have to remember to add it back
after calling PB2TM.ConsensusParams. Instead, PB2TM.ConsensusParams
should take it as an argument

Fixes #3432
2019-03-19 11:38:32 +04:00
551b6322f5 Update v0.31.0 release notes (#3434)
* changelog: fix formatting

* update release notes

* update changelog

* linkify

* update UPGRADING
2019-03-16 19:24:12 -04:00
52c4e15eb2 changelog: more review fixes/release/v0.31.0 (#3427)
* Update release summary

* Add pubsub config changes

* Add link to issue for pubsub changes
2019-03-14 19:07:06 +04:00
5483ac6b0a minor changes / fixes to release 0.31.0 (#3422)
* bump ABCIVersion due to renaming BlockSizeParams -> BlockParams
(https://github.com/tendermint/tendermint/pull/3417#discussion_r264974791)

* Move changelog on consensus params entry to breaking

* Add @melekes' suggestion for breaking change in pubsub into upgrading.md

* Add changelog entry for #3351

* Add changelog entry for #3358 & #3359

* Add changelog entry for #3397

* remove changelog entry for #3397 (was already released in 0.30.2)

* move 3351 to improvements

* Update changelog comment
2019-03-14 15:17:49 +04:00
7457133307 grpcdb: close Iterator/ReverseIterator after use (#3424)
Fixes #3402
2019-03-14 15:00:58 +04:00
a59930a327 localnet: fix $LOG variable (#3423)
Fixes #3421

Before: it was creating a file named ${LOG:-tendermint.log} in .build/nodeX
After: it creates a file named tendermint.log
2019-03-13 16:09:05 +04:00
85c023db88 Prep release v0.31.0:
- update changelog, reset pending
 - bump versions
 - add external contributors (partly manually)
2019-03-12 20:07:26 +01:00
4cbd36f341 Merge pull request #3415 from tendermint/master
Merge master back to develop (do not squash)
2019-03-12 21:22:03 +04:00
e42f833fd4 Merge master back to develop (#3412)
* libs/db: close batch (#3397)

ClevelDB requires closing when WriteBatch is no longer needed, https://godoc.org/github.com/jmhodges/levigo#WriteBatch.Close

Fixes the memory leak in https://github.com/cosmos/cosmos-sdk/issues/3842

* update changelog and bump version to 0.30.2
2019-03-12 16:20:59 +04:00
ad3e990c6a fix GO_VERSION in installation scripts (#3411)
there is no such file https://storage.googleapis.com/golang/go1.12.0.linux-amd64.tar.gz

Fixes #3405
2019-03-11 23:59:00 +04:00
676212fa8f cmd: make sure to have 'testnet' create the data directory for nonvals (#3409)
Fixes #3408
2019-03-11 23:06:03 +04:00
3035572034 cs: comment out log.Error to avoid TestReactorValidatorSetChanges timing out (#3401) 2019-03-11 22:52:09 +04:00
d741c7b478 limit number of /subscribe clients and queries per client (#3269)
* limit number of /subscribe clients and queries per client

Add the following config variables (under [rpc] section):
  * max_subscription_clients
  * max_subscriptions_per_client
  * timeout_broadcast_tx_commit

Fixes #2826

new HTTPClient interface for subscriptions

finalize HTTPClient events interface

remove EventSubscriber

fix data race

```
WARNING: DATA RACE
Read at 0x00c000a36060 by goroutine 129:
  github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe.func1()
      /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:168 +0x1f0

Previous write at 0x00c000a36060 by goroutine 132:
  github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe()
      /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:191 +0x4e0
  github.com/tendermint/tendermint/rpc/client.WaitForOneEvent()
      /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178
  github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1()
      /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162

Goroutine 129 (running) created at:
  github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe()
      /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:164 +0x4b7
  github.com/tendermint/tendermint/rpc/client.WaitForOneEvent()
      /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178
  github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1()
      /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162

Goroutine 132 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:878 +0x659
  github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync()
      /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:119 +0x186
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162
==================
```

lite client works (tested manually)

godoc comments

httpclient: do not close the out channel

use TimeoutBroadcastTxCommit

no timeout for unsubscribe

but 1s Local (5s HTTP) timeout for resubscribe

format code

change Subscribe#out cap to 1

and replace config vars with RPCConfig

TimeoutBroadcastTxCommit can't be greater than rpcserver.WriteTimeout

rpc: Context as first parameter to all functions

reformat code

fixes after my own review

fixes after Ethan's review

add test stubs

fix config.toml

* fixes after manual testing

- rpc: do not recommend to use BroadcastTxCommit because it's slow and wastes
Tendermint resources (pubsub)
- rpc: better error in Subscribe and BroadcastTxCommit
- HTTPClient: do not resubscribe if err = ErrAlreadySubscribed

* fixes after Ismail's review

* Update rpc/grpc/grpc_test.go

Co-Authored-By: melekes <anton.kalyaev@gmail.com>
2019-03-11 22:45:58 +04:00
15f621141d remove TimeIotaMs from ABCI consensus params (#3403)
Also

- init substructures to avoid panic in pb2tm.ConsensusParams
Before: if csp.Block is nil and we later try to access/write to it,
we'll panic.
After: if csp.Block is nil and we later try to access/write to it,
there'll be no panic.
2019-03-11 22:21:17 +04:00
dc359bd3a5 types: remove check for priority order of existing validators (#3407)
When scaling and averaging is invoked, it is possible to have validators
with close priorities ending up with same priority. With the current code,
this  makes it impossible to verify the priority orders before and after updates.

Fixes #3383
2019-03-11 18:17:25 +04:00
976819537d Merge pull request #3399 from tendermint/release/v0.30.2
Release/v0.30.2
2019-03-11 08:17:14 -04:00
100ff08de9 p2p: do not panic when filter times out (#3384)
Fixes #3369
2019-03-11 15:31:53 +04:00
f996b10f47 update changelog and bump version to 0.30.2 2019-03-10 13:06:34 +04:00
36d7180ca2 libs/db: close batch (#3397)
ClevelDB requires closing when WriteBatch is no longer needed, https://godoc.org/github.com/jmhodges/levigo#WriteBatch.Close

Fixes the memory leak in https://github.com/cosmos/cosmos-sdk/issues/3842
2019-03-10 12:56:04 +04:00
b021f1e505 libs/db: close batch (#3397)
ClevelDB requires closing when WriteBatch is no longer needed, https://godoc.org/github.com/jmhodges/levigo#WriteBatch.Close

Fixes the memory leak in https://github.com/cosmos/cosmos-sdk/issues/3842
2019-03-10 12:46:32 +04:00
90794260bc circleci: removed complexity from docs deployment job (#3396) 2019-03-09 19:13:36 +04:00
b6a510a3e7 make ineffassign linter pass (#3386)
Refs #3262

This fixes two small bugs:

1) lite/dbprovider: return `ok` instead of true in parse* functions. It's weird that we're ignoring `ok` value before.
2) consensus/state: previously because of the shadowing we almost never output "Error with msg". Now we declare both `added` and `err` in the beginning of the function, so there's no shadowing.
2019-03-08 09:46:09 +04:00
e415c326f9 update golang.org/x/crypto (#3392)
Update Gopkg.lock via dep ensure --update golang.org/x/crypto

see #3391 (comment) (nothing to review here really).
2019-03-08 09:40:59 +04:00
28e9e9e714 update levigo to 1.0.0 (#3389)
Although the version we were pinning to is from Nov. 2016 there were no substantial changes:

    jmhodges/levigo@2b8c778 added go-modules support (no code changes)
    jmhodges/levigo@853d788 added a badge to the readme

closes #3381
2019-03-07 20:03:57 +04:00
3ebfa99f2c do not pin repos without releases to exact revisions (#3382)
We're pinning repos without releases because it's very easy to upgrade all the dependencies by executing dep ensure --upgrade. Instead, we should just never run this command directly, only dep ensure --upgrade <some repo>. And we can defend that in PRs.

Refs #3374

The problem with pinning to exact revisions: people who import Tendermint as a library (e.g. abci/types) are stuck with these revisions even though the code they import may not even use them.
2019-03-07 19:35:04 +04:00
91b488f9a5 docs: fix the reverse of meaning in spec (#3387)
https://tools.ietf.org/html/rfc6962#section-2.1
"The largest power of two less than the number of items" is actually correct!

    For n > 1, let k be the largest power of two smaller than n (i.e.,
    k < n <= 2k).
2019-03-07 17:02:13 +04:00
f25d727035 make dupl linter pass (#3385)
Refs #3262
2019-03-07 09:10:34 +04:00
411bc5e49f types: followup after validator set changes (#3301)
* fix failure in TestProposerFrequency

* Add test to check priority order after updates

* Changed applyRemovals() and removed Remove()

Changed applyRemovals() similar to applyUpdates()
Removed function Remove()
Updated comments

* review comments

* simplify applyRemovals and add more comments

* small correction in comment

* Fix check in test

* Fix priority check for centering, address review comments

* fix assert for priority centering

* review comments

* review comments

* cleanup and review comments

added upper limit check for validator voting power
moved check for empty validator set earlier
moved panic on potential negative set length in verifyRemovals
added more tests

* review comments
2019-03-06 12:54:49 +04:00
858875fbb8 Copy secp256k1 code from go-ethereum to avoid GPL vendoring issues in (#3371)
downstream

Signed-off-by: Silas Davis <silas@monax.io>
2019-03-06 12:22:35 +04:00
1eaa42cd25 golang 1.12.0 (#3376)
- update docker image on circleci
 - remove GOCACHE=off from Makefile (see:
 https://tip.golang.org/doc/go1.12#gocache)
 - update badge in readme
 - update in scripts/install
 - update Vagrantfile
 - update in networks/remote/integration.sh
 - tools/build/Makefile
2019-03-05 11:08:52 +04:00
8c9df30e28 libs/db: Add cleveldb.Stats() (#3379)
Fixes: #3378

* Add stats to cleveldb implementation

* update changelog

* remote TODO

also
- sort keys
- preallocate memory

* fix const initializer []string literal is not a constant

* add test
2019-03-05 10:56:46 +04:00
52771e1287 make BlockTimeIota a consensus parameter, not a locally configurable … (#3048)
* make BlockTimeIota a consensus parameter, not a locally configurable option

Refs #2920

* make TimeIota int64 ms

Refs #2920

* update Gopkg.toml

* fixes after Ethan's review

* fix TestRemoteSignerProposalSigningFailed

* update changelog
2019-03-04 13:24:44 +04:00
f39138aa2e remove RoundState from EventDataRoundState (#3354)
Before we're using it to get a round state in tests. Now it can be done
by calling csX.GetRoundState. We will need to rewrite
TestStateSlashingPrevotes and TestStateSlashingPrecommits, which are
commented right now, to not rely on EventDataRoundState#RoundState
field.

Refs #1527
2019-03-04 12:18:32 +04:00
8a962ffc46 deps: update gogo/protobuf from 1.1.1 to 1.2.1 and golang/protobuf from 1.1.0 to 1.3.0 (#3357)
* deps: update gogo/proto from 1.1.1 to 1.2.1

- verified changes manually
  git diff 636bf030~ ba06b47c --stat -- ':!*.pb.go' ':!test'

* deps: update golang/protobuf from 1.1.0 to 1.3.0

- verified changes manually
  git diff b4deda0~ c823c79 -- ':!*.pb.go' ':!test'
2019-03-04 12:17:38 +04:00
3421e4dcd7 make lightd availbe (#3364)
1."abci_query": rpcserver.NewRPCFunc(c.ABCIQuery, "path,data,prove")
"validators": rpcserver.NewRPCFunc(c.Validators, "height"),
the parameters and function do not match, cause index out of range error.
2. the prove of query is forced to be true, while default option is false.
3. fix the wrong key of merkle
2019-03-02 16:36:52 -05:00
976b1c2ef7 fix pool timer leak bug, resolve#3353 (#3358)
When remove peer, block pool simple remove bpPeer,
but do not stop timer, that cause stopError for recorrected
peers. Stop timer when remove from pool.
2019-03-02 15:21:21 -05:00
d95894152b fix dirty data in peerset,resolve #3304 (#3359)
* fix dirty data in peerset

startInitPeer before PeerSet add the peer,
once mconnection start and Receive of one
Reactor faild, will try to remove it from PeerSet
while PeerSet still not contain the peer. Fix
this by change the order.

* fix test FilterDuplicate

* fix start/stop race

* fix err
2019-03-02 15:17:37 -05:00
37a548414b docs: fix typo (#3373) 2019-03-02 10:06:57 +04:00
853dd34d31 privval: improve Remote Signer implementation (#3351)
This issue is related to #3107
This is a first renaming/refactoring step before reworking and removing heartbeats.
As discussed with @Liamsi , we preferred to go for a couple of independent and separate PRs to simplify review work.

The changes:

    Help to clarify the relation between the validator and remote signer endpoints
    Differentiate between timeouts and deadlines
    Prepare to encapsulate networking related code behind RemoteSigner in the next PR

My intention is to separate and encapsulate the "network related" code from the actual signer.

SignerRemote ---(uses/contains)--> SignerValidatorEndpoint <--(connects to)--> SignerServiceEndpoint ---> SignerService (future.. not here yet but would like to decouple too)

All reconnection/heartbeat/whatever code goes in the endpoints. Signer[Remote/Service] do not need to know about that.

I agree Endpoint may not be the perfect name. I tried to find something "Go-ish" enough. It is a common name in go-kit, kubernetes, etc.

Right now:
SignerValidatorEndpoint:

    handles the listener
    contains SignerRemote
    Implements the PrivValidator interface
    connects and sets a connection object in a contained SignerRemote
    delegates PrivValidator some calls to SignerRemote which in turn uses the conn object that was set externally

SignerRemote:

    Implements the PrivValidator interface
    read/writes from a connection object directly
    handles heartbeats

SignerServiceEndpoint:

    Does most things in a single place
    delegates to a PrivValidator IIRC.

* cleanup

* Refactoring step 1

* Refactoring step 2

* move messages to another file

* mark for future work / next steps

* mark deprecated classes in docs

* Fix linter problems

* additional linter fixes
2019-02-28 11:48:20 +04:00
d6e2fb453d update docs (#3349)
* docs: explain create_empty_blocks configurations

Closes #3307

* Vagrantfile: install nodejs for docs

* update docs instructions

npm install does not make sense since there's no packages.json file

* explain broadcast_tx_* tx format

Closes #536

* docs: explain how transaction ordering works

Closes #2904

* bring in consensus parameters explained

* example for create_empty_blocks_interval

* bring in explanation from https://github.com/tendermint/tendermint/issues/2487#issuecomment-424899799

* link to formatting instead of duplicating info
2019-02-28 11:31:59 +04:00
ec9bff5234 rename WAL#Flush to WAL#FlushAndSync (#3345)
* rename WAL#Flush to WAL#FlushAndSync

- rename auto#Flush to auto#FlushAndSync
- cleanup WAL interface to not leak implementation details!
  * remove Group()
  * add WALReader interface and return it in SearchForEndHeight()
- add interface assertions

Refs #3337

* replace WALReader with io.ReadCloser
2019-02-25 09:11:07 +04:00
6797d85851 p2p: fix comment in secret connection (#3348)
Just a minor followup on the review if #3347: Fixes a comment. [#3347 (comment)](https://github.com/tendermint/tendermint/pull/3347#discussion_r259582330)
2019-02-25 09:06:21 +04:00
cdf3a74f48 Unclean shutdown on SIGINT / SIGTERM (#3308)
* libs/common: TrapSignal accepts logger as a first parameter

 and does not block anymore
* previously it was dumping "captured ..." msg to os.Stdout
* TrapSignal should not be responsible for blocking thread of execution

Refs #3238

* exit with zero (0) code upon receiving SIGTERM/SIGINT

Refs #3238

* fix formatting in docs/app-dev/abci-cli.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* fix formatting in docs/app-dev/abci-cli.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>
2019-02-23 10:48:28 -05:00
41f91318e9 bound mempool memory usage (#3248)
* bound mempool memory usage

Closes #3079

* rename SizeBytes to TxsTotalBytes

and other small fixes after Zarko's review

* rename MaxBytes to MaxTxsTotalBytes

* make ErrMempoolIsFull more informative

* expose mempool's txs_total_bytes via RPC

* test full response

* fixes after Ethan's review

* config: rename mempool.size to mempool.max_txs

https://github.com/tendermint/tendermint/pull/3248#discussion_r254034004

* test more cases

https://github.com/tendermint/tendermint/pull/3248#discussion_r254036532

* simplify test

* Revert "config: rename mempool.size to mempool.max_txs"

This reverts commit 39bfa3696177aa46195000b90655419a975d6ff7.

* rename count back to n_txs

to make a change non-breaking

* rename max_txs_total_bytes to max_txs_bytes

* format code

* fix TestWALPeriodicSync

The test was sometimes failing due to processFlushTicks being called too
early. The solution is to call wal#Start later in the test.

* Apply suggestions from code review
2019-02-23 10:32:31 -05:00
e0adc5e807 secret connection check all zeroes (#3347)
* reject the shared secret if is all zeros in case the blacklist was not
sufficient

* Add test that verifies lower order pub-keys are rejected at the DH step

* Update changelog

* fix typo in test-comment
2019-02-23 10:25:57 -05:00
2137ecc130 pubsub 2.0 (#3227)
* green pubsub tests :OK:

* get rid of clientToQueryMap

* Subscribe and SubscribeUnbuffered

* start adapting other pkgs to new pubsub

* nope

* rename MsgAndTags to Message

* remove TagMap

it does not bring any additional benefits

* bring back EventSubscriber

* fix test

* fix data race in TestStartNextHeightCorrectly

```
Write at 0x00c0001c7418 by goroutine 796:
  github.com/tendermint/tendermint/consensus.TestStartNextHeightCorrectly()
      /go/src/github.com/tendermint/tendermint/consensus/state_test.go:1296 +0xad
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162

Previous read at 0x00c0001c7418 by goroutine 858:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1631 +0x1366
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1476 +0x8f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:667 +0xa1e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:628 +0x794

Goroutine 796 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:878 +0x659
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1119 +0xa8
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1117 +0x4ee
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1034 +0x2ee
  main.main()
      _testmain.go:214 +0x332

Goroutine 858 (running) created at:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).startRoutines()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:334 +0x221
  github.com/tendermint/tendermint/consensus.startTestRound()
      /go/src/github.com/tendermint/tendermint/consensus/common_test.go:122 +0x63
  github.com/tendermint/tendermint/consensus.TestStateFullRound1()
      /go/src/github.com/tendermint/tendermint/consensus/state_test.go:255 +0x397
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162
```

* fixes after my own review

* fix formatting

* wait 100ms before kicking a subscriber out

+ a test for indexer_service

* fixes after my second review

* no timeout

* add changelog entries

* fix merge conflicts

* fix typos after Thane's review

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* reformat code

* rewrite indexer service in the attempt to fix failing test

https://github.com/tendermint/tendermint/pull/3227/#issuecomment-462316527

* Revert "rewrite indexer service in the attempt to fix failing test"

This reverts commit 0d9107a098.

* another attempt to fix indexer

* fixes after Ethan's review

* use unbuffered channel when indexing transactions

Refs https://github.com/tendermint/tendermint/pull/3227#discussion_r258786716

* add a comment for EventBus#SubscribeUnbuffered

* format code
2019-02-22 23:11:27 -05:00
67fd428354 fix TestWALPeriodicSync (#3342)
The test was sometimes failing due to processFlushTicks being called too
early. The solution is to call wal#Start later in the test.
2019-02-22 11:49:08 +04:00
f22ada442a refactor decideProposal in common_test (#3343) 2019-02-22 11:48:40 +04:00
ed1de13548 cs: update wal comments (#3334)
* cs: update wal comments

Follow-up to https://github.com/tendermint/tendermint/pull/3300

* Update consensus/wal.go

Co-Authored-By: melekes <anton.kalyaev@gmail.com>
2019-02-21 18:28:02 +04:00
4f83eec782 Merge pull request #3339 from tendermint/master
Merge master back to develop
2019-02-20 10:11:33 -05:00
e0f8936455 Merge pull request #3326 from tendermint/release/v0.30.1
Release/v0.30.1
2019-02-20 10:10:49 -05:00
f2351dc758 update changelog 2019-02-20 10:05:57 -05:00
db5d7602fe docs: fix rpc Tx() method docs (#3331) 2019-02-20 15:34:52 +04:00
dff3deb2a9 cs: sync WAL more frequently (#3300)
As per #3043, this adds a ticker to sync the WAL every 2s while the WAL is running.

* Flush WAL every 2s

This adds a ticker that flushes the WAL every 2s while the WAL is
running. This is related to #3043.

* Fix spelling

* Increase timeout to 2mins for slower build environments

* Make WAL sync interval configurable

* Add TODO to replace testChan with more comprehensive testBus

* Remove extraneous debug statement

* Remove testChan in favour of using system time

As per
https://github.com/tendermint/tendermint/pull/3300#discussion_r255886586,
this removes the `testChan` WAL member and replaces the approach with a
system time-oriented one. In this new approach, we keep track of the
system time at which each flush and periodic flush successfully
occurred.

The naming of the various functions is also updated here to be more
consistent with "flushing" as opposed to "sync'ing".

* Update naming convention and ensure lock for timestamp update

* Add Flush method as part of WAL interface

Adds a `Flush` method as part of the WAL interface to enforce the idea
that we can manually trigger a WAL flush from outside of the WAL. This
is employed in the consensus state management to flush the WAL prior to
signing votes/proposals, as per https://github.com/tendermint/tendermint/issues/3043#issuecomment-453853630

* Update CHANGELOG_PENDING

* Remove mutex approach and replace with DI

The dependency injection approach to dealing with testing concerns could
allow similar effects to some kind of "testing bus"-based approach. This
commit introduces an example of this, where instead of relying on
(potentially fragile) timing of things between the code and the test, we
inject code into the function under test that can signal the test
through a channel.

This allows us to avoid the `time.Sleep()`-based approach previously
employed.

* Update comment on WAL flushing during vote signing

Co-Authored-By: thanethomson <connect@thanethomson.com>

* Simplify flush interval definition

Co-Authored-By: thanethomson <connect@thanethomson.com>

* Expand commentary on WAL disk flushing

Co-Authored-By: thanethomson <connect@thanethomson.com>

* Add broken test to illustrate WAL sync test problem

Removes test-related state (dependency injection code) from the WAL data
structure and adds test code to illustrate the problem with using
`WALGenerateNBlocks` and `wal.SearchForEndHeight` to test periodic
sync'ing.

* Fix test error messages

* Use WAL group buffer size to check for flush

A function is added to `libs/autofile/group.go#Group` in order to return
the size of the buffered data (i.e. data that has not yet been flushed
to disk). The test now checks that, prior to a `time.Sleep`, the group
buffer has data in it. After the `time.Sleep` (during which time the
periodic flush should have been called), the buffer should be empty.

* Remove config root dir removal from #3291

* Add godoc for NewWAL mentioning periodic sync
2019-02-20 09:45:18 +04:00
9d4f59b836 update changelog and bump version 2019-02-18 15:27:26 +04:00
d2c7f8dbcf p2p: check secret conn id matches dialed id (#3321)
ref: [#3010 (comment)](https://github.com/tendermint/tendermint/issues/3010#issuecomment-464287627)

> I tried searching for code where we authenticate a peer against its NetAddress.ID and couldn't find it. I don't see a reason to switch to Noise, but a need to ensure that the node's ID is authenticated e.g. after dialing from the address book.

* p2p: check secret conn id matches dialed id

* Fix all p2p tests & make code compile

* add simple test for dialing with wrong ID

* update changelog

* address review comments

* yet another place where to use IDAddressString and fix
testSetupMultiplexTransport
2019-02-18 14:08:22 +04:00
8283ca7ddb 3291 follow-up (#3323)
* changelog: use issue number instead of PR number

* follow up to #3291

- rpc/test/helpers.go add StopTendermint(node) func
- remove ensureDir(filepath.Dir(walFile), 0700)
- mempool/mempool_test.go add type cleanupFunc func()

* cmd/show_validator: wrap err to make it more clear
2019-02-18 13:23:40 +04:00
59cc6d36c9 improve ResetTestRootWithChainID() concurrency safety (#3291)
* improve ResetTestRootWithChainID() concurrency safety

Rely on ioutil.TempDir() to create test root directories and ensure
multiple same-chain id test cases can run in parallel.

* Update config/toml.go

Co-Authored-By: alessio <quadrispro@ubuntu.com>

* clean up test directories after completion

Closes: #1034

* Remove redundant EnsureDir call

* s/PanicSafety()/panic()/s

* Put create dir functionality back in ResetTestRootWithChainID

* Place test directories in OS's tempdir

In modern UNIX and UNIX-like systems /tmp is very often
mounted as tmpfs. This might speed test execution a bit.

* Set 0700 to a const

* rootsDirs -> configRootDirs

* Don't double remove directories

* Avoid global variables

* Fix consensus tests

* Reduce defer stack

* Address review comments

* Try to fix tests

* Update CHANGELOG_PENDING.md

Co-Authored-By: alessio <quadrispro@ubuntu.com>

* Update consensus/common_test.go

Co-Authored-By: alessio <quadrispro@ubuntu.com>

* Update consensus/common_test.go

Co-Authored-By: alessio <quadrispro@ubuntu.com>
2019-02-18 11:45:27 +04:00
af8793c01a cs: reset triggered timeout precommit (#3310)
* Reset TriggeredTimeoutPrecommit as part of updateToState

* Add failing test and fix

* fix DATA RACE in TestResetTimeoutPrecommitUponNewHeight

```
WARNING: DATA RACE
Read at 0x00c001691d28 by goroutine 691:
  github.com/tendermint/tendermint/consensus.decideProposal()
      /go/src/github.com/tendermint/tendermint/consensus/common_test.go:133 +0x121
  github.com/tendermint/tendermint/consensus.TestResetTimeoutPrecommitUponNewHeight()
      /go/src/github.com/tendermint/tendermint/consensus/state_test.go:1389 +0x958
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162

Previous write at 0x00c001691d28 by goroutine 931:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).updateToState()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:562 +0x5b2
  github.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1340 +0x141e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1255 +0x66e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1201 +0x135
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1232 +0x94b
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1657 +0x132e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1503 +0x8f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:694 +0xa1e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:655 +0x7dd
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:655 +0x7dd

Goroutine 691 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:878 +0x659
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1119 +0xa8
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162
  testing.runTests()
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1034 +0x2ee
  main.main()
      _testmain.go:216 +0x332
```

* fix another DATA RACE by locking consensus

```
WARNING: DATA RACE
Read at 0x00c009b835a8 by goroutine 871:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).createProposalBlock()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:955 +0x7c
  github.com/tendermint/tendermint/consensus.decideProposal()
      /go/src/github.com/tendermint/tendermint/consensus/common_test.go:127 +0x53
  github.com/tendermint/tendermint/consensus.TestResetTimeoutPrecommitUponNewHeight()
      /go/src/github.com/tendermint/tendermint/consensus/state_test.go:1389 +0x958
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162

Previous write at 0x00c009b835a8 by goroutine 931:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).updateHeight()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:446 +0xb7
  github.com/tendermint/tendermint/consensus.(*ConsensusState).updateToState()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:542 +0x22f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1340 +0x141e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1255 +0x66e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1201 +0x135
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1232 +0x94b
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1657 +0x132e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1503 +0x8f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:694 +0xa1e
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:655 +0x7dd
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:642 +0x948
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:655 +0x7dd
```

* Fix failing test

* Delete profile.out

* fix data races
2019-02-18 11:29:41 +04:00
0b0a8b3128 cs/wal: refuse to encode msg that is bigger than maxMsgSizeBytes (#3303)
Earlier this week somebody posted this in GoS Riot chat:

```
E[2019-02-12|10:38:37.596] Corrupted entry. Skipping... module=consensus wal=/home/gaia/.gaiad/data/cs.wal/wal err="DataCorruptionError[length 878916964 exceeded maximum possible value of 1048576 bytes]"
E[2019-02-12|10:38:37.596] Corrupted entry. Skipping... module=consensus wal=/home/gaia/.gaiad/data/cs.wal/wal err="DataCorruptionError[length 825701731 exceeded maximum possible value of 1048576 bytes]"
E[2019-02-12|10:38:37.596] Corrupted entry. Skipping... module=consensus wal=/home/gaia/.gaiad/data/cs.wal/wal err="DataCorruptionError[length 1631073634 exceeded maximum possible value of 1048576 bytes]"
E[2019-02-12|10:38:37.596] Corrupted entry. Skipping... module=consensus wal=/home/gaia/.gaiad/data/cs.wal/wal err="DataCorruptionError[length 912418148 exceeded maximum possible value of 1048576 bytes]"
E[2019-02-12|10:38:37.600] Corrupted entry. Skipping... module=consensus wal=/home/gaia/.gaiad/data/cs.wal/wal err="DataCorruptionError[failed to read data: EOF]"
E[2019-02-12|10:38:37.600] Error on catchup replay. Proceeding to start ConsensusState anyway module=consensus err="Cannot replay height 7242. WAL does not contain #ENDHEIGHT for 7241"
E[2019-02-12|10:38:37.861] Error dialing peer module=p2p err="dial tcp 35.183.126.181:26656: i/o timeout
```

Note the length error messages. What has happened is the length field got corrupted probably. I've looked at the code and noticed that we don't check the msg size during encoding. This PR fixes that. It also improves a few error messages in WALDecoder.
2019-02-18 11:23:06 +04:00
7ced9e416b rpc/net_info: change RemoteIP type from net.IP to String (#3309)
* rpc/net_info: change RemoteIP type from net.IP to String

Before:
"AAAAAAAAAAAAAP//rB8ktw=="
which is amino-encoded net.IP byte slice

After:
"192.0.2.1"

Fixes #3251

* rpc/net_info: non-empty response in docs
2019-02-16 09:46:02 +04:00
af3ba5145a fix test-vectors to actually match the sign bytes: (#3312)
- sign bytes are length prefixed
 - change test to use SignBytes methods instead of calling amino methods
 directly

Resolves #3311
ref: #2455 #2508
2019-02-16 09:12:00 +04:00
cf737ec85c return an error on show_validator (#3316)
* return a command error prior to init

* add a pending log entry

* Update CHANGELOG_PENDING.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

closes: #3314
2019-02-16 09:07:18 +04:00
d32f7d2416 update codeowners (#3305)
limit the scope of @zramsay because he's annoyed by notifications
2019-02-13 08:26:01 +04:00
dc6567c677 consensus: flush wal on stop (#3297)
Should fix #3295
Also partial fix of #3043
2019-02-12 09:32:40 +04:00
08dabab024 types: validator set update tests (#3284)
* types: validator set update tests

* docs: abci val updates must not include duplicates
2019-02-12 09:04:23 +04:00
8a9eecce7f test blockExec does not panic if all vals removed (#3241)
Fix for #3224
Also address #2084
2019-02-12 09:02:44 +04:00
b089587b42 make gosec linter pass (#3294)
* not related to linter: remove obsolete constants:
 - `Insecure` and `Secure` and type `Security` are not used anywhere

* not related to linter: update example

 - NewInsecure was deleted; change example to NewRemoteDB

* address: Binds to all network interfaces (gosec):

 - bind to localhost instead of 0.0.0.0
 - regenerate test key and cert for this purpose (was valid for ::) and
 otherwise we would see:
 transport: authentication handshake failed: x509: certificate is
 valid for ::, not 127.0.0.1\"

(used https://github.com/google/keytransparency/blob/master/scripts/gen_server_keys.sh
to regenerate certs)

* use sha256 in tests instead of md5; time difference is negligible

* nolint usage of math/rand in test and add comment on its import

 - crypto/rand is slower and we do not need sth more secure in tests

* enable linter in circle-ci

* another nolint math/rand in test

* replace another occurrence of md5

* consistent comment about importing math/rand
2019-02-12 08:54:12 +04:00
7fd51e6ade make govet linter pass (#3292)
* make govet linter pass

Refs #3262

* close PipeReader and check for err
2019-02-11 16:31:34 +04:00
966b5bdf6e fix failure in TestProposerFrequency (#3293)
```
--- FAIL: TestProposerFrequency (2.50s)

panic: empty validator set [recovered]

        panic: empty validator set



goroutine 91 [running]:

testing.tRunner.func1(0xc000a98c00)

        /usr/local/go/src/testing/testing.go:792 +0x6a7

panic(0xeae7e0, 0x11fbb30)

        /usr/local/go/src/runtime/panic.go:513 +0x1b9

github.com/tendermint/tendermint/types.(*ValidatorSet).RescalePriorities(0xc0000e7380, 0x0)

        /go/src/github.com/tendermint/tendermint/types/validator_set.go:106 +0x1ac

github.com/tendermint/tendermint/state.TestProposerFrequency(0xc000a98c00)

        /go/src/github.com/tendermint/tendermint/state/state_test.go:335 +0xb44

testing.tRunner(0xc000a98c00, 0x111a4d8)

        /usr/local/go/src/testing/testing.go:827 +0x163

created by testing.(*T).Run

        /usr/local/go/src/testing/testing.go:878 +0x65a

FAIL    github.com/tendermint/tendermint/state  3.139s
```
2019-02-11 16:21:51 +04:00
021b5cc7f6 Merge pull request #3290 from tendermint/master
Merge pull request #3288 from tendermint/release/v0.30.0
2019-02-09 10:07:49 -05:00
28d75ec801 Merge pull request #3288 from tendermint/release/v0.30.0
Release/v0.30.0
2019-02-09 10:07:22 -05:00
792b12573e Prepare v0.30.0 (#3287)
* changelog, upgrading, version

* update for evidence fixes

* linkify

* fix an entry
2019-02-08 18:50:02 -05:00
4f2ef36701 types.NewCommit (#3275)
* types.NewCommit

* use types.NewCommit everywhere

* fix log in unsafe_reset

* memoize height and round in constructor

* notes about deprecating toVote

* bring back memoizeHeightRound
2019-02-08 18:40:41 -05:00
6b1b595951 Merge pull request #3286 from tendermint/bucky/fix-duplicate-evidence
Fixes for duplicate evidence
2019-02-08 18:33:45 -05:00
87bdc42bf8 Reject blocks with committed evidence (#37)
* evidence: NewEvidencePool takes evidenceDB

* evidence: failing TestStoreCommitDuplicate

tendermint/security#35

* GetEvidence -> GetEvidenceInfo

* fix TestStoreCommitDuplicate

* comment in VerifyEvidence

* add check if evidence was already seen
 - modify EventPool interface (EventStore is not known in ApplyBlock):
   - add IsCommitted method to iface
 - add test

* update changelog

* fix TestStoreMark:
 - priority in evidence info gets reset to zero after evidence gets committed

* review comments: simplify EvidencePool.IsCommitted
 - delete obsolete EvidenceStore.IsCommitted

* add simple test for IsCommitted

* update changelog: this is actually breaking (PR number still missing)

* fix TestStoreMark:
 - priority in evidence info gets reset to zero after evidence gets
 committed

* review suggestion: simplify return
2019-02-08 18:30:45 -05:00
90ba63948a Sec/bucky/35 commit duplicate evidence (#36)
Don't add committed evidence to evpool
2019-02-08 18:25:48 -05:00
cce4d21ccb treat validator updates as set (#3222)
* Initial commit for 3181..still early

* unit test updates

* unit test updates

* fix check of dups accross updates and deletes

* simplify the processChange() func

* added overflow check utest

* Added checks for empty valset, new utest

* deepcopy changes in processUpdate()

* moved to new API, fixed tests

* test cleanup

* address review comments

* make sure votePower > 0

* gofmt fixes

* handle duplicates and invalid values

* more work on tests, review comments

* Renamed and explained K

* make TestVal private

* split verifyUpdatesAndComputeNewPriorities.., added check for deletes

* return error if validator set is empty after processing changes

* address review comments

* lint err

* Fixed the total voting power and added comments

* fix lint

* fix lint
2019-02-08 13:05:09 -05:00
c1f7399a86 review comment: cleaner constant for N/2, delete secp256k1N and use (#3279)
`secp256k1.S256().N` directly instead
2019-02-08 09:48:09 -05:00
44a89a3537 Merge pull request #3282 from tendermint/master
Merge master back to develop
2019-02-08 09:43:36 -05:00
a8dbc64319 Merge pull request #3276 from tendermint/release/v0.29.2
Release/v0.29.2
2019-02-08 09:42:52 -05:00
af6e6cd350 remove MixEntropy (#3278)
* remove MixEntropy

* changelog
2019-02-07 20:12:57 -05:00
ad4bd92fec secp256k1: change build tags (#3277) 2019-02-07 19:57:30 -05:00
f571ee8876 prepare v0.29.2 (#3272)
* update changelog

* linkify

* bump version

* update main changelog

* final fixes

* entry for wal fix

* changelog preamble

* remove a line
2019-02-07 19:34:01 -05:00
11e36d0bfb addrbook_test: preallocate memory for bookSizes (#3268)
Fixes https://circleci.com/gh/tendermint/tendermint/44901
2019-02-07 17:16:31 +04:00
354a08c25a p2p: fix infinite loop in addrbook (#3232)
* failing test

* fix infinite loop in addrbook

There are cases where we only have a small number of addresses marked
good ("old"), but the selection mechanism keeps trying to select more of these
addresses, and hence ends up in an infinite loop. Here we fix this to
only try and select such "old" addresses if we have enough of them. Note this
means, if we don't have enough of them, we may return more "new"
addresses than otherwise expected by the newSelectionBias.

This whole GetSelectionWithBias method probably needs to be rewritten,
but this is a quick fix for the issue.

* changelog

* fix infinite loop if not enough new addrs

* fix another potential infinite loop

if a.nNew == 0 -> pickFromOldBucket=true, but we don't have enough items
  (a.nOld > len(oldBucketToAddrsMap) false)

* Revert "fix another potential infinite loop"

This reverts commit 146540c1125597162bd89820d611f6531f5e5e4b.

* check num addresses instead of buckets, new test

* fixed the int division

* add slack to bias % in test, lint fixes

* Added checks for selection content in test

* test cleanup

* Apply suggestions from code review

Co-Authored-By: ebuchman <ethan@coinculture.info>

* address review comments

* change after  Anton's review comments

* use the same docker image we use for testing

when building a binary for localnet

* switch back to circleci classic

* more review comments

* more review comments

* refactor addrbook_test

* build linux binary inside docker

in attempt to fix

```
--> Running dep
+ make build-linux
GOOS=linux GOARCH=amd64 make build
make[1]: Entering directory `/home/circleci/.go_workspace/src/github.com/tendermint/tendermint'
CGO_ENABLED=0 go build -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" -tags 'tendermint' -o build/tendermint ./cmd/tendermint/
p2p/pex/addrbook.go:373:13: undefined: math.Round
```

* change dir from /usr to /go

* use concrete Go version for localnet binary

* check for nil addresses just to be sure
2019-02-07 15:58:23 +04:00
e70f27c8e4 Add remote signer test harness (KMS) (#3149)
* WIP: Starts adding remote signer test harness

This commit adds a new command to Tendermint to allow for us to build a
standalone binary to test remote signers such as KMS
(https://github.com/tendermint/kms).

Right now, all it does is test that the local public key matches the
public key reported by the client, and fails at the point where it
attempts to get the client to sign a proposal.

* Fixes typo

* Fixes proposal validation test

This commit fixes the proposal validation test as per #3149. It also
moves the test harness into its own internal package to isolate its
exports from the `privval` package.

* Adds vote signing validation

* Applying recommendations from #3149

* Adds function descriptions for test harness

* Adds ability to ask remote signer to shut down

Prior to this commit, the remote signer needs to manually be shut down,
which is not ideal for automated testing. This commit allows us to send
a poison pill message to the KMS to let it shut down gracefully once
testing is done (whether the tests pass or fail).

* Adds tests for remote signer test harness

This commit makes some minor modifications to a few files to allow for
testing of the remote signer test harness. Two tests are added here:
checking for a fully successful (the ideal) case, and for the case where
the maximum number of retries has been reached when attempting to accept
incoming connections from the remote signer.

* Condenses serialization of proposals and votes using existing Tendermint functions

* Removes now-unnecessary amino import and codec

* Adds error message for vote signing failure

* Adds key extraction command for integration test

Took the code from here:
https://gist.github.com/Liamsi/a80993f24bff574bbfdbbfa9efa84bc7 to
create a simple utility command to extract a key from a local Tendermint
validator for use in KMS integration testing.

* Makes path expansion success non-compulsory

* Fixes segfault on SIGTERM

We need an additional variable to keep track of whether we're
successfully connected, otherwise hitting Ctrl+Break during execution
causes a segmentation fault. This now allows for a clean shutdown.

* Consolidates shutdown checks

* Adds comments indicating codes for easy lookup

* Adds Docker build for remote signer harness

Updates the `DOCKER/build.sh` and `DOCKER/push.sh` files to allow one to
override the image name and Dockerfile using environment variables.
Updates the primary `Makefile` as well as the `DOCKER/Makefile` to allow
for building the `remote_val_harness` Docker image.

* Adds build_remote_val_harness_docker_image to .PHONY

* Removes remote signer poison pill messaging functionality

* Reduces fluff code in command line parsing

As per
https://github.com/tendermint/tendermint/pull/3149#pullrequestreview-196171788,
this reduces the amount of fluff code in the PR down to the bare
minimum.

* Fixes ordering of error check and info log

* Moves remove_val_harness cmd into tools folder

It seems to make sense to rather keep the remote signer test harness in
its own tool folder (now rather named `tm-signer-harness` to keep with
the tool naming convention). It is actually a separate tool, not meant
to be one of the core binaries, but supplementary and supportive.

* Updates documentation for tm-signer-harness

* Refactors flag parsing to be more compact and less redundant

* Adds version sub-command help

* Removes extraneous flags parsing

* Adds CHANGELOG_PENDING entry for tm-signer-harness

* Improves test coverage

Adds a few extra parameters to the `MockPV` type to fake broken vote and
proposal signing. Also adds some more tests for the test harness so as
to increase coverage for failed cases.

* Fixes formatting for CHANGELOG_PENDING.md

* Fix formatting for documentation config

* Point users towards official Tendermint docs for tools documentation

* Point users towards official Tendermint docs for tm-signer-harness

* Remove extraneous constant

* Rename TestHarness.sc to TestHarness.spv for naming consistency

* Refactor to remove redundant goroutine

* Refactor conditional to cleaner switch statement and better error handling for listener protocol

* Remove extraneous goroutine

* Add note about installing tmkms via Cargo

* Fix typo in naming of output signing key

* Add note about where to find chain ID

* Replace /home/user with ~/ for brevity

* Fixes "signer.key" typo

* Minor edits for clarification for tm-signer-harness bulid/setup process
2019-02-07 10:32:32 +04:00
fcebdf6720 Merge pull request #3261 from tendermint/anton/circle
Revert "quick fix for CircleCI (#2279)"
2019-02-07 10:28:22 +04:00
9e9026452c p2p/conn: don't hold stopMtx while waiting (#3254)
* p2p/conn: fix deadlock in FlushStop/OnStop

* makefile: set_with_deadlock

* close doneSendRoutine at end of sendRoutine

* conn: initialize channs in OnStart
2019-02-06 10:29:51 -05:00
45b70ae031 fix non deterministic test failures and race in privval socket (#3258)
* node: decrease retry conn timeout in test

Should fix #3256

The retry timeout was set to the default, which is the same as the
accept timeout, so it's no wonder this would fail. Here we decrease the
retry timeout so we can try many times before the accept timeout.

* p2p: increase handshake timeout in test

This fails sometimes, presumably because the handshake timeout is so low
(only 50ms). So increase it to 1s. Should fix #3187

* privval: fix race with ping. closes #3237

Pings happen in a go-routine and can happen concurrently with other
messages. Since we use a request/response protocol, we expect to send a
request and get back the corresponding response. But with pings
happening concurrently, this assumption could be violated. We were using
a mutex, but only a RWMutex, where the RLock was being held for sending
messages - this was to allow the underlying connection to be replaced if
it fails. Turns out we actually need to use a full lock (not just a read
lock) to prevent multiple requests from happening concurrently.

* node: fix test name. DelayedStop -> DelayedStart

* autofile: Wait() method

In the TestWALTruncate in consensus/wal_test.go we remove the WAL
directory at the end of the test. However the wal.Stop() does not
properly wait for the autofile group to finish shutting down. Hence it
was possible that the group's go-routine is still running when the
cleanup happens, which causes a panic since the directory disappeared.
Here we add a Wait() method to properly wait until the go-routine exits
so we can safely clean up. This fixes #2852.
2019-02-06 10:24:43 -05:00
4429826229 cmn: GetFreePort (#3255) 2019-02-06 10:14:03 -05:00
1386707ceb rename TestGCRandom to _TestGCRandom 2019-02-06 18:36:54 +04:00
1a35895ac8 remove gotype linter
WARN [runner/nolint] Found unknown linters in //nolint directives: gotype
2019-02-06 18:26:56 +04:00
6941d1bb35 use nolint label instead of commenting 2019-02-06 18:21:32 +04:00
23314daee4 comment out clist tests w/ depend on runtime.SetFinalizer 2019-02-06 15:38:02 +04:00
3c8156a55a preallocating memory when we can 2019-02-06 15:24:54 +04:00
ffd3bf8448 remove or comment out unused code 2019-02-06 15:16:38 +04:00
da33dd04cc switch to golangci-lint from gometalinter 🚤 2019-02-06 15:00:55 +04:00
d8f0bc3e60 Revert "quick fix for CircleCI (#2279)"
This reverts commit 1cf6712a36.
2019-02-06 14:11:35 +04:00
1809efa350 Introduce CommitSig alias for Vote in Commit (#3245)
* types: memoize height/round in commit instead of first vote

* types: commit.ValidateBasic in VerifyCommit

* types: new CommitSig alias for Vote

In preparation for reducing the redundancy in Commits, we introduce the
CommitSig as an alias for Vote. This is non-breaking on the protocol,
and minor breaking on the Go API, as Commit now contains a list of
CommitSig instead of Vote.

* remove dependence on ToVote

* update some comments

* fix tests

* fix tests

* fixes from review
2019-02-04 13:01:59 -05:00
39eba4e154 WAL: better errors and new fail point (#3246)
* privval: more info in errors

* wal: change Debug logs to Info

* wal: log and return error on corrupted wal instead of panicing

* fail: Exit right away instead of sending interupt

* consensus: FAIL before handling our own vote

allows to replicate #3089:
- run using `FAIL_TEST_INDEX=0`
- delete some bytes from the end of the WAL
- start normally

Results in logs like:

```
I[2019-02-03|18:12:58.225] Searching for height module=consensus wal=/Users/ethanbuchman/.tendermint/data/cs.wal/wal height=1 min=0 max=0
E[2019-02-03|18:12:58.225] Error on catchup replay. Proceeding to start ConsensusState anyway module=consensus err="failed to read data: EOF"
I[2019-02-03|18:12:58.225] Started node module=main nodeInfo="{ProtocolVersion:{P2P:6 Block:9 App:1} ID_:35e87e93f2e31f305b65a5517fd2102331b56002 ListenAddr:tcp://0.0.0.0:26656 Network:test-chain-J8JvJH Version:0.29.1 Channels:4020212223303800 Moniker:Ethans-MacBook-Pro.local Other:{TxIndex:on RPCAddress:tcp://0.0.0.0:26657}}"
E[2019-02-03|18:12:58.226] Couldn't connect to any seeds module=p2p
I[2019-02-03|18:12:59.229] Timed out module=consensus dur=998.568ms height=1 round=0 step=RoundStepNewHeight
I[2019-02-03|18:12:59.230] enterNewRound(1/0). Current: 1/0/RoundStepNewHeight module=consensus height=1 round=0
I[2019-02-03|18:12:59.230] enterPropose(1/0). Current: 1/0/RoundStepNewRound module=consensus height=1 round=0
I[2019-02-03|18:12:59.230] enterPropose: Our turn to propose module=consensus height=1 round=0 proposer=AD278B7767B05D7FBEB76207024C650988FA77D5 privValidator="PrivValidator{AD278B7767B05D7FBEB76207024C650988FA77D5 LH:1, LR:0, LS:2}"
E[2019-02-03|18:12:59.230] enterPropose: Error signing proposal module=consensus height=1 round=0 err="Error signing proposal: Step regression at height 1 round 0. Got 1, last step 2"
I[2019-02-03|18:13:02.233] Timed out module=consensus dur=3s height=1 round=0 step=RoundStepPropose
I[2019-02-03|18:13:02.233] enterPrevote(1/0). Current: 1/0/RoundStepPropose module=consensus
I[2019-02-03|18:13:02.233] enterPrevote: ProposalBlock is nil module=consensus height=1 round=0
E[2019-02-03|18:13:02.234] Error signing vote module=consensus height=1 round=0 vote="Vote{0:AD278B7767B0 1/00/1(Prevote) 000000000000 000000000000 @ 2019-02-04T02:13:02.233897Z}" err="Error signing vote: Conflicting data"
```

Notice the EOF, the step regression, and the conflicting data.

* wal: change errors to be DataCorruptionError

* exit on corrupt WAL

* fix log

* fix new line
2019-02-04 13:00:06 -05:00
eb4e23b91e fix FlushStop (#3247)
* p2p/pex: failing test

* p2p/conn: add stopMtx for FlushStop and OnStop

* changelog
2019-02-04 07:30:24 -08:00
6485e68beb Use ethereum's secp256k1 lib (#3234)
* switch from fork (tendermint/btcd) to orig package (btcsuite/btcd); also

 - remove obsolete check in test `size != -1` is always true
 - WIP as the serialization still needs to be wrapped

* WIP: wrap signature & privkey, pubkey needs to be wrapped as well

* wrap pubkey too

* use "github.com/ethereum/go-ethereum/crypto/secp256k1" if cgo is
available, else use "github.com/btcsuite/btcd/btcec" and take care of
lower-S when verifying

Annoyingly, had to disable pruning when importing
github.com/ethereum/go-ethereum/ :-/

* update comment

* update comment

* emulate signature_nocgo.go for additional benchmarks:
592bf6a59c/crypto/signature_nocgo.go (L60-L76)

* use our format (r || s) in lower-s form when in the non-cgo case

* remove comment about using the C library directly

* vendor github.com/btcsuite/btcd too

* Add test for the !cgo case

* update changelog pending

Closes #3162 #3163
Refs #1958, #2091, tendermint/btcd#1
2019-02-04 12:24:54 +04:00
d470945503 update gometalinter to 3.0.0 (#3233)
in the attempt to fix https://circleci.com/gh/tendermint/tendermint/43165

also

    code is simplified by running gofmt -s .
    remove unused vars
    enable linters we're currently passing
    remove deprecated linters
2019-01-30 12:24:26 +04:00
8985a1fa63 pubsub: fixes after Ethan's review (#3212)
in https://github.com/tendermint/tendermint/pull/3209
2019-01-29 13:16:43 +04:00
6dd817cbbc secret connection: check for low order points (#3040)
> Implement a check for the blacklisted low order points, ala the X25519 has_small_order() function in libsodium

(#3010 (comment))
resolves first half of #3010
2019-01-29 12:44:59 +04:00
0b3a87a323 mempool: correct args order in the log msg (#3221)
Before: Unexpected tx response from proxy during recheck\n Expected: {r.CheckTx.Data}, got: {memTx.tx}
After: Unexpected tx response from proxy during recheck\n Expected: {memTx.tx}, got: {tx}

Closes #3214
2019-01-29 10:12:07 +04:00
e1edd2aa6a hardcode rpc link (#3223) 2019-01-28 23:41:37 +04:00
9a0bfafef6 docs: fix links (#3220)
Because there's nothing worse than having to copy/paste a link from a
web page to navigate to it 😁
2019-01-28 17:41:39 +04:00
a335caaedb alias amino imports (#3219)
As per conversation here: https://github.com/tendermint/tendermint/pull/3218#discussion_r251364041

This is the result of running the following code on the repo:

```bash
find . -name '*.go' | grep -v 'vendor/' | xargs -n 1 goimports -w
```
2019-01-28 16:13:17 +04:00
ff3c4bfc76 add go-deadlock tool to help detect deadlocks (#3218)
* add go-deadlock tool to help detect deadlocks

Run it with `make test_with_deadlock`. After it's done, use Git to
cleanup `git checkout .`

Link: https://github.com/sasha-s/go-deadlock/
Replaces https://github.com/tendermint/tendermint/pull/3148

* add a target to cleanup changes
2019-01-28 14:57:47 +04:00
8d2dd7e554 refactor TestListenerConnectDeadlines to avoid data races (#3201)
Fixes #3179
2019-01-28 12:38:11 +04:00
71e5939441 start eventBus & indexerService before replay and use them while replaying blocks (#3194)
so if we did not index the last block (because of panic or smth else), we index it during replay

Closes #3186
2019-01-28 11:36:35 +04:00
d91ea9b59d adr-033 update 2019-01-26 14:30:29 +04:00
9b6b792ce7 pubsub: comments 2019-01-26 14:30:29 +04:00
57af99d901 types: comments on user vs internal events
Distinguish between user events and internal consensus events
2019-01-26 14:30:29 +04:00
a58d5897e4 note about TmCoreSemVer 2019-01-26 14:30:29 +04:00
ddbdffb4e5 add design philosophy doc (#3034) 2019-01-25 23:00:55 +04:00
d6dd43cdaa adr: style fixes (#3206)
- links to issues
 - fix a few markdown glitches
 - inline code
 - etc
2019-01-25 17:38:26 +04:00
75cbe4a1c1 R4R: Config TestRoot modification for LCD test (#3177)
* add ResetTestRootWithChainID

* modify chainid
2019-01-25 08:10:36 -05:00
27c1563bf0 Merge pull request #3205 from tendermint/master
Merge master back to develop
2019-01-24 11:35:01 -05:00
4d7b29cd8f Merge pull request #3203 from tendermint/release/v0.29.1
Release/v0.29.1
2019-01-24 11:34:20 -05:00
90970d0ddc fix changelog 2019-01-24 11:19:52 -05:00
bb0a9b3d6d bump version 2019-01-24 19:18:32 +04:00
8992596192 update changelog 2019-01-24 19:17:53 +04:00
c20fbed2f7 [WIP] fix halting issue (#3197)
fix halting issue
2019-01-24 09:33:47 -05:00
c4157549ab only log "Reached max attempts to dial" once (#3144)
Closes #3037
2019-01-24 13:53:02 +04:00
fbd1e79465 docs: fix lite client formatting (#3198)
Closes #3180
2019-01-24 12:10:34 +04:00
1efacaa8d3 docs: update pubsub ADR (#3131)
* docs: update pubsub ADR

* third version
2019-01-24 11:33:58 +04:00
98b42e9eb2 docs: explain how someone can run his/her own ABCI app on localnet (#3195)
Closes #3192.
2019-01-24 10:45:43 +04:00
2449bf7300 p2p: file descriptor leaks (#3150)
* close peer's connection to avoid fd leak

Fixes #2967

* rename peer#Addr to RemoteAddr

* fix test

* fixes after Ethan's review

* bring back the check

* changelog entry

* write a test for switch#acceptRoutine

* increase timeouts? :(

* remove extra assertNPeersWithTimeout

* simplify test

* assert number of peers (just to be safe)

* Cleanup in OnStop

* run tests with verbose flag on CircleCI

* spawn a reading routine to prevent connection from closing

* get port from the listener

random port is faster, but often results in

```
panic: listen tcp 127.0.0.1:44068: bind: address already in use [recovered]
        panic: listen tcp 127.0.0.1:44068: bind: address already in use

goroutine 79 [running]:
testing.tRunner.func1(0xc0001bd600)
        /usr/local/go/src/testing/testing.go:792 +0x387
panic(0x974d20, 0xc0001b0500)
        /usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/tendermint/tendermint/p2p.MakeSwitch(0xc0000f42a0, 0x0, 0x9fb9cc, 0x9, 0x9fc346, 0xb, 0xb42128, 0x0, 0x0, 0x0, ...)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/test_util.go:182 +0xa28
github.com/tendermint/tendermint/p2p.MakeConnectedSwitches(0xc0000f42a0, 0x2, 0xb42128, 0xb41eb8, 0x4f1205, 0xc0001bed80, 0x4f16ed)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/test_util.go:75 +0xf9
github.com/tendermint/tendermint/p2p.MakeSwitchPair(0xbb8d20, 0xc0001bd600, 0xb42128, 0x2f7, 0x4f16c0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch_test.go:94 +0x4c
github.com/tendermint/tendermint/p2p.TestSwitches(0xc0001bd600)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch_test.go:117 +0x58
testing.tRunner(0xc0001bd600, 0xb42038)
        /usr/local/go/src/testing/testing.go:827 +0xbf
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:878 +0x353
exit status 2
FAIL    github.com/tendermint/tendermint/p2p    0.350s
```
2019-01-22 13:23:18 -05:00
3362da0a69 Merge pull request #3191 from tendermint/master
Merge master to develop
2019-01-22 13:19:58 -05:00
4514842a63 Merge pull request #3185 from tendermint/release/v0.29.0
Release/v0.29.0
2019-01-22 13:19:28 -05:00
a97d6995c9 fix changelog indent (#3190) 2019-01-22 12:24:26 -05:00
d9d4f3e629 Prepare v0.29.0 (#3184)
* update changelog and upgrading

* add note about max voting power in abci spec

* update version

* changelog
2019-01-21 19:32:10 -05:00
7a8aeff4b0 update spec for Merkle RFC 6962 (#3175)
* spec: specify when MerkleRoot is on hashes

* remove unnecessary hash methods

* update changelog

* fix test
2019-01-21 10:02:57 -05:00
de5a6010f0 fix DynamicVerifier for large validator set changes (#3171)
* base verifier: bc->bv and check chainid

* improve some comments

* comments in dynamic verifier

* fix comment in doc about BaseVerifier

It requires the validator set to perfectly match.

* failing test for #2862

* move errTooMuchChange to types. fixes #2862

* changelog, comments

* ic -> dv

* update comment, link to issue
2019-01-21 09:21:04 -05:00
da95f4aa6d mempool: enforce maxMsgSize limit in CheckTx (#3168)
- fixes #3008
- reactor requires encoded messages are less than maxMsgSize
- requires size of tx + amino-overhead to not exceed maxMsgSize
2019-01-20 17:27:49 -05:00
4f8769175e [types] hash of ConsensusParams includes only a subset of fields (#3165)
* types: dont hash entire ConsensusParams

* update encoding spec

* update blockchain spec

* spec: consensus params hash

* changelog
2019-01-19 16:08:57 -05:00
40c887baf7 Normalize priorities to not exceed total voting power (#3049)
* more proposer priority tests

 - test that we don't reset to zero when updating / adding
 - test that same power validators alternate

* add another test to track / simulate similar behaviour as in #2960

* address some of Chris' review comments

* address some more of Chris' review comments

* temporarily pushing branch with the following changes:
The total power might change if:
   - a validator is added
   - a validator is removed
   - a validator is updated

Decrement the accums (of all validators) directly after any of these events
(by the inverse of the change)

* Fix 2960 by re-normalizing / scaling priorities to be in bounds of total
power, additionally:

 - remove heap where it doesn't make sense
 - avg. only at the end of IncrementProposerPriority instead of each
   iteration
 - update (and slightly improve)
   TestAveragingInIncrementProposerPriorityWithVotingPower to reflect
   above changes

* Fix 2960 by re-normalizing / scaling priorities to be in bounds of total
power, additionally:

 - remove heap where it doesn't make sense
 - avg. only at the end of IncrementProposerPriority instead of each
   iteration
 - update (and slightly improve)
   TestAveragingInIncrementProposerPriorityWithVotingPower to reflect
   above changes

* fix tests

* add comment

* update changelog pending & some minor changes

* comment about division will floor the result & fix typo

* Update TestLargeGenesisValidator:
 - remove TODO and increase large genesis validator's voting power
accordingly

* move changelog entry to P2P Protocol

* Ceil instead of flooring when dividing & update test

* quickly fix failing TestProposerPriorityDoesNotGetResetToZero:

 - divide by Ceil((maxPriority - minPriority) / 2*totalVotingPower)

* fix typo: rename getValWitMostPriority -> getValWithMostPriority

* test proposer frequencies

* return absolute value for diff. keep testing

* use for loop for div

* cleanup, more tests

* spellcheck

* get rid of using floats: manually ceil where necessary

* Remove float, simplify, fix tests to match chris's proof (#3157)
2019-01-19 15:55:08 -05:00
d3e8889411 update btcd fork for v0.1.1 (#3164)
* update btcd fork for v0.1.1

* changelog
2019-01-19 14:08:41 -05:00
d17969e378 Merge pull request #3154 from tendermint/master
Merge master back to develop
2019-01-18 12:39:21 -05:00
07263298bd Merge pull request #3153 from tendermint/release/v0.28.1
Release/v0.28.1
2019-01-18 12:38:48 -05:00
5a2e69df81 changelog and version 2019-01-18 12:11:02 -05:00
f5f1416a14 json2wal: increase reader's buffer size (#3147)
```
panic: failed to unmarshal json: unexpected end of JSON input

goroutine 1 [running]:
main.main()
	/root/gelgo/src/github.com/tendermint/tendermint/scripts/json2wal/main.go:66 +0x73f
```

Closes #3146
2019-01-18 12:09:12 +04:00
4d36647eea Add ParadigmCore to ecosystem.json (#3145)
Adding the OrderStream network client (alpha), ParadigmCore, to the `ecosystem.json` file.
2019-01-18 11:46:34 +04:00
8fd8f800d0 Bucky/fix evidence halt (#34)
* consensus: createProposalBlock function

* blockExecutor.CreateProposalBlock

- factored out of consensus pkg into a method on blockExec
- new private interfaces for mempool ("txNotifier") and evpool with one function each
- consensus tests still require more mempool methods

* failing test for CreateProposalBlock

* Fix bug in include evidece into block

* evidence: change maxBytes to maxSize

* MaxEvidencePerBlock

- changed to return both the max number and the max bytes
- preparation for #2590

* changelog

* fix linter

* Fix from review

Co-Authored-By: ebuchman <ethan@coinculture.info>
2019-01-17 21:46:40 -05:00
87991059aa docs: fix RPC links (#3141) 2019-01-17 08:42:57 -05:00
c69dbb25ce Consolidates deadline tests for privval Unix/TCP (#3143)
* Consolidates deadline tests for privval Unix/TCP

Following on from #3115 and #3132, this converts fundamental timeout
errors from the client's `acceptConnection()` method so that these can
be detected by the test for the TCP connection.

Timeout deadlines are now tested for both TCP and Unix domain socket
connections.

There is also no need for the additional secret connection code: the
connection will time out at the `acceptConnection()` phase for TCP
connections, and will time out when attempting to obtain the
`RemoteSigner`'s public key for Unix domain socket connections.

* Removes extraneous logging

* Adds IsConnTimeout helper function

This commit adds a helper function to detect whether an error is either
a fundamental networking timeout error, or an `ErrConnTimeout` error
specific to the `RemoteSigner` class.

* Adds a test for the IsConnTimeout() helper function

* Separates tests logically for IsConnTimeout
2019-01-17 08:10:56 -05:00
bc8874020f docs: fix broken link (#3142) 2019-01-17 15:30:51 +04:00
55d7238708 Add comment to simple_merkle get_split_point (#3136)
* Add comment to simple_merkle get_split_point

* fix grammar error
2019-01-16 16:03:19 -05:00
4a037f9fe6 Merge pull request #3138 from tendermint/master
Merge master back to develop
2019-01-16 16:02:51 -05:00
aa40cfcbb9 Merge pull request #3135 from tendermint/release/v0.28.0
Release/v0.28.0
2019-01-16 16:01:58 -05:00
6d6d103f15 fixes from review (#3137) 2019-01-16 13:41:37 -05:00
239ebe2076 fix changelog fmt (#3134) 2019-01-16 10:21:15 -05:00
0cba0e11b5 update changelog and upgrading (#3133) 2019-01-16 10:16:23 -05:00
d4e6720541 Expanding tests to cover Unix sockets version of client (#3132)
* Adds a random suffix to temporary Unix sockets during testing

* Adds Unix domain socket tests for client (FAILING)

This adds Unix domain socket tests for the privval client. Right now,
one of the tests (TestRemoteSignerRetry) fails, probably because the
Unix domain socket state is known instantaneously on both sides by the
OS. Committing this to collaborate on the error.

* Removes extraneous logging

* Completes testing of Unix sockets client version

This completes the testing of the client connecting via Unix sockets.
There are two specific tests (TestSocketPVDeadline and
TestRemoteSignerRetryTCPOnly) that are only relevant to TCP connections.

* Renames test to show TCP-specificity

* Adds testing into closures for consistency (forgot previously)

* Moves test specific to RemoteSigner into own file

As per discussion on #3132, `TestRemoteSignerRetryTCPOnly` doesn't
really belong with the client tests. This moves it into its own file
related to the `RemoteSigner` class.
2019-01-16 10:05:34 -05:00
dcb8f88525 add "chain_id" label for all metrics (#3123)
* add "chain_id" label for all metrics

Refs #3082

* fix labels extraction
2019-01-15 12:16:33 -05:00
a2a62c9be6 Merge pull request #3121 from thanethomson/release/v0.28.0
Adds tests for Unix sockets
2019-01-15 18:17:50 +02:00
3191ee8bad Dropping "construct" prefix as per #3121 2019-01-15 18:06:57 +02:00
308b7e3bbe Merge branch 'release/v0.28.0' into release/v0.28.0 2019-01-15 17:58:33 +02:00
73ea5effe5 docs: update link for rpc docs (#3129) 2019-01-15 17:12:35 +04:00
d1afa0ed6c privval: fixes from review (#3126)
https://github.com/tendermint/tendermint/pull/2923#pullrequestreview-192065694
2019-01-15 16:55:57 +04:00
ca00cd6a78 Make privval listener testing generic
This cuts out two tests by constructing test cases and iterating through
them, rather than having separate sets of tests for TCP and Unix listeners.
This is as per the feedback from #3121.
2019-01-15 10:14:41 +02:00
4daca1a634 return maxPerPage (not defaultPerPage) if per_page is greater than max (#3124)
it's more user-friendly.

Refs #3065
2019-01-14 17:35:31 -05:00
bc00a032c1 makefile: fix build-docker-localnode target (#3122)
cd does not work because it's executed in a subprocess
so it has to be either chained by && or ;
See https://stackoverflow.com/q/1789594/820520
for more details.

Fixes #3058
2019-01-14 17:33:33 -05:00
5f4d8e031e [log] fix year format (#3125)
Refs #3060
2019-01-14 14:10:13 -05:00
7b2c4bb493 update ADR-020 (#3116) 2019-01-14 11:53:43 -05:00
5f93220c61 Adds tests for Unix sockets
As per #3115, adds simple Unix socket connect/accept deadline tests in
pretty much the same way as the TCP connect/accept deadline tests work.
2019-01-14 11:41:09 +02:00
ec53ce359b Simple merkle rfc compatibility (#2713)
* Begin simple merkle compatibility PR

* Fix query_test

* Use trillian test vectors

* Change the split point per RFC 6962

* update spec

* refactor innerhash to match spec

* Update changelog

* Address @liamsi's comments

* Write the comment requested by @liamsi
2019-01-13 18:02:38 -05:00
1f68318875 fix order of BlockID and Timestamp in Vote and Proposal (#3078)
* Consistent order fields of Timestamp/BlockID fields in CanonicalVote and
CanonicalProposal

* update spec too

* Introduce and use IsZero & IsComplete:
 - update IsZero method according to spec and introduce IsComplete
 - use methods in validate basic to validate: proposals come with a
 "complete" blockId and votes are either complete or empty
 - update spec: BlockID.IsNil() -> BlockID.IsZero() and fix typo

* BlockID comes first

* fix tests
2019-01-13 17:56:36 -05:00
1ccc0918f5 More ProposerPriority tests (#2966)
* more proposer priority tests

 - test that we don't reset to zero when updating / adding
 - test that same power validators alternate

* add another test to track / simulate similar behaviour as in #2960

* address some of Chris' review comments

* address some more of Chris' review comments
2019-01-13 17:40:50 -05:00
fc031d980b Bucky/v0.28.0 (#3119)
* changelog pending and upgrading

* linkify and version bump

* changelog shuffle
2019-01-13 17:15:34 -05:00
1895cde590 [WIP] Fill in consensus core details in ADR 030 (#2696)
* Initial work towards making ConsensusCore spec complete

* Initial version of executor and complete consensus
2019-01-13 14:47:00 -05:00
be00cd1add Hotfix/validating query result length (#3053)
* Validating that there are txs in the query results before loop throught the array

* Created tests to validate the error has been fixed

* Added comments

* Fixing misspeling

* check if the variable "skipCount" is bigger than zero. If it is not, we set it to 0. If it, we do not do anything.

* using function that validates the skipCount variable

* undo Gopkg.lock changes
2019-01-13 14:34:29 -05:00
a6011c007d Close and retry a RemoteSigner on err (#2923)
* Close and recreate a RemoteSigner on err

* Update changelog

* Address Anton's comments / suggestions:

 - update changelog
 - restart TCPVal
 - shut down on `ErrUnexpectedResponse`

* re-init remote signer client with fresh connection if Ping fails

- add/update TODOs in secret connection
- rename tcp.go -> tcp_client.go, same with ipc to clarify their purpose

* account for `conn returned by waitConnection can be `nil`

- also add TODO about RemoteSigner conn field

* Tests for retrying: IPC / TCP

 - shorter info log on success
 - set conn and use it in tests to close conn

* Tests for retrying: IPC / TCP

 - shorter info log on success
 - set conn and use it in tests to close conn
 - add rwmutex for conn field in IPC

* comments and doc.go

* fix ipc tests. fixes #2677

* use constants for tests

* cleanup some error statements

* fixes #2784, race in tests

* remove print statement

* minor fixes from review

* update comment on sts spec

* cosmetics

* p2p/conn: add failing tests

* p2p/conn: make SecretConnection thread safe

* changelog

* IPCVal signer refactor

- use a .reset() method
- don't use embedded RemoteSignerClient
- guard RemoteSignerClient with mutex
- drop the .conn
- expose Close() on RemoteSignerClient

* apply IPCVal refactor to TCPVal

* remove mtx from RemoteSignerClient

* consolidate IPCVal and TCPVal, fixes #3104

- done in tcp_client.go
- now called SocketVal
- takes a listener in the constructor
- make tcpListener and unixListener contain all the differences

* delete ipc files

* introduce unix and tcp dialer for RemoteSigner

* rename files

- drop tcp_ prefix
- rename priv_validator.go to file.go

* bring back listener options

* fix node

* fix priv_val_server

* fix node test

* minor cleanup and comments
2019-01-13 14:31:31 -05:00
ef94a322b8 Make SecretConnection thread safe (#3111)
* p2p/conn: add failing tests

* p2p/conn: make SecretConnection thread safe

* changelog

* fix from review
2019-01-13 13:46:25 -05:00
7f607d0ce2 docs: fix p2p readme links (#3109) 2019-01-11 17:41:02 -05:00
81c51cd4fc rpc: include peer's remote IP in /net_info (#3052)
Refs #3047
2019-01-11 09:24:45 -05:00
51094f9417 update README (#3097)
* update README

* fix from review
2019-01-11 08:28:29 -05:00
7644d27307 Ensure multisig keys have 20-byte address (#3103)
* Ensure multisig keys have 20-byte address

Use crypto.AddressHash() to avoid returning 32-byte long address.

Closes: #3102

* fix pointer

* fix test
2019-01-10 18:37:34 -05:00
764cfe33aa Don't use pointer receivers for PubKeyMultisigThreshold (#3100)
* Don't use pointer receivers for PubKeyMultisigThreshold

* test that showcases panic when PubKeyMultisigThreshold are used in sdk:

 - deserialization will fail in `readInfo` which tries to read a
 `crypto.PubKey` into a `localInfo` (called by
  cosmos-sdk/client/keys.GetKeyInfo)

* Update changelog

* Rename routeTable to nameTable, multisig key is no longer a pointer

* sed -i 's/PubKeyAminoRoute/PubKeyAminoName/g' `grep -lrw PubKeyAminoRoute .`

upon Jae's request

* AminoRoutes -> AminoNames

* sed -e 's/PrivKeyAminoRoute/PrivKeyAminoName/g'

* Update crypto/encoding/amino/amino.go

Co-Authored-By: alessio <quadrispro@ubuntu.com>
2019-01-10 17:47:20 -05:00
616c3a4bae cs: prettify logging of ignored votes (#3086)
Refs #3038
2019-01-06 12:00:12 +03:00
04e97f599a fix build scripts (#3085)
* fix build scripts

Search for the right variable when introspecting Go code. `Version` was
renamed to `TMCoreSemVer`.

This is regression introduced in
b95ac688af

* fix all `Version` introspections.

Use `TMCoreSemVer` instead of `Version`
2019-01-06 11:40:15 +03:00
56a4fb4d72 add signing spec (#3061)
* add signing spec

* fixes from review

* more fixes

* fixes from review
2019-01-02 17:18:45 -08:00
49017a5787 3070 [docs] unindent text as it is supposed to behave the same as the parts before (#3075) 2019-01-01 10:42:39 +03:00
6a80412a01 Remove privval.GetAddress(), memoize pubkey (#2948)
privval: remove GetAddress(), memoize pubkey
2018-12-22 00:36:45 -05:00
2348f38927 Update node_info.go (#3059) 2018-12-21 17:37:28 -05:00
41e2eeee9c R4R: Split immutable and mutable parts of priv_validator.json (#2870)
* split immutable and mutable parts of priv_validator.json

* fix bugs

* minor changes

* retrig test

* delete scripts/wire2amino.go

* fix test

* fixes from review

* privval: remove mtx

* rearrange priv_validator.go

* upgrade path

* write tests for the upgrade

* fix for unsafe_reset_all

* add test

* add reset test
2018-12-21 16:58:27 -05:00
a88e283a9d Merge pull request #3063 from tendermint/master
Merge master back to develop
2018-12-21 16:39:02 -05:00
1e1ca15bcc Merge pull request #3062 from tendermint/release/v0.27.4
Release/v0.27.4
2018-12-21 16:35:45 -05:00
c6604b5a9b changelog and version 2018-12-21 16:31:28 -05:00
c510f823e7 mempool: move tx to back, not front (#3036)
because we pop txs from the front if the cache is full

Refs #3035
2018-12-21 16:28:21 -05:00
daddebac29 circleci: update go version (#3051) 2018-12-19 21:45:12 +04:00
30f346fe44 docs: add rpc link to docs navbar and re-org sidebar (#3041)
* add rpc to docs navbar and close #3000

* Update config.js
2018-12-17 23:02:26 +04:00
4d8f29f79c set allow_duplicate_ip to false (#2992)
* config: cors options are arrays of strings, not strings

Fixes #2980

* docs: update tendermint-core/configuration.html page

* set allow_duplicate_ip to false

* in `tendermint testnet`, set allow_duplicate_ip to true

Refs #2712

* fixes after Ismail's review
2018-12-17 11:52:33 -05:00
2182f6a702 update go version & other cleanup (#3018)
* update go version & other cleanup

* fix lints

* go one.eleven.four

* keep circle on 1.11.3 for now
2018-12-17 11:51:53 -05:00
a06912b579 mempool: move tx to back, not front (#3036)
because we pop txs from the front if the cache is full

Refs #3035
2018-12-17 11:35:05 -05:00
0ff715125b fix docs / proxy app (#2988)
* fix docs / proxy app, closes #2986

* counter_serial

* review comments

* list all possible options

* add changelog entries
2018-12-16 23:34:13 -05:00
385977d5e8 Merge pull request #3033 from tendermint/master
Merge pull request #3032 from tendermint/release/v0.27.3
2018-12-16 14:30:46 -05:00
0138530df2 Merge pull request #3032 from tendermint/release/v0.27.3
Release/v0.27.3
2018-12-16 14:30:23 -05:00
0533c73a50 crypto: revert to mainline Go crypto lib (#3027)
* crypto: revert to mainline Go crypto lib

We used to use a fork for a modified bcrypt so we could pass our own
randomness but this was largely unecessary, unused, and a burden.
So now we just use the mainline Go crypto lib.

* changelog

* fix tests

* version and changelog
2018-12-16 14:19:38 -05:00
1beb45511c Merge pull request #3031 from tendermint/master
Merge pull request #3030 from tendermint/release/v0.27.2
2018-12-16 14:13:57 -05:00
4a568fcedb Merge pull request #3030 from tendermint/release/v0.27.2
Release/v0.27.2
2018-12-16 14:13:30 -05:00
b3141d7d02 makeNodeInfo returns error (#3029)
* makeNodeInfo returns error

* version and changelog
2018-12-16 14:05:58 -05:00
9a6dd96cba Revert to using defers in addrbook. (#3025)
* Revert to using defers in addrbook.  ValidateBasic->Validate since it requires DNS

* Update CHANGELOG_PENDING
2018-12-16 12:27:16 -05:00
9fa959619a Merge pull request #3026 from tendermint/master
Merge pull request #3023 from tendermint/release/v0.27.1
2018-12-16 12:25:19 -05:00
1f09818770 Merge pull request #3023 from tendermint/release/v0.27.1
Release/v0.27.1
2018-12-16 12:24:54 -05:00
e4806f980b Bucky/v0.27.1 (#3022)
* update changelog

* linkify

* changelog and version
2018-12-15 15:58:09 -05:00
b53a2712df docs: networks/docker-compose: small fixes (#3017) 2018-12-15 15:38:13 -05:00
a75dab492c #2980 fix cors doc (#3013) 2018-12-15 15:32:35 -05:00
7c9e767e1f 2980 fix cors (#3021)
* config: cors options are arrays of strings, not strings

Fixes #2980

* docs: update tendermint-core/configuration.html page

* set allow_duplicate_ip to false

* in `tendermint testnet`, set allow_duplicate_ip to true

Refs #2712

* fixes after Ismail's review

* Revert "set allow_duplicate_ip to false"

This reverts commit 24c1094ebcf2bd35f2642a44d7a1e5fb5c178fb1.
2018-12-15 15:26:27 -05:00
f82a8ff73a During replay, when appHeight==0, only saveState if stateHeight is also 0 (#3006)
* optimize addProposalBlockPart

* optimize addProposalBlockPart

* if ProposalBlockParts and LockedBlockParts both exist,let LockedBlockParts overwrite ProposalBlockParts.

* fix tryAddBlock

* broadcast lockedBlockParts in higher priority

* when appHeight==0, it's better fetch genDoc than state.validators.

* not save state if replay from height 1

* only save state if replay from height 1 when stateHeight is also 1

* only save state if replay from height 1 when stateHeight is also 1

* only save state if replay from height 0 when stateHeight is also 0

* handshake info's response version only update when stateHeight==0

* save the handshake responseInfo appVersion
2018-12-15 14:33:30 -05:00
ae275d791e mempool: notifyTxsAvailable if there're txs left, but recheck=false (#2991)
(left after committing a block)

Fixes #2961

--------------
ORIGINAL ISSUE

Tendermint version : 0.26.4-b771798d

ABCI app : kv-store

Environment:

OS (e.g. from /etc/os-release): macOS 10.14.1 What happened: Set
mempool.recheck = false and create empty block = false in config.toml.
When transactions get added right between a new empty block is being
proposed and committed, the proposer won't propose new block for that
transactions immediately after. That transactions are stuck in the
mempool until a new transaction is added and trigger the proposer.

What you expected to happen: If there is a transaction left in the
mempool, new block should be proposed immediately.

Have you tried the latest version: yes

How to reproduce it (as minimally and precisely as possible): Fire two
transaction using broadcast_tx_sync with specific delay between them.
(You may need to do it multiple time before the right delay is found, on
my machine the delay is 0.98s)

Logs (paste a small part showing an error (< 10 lines) or link a
pastebin, gist, etc. containing more of the log file):
https://pastebin.com/0Wt6uhPF

Config (you can paste only the changes you've made): [mempool] recheck =
false create_empty_block = false

Anything else we need to know: In mempool.go, we found that proposer
will immediately propose new block if

Last committed block has some transaction (causing AppHash to changed)
or mem.notifyTxsAvailable() is called. Our scenario is as followed.

A transaction is fired, it will create 1 block with 1 tx (line 1-4 in
the log) and 1 empty block. After the empty block is proposed but before
it is committed, second transaction is fired and added to mempool. (line
8-16) Now, since the last committed block is empty and
mem.notifyTxsAvailable() will be called only if mempool.recheck = true.
The proposer won't immediately propose new block, causing the second
transaction to stuck in mempool until another transaction is added to
mempool and trigger mem.notifyTxsAvailable().
2018-12-15 14:27:02 -05:00
f5cca9f121 docs: update DOCS_README (#3019)
Co-Authored-By: zramsay <zach.ramsay@gmail.com>
2018-12-15 23:01:28 +04:00
3fbe9f235a docs: add edit on Github links (#3014) 2018-12-14 09:32:09 +04:00
f7e463f6d3 circleci: add a job to automatically update docs (#3005) 2018-12-12 13:48:53 +04:00
bc2a9b20c0 mempool: add a comment and missing changelog entry (#2996)
Refs #2994
2018-12-12 13:31:35 +04:00
9e075d8dd5 docs: enable full-text search (#3004) 2018-12-12 13:20:02 +04:00
8003786c9a docs: fixes from 'first time' review (#2999) 2018-12-11 22:21:54 +04:00
2594cec116 add UnconfirmedTxs/NumUnconfirmedTxs methods to HTTP/Local clients (#2964) 2018-12-11 12:41:02 +04:00
df32ea4be5 Make testing logger that doesn't write to stdout (#2997) 2018-12-11 12:17:21 +04:00
f69e2c6d6c p2p: set MConnection#created during init (#2990)
Fixes #2715

In crawlPeersRoutine, which is performed when seedMode is run, there is
logic that disconnects the peer's state information at 3-hour intervals
through the duration value. The duration value is calculated by
referring to the created value of MConnection. When MConnection is
created for the first time, the created value is not initiated, so it is
not disconnected every 3 hours but every time it is disconnected. So,
normal nodes are connected to seedNode and disconnected immediately, so
address exchange does not work properly.

https://github.com/tendermint/tendermint/blob/master/p2p/pex/pex_reactor.go#L629
This point is not work correctly.
I think,
https://github.com/tendermint/tendermint/blob/master/p2p/conn/connection.go#L148
created variable is missing the current time setting.
2018-12-10 15:24:58 -05:00
d5d0d2bd77 Make mempool fail txs with negative gas wanted (#2994)
This is only one part of #2989. We also need to fix the application,
and add rules to consensus to ensure this.
2018-12-10 12:56:49 -05:00
41eaf0e31d turn off strict routability every time (#2983)
previously, we're turning it off only when --populate-persistent-peers
flag was used, which is obviously incorrect.

Fixes https://github.com/cosmos/cosmos-sdk/issues/2983
2018-12-09 13:29:51 -05:00
68b467886a docs: relative links in docs/spec/readme.md, js-amino lib (#2977)
Co-Authored-By: zramsay <zach.ramsay@gmail.com>
2018-12-07 19:41:19 +04:00
2f64717bb5 return an error if validator set is empty in genesis file and after InitChain (#2971)
Fixes #2951
2018-12-07 12:30:58 +04:00
c4a1cfc5c2 don't ignore key when executing CONTAINS (#2924)
Fixes #2912
2018-12-07 12:28:02 +04:00
0f96bea41d Merge pull request #2976 from tendermint/master
Merge pull request #2975 from tendermint/release/v0.27.0
2018-12-05 16:51:04 -05:00
9c236ffd6c Merge pull request #2975 from tendermint/release/v0.27.0
Release/v0.27.0
2018-12-05 16:50:36 -05:00
9f8761d105 update changelog and upgrading (#2974) 2018-12-05 15:19:30 -05:00
5413c11150 kv indexer: add separator to start key when matching ranges (#2925)
* kv indexer: add separator to start key when matching ranges

to avoid including false positives

Refs #2908

* refactor code

* add a test case
2018-12-05 14:21:46 -05:00
a14fd8eba0 p2p: fix peer count mismatch #2332 (#2969)
* p2p: test case for peer count mismatch #2332

* p2p: fix peer count mismatch #2332

* changelog

* use httptest.Server to scrape Prometheus metrics
2018-12-05 07:32:27 -05:00
1bb7e31d63 p2p: panic on transport error (#2968)
* p2p: panic on transport error

Addresses #2823. Currently, the acceptRoutine exits if the transport returns
an error trying to accept a new connection. Once this happens, the node
can't accept any new connections. So here, we panic instead. While we
could potentially be more intelligent by rerunning the acceptRoutine, the
error may indicate something more fundamental (eg. file desriptor limit)
that requires a restart anyways. We can leave it to process managers to
handle that restart, and notify operators about the panic.

* changelog
2018-12-04 19:16:06 -05:00
222b8978c8 Minor log changes (#2959)
* node: allow state and code to have diff block versions

* node: pex is a log module
2018-12-04 08:30:29 -05:00
d9a1aad5c5 docs: add client#Start/Stop to examples in RPC docs (#2939)
follow-up on https://github.com/tendermint/tendermint/pull/2936
2018-12-03 16:17:06 +04:00
8ef0c2681d check if deliverTxResCh is still open, return an err otherwise (#2947)
deliverTxResCh, like any other eventBus (pubsub) channel, is closed when
eventBus is stopped. We must check if the channel is still open. The
alternative approach is to not close any channels, which seems a bit
odd.

Fixes #2408
2018-12-03 16:15:36 +04:00
c4d93fd27b explicitly type MaxTotalVotingPower to int64 (#2953) 2018-11-30 14:43:16 -05:00
dc2a338d96 Bucky/v0.27.0 (#2950)
* update changelog

* changelog, upgrading, version
2018-11-30 14:05:16 -05:00
725ed7969a Add some ProposerPriority tests (#2946)
* WIP: tests for #2785

* rebase onto develop

* add Bucky's test without changing ValidatorSet.Update

* make TestValidatorSetBasic fail

* add ProposerPriority preserving fix to ValidatorSet.Update to fix
TestValidatorSetBasic

* fix randValidator_ to stay in bounds of MaxTotalVotingPower

* check for expected proposer and remove some duplicate code

* actually limit the voting power of random validator ...

* fix test
2018-11-29 17:03:41 -05:00
44b769b1ac types: ValidatorSet.Update preserves Accum (#2941)
* types: ValidatorSet.Update preserves ProposerPriority

This solves the other issue discovered as part of #2718,
where Accum (now called ProposerPriority) is reset to
0 every time a validator is updated.

* update changelog

* add test

* update comment

* Update types/validator_set_test.go

Co-Authored-By: ebuchman <ethan@coinculture.info>
2018-11-29 08:26:12 -05:00
380afaa678 docs: update ecosystem.json: add Rust ABCI (#2945) 2018-11-29 15:57:11 +04:00
b30c34e713 rename Accum -> ProposerPriority: (#2932)
- rename fields, methods, comments, tests
2018-11-28 15:35:09 -05:00
4039276085 remove unnecessary "crypto" import alias (#2940) 2018-11-28 23:53:04 +04:00
3f987adc92 Set accum of freshly added validator -(total voting power) (#2785)
* set the accum of a new validator to (-total voting power):

- disincentivize validators to unbond, then rebon to reset their
negative Accum to zero

additional unrelated changes:
- do not capitalize error msgs
- fix typo

* review comments: (re)capitalize errors & delete obsolete comments

* More changes suggested by @melekes

* WIP: do not batch clip (#2809)

* substract avgAccum on each iteration

- temporarily skip test

* remove unused method safeMulClip / safeMul

* always substract the avg accum

 - temp. skip another test

* remove overflow / underflow tests & add tests for avgAccum:

- add test for computeAvgAccum
- as we substract the avgAccum now we will not trivially over/underflow

* address @cwgoes' comments

* shift by avg at the end of IncrementAccum

* Add comment to MaxTotalVotingPower

* Guard inputs to not exceed MaxTotalVotingPower

* Address review comments:

 - do not fetch current validator from set again
 - update error message

* Address a few review comments:

 - fix typo
 - extract variable

* address more review comments:

 - clarify 1.125*totalVotingPower == totalVotingPower + (totalVotingPower >> 3)

* review comments: panic instead of "clipping":

 - total voting power is guarded to not exceed MaxTotalVotingPower ->
 panic if this invariant is violated

* fix failing test
2018-11-28 13:12:17 -05:00
b11788d36d types: NewValidatorSet doesn't panic on empty valz list (#2938)
* types: NewValidatorSet doesn't panic on empty valz list

* changelog
2018-11-28 13:09:29 -05:00
9adcfe2804 docs: add client.Start() to RPC WS examples (#2936) 2018-11-28 20:55:18 +04:00
3d15579e0c docs: fix js-abci example (#2935) 2018-11-28 20:29:26 +04:00
4571f0fbe8 Enforce validators can only use the correct pubkey type (#2739)
* Enforce validators can only use the correct pubkey type

* adapt to variable renames

* Address comments from #2636

* separate updating and validation logic

* update spec

* Add test case for TestStringSliceEqual, clarify slice copying code

* Address @ebuchman's comments

* Split up testing validator update execution, and its validation
2018-11-28 09:09:27 -05:00
8a73feae14 Merge pull request #2934 from tendermint/master
Merge pull request #2922 from tendermint/release/v0.26.4
2018-11-28 08:56:39 -05:00
e291fbbebe 2871 remove proposalHeartbeat infrastructure (#2874)
* 2871 remove proposalHeartbeat infrastructure

* 2871 add preliminary changelog entry
2018-11-28 08:52:34 -05:00
416d143bf7 R4R: Swap start/end in ReverseIterator (#2913)
* Swap start/end in ReverseIterator

* update CHANGELOG_PENDING

* fixes from review
2018-11-28 08:49:24 -05:00
7213869fc6 Refactor updateState #2865 (#2929)
* Refactor updateState #2865

* Apply suggestions from code review

Co-Authored-By: danil-lashin <danil-lashin@yandex.ru>

* Apply suggestions from code review
2018-11-28 08:32:16 -05:00
ef9902e602 docs: small improvements (#2933)
* update docs

- make install_c cmd (install)
- explain node IDs (quick-start)
- update UPGRADING section (using-tendermint)

* use git clone with JS example

JS devs may not have Go installed and we should not force them to.

* rewrite sentence
2018-11-28 08:25:23 -05:00
b771798d48 Merge pull request #2922 from tendermint/release/v0.26.4
Release/v0.26.4
2018-11-27 08:51:45 -05:00
1abf34aa91 Prepare v0.26.4 changelog (#2921)
* prepare changelog

* linkify changelog

* changelog and version

* update changelog
2018-11-27 08:43:21 -05:00
92dc5fc77a don't return false positives when searching for a prefix of a tag value (#2919)
Fixes #2908
2018-11-27 08:12:28 -05:00
bef39f3346 Updated Marshal and unmarshal methods to make compatible with protobuf (#2918)
* upadtes in grpc Marshal and unmarshal

* update comments
2018-11-27 08:07:20 -05:00
94e63be922 [indexer] order results by index if height is the same (#2900)
Fixes #2775
2018-11-27 07:53:06 -05:00
9570ac4d3e rpc: Fix tx.height range queries (#2899)
Modify lookForHeight to return a height only there's a equal operator.
Previously, it was returning a height even for range conditions: "height
< 10000".

Fixes #2759
2018-11-27 07:47:50 -05:00
99b9c9bf60 types: Emit tags from BeginBlock/EndBlock (#2747)
This commit makes both EventNewBlock and EventNewBlockHeader emit tags
on the event bus, so subscribers can use them in queries.
2018-11-26 22:21:42 -05:00
47a0669d12 Fix fast sync stack with wrong block #2457 (#2731)
* fix fastsync may stuck by a wrong block

* fixes from updates

* fixes from review

* Align spec with the changes

* fmt
2018-11-26 15:31:11 -05:00
fe3b97fd66 It's better read from genDoc than from state.validators when appHeight==0 in replay (#2893)
* optimize addProposalBlockPart

* optimize addProposalBlockPart

* if ProposalBlockParts and LockedBlockParts both exist,let LockedBlockParts overwrite ProposalBlockParts.

* fix tryAddBlock

* broadcast lockedBlockParts in higher priority

* when appHeight==0, it's better fetch genDoc than state.validators.
2018-11-26 08:03:08 -05:00
56052c0a87 update encoding spec (#2903)
Quick fix for #2902
2018-11-26 12:24:32 +04:00
98e442a8de return back initially allowed level if we encounter allowed key (#2889)
Fixes #2868 where module=main setting overrides all others
2018-11-25 23:34:22 -05:00
b12488b5f1 Handling integer IDs in JSON-RPC requests -- fixes #2366 (#2811)
* Fixed accepting integer IDs in requests for Tendermint RPC server (#2366)

* added a wrapper interface `jsonrpcid` that represents both string and int IDs in JSON-RPC requests/responses + custom JSON unmarshallers

* changed client-side code in RPC that uses it

* added extra tests for integer IDs

* updated CHANGELOG_PENDING, as suggested by PR instructions

* addressed PR comments

* added table driven tests for request type marshalling/unmarshalling
* expanded handler test to check IDs
* changed pending changelog note

* changed json rpc request/response unmarshalling to use empty interfaces and type switches on ID

* some cleanup
2018-11-25 23:33:40 -05:00
b487feba42 node: refactor privValidator ext client code & tests (#2895)
* update ConsensusState#OnStop comment

* consensus: set logger for WAL in tests

* refactor privValidator client code and tests

follow-up on https://github.com/tendermint/tendermint/pull/2866
2018-11-21 21:24:13 +04:00
72f86b5192 [pv] add ability to use ipc validator (#2866)
Ref #2827

(I have since seen #2847 which is a fix for the same issue; this PR has tests and docs too ;) )
2018-11-21 10:45:20 +04:00
42592d9ae0 IncrementAccum upon RPC /validators; Sanity checks and comments (#2808) 2018-11-21 10:43:02 +04:00
1610a05cbd Remove counter from every mempoolTx (#2891)
Within every tx in the mempool, we store a 64 bit counter,
as an index for when it was inserted into the mempool.
This counter doesn't really serve any purpose.
It was likely added for debugging at one point,
Removing the counter reclaims memory,
which enables greater mempool sizes / mitigates resources at the same size.

Closes #2835
2018-11-21 10:33:41 +04:00
2d525bf2b8 mempool: add txs from Update to cache
We should add txs that come in from mempool.Update to the mempool's
cache, so that they never hit a potentially expensive check tx.

Originally posted by @ValarDragon in #2846
https://github.com/tendermint/tendermint/issues/2846#issuecomment-439216656

Refs #2855
2018-11-20 10:47:30 +04:00
e9efbfe267 refactor mempool.Update
- rename filterTxs to removeTxs
- move txsMap into removeTxs func
- rename goodTxs to txsLeft
2018-11-20 10:47:30 +04:00
7b883a5457 docs/install: prepend cp to /usr/local with sudo (#2885)
Closes #2884
2018-11-20 10:27:58 +04:00
fd8d1d6b69 add BlockTimeIota to the config.toml (#2878)
Refs #2877
2018-11-19 20:15:23 +04:00
5abdd254e7 Merge pull request #2875 from tendermint/master
Merge pull request #2873 from tendermint/release/v0.26.3
2018-11-17 18:25:46 -05:00
22dcc92232 Merge pull request #2873 from tendermint/release/v0.26.3
Release/v0.26.3
2018-11-17 18:25:12 -05:00
ccf6b2b512 Bucky/v0.26.3 (#2872)
* update CONTRIBUTING with notes on CHANGELOG

* update changelog

* changelog and version
2018-11-17 16:04:05 -05:00
1466a2cc9f #2815 do not broadcast heartbeat proposal when we are non-validator (#2819)
* #2815 do not broadcast heartbeat proposal when we are non-validator

* #2815 adding preliminary changelog entry

* #2815 cosmetics and added test

* #2815 missed a little detail

- it's enough to call getAddress() once here

* #2815 remove debug logging from tests

* #2815 OK. I seem to be doing something fundamentally wrong here

* #2815 next iteration of proposalHeartbeat tests

- try and use "ensure" pattern in common_test

* 2815 incorporate review comments
2018-11-17 15:23:39 -05:00
6168b404a7 p2p: NewMultiplexTransport takes an MConnConfig (#2869)
* p2p: NewMultiplexTransport takes an MConnConfig

* changelog

* move test func to test file
2018-11-17 03:16:49 -05:00
e6fc10faf6 R4R: Add timeouts to http servers (#2780)
* Replaces our current http servers where connections stay open forever with ones with timeouts to prevent file descriptor exhaustion

* Use the correct handler

* Put in go routines

* fix err

* changelog

* rpc: export Read/WriteTimeout

The `broadcast_tx_commit` endpoint has it's own timeout.
If this is longer than the http server's WriteTimeout, the
user will receive an error. Here, we export the WriteTimeout
and set the broadcast_tx_commit timeout to be less than it.

In the future, we should use a config struct for the timeouts
to avoid the need to export. The broadcast_tx_commit timeout
may also become configurable, but we must check that it's less
than the server's WriteTimeout.
2018-11-17 03:10:22 -05:00
60018d6148 comment out until someone decides to tackle #2285 (#2760)
current code results in panic and we certainly don't want that.
https://github.com/tendermint/tendermint/pull/2286#issuecomment-418281846
2018-11-16 18:17:07 -05:00
0d5e0d2f13 p2p/conn: FlushStop. Use in pex. Closes #2092 (#2802)
* p2p/conn: FlushStop. Use in pex. Closes #2092

In seed mode, we call StopPeer immediately after Send.
Since flushing msgs to the peer happens in the background,
the peer connection is often closed before the messages are
actually sent out. The new FlushStop method allows all msgs
to first be written and flushed out on the conn before it is closed.

* fix dummy peer

* typo

* fixes from review

* more comments

* ensure pex doesn't call FlushStop more than once

FlushStop is not safe to call more than once,
but we call it from Receive in a go-routine so Receive
doesn't block.

To ensure we only call it once, we use the lastReceivedRequests
map - if an entry already exists, then FlushStop should already have
been called and we can return.
2018-11-16 17:44:19 -05:00
2cfdef6111 Make "Update to validators" msg value pretty (#2848)
* Make "Update to validators" msg value pretty #2765

* New format for logging validator updates

* Refactor logging validator updates

* Fix changelog item

* fix merge conflict
2018-11-16 17:38:22 -05:00
b90e06a37c More verbose error log (#2864) 2018-11-16 17:36:42 -05:00
e6a0d098e8 small fixes to spec & http_server & Vagrantfile (#2859)
* Vagrantfile: install dev_tools

Follow-up on https://github.com/tendermint/tendermint/pull/2824

* update consensus params spec

* fix test name

* rpc_test: panic if failed to start listener

also
- remove http_server#MustListen
- align StartHTTPServer and StartHTTPAndTLSServer functions

* dep: allow minor releases for grpc
2018-11-16 12:58:30 -05:00
d8ab8509de p2p: log 'Send failed' on Debug (#2857) 2018-11-16 11:37:58 +04:00
85bba82154 Merge pull request #2858 from tendermint/master
Merge pull request #2851 from tendermint/release/v0.26.2
2018-11-15 18:42:47 -05:00
d5a05eccba Merge pull request #2851 from tendermint/release/v0.26.2
Release/v0.26.2
2018-11-15 18:41:54 -05:00
a676c71678 [R4R] Add proposer to NewRound event and proposal info to CompleteProposal event (#2767)
* add proposer info to EventCompleteProposal

* create separate EventData structure for CompleteProposal

* cant us rs.Proposal to get BlockID because it is not guaranteed to be set yet

* copying RoundState isnt helping us here

* add Step back to make compatible with original RoundState event. update changelog

* add NewRound event

* fix test

* remove unneeded RoundState

* put height round step into a struct

* pull out ValidatorInfo struct. add ensureProposal assert

* remove height-round-state sub-struct refactor

* minor fixes from review
2018-11-15 18:40:42 -05:00
c033975a53 docs ADR (#2828)
* wip

* use same ADR template as SDK

* finish docs adr

* lil fixes
2018-11-15 18:08:24 -05:00
06225e332e Config option for JSON output formatter (#2843)
* Introduce a structured logging option

* rename StructuredLog to LogFormat

* add changelog entry

* move log_format under log_level
2018-11-15 18:05:06 -05:00
b646437ec7 Decouple StartHTTP{,AndTLS}Server from Listen() (#2791)
* Decouple StartHTTP{,AndTLS}Server from Listen()

This should help solve cosmos/cosmos-sdk#2715

* Fix small mistake

* Update StartGRPCServer

* s/rpc/rpcserver/

* Start grpccore.StartGRPCServer in a goroutine

* Reinstate l.Close()

* Fix rpc/lib/test/main.go

* Update code comment

* update changelog and comments

* fix tm-monitor. more comments
2018-11-15 15:33:04 -05:00
be8c2d5018 use a github link (#2849) 2018-11-15 14:41:40 -05:00
e93b492efe do not pin deps to exact versions (#2844)
because
- they are locked in .lock file already
- individual dependencies can be updated with `dep ensure -update XXX`
- review process (and ^^^) should help us prevent accidental updates

Closes #2798
2018-11-15 14:40:18 -05:00
9973decff9 changelog, versionbump (#2850) 2018-11-15 12:16:24 -05:00
a0412357c1 update some top-level markdown files (#2841)
* update some top-level markdown files

* Update README.md

Co-Authored-By: ebuchman <ethan@coinculture.info>
2018-11-15 12:04:47 -05:00
a70a53254d Optimize: using parameters in func (#2845)
Signed-off-by: Zeyu Zhu <zhuzeyu0409@gmail.com>
2018-11-15 19:57:13 +04:00
1ce24a6282 docs: update config: ref #2800 & #2837 2018-11-15 10:23:00 +04:00
814a88a69b more maintainable/useful install scripts 2018-11-15 10:23:00 +04:00
6353862ac0 2582 Enable CORS on RPC API (#2800) 2018-11-14 16:47:41 +04:00
3af11c43f2 cleanup ecosystem docs (#2829) 2018-11-14 14:52:01 +04:00
27fcf96556 update genesis docs, closes #2814 (#2831) 2018-11-14 14:34:10 +04:00
bb0e17dbf0 arm: add install script, fix Makefile (#2824)
* be like the SDK makefile

* arm: add install script, fix Makefile

* ...
2018-11-14 14:17:07 +04:00
5a6822c8ac abci: localClient improvements & bugfixes & pubsub Unsubscribe issues (#2748)
* use READ lock/unlock in ConsensusState#GetLastHeight

Refs #2721

* do not use defers when there's no need

* fix peer formatting (output its address instead of the pointer)

```
[54310]: E[11-02|11:59:39.851] Connection failed @ sendRoutine              module=p2p peer=0xb78f00 conn=MConn{74.207.236.148:26656} err="pong timeout"
```

https://github.com/tendermint/tendermint/issues/2721#issuecomment-435326581

* panic if peer has no state

https://github.com/tendermint/tendermint/issues/2721#issuecomment-435347165

It's confusing that sometimes we check if peer has a state, but most of
the times we expect it to be there

1. add79700b5/mempool/reactor.go (L138)
2. add79700b5/rpc/core/consensus.go (L196) (edited)

I will change everything to always assume peer has a state and panic
otherwise

that should help identify issues earlier

* abci/localclient: extend lock on app callback

App callback should be protected by lock as well (note this was already
done for InitChainAsync, why not for others???). Otherwise, when we
execute the block, tx might come in and call the callback in the same
time we're updating it in execBlockOnProxyApp => DATA RACE

Fixes #2721

Consensus state is locked

```
goroutine 113333 [semacquire, 309 minutes]:
sync.runtime_SemacquireMutex(0xc00180009c, 0xc0000c7e00)
        /usr/local/go/src/runtime/sema.go:71 +0x3d
sync.(*RWMutex).RLock(0xc001800090)
        /usr/local/go/src/sync/rwmutex.go:50 +0x4e
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).GetRoundState(0xc001800000, 0x0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:218 +0x46
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusReactor).queryMaj23Routine(0xc0017def80, 0x11104a0, 0xc0072488f0, 0xc007248
9c0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/reactor.go:735 +0x16d
created by github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusReactor).AddPeer
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/reactor.go:172 +0x236
```

because localClient is locked

```
goroutine 1899 [semacquire, 309 minutes]:
sync.runtime_SemacquireMutex(0xc00003363c, 0xc0000cb500)
        /usr/local/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000033638)
        /usr/local/go/src/sync/mutex.go:134 +0xff
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/abci/client.(*localClient).SetResponseCallback(0xc0001fb560, 0xc007868540)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/abci/client/local_client.go:32 +0x33
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/proxy.(*appConnConsensus).SetResponseCallback(0xc00002f750, 0xc007868540)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/proxy/app_conn.go:57 +0x40
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/state.execBlockOnProxyApp(0x1104e20, 0xc002ca0ba0, 0x11092a0, 0xc00002f750, 0xc0001fe960, 0xc000bfc660, 0x110cfe0, 0xc000090330, 0xc9d12, 0xc000d9d5a0, ...)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/state/execution.go:230 +0x1fd
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(0xc002c2a230, 0x7, 0x0, 0xc000eae880, 0x6, 0xc002e52c60, 0x16, 0x1f927, 0xc9d12, 0xc000d9d5a0, ...)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/state/execution.go:96 +0x142
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit(0xc001800000, 0x1f928)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:1339 +0xa3e
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit(0xc001800000, 0x1f928)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:1270 +0x451
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1(0xc001800000, 0x0, 0x1f928)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:1218 +0x90
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit(0xc001800000, 0x1f928, 0x0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:1247 +0x6b8
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote(0xc001800000, 0xc003d8dea0, 0xc000cf4cc0, 0x28, 0xf1, 0xc003bc7ad0, 0xc003bc7b10)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:1659 +0xbad
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote(0xc001800000, 0xc003d8dea0, 0xc000cf4cc0, 0x28, 0xf1, 0xf1, 0xf1)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:1517 +0x59
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg(0xc001800000, 0xd98200, 0xc0070dbed0, 0xc000cf4cc0, 0x28)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:660 +0x64b
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine(0xc001800000, 0x0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:617 +0x670
created by github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/consensus/state.go:311 +0x132
```

tx comes in and CheckTx is executed right when we execute the block

```
goroutine 111044 [semacquire, 309 minutes]:
sync.runtime_SemacquireMutex(0xc00003363c, 0x0)
        /usr/local/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000033638)
        /usr/local/go/src/sync/mutex.go:134 +0xff
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync(0xc0001fb0e0, 0xc002d94500, 0x13f, 0x280, 0x0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/abci/client/local_client.go:85 +0x47
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync(0xc00002f720, 0xc002d94500, 0x13f, 0x280, 0x1)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/proxy/app_conn.go:114 +0x51
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/mempool.(*Mempool).CheckTx(0xc002d3a320, 0xc002d94500, 0x13f, 0x280, 0xc0072355f0, 0x0, 0x0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/mempool/mempool.go:316 +0x17b
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/core.BroadcastTxSync(0xc002d94500, 0x13f, 0x280, 0x0, 0x0, 0x0)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/core/mempool.go:93 +0xb8
reflect.Value.call(0xd85560, 0x10326c0, 0x13, 0xec7b8b, 0x4, 0xc00663f180, 0x1, 0x1, 0xc00663f180, 0xc00663f188, ...)
        /usr/local/go/src/reflect/value.go:447 +0x449
reflect.Value.Call(0xd85560, 0x10326c0, 0x13, 0xc00663f180, 0x1, 0x1, 0x0, 0x0, 0xc005cc9344)
        /usr/local/go/src/reflect/value.go:308 +0xa4
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/lib/server.makeHTTPHandler.func2(0x1102060, 0xc00663f100, 0xc0082d7900)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/lib/server/handlers.go:269 +0x188
net/http.HandlerFunc.ServeHTTP(0xc002c81f20, 0x1102060, 0xc00663f100, 0xc0082d7900)
        /usr/local/go/src/net/http/server.go:1964 +0x44
net/http.(*ServeMux).ServeHTTP(0xc002c81b60, 0x1102060, 0xc00663f100, 0xc0082d7900)
        /usr/local/go/src/net/http/server.go:2361 +0x127
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x10f8a40, 0xc002c81b60, 0xf4240, 0x1102060, 0xc00663f100, 0xc0082d7900)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:219 +0xcf
github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x1103220, 0xc00121e620, 0xc0082d7900)
        /root/go/src/github.com/MinterTeam/minter-go-node/vendor/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:192 +0x394
net/http.HandlerFunc.ServeHTTP(0xc002c06ea0, 0x1103220, 0xc00121e620, 0xc0082d7900)
        /usr/local/go/src/net/http/server.go:1964 +0x44
net/http.serverHandler.ServeHTTP(0xc001a1aa90, 0x1103220, 0xc00121e620, 0xc0082d7900)
        /usr/local/go/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc00785a3c0, 0x11041a0, 0xc000f844c0)
        /usr/local/go/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2851 +0x2f5
```

* consensus: use read lock in Receive#VoteMessage

* use defer to unlock mutex because application might panic

* use defer in every method of the localClient

* add a changelog entry

* drain channels before Unsubscribe(All)

Read 55362ed766/libs/pubsub/pubsub.go (L13)
for the detailed explanation of the issue.

We'll need to fix it someday. Make sure to keep an eye on
https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-033-pubsub.md

* retry instead of panic when peer has no state in reactors other than consensus

in /dump_consensus_state RPC endpoint, skip a peer with no state

* rpc/core/mempool: simplify error messages

* rpc/core/mempool: use time.After instead of timer

also, do not log DeliverTx result (to be consistent with other memthods)

* unlock before calling the callback in reqRes#SetCallback
2018-11-13 11:32:51 -05:00
fb10209a96 update to amino 0.14.1 (#2822) 2018-11-13 11:54:43 +04:00
0f793a5a00 Merge pull request #2813 from tendermint/master
Merge pull request #2807 from tendermint/release/v0.26.1
2018-11-12 08:05:12 -05:00
80d0a36250 Merge pull request #2807 from tendermint/release/v0.26.1
Release/v0.26.1
2018-11-12 08:04:27 -05:00
e11699038d [R4R] Add adr-034: PrivValidator file structure (#2751)
* add adr-034

* update changelog

* minor changes

* do some refactor
2018-11-11 14:47:34 -05:00
533b3cfb73 Release/v0.26.1 (#2803)
* changelog and version

* fix changelog
2018-11-11 12:08:28 -05:00
3ff820bdf4 fix amino overhead computation for Tx (#2792)
* fix amino overhead computation for Tx:

- also count the fieldnum / typ3
- add method to compute overhead per Tx
- slightly clarify comment on MaxAminoOverheadForBlock
- add tests

* fix TestReapMaxBytesMaxGas according to amino overhead

* fix TestMempoolFilters according to amino overhead

* address review comments:

 - add a note about fieldNum = 1
 - add forgotten godoc comment

* fix and use sm.TxPreCheck

* fix test

* remove print statement
2018-11-11 10:09:33 -05:00
905abf1388 p2p: re-check after sleeps (#2664)
* p2p: re-check after sleeps

* use NodeInfo as an interface

* Revert "use NodeInfo as an interface"

This reverts commit 5f7d055e6c745ac8c8e5a9a7f0bd5ea5bc3d448c.

* Revert "p2p: re-check after sleeps"

This reverts commit 7f41070da070eadd3312efce1cc821aaf3e23771.

* preserve dial to itself

* ignore ensured connections while re-connecting

* re-check after sleep

* keep protocol definition on net addresses

* decrease log level

* Revert "preserve dial to itself"

This reverts commit 0c6e0fc58da78c378c32bb9ded2dd04ad5e754a9.

* correct func comment according to modification

Co-Authored-By: mgurevin <mehmet@gurevin.net>
2018-11-11 08:14:52 -05:00
7a4b62d3be check the result of ps.peer.Send before calling ps.setHasVote (#2787)
- actually call `ps.SetHasVote` instead to avoid carrying around
`votes.Height()`, `votes.Round()`, `types.SignedMsgType(votes.Type())`
2018-11-11 07:57:08 -05:00
5b19fcf204 p2p: AddressBook requires addresses to have IDs; Do not close conn immediately after sending pex addrs in seed mode (#2797)
* Require addressbook to only store addresses with valid ID

* Do not shut down peer immediately after sending pex addrs in SeedMode

* p2p: fix #2773

* seed mode: use go-routine to sleep before stopping peer
2018-11-11 06:50:25 -05:00
1944d8534b test AutoFile#Size (happy path) 2018-11-09 16:29:43 +01:00
13badc1d29 [autofile/group] do not panic when checking size
It's OK if the head will grow a little bit bigger, but we'll avoid
panic.

Refs #2703
2018-11-09 16:29:43 +01:00
091d2c3e5e openFile creates a file if not exist => ErrNotExist is not possible 2018-11-09 16:29:43 +01:00
d178ea9eaf use our logger in autofile/group 2018-11-09 16:29:43 +01:00
46d32af055 Add tests for ValidateBasic methods (#2754)
Fixes #2740
2018-11-09 15:59:04 +01:00
8b77328313 [docs] improve organization of ABCI docs & fix links (#2749)
* dedup with spec/abci/client-server

* fixup abci/readme

* link to getting started in abci/README

* https

* spec/abci: some deduplication

* docs: remove extraneous comment
2018-11-09 15:11:06 +01:00
6e9aee5460 p2p: peer-id -> peer_id (#2771)
* p2p: peer-id -> peer_id

* update changelog
2018-11-06 21:12:46 -08:00
d460df1335 mempool: print postCheck error (#2762)
This is a follow-up from https://github.com/tendermint/tendermint/pull/2724

Closes #2761
2018-11-06 20:23:44 -08:00
03e42d2e38 Fix crypto/merkle ProofOperators.Verify to check bounds on keypath pa… (#2756)
* Fix crypto/merkle ProofOperators.Verify to check bounds on keypath parts.

* Update PENDING
2018-11-05 22:53:44 -08:00
b8a9b0bf78 Mempool WAL is still created by default in home directory, leads to permission errors (#2758)
* only invoke InitWAL/CloseWAL if WalPath is not empty

Closes #2717

* panic if WAL is not initialized when calling CloseWAL

* add a changelog entry
2018-11-05 22:39:05 -08:00
7246ffc48f mempool: ErrPreCheck and more log info (#2724)
* mempool: ErrPreCheck and more log info

* change Pre/PostCheckFunc to return errors

also, continue execution when checking txs in mempool_test if
err=PreCheckErr
2018-11-05 22:32:52 -08:00
071ebdd514 Merge pull request #2704 from tendermint/2702-proposal-pol-round-validation
if some process locks a block in round 0, then 0 is valid proposal.PO…
2018-11-05 22:32:15 -08:00
8760c5b4f9 Merge branch 'develop' into 2702-proposal-pol-round-validation 2018-11-05 20:53:05 -08:00
59b75d3f28 Merge pull request #2753 from tendermint/master
Merge pull request #2750 from tendermint/release/v0.26.0
2018-11-03 12:46:55 -07:00
c086d0a341 Merge pull request #2750 from tendermint/release/v0.26.0
Release/v0.26.0
2018-11-03 12:46:14 -07:00
322cee9156 Release/v0.26.0 (#2726)
* changelog_pending -> changelog

* update changelog

* update changelog

* update changelog and upgrading
2018-11-02 13:55:09 -04:00
80e4fe6c0d [ADR] [DRAFT] pubsub 2.0 (#2532)
* pubsub adr

Refs #951, #1879, #1880

* highlight question

* fix typos after Ismail's review
2018-11-02 10:16:29 +01:00
fb91ef7462 validate reactor messages (#2711)
* validate reactor messages

Refs #2683

* validate blockchain messages

Refs #2683

* validate evidence messages

Refs #2683

* todo

* check ProposalPOL and signature sizes

* add a changelog entry

* check addr is valid when we add it to the addrbook

* validate incoming netAddr (not just nil check!)

* fixes after Bucky's review

* check timestamps

* beef up block#ValidateBasic

* move some checks into bcBlockResponseMessage

* update Gopkg.lock

Fix

```
grouped write of manifest, lock and vendor: failed to export github.com/tendermint/go-amino: fatal: failed to unpack tree object 6dcc6ddc143e116455c94b25c1004c99e0d0ca12
```

by running `dep ensure -update`

* bump year since now we check it

* generate test/p2p/data on the fly using tendermint testnet

* allow sync chains older than 1 year

* use full path when creating a testnet

* move testnet gen to test/docker/Dockerfile

* relax LastCommitRound check

Refs #2737

* fix conflicts after merge

* add small comment

* some ValidateBasic updates

* fixes

* AppHash length is not fixed
2018-11-01 02:07:18 -04:00
a22c962e28 TMHASH is 32 bytes. Closes #1990 (#2732)
* tmhash is fully 32 bytes. closes #1990

* AddressSize

* fix tests

* fix max sizes
2018-10-31 12:42:05 -04:00
1660e30ffe Fix general merkle keypath to start w/ last op's key (#2733)
* Fix general merkle keypath to start w/ last op's key

* Update CHANGELOG_PENDING.md
2018-10-31 11:02:13 -04:00
a83c268d7f Fix spec (#2736) 2018-10-31 10:59:01 -04:00
c5905900eb Simplify proposal msg (#2735)
* Align Proposal message with spec

* Update spec
2018-10-31 10:27:11 -04:00
7a03344480 Introduce EventValidBlock for informing peers about wanted block (#2652)
* Introduce EventValidBlock for informing peer about wanted block

* Merge with develop

* Add isCommit flag to NewValidBlock message

- Add test for the case of +2/3 Precommit from the previous round
2018-10-31 09:20:36 -04:00
a530352f61 Align Vote/Proposal fields with canonical order and fields (#2730)
* reorder fields

* add TestVoteString & update tests

* remove redundant info from Proposal.String()

* update spec

* revert changes on vote.String() -> more human friendly
2018-10-30 12:16:55 -04:00
60437953ac [R4R] libs/log: add year to log format (#2707)
* add year to log format

* update documentation
2018-10-30 11:46:55 -04:00
56d7160606 Add ValidatorPubkeyTypes as a consensus param (#2636)
* Add ValidatorPubkeyTypes as a consensus param

Ref #2414

* update spec

* address anton's comment

* Switch to Validator and Validator Params

* Correct changelog entry

* Address bucky's comments!

* forgot to update changelog

* fix typo

* fix Params naming
2018-10-30 11:36:53 -04:00
cdc252b818 add fail-test file instead of dep, closes #2638 (#2728)
original author of this file is @ebuchman:

https://github.com/ebuchman/fail-test
2018-10-30 10:34:51 -04:00
b24de1c01c update changelog pending and readme (#2725) 2018-10-29 10:13:11 -04:00
b6d5b8b745 Update to amino 0.14.0 (#2710)
* WIP: update to amino 0.14.0

* update Changelog

* Update to latest amino version (v0.14.0)
2018-10-29 09:16:50 -04:00
a67ae81469 if some process locks a block in round 0, then 0 is valid proposal.POLRound in rounds > 0
This condition is really hard to get. Initially, lockedRound and
validRound are set to -1 as we start with round 0.

Refs #2702
2018-10-25 16:40:20 +02:00
bbf15b3d09 tm-monitor: update health after we added / removed node (#2694)
Refs #2693
2018-10-25 12:27:32 +02:00
6643c5dd11 Catch up with amino 0.13.0 (#2690)
* catch up with amino changes in
https://github.com/tendermint/go-amino/pull/222

* WIP: update to amino v0.13.0

* update to fixed amino release
2018-10-24 21:34:01 -04:00
9795e12ef2 fix RecoverAndLogHandler not to call multiple writeheader (#2688) 2018-10-24 10:07:33 +02:00
be929acd6a Update to Amino v0.13.0-rc0 (#2687)
* types: test tm2pm on fully populated header

* upgrade for amino v0.13.0-rc0

* fix lint

* comment out final test
2018-10-23 13:21:47 -04:00
fe1d59ab7b Set protocol versions in NodeInfo from state (#2686)
* use types.NewValidator

* node: set p2p.ProtocolVersion from state, not globals
2018-10-22 17:55:49 -04:00
f94eb42ebe Version bump; Update Upgrading.md; linkify Changelog (#2679)
* version bump

* update UPGRADING.md

* add missing pr numbers to changelog pending

* linkify changelog
2018-10-19 20:27:00 -04:00
9d62bd0ad3 crypto: use stdlib crypto/rand. ref #2099 (#2669)
* crypto: use stdlib crypto/rand. ref #2099

* comment
2018-10-19 14:29:45 -04:00
30519e8361 types: first field in Canonical structs is Type (#2675)
* types: first field in Canonical structs is Type

* fix spec
2018-10-19 14:23:14 -04:00
7c6519adbd Bucky/changelog (#2673)
* update changelog, add authors script

* update changelog

* update changelog
2018-10-19 13:49:04 -04:00
f536089f0b types: dont use SimpleHashFromMap for header. closes #1841 (#2670)
* types: dont use SimpleHashFromMap for header. closes #1841

* changelog and spec

* comments
2018-10-19 11:39:27 -04:00
746d137f86 p2p: Restore OriginalAddr (#2668)
* p2p: bring back OriginalAddr

* p2p: set OriginalAddr

* update changelog
2018-10-18 18:26:32 -04:00
e798766a27 types: remove Version from CanonicalXxx (#2666) 2018-10-18 18:02:20 -04:00
c3384e88e5 adr-016: update int64->uint64; add version to ConsensusParams (#2667) 2018-10-18 17:32:53 -04:00
ed4ce5ff6c ADR-016: Update ABCI Info method for versions (#2662)
* abci: update RequestInfo for versions

* abci: update ResponseInfo for versions

* compile fix

* fix test

* software_version -> version

* comment fix

* update spec

* add test

* comments and fix test
2018-10-18 16:51:17 -04:00
055d7adffb add tm-abci python ABCI server (fork of py-abci) (#2658)
It utilises async IO -> greater performance.
2018-10-18 20:03:45 +04:00
14c1baeb24 ADR-016: Add protocol Version to NodeInfo (#2654)
* p2p: add protocol Version to NodeInfo

* update node pkg. remove extraneous version files

* update changelog and docs

* fix test

* p2p: Version -> ProtocolVersion; more ValidateBasic and tests
2018-10-18 10:29:59 -04:00
455d34134c ADR-016: Add versions to Block and State (#2644)
* types: add Version to Header

* abci: add Version to Header

* state: add Version to State

* node: check software and state protocol versions match

* update changelog

* docs/spec: update for versions

* state: more tests

* remove TODOs

* remove empty test
2018-10-17 15:30:53 -04:00
6a07f415e9 Change error output format for better SDK and Voyager UX (#2648)
* Change error output format

* Update tests

* 🤦

* apply suggestion
2018-10-17 14:26:14 -04:00
d20693fb16 install scripts: update go version, remove upgrade cmd (#2650)
* [install scripts] update go version, remove upgrade

- upgrading OS is out of scope of installation scripts

* add missing log statement

Refs https://github.com/tendermint/tendermint/pull/2642#discussion_r225786794
2018-10-17 12:47:56 -04:00
f60713bca8 privval: Add IPCPV and fix SocketPV (#2568)
Ref: #2563

I added IPC as an unencrypted alternative to SocketPV.

Besides I fixed the following aspects of SocketPV:

Added locking since we are operating on a single socket
The connection deadline is extended every time a successful packet exchange happens; otherwise the connection would always die permanently x seconds after the connection was established.
Added a ping/heartbeat mechanism to keep the connection alive; native TCP keepalives do not work in this use-case


* Extend the SecureConn socket to extend its deadline
* Add locking & ping/heartbeat packets to SocketPV
* Implement IPC PV and abstract socket signing
* Refactored IPC and SocketPV
* Implement @melekes comments
* Fixes to rebase
2018-10-17 10:26:14 +02:00
ed107d0e84 [scripts/install_tendermint_ubuntu] change /root to local user (#2647) 2018-10-17 10:12:31 +04:00
80562669bf add Google Analytics for documentation pages (#2645)
We need Google Analytics to start measuring how many developers are viewing our documentation. That way we can gauge how successful an/or useful various pages are. VuePress supports GA and all we have to provide is the tracking code.

This PR also renames the static docs site to "Tendermint Documentation", which is a better representation of the contents than only "Tendermint Core".
2018-10-16 10:10:52 +04:00
55362ed766 [pubsub] document design shortcomings (#2641)
Refs https://github.com/tendermint/tendermint/issues/1811#issuecomment-427825250
2018-10-16 10:09:24 +04:00
124d0db1e0 Make txs and evidencelist use merkle.SimpleHashFromBytes to create hash (#2635)
This is a performance regression, but will also spare the types directory
from knowing about RFC 6962, which is a more correct abstraction. For txs
this performance hit will be fixed soon with #2603. For evidence, the
performance impact is negligible due to it being capped at a small number.
2018-10-15 16:42:47 -04:00
4ab7dcf3ac [R4R] Unmerklize ConsensusParams.Hash() (#2609)
* Hash() uses tmhash instead of merkle.SimpleHashFromMap

* marshal whole struct

* update comments

* update docs
2018-10-15 16:31:27 -04:00
26462025bc standardize header.Hash() (#2610) 2018-10-15 16:28:49 -04:00
287b25a059 Align with spec (#2642) 2018-10-15 16:05:13 -04:00
37928cb990 set next validators along with validators while replay (#2637)
Closes #2634
2018-10-14 22:28:41 -04:00
0790223518 Comment about ed25519 private key format on Sign (#2632)
Closes #2001
2018-10-13 20:01:21 -04:00
0baa7588c2 p2p: NodeInfo is an interface; General cleanup (#2556)
* p2p: NodeInfo is an interface

* (squash) fixes from review

* (squash) more fixes from review

* p2p: remove peerConn.HandshakeTimeout

* p2p: NodeInfo is two interfaces. Remove String()

* fixes from review

* remove test code from peer.RemoteIP()

* p2p: remove peer.OriginalAddr(). See #2618

* use a mockPeer in peer_set_test.go

* p2p: fix testNodeInfo naming

* p2p: remove unused var

* remove testRandNodeInfo

* fix linter

* fix retry dialing self

* fix rpc
2018-10-12 19:25:33 -04:00
8888595b94 [R4R] Fixed sized and reordered fields for Vote/Proposal/Heartbeat SignBytes (#2598)
* WIP: switching to fixed offsets for SignBytes

* add version field to sign bytes and update order

* more comments on test-cases and add a tc with a chainID

* remove amino:"write_empty" tag

- it doesn't affect if default fixed size fields ((u)int64) are
written or not
- add comment about int->int64 casting

* update CHANGELOG_PENDING

* update documentation

* add back link to issue #1622 in documentation

* remove JSON tags and add (failing test-case)

* fix failing test

* update test-vectors due to added `Type` field

* change Type field from string to byte and add new type alias

- SignedMsgType replaces VoteTypePrevote, VoteTypePrecommit and adds new
ProposalType to separate votes from proposal when signed

- update test-vectors

* fix remains from rebasing

* use SignMessageType instead of byte everywhere

* fixes from review
2018-10-12 19:21:46 -04:00
1b51cf3f46 Remove unnecessary layer of indirection / unnecessary allocation of hashes (#2620) 2018-10-12 17:48:00 -04:00
2363d88979 consensus: Wait for proposal or timeout before prevote (#2540)
* Fix termination issues and improve tests

* Improve formatting and tests based on reviewer feedback
2018-10-12 16:13:01 -04:00
e1538bf67e state: require block.Time of the fist block to be genesis time (#2594)
* require block.Time of the fist block to be genesis time

Refs #2587:

```
We only start validating block.Time when Height > 1, because there is no
commit to compute the median timestamp from for the first block. This
means a faulty proposer could make the first block with whatever time
they want.

Instead, we should require the timestamp of block 1 to match the genesis
time.

I discovered this while refactoring the ValidateBlock tests to be
table-driven while working on tests for #2560.
```

* do not accept blocks with negative height

* update changelog and spec

* nanos precision for test genesis time

* Fix failing test (#2607)
2018-10-12 01:03:58 -04:00
3744e8271d [R4R] Pass nil to NewValidatorSet() when genesis file's Validators field is nil (#2617)
* Pass nil to NewValidatorSet() when genesis file's Validators field is nil

Closes: #2616

* Update CHANGELOG_PENDING.md
2018-10-11 23:37:21 -04:00
7b48ea1788 privval: set deadline in readMsg (#2548)
* privval: set deadline in readMsg

* fixes from review
2018-10-11 13:55:36 -04:00
69ecda18f9 refactor nop_event_bus.go into event_bus.go (#2605)
This is just to match the style of the rest of the codebase, and to
reduce the number of files in types.
2018-10-11 10:16:25 -04:00
cc0bea522c Minor doc fix regarding testnet on non-linux OS (#2601) 2018-10-11 10:03:34 -04:00
feb08fa4f8 ed25519: use golang/x/crypto fork (#2558)
* ed25519: use golang/x/crypto fork

* changelog

* gix GenerateFromPassword

* fixes from review
2018-10-11 10:01:53 -04:00
9a6cdaddf2 fix contributor's name in CHANGELOG_PENDING (#2599)
Refs https://github.com/tendermint/tendermint/pull/2506#issuecomment-428458974
2018-10-10 21:29:13 +04:00
12fa9d1cab crypto/merkle: Remove byter in favor of plain byte slices (#2595)
* crypto/merkle: Remove byter in favor of plain byte slices

This PR is fully backwards compatible in terms of function output!
(The Go API differs though) The only test case changes was to refactor
it to be table driven.

* Update godocs per review comments
2018-10-10 12:46:09 -04:00
92343ef484 Add additional metrics (#2500)
* Add additional metrics
Continues addressing https://github.com/cosmos/cosmos-sdk/issues/2169.
* Add nop metrics to fix NPE
* Tweak buckets, code review
* Update buckets
* Update docs with new metrics
* Code review updates
2018-10-10 18:27:43 +02:00
ee7b3d260e crypto/amino: Address anton's comment on PubkeyAminoRoute (#2592) 2018-10-10 12:13:42 +04:00
6ec52a9233 types: cap evidence in block validation (#2560)
* cap evidence in block validation

* state: use table-driven test for ValidateBlockHeader

* state: test evidence cap

* fixes from review
2018-10-09 13:31:21 -04:00
05a119aab5 libs: Test deadlock from listener removal inside callback (#2588)
Closes #2575
2018-10-09 19:31:06 +02:00
d7341c4057 distribution: Lock binary dependencies to specific commits (#2550) 2018-10-09 19:28:15 +02:00
3fcb62b931 :tools: Update docs & fix build-docker Makefile target (#2584)
bump alpine version to 3.8
2018-10-09 16:04:15 +02:00
8761b27489 crypto: Add a way to go from pubkey to route (#2574)
This is intended for use in a future PR for #2414
2018-10-09 14:41:33 +02:00
e7708850c0 libs: Let prefixIterator implements Iterator correctly (#2581)
Fixes #2577
2018-10-09 14:21:36 +02:00
561fc2d717 test(db): Test itr.Value in checkValuePanics (#2580)
Fixes #2573
2018-10-09 14:19:00 +02:00
724e264ff5 separate mock evidence from real evidence (#2571)
Closes #2525
2018-10-09 14:10:05 +02:00
989a2f32b1 libs: Refactor & document events code (#2576)
* [libs/events] add more godoc comments
* [libs/events] refactor code
- improve var naming
- improve code structure
- do not use defers for unlocking mutexes (defer takes time)
2018-10-09 13:09:40 +02:00
4b2bf023dd libs: Fix event concurrency flaw (#2519)
* fix event concurrency flaw
* modify changelog
* fix a mistake
* fix a lint issue
* modify changelog
* modify for review issue
* modify for review issue
* modify for review issue
2018-10-08 15:36:31 +02:00
c17547ac2f Switch nodeID to use tmhash.Size, add test names for net addr tests (#2559)
* Switch nodeID to be tmhash.Size, add test names for net addr tests
Both of these came up when locally trying to change tmhash size.
* fix error introduced by merge
2018-10-08 15:20:41 +02:00
b1e7fac787 crypto/random: Use chacha20, add forward secrecy (#2562)
Ref #2099
2018-10-08 15:15:56 +02:00
35b671214c tools: Refactor tm-bench (#2570)
* specify time unit for FlushThrottleTimeout in TestP2PConfig
Refs #2555
* [tm-bench] refactor code
https://github.com/tendermint/tendermint/pull/2405#pullrequestreview-157166387
2018-10-08 15:03:38 +02:00
4c0c6e0116 [tm-bench] exit on CTRL-C (#2405) 2018-10-08 11:06:01 +04:00
b8556b97b8 circle: save p2p logs as artifacts (#2566) 2018-10-08 10:49:50 +04:00
5f88fe0e9b fix p2p switch FlushThrottle value (#2569) 2018-10-08 10:05:12 +04:00
1d8348d707 [p2p] Malformed external address causes SIGSEGV (if URL has empty host) (#2564)
fix #2071

Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
2018-10-06 09:53:52 -04:00
f471fc4963 abci: codespace (#2557)
* abci: codespace

* changelog
2018-10-06 09:20:15 -04:00
2d726a620b add adr (#2553) 2018-10-05 23:44:53 -04:00
dfda7b442f types: Remove pubkey from validator hash (#2512)
* types: Remove pubkey from validator hash

* undo lock file change

* Update Spec
2018-10-05 19:26:52 -04:00
6e5f58191e add spec/abci/readme to sidebar (#2551) 2018-10-05 09:51:23 -04:00
c648c93807 Fix random distribution in bitArray.PickRandom (#2534)
* Fix random distribution in bitArray.PickRandom

Previously it was very biased. 63 "_" followed by a single "x" had
much greater odds of being chosen. Additionally, the last element was
skewed. This fixes that by first preproccessing the set of all true
indices, and then randomly selecting a single element from there.

This commit also makes the code here significantly simpler, and
improves test cases.

* unlock mtx right after we select true indices
2018-10-05 11:00:50 +04:00
5b120d788a lite support maxOpenConnections (#2413) 2018-10-04 20:39:24 -04:00
e6a55b7be0 consensus: Add ADR for first stage consensus refactor (#2462) 2018-10-04 20:35:35 -04:00
d2be7482e1 [ADR][DRAFT] 024: SignBytes and validator types in privval (#2445)
* first draft for ADR summarizing discussion from:
https://github.com/tendermint/tendermint/issues/1622

* fix link and add comment about pub-key per message and fix link

* fix link and add comment about pub-key per message; also:
 - fix link
 - add little diagram
 - fix typo

* Add a slightly different approach

* typo and ADR number
2018-10-04 20:28:27 -04:00
44a72fb642 Merge pull request #2544 from tendermint/bucky/adr-029
Bucky/adr 029
2018-10-04 20:09:34 -04:00
c15fc9ff63 adr-029: update CheckBlock 2018-10-04 20:11:21 -04:00
be1760cc25 Create adr-021-check block txs before prevote.md 2018-10-04 18:43:17 -04:00
5b1b1ea58a [libs/autofile] fix DATA RACE by removing openFile() call (#2539)
There's a time window after we call RotateFile() where autofile#index+1
does not exist. It will be created during the next call to Write(). BUT
if somebody calls NewReader() before Write(), it will fail with "open
  /tmp/wal#index+1/wal: no such file or directory"

We must create file (either by calling gr.Head.openFile() or directly)
during NewReader() to ensure read calls succeed.

Closes #2538
2018-10-04 17:57:59 -04:00
f11aef20a0 Add ADR for Commit changes (#2374) 2018-10-04 17:54:45 -04:00
303649818c update docs links & sidebar (#2541)
* docs: fix links

* docs: add readme from each section to the sidebar
2018-10-04 17:22:41 -04:00
12675ecd92 consensus: Wait timeout precommit before starting new round (#2493)
* Disable transitioning to new round upon 2/3+ of Precommit nils

Pull in ensureVote test function from https://github.com/tendermint/tendermint/pull/2132

* Add several ensureX test methods to wrap channel read with timeout

* Revert panic in tests
2018-10-04 09:37:13 -04:00
cb2e58411f add a missing changelog entry 2018-10-03 11:29:04 +04:00
0755a5203d bit_array: Simplify subtraction
also, fix potential bug in Or function
2018-10-03 11:29:04 +04:00
c94133ed1b Fix a bug in bit_array's sub function (#2506) 2018-10-03 10:28:46 +04:00
f3d08f969d [rpc] fix /abci_query: trusted was renamed to prove (#2531) 2018-10-02 20:31:04 -04:00
5c6999cf8f fix evidence db iter leak (#2516)
Also make reversing a slice more efficient
2018-10-02 11:52:56 +04:00
fd1b8598bc Make block_test.go more table driven (#2526) 2018-10-02 11:47:20 +04:00
32e274cff0 config: Refactor ValidateBasic (#2503)
* timeouts as time.Duration are also breaking for old configs
* split BaseConfig#ValidateBasic into smaller methods
2018-10-01 14:38:35 +02:00
ccd04587ff docs/spec/abci: consensus params and general merkle (#2524)
* docs: links to dirs need a slash

* docs/spec/abci: consensus params and general merkle
2018-09-30 15:08:01 -04:00
52e21cebcf remove some xxx comments and the config.mempool.recheck_empty (#2505)
* remove some XXX

* config: remove Mempool.RecheckEmpty

* docs: remove recheck_empty
2018-09-30 13:28:34 -04:00
69c7aa77bc clist: speedup Next by removing defers (#2511)
This change doubles the speed of the mempool's reaping.
Before:

BenchmarkReap-8   	    5000	    365390 ns/op	  122887 B/op

After:

BenchmarkReap-8   	   10000	    158274 ns/op	  122882 B/op
2018-09-30 13:26:14 -04:00
ead9fc0179 Docs cleanup (#2522)
* minor doc cleanup

* docs/tools: link fixes and readme

* docs/networks: networks/local/README.md

* docs: update vuepress config

* docs: fixes from review
2018-09-30 12:35:52 -04:00
f36ed7e7ff General Merkle Follow Up (#2510)
* tmlibs -> libs

* update changelog

* address some comments from review of #2298
2018-09-28 23:32:13 -04:00
71a34adfe5 General Merkle Proof (#2298)
* first commit

finalize rebase

add protoc_merkle to Makefile

* in progress

* fix kvstore

* fix tests

* remove iavl dependency

* fix tx_test

* fix test_abci_cli

fix test_apps

* fix test_apps

* fix test_cover

* rm rebase residue

* address comment in progress

* finalize rebase
2018-09-28 20:03:19 -04:00
fc073746a0 privval: Switch to amino encoding in SignBytes (#2459)
* switch to amino for SignBytes and add Reply with error message

- currently only Vote is done

* switch Reply type in socket for other messages

 - add error description on error

* add TODOs regarding error handling

* address comments from peer review session (thx @xla)

 - contains all changes besides the test-coverage / error'ing branches

* increase test coverage:

 - add tests for each newly introduced error'ing code path

* return error if received wrong response

* add test for wrong response branches (ErrUnexpectedResponse)

* update CHANGELOG_PENDING and related documentation (spec)

* fix typo: s/CanonicallockID/CanonicalBlockID

* fixes from review
2018-09-28 19:57:29 -04:00
47bc15c27a disable mempool WAL by default (#2490) 2018-09-28 19:28:42 -04:00
8dda3c3b28 lite: Add synchronization in lite verify (#2396)
* Implement issues 2386: add synchronization in lite verify and change all Certify to Verify

* Replace make(chan struct{}, 0) with make(chan struct{})

* Parameterize memroy cache size and add concurrent test

* Refactor import order
2018-09-28 19:23:21 -04:00
5173fe9414 Merge pull request #2497 from tendermint/zach/version
docs: Add version
2018-09-27 16:41:13 -04:00
d007ade6c3 add version to docs 2018-09-26 17:49:20 -04:00
4c4a95ca53 config: Add ValidateBasic (#2485)
* add missing options to config.toml template and docs
Refs #2232
* config#ValidateBasic
Refs #2232
* [config] timeouts as time.Duration, not ints
Why:
- native type provides better guarantees than ", in ms" comment (harder
to shoot yourself in the leg)
- flexibility: you can change units
2018-09-26 12:04:44 +02:00
df329e8f27 rpc/libs/doc: formatting for godoc, closes #2420 2018-09-26 11:37:26 +04:00
cf8b42d813 rpc/core: ints are strings in responses, closes #1896 2018-09-26 11:37:26 +04:00
110b07fb3f libs: Call Flush() before rename #2428 (#2439)
* fix Group.RotateFile need call Flush() before rename. #2428
* fix some review issue. #2428
 refactor Group's config: replace  setting member with initial option
* fix a handwriting mistake
* fix a time window error between rename and write.
* fix a syntax mistake.
* change option name Get_ to With_
* fix review issue
* fix review issue
2018-09-25 13:22:45 +02:00
587116dae1 metrics: Add additional metrics to p2p and consensus (#2425)
* Add additional metrics to p2p and consensus
Partially addresses https://github.com/cosmos/cosmos-sdk/issues/2169.
* WIP
* Updates from code review
* Updates from code review
* Add instrumentation namespace to configuration
* Fix test failure
* Updates from code review
* Add quotes
* Add atomic load
* Use storeint64
* Use addInt64 in writePacketMsgTo
2018-09-25 13:14:38 +02:00
eb0da7f9cb libs: Handle SIGHUP explicitly inside autofile (#2480)
* handle SIGHUP explicitly inside autofile
Refs #2260
* libs: Use consistent channel suffix
2018-09-25 12:43:28 +02:00
d12e55c494 node: Respond always to OS interrupts (#2479)
* stop node upon receiving SIGTERM or CTRL-Ceven during genesis sleep by setting up interrupt before starting a node

Closes #2434

* call Start, not OnStart when starting a component to avoid:

```
E[09-24|10:13:15.805] Not stopping PubSub -- have not been started yet module=pubsub impl=PubSub
```

being printed on exit
2018-09-25 12:24:18 +02:00
d297f02227 Merge pull request #2438 from tendermint/bucky/versions
version: types
2018-09-23 16:24:14 -04:00
d0f6864c69 Merge pull request #2476 from tendermint/master
Master back to develop
2018-09-23 10:23:17 -04:00
0c9c3292c9 Merge pull request #2473 from tendermint/release/v0.25.0
Release/v0.25.0
2018-09-23 10:22:46 -04:00
e4ee34cfbc version: types 2018-09-23 09:19:12 -04:00
d16f52eab3 copy without sudo (#2474) 2018-09-23 08:31:19 -04:00
27ba6e8a42 Minor docs cleanup (#2472)
* docs: link consensus to blockchain spec. closes #2422

* docs: deprecate research section. closes #2401

* docs: fix some links

* docs: fix some markdown lists

* docs: fix more links
2018-09-23 02:25:33 -04:00
a8eee4ab28 Merge pull request #2471 from tendermint/master
Merge master to develop
2018-09-23 01:54:33 -04:00
cd172acee8 Merge pull request #2467 from tendermint/release/v0.25.0
Release/v0.25.0
2018-09-23 01:33:35 -04:00
97b43d875a update changelog 2018-09-23 01:25:10 -04:00
b394bd5b5c Merge branch 'develop' into release/v0.25.0 2018-09-23 01:24:50 -04:00
f5824bc837 Update abci and app docs (#2470)
* mempool: update some comments

* make build_c

* docs: notes about databases and WAL files

* docs: determinism. closes #1279

* docs: small note about query paths. closes #2090

* docs: gas

* docs: abci consensus params
2018-09-23 01:14:05 -04:00
111e627037 mempool: Filter new txs if they have insufficient gas (#2385)
This also refactors the prior mempool to filter to be known as
"precheck filter" and this new filter is called "postcheck filter"

This PR also fixes a bug where the precheck filter previously didn't
account for the amino overhead, which could a maliciously sized tx to
halt blocks from getting any txs in them.

* Move maxGas outside of function definition to avoid race condition
* Type filter funcs and make public
* Use helper method for post check
* Remove superfluous Filter suffix
* Move default pre/post checks into package
* Fix broken references
* Fix typos
* Expand on examples for checks
2018-09-22 02:50:06 +02:00
ee8b8bbefb flush changelog pending, bump version 2018-09-21 17:41:02 -04:00
dde0936fb8 linkify changelog 2018-09-21 17:37:40 -04:00
2dfde37f44 update changelog and upgrading 2018-09-21 17:34:36 -04:00
f99e4010f2 Add stats related channel between consensus state and reactor (#2388) 2018-09-21 14:36:48 -04:00
f11db8c1b0 Pass http.ServeTLS() errors back to the caller (#2461)
Closes: #2460

* Pass http.ServeTLS() errors back to the caller
* Update CHANGELOG
* Amend StartHTTPServer() too for consistency's sake
* Revert "Amend StartHTTPServer() too for consistency's sake"
This reverts commit 23bfb4c2e917f581702291fe3ea69fce23f8c89d.
2018-09-21 18:12:29 +02:00
886a83dfb8 docs: Add assets/instructions for local docs build (#2453)
* ungitignore
* add docs/.vuepress to enable local builds
* config.js needs to be here, one less step
* docs: make spec in sidebar nicer
* docs: local build instructions
2018-09-21 13:39:55 +02:00
8d50bb9dad conesnsu: follow up to removing some consensus params (#2427)
* follow up to removing some consensus params Refs #2382
* change args type to int64 in state#makeParams
* make valsCount and evidenceCount ints again
* MaxEvidenceBytesPerBlock: include magic number in godoc
* [spec] creating a proposal
* test state#TxFilter
* panic if MaxDataBytes is less than 0
* fixes after review
* use amino#UvarintSize to calculate overhead
0c74291f3b/encoder.go (L85-L90)
* avoid cyclic imports
* you can do better Go, come on
* remove testdouble package
2018-09-21 11:00:36 +02:00
7b727bf3d0 Minor changelog fixes (#2449)
* readme: add some libs to semver

* changelog: some updates
2018-09-20 11:55:36 -04:00
84b518b8d3 rpc: Add /consensus_params endpoint (#2415)
* Add /consensus_params endpoint
* Incorporated change https://github.com/tendermint/tendermint/pull/2415#discussion_r219078049
* Fixed an error in pervious commit
2018-09-20 14:31:20 +02:00
bd951171db docs: Add missing changelog entry and comment (#2451)
Follow-up on https://github.com/tendermint/tendermint/pull/2411
2018-09-20 11:14:02 +02:00
0d6b75bd53 common: Delete unused functions (#2452)
These functions were not used anywhere within tendermint, or the
cosmos-sdk. (The functionality is already duplicated in the cosmos-sdk
types package)

* common: Delete unused functions within byteslice
* remove more unused code from strings.go and int.go
* Remove more unused code from int.go
* Fix testcase
2018-09-20 11:12:42 +02:00
f76312ffe6 docs: Update secure-p2p doc to match the spec + current implementation
Closes #2421.
I am of the opinion that the spec is easier to read than this though,
and we shouldn't really explain this here other than that we use a variant
of station to station protocol, with X25519 for the diffie hellman, and we
describe the related security properties.
2018-09-20 09:56:15 +02:00
8aad09d9d4 Output error instead of panic when the given db_backend is not initialised (#2411)
Closes #2371
2018-09-20 09:53:25 +04:00
faa3509646 adr-021: note about tag spacers (#2362) 2018-09-19 18:56:23 -04:00
a045c562a2 update adr-016 (#2435) 2018-09-19 18:11:11 -04:00
26aa978456 Make mempool cache a proper LRU (#2407)
Closes #2399
2018-09-19 21:40:22 +04:00
aa5495f24e p2p: add RPCAddress to NodeInfoOther.String() (#2442)
- remove second AminoVersion from
https://github.com/tendermint/tendermint/pull/2426/files#diff-f2fefc7a06ea0d1e0a910196901e50aaR86

Refs #2433
2018-09-19 15:54:14 +02:00
c0cdb9d441 libs : Remove libs/common/word.go (#2431)
We didn't use this code anywhere in the codebase. As such, we probably
should reduce the surface area we support. In the event that we do
in fact require 256 bit words inside of tendermint, we should adapt
the stdlibs' internal word representations, which also handles SIMD.

Inside of the SDK, a separate solution for big ints / larger words
is employed, which uses big ints. This in turn does utilize the stdlibs
SIMD support.
2018-09-19 15:38:30 +02:00
91a8767083 proxy: remove Handshaker from proxy pkg (#2437)
Handshaker was removed from proxy package so it can be called
independently of starting the abci app connections and can return a
result to the caller.
2018-09-19 15:35:09 +02:00
3e099f75c7 minor note in indexing-transactions.md (#2443) (#2444)
Fix inconsistent documents and code
2018-09-19 13:46:37 +04:00
bdd01310a0 p2p: Integrate new Transport
We are swapping the exisiting listener implementation with the newly
introduced Transport and its default implementation MultiplexTransport,
removing a large chunk of old connection setup and handling scattered
over the Peer and Switch code. The Switch requires a Transport now and
handles externally passed Peer filters.
2018-09-18 22:26:43 +02:00
be5d68ea4f p2p: Implement PeerTransport
This is the implementation for the design described in ADR 12[0]. It's
the first step of a larger refactor of the p2p package as tracked in
interface bundling all concerns of low-level connection handling and
isolating the rest of peer lifecycle management from the specifics of
the low-level internet protocols. Even if the swappable implementation
will never be utilised, already the isolation of conn related code in
one place will help with the reasoning about execution path and
addressation of security sensitive issues surfaced through bounty
programs and audits.

We deliberately decided to not have Peer filtering and other management
in the Transport, its sole responsibility is the translation of
connections to Peers, handing those to the caller fully setup. It's the
responsibility of the caller to reject those and or keep track. Peer
filtering will take place in the Switch and can be inspected in a the
following commit.

This changeset additionally is an exercise in clean separation of logic
and other infrastructural concerns like logging and instrumentation. By
leveraging a clean and minimal interface. How this looks can be seen in
a follow-up change.

Design #2069[2]
Refs #2067[3]
Fixes #2047[4]
Fixes #2046[5]

changes:
* describe Transport interface
* implement new default Transport: MultiplexTransport
* test MultiplexTransport with new constraints
* implement ConnSet for concurrent management of net.Conn, synchronous
to PeerSet
* implement and expose duplicate IP filter
* implemnt TransportOption for optional parametirisation

[0] https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-012-peer-transport.md
[1] https://github.com/tendermint/tendermint/issues/2067
[2] https://github.com/tendermint/tendermint/pull/2069
[3] https://github.com/tendermint/tendermint/issues/2067
[4] https://github.com/tendermint/tendermint/issues/2047
[5] https://github.com/tendermint/tendermint/issues/2046
2018-09-18 22:26:43 +02:00
89462c52d9 spec: add missing field to NodeInfoOther (#2426)
and fix formatting

Refs https://github.com/tendermint/tendermint/pull/2417#discussion_r218080500
2018-09-18 11:28:32 +02:00
2fbf810cd8 Delay starting node until Genesis time (#2389) 2018-09-18 13:16:50 +04:00
64fc8f8157 Merge pull request #2337 from tendermint/anton/cleveldb
BlockIntervalSeconds metric & DB tests cleanup & benchmark improv.
2018-09-18 12:48:45 +04:00
e1bda36c6c switch back to original fork 2018-09-18 12:16:03 +04:00
ff9d0cdfb6 generate random txs
otherwise we're benchmarking overriding single key (because hash stays
the same!)
2018-09-18 12:16:03 +04:00
788474d08d change consensus_block_interval_seconds metric type to gauge
Otherwise, it's impossible to see outliers
https://github.com/tendermint/tendermint/issues/1835#issuecomment-402054099
2018-09-18 12:16:01 +04:00
484194789f update Vagrantfile to install go1.11 2018-09-18 12:15:44 +04:00
747797bf3b cleanup after tests! 2018-09-18 12:15:44 +04:00
76302c651f remove LICENSE from libs/db in favor of root license 2018-09-18 12:15:44 +04:00
5bfb9001eb switch from jmhodges/levigo to DataDog/leveldb
Why:
original fork is abandoned and not supported anymore.

Changes:
- LevelDB 1.19 (LevelDB and Snappy are both compiled and linked statically, so while you will not need them installed on your target machine, you should have a roughly compatible version of libstdc++.)
- snappy and lz4 libs included by default
2018-09-18 12:15:43 +04:00
38bced2440 [types] add Address to GenesisValidator (#2418)
Refs #1714
2018-09-18 11:59:52 +04:00
4fe9906361 docs: Update README (#2393)
* update DOCS_README
* add spec to docs & other lil fixes (#2402)
2018-09-17 18:43:10 +02:00
fc7f9bcaf6 rpc: Transform /status result.node_info.other into map (#2417)
* [rpc] transform /status result.node_info.other into map
* amino does not support maps, duh

Refs #2391
2018-09-17 18:39:52 +02:00
8ae3334423 [libs/autofile & db/fsdb] Throw error if file permissions change (#2286)
* Enforce file permissions in case they've changed

* test behaviour for autofile

* use testify in tests and rename `fInf` to `fileInfo`

* return an error if file permissions have changed

- if we can't read the file, we'll still panic

* get rid of "github.com/pkg/errors" dependency

* address review comments:

- prefix instead of suffix
- add state to err and construct formatting in Error() method

* address review comments:

- move error to libs/errors
2018-09-17 14:38:29 +04:00
c6c0b52d0c tools/tm-bench: bounds check for txSize and improving test cases (#2410)
Fixes #2409
2018-09-17 13:08:47 +04:00
e3e3c13741 [common] revert started flag when service already stopped (#2326)
also, return ErrNotStarted when trying to stop a not-running service
2018-09-12 19:07:29 -04:00
1ea64fc27f Make mempool aware of MaxGas requirement (#2360)
* Make mempool aware of MaxGas requirement

* update spec

* Add tests

* Switch GasWanted from kv store to persistent kv store

* Fix typo in test name

* switch back to using kvstore, not persistent kv store
2018-09-12 16:41:19 -04:00
0e1cd88863 Remove ConsensusParams.TxSize and ConsensusParams.BlockGossip (#2364)
* remove ConsensusParams.TxSize and ConsensusParams.BlockGossip

Refs #2347

* block part size is now fixed

Refs #2347

* use max data size, not max bytes for tx limit

Refs #2347
2018-09-12 15:44:43 -04:00
33b4617e9a docs: update link to rpc (#2361)
* md links dont work in slate

* docs: link to rpc

* docs: use unsafe_reset_all

* do not advertise unsafe_reset_priv_validator
2018-09-12 21:03:17 +04:00
503de8c9b8 docs/spec/abci: improve docs on AppHash (#2363) 2018-09-10 09:10:53 -04:00
dea4e96f66 fix docs links (#2352) 2018-09-10 10:42:48 +04:00
a57aae7072 [ADR] ABCI errors and events (#2314)
* Start of ADR

* flesh out abci events and errors adrs

* adr: move 012 to 023

* adr-022: add note from cwgoes
2018-09-09 14:04:01 -04:00
0bec20a1e3 update readme, clsoes #2357 (#2359) 2018-09-08 16:45:12 +04:00
83a7c04bce Merge pull request #2356 from tendermint/master
Merge master back to develop
2018-09-07 07:47:36 -04:00
d419fffe18 Merge pull request #2350 from tendermint/release/v0.24.0
Release/v0.24.0
2018-09-07 07:46:44 -04:00
c8895dab98 minor note in UPGRADING.md 2018-09-07 07:43:41 -04:00
8b94deca73 Merge pull request #2354 from tendermint/anton/fix-typos-in-spec
Fix typos in spec
2018-09-07 07:28:50 -04:00
4cd2e40fb1 TMBIN -> Amino 2018-09-07 07:28:58 -04:00
47dc4e6428 fix a few typos in spec 2018-09-07 11:40:16 +04:00
94288006ba minor fixes 2018-09-06 22:47:05 -04:00
22445a5029 Merge pull request #2349 from tendermint/release/v0.24.0
update UPGRADING.md and minor docs fixes
2018-09-06 22:25:20 -04:00
299d46304d update UPGRADING.md and minor docs fixes 2018-09-06 22:35:31 -04:00
5106af484f docs: add abci spec to config.js 2018-09-06 22:18:15 -04:00
114c405120 docs/spec/abci: fixes and more from #2249 2018-09-06 22:17:00 -04:00
246a56283a Merge pull request #2343 from tendermint/release/v0.24.0
Major spec update to prepare v0.24.0 for release
2018-09-06 20:44:54 -04:00
1144e72c61 docs: refactor ABCI docs
* move spec/software/abci.md to spec/abci/apps.md and improve it
* move some of app-dev/app-development.md to spec/abci/client-server.md
2018-09-06 20:51:36 -04:00
3fd54c5df5 docs/spec/abci: update spec
* better overview section
* section on tags
* remove notes about state/concurrency from CheckTx
* incorporate feedback from #2249
* explain how validator set updates effect future blocks
2018-09-06 19:36:30 -04:00
20c55cffc4 docs: move app-dev/abci-spec.md to spec/abci/abci.md 2018-09-06 18:36:11 -04:00
dea34506fb types/time: add note about stripping monotonic part 2018-09-06 17:58:52 -04:00
54fe6ef73c version: add and bump abci version 2018-09-06 17:58:12 -04:00
6fd79d1545 docs/spec/blockchain: remove tags from result for now 2018-09-06 12:47:26 -04:00
8fcabe8b05 docs: fix note about ChainID size 2018-09-06 12:42:23 -04:00
e0fa827a53 docs/spec/blockchain: specify consensus params in state.md 2018-09-06 12:41:57 -04:00
bdf3238710 docs/spec/blockchain: bring blockchain.md up-to-date 2018-09-06 12:41:33 -04:00
ed9e00a8a7 docs/spec/blockchain: fix encoding JSON 2018-09-06 12:41:02 -04:00
604eae86b6 Merge branch 'master' into release/v0.24.0 2018-09-05 19:15:06 -04:00
b616e54c9b changelog and version 2018-09-05 19:26:55 -04:00
fae21c9f52 linkify changelog pending 2018-09-05 19:25:33 -04:00
8c0c4844b6 Merge pull request #2342 from tendermint/dev/changelog2
add script to add links in changelog
2018-09-05 19:10:48 -04:00
bbc30f992e Merge pull request #2340 from tendermint/bucky/changelog
name drop external contribs in changelog
2018-09-05 19:03:03 -04:00
91f8af8fd8 docs/spec/blockchain: update vote, signature, time 2018-09-05 19:14:18 -04:00
0881068d76 add script to add links in changelog 2018-09-05 15:58:29 -07:00
80c217089a docs/spec/blockchain: remove json tags, dont use HexBytes 2018-09-05 18:57:54 -04:00
61914cf48e docs/tm-core/using-tm: fix indentation for genesis.validators 2018-09-05 18:56:58 -04:00
4416c9e4bc fix links in abci readme. fixes #2335 2018-09-05 18:44:48 -04:00
c9510d0f50 name drop external contribs in changelog 2018-09-05 18:26:12 -04:00
892b170818 Bucky/changelog (#2339)
* update changelog pending

* fixes from review
2018-09-05 18:02:45 -04:00
7f6bd5c161 docs & spec: deduplicate block-structure.md (#2331) 2018-09-05 12:21:04 -04:00
eb5cf0f0dd ignore existing peers in DialPeersAsync (#2327)
* ignore existing peers in DialPeersAsync

Fixes #2253

* rename HasPeerWithAddress to IsDialingOrExistingAddress

[breaking] remove Switch#IsDialing

* check if addrBook is nil

to be consistent with other usages of addrBook across Switch

* different log messages for 2 use-cases
2018-09-05 11:52:22 -04:00
2a3520a714 Merge pull request #2134 from tendermint/2027-cs-failure
Add priv_validator_laddr to config.toml
2018-09-05 11:48:34 -04:00
39ab199181 Merge pull request #2333 from tendermint/anton/docs
Update indexing docs & write a test cast
2018-09-05 11:41:42 -04:00
4c7591cf6b Merge pull request #2336 from tendermint/zach/hotfix
fix failing website build
2018-09-05 09:14:47 -04:00
0149c8ffee fix failing website build 2018-09-05 08:56:48 -04:00
9db66deaa2 test make localnet in CI (#2281)
* tests: use make localnet

based on @jackzampolin work in:
https://github.com/cosmos/cosmos-sdk/pull/2067

* keep the p2p tests for now

* fixes after my own review

* nohup

* remove nohup
2018-09-05 13:25:15 +04:00
098681fd91 test searching txs by height
Refs #2051
2018-09-05 12:01:38 +04:00
cb91cd5965 [docs] one can also index txs by height now 2018-09-05 11:05:06 +04:00
92185c017c Several minor docs & spec cleanup (#2330)
* addr_book_strick=false on local nets

* link to spec

* spec: remove TODO, see #1749 instead

* spec: make issues from TODOs

* update docs on addr_book_strict option
2018-09-05 10:30:36 +04:00
d0bb1ab2b0 Filter out empty addresses in persistent_peers/seeds lists (#2323)
Fixes #2320
2018-09-05 10:13:25 +04:00
d27cd972d2 Index tx.height (#2324)
Refs #2051
2018-09-05 10:00:10 +04:00
29d2db352e update outdated abci-cli install instructions (#2325)
https://github.com/tendermint/tendermint/pull/2301
2018-09-04 23:20:45 +04:00
eabb1ece8e tmtime: Canonical, some comments (#2312) 2018-09-04 12:20:58 +04:00
166fd82b70 max-bytes PR follow-up (#2318)
* ReapMaxTxs: return all txs if max is negative

this mirrors ReapMaxBytes behavior

See https://github.com/tendermint/tendermint/pull/2184#discussion_r214439950

* increase MaxAminoOverheadForBlock

tested with:

```
func TestMaxAminoOverheadForBlock(t *testing.T) {

        maxChainID := ""
        for i := 0; i < MaxChainIDLen; i++ {
                maxChainID += "𠜎"
        }

        h := Header{
                ChainID:            maxChainID,
                Height:             10,
                Time:               time.Now().UTC(),
                NumTxs:             100,
                TotalTxs:           200,
                LastBlockID:        makeBlockID(make([]byte, 20), 300, make([]byte, 20)),
                LastCommitHash:     tmhash.Sum([]byte("last_commit_hash")),
                DataHash:           tmhash.Sum([]byte("data_hash")),
                ValidatorsHash:     tmhash.Sum([]byte("validators_hash")),
                NextValidatorsHash: tmhash.Sum([]byte("next_validators_hash")),
                ConsensusHash:      tmhash.Sum([]byte("consensus_hash")),
                AppHash:            tmhash.Sum([]byte("app_hash")),
                LastResultsHash:    tmhash.Sum([]byte("last_results_hash")),
                EvidenceHash:       tmhash.Sum([]byte("evidence_hash")),
                ProposerAddress:    tmhash.Sum([]byte("proposer_address")),
        }
        b := Block{
                Header:     h,
                Data:       Data{Txs: makeTxs(10000, 100)},
                Evidence:   EvidenceData{},
                LastCommit: &Commit{},
        }

        bz, err := cdc.MarshalBinary(b)
        require.NoError(t, err)

        assert.Equal(t, MaxHeaderBytes+MaxAminoOverheadForBlock-2, len(bz)-1000000-20000-1)
}
```

* fix MaxYYY constants calculation

by using math.MaxInt64

See https://github.com/tendermint/tendermint/pull/2184#discussion_r214444244

* pass mempool filter as an option

See https://github.com/tendermint/tendermint/pull/2184#discussion_r214445869

* fixes after Dev's comments
2018-09-04 11:46:34 +04:00
1de32fba17 Check for int overflow in clist (#2289)
* explicitly panic if max capacity is reached

* address review comments

* comments and a test
2018-09-02 02:13:09 -04:00
7b88172f41 Implement BFT time (#2203)
* Implement BFT time

* set LastValidators when creating state in state helper

for heights >= 2
2018-08-31 19:33:51 -04:00
ffe91ae9e3 Merge pull request #2184 from tendermint/2035-max-bytes
MaxBytes
2018-08-31 15:16:37 -04:00
03afad3218 Merge pull request #2307 from tendermint/master
libs/autofile: bring back loops (#2261)
2018-08-31 14:42:48 -04:00
5ecdfacb8e fix docs base directory (#2295) 2018-08-31 14:09:43 -04:00
9e940b95ad libs/autofile: bring back loops (#2261)
* libs/autofile: bring back loops

* changelog, version
2018-08-31 14:05:49 -04:00
4147f856dc update arch doc 2018-08-31 16:10:41 +04:00
02d1b03abb update comment for MaxBlockSizeBytes 2018-08-31 16:01:22 +04:00
e873fed815 calculate amino overhead on the fly 2018-08-31 16:01:22 +04:00
e957f322c7 be more precise in comments 2018-08-31 16:01:21 +04:00
ad3d42981a update Gopkg.lock 2018-08-31 16:01:21 +04:00
0f7485690e limit chain ID to 50 symbols max 2018-08-31 16:01:21 +04:00
d73c5cbdb1 reap max bytes from the mempool & check transaction size
See ADR 020: Limiting txs size inside a block docs/architecture/adr-020-block-size.md

Refs #2035
2018-08-31 16:01:21 +04:00
7b2f7090fd add missing changelog entry (#2303)
https://github.com/tendermint/tendermint/pull/2264#issuecomment-417378396
2018-08-31 11:59:52 +04:00
61ab10d655 config: reduce default mempool size (#2300)
* config: reduce default mempool size

This reduces the mempool size from 100k to 5k. Note that each secp256k1 sig
takes .5ms to compute. Therefore an adversary could previously delay every
node on the network's computation time upon receiving a block by 50 seconds.

This now reduces that ability to being able to only delay each node by 2.5
seconds. This change should be reverted once ABCI recheck is implemented.

* (squash this) fix test
2018-08-30 17:41:58 -04:00
3a6cc5e6af cache codecov script (#2291) 2018-08-30 10:11:33 +04:00
c43fb700e3 New NewGoLevelDBWithOpts() to pass opts down to goleveldb (#2293)
Closes: #2292
2018-08-29 08:44:55 +04:00
bd531401a0 mempool: Store txs by hash inside of cache (#2234)
* mempool: Store txs by hash inside of cache

This allows for large cachesizes, without fear of the memory
consumption growing rapidly.

* (squash this) rename hashedTx -> txHash
2018-08-29 08:10:06 +04:00
9d06d7e306 update secret connection to use a little endian encoded nonce (#2264)
* update secret connection to use a little endian encoded nonce

* update encoding of chunk length to be little endian, too

* update comment

* Change comment slightly to trigger circelci
2018-08-28 09:37:38 +04:00
b1bc3e4f89 crypto/secp256k1: Fix signature malleability, adopt more efficient en… (#2239)
* crypto/secp256k1: Fix signature malleability, adopt more efficient encoding

This removes signature malleability per ADR 14, and makes secp match
the encoding in ADR 15.

* (squash this) add lock
2018-08-28 09:32:54 +04:00
38b401657e Cleanup up Multisig naming (#2255)
* crypto/multisig: Pubkey -> PubKey

* crypto/encoding/amino: use pkg vars for routes

* crypto/multisig/bitarray

* crypto/multisig: ThresholdMultiSignaturePubKey -> PubKeyMultisigThreshold

* crypto/encoding/amino: add PubKeyMultisig to table

* remove bA import alias

https://github.com/tendermint/tendermint/pull/2255#discussion_r211900709
2018-08-28 08:41:40 +04:00
8972b6e293 Update config.js (#2287) 2018-08-28 08:37:35 +04:00
5f255f0f71 Replace db_path with db_dir in default configuration (#2284)
* db_path is not being parsed

Fix default configuration, db_path is now db_dir.

Closes: cosmos/cosmos-sdk#1712

* Update CHANGELOG_PENDING.md
2018-08-27 17:27:18 +04:00
20e35654c6 lint markdown docs using a stop-words and write-good linters (#2195)
* lint docs with write-good, stop-words

* remove package-lock.json

* update changelog

* fix wrong paragraph formatting

* fix some docs formatting

* fix docs format

* fix abci spec format
2018-08-27 11:33:46 +04:00
8a84593c02 Reduce code in common/math (#2274) 2018-08-27 10:43:15 +04:00
aab5947d82 docs: deprecate RTD (#2280) 2018-08-27 10:37:54 +04:00
2f7fc87230 docs: fix img links, closes #2214 (#2282) 2018-08-27 10:36:22 +04:00
1cf6712a36 quick fix for CircleCI (#2279)
See https://discuss.circleci.com/t/saving-cache-stopped-working-warning-skipping-this-step-disabled-in-configuration/24423/2
2018-08-27 10:19:27 +04:00
43ebc77f9b Fix typo, closes #2269 (#2277) 2018-08-26 11:45:34 +04:00
debe56326f Merge pull request #2159 from tendermint/bucky/abci-validators
Bucky/abci validators
2018-08-17 11:12:27 -04:00
6dde320591 fixes from review 2018-08-17 10:32:10 -04:00
62b2093da5 ABCIAppClient conn close (#2236)
Refs https://github.com/grpc/grpc-go/issues/2264
2018-08-17 11:59:46 +04:00
76bb4b15c7 rebase fixes 2018-08-16 13:22:04 -04:00
0cbf9b2a7d update changelog 2018-08-16 13:19:30 -04:00
0701d79046 minor fixes 2018-08-16 13:19:14 -04:00
4f61b97bbe update dep for proto. fix types/proto3/block.proto 2018-08-16 13:19:14 -04:00
1111c1848d update abci spec 2018-08-16 13:19:14 -04:00
c919643c3e abci: move round back from votes to commit 2018-08-16 13:19:14 -04:00
b189ab676f makefile: lint flags 2018-08-16 13:19:14 -04:00
fe6a504374 revert gogo version used to generate files 2018-08-16 13:19:13 -04:00
91376627ea update ADR 2018-08-16 13:19:13 -04:00
e3f54ece2f abci: VoteInfo, ValidatorUpdate. See ADR-018 2018-08-16 13:19:13 -04:00
f26b83f15f abci: add next_validators_hash to header 2018-08-16 13:19:13 -04:00
1f6c7bf22a make: update protoc_abci use of awk 2018-08-16 13:19:13 -04:00
d69cf9dd2f Merge pull request #2231 from tendermint/anton/changelog-2
Add a changelog entry & Upgrading guides
2018-08-15 10:19:06 -04:00
4e78badac9 docs: note max outbound peers excludes persistent 2018-08-15 12:54:20 +04:00
684e3cb446 add upgrading guides 2018-08-15 12:53:00 +04:00
a649deb6ee add a changelog entry 2018-08-15 12:52:43 +04:00
5446452b01 pass in NodeKey to NewNode (#2212)
Fixes #1544
2018-08-15 12:29:45 +04:00
ad24d66750 [abci-cli] print out all the sub-commands available (#2219) 2018-08-15 12:28:17 +04:00
eb98f1c3a9 add missing changelog entries (#2224) 2018-08-14 19:16:18 -04:00
728d2ed266 crypto: Remove unnecessary prefixes from amino route variable names (#2205)
* crypto: Remove unnecessary ed25519 and secp256k1 prefixes from amino routes.

* (squash this) add changelog

* (squash this) multisig amino fixes

* (squash this) fix build error
2018-08-14 19:13:25 -04:00
e10666859f Zach/automated docs (#2225)
* add docs/config.js for better developer experience

* update docs_readme :)
2018-08-14 18:40:05 -04:00
6fad8eaf5a [p2p/pex] connect to more than 10 peers (#2169)
* [p2p/pex] connect to more than 10 peers

also, remove DefaultMinNumOutboundPeers because a) I am not sure it's
needed b) it's super confusing

look closely

```
maxPeers := sw.config.MaxNumPeers - DefaultMinNumOutboundPeers
if maxPeers <= sw.peers.Size() {
  sw.Logger.Info("Ignoring inbound connection: already have enough peers", "address", inConn.RemoteAddr().String(), "numPeers", sw.peers.Size(), "max", maxPeers)
```

we print maxPeers = config.MaxPeers - DefaultMinNumOutboundPeers. So we
may not have enough peers even though we say we have enough.

Refs #2130

* update spec

* replace MaxNumPeers with MaxNumInboundPeers/MaxNumOutboundPeers

Refs #2130

* update changelog

* make max rpc conns formula visible to users

* update spec

* docs: note max outbound peers excludes persistent
2018-08-14 18:25:56 -04:00
db53dc5fd4 Merge pull request #2164 from tendermint/dev/multisig
Threshold Multisignature implementation
2018-08-14 16:37:07 -04:00
2fe34491ba (squash this) Fix build errors 2018-08-14 11:42:40 -07:00
80e49abada send ValidatorSetUpdates event when validator set changes (#2161)
Refs #1916
2018-08-14 19:16:35 +04:00
0f931eeb10 types: allow genesis file to have 0 validators (#2148)
* fixing issue 2015

* Remove comments for code review

* Update tests
2018-08-14 19:02:53 +04:00
89668c3179 clist: Speedup functions (#2208)
* clist: Speedup detachNext() and detachPrev()

We used unnecessary function calls, defers, and extra mutexes.
These are not our friends for writing fast code in our libs.

* Remove more defers from clist functions

* Add more benchmarks
2018-08-14 19:00:21 +04:00
d0dcb1cde1 cmap: Remove defers (#2210)
All functions in cmap have just one code path. Thus there is not a reason
to use defer statements.
2018-08-14 18:59:04 +04:00
ed08ae7321 [tm-monitor] use pubkey.Equals() func instead of raw == (#2221) 2018-08-14 18:57:48 +04:00
6beaf6e72d (squash this) address Jae's comments on NumTrueBitsBefore 2018-08-13 18:46:33 -07:00
3624a17642 blockchain: fix register concrete name. (#2213) 2018-08-13 17:40:49 +04:00
8a1a79257e mempool: Keep cache hashmap and linked list in sync (#2188)
* mempool: Keep cache hashmap and linked list in sync

This removes bugs with the linked list being full, but hashmap empty

* address PR comments

* switch clist back to list
2018-08-13 14:42:33 +04:00
9c6fdad276 Merge pull request #2200 from tendermint/anton/missing-changelog-entry
Add missing changelog entry
2018-08-10 17:41:48 -04:00
8d28344e84 (Squash this) switch to bare 2018-08-10 13:59:35 -05:00
4cf1dbd676 (squash this) fix amino route 2018-08-10 13:20:59 -05:00
00db469fc0 (squash this) begin addressing PR comments 2018-08-10 13:14:43 -05:00
93aadf160f add missing changelog entry
Refs #1954
2018-08-10 09:33:02 +04:00
2756be5a59 libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199)
* libs: Remove usage of custom Fmt, in favor of fmt.Sprintf

Closes #2193

* Fix bug that was masked by custom Fmt!
2018-08-10 09:25:57 +04:00
fc7c298cc0 Remove gogoproto from Makefile's TOOLS (#2198)
* remove gogoproto from tools

because it's not a binary

* update protobuf version to 3.6.1 in `make get_protoc`

* update libs/common/types.pb.go and rpc/grpc/types.pb.go

* fix app tests
2018-08-10 09:14:17 +04:00
785786bec4 add json2wal & fix wal2json (#2196)
* add json2wal & fix wal2json

* fix bug

* Update main.go

* add wal2JsonTest file

* Delete wal2JsonTest
2018-08-10 09:09:40 +04:00
aab26c3ff7 Merge remote-tracking branch 'origin/develop' into dev/multisig 2018-08-09 01:05:39 -05:00
5a8fe61200 crypto: Add compact bit array for intended usage in the multisig (#2140)
* crypto: Add compact bit array for intended usage in the multisig

This is in a separate PR for ease of review.

* (squash this) add comment
2018-08-09 09:38:23 +04:00
3c98cec2c2 Add ADR entry for ProposeTx (#1813)
This adds an ADR entry addressing the implementation of a `ProposeTx`
method in the ABCI proposed in #1776. Fundamentally, this proposal gives
some control of block proposals to the application. The initial use case is
to support the Minimal Viable Plasma specification.
2018-08-08 23:12:36 +04:00
1fbca09e3c [ADR] Proposal for multisignature encoding (#1960)
* ADR: Proposal for multisignature encoding

This proposal is partially tied to the resolution of #1957.

* Change title to Encoding standard for multisignatures

* ADR: Change multisigs ADR now that amino must be used for pubkeys

* Address PR comments
2018-08-08 23:10:33 +04:00
37ea7040ef remove JB from codeowners file (#2174) 2018-08-08 13:03:00 +04:00
6770992b01 Merge pull request #2181 from tendermint/zach/docs-fixes
docs: fix links & other improvements
2018-08-07 20:35:13 -04:00
b30596b3a1 docs: fix links & other imrpvoements 2018-08-07 19:47:51 -04:00
ef5c27a2d2 Merge pull request #2154 from tendermint/bucky/speed-up-tests
speed up some tests. ref #2038
2018-08-07 15:57:08 -04:00
e1b9bf7c81 set capacity of txsmap (#2166) 2018-08-07 20:50:10 +04:00
4e7bf10b59 (squash this) squashed bug with multiple signatures at same index. 2018-08-07 11:37:42 -05:00
67b6d51ff4 (squash this) address PR comments + fix bug in equality check 2018-08-07 10:44:38 -05:00
6dbbdb9438 Merge branch 'dev/compact_bitmap' into dev/multisig 2018-08-06 21:20:23 -05:00
e7dd76c28d crypto: Threshold multisig implementation 2018-08-06 21:17:38 -05:00
21448bcf4f crypto: Add compact bit array for intended usage in the multisig
This is in a separate PR for ease of review.
2018-08-06 15:55:02 -05:00
ec3e34efd8 Merge pull request #2145 from tendermint/bucky/adr-chain-versions
adr: chain-versions
2018-08-05 22:48:06 -04:00
b19e148bc5 Merge pull request #2144 from tendermint/bucky/adr-protocol-versions
adr: protocol versioning
2018-08-05 22:47:12 -04:00
6f8b62d1f3 Merge pull request #2149 from tendermint/bucky/adr-abci-validators
[ADR] ABCI Validators
2018-08-05 22:44:38 -04:00
e0e19a24a4 Merge pull request #2157 from tendermint/master
Merge pull request #2152 from tendermint/release/v0.23.0
2018-08-05 17:12:01 -04:00
013b9cef64 Merge pull request #2152 from tendermint/release/v0.23.0
Release/v0.23.0
2018-08-05 17:11:22 -04:00
087b657008 speed up some tests. ref #2038 2018-08-05 16:59:23 -04:00
fe835cd456 Merge pull request #2116 from tendermint/265-change-abci-header-to-match-tm
change ABCI header to match Tendermint exactly
2018-08-05 16:55:10 -04:00
d7035abe73 change ABCI header to match Tendermint exactly
Now that Tendermint Amino will be compatible with proto3, the Header in ABCI
should exactly match the Tendermint header - they will then be encoded
identically in ABCI and in Tendermint Core.

Refs #265
2018-08-05 16:57:38 -04:00
f2b629680a Merge pull request #2153 from tendermint/bucky/merge-0.23.0-to-develop
Bucky/merge 0.23.0 to develop
2018-08-05 16:43:00 -04:00
720ce658f1 Merge branch 'release/v0.23.0' into bucky/merge-0.23.0-to-develop 2018-08-05 16:42:04 -04:00
309a6772d7 types: fix formatting when printing signatures
- use cmn.Fingerprint and %X
2018-08-05 16:35:43 -04:00
8bd514d9fb update changelog 2018-08-05 15:55:48 -04:00
f903947ff3 crypto: Remove interface from crypto.Signature
Signatures are now []byte, which saves on the number of bytes after
amino encoding

(squash this) address Ismail's comment
2018-08-05 15:46:57 -04:00
ea67fb55eb Merge pull request #2106 from tendermint/1134-add-proposer-to-the-block
add proposer address to block's Header
2018-08-05 15:18:42 -04:00
e1062a657f fixes for ProposerAddress
- state.MakeBlock takes a proposerAddr
- validateBlock only checks that the ProposerAddress is in the validator
  set
- fix raceyness from bad proposer test:
  - use privValidator to get the proposer address (instead of racy
    state)
  - note we had to remove the test that checked the correct proposer was
    included for higher rounds because we don't have a good way to test
    this with multiple consensus states and not using the
    privValidator.Address while calling createProposalBlock was a hack!
2018-08-05 15:19:21 -04:00
4d998b7c03 consensus: failing test for ProposerAddress 2018-08-05 15:17:43 -04:00
bec9d5cba9 add proposer address to block's Header
Refs #1134

Validation:

- ignored in block.ValidateBasic since it's stateful information
- checked in blockExec.ValidateBlock
2018-08-05 15:16:49 -04:00
06a157ad06 Merge pull request #1815 from tendermint/jae/literefactor4
ValidatorSet change delayed by 1 block, and lite refactor (#2)
2018-08-05 14:54:07 -04:00
d6a666b445 p2p/pex: Fix mismatch between dialseeds and checkseeds. (#2151) 2018-08-05 14:47:01 -04:00
c5c2b9601f update changelog and version 2018-08-05 14:14:56 -04:00
7538864c15 Merge branch 'develop' into jae/literefactor4 2018-08-05 13:51:41 -04:00
279259ec8e adr-018: abci validators 2018-08-05 12:45:27 -04:00
ca9d07e5e4 update deps for amaino v0.12.0-rc0 2018-08-05 12:39:08 -04:00
6e3c5e8033 p2p/pex: Allow configured seed nodes to not be resolvable over DNS (#2129)
* p2p/pex: Allow configured seed nodes to be offline

Previously you couldn't startup tendermint if a seed node was offline.
This now allows you to startup tendermint, as long as all seed node addresses
are formatted correctly. In the event that all seed nodes are down,
and the address book is empty, then it crashes with an informative error msg.
(This case doesn't occur if no seeds were specified)

Closes #1716

* (Squash this) Address melekes' comments

* (squash this) fix package imports

* (squash this) fix pex_reactor comment

* (squash this) add a test case
2018-08-04 20:35:08 -04:00
8073e51b04 Merge pull request #2096 from tendermint/dev/adr_symmetric
[ADR] Proposal for encoding symmetric cryptography
2018-08-04 20:27:24 -04:00
3161ebbc2f Merge pull request #2091 from tendermint/dev/adr_secp_signatures
[ADR] Fix malleability problems in Secp256k1 signatures
2018-08-04 20:22:56 -04:00
4cbeb30da2 Merge pull request #2136 from tendermint/1944-update-grpc
update genproto
2018-08-03 23:40:21 -04:00
d5b5e5a2e4 Merge pull request #2135 from tendermint/2072-unresponsive-tm-after-cs-failure
consensus: non-responsive to CTRL-C if consensus state panics
2018-08-03 23:39:25 -04:00
6691492540 (squash this) indicate what Ethereum does 2018-08-03 17:49:46 -07:00
0f80a7da82 adr: chain-versions 2018-08-03 20:23:37 -04:00
ae2238efe6 adr: protocol versioning 2018-08-03 20:21:40 -04:00
2878c7523f update github bug report template (#2131) 2018-08-03 11:39:57 +04:00
b1cff0f9bf [libs/autofile] create a Group ticker on Start
1) no need to stop the ticker in createTestGroup() method
2) now there is a symmetry - we start the ticker in OnStart(), we stop it
in OnStop()

Refs #2072
2018-08-03 11:34:58 +04:00
d09a3a6d3a stop gracefully instead of trying to resume ops
Refs #2072

We most probably shouldn't be running any further when there is some
unexpected panic. Some unknown error happened, and so we don't know if
that will result in the validator signing an invalid thing. It might be
worthwhile to explore a mechanism for manual resuming via some console
or secure RPC system, but for now, halting the chain upon unexpected
consensus bugs sounds like the better option.
2018-08-03 11:24:55 +04:00
87f09adeec (Squash this) Be more explicit about the exact encoding of the secp signature 2018-08-02 23:27:16 -07:00
b3a3c8a192 Merge remote-tracking branch 'origin/develop' into dev/adr_secp_signatures 2018-08-02 23:25:14 -07:00
96fdec0fca crypto: Add compact bit array for intended usage in the multisig
This is in a separate PR for ease of review.
2018-08-02 23:18:09 -07:00
fe5e7808f2 fix Gopkg.lock 2018-08-02 19:15:32 -04:00
2d1c5a1ce6 Merge remote-tracking branch 'origin/develop' into jae/literefactor4 2018-08-02 19:12:22 -04:00
00ebdcd581 update pending changelog 2018-08-02 19:06:29 -04:00
2487210414 Merge pull request #2097 from tendermint/1772-revert
revert "make `/status` RPC endpoint resistant to consensus halt"
2018-08-02 17:31:07 -04:00
a040c36dfb (squash this) change adr number, remove redundancy in function names 2018-08-02 10:43:47 -07:00
d579f4c610 update genproto
Closes #1944
2018-08-02 17:54:55 +04:00
b82138b002 update changelog 2018-08-02 16:48:12 +04:00
8ed99c2c13 exit from initSighupWatcher child goroutine
also, remove excessive log message

Refs #2072
2018-08-02 16:42:25 +04:00
4c5a143a70 respawn receiveRoutine so we can properly exit
Closes #2072
2018-08-02 16:36:28 +04:00
b33f73eaf1 stop autofile and autogroup properly
NOTE: from the ticker#Stop documentation:

```
Stop does not close the channel, to prevent a read from the channel
succeeding incorrectly.
https://golang.org/src/time/tick.go?s=1318:1341#L35
```

Refs #2072
2018-08-02 16:33:34 +04:00
e719a93d1d Addressed review for #1815 except those marked as 'TODO make issue' 2018-08-02 03:10:50 -07:00
eb9b37e196 Pull out consensus liveness fix, which went to #1815 2018-08-02 01:59:46 -07:00
eaa137512c adr: Encoding for cryptography at launch (#2121) 2018-08-01 18:19:21 -04:00
023bb99eb0 p2p: Add test vectors for deriving secrets (#2120)
These test vectors are needed for comparison with the Rust implementation.
To implement this effectively, a "RandBool" method was added to cmn.Rand.
2018-08-01 15:06:29 -04:00
f2f53442c6 reorder BaseConfig according to generated version
also, add `priv_validator_laddr` to the template
2018-08-01 16:20:59 +04:00
24ae878b9f update encoding test to how amino skips empty pointers 2018-08-01 13:29:41 +02:00
619bb3b2d7 Merge remote-tracking branch 'remotes/origin/jae/literefactor5' into jae/literefactor6 2018-08-01 03:06:00 -07:00
dde96b75ce abci: Update readme for building protoc (#2124) 2018-08-01 13:57:31 +04:00
6fb2f44cc3 p2p: Connect to peers from a seed node immediately (#2115)
This is to reduce wait times when initially connecting. This still runs checks
such as whether you still want additional peers.

A test case has been created, which fails if this change is not included.
2018-07-31 22:09:01 +02:00
08ad162daa docs: Modify blockchain spec to reflect validator set changes (#2107) 2018-07-31 20:19:57 +02:00
a83eed104c libs/cmn: Remove Tempfile, Tempdir, switch to ioutil variants (#2114)
Our Tempfile was just a wrapper on ioutil that panicked instead of error.

Our Tempdir was a less safe variant of ioutil's Tempdir.
2018-07-31 19:43:36 +02:00
be642754f5 libs/cmn/writefileatomic: Handle file already exists gracefully (#2113)
This uses the stdlib's method of creating a tempfile in our write
file atomimc method, with a few modifications. We use a 64 bit number
rather than 32 bit, and therefore a corresponding LCG. This is to
reduce collision probability. (Note we currently used 32 bytes previously,
so this is likely a concern)

We handle reseeding the LCG in such a way that multiple threads are
even less likely to reuse the same seed.
2018-07-31 19:43:36 +02:00
2608249e5b libs/common: Refactor tempfile code into its own file 2018-07-31 19:43:36 +02:00
62b8ee270d [docs] Validator's address can be skipped (#2117)
Refs #1712
2018-07-31 18:28:19 +02:00
0c7338c5f0 abci: Change validators to last_commit_info in RequestBeginBlock (#2074)
* change validators to last_commit_info in RequestBeginBlock
* do not send pubkeys with RequestBeginBlock

Refs #1856
2018-07-30 17:29:40 +02:00
231cdc1320 ci: Reduce log output in test_cover (#2105)
This commit makes it such that circle CI only shows the module whose
tests it is currently running in the log, unless a test fails. For each
failing test, it will display the name of all failing tests, along with
their log output. This is done to make
our log output far more scrollable. We lose no information in debugging.
2018-07-30 01:05:27 +02:00
fef4fe1c66 Link to "The latest gossip on BFT consensus" (#2102)
The paper is such a useful resource to anyone building on Tendermint. It should be linked in the ReadMe.
2018-07-29 09:49:42 +04:00
f00b52b710 libs/autofile/group_test: Remove unnecessary logging (#2100)
Previously we logged `Testing for i <i>` for all i in [0,100).
This was unnecessary. This changes it to just log the value for i on
error messages, to reduce the unnecessary verbosity in log files.
2018-07-29 09:48:37 +04:00
188e459273 Removed unnecessary onStart call (#2098)
* Removed unnecessary onStart & onStop calls in reactor

* Refactor OnStart & OnStop in reactor

* Removed redundant OnStart func in reactor
2018-07-29 09:46:53 +04:00
3d5d254932 (squash this) Mixed up field element and curve element. Idea still stands. 2018-07-28 20:41:19 -07:00
ce9ddc7cd7 (squash this) Note not to overwrite aead's. 2018-07-28 06:33:15 -07:00
c03ad56d55 (squash this) Note that this breaks existing keys. 2018-07-28 04:23:22 -07:00
caef5dcd69 (Squash this) forgot to say that algo_name should be length prefixed 2018-07-28 04:14:07 -07:00
7634073718 revert "make /status RPC endpoint resistant to consensus halt"
Refs #1772

Reasons:
- this was a bad patch for something not well understood

Lessons learned:
- nobody should be modifying code without understanding the problem
first. it will only result in more technical debt and code rot.
- we never hide information when we suspect a bug or we'not sure what's
going on.
2018-07-28 09:17:42 +04:00
af2894c0f8 (squash this) improve grammar. 2018-07-27 19:27:25 -07:00
a2debe57c7 [ADR] Proposal for encoding symmetric cryptography 2018-07-27 18:10:41 -07:00
5955eddc7d ADR: Fix malleability problems in Secp256k1 signatures
Previously you could not assume that your transaction hash would
appear on chain.
2018-07-27 13:18:21 -07:00
4bab34ae45 Merge pull request #2088 from tendermint/bucky/fix-evidence-test
consensus: Fix test for blocks with evidence
2018-07-27 14:06:12 -04:00
fe5b0d7074 consensus: fix test for blocks with evidence 2018-07-27 14:00:05 -04:00
96ae535fb8 proto3 timestamp (#2064)
This PR changes ABCI time format from int64 (Unix seconds) to WKT (WellKnownType) google.protobuf.Timestamp.

Refs #1857

Reasons:

better precision
standard DT for proto

* update Gopkg.lock
* [makefile] remove extra grep
    - go list excludes vendor by default now
* proto3 timestamp
* [docs/abci-spec] note about serialisation format
* make time non-nullable
2018-07-27 04:23:19 +02:00
4be6395ee0 Merge pull request #2085 from tendermint/master
Merge 0.23.8 back into develop
2018-07-27 04:21:34 +02:00
bc526f18a4 libs: Make bitarray functions lock parameters that aren't the caller (#2081)
This now makes bit array functions which take in a second bit array, thread
safe. Previously there was a warning on bitarray.Update to be lock the
second parameter externally if thread safety wasrequired.
This was not done within the codebase, so it was fine to change here.

Closes #2080
2018-07-27 04:21:08 +02:00
40d6dc2ee5 Merge pull request #2082 from tendermint/release/0.22.8
HotFix for 0.22.7, bump to 0.22.8
2018-07-26 19:13:27 -07:00
d542d2c394 Fix 0.22.7, bump to 0.22.8 2018-07-26 18:08:09 -07:00
fd29fd6465 adr: PeerTransport (#2069)
* p2p: Propose PeerTransport ADR
* adr: Set status to in review
* adr: Add high-level decision
* adr: Extend on the idea of guards
* adr: Rework guards into transport specific filters
* adr: Rename to nodeAddr
* adr: Incorporate review
2018-07-27 02:27:19 +02:00
6241e6b927 libs: update BitArray go docs (#2079) 2018-07-27 02:10:58 +02:00
18acd77e40 Merge pull request #2076 from tendermint/hotfix/0.22.7
Hotfix/0.22.7
2018-07-26 19:00:50 -04:00
49b52ee3c7 Add test for MakePartSet with evidence 2018-07-26 19:00:07 -04:00
e4dfab6349 changelog and version 2018-07-26 18:54:15 -04:00
0e127562bf register evidence interface wherever its used 2018-07-26 18:53:19 -04:00
9f19229791 .github: Split the issue template into two seperate templates (#2073)
* .github: Split the issue template into two seperate templates

Now we have different bug report and feature request templates.

* Forgot to add the name, and about fields
2018-07-26 12:18:55 +04:00
bdab37a626 Merge pull request #2054 from tendermint/dev/secret_connection
secret connection update
2018-07-26 00:29:36 +02:00
7bf28af590 p2p/secret_connection: Switch salsa usage to hkdf + chacha
This now uses one hkdf on the X25519 shared secret to create
a key for the sender and receiver.
The hkdf call is now just called upon the computed shared
secret, since the shared secret is a function of the pubkeys.

The nonces now start at 0, as we are using chacha as a stream
cipher, and the sender and receiver now have different keys.
2018-07-26 00:12:32 +02:00
1b04e4e5f1 p2p: Remove RipeMd160.
Generate keys with HKDF instead of hash functions, which provides better security properties.

Add xchacha20poly1305 to secret connection. (Due to rebasing, this code has been removed)
2018-07-26 00:09:37 +02:00
66fe5b7bae rpc: Improve slate for Jenkins (#2070) 2018-07-25 23:37:08 +02:00
24b94d7aa4 crypto: Switch hkdfchacha back to xchacha (#2058)
hkdfchachapoly was a construction we came up with. There is no longer any
reason to use it. We should instead just use xchacha for the remaining use
cases we have. (Symmetrically encrypting the keys in the sdk keys package)
2018-07-25 23:12:39 +02:00
0bd4fb96f0 crypto: Add benchmarking code for signature schemes (#2061)
* crypto: Add benchmarking code for signature schemes

This does a slight refactor for the key generation code. It now calls a
seperate unexported method to allow generation from a reader. I think this
will actually reduce time in generation, due to no longer initializing an
extra slice. This was needed in order to enable benchmarking.

This uses an internal package for the benchmarking code, so that this can
be standardized without being exported in the public API. The benchmarking
code is derived from agl/ed25519's benchmarking code, and has copied the
license over.

Closes #1984
2018-07-25 23:07:47 +02:00
9cfc47a93b makefile: Add make check_dep and remove make ensure_deps (#2055)
This adds a new makefile command, which is used in CI linting, `make check_dep`.
This ensures the toml is in sync with the lock, and that were not pinning to a
branch in any repository.

This also adapts `make get_vendor_deps` to check the lock, in addition to
populating the vendor directory. This removes the need for `make ensure_deps`.

This makes `make get_vendor_deps` consistent between tendermint and the sdk.
2018-07-25 18:09:52 +02:00
d212292f86 Merge pull request #2066 from tendermint/bucky/merge-master
Bucky/merge master
2018-07-25 17:36:39 +02:00
7ad92c44cb Merge branch 'master' into bucky/merge-master 2018-07-25 11:34:32 -04:00
5fdbcd70df Merge pull request #2056 from tendermint/hotfix/v0.22.6
Hotfix/v0.22.6
2018-07-25 11:18:00 -04:00
d149d8f96d github: update PR template to indicate changing pending changelog. (#2059) 2018-07-25 11:34:51 +04:00
74b6cc9057 rpc: log error when we timeout getting validators from consensus (#2045) 2018-07-25 10:56:00 +04:00
6046b99197 consensus: include evidence in proposed block parts. fixes #2050 2018-07-24 21:58:39 -04:00
359898dcac p2p: fix conn leak. part of #2046 2018-07-24 21:53:37 -04:00
5768b67162 changelog and version 2018-07-24 21:26:41 -04:00
082557b7d4 rpc: validate height in abci_query 2018-07-24 21:25:47 -04:00
8dc655dad2 rpc: fix /blockchain OOM #2049 2018-07-24 21:18:20 -04:00
70d3783747 dep: revert updates
- leave protobuf on 1.1.1 for grpc import fixes
- amino v0.11 breaks tendermint - revert to v0.10.1
2018-07-24 21:01:14 -04:00
60378fd7f9 abci: remove fee (#2043)
Refs #1861

We don't use the fee field and its likely just confusing.

We can add backwards compatible priority (instead of fee) later.

Note priority is better than fee because it lets the app do the math on how to rank order transactions, rather than forcing that into tendermint (ie. if we return fee, priority would be fee/gas)
2018-07-24 17:28:26 +02:00
c248ce5ef6 p2p: Reject addrs coming from private peers (#2032)
Refs #1706
2018-07-24 17:10:58 +02:00
059a03a66a tools: clean up Makefile and remove LICENSE file (#2042)
* lean up Makefile and remove LICENSE file
* remove k8s and build LICENSE files
* remove non-existing target
2018-07-24 16:02:32 +02:00
abe5b63059 Merge pull request #2040 from tendermint/2027-socket-pv
fix acceptDeadline
2018-07-24 15:52:45 +02:00
a657870b3d update dockerfile 2018-07-24 09:42:08 -04:00
7e7473ad41 Merge pull request #2044 from tendermint/2019-prometheus
do not overwrite metrics provider in node#NewNode
2018-07-24 15:41:44 +02:00
75a26ebd6d do not overwrite metrics provider in node#NewNode
also, make running Prometheus server optional.

Closes #2019
2018-07-24 16:01:11 +04:00
ad580e2734 fix acceptDeadline
before: 1.000000003s
after: 3.000000000s

Refs #2027
2018-07-24 10:51:12 +04:00
f6705f02c7 fixes post merge 2018-07-23 23:39:22 -04:00
ea31c4836a Merge branch 'develop' into jae/literefactor4 2018-07-23 23:28:14 -04:00
f1093edbe2 remove accidental files 2018-07-23 23:11:53 -04:00
b92860b6c4 Merge pull request #1805 from tendermint/jae/optimize_blockchain
Optimizing blockchain reactor.
2018-07-23 22:46:51 -04:00
54d753e64e fix Gopkg, add changelog 2018-07-23 22:48:38 -04:00
e1b48b16c4 Merge branch 'develop' into jae/optimize_blockchain 2018-07-23 22:16:34 -04:00
7c07235649 Merge pull request #2036 from tendermint/master
Merge master to develop
2018-07-23 22:05:44 -04:00
05a76fb517 Merge pull request #2029 from tendermint/release/0.22.5
Release/0.22.5
2018-07-23 21:57:43 -04:00
15b112e669 mempool: chan bool -> chan struct{} 2018-07-23 21:06:47 -04:00
2aef80bcff Merge pull request #2034 from tendermint/dev/fix_pkg_names
crypto: Fix package imports from the refactor
2018-07-23 20:34:34 -04:00
f3d519c966 crypto: Fix package imports from the refactor 2018-07-23 16:14:21 -07:00
9962e598a0 reconnect to self-reported address if persistent peer is inbound (#2031)
* reconnect to self-reported address if persistent peer is inbound

* add a fixme
2018-07-23 21:15:08 +04:00
948b91e62e add missing changelog entries 2018-07-23 17:16:43 +04:00
1e05242297 update changelog and bump version to 0.22.5 2018-07-23 17:07:14 +04:00
94e8252607 #2021 follow up (#2028)
* update changelog

* txAvailable is always true

Refs #2021, #1920

* remove debug message

No additional value. `enterPropose` log message should be enough.

Refs #2021, #1920
2018-07-23 16:47:15 +04:00
eb7dea1b0d crypto/ed25519: Remove privkey.Generate method (#2022)
The privkey.Generate method here was a custom-made method for deriving
a private key from another private key. This function is currently
not used anywhere in our codebase, and has not been reviewed enough
that it would be secure to use. This removes that method. We should
adopt the official ed25519 HD derivation once that has been standardized,
in order to fulfill this need.

closes #2000
2018-07-23 15:35:13 +04:00
e36ce6f893 fix race condition on proposal height for published txs (#2021)
* #1920 try to fix race condition on proposal height for published txs

- related to create_empty_blocks=false
- published height for accepted tx can be wrong (too low)
- use the actual mempool height + 1 for the proposal
- expose Height() on mempool

* #1920 add initial test for mempool.Height()

- not sure how to test the lock
- can the mutex reference be of type Locker?
-- this way, we can use a "mock" of the mutex to test triggering

* #1920 use the ConsensusState height in favor of mempool

- gets rid of indirections
- doesn't need any "+1" magic

* #1920 cosmetic

- if we use cs.Height, it's enough to evaluate right before propose

* #1920 cleanup TODO and non-needed code

* #1920 add changelog entry
2018-07-23 15:34:45 +04:00
c5c1689591 crypto/secp256k1: Add godocs, remove indirection in privkeys (#2017)
* crypto/secp256k1: Add godocs, remove indirection in privkeys

The following was previously done for creating secp256k1 private keys:

First obtain privkey bytes. Then create a private key in the
underlying library, with scalar exponent equal to privKeyBytes.
(The method called was secp256k1.PrivKeyFromBytes,
fb90c334df/btcec/privkey.go (L21))

Then the private key was serialized using the underlying library, which just
returns back the bytes that comprised the scalar exponent, but padded to be
exactly 32 bytes.
fb90c334df/btcec/privkey.go (L70)

Thus the entire indirection of calling the underlying library can be avoided
by just ensuring that we pass in a 32 byte value. A test case has even be written
to show this more clearly in review.

* crypto/secp256k1: Address PR comments

Squash this commit

* crypto: Remove note about re-registering amino paths when unnecessary.

This commit should be squashed.
2018-07-21 08:52:04 +04:00
b41b89732d Update store.go
Revert to SetSync for saveABCIResponses() as per Ethan's feedback
2018-07-20 14:38:27 -07:00
5e96421d44 Merge pull request #1966 from tendermint/dev/refactor_crypto
crypto: Refactor to move files out of the top level directory
2018-07-20 22:48:41 +04:00
c798702764 crypto: Remove Ed25519 and Secp256k1 suffix on GenPrivKey 2018-07-20 10:44:21 -07:00
17c0029233 Merge remote-tracking branch 'origin/develop' into dev/refactor_crypto 2018-07-20 08:59:41 -07:00
0f2d97dffe Merge pull request #1742 from Liamsi/proto_files
Add Proto files for types.Header (incl. BlockId, Time, PartsSetHeader)
2018-07-20 17:43:25 +02:00
ed8714e40c Merge pull request #1965 from tendermint/693-part-2
make Block Header and Data non-pointers
2018-07-20 17:42:42 +02:00
6017d817e5 Merge pull request #2008 from tendermint/1772-rwmutex-cs
use RWMutex for consensus state
2018-07-20 17:24:55 +02:00
63835c0360 Merge pull request #2009 from tendermint/1772-call-validators-with-timeout
make `/status` RPC endpoint resistant to consensus halt
2018-07-20 17:22:16 +02:00
c82c60df11 rpc: Test Validator retrevial timeout 2018-07-20 17:08:55 +02:00
67762aec73 crypto/ed25519: Update the godocs (#2002)
This commit updates the godocs for the package, and adds an optimization
to the privkey.Pubkey() method.

The optimization is that in golang, the private key (due to interface
compatibility reasons) has a copy of the public key stored inside of it.
Therefore if this copy has already been computed, there is no need to
recompute it.
2018-07-20 10:09:30 +04:00
0fbb465b8f add protoc_all and protoc_grpc to .PHONY 2018-07-20 01:27:41 +04:00
2e75214316 update gogo to 1.1.1 and other misc. updates
Refs #1883
2018-07-20 01:27:41 +04:00
5be456e5b1 update grpc version to 1.13.0
Refs #1883
2018-07-20 01:27:41 +04:00
1bd5476854 make /status RPC endpoint resistant to consensus halt
Refs #1772
2018-07-19 11:26:50 +04:00
5037dd40c5 use RWMutex for consensus state
allows multiple RPC requests to query consensus state

Refs #1772
2018-07-19 10:49:12 +04:00
96818af9d5 fix protos to make all tests pass, document differences 2018-07-18 19:06:38 +02:00
571e602f07 Merge remote-tracking branch 'origin/develop' into dev/refactor_crypto 2018-07-18 08:54:51 -07:00
99e582d79a crypto: Refactor to move files out of the top level directory
Currently the top level directory contains basically all of the code
for the crypto package. This PR moves the crypto code into submodules
in a similar manner to what `golang/x/crypto` does. This improves code
organization.

Ref discussion: https://github.com/tendermint/tendermint/pull/1966

Closes #1956
2018-07-18 08:38:44 -07:00
a81ca93139 update to new (timestamp & empty structs) encoding in amino
- timestamps no longer have fixed length encoding
-
2018-07-18 16:37:15 +02:00
2744682e77 update to latest amino (pre) release v0.11.1
- also reformat code and order imports
2018-07-18 15:53:53 +02:00
d665c79cc9 WIP: more empty struct examples 2018-07-18 15:18:10 +02:00
3c38a25bbb add empty struct examples 2018-07-18 15:17:51 +02:00
0cd82fa166 add empty struct examples 2018-07-18 15:14:41 +02:00
99fa7f8132 everything works with https://github.com/tendermint/go-amino/pull/178 2018-07-18 15:14:41 +02:00
82104c9329 almost 2018-07-18 15:14:41 +02:00
40342bfa4a Update DOCS_README.md (#1985) 2018-07-18 13:32:17 +04:00
912fe477a4 Merge pull request #1987 from silasdavis/static-marshaler
Generate static marshalling methods for ABCI types to make compatible with downstream GRPC usage
2018-07-18 13:26:44 +04:00
b31ee798bd preserve original address and dial it instead of self-reported address (#1994)
Refs #1720
2018-07-18 13:23:29 +04:00
6c4ca140ed Add private peer ID tracking to AddrBook (#1989)
* Add private peer ID tracking to AddrBook

* Remove private peer tracking/blocking from pex

* debug level msg when we fail to add private address
2018-07-18 13:22:09 +04:00
449846ccb2 NodeInfo version check: delete redundant code 2018-07-18 13:12:52 +04:00
3353bb99ae tools: Remove redundant grep -v vendors/ (#1996)
* tools: Remove redundant grep -v vendors/

This was used in conjunction with `go list <path>`, however `go list`
already ignores the vendor directory. This made this `grep -v` redundant.

* Missed an apostrophe
2018-07-17 21:33:00 +04:00
b7e5cbeb3b Remove pb.go files from codecov
Signed-off-by: Silas Davis <silas@monax.io>
2018-07-17 17:42:30 +01:00
21b900dceb Add gogo generated tests for pb.go files
Signed-off-by: Silas Davis <silas@monax.io>
2018-07-17 14:56:11 +01:00
c9f92f465b Use pattern rule for protoc building and \\nolint in generated pb.go files
Signed-off-by: Silas Davis <silas@monax.io>
2018-07-17 14:20:49 +01:00
398f3779cc Add gogoproto marshallers to proto files in order to make use of
gogoproto.nullable compatible with GRPC downstream of ABCI and libs
protbuf types
2018-07-17 11:51:38 +01:00
257622cf6b update rpc/core/doc.go
Closes #1932 (#1986)
2018-07-17 10:52:49 +04:00
07ad325b1a A link fixed (#1991)
To address the relocation of terraform-and-ansible.md under networks/, as per e54c0f804f (diff-95ac35ad12aa33ed70e9ff5db2229771)
2018-07-17 10:49:38 +04:00
76f5e92528 Fixed a link (#1992)
Broken by #e54c0f8
2018-07-17 10:44:59 +04:00
71859f8f3b common/rand: Remove exponential distribution functions (#1979)
We were computing these functions incorrectly.
I'm not sure what distribution these numbers are, but it isn't the
normal exponential distribution. (We're making the probability of
getting a number of a particular bitlength equal, but the number in
that bitlength thats gets chosen is uniformly chosen)

We weren't using these functions anywhere in our codebase, and they
had a nomenclature error. (There aren't exponentially distributed
integers, instead they would be geometrically distributed)
2018-07-16 11:38:04 +04:00
a3df06d081 libs/common/rand: Update godocs
The godocs fell out of sync with the code here. Additionally we had
warning that these randomness functions weren't for cryptographic
use on every function. However these warnings are confusing, since
there was no implication that they would be secure there, and a
single warning on the actual Rand type would suffice. (This is what
is done in golang's math/rand godoc)

Additionally we indicated that rand.Bytes() was reading OS randomness
but in fact that had been changed.
2018-07-16 11:38:04 +04:00
dae7dc30e0 Switch usage of math/rand to cmn's rand (#1980)
This commit switches all usage of math/rand to cmn's rand. The only
exceptions are within the random file itself, the tools package, and the
crypto package. In tools you don't want it to lock between the go-routines.
The crypto package doesn't use it so the crypto package have no other
dependencies within tendermint/tendermint for easier portability.

Crypto/rand usage is unadjusted.

Closes #1343
2018-07-16 11:20:37 +04:00
14cebd181d config: 10x default send/recv rate (#1978)
* config: 10x default send/recv rate

This increases the default send/recv rate from 512 kB/s to 5.12 mB/s

Closes #1752

* Fix typo
2018-07-16 11:17:27 +04:00
522a425708 Merge pull request #1975 from tendermint/bucky/1951-fix-protoc-libs
makefile: fix protoc_libs
2018-07-15 13:19:00 +01:00
0fbcbb3aeb makefile: fix protoc_libs 2018-07-14 18:33:18 +01:00
8a5930ad72 Merge pull request #1974 from tendermint/master
Merge master back to develop
2018-07-14 15:13:52 +01:00
c64a3c74c8 Merge pull request #1972 from tendermint/release/v0.22.4
Release/v0.22.4
2018-07-14 14:55:12 +01:00
722f8a1b6f Merge pull request #1973 from tendermint/bucky/fix-pubsub-stop
fix stopping pubsub
2018-07-14 14:47:20 +01:00
d903057011 fix stopping pubsub 2018-07-14 14:50:56 +01:00
74106c8bea update changelog 2018-07-14 14:05:50 +01:00
94006855d1 changelog and version 2018-07-14 13:29:54 +01:00
a963af4c46 Merge pull request #1968 from tendermint/dev/tmbench_refactor_statistics
tools/tmbench: Move statistics to a seperate file
2018-07-14 13:14:00 +01:00
a1400aee73 Merge pull request #1964 from tendermint/dev/tmbench_improve_sendloop_efficiency
tools/tmbench: Improve accuracy with large tx sizes.
2018-07-14 13:12:33 +01:00
789666ef78 Merge pull request #1936 from tendermint/693-ensure-types-are-covered
Ensure all funcs in types pkg are well guarded (Part 1)
2018-07-14 13:02:56 +01:00
c66e1514de Merge branch 'develop' into 693-ensure-types-are-covered 2018-07-14 13:02:42 +01:00
a163f08e4e Merge pull request #1970 from tendermint/bucky/consensus-stop-wait
consensus: wait on stop if not fastsync
2018-07-14 12:50:15 +01:00
9b0b0b02d0 consensus: wait on stop if not fastsync 2018-07-14 12:53:54 +01:00
5439da6323 Merge pull request #1971 from tendermint/master
Merge master back to develop
2018-07-14 12:48:54 +01:00
9703a8825d rm script that Jenkins will replace (#1967) 2018-07-14 11:04:15 +04:00
9035546884 Merge remote-tracking branch 'origin/develop' into dev/tmbench_improve_sendloop_efficiency 2018-07-13 22:36:09 -07:00
aff063b79b tools/tmbench: Move statistics to a seperate file
This PR moves statistics to its own file, seperates getBlockMetas
into its own function, and removes the timeEnd parameter from
calculate statistics. The ending time is now computed directly from
the start time and the duration, to enforce that we only collect
data for the provided duration.
2018-07-13 18:00:49 -07:00
66c4f7aeae Remove gopkg stuff, should hopefully get these tests in test_cover 2018-07-13 11:23:17 -07:00
262c8daa04 tools/tm-bench: Don't count the first block if its empty (#1948)
* tools/tm-bench: Don't count the first block if its empty

* Try melekes suggestion

* Fix getting the start time so the first block is no longer empty

* Fix changelog entry

* Make code smell better

* tools/tmbench: Fix the end time being used for statistics calculation

Previously we were using the time at which all connections closed in statistics, not
the time after {duration} seconds.

* Use waitgroups for starting up
2018-07-13 12:28:19 +04:00
270659f03f make Block Header and Data non-pointers
make BlockMeta Header a non-pointer

Refs #693
2018-07-13 12:05:54 +04:00
1dbe7b7e68 tools/tmbench: Improve accuracy with large tx sizes.
At larger tx sizes (e.g. > 10000) we were spending non-neglible
amounts of time in tx creation, due to making the final bytes random.
The slower the send loop, the less accurate it is at measuring the time
tendermint took. (As we can't reach the promised contract of the given rate)

There really isn't much need for that randomness, so this PR makes it
such that only the txNumber gets bumped between txs from the same
connection, thereby improving sendloop speed and accuracy.
2018-07-12 23:47:40 -07:00
93a3f701fe Merge branch 'dev/tm_bench_ignore_first_block_if_empty' into dev/tmbench_fix_end_time 2018-07-12 15:40:46 -07:00
e46ae15859 Use waitgroups for starting up 2018-07-12 15:37:46 -07:00
75c9303c68 tools/tmbench: Fix the end time being used for statistics calculation
Previously we were using the time at which all connections closed in statistics, not
the time after {duration} seconds.
2018-07-12 13:02:34 -07:00
bd050c1d03 Make code smell better 2018-07-12 12:42:26 -07:00
3ffda994c2 Revert "rename privval#GetAddress and GetPubKey to Address and PubKey"
This reverts commit 58d0c8de89bcc6c081c5b33683c2d0a4e1f83eef.
2018-07-12 22:40:07 +04:00
6a85aecfb7 fix linter issues 2018-07-12 22:40:07 +04:00
d103aaf53f add test for Vote#Verify
remove test for String (very brittle)
2018-07-12 22:40:06 +04:00
17e1df0cbd test validator set more thoroughly
Refs #693
2018-07-12 22:40:06 +04:00
ff8ddee708 rename privval#GetAddress and GetPubKey to Address and PubKey 2018-07-12 22:40:06 +04:00
20bb522592 add tests for ABCIResults#Bytes and tx#IndexByHash 2018-07-12 22:40:06 +04:00
715ec19c96 add tests for protobuf
Refs #693
2018-07-12 22:40:06 +04:00
d51b196992 improve part set tests
Refs #693
2018-07-12 22:40:06 +04:00
5a4459935b add a test for ConsensusParams#Update
Refs #693
2018-07-12 22:40:06 +04:00
3132f7fad4 add tests for genesis
Refs #693
2018-07-12 22:40:06 +04:00
80399e60fb add tests for events public funcs
Refs #693
2018-07-12 22:40:05 +04:00
b271c40783 remove deprecated app_options field from genesis 2018-07-12 22:40:05 +04:00
37ce4e549e add more tests for evidence
Refs #693
2018-07-12 22:40:05 +04:00
e4db5f8dcd test event bus
Refs #693
2018-07-12 22:40:05 +04:00
6fe8ea966a remove events we do not emit 2018-07-12 22:40:05 +04:00
1377ef1e1f remove unused TxEventBuffer 2018-07-12 22:40:05 +04:00
95980d944b [types] add tests for Block and Commit
Refs #693
2018-07-12 22:40:05 +04:00
7a7f5782bc Fix changelog entry 2018-07-11 22:59:13 -07:00
e785d6851c Fix getting the start time so the first block is no longer empty 2018-07-11 22:55:20 -07:00
f04a087546 Try melekes suggestion 2018-07-11 21:54:46 -07:00
94c8dd1c55 Merge remote-tracking branch 'origin/develop' into dev/tm_bench_ignore_first_block_if_empty 2018-07-11 21:39:06 -07:00
bbf2bd1d81 Deprecate/refactor content in docs/specification (#1934)
* docs: deprecate specification dir, closes #1814

* update genesis

* old spec dir, deprecation complete

* rm a file
2018-07-11 23:45:10 +04:00
4f7fac8076 Merge pull request #1950 from tendermint/1891-follow-up
remove print statements
2018-07-11 13:04:12 +02:00
a3640ef809 Add OSX install script (#1947)
* Add OSX install script

* Address PR comments
2018-07-11 14:47:59 +04:00
1034a35b3a remove print statements
Refs https://github.com/tendermint/tendermint/pull/1891#discussion_r201339918
2018-07-11 10:04:32 +04:00
f9ae7730fe abciClient.BeginBlockSync should not hang on crashed server (#1891)
* Add test showing normal Sync call

* Show hanging response if server dies during BeginBlock

* Flush all in-flight requests on shutdown, not just pending requests

* Add bugfix to CHANGELOG
2018-07-11 09:59:16 +04:00
b980ef8bea tools/tm-bench: Remove testing flags from help (#1949) 2018-07-11 09:54:59 +04:00
50ea68a426 tools/tm-bench: Don't count the first block if its empty 2018-07-10 22:14:41 -07:00
f5ad8ef860 Merge pull request #1943 from tendermint/zach/merge-tools
Merge in the tools repo w/ commit history
2018-07-10 19:46:43 -04:00
8ce588d984 fixes for tools repo merge (#1945)
fixes for tools repo merge (#1943)
2018-07-10 16:42:27 -04:00
2aa2b63cad Merge pull request #1942 from tendermint/release/v0.22.3
Release/v0.22.3
2018-07-10 14:12:56 -04:00
17c924de7e changelog, version 2018-07-10 11:56:22 -04:00
ebe97d3956 dep: pin all deps to version or commit 2018-07-10 11:56:19 -04:00
44dad6d70b Revert "detele everything"
This reverts commit d02c5d1e30.
2018-07-10 11:22:25 -04:00
2f4ab0c068 mv tools files to tools repo 2018-07-10 11:15:39 -04:00
65487586f8 fix conflict 2018-07-10 11:13:39 -04:00
d02c5d1e30 detele everything 2018-07-10 11:12:46 -04:00
9d81a74429 dev version 2018-07-10 10:12:55 -04:00
5ff65274b8 Merge pull request #1935 from tendermint/release/v0.22.2
Release/v0.22.2
2018-07-10 10:01:55 -04:00
ac3b764b52 update changelog 2018-07-10 09:55:15 -04:00
223095d12f remove Wait from consensus reactor OnStop 2018-07-10 09:48:01 -04:00
af697d3c4a changelog, version 2018-07-10 09:47:40 -04:00
7c06a98b71 Merge branch 'master' into develop 2018-07-10 09:46:31 -04:00
ce824d0b70 Merge pull request #1915 from tendermint/release/v0.22.1
Release/v0.22.1
2018-07-10 09:11:46 -04:00
4de9d42e4c limit the number of requests in flights for Prometheus server (#1927)
* limit the number of requests in flights for Prometheus server

Closes #1804

Default to 1 because usually there's just one collector.

* config: Up default for prom connections
2018-07-10 15:49:48 +04:00
ce33914f70 Merge pull request #1928 from tendermint/646-decode-msg
Unexport DecodeMessage
2018-07-10 12:50:33 +02:00
1cd7d862fa Merge pull request #1929 from tendermint/1901-changelog-2
Add missing changelog entry
2018-07-09 19:48:08 +02:00
22133ef97a add missing changelog entry
Refs #1901
2018-07-09 13:54:32 +04:00
0030a8e697 Peng/deprecate aib data (#1926)
* include ecosystem.json

* update changelog

* also include zarko's interview
2018-07-09 13:19:45 +04:00
a19e857f2e [pex] switch to MustMarshalBinaryBare and UnmarshalBinaryBare
Refs #646
2018-07-09 13:11:41 +04:00
9120fd5d14 unexport DecodeMessage functions
Refs #646
2018-07-09 13:01:23 +04:00
523d29256e Merge pull request #1911 from tendermint/1901-changelog
Add missing changelog entry
2018-07-07 15:14:43 +02:00
397d89e40b Merge pull request #1906 from tendermint/zach/1793-repo-consolidation
clean up abci/libs directories
2018-07-07 11:53:58 +02:00
ed01638076 remove doc. about no longer existing config option 2018-07-07 11:50:34 +02:00
7b153bde31 add missing changelog entry
Closes #1901
2018-07-07 11:50:31 +02:00
f93798f72d Merge branch 'master' into release/v0.22.1 2018-07-07 11:45:20 +02:00
8d2d94c1c0 Merge pull request #1922 from tendermint/zach/fix-md
docs: md fixes & latest tm-bench/monitor
2018-07-07 11:43:16 +02:00
bef04114ef docs: md fixes & latest tm-bench/monitor 2018-07-06 14:25:04 -04:00
0e85ae6179 Merge pull request #1918 from tendermint/docs-staging
Re-organize docs into directories
2018-07-06 19:53:15 +02:00
539722c02d ports 2018-07-06 13:31:39 -04:00
8544e18eaf Merge pull request #1919 from tendermint/jae/rpc_int_noquote
WIP RPC HTTP does not require quotes around int64/int/uint64/uint types
2018-07-06 13:05:13 -04:00
379e5a15cc Uint64 2018-07-06 07:56:00 -04:00
bd47ed989f rpc/lib/server: add test for int parsing 2018-07-06 07:55:15 -04:00
d336cfe5d3 RPC HTTP does not require quotes around int64/int/uint64/uint types 2018-07-05 23:36:49 -07:00
e54c0f804f docs re-orgnization 2018-07-05 16:08:42 -04:00
79d6bd8ce0 TEST 2018-07-05 13:27:54 -04:00
14b6010240 move a file 2018-07-05 13:22:06 -04:00
2fa9962835 changelog and version 2018-07-05 12:03:23 -04:00
64bae01d00 Merge pull request #1913 from tendermint/zach/path-fix
HOTFIX: fix url path because cloudfront
2018-07-05 11:48:12 -04:00
e282b3d761 Merge branch 'master' into zach/path-fix 2018-07-05 10:10:11 -04:00
07747de305 add docs/DOCS_README.md for devs, closes #1885 (#1905) 2018-07-05 11:44:15 +04:00
030c782e6f Zach/1793 repo consolidation v2 (#1907) 2018-07-04 17:11:34 -04:00
1f215eb875 Merge pull request #1898 from tendermint/1893-err-if-zero-power-val
state: err if 0 power validator is added to the validator set
2018-07-04 23:05:22 +02:00
82a5e9604c Merge pull request #1903 from tendermint/zach/lint-md
lint the docs markdown & fix codeblocks for website
2018-07-04 16:03:38 -04:00
962bb3f969 Merge pull request #1904 from tendermint/zach/jb/docs-owners
update codeowners
2018-07-04 15:23:47 -04:00
f7156afee3 repo bloat artifacts errrrywhere 2018-07-04 15:09:06 -04:00
bc010ab5fa updates 2018-07-04 14:54:53 -04:00
0c393b5c62 abci mostly done, still gonna want to consolidate the tests 2018-07-04 14:48:45 -04:00
cf9d63628b move abci Dockerfile (still needs to be updated tho) 2018-07-04 14:19:33 -04:00
f9c39740cd remove old abci scripts 2018-07-04 14:18:03 -04:00
59f624043c reorder statements 2018-07-04 20:50:36 +04:00
e786d3feca add @zramsay & @jolesbi as docs owners 2018-07-04 12:31:17 -04:00
82a43593ab add linters to docs 2018-07-04 12:01:19 -04:00
ccaad06eb5 lint markdown 2018-07-04 12:00:57 -04:00
5cfd8ebaa2 Merge pull request #1899 from tendermint/1839-shutdown-wal-properly
Properly shutdown consensus WAL
2018-07-04 15:23:25 +02:00
99e982669e Merge pull request #1902 from tendermint/1766-wrong-field-access
fix wrong field access in LoadConsensusParams
2018-07-04 15:17:10 +02:00
48a1f6f9b3 state: Format panics 2018-07-04 14:59:50 +02:00
e565e348d5 fix wrong field access in LoadConsensusParams
Closes #1766
2018-07-04 15:34:13 +04:00
b242b15d40 wait until WAL closes the autogroup
Refs #1839
2018-07-04 13:59:16 +04:00
c1aeb08e4b return error if power is negative
Refs #1893
2018-07-04 13:21:29 +04:00
dda8b67f37 state: err if 0 power validator is added to the validator set
Closes #1893
2018-07-04 12:36:11 +04:00
bff68abe04 update abci spec 2018-07-03 23:16:32 -04:00
19662ac8a1 Merge pull request #1895 from tendermint/zach/1874-docs-examples
docs/examples: remove node* directories, update docs for testnet command
2018-07-03 23:02:41 -04:00
fa05b03956 Merge pull request #1894 from tendermint/ebuchman-patch-1
Update CHANGELOG.md
2018-07-03 21:20:03 -04:00
fcf8bd94c2 docs/examples: update getting started and remove old script (now in scripts/install) 2018-07-03 19:07:19 -04:00
087d3e54d2 Update CHANGELOG.md
Emphasize that all integers are encoded as strings in the rpc
2018-07-03 18:52:26 -04:00
0821ccb603 docs/examples: remove node* files 2018-07-03 18:47:13 -04:00
7a61e8cf9d Merge pull request #1862 from tendermint/zramsay-patch-1
Delete libs/common/array.go
2018-07-03 17:45:06 +02:00
4c373a6e78 Merge pull request #1872 from tendermint/1829-fill-in-missing-fields
overwrite pubkey and address for convenience
2018-07-03 17:44:29 +02:00
2f29aa9605 Merge pull request #1871 from tendermint/1774-remove-init-testnet-script
remove init_testnet script
2018-07-03 17:42:58 +02:00
eb77f662f2 Merge pull request #1886 from tendermint/zach/libs
cleanup repo merge artifacts
2018-07-03 17:40:08 +02:00
277e323d4a Merge pull request #1888 from tendermint/zach/abci-spec-location
abci spec should be in one location
2018-07-03 17:38:56 +02:00
8e4b803161 abci spec is in docs/abci-spec.md, closes #1847 2018-07-03 10:38:40 -04:00
5fb3955c93 cleanup repo merge artifacts, closes #1873, starts #1793 2018-07-03 10:17:08 -04:00
26a7d757cb overwrite pubkey and address for convenience
Closes #1829
2018-07-03 16:31:34 +04:00
a42c58604d remove init_testnet script
`tendermint testnet` cmd should be used instead

Closes #1774
2018-07-03 15:42:52 +04:00
489f2525bd Delete libs/common/array.go
closes https://github.com/tendermint/tmlibs/issues/133
2018-07-02 16:14:40 -04:00
9018acde5f tmlibs -> tendermint/libs 2018-07-02 14:58:07 -04:00
5453aa6169 Merge branch 'develop' into jae/literefactor4 2018-07-02 14:57:30 -04:00
931b465a05 dev version bump 2018-07-02 14:50:57 -04:00
dfa9a9a30a Merge pull request #1840 from tendermint/release/v0.22.0
Release/v0.22.0
2018-07-02 14:39:30 -04:00
5923b6288f update changelog 2018-07-02 14:40:59 -04:00
0f6f6bd3c0 Merge pull request #1606 from tendermint/bucky/hash
Bucky/hash
2018-07-02 14:30:24 -04:00
ca3e337ef9 remove libs/merkle 2018-07-02 14:32:27 -04:00
ec710395b7 RIPEMD160 -> SHA256 2018-07-02 14:27:43 -04:00
d47b4ef12d update some docs 2018-07-02 14:20:27 -04:00
72475c800b Merge pull request #1843 from tendermint/bucky/external_address
Bucky/external address
2018-07-02 13:48:09 -04:00
c3504c111e add test 2018-07-02 13:04:34 -04:00
737c5c065d fixes from review 2018-07-02 12:46:02 -04:00
1c018d3fd2 p2p: external address
* new config option for external address to advertise
* if blank, defaults to best guess from listener
* if laddr ip address is also blank, default to IPv4
2018-07-02 12:44:48 -04:00
60f233a4bc Merge pull request #1842 from tendermint/bucky/merge-tmlibs
Bucky/merge tmlibs
2018-07-02 12:31:39 -04:00
eccdce11c5 make linter happy 2018-07-02 12:06:43 -04:00
e8127456ca tmbench: Make it more resilient to WSConn breaking (#111)
* tmbench: Make it more resilient to WSConn breaking

This commit changes the behavior of a broken connection from calling
os.Exit, to instead killing that connection. This also improves
the debug logging, by specifying connection index within errors.

* Rename connStatus to connsBroken

* change logging level
2018-07-02 14:19:51 +04:00
3f4847331f update grpc version. fix remotedb tests 2018-07-01 23:15:14 -04:00
ff73e0aa55 fix test folder mishap 2018-07-01 22:50:31 -04:00
965a55d2a8 remove tmlibs from dep 2018-07-01 22:39:41 -04:00
d55243f0e6 fix import paths 2018-07-01 22:36:49 -04:00
233b35a2a9 Revert "delete some things for the merge"
This reverts commit 2902ab1a14.
2018-07-01 22:36:13 -04:00
ae3bf81833 mv tmlibs files to libs dir 2018-07-01 22:36:03 -04:00
2d7ffdd72b Merge remote-tracking branch 'tmlibs/master' into bucky/merge-tmlibs 2018-07-01 22:32:33 -04:00
2902ab1a14 delete some things for the merge 2018-07-01 22:32:06 -04:00
9ff99114b1 update for tmlibs v0.9.0 2018-07-01 22:12:58 -04:00
af703620d4 consensus: stop wal 2018-07-01 12:53:51 -04:00
3a0dff7db2 fix changelog 2018-07-01 11:51:06 -04:00
59145eca62 Merge pull request #1824 from tendermint/1762-tm-stops-producing-blocks
Fix emptyPacketMsgSize calc. plus limit max request body size and other mics. changes
2018-07-01 11:39:56 -04:00
d6394bcbfd Merge branch 'release/v0.22.0' into 1762-tm-stops-producing-blocks 2018-07-01 11:39:43 -04:00
2d98899b9b set MaxTxs to 10000 (the same that was used in the config before) 2018-07-01 09:44:12 +04:00
da4632c651 docs/spec: update address spec to sha2 for ed25519 2018-07-01 01:29:28 -04:00
f35ebd5cf7 docs: minor fix for abci query peer filter 2018-07-01 01:23:38 -04:00
6e5a01ccec changelog and version 2018-07-01 00:50:49 -04:00
b2c3f6f737 Merge pull request #1836 from tendermint/1830-nil-pointer-in-pex
fix nil pointer panic by checking if peer is nil
2018-06-29 17:55:06 -04:00
bb0313d060 Fix typo (#1837)
The base64 encoding for 'abcd' is incorrect for the python decoding examples.
2018-06-29 22:09:50 +04:00
71da5e128a fix url path because cloudfront 2018-06-29 09:56:15 -04:00
9752e059e1 fix nil pointer panic by checking if peer is nil
Fixes #1830

remember that PeerSet#Get can return nil
2018-06-29 16:03:31 +04:00
399e2fbdac update changelog 2018-06-29 12:57:17 +04:00
61c5791fa3 revert back to Jae's original payload size limit
except now we calculate the max size using the maxPacketMsgSize()
function, which frees developers from having to know amino encoding
details.

plus, 10 additional bytes are added to leave the room for amino upgrades
(both making it more efficient / less efficient)
2018-06-29 12:57:17 +04:00
ab04201c3d fix empty packet size calculation
Fixes #1762#issuecomment-398940107
2018-06-29 12:40:32 +04:00
297cd4cfe8 limit HTTP request body and WS read msg size to 1MB 2018-06-29 12:40:32 +04:00
f760c24ff0 [config] remove MaxBlockSizeTxs and MaxBlockSizeBytes in favor of consensus params 2018-06-29 12:40:32 +04:00
2a7602c4ed [tendermint init] add default consensus params to genesis 2018-06-29 12:40:32 +04:00
9563927bbd print only tx's hash and size when logging blocks
Closes #1799
2018-06-29 12:40:32 +04:00
ac12432603 [rpc/client/http] set codec on rpc client 2018-06-29 12:40:32 +04:00
ada5ef0669 [p2p] add godoc comments to Listener (#1828)
* update changelog

* document p2p/listener

* do not expose underlying net.Listener

* add a TODO

* replace todo with a comment
2018-06-29 11:48:52 +04:00
58acbf5ee3 contributing guide typos (#1831)
* contributing guide typos

* fix git remote cmd
2018-06-29 11:09:16 +04:00
41733b46b9 crypto: Abstract pubkey / signature size when known to constants (#1808)
* crypto: Abstract pubkey / signature size when known to constants

* Created PubKeyEd25519Size as 32
* Created PubkeySecp256k1Size as 33
* Created SignatureEd25519Size as 64

* Remove extraneous message from changelog
2018-06-29 11:08:01 +04:00
e26d6ed448 Update ISSUE_TEMPLATE to mention using pastebin (#1832)
* Update ISSUE_TEMPLATE to mention using pastebin

closes #1826

* Update ISSUE_TEMPLATE
2018-06-29 11:01:11 +04:00
db419a308e Fix unable to query status endpoint issue. (#103)
* Fix unable to query status endpoint issue.

* Revert "Fix unable to query status endpoint issue."

This reverts commit 73f02cdaea24dee88c47674dceed4f2513abac87.

* Replace amino unsafe tag for float fields.
2018-06-28 12:12:27 +04:00
48e1227f92 tmbench: Make sendloop act in one second segments (#110)
* tmbench: Make sendloop act in one second segments

Previous behaviour was to make the sendloop send all its messages
and then time how long that took. (Possibly waiting if too fast)
This has the same operation when too fast, but stops the loop
after one second. This is useful if a large tx amount is specified
and the ping doesn't get executed. Tmbench no longer crashes on
large rates.

* Update Readme
2018-06-28 12:11:05 +04:00
e556e3336e Adding IPv6 support to peering (#1818) 2018-06-28 11:29:27 +04:00
69356a60b5 Broken link to docs/terraform-and-ansible corrected (#1823)
Fixed rst -> md
2018-06-28 11:28:41 +04:00
b1d6deaf0b config: rename skip_upnp to upnp (#1827)
* config: rename skip_upnp to upnp

Change default option to enable upnp.

Closes #1806

* doc updates

- fix comment and set UPNP to false in TestP2PConfig
- add UPNP to config template
- update changelog
2018-06-28 11:09:39 +04:00
b51ed132f7 Fix test/p2p/pex circle tests; update consensus 2018-06-27 16:24:21 -07:00
aa20c45ae9 log total when adding new txs to the mempool 2018-06-27 18:14:45 +04:00
70d314312c consensus: fix addProposalBlockPart
* When create_empty_blocks=false, we don't enterPropose until we
* receive a transaction, but if we then receive a complete proposal,
* we should enterPrevote. A guard in addProposalBlockPart was checking if
* step==Propose before calling enterPrevote, but we need it to be step<=Propose,
* since we may not have seen a tx.
* This was discovered by disabling mempool broadcast, sending txs to
* peers one a time, and observing their consensus logs.
2018-06-27 18:14:45 +04:00
fa3bd05d44 mempool: log hashes, not whole tx 2018-06-27 18:14:45 +04:00
8524a8da7f Try to fix circle... 2018-06-27 04:22:30 -07:00
cfcbc61449 oops 2018-06-27 04:04:33 -07:00
f0e5332b1f Feature/support https rpc client (#1816)
* Implement support for https in rpc client

* Update changelog

* update comment

* support wss protocol

* fixed changelog

* if -> switch

* fix lint

* protocol constants introduced
2018-06-27 15:03:47 +04:00
9184733261 try it with new consensus? 2018-06-27 02:34:11 -07:00
363146dacf just print node1 2018-06-27 02:03:15 -07:00
ad1b722898 bump for circle 2018-06-27 00:41:50 -07:00
8163b99a75 print docker output to console to debug circle 2018-06-27 00:37:53 -07:00
835c2ee74a Print 2018-06-27 00:09:04 -07:00
19fc4ac47c remove abci from gopkg.toml 2018-06-26 23:58:47 -07:00
231812c875 proper link to a docs module (#1822)
Fixed rst -> md
2018-06-27 10:54:01 +04:00
acd976ad5b bump circle 2018-06-26 23:42:00 -07:00
e6abdb8b9d p2p/trust: Fix nil pointer error on TrustMetric Copy() (#1819) 2018-06-27 08:37:30 +04:00
37ef5485b4 Add logs to lite/*; Fix rpc status to return consensus height, not blockstore height 2018-06-26 16:53:06 -07:00
8412b75b10 Merge pull request #1800 from tendermint/zach/more-docs-fixes
docs cleanup
2018-06-26 11:33:25 +04:00
9f656e1239 add a link to full node guide
Refs https://github.com/tendermint/tendermint/pull/1800/files#r197919542
2018-06-26 11:21:25 +04:00
7f4498f8b1 remove no longer needed install_abci_apps script
Fixes
https://circleci.com/gh/tendermint/tendermint/12923?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
2018-06-26 11:10:54 +04:00
538c410bcd Fixes from review 2018-06-25 18:16:16 -07:00
c3296f2e01 Garbage collect DBProvider (unoptimized); Certifier creation takes a client 2018-06-25 17:13:00 -07:00
242a6037e8 Fixes from review 2018-06-25 17:12:52 -07:00
bf0ff212b9 Refactor "lite" to handle delayed validator set changes.
Also, fix consensus liveness issue.
2018-06-25 17:12:25 -07:00
a5b7ea93c4 Delay validator set changes by 1 block. 2018-06-25 16:59:00 -07:00
c6626f94de the last RTD version is archived 2018-06-25 10:33:18 -04:00
fd55ccdd99 Merge branch 'develop' into zach/more-docs-fixes 2018-06-25 10:27:33 -04:00
516b3399f3 docs: update js-abci example
closes https://github.com/tendermint/js-abci/issues/21
2018-06-25 10:14:32 -04:00
e09e3a56f3 Merge pull request #225 from tendermint/develop
0.9.0 release
2018-06-24 19:41:18 -07:00
49596e0a1f Bump version to 0.9.0 2018-06-24 19:40:24 -07:00
cb08d28d40 Reverse iterators (#224)
with passing tests
2018-06-24 19:37:32 -07:00
3b461bfbe9 tmbench: Update dependencies to use tendermint's master 2018-06-24 22:40:55 +04:00
ce0d0b312f Merge pull request #1711 from tendermint/bucky/adrs
Bucky/adrs
2018-06-23 09:22:14 -04:00
1215081951 adr: update readme 2018-06-23 09:29:46 -04:00
500fca8efe fixes from review 2018-06-23 09:29:46 -04:00
f6ff6b0e15 use consistent naming for protobuf
protobuf -> proto
protobuf version X -> protoX
2018-06-23 09:29:46 -04:00
956e6d3435 change BeginBlock validators to LastCommitInfo 2018-06-23 09:28:44 -04:00
3e1684d2a2 adr-010-crypto-changes 2018-06-23 09:28:44 -04:00
a25d181074 adr-009: add references 2018-06-23 09:28:44 -04:00
7d82bdb3e6 adr-009: no pubkeys in beginblock 2018-06-23 09:28:44 -04:00
c48ff031cd add ADR-009 for ABCI design upgrade 2018-06-23 09:28:44 -04:00
8128627f08 Optimizing blockchain reactor.
Should be paired with https://github.com/tendermint/iavl/pull/65.
2018-06-22 21:47:48 -07:00
2bcd7e5962 tm-bench: Update dependencies, add total metrics
* Update tendermint to develop branch
* Update tmlibs to develop branch
* Add total field for txs and blocks
2018-06-23 08:26:11 +04:00
b7925cd34f tmbench: Make tx size configurable
* Make the parameter for tx size in bytes -s <size>, w/ default value 250
2018-06-23 08:26:11 +04:00
835af6fcb9 link fixes 2018-06-23 00:06:04 +00:00
6c92a6f99a prepare RTD dismantling 2018-06-23 00:00:42 +00:00
c3769b88e4 Merge pull request #100 from tendermint/bucky/tm-bench-fixes
Fix tm-bench metrics
2018-06-23 01:58:56 +02:00
65b479dd65 tm-bench: Improve code shape
* return error so main controls exit states
* formatting
* order imports
2018-06-23 01:57:50 +02:00
7eb2674e2b tmbench: Fix iterating through the blocks, update readme 2018-06-22 16:24:18 -07:00
f62d6651e3 Merge pull request #1781 from tendermint/1740-node-crashes-when-too-many-rpc-connections
limit number of open connections
2018-06-23 01:15:03 +02:00
e79b642d8d wip fixes 2018-06-22 16:06:24 -07:00
0d35d722cb rpc: Break up long lines 2018-06-23 01:01:31 +02:00
e39e43f86f Merge pull request #1790 from tendermint/xla/merge-abci-tmlibs
Merge abci
2018-06-23 00:55:31 +02:00
e9e00c4db7 Merge pull request #1797 from SamuelSarle/develop
Rename sync_info.syncing to sync_info.catching_up
2018-06-23 00:49:47 +02:00
003d8956a5 rm dead docs file 2018-06-22 18:23:45 -04:00
867550dd8b docs: update abci links (#1796) 2018-06-23 00:16:51 +02:00
c1548c7861 docs readme is vuepress landing page 2018-06-22 18:13:25 -04:00
8ff95bf32c remove old code 2018-06-22 18:10:50 -04:00
8554a6dcd8 Renamed sync_info.syncing to sync_info.catching_up. 2018-06-23 00:20:49 +03:00
f5b8849106 bump max connections number to 900 2018-06-22 22:48:20 +04:00
01f6009518 abci: Add comment for doc update 2018-06-22 20:36:29 +02:00
3f34deab90 abci: Remove LICENSE 2018-06-22 20:29:23 +02:00
693a973997 abci: Remove nested .gitignore 2018-06-22 20:28:54 +02:00
02e5cbaa07 abci: Remove old repo docs 2018-06-22 20:23:37 +02:00
77573a1bad ci: Move over abci-cli tests 2018-06-22 20:09:44 +02:00
3ff3a8ec37 ci: Setup abci in dependency step 2018-06-22 19:29:44 +02:00
47256cfda2 update ports from 466* to 266* (#104)
* updates ports from 466* to 266*

* missed a port
2018-06-22 19:55:07 +04:00
936a655990 limit number of open connections
Refs #1740

also, expose limit option for number concurrent streams for gRPC
(unlimited by default)
2018-06-22 19:25:11 +04:00
a605b66c5a Move abci imports 2018-06-22 07:28:07 +02:00
3e1baf68f8 crypto: Rename last traces of go-crypto (#1786)
Follow-up to #1782
2018-06-22 08:24:36 +04:00
4bee228ba7 Add abci repo 2018-06-22 02:36:54 +02:00
7e3de2027e Merge pull request #1787 from tendermint/dev/hkdfchachapoly_testvector_seal
crypto/hkdfchachapoly: Add testing seal to the test vector
2018-06-22 01:59:35 +02:00
3ae878b229 crypto/hkdfchachapoly: Add testing seal to the test vector 2018-06-21 16:47:48 -07:00
2b5229dd5e Merge pull request #1782 from Liamsi/merge-city
Merge go-crypto into tendermint
2018-06-21 15:53:02 -07:00
9cd9f3338b Merge branch 'master' into develop 2018-06-21 12:57:09 -07:00
46369a1ab7 Merge pull request #1779 from tendermint/release/v0.21.0
Release/v0.21.0
2018-06-21 12:44:31 -07:00
1e3951c61c update changelog 2018-06-21 12:47:29 -07:00
9803f18494 review comments:
gofmt
2018-06-21 12:21:33 -07:00
a39b2522d5 review comments:
- re-add test
- add TODO
- err instead of panic where possible
2018-06-21 11:51:46 -07:00
c96b27136f remove go-crypto from go-crypto:
use tendermint/crypto :-)
2018-06-20 21:05:38 -07:00
80ab7bfe99 fix p2p test in circleci 2018-06-20 20:59:33 -07:00
f3d755f5e8 please the linter gods:
crypto/hkdfchacha20poly1305/hkdfchachapoly_test.go:36:25⚠️ should use make([]byte, 24) instead (S1019) (gosimple)
2018-06-20 20:29:12 -07:00
8329b86570 more changes from #1721 2018-06-20 20:25:08 -07:00
4fb40e5437 cherry pick @melekes changes 2018-06-20 20:04:43 -07:00
25397fb9f8 more changes from #1721 2018-06-20 18:30:14 -07:00
6677f81ffb revert change from #1721
makes TestListener never quit
2018-06-20 17:48:04 -07:00
5a70fa6f35 fix typos 2018-06-20 17:42:52 -07:00
d2c05bc5b9 Revert "delete everything" (includes everything non-go-crypto)
This reverts commit 96a3502
2018-06-20 17:35:30 -07:00
587505d4d2 fix crypto tests 2018-06-20 17:34:28 -07:00
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
368c236c75 mv go-crypto files to crypto dir 2018-06-20 15:30:44 -07:00
96a3502126 delete everything 2018-06-20 15:19:08 -07:00
edb36d38b2 Merge PR #142: Delete keys package & Ledger integration; update tests 2018-06-20 23:33:33 +02:00
c7a842a4e2 Update Gopkg.lock 2018-06-20 23:31:57 +02:00
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
a589e0eabd delete keys package
- it will be moved to cosmos-sdk
2018-06-20 14:09:24 -07:00
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
37385cb1d4 Merge pull request #1737 from tendermint/986-monitoring
metrics
2018-06-20 20:43:20 +02:00
8c1ca9d64a updates to docs/specification/configuration.md after rebase 2018-06-20 12:42:43 +04:00
205d8b8062 fixes after @xla review
- move prometheus metrics into internal packages
- *Option structs
- misc. format changes
2018-06-20 12:40:25 +04:00
e4bb3566a0 move metrics constructors to a separate package 2018-06-20 12:40:25 +04:00
829342a82d make StartPrometheusServer func private
we don't really need to export it
2018-06-20 12:40:25 +04:00
84812145cb friendly apis for constructors 2018-06-20 12:40:25 +04:00
cd11a54f7a add since column to list of available metrics table 2018-06-20 12:40:25 +04:00
d8fea3ec9d separate http server for metrics 2018-06-20 12:40:23 +04:00
b10b0da3fd bundle imports 2018-06-20 12:40:11 +04:00
bba2862498 add one useful query 2018-06-20 12:40:11 +04:00
e90cb4f5fa add docs 2018-06-20 12:40:11 +04:00
1bdff076ad add config option 2018-06-20 12:40:08 +04:00
c958b5319c update ADR 2018-06-20 12:38:45 +04:00
7efb73aa18 mempool size metric 2018-06-20 12:38:45 +04:00
19699d644f p2p metric, make height and totalTxs gauges 2018-06-20 12:38:45 +04:00
0cb50c05fc add rounds metric 2018-06-20 12:38:45 +04:00
e58d674f4c add validators power gauges 2018-06-20 12:38:45 +04:00
fad76e103b extract metrics to provider, remove height label 2018-06-20 12:38:45 +04:00
489d9b9184 more metrics 2018-06-20 12:38:45 +04:00
3cdf3b670d serve metrics under /metrics 2018-06-20 12:38:45 +04:00
5c869b5888 validator metrics 2018-06-20 12:38:45 +04:00
9e14dc21a9 add labels column 2018-06-20 12:38:45 +04:00
5c7093cc9f go-kit metrics plus prometheus: one metric 2018-06-20 12:38:45 +04:00
03079185d4 metrics ADR
Refs #986
2018-06-20 12:38:45 +04:00
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
d220a1ef13 changelog 2018-06-20 00:22:07 -07:00
c6c468c341 update changelog 2018-06-20 00:13:23 -07:00
1d86270e20 version 2018-06-20 00:09:55 -07:00
43745c83db Merge branch 'release/v0.20.1' into develop 2018-06-20 00:08:51 -07:00
c793a72ac5 Merge pull request #1769 from tendermint/1755-possible-memory-leak
Memory leak in Websocket
2018-06-19 23:57:29 -07:00
fed8807a32 Switch xchachapoly to hkdfchachapoly (#135)
* Switch from xchachapoly to hkdfchachapoly
2018-06-19 22:18:36 -07:00
cfff83fa3d update changelog 2018-06-19 20:20:30 +04:00
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
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
26b2e808f7 [rpc/lib/server] wrote a basic test for WebsocketManager 2018-06-19 17:06:48 +04:00
3d30a42943 add config to issue template 2018-06-19 11:59:14 +04:00
4f5492c831 add nopTxCache (Nil Object Pattern)
to better handle zero cache size
2018-06-19 11:59:07 +04:00
70d973016e output msg only once during start 2018-06-19 11:40:40 +04:00
4b2348f697 mempool: fix cache_size==0. closes #1761 2018-06-18 18:21:19 -07:00
6a324764ac fix circle 2018-06-18 17:18:35 -07:00
3470e5d7b3 changelog and version 2018-06-18 17:15:41 -07:00
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
d457887dd6 Merge pull request #1759 from tendermint/bucky/readme
update README
2018-06-16 22:56:35 -07:00
adb6a94f18 contact us at riot 2018-06-16 23:05:24 -07:00
b8bfc041d3 update README 2018-06-16 19:00:42 -07:00
9bad770f21 Merge pull request #1757 from tendermint/bucky/update-spec
docs/spec: some organizational cleanup
2018-06-16 13:03:00 -07:00
d3b53e62a5 fix circle 2018-06-15 23:46:43 -07:00
506cf6c9c7 docs/spec: DuplicateVoteEvidence 2018-06-15 23:19:42 -07:00
b8f340afd0 docs/spec: some organizational cleanup 2018-06-15 22:56:26 -07:00
1a2f468695 fix circleci 2.0 config (#139) 2018-06-15 15:17:40 -07:00
c84be3b8dd Merge pull request #1751 from tendermint/bucky/codeowner-alex
add xla as codeowner
2018-06-14 20:22:04 -07:00
050636d5ce add xla as codeowner 2018-06-14 17:04:45 -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
19af3e9733 Merge pull request #1738 from tendermint/zarko/add-blockchain-reactor-algorithm-spec
Add algorithm for Blockchain Reactor
2018-06-15 01:47:36 +02:00
41369d7529 circleci 2.0 (#134)
* circleci 2.0
2018-06-14 00:04:30 -07:00
fb7ec62b29 Fix comment 2018-06-13 23:45:44 -07:00
21726a6853 Add ColoredBytes() and update DebugDB 2018-06-13 23:45:44 -07:00
1b1c4cd94d Reduce Errors T/Cause/Message into single Data 2018-06-13 23:45:44 -07:00
917bf4d428 Merge pull request #1732 from maxim-levy/patch-2
typo fix
2018-06-13 17:42:29 -07:00
696e8c6f9e [docs] write about addr_book_strict in production notes (#1741)
Refs #1736
2018-06-13 18:24:12 +04:00
ce73884857 Add spec for Blockchain Reactor algorithm 2018-06-13 14:05:17 +02:00
fa32dc5181 Merge pull request #1739 from tendermint/dev/bump_version
Bump abci version
2018-06-13 01:48:13 +02:00
da4d1c2038 Merge pull request #270 from tendermint/xla/update-develop-v0120
Xla/update develop v0120
2018-06-13 01:32:14 +02:00
ec0c901bec Bump abci version 2018-06-12 16:30:24 -07:00
198dccf0dd Merge pull request #269 from tendermint/release/v0.12.0
Release/v0.12.0
2018-06-12 16:22:00 -07:00
1eeebabb0b Update version and changelog 2018-06-13 01:20:21 +02:00
8e273220a3 Remove error from priv.PubKey() (#131)
* Remove error from priv.PubKey()

* Update changelog
2018-06-12 13:35:22 -07:00
b84f788f36 Switch ports 466xx to 266xx (#1735)
* Switch ports 466xx to be 266xx
This is done so the default ports aren't in the linux kernel's default ephemeral port range.

* Update ABCI import

* Bump cache on circleci

* Get more verbose output for debugging

* Bump abci dependency

* Fix accidental change of a block header's hash

* pin abci release
2018-06-12 13:25:52 +04:00
ac80b93b60 unsafe_reset_all also resets addrbook.json (#1731)
* `unsafe_reset_all` also resets addrbook.json

When executing `unsafe_reset_all` it also clear all IP addresses from
addrbook.json. This is the expected behaviour of `unsafe_reset_all`.

* Fix tests

* improve logging statements

* use correct file
2018-06-12 12:55:10 +04:00
887bd8be08 Merge pull request #268 from tendermint/xla/resolve-divergence
Resolve divergence
2018-06-11 19:51:48 -07:00
514065a3c4 Merge branch 'master' into xla/resolve-divergence 2018-06-12 04:50:20 +02:00
42c6a64e04 version bump (#128)
version bump
2018-06-11 17:27:32 -07:00
260d69f372 Merge pull request #110 from tendermint/bucky/sig-name
SignatureKey -> Signature
2018-06-12 01:57:26 +02:00
e552d344e3 forgot PrivKeyLedgerSecp256k1 2018-06-11 16:51:38 -07:00
c4484c4a1b Merge remote-tracking branch 'remotes/origin/develop' into bucky/sig-name
# Conflicts:
#	Gopkg.lock
#	keys/keybase_test.go
#	signature_test.go
2018-06-11 16:46:08 -07:00
f4663e5bb7 fix tests, bump amino version, move encoding to encode_test.go,
include an example, do not err check on info ... bur for empty info
instead
2018-06-11 16:37:14 -07:00
45a1c8aef3 fix tests, move encoding to encode_test.go, include an example 2018-06-11 16:23:34 -07:00
dfc5aefd5f Merge pull request #1726 from tendermint/1717-panic-in-netaddress
return an error if we fail to parse external IP
2018-06-12 01:08:16 +02:00
eb4a8e0e7a Merge pull request #1719 from Slamper/develop
Escape paths in config template
2018-06-12 01:06:22 +02:00
e694c309ba update ed25519 address scheme (#112)
make PubKeyEd25519.Address() returns the first 20 bytes of the hash of the raw 32-byte pubkey, no amino required
2018-06-11 15:43:32 -07:00
0c98d10b4f Merge pull request #222 from tendermint/dev/bech32_err_msg
Bech32: Wrap error messages
2018-06-11 10:20:51 -07:00
708ddb30f7 typo fix
And typo fix
2018-06-11 22:53:48 +09:00
66794a174a Move from tmlibs #213 (#115)
* move from tmlibs 213
* expose KVPair, simpleproofsfrommap returns keys
2018-06-10 20:43:40 -07:00
c21f67c5af Unify local and external keys in keybase interface (#117)
* Return errors on priv.Sign(), priv.PubKey()

* Add CreateLedger, CreateOffline

* Add switch on .Sign() for Ledger wallets

* Add offline signing switch on .Sign()

* Use MustUnmarshalBinaryBare()

* Add confirmation to delete offline/Ledger keys

* Lowercase error message

* Add human-readable .GetType() function to Info interface

* Rename CryptoAlgo => SignAlgo

* assert.Nil(t, err) => assert.NoError(t, err)
2018-06-10 01:01:41 -07:00
1d66e34dc8 Bech32: Wrap error messages 2018-06-09 16:22:52 -07:00
cd3a240c9f return an error if we fail to parse external IP
```
I[06-08|11:51:57.234] Getting UPNP external address                module=p2p
I[06-08|11:51:58.867] Got UPNP external address                    module=p2p address=
```

Fixes #1717

```
I[06-08|11:51:56.952] Starting multiAppConn                        module=proxy impl=multiAppConn
I[06-08|11:51:56.952] Starting localClient                         module=abci-client connection=query impl=localClient
I[06-08|11:51:56.952] Starting localClient                         module=abci-client connection=mempool impl=localClient
I[06-08|11:51:56.952] Starting localClient                         module=abci-client connection=consensus impl=localClient
I[06-08|11:51:56.952] ABCI Handshake                               module=consensus appHeight=0 appHash=
I[06-08|11:51:56.952] ABCI Replay Blocks                           module=consensus appHeight=0 storeHeight=0 stateHeight=0
I[06-08|11:51:57.053] Completed ABCI Handshake - Tendermint and App are synced module=consensus appHeight=0 appHash=
I[06-08|11:51:57.053] This node is a validator                     module=consensus addr=6816B5D9BAC32A3CDF07884D9D3D2650694C371D pubKey=PubKeyEd25519{27A40CD032DD2467342D0CF27C5EC92052D966FEC714B6CF2F3BF3146AFD0D51}
I[06-08|11:51:57.234] Starting Node                                module=main impl=Node
I[06-08|11:51:57.234] Starting EventBus                            module=events impl=EventBus
I[06-08|11:51:57.234] Local listener                               module=p2p ip=:: port=46656
I[06-08|11:51:57.234] Getting UPNP external address                module=p2p
I[06-08|11:51:58.867] Got UPNP external address                    module=p2p address=
I[06-08|11:51:58.867] Starting DefaultListener                     module=p2p impl=Listener(@<nil>:46656)
I[06-08|11:51:58.867] P2P Node ID                                  module=main ID=3629b516392e494ae717ac4c6a1ea7eb0fe421c3 file=/home/tpb/.tendermint/config/node_key.json
I[06-08|11:51:58.868] Add our address to book                      module=p2p book=/home/tpb/.tendermint/config/addrbook.json addr=null
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x89fb86]

goroutine 1 [running]:
github.com/tendermint/tendermint/p2p.(*NetAddress).String(0x0, 0xc96e24, 0x17)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/p2p/netaddress.go:171 +0x26
github.com/tendermint/tendermint/p2p/pex.(*addrBook).AddOurAddress(0xc420190620, 0x0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/p2p/pex/addrbook.go:160 +0x116
github.com/tendermint/tendermint/node.(*Node).OnStart(0xc420286d00, 0xc4201b8010, 0xd)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/node/node.go:402 +0x547
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start(0xc420286d00, 0xe51c40, 0xc42000bd40)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x3bd
github.com/tendermint/tendermint/cmd/tendermint/commands.NewRunNodeCmd.func1(0xc42022e000, 0xc4200acdc0, 0x0, 0x1, 0x0, 0x0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/cmd/tendermint/commands/run_node.go:58 +0xfe
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).execute(0xc42022e000, 0xc4200acda0, 0x1, 0x1, 0xc42022e000, 0xc4200acda0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:762 +0x468
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1289280, 0xbbdda0, 0xc420015e01, 0xc4201bc640)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).Execute(0x1289280, 0xc4201bc640, 0xc420015e98)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli.Executor.Execute(0x1289280, 0xde5798, 0x2, 0xc4200332c0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli/setup.go:89 +0x4e
main.main()
	/home/tpb/code/go/src/github.com/tendermint/tendermint/cmd/tendermint/main.go:45 +0x24d
```
2018-06-09 15:03:38 +04:00
e93865f7de escape paths in config template 2018-06-08 20:44:54 -07:00
f6c960c3d3 Merge branch 'develop' of https://github.com/tendermint/go-crypto into develop 2018-06-08 17:29:20 -07:00
854eb323dd dev version bump 2018-06-08 17:28:50 -07:00
710efe576a Merge pull request #113 from tendermint/release/v0.7.0
Release/v0.7.0
2018-06-08 17:17:35 -07:00
2e0466d1c8 Merge pull request #1722 from tendermint/dev/document_peer_types
Update description of seed and persistent peer nodes
2018-06-09 02:14:48 +02:00
fd9375c35b Docs: Update description of seeds and persistent peers 2018-06-09 01:25:46 +02:00
5ebf9b816b Merge pull request #1698 from tendermint/zach/rst-2-md
docs to markdown
2018-06-07 21:46:18 -07:00
361277f9be Merge branch 'develop' into dev/ephemeral_ports 2018-06-08 04:14:45 +02:00
724b6c39b8 style fixes/typos/etc from PR review 2018-06-07 10:01:31 -04:00
9aef3fa610 docs: pretty fixes 2018-06-07 09:41:57 -04:00
e82ab1c374 moar fixes 2018-06-07 09:41:57 -04:00
ffa8b5f620 oomph 2018-06-07 09:41:57 -04:00
df07f8b36a moar 2018-06-07 09:41:57 -04:00
d4d91d7781 running in prod 2018-06-07 09:41:57 -04:00
3039aa1e67 intro 2018-06-07 09:41:57 -04:00
d4d79886b2 indexing txns 2018-06-07 09:41:57 -04:00
b429d65f9f how to read logs 2018-06-07 09:41:57 -04:00
20e1eadcf1 getting started 2018-06-07 09:41:57 -04:00
2e18a4e633 determinism & ecosystem 2018-06-07 09:41:57 -04:00
b860018975 deploy tesnets 2018-06-07 09:41:57 -04:00
44c88805a7 app devel 2018-06-07 09:41:57 -04:00
a9b6fcdbc4 docs: cleanup/clarify build process 2018-06-07 09:41:57 -04:00
14a5dfd945 docs: start move back to md 2018-06-07 09:41:57 -04:00
24fa2a62b0 dev version bump 2018-06-06 20:57:19 -07:00
27bd1deabe Merge pull request #1703 from tendermint/release/v0.20.0
Release/v0.20.0
2018-06-06 20:47:17 -07:00
76c82fd433 add more tests 2018-06-06 20:49:00 -07:00
640af0205d Merge pull request #219 from tendermint/include-group-close-in-tests
[autofile] include call to group#Close in tests
2018-06-06 20:46:39 -07:00
9481cabd50 fixes from review 2018-06-06 20:45:20 -07:00
46b957929c Merge branch 'develop' into release/v0.20.0 2018-06-06 19:24:36 -07:00
512e563d4b Merge pull request #1694 from tendermint/dev/bsd_install_script
docs: Add BSD install script
2018-06-06 19:14:46 -07:00
a6a4fc7784 docs: Add BSD install script 2018-06-06 17:57:25 -07:00
bfcec02423 Merge pull request #1702 from tendermint/xla/fix-racy-config
Fix race when mutating MConnConfig
2018-06-06 17:15:53 -07:00
fcf61b8088 check addrs match pubkeys in abci Validator. version bump 2018-06-06 16:35:35 -07:00
46fb179605 Merge pull request #1701 from tendermint/bucky/abci-fixes
Bucky/abci fixes
2018-06-06 16:12:12 -07:00
89925501f3 p2p/filter/pubkey -> p2p/filter/id 2018-06-06 16:13:51 -07:00
6b8613b3e7 ResponseEndBlock: ensure Address matches PubKey if provided 2018-06-06 16:12:14 -07:00
8be27494bb update abci spec. add address spec 2018-06-06 16:11:58 -07:00
c661a3ec21 Fix race when mutating MConnConfig
Instead of mutating the passed in MConnConfig part of P2PConfig we just
use the default and override the values, the same as before as it was
always the default version. This is yet another good reason to not embed
information and access to config structs in our components and will go
away with the ongoing refactoring in #1325.
2018-06-07 01:09:13 +02:00
8e45348737 update for abci v0.11.0 release. let InitChain update validators 2018-06-06 15:47:04 -07:00
0b0d9d0029 Merge pull request #262 from tendermint/changelog-date
date in changelog
2018-06-06 14:56:15 -07:00
aaeeb76808 date in changelog 2018-06-06 13:22:57 -07:00
7dfc74a6b6 Merge pull request #1667 from tendermint/bucky/abci-11
Update ABCI for new PubKey type and changes to BeginBlock and InitChain
2018-06-06 13:16:09 -07:00
ebee2fe114 Merge pull request #261 from tendermint/release/v0.11.0
Release/v0.11.0
2018-06-06 13:13:20 -07:00
084f2e5b8c update readme 2018-06-06 13:17:11 -07:00
2edc68c59b use all fields in abci types 2018-06-06 13:07:17 -07:00
3f6da94d55 update Makefile 2018-06-06 12:52:11 -07:00
72330e6609 val_set_hash -> validators_hash 2018-06-06 12:29:05 -07:00
fe4123684d Change reset messages (#1699) 2018-06-06 22:07:10 +04:00
a12785aa60 [tm-monitor] fixed online status not changing issue. (#99)
* [tm-monitor] fixed online status not changing issue.

* Refactor UpdateNodeStatus.
2018-06-06 17:00:59 +04:00
95e3e7afcd remove deprecated docker directory & docs: rst2md (#102) 2018-06-06 16:53:58 +04:00
f0c44d1bd0 [autofile] include call to group#Close in tests 2018-06-06 11:52:59 +04:00
2897685c57 abci header takes ValidatorsHash 2018-06-06 00:28:12 -07:00
8fa7c493bc add val_set_hash to header 2018-06-06 00:01:38 -07:00
bc07d06647 update changelog, version, spec 2018-06-05 23:37:15 -07:00
71556c62eb fixes from rebase 2018-06-05 22:14:37 -07:00
0e02e45ac7 Merge pull request #254 from tendermint/bucky/genesi
include genesis file structure
2018-06-05 22:07:15 -07:00
54e61468d4 fixes from review 2018-06-05 22:04:38 -07:00
5c7ccbd4a7 use const for abci type strings 2018-06-05 22:04:38 -07:00
e2f5a6fbe4 update abci 2018-06-05 22:04:38 -07:00
aa8be33da1 fix fmt 2018-06-05 22:04:27 -07:00
909f66e841 remove extra eventBus 2018-06-05 22:04:27 -07:00
3d2c4fd309 update Evidence type - requires pubkey and valset to verify and convert to abci.Evidence 2018-06-05 22:04:26 -07:00
e5bca1df6f update godep for abci 2018-06-05 22:00:43 -07:00
866bcceb35 fix consensus tests 2018-06-05 22:00:25 -07:00
e1e6878a4d fix state tests 2018-06-05 22:00:25 -07:00
e4147b6f1a state test runs 2018-06-05 22:00:25 -07:00
7606b7595f compiles 2018-06-05 22:00:25 -07:00
5480fd4a67 Merge branch 'develop' into bucky/genesi 2018-06-05 22:00:11 -07:00
485b4a0c6f revert gogo 2018-06-05 21:59:52 -07:00
575d94dbb9 state compiles 2018-06-05 21:59:52 -07:00
ebd2fe7a68 more types 2018-06-05 21:59:52 -07:00
f28eae7816 update types 2018-06-05 21:59:52 -07:00
e13c1ab735 update for new abci 2018-06-05 21:59:52 -07:00
8bbe43aa33 update changelog 2018-06-05 21:53:09 -07:00
a7e049a228 Merge branch 'master' into develop 2018-06-05 21:39:23 -07:00
0e0461d9bc dev version bump 2018-06-05 18:54:30 -07:00
057e076ca9 Merge pull request #1693 from tendermint/release/v0.19.9
Release/v0.19.9
2018-06-05 18:00:02 -07:00
775fef31c2 remove go-wire from test/app/grpc_client 2018-06-05 17:43:39 -07:00
9cb079dcc6 dep, version, changelog 2018-06-05 17:38:54 -07:00
67180344b7 Merge pull request #1663 from tendermint/zach/quick-install
quick install script
2018-06-05 17:17:47 -07:00
825fdf2c24 Merge pull request #1679 from tendermint/flush-wal-on-stop
Flush cs.wal on stop
2018-06-05 17:14:19 -07:00
692f1d86a6 Merge pull request #218 from tendermint/release/v0.8.4
Release/v0.8.4
2018-06-05 17:11:19 -07:00
22541b881d changelog and version 2018-06-05 17:12:33 -07:00
e0985bf566 flush on stop & function to close group
as opposite to OpenGroup
2018-06-05 17:11:06 -07:00
61002ad264 Merge pull request #1628 from tendermint/bucky/selective-evidence-broadcast
evidence: dont send evidence to unsynced peers
2018-06-05 17:07:29 -07:00
41e847ec97 linter 2018-06-05 17:02:05 -07:00
55bae62d71 fix test 2018-06-05 16:54:58 -07:00
d2259696af Merge pull request #1689 from tendermint/1688-tx-search-panic
validate per_page before page
2018-06-05 07:52:49 -07:00
32719123d9 Merge pull request #1687 from tendermint/sdk-1045-memory-leak
do not drain the channel because there is no channel, duh
2018-06-05 07:51:21 -07:00
80e7807cae move spec to markdown (#260) 2018-06-05 10:27:55 -04:00
2ce8179c8b validate per_page before page
plus an additional check just in case
Closes #1688
2018-06-05 16:20:48 +04:00
b8c076ca79 do not drain the channel because there is no channel, duh
Fixes https://github.com/cosmos/cosmos-sdk/issues/1045
2018-06-05 14:57:20 +04:00
1b2e34738a checkSendEvidenceMessage 2018-06-05 00:01:01 -07:00
566024b64f use Hash as map key 2018-06-04 21:50:29 -07:00
932381effa evidence: give each peer a go-routine 2018-06-04 21:20:23 -07:00
2007c66091 fix test 2018-06-04 21:20:23 -07:00
97c5533c35 update some comments 2018-06-04 21:20:23 -07:00
3d33226e80 move types/services.go to state pkg. pass State to evpool.Update 2018-06-04 21:20:23 -07:00
edb851280a state: b -> block 2018-06-04 21:20:23 -07:00
dd62f06994 state: s -> state 2018-06-04 21:20:23 -07:00
19d95b5410 evidence: check peerstate exists; dont send old evidence 2018-06-04 21:20:23 -07:00
53937a8129 changelog 2018-06-04 21:20:23 -07:00
f1c53c7358 evidence: dont send evidence to unsynced peers
* only send evidence to peers that are synced enough to validate it all
* closes #1624
2018-06-04 21:20:23 -07:00
3445f1206e Merge pull request #1683 from tendermint/bucky/test
fix byz-test
2018-06-04 21:09:10 -07:00
097f778c1e fix byz-test 2018-06-04 20:48:35 -07:00
c85c21d1bc Merge pull request #1670 from tendermint/xla/extract-privval
Extract priv_validator into first class package
2018-06-04 18:57:09 -07:00
fd4db8dfdc Merge pull request #1676 from tendermint/xla/collapse-peerconfig
Collapse PeerConfig into P2PConfig
2018-06-04 18:50:41 -07:00
1318bd18cd Merge pull request #1680 from Slamper/develop
Return 404 for unknown RPC endpoints
2018-06-05 02:14:16 +02:00
ea896865a7 Collapse PeerConfig into P2PConfig
As both configs are concerned with the p2p packaage and PeerConfig is
only used inside of the package there is no good reason to keep the
couple of fields separate, therefore it is collapsed into the more
general P2PConifg. This is a stepping stone towards a setup where the
components inside of p2p do not have any knowledge about the config.

follow-up to #1325
2018-06-05 02:07:56 +02:00
aeb91dfc22 dev version bump 2018-06-04 15:57:57 -07:00
5727916c5b Merge pull request #1681 from tendermint/release/v0.19.8
Release/v0.19.8
2018-06-04 15:48:22 -07:00
876c8f14e7 changelog and version 2018-06-04 14:16:58 -07:00
67416feb3a return 404 for unknown RPC endpoints 2018-06-04 22:14:20 +02:00
8706ae765c docs: a link to quick install script 2018-06-04 10:42:28 -04:00
954a8941ff scripts: quickest/easiest fresh install 2018-06-04 10:42:28 -04:00
1f22f34edf flush wal group on stop
Refs #1659
Refs https://github.com/tendermint/tmlibs/pull/217
2018-06-04 16:47:44 +04:00
0562009275 bring back assert 2018-06-04 16:33:57 +04:00
fedd07c522 removed assertion to avoid confusion (#1626) 2018-06-04 14:30:46 +04:00
3fa734ef5a recheck only if there are txs left in the mempool (#1645) 2018-06-04 14:28:47 +04:00
cd6bfdc42f Merge pull request #1673 from tendermint/bucky/mempool
fix possible mempool deadlock
2018-06-03 16:14:58 -04:00
98b0c51b5f fix possible mempool deadlock 2018-06-03 16:11:52 -04:00
c777be256a changelog, version 2018-06-03 16:11:21 -04:00
d66f8bf829 Merge branch 'master' into develop 2018-06-03 16:10:04 -04:00
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
1c643701f5 Merge pull request #1662 from Liamsi/develop
WIP: simplify & update documentation, fix typo
2018-06-02 18:39:36 -04:00
0b0290bdb2 Merge pull request #1675 from tendermint/xla/disable-slate-ci
Disable slate step in CI workflow
2018-06-02 15:56:43 +02:00
a4779fdf51 Disable slate step in CI workflow
It's currently breaking for unknown reasons, until fixed we going to
disable it, to not block on it for unrelated PRs.
2018-06-02 15:49:25 +02:00
7030d5c2a7 remove notes column
according to: https://github.com/tendermint/go-crypto/pull/110#issuecomment-394048086
2018-06-02 13:04:40 +01:00
9af8b7a7c8 fix tests file 2018-06-01 22:03:47 -04:00
f34d1009c4 Merge pull request #1671 from tendermint/1518-xla/remove-auth_enc-option
Remove auth_enc config option
2018-06-01 21:07:14 -04:00
0e3dc32b3d Merge pull request #1672 from tendermint/xla/store-ci-test-logs
Store CI test logs
2018-06-02 02:44:01 +02:00
d292fa4541 Store CI test logs
For post-mortem introspection it is helpful to have the full logs of
test runs available for download.
2018-06-02 02:33:31 +02:00
3255c076e5 Remove auth_enc config option
As we didn't hear any voices requesting this feature, we removed the
option to disable it and always have peer connection auth encrypted.

closes #1518
follow-up #1325
2018-06-01 21:07:20 +02:00
44f1bdb0d5 Bech32 (#216)
* Add support for regular bech32 to tmlibs

* Add bech32 to gopkg.toml
2018-06-01 13:56:00 +04:00
72543092a0 Switch usage of port 46658 to 26658 2018-05-31 21:50:22 -07:00
c681347ee3 move genesis fields into RequestInitChain. some nullable=false 2018-05-31 23:58:02 -04:00
512b3121a7 include genesis file structure 2018-05-31 21:59:20 -04:00
355fde16fe Merge pull request #255 from tendermint/bucky/gogo
Revert "Merge pull request #247 from tendermint/bucky/no-gogo"
2018-05-31 21:43:11 -04:00
90c3a469ff Revert "Merge pull request #247 from tendermint/bucky/no-gogo"
This reverts commit ef79007433, reversing
changes made to bcfdd6dbaf.
2018-05-31 21:45:14 -04:00
2bbad9d496 Merge pull request #85 from tendermint/cwgoes/ledger-integration
Ledger integration
2018-05-31 21:45:00 +02:00
978277a4c1 make slightly more readable 2018-05-31 20:40:01 +01:00
80e9752250 Move TODOs to #114 2018-05-31 21:30:20 +02:00
63aac65590 Remove Ledger ed25519 support, for now 2018-05-31 21:21:50 +02:00
58eb76f34d simplify & update documentation, fiy typo 2018-05-31 20:13:41 +01:00
a017f2fdd4 Merge pull request #1654 from tendermint/release/v0.19.7
Release/v0.19.7
2018-05-31 09:15:13 -04:00
aaaa5f23e2 changelog and version 2018-05-30 23:36:36 -04:00
178e357d7f Merge pull request #1618 from tendermint/1494-production-notes
[docs] notes about running a production system
2018-05-30 23:23:51 -04:00
683b527534 Merge pull request #1636 from tendermint/bucky/docs
gut docs/app-arch
2018-05-30 23:17:26 -04:00
d584e03427 fix link and typo 2018-05-30 23:23:39 -04:00
d454b1b25f SkipDuplicate -> AllowDuplicate; fix p2p test on mac 2018-05-30 21:44:39 -04:00
432f21452d Merge branch 'master' into develop 2018-05-30 21:43:31 -04:00
e1ce3ffe0f changelog and version 2018-05-30 20:48:52 -04:00
eadc7b137b Merge branch 'master' into develop 2018-05-30 18:58:39 -04:00
9706935233 fix link in readme 2018-05-30 18:57:53 -04:00
21b821d661 SignatureKey -> Signature 2018-05-30 18:41:08 -04:00
434759e17b Merge pull request #94 from Liamsi/const_time
Use constant-time comparator to compare signatures
2018-05-30 18:27:05 -04:00
20fdec6c0e fix comment 2018-05-30 18:34:11 -04:00
aa3212180f Merge pull request #80 from alessio/keymanager
Add import/export of public keys #79
2018-05-30 18:24:53 -04:00
f9d094dc1a Merge pull request #97 from Liamsi/prng_seed
safer PRNG seeding
2018-05-30 18:17:58 -04:00
251041ce09 Merge pull request #105 from tendermint/bucky/merkle
Bring in merkle and tmhash from tmlibs
2018-05-30 18:08:25 -04:00
52bd867fd9 merkle: use amino for byteslice encoding 2018-05-30 17:50:17 -04:00
862d3c342a commit doc.go 2018-05-30 17:44:20 -04:00
9f04935caa merkle: remove unused funcs. unexport simplemap. improv docs 2018-05-30 17:44:02 -04:00
bb81e4aa5f Pin to an upstream revision 2018-05-30 22:16:30 +02:00
c689f38cb5 Implement PubKeyLedgerEd25519 2018-05-30 22:07:20 +02:00
f0ce8b3883 note about state syncing 2018-05-30 16:55:39 +04:00
3da5198631 fixes after @zramsay's review 2018-05-30 16:51:20 +04:00
252a0a392b move reactor descriptions to relevant specs 2018-05-30 16:51:19 +04:00
f7106bfb39 more config variables
Refs #1494
2018-05-30 16:51:19 +04:00
2a517ac98c hardware specs and configuration params
Refs #1494
2018-05-30 16:51:19 +04:00
b542dce2e1 [docs] signal handling
Refs #1494
2018-05-30 16:51:19 +04:00
82ded582f2 [docs] debugging/monitoring sections, restart handling
Refs #1494
2018-05-30 16:51:19 +04:00
e0d4fe2dba document DOS exposure and mitigation
Refs #1494
2018-05-30 16:51:19 +04:00
83c6f2864d document the consensus WAL
Refs #1494
2018-05-30 16:51:19 +04:00
33ec8cb609 document logging
Refs #1494
2018-05-30 16:51:19 +04:00
ef79007433 Merge pull request #247 from tendermint/bucky/no-gogo
Bucky/no gogo
2018-05-30 08:41:03 -04:00
6e3191fd6c Merge branch 'develop' into bucky/no-gogo 2018-05-30 08:34:16 -04:00
21951dd5b3 update tmlibs dep 2018-05-30 08:42:07 -04:00
e0acf357bb Merge pull request #214 from tendermint/bucky/no-gogo
no gogo proto
2018-05-30 08:30:54 -04:00
43a652bcbf Merge pull request #1647 from tendermint/1643-events-query-pubsub
[docs] indexing transactions and subscribing to events
2018-05-30 08:16:08 -04:00
094a40084d Merge pull request #1646 from tendermint/xla/duplicate-ip-check-config
Introduce option to skip duplicate ip check
2018-05-30 08:12:46 -04:00
eec9f142b5 [docs] indexing transactions and subscribing to events
Refs #1643
2018-05-30 13:10:04 +04:00
5796e879b9 Introduce option to skip duplicate ip check
In some scenarios like tests we want to disable the guard which prevents
peers connecting from the same ip.

Fixes #1632
Closes #1634
2018-05-30 10:40:22 +02:00
ee411daa17 Add ed25519, tests will fail until ed25519 verification fix 2018-05-30 03:42:57 +02:00
3186dc4cef Clarify function names 2018-05-30 03:29:42 +02:00
e534559bdc Update upstream Ledger code 2018-05-30 01:39:50 +02:00
846ca5ce56 Merge pull request #1641 from tendermint/release/v0.19.6
Release/v0.19.6
2018-05-29 13:14:44 -04:00
fd6021876b Potential fix for blockchain pool halting issue 2018-05-29 12:32:22 -04:00
2763c8539c changelog and version 2018-05-29 12:31:01 -04:00
1c0bfe1158 Merge pull request #1633 from tendermint/jae/blockchain_pool
Potential fix for blockchain pool halting issue
2018-05-29 10:27:53 -04:00
1e87ef7f75 circle: add GOCACHE=off and -v to tests 2018-05-29 09:28:29 -04:00
bcfdd6dbaf Merge pull request #249 from tendermint/zach/fix-test
fix cli test
2018-05-28 18:34:58 -04:00
c8be091d4a gut docs/app-arch 2018-05-28 16:58:38 -04:00
ec34c8f9d2 docs: update ABCI output (#1635) 2018-05-28 22:06:02 +04:00
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
f55725ebfa Potential fix for blockchain pool halting issue 2018-05-26 22:08:42 -07:00
b73157141b fix make test_cli, #244 2018-05-25 16:22:27 -04:00
7f20eb5f8e generate RPC docs using Slate (#1612)
* generate RPC docs using Slate (#691)

* update changelog

* skip if branch not develop

* slate: only build if rpc/core has changes

* fetch develop to compare against

* slate: build on master only

* [rpc/core] use original repo, not fork in README
2018-05-25 15:59:24 +04:00
eeabb4c06b Merge pull request #1607 from tendermint/1600-wal-bug
[wal] small fixes in SearchEndHeight & replay logic
2018-05-25 15:41:57 +04:00
4da81aa0b7 commented out TestPEXReactorRunning 2018-05-25 15:11:32 +04:00
67068a34f2 log requesting addresses 2018-05-25 15:11:32 +04:00
2a0e9f93ce provide arg to error
BEFORE:

```
E[05-24|11:55:37.229] Dialing failed                               pex=0 addr=022ec801d79025caab3afbbf816d92ff8450d040@127.0.0.2:6593 err="Connect to self: <nil>" attempts=0
```

AFTER:

```
E[05-24|11:55:37.229] Dialing failed                               pex=0 addr=022ec801d79025caab3afbbf816d92ff8450d040@127.0.0.2:6593 err="Connect to self: 022ec801d79025caab3afbbf816d92ff8450d040@127.0.0.2:6593" attempts=0
```
2018-05-25 15:11:32 +04:00
708f35e5c1 do not look for height in older files if we've seen height - 1
Refs #1600
2018-05-25 15:11:15 +04:00
f3f5c7f472 we must only return io.EOF to progress to the next file in auto.Group
since we never write msg partially, if we've encountered io.EOF in the
middle of the msg, we must abort
2018-05-25 15:10:51 +04:00
68f6226bea data is corrupted, but this requires manual intervention
i.e., can't be skipped

and we should only return DataCorruptionError if we can skip a msg safely
2018-05-25 15:10:51 +04:00
118b86b1ef fix nil panic error
msg is nil and if we continue executing, we'll get nil exception at
`msg.Msg.(....)`
2018-05-25 15:10:51 +04:00
b9afcbe3a2 fix typo 2018-05-25 15:10:51 +04:00
a885af0826 Merge pull request #1574 from tendermint/847-separate-internal-pubsub
[pubsub] Prioritise internal subscribers (e.g. reactor) over external (e.g. RPC)
2018-05-24 21:09:56 +04:00
707d27c11e Fix dead link in README.md (#106)
* Fix dead link in README.md
2018-05-24 16:57:37 +02:00
6334b3a501 fix makefile 2018-05-24 00:17:46 -04:00
01f87fd8d3 remove gogoproto 2018-05-24 00:13:43 -04:00
d24a30858e no gogo proto 2018-05-24 00:10:35 -04:00
cfdec76020 update everything for Params and Result types 2018-05-23 23:27:46 -04:00
5830c338ae Application uses new ParamsXxx and ResultXxx Types 2018-05-23 22:49:46 -04:00
07a9ddb2d5 result.go is json.go and codetype.go 2018-05-23 22:49:13 -04:00
fac6bcd19e consolidate util.go and pubkey.go to validator.go 2018-05-23 22:46:15 -04:00
3d4f3bbbdd varint -> uvarint for length prefix 2018-05-23 22:46:13 -04:00
927c16281c Merge pull request #245 from tendermint/bucky/validator-types
Request/ResponseValidator, update Header
2018-05-23 22:18:45 -04:00
3dbdc87edb protoc and update everything 2018-05-23 22:24:39 -04:00
8bb04d7ef7 Validator and SignedValidator 2018-05-23 22:20:24 -04:00
3a947b0117 Merge pull request #1619 from tendermint/zach/cleaner-repo
clean up links & spec docs
2018-05-23 21:09:15 -04:00
caf5afc084 Merge pull request #1520 from tendermint/bucky/p2p-same-ip
p2p: prevent connections from same ip
2018-05-23 20:57:17 -04:00
f0b1f6e8ac Merge pull request #98 from zmanian/xChaChaPoly1035
Implementation of xchacha20poly1035 aead
2018-05-23 18:42:17 -04:00
05a5294e52 Remove panic and check the round trip 2018-05-24 00:12:54 +02:00
384f1e399a Fixed the directory name and added a test vector 2018-05-23 23:54:26 +02:00
2aa5285c66 fix from self-review 2018-05-23 10:08:57 -04:00
b166831fb5 link to both consensus specs 2018-05-23 10:05:03 -04:00
423fef1416 docs: use absolute links (#1617) 2018-05-23 10:01:32 -04:00
b4d10b5b91 consensus: link to spec from readme (#1609) 2018-05-23 09:41:54 -04:00
6f1bfb6280 Merge pull request #1616 from tendermint/zach/no-debora
remove debora scripts
2018-05-23 08:43:22 -04:00
5e7177053c Merge pull request #1611 from tendermint/zach/dead-links
fix dead links & other doc updates
2018-05-23 08:42:25 -04:00
a0201e7862 docker readme: update 2018-05-23 08:28:55 -04:00
126ddca1a6 remove debora scripts (#1610) 2018-05-23 08:01:07 -04:00
186d38dd8a Use different loopback addresses for test switch 2018-05-23 02:36:48 +02:00
01fd102dba Incoporate review feedback 2018-05-23 01:56:03 +02:00
e11f3167ff Fix pex reactor test 2018-05-23 01:35:03 +02:00
7d98cfd3d6 Test duplicate IP guard in peer set 2018-05-23 01:24:27 +02:00
4848e88737 Fix persistent peer switch test 2018-05-23 00:24:40 +02:00
60d7486de2 docs: fix dead links, closes #1608 2018-05-22 14:46:56 -04:00
c2636c3c6b tmhash: add Sum function 2018-05-22 13:04:42 -04:00
4663ffdf08 add tmhash 2018-05-22 12:49:44 -04:00
134fdf7169 bring in merkle from tmlibs 2018-05-22 12:43:44 -04:00
c3b72ea708 Merge pull request #210 from tendermint/bucky/tmhash
tmhash
2018-05-22 12:09:52 -04:00
f9b0820752 Merge branch 'develop' into xChaChaPoly1035 2018-05-22 05:47:05 -07:00
8423f6ef5a Add the libsodium test vector 2018-05-21 20:45:36 -07:00
d468cee107 Merge branch 'master' into develop 2018-05-21 21:40:07 -04:00
d970af8724 Merge pull request #212 from tendermint/release/v0.8.3
Release/v0.8.3
2018-05-21 21:30:52 -04:00
06cffa6acb changelog and version 2018-05-21 21:38:02 -04:00
d72de8ba68 fix test 2018-05-21 20:26:54 -04:00
d82699bf43 tmhash 2018-05-21 20:15:32 -04:00
4fb515fa08 Merge pull request #208 from tendermint/bucky/remotedb
Move remotedb under db
2018-05-21 17:36:18 -04:00
f27c358a8a revert protobuf recompile 2018-05-21 17:37:53 -04:00
229c18f1bd Merge branch 'master' into develop 2018-05-21 16:13:11 -04:00
91b6d3f18c Do not set address for self error 2018-05-21 18:47:14 +02:00
20e9dd0737 Return fake IP even when there is no conn 2018-05-21 17:55:40 +02:00
7b02b5b66b Add RemoteIP to test implementation 2018-05-21 17:41:34 +02:00
0cd92a4948 Fix race in test suffix 2018-05-21 17:35:49 +02:00
747f28f85f Merge pull request #1602 from tendermint/bucky/readme
update readme
2018-05-21 09:27:15 -04:00
a9d0adbdef update changelog 2018-05-21 10:56:33 +04:00
3485edf4f5 update test docker image Go version to 1.10 2018-05-21 10:51:47 +04:00
c6f612bfc3 subscribe before state emits NewRoundStep
I had to alter events package for that. Hope that's fine.
Refs #847
2018-05-21 10:51:47 +04:00
bb9aa85d22 copy events and pubsub packages from tmlibs
Refs #847
2018-05-21 10:51:47 +04:00
c4fef499b6 switch to events package 2018-05-21 10:50:55 +04:00
b77d5344fc rename methods for clarity 2018-05-21 10:50:55 +04:00
21f5f3faa7 use channels to send votes, ... from consensus state to reactor
Refs #847
2018-05-21 10:50:55 +04:00
3399ca9369 Merge pull request #101 from Liamsi/go-bindata
Get rid of go-bindata in Makefile
2018-05-20 21:52:21 -04:00
bf6527fc59 Merge pull request #1382 from EugeneChung/develop
remove Heap.Update() call when setting Proposer field
2018-05-20 19:32:13 -04:00
a8910a30e6 Merge branch 'develop' into go-bindata 2018-05-20 23:34:19 +02:00
ed8d9951c0 point to terraform-ansible docs 2018-05-20 17:05:57 -04:00
97b39f340e update readme 2018-05-20 17:01:15 -04:00
383c255f35 dev version bump 2018-05-20 16:54:21 -04:00
931fb385d7 Merge pull request #1599 from tendermint/release/v0.19.5
Release/v0.19.5
2018-05-20 16:45:00 -04:00
018e096748 Merge pull request #1601 from tendermint/bucky/wal-sync
consensus: only fsync wal after internal msgs
2018-05-20 16:36:33 -04:00
ee4eb59355 update comments 2018-05-20 16:44:08 -04:00
efbc2efb42 add proposer to header 2018-05-20 16:25:48 -04:00
31576150ad add total_voting_power to evidence 2018-05-20 16:24:21 -04:00
459ee59e46 Request/ResponseValidator, update Header 2018-05-20 16:15:58 -04:00
f9dce53728 Merge pull request #243 from tendermint/cwgoes/timestamp-in-evidence
Add evidence type and block timestamp to abci.Evidence
2018-05-20 15:00:51 -04:00
a1b8579591 Merge branch 'develop' into cwgoes/timestamp-in-evidence 2018-05-20 14:58:48 -04:00
082a02e6d1 consensus: only fsync wal after internal msgs 2018-05-20 14:40:47 -04:00
2c40966e46 fix changelog 2018-05-20 14:08:35 -04:00
0a9dc9f875 changelog 2018-05-20 10:25:21 -04:00
87cefb724d version 2018-05-20 10:22:42 -04:00
6701dba876 changelog 2018-05-20 10:22:22 -04:00
442bbe592f Merge pull request #1598 from tendermint/bucky/docs-clean
Bucky/docs clean
2018-05-20 09:46:09 -04:00
301aa92f9c phony 2018-05-20 09:53:38 -04:00
52f27686ef Merge pull request #1567 from tendermint/909-limit-tx-search-output
limit /tx_search output
2018-05-20 09:44:41 -04:00
6f9867cba6 fix validate pagination params 2018-05-20 01:47:15 -04:00
02615c8695 update readme 2018-05-20 00:41:54 -04:00
2df137193c security.md 2018-05-20 00:33:37 -04:00
1ef415728d docs/spec: blockchain and consensus dirs 2018-05-20 00:28:47 -04:00
773e3917ec networks: update readmes 2018-05-19 23:35:45 -04:00
26fdfe10fd update readme 2018-05-19 23:28:27 -04:00
d76e2dc3ff readme.rst -> readme.md 2018-05-19 23:26:02 -04:00
420f925a4d link bug bounty in readme 2018-05-19 23:21:42 -04:00
d7d12c8030 update networks/local readme 2018-05-19 23:21:35 -04:00
6c4a26f248 update readme 2018-05-19 22:44:29 -04:00
2a26c47da5 Merge pull request #1590 from tendermint/1227-msg-bytes
nice output for msgBytes
2018-05-18 19:17:22 -04:00
aabe96f1af Merge pull request #1594 from tendermint/zach/tests-less-bash
test cleanup
2018-05-18 19:00:44 -04:00
bb68d7e7be Merge pull request #177 from tendermint/jenkins
tests: slow is smooth, smooth is fast
2018-05-18 18:57:06 -04:00
e196dacf80 Add 'type' field to abci.Evidence 2018-05-18 20:29:32 +02:00
0e1f730fbb rm unused file, fix docker-compose.yml 2018-05-18 14:12:01 -04:00
0b68ec4b8e move a file to remove a directory 2018-05-18 13:37:58 -04:00
ca120798e4 s/dummy/kvstore/g for compatibility (#1532) 2018-05-18 13:26:26 -04:00
595fc24c56 remove very old bash file 2018-05-18 13:22:04 -04:00
e19cedc4b4 tests: more smoothness 2018-05-18 12:03:57 -04:00
2adef2e8f8 less bash in tests 2018-05-18 11:51:56 -04:00
de02ab4b3c lil fix 2018-05-18 11:51:18 -04:00
308ce8b235 tests: less bash 2018-05-18 11:50:57 -04:00
4611cf44f0 Merge pull request #1591 from tendermint/zach/dawks
docs improvements
2018-05-18 18:32:43 +04:00
d596ed1bc2 Let peerConn handle IPs in for tests 2018-05-18 16:27:57 +02:00
0fb33ca91d docs: update install instructions, closes #1580 2018-05-18 10:12:52 -04:00
35428ceb53 docs: lil fixes 2018-05-18 10:01:56 -04:00
de8d4325de Merge pull request #1585 from tendermint/345-mempool-cache
Mempool cache
2018-05-18 08:54:47 -04:00
5a041baa36 nice output for msgBytes
Closes #1227
2018-05-18 12:45:09 +04:00
202a43a5af remove TODO
no longer relevant, I guess. since ABCI only defines 0 (success) code.
2018-05-18 10:48:13 +04:00
2987158a65 [docs] add a note about replay protection
Refs #345, https://github.com/tendermint/tendermint/issues/458#issuecomment-297077148
2018-05-18 10:45:51 +04:00
c9001d5a11 bound the mempool
Refs #345
2018-05-18 10:45:51 +04:00
90446261f3 [docs] document transactional semantics
Refs #1494, #345
2018-05-18 10:45:51 +04:00
ae572b9038 remove extra call to Exists
Refs #345

https://github.com/tendermint/tendermint/issues/1539#issuecomment-387240606
2018-05-18 10:17:09 +04:00
0908e668bd document testnet command, closes #1535 (#1588) 2018-05-18 09:52:31 +04:00
e0dbc3673c version bump 2018-05-17 22:28:53 -04:00
545990f845 Merge pull request #1587 from tendermint/release/v0.19.4
Release/v0.19.4
2018-05-17 22:20:17 -04:00
19ccd1842f version and changelog 2018-05-17 15:47:07 -04:00
b4d6bf7697 add back new-spec/README to tell people it moved 2018-05-17 15:39:49 -04:00
1854ce41fc Merge pull request #1586 from tendermint/bucky/add-part-fix
Bucky/add part fix
2018-05-17 15:21:29 -04:00
547e8223b9 fix 2018-05-17 15:24:37 -04:00
8e46df14e7 improve consensus logger 2018-05-17 13:59:41 -04:00
435eb273a4 Update changelog 2018-05-17 19:47:52 +02:00
4c73ceee08 Add time field to abci.Evidence 2018-05-17 19:46:00 +02:00
8d60a5a7bd update changelog 2018-05-17 21:25:45 +04:00
5115618550 add limit param to /unconfirmed_txs 2018-05-17 21:25:04 +04:00
a6b74b82d1 limit /tx_search output
Refs #909
2018-05-17 21:25:03 +04:00
e5220360c5 AddPart always verifies 2018-05-17 13:17:50 -04:00
b5c4098c53 update docs/examples & terraform/ansible (#1534)
* update docs/examples

* ansible: add node IDs from docs/examples

* better monikers

* ansible: clearer paths

* upgrade version

* examples: updates

* docs: consolidate terraform & ansible

* remove deprecated info, small reorgs

* docs build fix

* docs: t&a critical commit

* s/dummy/kvstore/g

* terraform/DO region unavailable, persistent error can't be bothered to debug rn

* terraform: need vars

* networks: t&a standalone integration script for DO

* t&a more updates

* examples: add script that shows what the testnet command does

* use AMS3, since AMS2 is not available
2018-05-17 18:05:59 +04:00
bc8768cfea Merge pull request #1550 from tendermint/perf-improvements
Performance improvements
2018-05-17 10:50:28 +04:00
d832bde280 update Vagrantfile 2018-05-17 10:43:38 +04:00
5e3a23df6d simplify indexer service main loop 2018-05-17 10:00:59 +04:00
6f7333fd5f fix tests 2018-05-17 10:00:59 +04:00
58e3246ffc batch index txs 2018-05-17 10:00:59 +04:00
bbe1355957 log only hash, not tx itself 2018-05-17 10:00:59 +04:00
7c14fa820d do not log txs at info level
BEFORE:

```
./tm-bench -c 5 -r 1000 127.0.0.1:46657
Stats          Avg       StdDev     Max
Txs/sec        1826      843        2744
Blocks/sec     1.100     0.300      2
```

AFTER:

```
./tm-bench -T 30 -c 5 -r 1000 127.0.0.1:46657
Stats          Avg       StdDev     Max
Txs/sec        6120      1970       9776
Blocks/sec     1.000     0.000      1
```
2018-05-17 10:00:59 +04:00
0d93424c6a disable indexer by default 2018-05-17 10:00:59 +04:00
efc01cf582 stop localnet before starting
in order to avoid having to stop it manually
2018-05-17 10:00:58 +04:00
754be1887c spec: move to final location (#1576) 2018-05-17 09:58:15 +04:00
775b015173 docs: add diagram, closes #1565 (#1577) 2018-05-17 09:57:28 +04:00
b698a9febc Remove double locking in HasIP 2018-05-16 19:21:12 +02:00
c5f45275ec Use remotePeer for test switch 2018-05-16 19:21:12 +02:00
77f09f5b5e Move to ne.IP 2018-05-16 19:21:12 +02:00
1fe41be929 p2p: prevent connections from same ip 2018-05-16 19:21:12 +02:00
906331a8d1 Merge pull request #100 from Liamsi/nano_wallet
Remove outdated non-building code in _nano
2018-05-16 11:20:57 -04:00
b161f0e8c9 Merge pull request #241 from tendermint/max/fix/l_addr
A redundant "listen address" flag removed
2018-05-16 11:14:35 -04:00
Max
64c796f1d2 A redundant "listen address" flag removed 2018-05-16 11:11:26 -04:00
4780afcc58 Merge pull request #240 from tendermint/zach/fix-circle
circle: fix config.yml
2018-05-16 10:45:12 -04:00
a13a2529bf circle: fix config.yml 2018-05-16 10:27:44 -04:00
31c0c9555e Merge pull request #209 from tendermint/tm-847
events and pubsub were moved to tendermint core
2018-05-16 08:49:23 -04:00
399c7ea8ed [tm-monitor] update readme
Refs #92
2018-05-16 16:34:48 +04:00
4a77eda368 events and pubsub were moved to tendermint core
Refs https://github.com/tendermint/tendermint/issues/847
2018-05-16 12:57:08 +04:00
68a0b3f95b version bump. add roadmap back. minor fixes 2018-05-15 22:42:29 -04:00
b1f3c11948 Merge branch 'master' into develop 2018-05-15 22:41:03 -04:00
e1a3f16fa4 Comment tweaks 2018-05-15 08:48:59 -07:00
aab98828fe Merge pull request #1570 from tendermint/release/v0.19.3
Release/v0.19.3
2018-05-15 08:44:16 -04:00
3fe985e289 fix makefile 2018-05-15 12:23:33 +01:00
9136140719 get rid of go-bindata dependency in Makefile; hardcode its output instead 2018-05-15 12:07:05 +01:00
aa2b6b546f Remove outdated non-building code in _nano 2018-05-15 11:39:48 +01:00
ec8079089f Merge pull request #237 from tendermint/bucky/begin-end-block-tags
add tags to begin/end block
2018-05-14 18:55:41 -04:00
9b20287463 add tags to begin/end block 2018-05-14 19:01:49 -04:00
4b080454bb Merge pull request #236 from tendermint/bucky/absent-vals
absent_validators: repeated int -> repeated bytes
2018-05-14 18:48:04 -04:00
f7d775337b absent_validators: repeated int -> repeated bytes 2018-05-14 18:54:48 -04:00
6f316db5de Merge pull request #213 from tendermint/validators-type-assert-to-sortInterface
types: compile time assert to, and document sort.Interface
2018-05-14 18:37:57 -04:00
453e8efe8a Merge pull request #234 from tendermint/adrian/genesis_bytes
Change AppStateBytes to GenesisBytes
2018-05-14 18:34:27 -04:00
063a7d83c1 Merge branch 'develop' into adrian/genesis_bytes 2018-05-14 18:32:47 -04:00
49849de414 Merge pull request #233 from tendermint/adrian/requestinitchain
Allow ResponseInitChain to return the initial validator set
2018-05-14 18:23:40 -04:00
43e72bbcc0 version bump 2018-05-14 18:30:41 -04:00
cd24e92dcb Merge pull request #235 from tendermint/develop
Develop
2018-05-14 18:22:02 -04:00
da73fb87a4 Merge branch 'develop' into adrian/requestinitchain 2018-05-14 18:19:36 -04:00
03f6a29a64 changelog and version 2018-05-14 17:00:57 -04:00
4851653d8e Merge pull request #1569 from tendermint/bucky/update-valid-block-rule
Fix validBlock rule
2018-05-14 16:48:20 -04:00
162811476a update some comments 2018-05-14 16:32:19 -04:00
b5ac9ede8a Add rules in gossipVotesForHeight to clarify priorities on messages to send 2018-05-14 16:18:50 -04:00
ff5dfc0c15 Add more comments for Valid* 2018-05-14 16:18:50 -04:00
d3a98675aa Refactor addVote() to be clearer 2018-05-14 16:17:21 -04:00
e3c4625e63 Suggested changes to consensus/reactor.go 2018-05-14 16:17:21 -04:00
01ac378c96 Update condition based on Jae input 2018-05-14 16:17:21 -04:00
83ca46396d Update gossipVotes routine to align with validBlock mechanism 2018-05-14 16:17:21 -04:00
2c125b6c78 Fix validValue rule 2018-05-14 16:17:21 -04:00
468be0f8d6 mv remotedb, proto, grpcdb all under db/remotedb 2018-05-14 15:49:00 -04:00
3dde0584ed Merge pull request #1529 from tendermint/greg/persistent-script-fix
Persistence test bash fix for relative folder path
2018-05-14 15:44:27 -04:00
45caff1a20 changelog and version 2018-05-14 15:21:29 -04:00
e132e7842b Merge pull request #223 from tendermint/adrian/circle2
Upgrade to Circle 2.0
2018-05-14 15:09:13 -04:00
52d6dfe074 Update specification.rst 2018-05-14 12:27:29 -04:00
4bca7c1009 Added tendermint/testing docker image description 2018-05-14 12:24:54 -04:00
4be3ffbe9b Persistence test bash fix for relative folder path 2018-05-14 12:24:54 -04:00
5b9a1423ae Merge pull request #1564 from tendermint/bucky/dump-consensus
Improve consensus state RPC
2018-05-14 12:21:54 -04:00
16932f889f changelog 2018-05-14 10:45:18 -04:00
e9804d76cf fixes from review 2018-05-14 10:33:31 -04:00
e6d0ade0e1 Update to latest upstream, debugging information 2018-05-14 16:24:08 +02:00
337ad8e594 Update to new Ledger API in progress 2018-05-14 15:26:14 +02:00
49e03fb481 Update dependency versions 2018-05-14 15:26:14 +02:00
86b09b0cd7 Bugfix 2018-05-14 15:26:14 +02:00
391936b734 Prevent unnecessary signatures, improve error messages 2018-05-14 15:26:14 +02:00
e25a64fdf1 Fix testcases, all looks OK 2018-05-14 15:26:14 +02:00
065c3943b1 Fix no-Ledger testcase 2018-05-14 15:26:14 +02:00
1c9ff46e98 Ledger integration, WIP 2018-05-14 15:26:14 +02:00
a7d695408a Merge pull request #94 from tendermint/tm-bench-improvements
[tm-bench] small fixes and improv.
2018-05-14 15:08:11 +04:00
9439306f0f Change last instance of AppStateBytes to GenesisBytes 2018-05-13 20:05:45 -04:00
a41f0d3891 rpc: /consensus_state for simplified output 2018-05-13 19:53:54 -04:00
f80b3aee48 Change AppStateBytes to GenesisBytes
The consensus should pass the entire genesis file to the application.
That way the application has access to the chain_id, the timestap, ...
2018-05-13 19:50:15 -04:00
658060150c rpc: add voting power totals to vote bitarrays 2018-05-13 19:22:23 -04:00
ef67705524 Allow ResponseInitChain to return the initial validator set
ResponseInitChain should be able to return an initial validator set that
is determined by some logic within the genesis.json file.
2018-05-13 19:04:03 -04:00
d0229e8b1e Merge pull request #1554 from tendermint/jae/expose_peer_stats
Expose peer stats for dump_consensus_state
2018-05-13 16:16:35 -04:00
1c8dffaa28 Initial implementation of xchacha20poly1035 aead 2018-05-13 11:06:20 -04:00
56c9e0da7e Add back sample output in rpc/core/consensus.go; Tweak DumpConsensusState output for peers 2018-05-12 15:39:30 -07:00
fbe253767e Merge pull request #1540 from tendermint/set-genesis-time-on-init
set GenesisTime to now during `tendermint init`
2018-05-12 10:10:06 -04:00
edbec10f9e Expose peer stats for dump_consensus_state 2018-05-10 22:43:21 -07:00
a8fcf45624 Change defaults to 100M and 10G respectively 2018-05-10 20:58:28 -07:00
2e41756b55 Add logjack command 2018-05-10 20:43:50 -07:00
67faf556ed Merge pull request #162 from tendermint/db-gRPC
DB as a service: remove database deployment with API
2018-05-10 18:46:05 +02:00
a28fdfd3a8 fix stats calculation 2018-05-10 17:08:49 +04:00
43570388a9 Update README.md 2018-05-09 13:48:49 -07:00
35cf21c6eb Update README.md 2018-05-09 13:48:21 -07:00
3477dd7a90 safer PRNG seeding: hash concatenation of fresh seedBytes with current seedBytes 2018-05-09 15:04:51 +01:00
851232d1b5 Merge pull request #95 from tendermint/delete-ansible-and-terraform
delete ansible and terraform folders
2018-05-09 07:12:27 -04:00
7fac16dc7f ansible and terraform moved to tendermint core repo
see https://github.com/tendermint/tendermint/tree/master/networks
2018-05-09 15:06:47 +04:00
94ce56d243 Use constant-time comparator (sublte.ConstantTimeCompare) to compare
signatures

prevents potential signature forgery

resolves #91
2018-05-09 11:48:46 +01:00
c0a1a8d3c0 add link to github (#1542) 2018-05-09 12:13:07 +04:00
20be8c75e5 Tweak testcases 2018-05-08 17:13:13 +02:00
0b6d101c77 Implement batch operations 2018-05-08 16:38:39 +02:00
45514a6013 Address PR comments 2018-05-08 15:47:06 +02:00
80e6e0fa05 only call Sleep if it took us less than 1 sec. to generate txs 2018-05-08 16:23:29 +04:00
52d3eca67c check if block was created after timeStart 2018-05-08 16:23:00 +04:00
ac2d3a917e set GenesisTime to now during tendermint init 2018-05-08 12:04:20 +04:00
39e1567d0a Add iterator tests 2018-05-08 00:53:33 +02:00
55f4ccd4fc CI fix 2018-05-07 23:28:41 +02:00
2cca5a7a4c Implement TLS/SSL 2018-05-07 23:16:06 +02:00
bf16d6453c Address PR comments 2018-05-07 22:12:26 +02:00
5d12e1eb46 remotedb: a client package implementing the db.DB interface
Simplified the abstractions to remotedb, a package that
allows clients to use whatever database they can in client
code without having to switch out their code e.g
```go
client, err := remotedb.NewInsecure(":9888")
...
// Just like they'd initialize locally
in := &remotedb.Init{
  Name: "test-remote-db",
  Type: "leveldb",
  Dir: "/tmp/dbs",
}

if err := client.InitRemote(in); err != nil {
    log.Fatalf("Failed to initialize the database")
}

v1 := client.Get(k1)
client.Set(k9, dog)

for itr := client.Iterator(a1, z1); itr.Valid(); itr.Next() {
  k, v := itr.Key(), itr.Value()
  dom := itr.Domain()
  ...
}
```
2018-05-07 22:00:38 +02:00
1260b75f63 grpcdb: Better readability for docs and constructor names
* Added some docs for NewClient, BindServer, *server.Init
* Security level clarified, whether "secure" for https
or "insecure" for non-https gRPC connections.
2018-05-07 22:00:38 +02:00
11bee6194a DB as a service
Fixes https://github.com/tendermint/tendermint/issues/1162

Databases as a service!

Can now access Databases as a remote service
via gRPC for performance and easy deployment.

The caveat is that each service is stateful in regards to
the DB i.e. each unique service uses only one unique DB
but nonetheless multiple clients can access it.

A full standalone example

```go
package main

import (
  "bytes"
  "context"
  "log"

  grpcdb "github.com/tendermint/tmlibs/grpcdb"
  protodb "github.com/tendermint/tmlibs/proto"
)

func main() {
  addr := ":8998"
  go func() {
    if err := grpcdb.BindRemoteDBServer(addr); err != nil {
      log.Fatalf("BindRemoteDBServer: %v", err)
    }
  }()

  client, err := grpcdb.NewClient(addr, false)
  if err != nil {
    log.Fatalf("Failed to create grpcDB client: %v", err)
  }

  ctx := context.Background()
  // 1. Initialize the DB
  in := &protodb.Init{
    Type: "leveldb",
    Name: "grpc-uno-test",
    Dir:  ".",
  }
  if _, err := client.Init(ctx, in); err != nil {
    log.Fatalf("Init error: %v", err)
  }

  // 2. Now it can be used!
  query1 := &protodb.Entity{Key: []byte("Project"), Value:
[]byte("Tmlibs-on-gRPC")}
  if _, err := client.SetSync(ctx, query1); err != nil {
    log.Fatalf("SetSync err: %v", err)
  }

  query2 := &protodb.Entity{Key: []byte("Project")}
  read, err := client.Get(ctx, query2)
  if err != nil {
    log.Fatalf("Get err: %v", err)
  }
  if g, w := read.Value, []byte("Tmlibs-on-gRPC"); !bytes.Equal(g, w) {
    log.Fatalf("got= (%q ==> % X)\nwant=(%q ==> % X)", g, g, w, w)
  }
}
```
2018-05-07 22:00:33 +02:00
aefb6c58b6 Merge pull request #87 from tendermint/bucky/fix-ed-gen
fix ed25519 Generate
2018-05-07 10:52:46 -04:00
ad837a8183 fix ed25519 Generate 2018-05-05 19:17:21 -04:00
ab9881471a [tm-bench] give user ability to change rpc function (#91)
Closes #17
2018-05-04 16:35:39 +04:00
8b5c692a6a different way to get stats (#90)
Refs #62
2018-05-04 16:13:42 +04:00
603d173b87 Changed tm-bench output to json (#83)
* Changed output to json

* Added -output-format parameter (issue #40)

* remove leftover debug message
2018-05-03 13:08:19 +04:00
64408a4041 Merge pull request #1528 from tendermint/release/v0.19.2
Release/v0.19.2
2018-04-30 18:28:38 -04:00
cae31157b1 fix lint 2018-04-30 18:23:02 -04:00
66c2b60324 version and changelog 2018-04-30 16:06:45 -04:00
e2e2127365 Merge pull request #1519 from tendermint/bucky/p2p-cleanup
Cleanup P2P
2018-04-30 15:54:04 -04:00
f395b82f73 node: remove commented out trustMetric 2018-04-30 15:59:05 -04:00
47557f868a create addrbook even if pex=false. fixes #1525 2018-04-30 08:31:03 -04:00
b6c062c451 fixes from review 2018-04-30 08:19:19 -04:00
12fc396101 Split CMD's param on space (#1523)
This is to avoid "ERROR: unknown flag: --proxy_app dummy" message when running "docker-compose up"
2018-04-29 17:35:10 +03:00
c195772de1 p2p: small lint 2018-04-28 21:17:28 -04:00
d3c4f746a7 spec: abci notes. closes #1257 2018-04-28 21:12:25 -04:00
fae94a44a2 p2p/pex: some addrbook fixes
* fix before/after in isBad()
* allow multiple IPs per ID even if ID isOld
2018-04-28 20:09:02 -04:00
3a30ee75b9 minor fixes 2018-04-28 17:27:51 -04:00
3498b676a6 update spec and addrbook.go 2018-04-28 17:14:58 -04:00
6157c700dd forgot errors file 2018-04-28 16:15:30 -04:00
c90bf77566 rpc: add n_peers to /net_info 2018-04-28 16:09:18 -04:00
6805ddf1b8 p2p: change some logs from Error to Debug. #1476 2018-04-28 16:00:45 -04:00
2761861b6b p2p: MinNumOutboundPeers. Closes #1501 2018-04-28 15:52:05 -04:00
64569b15e5 fix build and test 2018-04-28 15:39:09 -04:00
0450e35d67 some comments 2018-04-28 15:19:33 -04:00
268055e549 node: remove dup code from rebase 2018-04-28 15:04:37 -04:00
aaa81092e7 p2p: some comments and a log line 2018-04-28 15:01:33 -04:00
3ee1d7909e p2p: explicit netaddress errors 2018-04-28 14:48:51 -04:00
32268a8135 limit maxPexMessageSize based on maxAddressSize 2018-04-28 14:41:36 -04:00
f645187122 spec: pex update 2018-04-28 13:11:32 -04:00
40c79235c0 p2p: dont require minor versions to match in handshake 2018-04-28 13:09:17 -04:00
c23909eecf p2p/pex: minor cleanup and comments 2018-04-28 13:08:44 -04:00
936d1a0e68 some notes about the p2p layer 2018-04-28 11:35:09 -04:00
0cbbb61962 minor cleanup 2018-04-28 01:02:39 -04:00
fa66694f2e Merge branch 'develop' into fix-persistent-first 2018-04-28 00:34:03 -04:00
d92def4b60 version bump 2018-04-28 00:06:05 -04:00
26f633ed48 Merge pull request #1514 from tendermint/release/v0.19.1
Release/v0.19.1
2018-04-27 23:36:15 -04:00
79bfbebfff rpc: docs/comments 2018-04-27 23:19:40 -04:00
f33da8817a rpc: lower_case peer_round_states, use a list, add the node_address 2018-04-27 23:00:09 -04:00
ffe81a0206 changelog and version 2018-04-27 12:35:21 -04:00
0e00154fcc Merge branch 'master' into develop 2018-04-27 12:23:12 -04:00
1ab89e6cbf update changelog 2018-04-27 12:23:00 -04:00
14cff484f1 Merge pull request #1440 from tendermint/1428-remove-wal-light
[config] remove wal_light setting
2018-04-27 12:06:51 -04:00
25cee8827a Merge branch 'develop' into 1428-remove-wal-light 2018-04-27 12:06:08 -04:00
65ebbccb74 Add GoAmino DeepCopy() benchmark for RoundState 2018-04-27 11:55:45 -04:00
1188dfe7ee Merge pull request #1511 from tendermint/bucky/rpc-fixes
Various RPC fixes
2018-04-27 11:45:46 -04:00
c45ba2967a fixes from review 2018-04-27 10:29:05 -04:00
f67c5a9e7b forgot wire.go file 2018-04-27 10:00:34 -04:00
593a785ae2 set NodeInfo on switch before starting RPC server
should fix #1199
2018-04-26 23:49:48 -04:00
94e823cc91 p2p: NodeInfo.Channels is HexBytes 2018-04-26 23:43:51 -04:00
47e4d64973 add validator address to /status 2018-04-26 23:43:51 -04:00
a2d77cbe4e add MarshalJSON methods to fix dump_consensus_state 2018-04-26 23:43:48 -04:00
390b592dec Merge pull request #1510 from tendermint/bucky/docs-and-fixes
JSON Indent and some docs
2018-04-26 23:03:47 -04:00
9ab1fafdf1 some amino json for #1504 2018-04-26 22:06:15 -04:00
94c016a04e use MarshalJSONIndent for init files. closes #1506 2018-04-26 21:32:18 -04:00
97f3ada9c2 update godep 2018-04-26 21:31:48 -04:00
d7d4471072 Merge pull request #1507 from tendermint/bucky/docs-pre-amino
document pre-amino pubkeys/addresses
2018-04-26 20:40:53 -04:00
d48a6f930d document pre-amino pubkeys/addresses 2018-04-26 20:46:08 -04:00
389a6ffa16 Merge pull request #1500 from tendermint/bucky/spec-updates
Bucky/spec updates
2018-04-26 11:44:27 -04:00
f1ead2df70 typo 2018-04-26 11:50:45 -04:00
e5951acfb4 SHA256 -> RIPEMD160 2018-04-26 11:47:13 -04:00
0e1414ef9d spec: add Address spec. notes about Query 2018-04-26 11:46:20 -04:00
97be1eef87 add abci notes 2018-04-26 11:08:34 -04:00
0d9004a854 [cmd] Turn off strict routability when using testnet cmd (#1493)
* [cmd] Turn off strict routability when using testnet cmd

Refs https://github.com/tendermint/tendermint/pull/1454

* use "testnet" instead of "it"
2018-04-26 16:52:11 +02:00
91c81ef9a1 spec: note on byte arrays, clean up bitarrays and more, add merkle proof, add crypto.go script 2018-04-26 10:42:58 -04:00
e2f0778c14 spec: update encoding.md 2018-04-26 09:36:41 -04:00
da088e3ecd Merge pull request #229 from tendermint/update-spec
specify DeliverTx/CheckTx Tags format
2018-04-25 23:39:29 -04:00
a6fe2a9854 specify DeliverTx/CheckTx Tags format 2018-04-25 22:52:11 +02:00
63f8c58009 Merge pull request #1471 from tendermint/greg/devopstools
Greg/devopstools
2018-04-25 10:37:28 +02:00
9ba208c1f5 wrapper.sh logfile check fix 2018-04-24 16:40:51 -04:00
6ce6b20993 Renamed remotenet to sentrynet to match the purpose better. 2018-04-24 14:22:19 -04:00
5361073439 Merge pull request #1483 from tendermint/jae/lower_case_round_state
Jae/lower case round state
2018-04-24 09:57:42 +02:00
6c04465d3d Fix Prove int abci.ABCIQuery (#1485)
* fix Prove in abci query

* fix Prove in abci query

* fix doc

* fix doc
2018-04-24 09:56:25 +02:00
089ce6744c Added ansible playbook to remote networks to ship logs to logz.io 2018-04-23 22:38:49 -04:00
17a5c6fa1a typo fix 2018-04-23 21:03:34 +02:00
18c3f8f3f1 writeDefaultCondigFile -> writeDefaultConfigFile (#1490) 2018-04-23 21:01:40 +02:00
cc5f287c47 Add developer branch 0.8.3 to CHANGELOG 2018-04-23 02:36:49 -07:00
9b2a8f07a3 [common] Add ASCIITrim 2018-04-23 01:32:18 -07:00
d94e312673 add MarshalJSON and UnmarshalJSON to BitArray (#200)
See CHANGELOG
2018-04-23 00:16:05 -07:00
8fa4211bbd Fixes TestParallelAbort nondeterministic failure #201 (#202) 2018-04-23 00:07:03 -07:00
b42d5a2211 blockID -> block_id for JSON 2018-04-21 20:24:50 -07:00
e328006bfe Jae/fixprefixdb (#199)
* Fix PrefixDB Iterator
* PrefixDB Iterator/ReverseIterator fixes
* Bump version 0.8.2
* Update CHANGELOG.md about DebugDB
* Keep invalid source to be closed
* Use prefixBatch instead of memBatch
2018-04-21 04:25:45 -07:00
b20e777f53 lower_case json field names 2018-04-20 23:20:44 -07:00
92102a84dc upgrade tendermint to v0.19.0 (#88)
* upgrade tendermint to v0.19.0

* rm test

* typo fix

* rm test
2018-04-18 13:57:30 +02:00
659762736c Makefile targets for remotenet fixed 2018-04-18 05:56:13 -04:00
ece3f678da [docs/spec] update msg type and Tendermint behavior (#1468)
Refs #1422
2018-04-17 19:38:10 +02:00
d02e4f344f Merge pull request #227 from tendermint/tm-1422-commit-hash
[docs/Commit] all application instances must return the same hash
2018-04-17 13:34:50 -04:00
5b5acbb343 Ansible README update and small fixes 2018-04-17 12:28:05 -04:00
a2930cd723 Merge pull request #1474 from tendermint/release/v0.19.0
Release/v0.19.0
2018-04-17 10:59:36 +02:00
45a05b4726 Merge pull request #1461 from tendermint/update-changelog
update changelog
2018-04-17 09:56:53 +02:00
8bdfe15de9 Dockerfile, localnode, sentry node scripts changes
- Updated Dockerfile and created build-docker target
- Changed localnode docker image to set permissions to more permissive (docker has different user than host system)
- Added sentry node terraform and ansible script
2018-04-16 11:34:01 -04:00
44a8a23932 [docs/Commit] all application instances must return the same hash
Refs https://github.com/tendermint/tendermint/issues/1422
2018-04-16 13:40:19 +02:00
b3904b8da8 ShellChecked wrapper.sh 2018-04-13 21:34:05 -04:00
f2dae2a2d8 Moved to networks folder, introduced cloud server scripts using terraform and ansible (sentry nodes) 2018-04-13 21:03:25 -04:00
a88ccb9396 Matt's wallet changed (#85) 2018-04-13 15:35:37 +02:00
1706ce6f7f update changelog for 0.19.0 release 2018-04-13 10:50:34 +02:00
d0beaba7e8 Bump version to 0.19.0 2018-04-13 01:32:47 -07:00
c28784de5e Merge pull request #1453 from tendermint/fix-localnet
Fix permissions and folder structure for localnet
2018-04-12 17:50:08 +02:00
d06390638d [localnet] use routable IPs 2018-04-12 16:02:31 +02:00
3a0edc561d log error from AddrBook#AddAddress in DialPeersAsync
Refs #1434
2018-04-12 15:51:17 +02:00
f8ed578325 [localnet] execute cmd from root
not secure, but we don't care because it's local tooling
2018-04-12 15:51:32 +02:00
5babaf9a88 [localnet] fix folder permissions errors 2018-04-12 15:51:17 +02:00
c0610b2c32 Greg/localnet (#1450)
* Added new Makefile targets for local testnet running using docker

* Added localnode docker image description, some documentation and refactored to use the tendermint testnet command

* Fixes for the new tendermint testnet command

* More fixes on tendermint testnet and docker-compose

* Changed logging

* Added missing targets to phony
2018-04-12 13:15:16 +02:00
1db2224241 do not use mask in testnet cmd (#1451)
fix node ids
2018-04-11 20:53:33 +02:00
0323b03daf improve testnet cmd (#1449)
* improve testnet cmd

* allow non-validators
* configurable prefix
* populating of persistent peers

* relax permissions

* cleanup output dir every time

* do not remove dir

* remove panic comments
2018-04-11 19:40:53 +02:00
379f9f875b update docs for latest develop (#1448)
* update docs for latest develop

* latest_app_hash, not app_hash
2018-04-11 17:36:14 +02:00
ab00bf7c8b standardize PRNG access (#1411)
* replace math/rand with tmlibs equivalent.

* update tmlibs dependency
2018-04-11 11:38:30 +02:00
64879c1e6a 1417 status response format (#1424)
* Reformated the ResultStatus

* fix misuse of ResultStatus.

* updated changelog

* Fixed tests

* fixed rpc helper tests

* fixed rpc_tests

* fixed mock/status_test

* fixed typo

* fixed ommitempty on validatorstatus and the changelog

* fixed extra line in changelog

* Updated usage of the /status json response in tests after breaking changes

* Updated remaining tests with changes after searching the codebase for usage

* Reformated the ResultStatus

* fix misuse of ResultStatus.

* updated changelog

* Fixed tests

* fixed rpc helper tests

* fixed rpc_tests

* fixed mock/status_test

* fixed typo

* fixed ommitempty on validatorstatus and the changelog

* Updated usage of the /status json response in tests after breaking changes

* Updated remaining tests with changes after searching the codebase for usage

* rebased against develop
2018-04-11 10:38:34 +02:00
7c22e47629 Replaced NodeInfo's pubkey to ID (#1443)
* Replaced NodeInfo PubKey to NodeID

* Fixed tests and replaced NodeID with ID

* Removed unnecessary method ID()

* Fixed codec_test.go

* Fixed codec_test.go

* Removed unnecessary bracket

* Fixed all tests

* Fixed peer_set_test.go

* Fixed peer_test.go

* Fixed common_test.go

* Fixed common_test.go

* Renamed node_id to id

* Removed peer.ID() from RPC net.go

* Replaced NodeInfo pubKey to ID

* Fixed codec_test.go

* Fixed peer_set_test.go

* Fix pex_reactor_test.go

* Refactored code for privateKey initiali

* Fixed peer_set_test.go

* Fixed test.proto and removed orphan string in codec_test.go

* Fixed pointer to a string

* generate node_key when running tendermint init

* [docs] prefix IPs with node IDs

Refs #1429

* gen_node_key cmd

* [docs/specification/secure-p2p] add a note about config

* fix data race

Closes #1442

```
WARNING: DATA RACE
Write at 0x00c4209de7c8 by goroutine 23:
  github.com/tendermint/tendermint/types.(*Block).fillHeader()
      /home/vagrant/go/src/github.com/tendermint/tendermint/types/block.go:88 +0x157
  github.com/tendermint/tendermint/types.(*Block).Hash()
      /home/vagrant/go/src/github.com/tendermint/tendermint/types/block.go:104 +0x121
  github.com/tendermint/tendermint/types.(*Block).HashesTo()
      /home/vagrant/go/src/github.com/tendermint/tendermint/types/block.go:135 +0x4f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrecommit()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1037 +0x182d
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1425 +0x1a6c
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1318 +0x77
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:581 +0x7a9
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:539 +0x6c3

Previous read at 0x00c4209de7c8 by goroutine 47:
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*HexBytes).MarshalJSON()
      <autogenerated>:1 +0x52
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.invokeMarshalJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:433 +0x88
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:82 +0x8d2
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).MarshalJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/amino.go:296 +0x182
  github.com/tendermint/tendermint/rpc/lib/types.NewRPCSuccessResponse()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/types/types.go:100 +0x12c
  github.com/tendermint/tendermint/rpc/lib/server.makeJSONRPCHandler.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/server/handlers.go:152 +0xab7
  net/http.HandlerFunc.ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:1918 +0x51
  net/http.(*ServeMux).ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:2254 +0xa2
  github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:138 +0x4fa
  net/http.HandlerFunc.ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:1918 +0x51
  net/http.serverHandler.ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:2619 +0xbc
  net/http.(*conn).serve()
      /usr/lib/go-1.9/src/net/http/server.go:1801 +0x83b

Goroutine 23 (running) created at:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:250 +0x35b
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/reactor.go:69 +0x1b4
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).Start()
      <autogenerated>:1 +0x43
  github.com/tendermint/tendermint/p2p.(*Switch).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch.go:177 +0x124
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/node.(*Node).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/node/node.go:416 +0xa1b
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/rpc/test.StartTendermint()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/test/helpers.go:100 +0x5b
  github.com/tendermint/tendermint/rpc/client_test.TestMain()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/client/main_test.go:17 +0x4c
  main.main()
      github.com/tendermint/tendermint/rpc/client/_test/_testmain.go:76 +0x1cd

Goroutine 47 (running) created at:
  net/http.(*Server).Serve()
      /usr/lib/go-1.9/src/net/http/server.go:2720 +0x37c
  net/http.Serve()
      /usr/lib/go-1.9/src/net/http/server.go:2323 +0xe2
  github.com/tendermint/tendermint/rpc/lib/server.StartHTTPServer.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:35 +0xb3
```

* removed excessive comment

Refs https://github.com/tendermint/tendermint/pull/1446#discussion_r180353446

* use the tag interface for pubsub. (#1438)

* use the tag interface for pubsub.

* update tmlibs.

* Fix unresolved conflict.

* improve `show_node_id` (#1433)

* fix show_node_id

* make LoadNodeKey public

* make LoadNodeKey public

* remove if

* remove if
2018-04-11 10:11:11 +02:00
e88f74bb9b remove wal_light setting
Closes #1428
2018-04-11 10:08:03 +02:00
384b3ea065 improve show_node_id (#1433)
* fix show_node_id

* make LoadNodeKey public

* make LoadNodeKey public

* remove if

* remove if
2018-04-10 16:03:51 +02:00
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
d93e177a69 Merge pull request #1446 from tendermint/1442-data-race-fix-attempt
fix data race
2018-04-10 16:49:36 +03:00
cef053386b Merge pull request #1439 from tendermint/1429-add-docs-for-node-ids
docs: update docs to include IDs or set auth_enc to false
2018-04-10 11:46:48 +02:00
cca1dd8e3e removed excessive comment
Refs https://github.com/tendermint/tendermint/pull/1446#discussion_r180353446
2018-04-10 11:36:31 +02:00
26c38e770e fix data race
Closes #1442

```
WARNING: DATA RACE
Write at 0x00c4209de7c8 by goroutine 23:
  github.com/tendermint/tendermint/types.(*Block).fillHeader()
      /home/vagrant/go/src/github.com/tendermint/tendermint/types/block.go:88 +0x157
  github.com/tendermint/tendermint/types.(*Block).Hash()
      /home/vagrant/go/src/github.com/tendermint/tendermint/types/block.go:104 +0x121
  github.com/tendermint/tendermint/types.(*Block).HashesTo()
      /home/vagrant/go/src/github.com/tendermint/tendermint/types/block.go:135 +0x4f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrecommit()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1037 +0x182d
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1425 +0x1a6c
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1318 +0x77
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:581 +0x7a9
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:539 +0x6c3

Previous read at 0x00c4209de7c8 by goroutine 47:
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*HexBytes).MarshalJSON()
      <autogenerated>:1 +0x52
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.invokeMarshalJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:433 +0x88
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:82 +0x8d2
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSONStruct()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:348 +0x539
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec)._encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:119 +0x83f
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).encodeReflectJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/json-encode.go:50 +0x10e
  github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino.(*Codec).MarshalJSON()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-amino/amino.go:296 +0x182
  github.com/tendermint/tendermint/rpc/lib/types.NewRPCSuccessResponse()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/types/types.go:100 +0x12c
  github.com/tendermint/tendermint/rpc/lib/server.makeJSONRPCHandler.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/server/handlers.go:152 +0xab7
  net/http.HandlerFunc.ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:1918 +0x51
  net/http.(*ServeMux).ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:2254 +0xa2
  github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:138 +0x4fa
  net/http.HandlerFunc.ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:1918 +0x51
  net/http.serverHandler.ServeHTTP()
      /usr/lib/go-1.9/src/net/http/server.go:2619 +0xbc
  net/http.(*conn).serve()
      /usr/lib/go-1.9/src/net/http/server.go:1801 +0x83b

Goroutine 23 (running) created at:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:250 +0x35b
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/reactor.go:69 +0x1b4
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).Start()
      <autogenerated>:1 +0x43
  github.com/tendermint/tendermint/p2p.(*Switch).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch.go:177 +0x124
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/node.(*Node).OnStart()
      /home/vagrant/go/src/github.com/tendermint/tendermint/node/node.go:416 +0xa1b
  github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start()
      /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x5fc
  github.com/tendermint/tendermint/rpc/test.StartTendermint()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/test/helpers.go:100 +0x5b
  github.com/tendermint/tendermint/rpc/client_test.TestMain()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/client/main_test.go:17 +0x4c
  main.main()
      github.com/tendermint/tendermint/rpc/client/_test/_testmain.go:76 +0x1cd

Goroutine 47 (running) created at:
  net/http.(*Server).Serve()
      /usr/lib/go-1.9/src/net/http/server.go:2720 +0x37c
  net/http.Serve()
      /usr/lib/go-1.9/src/net/http/server.go:2323 +0xe2
  github.com/tendermint/tendermint/rpc/lib/server.StartHTTPServer.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:35 +0xb3
```
2018-04-10 11:15:16 +02:00
609452958c [docs/specification/secure-p2p] add a note about config 2018-04-09 17:02:48 +02:00
c954fca376 gen_node_key cmd 2018-04-09 17:02:47 +02:00
9be16d56ba [docs] prefix IPs with node IDs
Refs #1429
2018-04-09 17:02:47 +02:00
2b732bc11a generate node_key when running tendermint init 2018-04-09 17:02:47 +02:00
dcd00b0e68 update deps and changelog 2018-04-09 16:36:42 +03:00
78a8905690 update deps and version bump 2018-04-09 16:27:58 +03:00
ff3f35c5f4 Merge pull request #1347 from tendermint/jae/aminoify
Convert Tendermint to use GoAmino
2018-04-09 16:24:38 +03:00
915416979b update for latest amino. bump version 2018-04-09 16:21:58 +03:00
357648b8d6 Merge branch 'master' into develop 2018-04-09 16:03:08 +03:00
50ad19541d Merge pull request #198 from tendermint/release/v0.8.1
Release/v0.8.1
2018-04-09 15:47:27 +03:00
0f92a01737 changelog dates 2018-04-09 15:51:54 +03:00
75345c2046 Use an interface for tags. (#195)
* Use an interface for tags.

* rename TagSet to TagMap.

* add documentation to TagMap.
2018-04-09 14:36:40 +02:00
93c4312cdd Merge pull request #1432 from tendermint/bucky/aminoify
Bucky/aminoify
2018-04-09 15:20:36 +03:00
1a1e4e767b check max msg size in DecodeMessage 2018-04-09 15:18:47 +03:00
bb1b249e8a types: lock block on MakePartSet 2018-04-09 15:04:59 +03:00
a807b5db57 added PrefixEndBytes (#186)
* added PrefixToBytes

* added test

* added comment
2018-04-09 12:51:24 +02:00
40a73fa75c Merge pull request #196 from tendermint/joon/simple-proofs-from-map
add SimpleProofsFromMap
2018-04-09 12:40:22 +02:00
c778d7f5d1 fix addresses 2018-04-07 23:13:41 +03:00
bb9b12d67a add scripts/wire2amino.go 2018-04-07 22:04:28 +03:00
767521ac52 update test/p2p/data for amino 2018-04-07 22:03:48 +03:00
df9bf60b05 forgot Gopkg.lock 2018-04-07 20:59:13 +03:00
466c3ab1c7 forgot node/wire.go 2018-04-07 19:53:29 +03:00
c68d406195 fix tests 2018-04-07 19:47:19 +03:00
02c0835e9b fixes post merge 2018-04-07 16:25:10 +03:00
c170800fbd Merge branch 'develop' into jae/aminoify 2018-04-07 16:16:53 +03:00
7afe74a963 Update go-crypto to 0.6.1 and change config/toml.go privval address 2018-04-07 02:01:45 -07:00
5d8767e656 p2p: don't use dial funcn in peerconfig 2018-04-07 12:51:51 +05:30
54adb790f2 p2p: switch - reconnect only if persistent 2018-04-07 11:46:48 +05:30
02531ca5a3 Fix race testing (cont;) Bump version to 0.19.0 2018-04-06 17:06:46 -07:00
d24e4cb821 Fix race testing 2018-04-06 17:02:29 -07:00
fb64314d1c Review from Anton 2018-04-06 13:46:40 -07:00
4930b61a38 Merge pull request #1431 from tendermint/release/v0.18.0
Release/v0.18.0
2018-04-06 23:19:09 +03:00
9cc2cf362f changelog and version 2018-04-06 23:03:27 +03:00
ed93fb34ab Merge pull request #1350 from tendermint/1275-p2p-loopbacks
p2p: loopbacks should be detected and ignored instead of dialling self infinitely
2018-04-06 18:59:05 +03:00
3d32474da8 make linter happy 2018-04-06 13:26:05 +02:00
3233c318ea only log errors, dial correct addresses
"this means if there are lookup errors or typos in the persistent_peers,
tendermint will fail to start ? didn't some one ask for us not to do
this previously ?"
2018-04-06 12:35:48 +02:00
32e1d195a0 Fix cmd and lite 2018-04-05 22:05:30 -07:00
3ca5292dc9 Fix rpc tests 2018-04-05 21:19:14 -07:00
c541d58d2f WIP: fix rpc/core 2018-04-05 16:07:29 -07:00
3037b5b7ca Fix rpc/lib/... 2018-04-05 15:45:11 -07:00
50c521e706 expose KVPair 2018-04-05 21:56:29 +02:00
2861f795f5 add SimpleProofsFromMap 2018-04-05 21:30:15 +02:00
c9a263c589 Merge pull request #1389 from tendermint/1380-trim-whitespaces
trim whitespace from elements of lists (like `persistent_peers`)
2018-04-05 18:22:46 +03:00
e4492afbad Merge 2018-04-05 08:17:10 -07:00
799beebd36 fix consensus tests 2018-04-05 17:54:26 +03:00
45ec5fd170 WIP consensus 2018-04-05 07:05:45 -07:00
6e39ec6e26 do not even try to dial ourselves
also, remove address from the book (plus mark it as our address)
and return an error if we fail to parse peers list
2018-04-05 15:45:52 +02:00
d38a6cc7ea trim whitespace from elements of lists (like persistent_peers)
Refs #1380
2018-04-05 16:42:26 +03:00
7f6ee7a46b add a comment for NewSwitch 2018-04-05 15:27:47 +02:00
34b77fcad4 log error when we fail to add new address 2018-04-05 15:27:47 +02:00
3b3f45d49b use addrbook#AddOurAddress to store our address 2018-04-05 15:27:47 +02:00
3284a13fee add test
Refs #1275
2018-04-05 15:27:47 +02:00
fc9ffee2e3 remove unused tracking because it leads to memory leaks in tests
see https://blog.cosmos.network/debugging-the-memory-leak-in-tendermint-210186711420
2018-04-05 15:27:47 +02:00
3a672cb2a9 update changelog [ci skip] 2018-04-05 15:27:46 +02:00
4b8e342309 fix panic: lookup testing on 10.0.2.3:53: no such host 2018-04-05 15:27:46 +02:00
5a2fa71b03 use combination of IP and port, not just IP 2018-04-05 15:27:46 +02:00
9a57ef9cbf do not dial ourselves (ok, maybe just once)
Refs #1275
2018-04-05 15:27:46 +02:00
59ca9bf480 update to tmlibs v0.8.1 2018-04-05 16:16:36 +03:00
7cce07bc99 Merge pull request #1352 from tendermint/1228-require-id
p2p: require all addresses come with an ID no matter what
2018-04-05 15:55:41 +03:00
0ae66f75ce Merge pull request #1420 from tendermint/1414-data-race
protect Record* peerStateStats functions by mutex
2018-04-05 15:53:15 +03:00
5d1c758730 Fix evidence 2018-04-05 05:43:23 -07:00
1b9323f105 Fix blockchain tests 2018-04-05 05:17:43 -07:00
2e24b64fc1 Add IsEmpty; Publish 0.8.1 2018-04-05 03:14:53 -07:00
cee7b5cb54 GetSelectionWithBias
Refs #1130
2018-04-05 12:00:16 +02:00
1585152341 https://github.com/tendermint/tendermint/pull/1128#discussion_r162799294
Refs #1130
2018-04-05 12:00:16 +02:00
8e699c2bfd defaultSeedDisconnectWaitPeriod should be at least as long as we expect
it to take for a peer to become MarkGood

Refs #1130
2018-04-05 12:00:16 +02:00
904a3115a6 require addresses to have an ID by default
Refs #1228
2018-04-05 11:55:29 +02:00
a506cf47ad protect Record* peerStateStats functions by mutex
Fixes #1414

DATA RACE:
```
Read at 0x00c4214ee940 by goroutine 146:
  github.com/tendermint/tendermint/consensus.(*peerStateStats).String()
      <autogenerated>:1 +0x57
  fmt.(*pp).handleMethods()
      /usr/local/go/src/fmt/print.go:596 +0x3f4
  fmt.(*pp).printArg()
      /usr/local/go/src/fmt/print.go:679 +0x11f
  fmt.(*pp).doPrintf()
      /usr/local/go/src/fmt/print.go:996 +0x319
  fmt.Sprintf()
      /usr/local/go/src/fmt/print.go:196 +0x73
  github.com/tendermint/tendermint/consensus.(*PeerState).StringIndented()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:1426 +0x573
  github.com/tendermint/tendermint/consensus.(*PeerState).String()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:1419 +0x66
  github.com/go-logfmt/logfmt.safeString()
      /home/ubuntu/go/src/github.com/go-logfmt/logfmt/encode.go:299 +0x9d
  github.com/go-logfmt/logfmt.writeValue()
      /home/ubuntu/go/src/github.com/go-logfmt/logfmt/encode.go:217 +0x5a0
  github.com/go-logfmt/logfmt.(*Encoder).EncodeKeyval()
      /home/ubuntu/go/src/github.com/go-logfmt/logfmt/encode.go:61 +0x1dd
  github.com/tendermint/tmlibs/log.tmfmtLogger.Log()
      /home/ubuntu/go/src/github.com/tendermint/tmlibs/log/tmfmt_logger.go:107 +0x1001
  github.com/tendermint/tmlibs/log.(*tmfmtLogger).Log()
      <autogenerated>:1 +0x93
  github.com/go-kit/kit/log.(*context).Log()
      /home/ubuntu/go/src/github.com/go-kit/kit/log/log.go:124 +0x248
  github.com/tendermint/tmlibs/log.(*tmLogger).Debug()
      /home/ubuntu/go/src/github.com/tendermint/tmlibs/log/tm_logger.go:64 +0x1d0
  github.com/tendermint/tendermint/consensus.(*PeerState).PickSendVote()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:1059 +0x242
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).gossipVotesForHeight()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:789 +0x6ef
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).gossipVotesRoutine()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:723 +0x1039

Previous write at 0x00c4214ee940 by goroutine 21:
  github.com/tendermint/tendermint/consensus.(*PeerState).RecordVote()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:1242 +0x15a
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).Receive()
      github.com/tendermint/tendermint/consensus/_test/_obj_test/reactor.go:309 +0x32e6
  github.com/tendermint/tendermint/p2p.createMConnection.func1()
      /home/ubuntu/go/src/github.com/tendermint/tendermint/p2p/peer.go:365 +0xea
  github.com/tendermint/tendermint/p2p/conn.(*MConnection).recvRoutine()
      /home/ubuntu/go/src/github.com/tendermint/tendermint/p2p/conn/connection.go:531 +0x779
```
2018-04-05 11:42:45 +02:00
7689c15413 Merge pull request #1378 from tendermint/bucky/disable-test-libs
comment out test_libs because of gcc dep in tmlibs
2018-04-05 11:06:30 +02:00
f907113c19 Net_info should print the ID of peers (#1312) 2018-04-05 11:02:23 +02:00
140f962201 Merge pull request #1406 from tendermint/docker
Update dockerfile and readme
2018-04-05 10:57:19 +02:00
c23d907f12 Merge pull request #1391 from tendermint/581-include-validator-power
Include validator power in /status
2018-04-05 11:18:45 +03:00
105847b7dd Fix comments 2018-04-05 08:13:13 +01:00
9c02c8ce93 Add import/export of public keys #79 2018-04-04 23:29:00 +01:00
fb7bde9c24 Add cause in Error.Error() 2018-04-04 13:43:19 -07:00
390de81bbc Release version 0.8.0 2018-04-04 12:30:13 -07:00
1b51cbc224 Changed wallet addresses (#84)
* Changed wallets to basecli 0.13-compatible keys
2018-04-04 12:04:09 -04:00
ed782e7508 include validator's voting power in /status
Refs #581
2018-04-04 11:34:59 +02:00
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
39a4963782 document funcs in validator_set.go 2018-04-04 10:42:35 +02:00
37ce6b195a ValidatorSet#GetByAddress: return -1 if no validator was found 2018-04-04 10:42:34 +02:00
7aa6d36258 Merge pull request #1412 from tendermint/bucky/exit-conR-subscribe-routine
consensus: check for closed subscription channels and exit routine
2018-04-03 23:53:48 +03:00
5c3d3f0875 Merge pull request #194 from Tilkal/random-missing-methods
Random missing methods
2018-04-03 23:52:16 +03:00
991017fc41 Merge pull request #1336 from tendermint/zarko/1308-add-light-client-spec
Add light client spec
2018-04-03 23:02:32 +03:00
5f548c7679 consensus: close pubsub channels. fixes #1372 2018-04-03 22:57:32 +03:00
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
39ff4d22e9 minor cleanup 2018-04-03 22:34:18 +03:00
74486f7f93 Add Int63n() and RandInt63n(). 2018-04-03 16:24:38 +02:00
d66d43d2ea Add Int31n() and RandInt31n(). 2018-04-03 16:23:36 +02:00
196f8410ba WIP commit; Fix types/results_test 2018-04-03 07:03:08 -07:00
f457435199 HexBytes formatting; Make computeHashFromAunts more defensive 2018-04-03 07:02:19 -07:00
8462493cbf [rpc] fix subscribing using an abci.ResponseDeliverTx tag
Refs #1369
2018-04-03 15:53:13 +02:00
47b8bd1728 wrote a test for EventBus#PublishEventTx
Refs #1369
2018-04-03 15:53:13 +02:00
89cdde7f1e Fix state tests 2018-04-03 06:50:53 -07:00
fec8de831a Added more wallets (#82) 2018-04-03 15:46:53 +02:00
3cd4dcf13b changelog 2018-04-03 16:23:41 +03:00
b5e6f8a446 Merge pull request #191 from Tilkal/random-float64
Add Float64() and RandFloat64().
2018-04-03 16:15:06 +03:00
f664b020cd Merge pull request #189 from mohanson/patch-2
bug fix: WriteFileAtomic
2018-04-03 16:13:56 +03:00
657fd671ea Merge pull request #1409 from tendermint/zach/docs/tm-monitor
docs: build updates
2018-04-03 15:24:55 +03:00
3375dac049 add Float64() and RandFloat64(). 2018-04-03 14:09:50 +02:00
7d00575898 Merge pull request #81 from tendermint/update-monitor-and-bench-3
Update bench version
2018-04-03 13:49:14 +02:00
315c475b79 docs: build updates
ref: https://github.com/tendermint/tools/pull/79
2018-04-03 04:48:40 -07:00
3d333f5cac [bench] bump version 2018-04-03 13:42:57 +02:00
63deea9675 [bench] update monitor 2018-04-03 13:42:13 +02:00
a66b20aff4 Merge pull request #80 from tendermint/update-monitor-and-bench-2
Update tm-bench
2018-04-03 13:26:28 +02:00
34896f2988 remove .dockerignore 2018-04-03 13:21:21 +02:00
8f741b44d6 [monitor/bench] fix Dockerfile.dev 2018-04-03 13:19:21 +02:00
b221ca0efa refine comments 2018-04-03 19:04:09 +08:00
4bffda0dc2 [monitor] bump version 2018-04-03 13:03:31 +02:00
5a211ff791 [monitor] move to int64 for height 2018-04-03 13:02:09 +02:00
d831b443da [bench] fix type errors 2018-04-03 12:48:33 +02:00
aa40f8a868 [bench] do not send vendor dir to docker 2018-04-03 12:43:09 +02:00
2912f40f8e [bench] switch from glide to dep 2018-04-03 12:42:49 +02:00
efb8f6fc1f [bench] update Makefile 2018-04-03 12:39:58 +02:00
62965e68f1 Merge pull request #79 from tendermint/update-monitor-and-bench
Update monitor and bench
2018-04-03 12:30:39 +02:00
ee67e34519 Fix lint errors (#190)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix receiver names.

* remove omittable code.

* fix dot imports.
2018-04-03 12:23:28 +02:00
585b163d94 [monitor] fix linter error 2018-04-03 11:56:00 +02:00
4a03eb7baf [monitor] bring back readme 2018-04-03 11:55:43 +02:00
445ddbf040 [monitor] fix data races! 2018-04-03 11:33:16 +02:00
664d4ebf4c [monitor] ignore vendor when building docker 2018-04-03 11:08:43 +02:00
2f1c7a3646 [monitor] make linters happy 2018-04-03 11:08:43 +02:00
0e09c09c30 [monitor] switch to dep 2018-04-03 11:08:43 +02:00
9a2935cff6 [monitor] update Makefile 2018-04-03 11:05:28 +02:00
29a8cb8d87 add comments. 2018-04-03 16:51:30 +08:00
8833335948 Merge pull request #78 from tendermint/feature/jenkins
Feature/jenkins
2018-04-03 10:11:36 +02:00
2fbd9f15fa bug fix: WriteFileAtomic
Must close file before rename it.
2018-04-03 15:26:47 +08:00
5ef639fcbe p2p: persistent - redial if first dial fails
Fixes #1401
2018-04-03 09:27:06 +05:30
a557bb4d0b Merge pull request #185 from tendermint/bucky/merge-master
Bucky/merge master
2018-04-02 22:26:22 +03:00
b800b4ec1d update docker readme 2018-04-02 16:57:25 +02:00
208ac32fa2 update Dockerfile to point to 0.17.1 release 2018-04-02 16:56:07 +02:00
641476d40f update docker to use alpine 3.7 2018-04-02 16:55:43 +02:00
491c8ab4c1 [rpc/lib] log cert and key files in StartHTTPAndTLSServer 2018-04-02 15:21:05 +02:00
5ef8a6e887 deprecate not fully formed addresses 2018-04-02 15:21:05 +02:00
d694d47d22 [rpc/lib] rename vars according to Go conventions 2018-04-02 15:21:05 +02:00
ecdc1b9bb0 Add a method for creating an https server (#1403) 2018-04-02 11:36:09 +02:00
9c757108ca [test] remove test_libs
Reasons:
1) all deps we're using should be passing tests (including external)
2) deps can require complicated setup for testing
3) the person responsible for releasing Tendermint should be cautious
when updating a dep
2018-04-02 11:29:03 +02:00
5243e54641 [codecov] ignore docs, scripts and DOCKER dirs 2018-04-02 11:23:56 +02:00
70e7454c21 comment out test_libs because of gcc dep in tmlibs 2018-04-02 11:23:56 +02:00
382e99d06e Add IsTypedNil 2018-04-02 01:47:42 -07:00
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
eaee98ee1f CGO_ENABLED=0 added for static linking (#1396) 2018-04-01 19:54:48 +02:00
41302c206a Merge branch 'master' into develop
* Update changelog
2018-03-31 19:36:05 +03:00
35a1d747b0 Fix mempool 2018-03-31 11:51:32 +02:00
d73a7397b5 Dockerfile update and fixes 2018-03-31 00:34:32 -04:00
043ba85a9e Added automated dockerfile 2018-03-30 23:22:08 -04:00
34974e3932 Make types use Amino; Refactor PrivValidator* to FilePV/SocketPV 2018-03-31 00:18:43 +02:00
df704e99b1 Merge pull request #77 from zhangyelong/master
dependency upgrade
2018-03-29 12:13:50 +02:00
898216d419 add SplitAndTrim func (#183)
Refs https://github.com/tendermint/tendermint/issues/1380
2018-03-29 12:04:01 +02:00
575a46d9d4 fix typo on block header (#1387) 2018-03-29 11:28:29 +02:00
bcadbd1b10 Merge pull request #1376 from tendermint/1368-unsubscribe-does-not-work
[rpc] unsubscribe does not work
2018-03-28 15:13:40 -04:00
ead9daf1ba Fix code style (#1362)
* cfg: Uniform style for method args and var names
2018-03-28 13:40:47 -04:00
22949e6dfd new tmlibs Parallel implementation 2018-03-28 19:13:08 +02:00
49986b05bc update tmlibs
Refs #1376
2018-03-28 19:12:52 +02:00
0f2811441f [pubsub] fix unsubscribing (#181)
* [pubsub] fix unsubscribing

by giving it the same exact query, which was used to subscribe

Refs https://github.com/tendermint/tendermint/issues/1368

* use original query to unsubscribe

Refs #1368

* modify the unit test the issue is fixed
2018-03-28 16:04:46 +02:00
2fa7af4614 [lite] fixed listen address (#1384) 2018-03-28 15:59:09 +02:00
2d857c4b1b add hash field to ResultTx (/tx and /tx_search endpoints) (#1374)
Refs #1367
2018-03-28 15:44:58 +02:00
6e26392209 Return config parse errors (#182) 2018-03-28 15:35:52 +02:00
2b63f57b4c fix tx_indexer's matchRange
before we're using IteratePrefix, which is wrong because we want full
range, not just "account.number=1".
2018-03-28 15:02:54 +02:00
4085c72496 sort /tx_search results by height by default
Refs #1366
2018-03-28 15:02:54 +02:00
eea93b8904 Upgrade to Circle 2.0 2018-03-28 12:37:42 +02:00
2914b73e30 Rename queries to queryToMetricMap 2018-03-28 18:37:39 +08:00
858cad05f1 Rename eventType to query 2018-03-28 18:20:00 +08:00
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
d42a308887 dependency upgrade 2018-03-28 11:44:06 +08:00
6f9956990c Merge pull request #1377 from tendermint/release/0.17.1
Release/0.17.1
2018-03-27 11:24:48 -04:00
9bf5862def types: fix genesis.AppStateJSON 2018-03-27 11:20:09 -04:00
e1d98bb7f6 forgot bug fix in changelog 2018-03-27 10:06:30 -04:00
e5cd006bce Merge pull request #1373 from tendermint/release/0.17.0
Release/0.17.0
2018-03-27 09:57:10 -04:00
58242e1b63 bump version one more time 2018-03-27 09:07:29 +02:00
4e86835163 update changelog for 0.17.0 release 2018-03-27 09:06:32 +02:00
ab4ac04c88 bump up the version 2018-03-26 22:07:07 +02:00
2c1887a635 update changelog 2018-03-26 22:06:58 +02:00
1c82281b77 make app_options -> app_state backwards compatible 2018-03-26 21:51:07 +02:00
43ac92b615 Changed to make line break easier to read (#1363) 2018-03-26 16:27:20 +02:00
7fb3f704b3 Update README with examples; Add signature test 2018-03-26 10:59:10 +02:00
5d5f580f49 Update changelog for v0.6.1 2018-03-26 10:44:04 +02:00
0d4436dea7 Use MarshalBinaryBare; Fix encode_test; Bump version 2018-03-26 10:41:04 +02:00
901b456151 P2P now works with Amino 2018-03-26 06:40:02 +02:00
8813684040 lite/proxy: consolidate some common test headers into a variable
Addressing some feedback from @ebuchman in regards to
consolidating some common test headers into a variable.

I've added that for simple cases, trying to meet in the middle
instead of creating helpers that obscure readibility and easy
comparison of test cases.
2018-03-25 00:27:42 -06:00
58f36bb321 Review feedback from @melekes
* Fix typo on naming s/deabBeef/deadBeef/g
* Use `assert.*(t,` instead of `assert.New(t);...;assert.*(`
2018-03-24 23:54:01 -06:00
4c2f56626a lite/proxy: Validation* tests and hardening for nil dereferences
Updates https://github.com/tendermint/tendermint/issues/1017

Ensure that the Validate* functions in proxy are tests
and cover the case of sneakish bugs that have been encountered
a few times from nil dereferences. The lite package should
theoretically never panic with a nil dereference. It is meant
to contain the certifiers hence it should never panic with such.

Requires the following bugs to be fixed first;
* https://github.com/tendermint/tendermint/issues/1298
* https://github.com/tendermint/tendermint/issues/1299
2018-03-24 23:54:01 -06:00
a04f2ae5c6 tmlibs 0.8.0-dev; canonical concrete names 2018-03-25 07:15:24 +02:00
e9cf47606c Merge panics into errors in Parallel 2018-03-25 00:04:47 +01:00
c62aed95f2 Lock to 0.8.0-dev tmlibs 2018-03-24 23:51:08 +01:00
87c0473730 New Error (#180)
* New Error can capture Stacktrace
* Intelligent ErrorWrap
* Review fixes
2018-03-24 22:19:44 +01:00
e3337d764a Merge pull request #1354 from tendermint/bucky/dep
update dep
2018-03-24 12:14:56 -04:00
aeb6d14c1c version bump 2018-03-23 09:13:59 -04:00
214817ed17 do not add peer to switch if it fails to start 2018-03-23 13:31:48 +01:00
116a4ec705 temporary fix
I assume there is a deeper issue with how UnmarshalBinary works in
go-amino (i.e., when loading array of some objects, the empty array
becomes []object{nil}). Note when Marshaling, the object is nil.
2018-03-23 12:47:02 +01:00
bbaad22982 update dep 2018-03-23 10:27:00 +01:00
a7250af303 Exponential backoff follow up (#1349)
* document new functionality [ci skip]

Refs #1304

* add fixme [ci skip]

Refs #1304

* ensure that we dial peer after backoff duration

Refs #1304
2018-03-23 09:48:27 +01:00
46686763ba Merge pull request #219 from tendermint/release/v0.10.2
Release/v0.10.2
2018-03-23 00:16:46 -04:00
454db6c12b version and changelog 2018-03-23 00:21:27 -04:00
8fc21cdcd9 remove omitempty 2018-03-22 23:59:25 -04:00
5310e85bbb run make protoc 2018-03-22 23:46:23 -04:00
f3f9f792a5 Merge pull request #218 from tendermint/release/v0.10.1
Release/v0.10.1
2018-03-22 23:18:30 -04:00
968db546ee changelog update 2018-03-22 23:13:55 -04:00
4600f19d9f add nullable=false and omitempty to fee 2018-03-22 22:53:09 -04:00
e0c174b02b remove nullable=false from fee 2018-03-22 22:50:26 -04:00
f9d9d92ea3 fix dep for minor version bumps 2018-03-22 20:01:07 -04:00
c11bcd7890 update dep for tmlibs 2018-03-22 19:44:43 -04:00
24da7009c3 Merge pull request #178 from tendermint/release/v0.7.1
Release/v0.7.1
2018-03-22 19:38:39 -04:00
db3d1cb7fa changelog and version 2018-03-22 19:36:57 -04:00
d46b9afb79 Simplify WriteFileAtomic
We can make the implementation more robust by adjusting our assumptions
and leverage explicit file modes for syncing. Additionally we going to
assume that we want to clean up and can't really recover if thos
operations (file close and removal) fail.

* utilise file mode for majority of concerns
* improve test coverage by covering more assumptions
* signature parity with ioutil.WriteFile
* always clean up

Replaces #160
2018-03-22 19:36:24 -04:00
97bdad8262 common: NewBitArray never crashes on negatives (#170)
Fixes #169
Fixes https://github.com/tendermint/tendermint/issues/1322

The previous code was very trusting assuming that
rational actors will use this code. However, Byzantine
actors don't care and in the case of the linked issue
negative lengths can be sent to this code unfettered
having been received from a peer.

This code is essentially just a sign change from
`==`
to
`<=`

and we've gutted out that attack by being more defensive.
2018-03-22 19:36:24 -04:00
3135fca73b changelog, dep, version 2018-03-22 19:19:16 -04:00
215831d035 update spec and explain more 2018-03-22 19:12:08 -04:00
5306147a2d types: revert CheckTx/DeliverTx changes. make them the same 2018-03-22 19:11:34 -04:00
c0549ec943 Merge pull request #175 from tendermint/bucky/changelog
update version, changelog
2018-03-22 19:09:06 -04:00
dc1042eb5f finish changelog 2018-03-22 13:55:55 -04:00
6545a21369 docs/examples: update quick start guide (#1351) 2018-03-22 08:58:02 +01:00
416f03c05b Add light client spec 2018-03-21 10:00:18 +01:00
b6400af7ac update version, changelog 2018-03-21 05:15:30 +01:00
a86b1d8f75 Merge pull request #171 from tendermint/feature/xla-writefileatomic
Simplify WriteFileAtomic
2018-03-21 05:04:14 +01:00
ced74251e9 maxPacketMsg -> packetMsgMax... 2018-03-21 02:47:38 +01:00
6c345f9fa2 First stab: p2p/conn 2018-03-21 02:27:10 +01:00
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
4e5c655944 Parallel reaps automatically before returning 2018-03-20 23:08:51 +01:00
4caf943f49 Parallel returns a TaskResultSet 2018-03-20 21:43:58 +01:00
db48010e81 Add return parameter to Parallel 2018-03-20 19:58:05 +01:00
bf24f2dcc5 Implement better Parallel (#174)
* Implement better Parallel
2018-03-20 19:24:18 +01:00
79315efd1f Merge pull request #1341 from EugeneChung/develop
Remove unnecessary bytes.Compare() call
2018-03-20 16:27:06 +01:00
a61130aebb Remove unnecessary bytes.Compare() call 2018-03-20 23:43:18 +09:00
5a51a0ba06 Merge pull request #1337 from tendermint/1296-follow-up
Follow up for /health endpoint
2018-03-20 10:36:47 +01:00
0d0b56739d Merge pull request #1335 from tendermint/zarko/1146-improve-bft-time-spec
Improve BFT time spec
2018-03-20 01:00:34 +01:00
eb1816c9ff Merge pull request #1338 from tendermint/1266/xla-fix-flaky-testswitchreconnectstopersistentpeer
p2p: Keep reference to connections in test peer
2018-03-20 00:14:38 +01:00
50ae892d5e p2p: Keep reference to connections in test peer
We observed non-deterministic test failures in one of our switch tests,
which would happen if the GC would run between iterations of the accept
loop. As we don't hold any reference to the connection the setup
finalizer might get triggered and therefore the file handle closed. For
the curious check the references on finalizers and the variable scoping
in the spec:

https://groups.google.com/forum/#!topic/golang-nuts/xWkhGJ5PY6c
https://groups.google.com/forum/#!topic/golang-nuts/d8aF4rAob7U/discussion
https://golang.org/ref/spec#Declarations_and_scope

Fixes #1266
2018-03-19 20:35:12 +01:00
5a79b3d74a Improve the spec to make explicit median computation based on voting power 2018-03-19 19:10:02 +01:00
460599ef75 fix comment 2018-03-19 20:01:43 +03:00
830bb72d6f add Health method to clients
Refs #1296
2018-03-19 20:01:43 +03:00
b11c26cc1c update CHANGELOG 2018-03-19 19:53:28 +03:00
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
20b198681b Merge pull request #1328 from tendermint/bucky/add-vote-readability
addVote readability
2018-03-19 12:24:28 +01:00
2bf106a1b3 Merge pull request #1333 from tendermint/1244-follow-up
consensus: fix tracking for MarkGood
2018-03-19 12:19:16 +01:00
2c445059f2 mark peer as good every blocksToContributeToBecomeGoodPeer blocks
if enough peers are marked good eventually some will become unmarked, so
good to have a force that will continue to cycle them back into good
territory!

Refs #1317
2018-03-19 14:10:25 +03:00
d8b08cd943 return back panic in peer#onReceive
Refs #1317
2018-03-19 13:19:05 +03:00
ab59f64f57 test we record votes and block parts
Refs #1317
2018-03-19 13:17:11 +03:00
42e3457884 fix tracking of votes and blockparts to not allow old information
also remove mutex
Refs #1317
2018-03-19 13:17:06 +03:00
31f3dd42e7 mark peer as good only once
or should we do it every N blocks?
Refs #1317
2018-03-19 13:17:00 +03:00
5fab8e404d replace magic number with blocksToContributeToBecomeGoodPeer const
Refs #1317
2018-03-19 13:16:56 +03:00
701df09971 do not use keywords
Refs #1317
2018-03-19 13:16:02 +03:00
bb65f097fd Simplify WriteFileAtomic
We can make the implementation more robust by adjusting our assumptions
and leverage explicit file modes for syncing. Additionally we going to
assume that we want to clean up and can't really recover if thos
operations (file close and removal) fail.

* utilise file mode for majority of concerns
* improve test coverage by covering more assumptions
* signature parity with ioutil.WriteFile
* always clean up

Replaces #160
2018-03-19 09:38:28 +01:00
358f7ad8e9 Merge pull request #75 from racin/master
Documentation: Wrong command-line flag
2018-03-19 09:35:28 +08:00
d350da3135 config: fix private_peer_ids 2018-03-18 23:55:44 +01:00
f010462639 Make concrete registered name be tendermint/* 2018-03-18 23:45:46 +01:00
ab7dea4f20 consensus: return from errors sooner in addVote 2018-03-18 23:09:04 +01:00
b297efb532 consensus: return from go-routine in test 2018-03-18 23:05:04 +01:00
eaabdb5cac Merge pull request #1282 from tendermint/1126-private-peers
private peers
2018-03-18 22:53:57 +01:00
066aee3045 Documentation: The character for 1/3 fraction could not be rendered in PDF on readthedocs. (#1326) 2018-03-18 22:44:38 +03:00
0d8ca4ec10 Documentation: Wrong command-line flag 2018-03-18 18:51:37 +01:00
4b0058dd64 common: remove {Left, Right}PadString (#168)
Fixes #134

Those functions are unused in the whole Tendermint Github
organization plus they were unnecessariy verbose and could
have been concisely replaced with

```go
func RightPadString(s string, totalLength uint) string {
       return fmt.Sprintf("% *s", totalLength, s)
}

func LeftPadString(s string, totalLength uint) string {
       return fmt.Sprintf("% -*s", totalLength, s)
}
```

delete them anyways
2018-03-18 15:19:23 +04:00
b1c9b82531 common: NewBitArray never crashes on negatives (#170)
Fixes #169
Fixes https://github.com/tendermint/tendermint/issues/1322

The previous code was very trusting assuming that
rational actors will use this code. However, Byzantine
actors don't care and in the case of the linked issue
negative lengths can be sent to this code unfettered
having been received from a peer.

This code is essentially just a sign change from
`==`
to
`<=`

and we've gutted out that attack by being more defensive.
2018-03-18 15:17:11 +04:00
b0e0dc5de3 Implement DebugDB (#166) 2018-03-18 01:52:28 +01:00
3412587036 Fix race condition in random.go 2018-03-18 01:50:15 +01:00
4e02184676 Remove pkg/errors; Update Gopkg.toml, but not GRPC because it breaks. 2018-03-18 01:40:26 +01:00
9b9a9e7f8c Add Error Type for switching 2018-03-17 16:32:49 +01:00
99437a96fb Add efficient implementation of fmt and use for errors. 2018-03-17 15:23:22 +01:00
bb875303c2 Add NewErrorWithCause() 2018-03-17 14:44:12 +01:00
de36bfe31c Add TMLibs/Error from Cosmos-SDK/Error 2018-03-17 13:56:39 +01:00
90cd89eab0 Unexpose r.rand (#167) 2018-03-17 05:18:22 -07:00
6d61ca3bb5 New -> NewRand 2018-03-17 12:34:23 +01:00
536c27de8e common/random.go supports seeding and *Rand (#121)
* common/random.go supports seeding and *Rand
* Ensure determinism
2018-03-17 04:28:53 -07:00
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
a3800da0a1 Update Gopkg.lock to use go-amino 2018-03-16 07:01:02 -07:00
7dee27c851 Merge pull request #76 from tendermint/update-go-amino
wire -> amino
2018-03-16 06:48:32 -07:00
7cb3188fbc testnet cmd: ensure config dir exists. closes #1290 2018-03-16 14:26:43 +01:00
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
68e049d3af Merge pull request #1244 from tendermint/1147-using-mark-good-and-stop-peer-for-error
Using MarkGood and StopPeerForError
2018-03-15 18:58:29 +01:00
d289c9286e Implement NewPrefixDB (#164)
* encodeByteSlice uses uvarint for length instead of varint
* Implemented NewPrefixDB
* Fix flowrate test (#165)
* Complete implementation and fix tests
* Add tests for MemBatch Write[Sync]
2018-03-15 09:43:23 -07:00
86ddf17db0 add a todo
Refs #1281
2018-03-15 11:58:20 +04:00
a655500047 fix copy-pasted comment [ci skip] 2018-03-15 11:58:20 +04:00
714f885dac mark peer as good if it contributed enough votes or block parts
Refs #1147
2018-03-15 11:58:20 +04:00
b0d8f552c5 return err if peer has sent a vote that does not match our round 2018-03-15 11:58:20 +04:00
63cb69cb96 comment out ErrAddingVote because it breaks byzantine_test 2018-03-15 11:58:20 +04:00
266974cb59 stop peer if it sends invalid vote 2018-03-15 11:58:20 +04:00
bcf54b0aa3 PanicSanity is deprecated 2018-03-15 11:58:20 +04:00
d86855ad7a stop peer if it sends us msg with unknown channel 2018-03-15 11:58:20 +04:00
d0c67bbe16 stop peer if evidence is not valid 2018-03-15 11:58:20 +04:00
4242352852 stop peer on decoding error 2018-03-15 11:58:19 +04:00
f299689573 return back defaultChannelCapacity 2018-03-15 11:58:19 +04:00
baf457e6d4 return error if peer sent us a block we didn't expect with a height too far ahead/behind 2018-03-15 11:58:19 +04:00
0c7e871ef0 [blockchain] replace timeoutsCh with more abstract errorsCh 2018-03-15 11:58:19 +04:00
87ce804b4a cmn.PanicSanity is deprecated 2018-03-15 11:58:19 +04:00
2a258a2c3f revert removing private peers from persistent 2018-03-15 11:55:30 +04:00
a40518c7da revert adding dial_peers's private flag 2018-03-15 11:55:30 +04:00
31deaa4a79 fix broken merge 2018-03-15 11:55:30 +04:00
736ea055a8 add a test for pex reactor 2018-03-15 11:55:30 +04:00
a39aec0bae rename private_peers to private_peer_ids to distinguish from peers 2018-03-15 11:55:30 +04:00
8bef3eb1f4 private peers
Refs #1126
2018-03-15 11:55:29 +04:00
244d88dfda Merge pull request #1314 from tendermint/add-go-amino-as-source-to-wire
Add go amino as source to wire
2018-03-15 01:10:38 +01:00
791f95bac3 Merge pull request #215 from tendermint/bucky/fees-gas
comment some fields in ResponseCheck/DeliverTx. closes #214
2018-03-14 18:47:26 +01:00
76e1dd41e4 fix Makefile's .PHONY 2018-03-14 21:42:35 +04:00
e39187a063 add go-amino as source for go-wire 2018-03-14 21:42:17 +04:00
f7afa3d91f comment some fields in ResponseCheck/DeliverTx. closes #214 2018-03-13 13:40:41 +01:00
121f0d3fcf types: compile time assert to, and document sort.Interface
Fixes #212

Declare the purpose of the Less, Len, Swap methods
so that readers can see why they are defined.

Raised by an auditor in their report, as it looked like a security
concern but actually sort.Interface requires those methods implemented.
2018-03-12 14:46:06 -07:00
cd2ba4aa7f Merge pull request #1286 from tendermint/feature/xla-priv-val-invert-dial
Invert privVal socket communication
2018-03-12 16:49:32 +01:00
73407e7cff add CODEOWNERS file 2018-03-12 12:37:19 +04:00
47b8a8864b remove any mention of glide 2018-03-12 12:34:43 +04:00
f499ce8713 update go-amino 2018-03-12 12:29:25 +04:00
0de19420f6 cmd/tendermint/commands/lite: add tcp scheme to address URLs (#1297)
Noticed while investigating
https://github.com/tendermint/tendermint/issues/970

As reported by @zramsay, we'd get the warning
from tendermint/rpc/lib because we were passing in
scheme-less addresses, so by default use "tcp".

Also by default, "node" (nodeAddr) has been set to:
  "tcp://localhost:46657"
instead of the bare:
  "localhost:46657"

This change is just to clean up such warnings as
they spuriously would spook users for a package "lite"
that claims to be secure.
2018-03-12 10:03:11 +04:00
b1cc688a61 encodeByteSlice uses uvarint for length instead of varint (#161) 2018-03-12 09:46:31 +04:00
f3000d0c84 Merge pull request #1292 from tendermint/1125-exp-backoff-for-ensure-peers
exponential backoff for addrs in the address book
2018-03-11 19:57:49 +01:00
fc5b0471d9 use time.Since 2018-03-11 14:13:34 +04:00
264bce4ddd skip dialing based on last time dialed 2018-03-11 14:00:49 +04:00
0f41570c80 fixes from bucky's review 2018-03-11 13:22:37 +04:00
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
f85c8896d9 test pex_reactor's dialPeer 2018-03-09 16:23:52 +04:00
f0d4f56327 refactor pex_reactor tests 2018-03-09 16:02:24 +04:00
3d5c05e4e6 Merge pull request #1293 from tendermint/update-template
add 2 more points to ISSUE_TEMPLATE
2018-03-09 15:15:34 +04:00
018da09f14 do not run complete test suite on make
bad dev experience
2018-03-08 18:55:14 +04:00
60a64af28d add 2 more points to ISSUE_TEMPLATE
Refs #1291
2018-03-08 18:53:11 +04:00
13a2013229 Testing refactor for Jenkins (#1098)
* de-mystify tests & run them in parallel (#1031)

* test optimization for jenkins (#1093)

* makefile cleanup

* tests: split fast and slow go tests, closes #1055

* pr comments

* restore circle conditions

* fix need_abci

* ...

* docker run: no :Z for circle?

* Remove cmd breaking comment
2018-03-08 18:52:38 +04:00
1941b5c769 fixes from @xla's review 2018-03-08 16:31:44 +04:00
21e2c41c6b exponential backoff for addrs in the address book
Refs #1125
2018-03-08 14:04:26 +04:00
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
2ce57a65ff Merge pull request #1284 from tendermint/feature/xla-follow-priv-val
Follow-ups to PrivValidator
2018-03-06 23:37:10 +01:00
2aa77025c3 Fix typo 2018-03-06 19:56:31 +01:00
8e1856a90a Use builtin panic 2018-03-06 19:56:31 +01:00
ca619c80b6 Stop privVal socket client on node shutdown 2018-03-06 19:56:30 +01:00
25ff699425 Improve method docs 2018-03-06 19:55:26 +01:00
879b4c0a2c Use common method to determine file existence 2018-03-06 19:55:26 +01:00
45d07a3d0b Merge pull request #1283 from tendermint/feature/xla-run-integration-release
Speed up CircleCI builds
2018-03-06 19:38:08 +01:00
788354d81e fix typo (#1285) 2018-03-06 20:44:13 +04:00
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
8d81a259c7 Merge pull request #1280 from tendermint/zach/explain-determinism
docs: add 'On Determinism'
2018-03-06 13:44:00 +04:00
066fe82a92 pubsub implements service.OnReset (#156) 2018-03-06 11:29:18 +04:00
3019761204 docs: add document 'On Determinism'
closes https://github.com/tendermint/abci/issues/56
2018-03-06 15:19:59 +08:00
6120a4c5e4 Merge pull request #1256 from tendermint/feature/more-priv-val
PrivValidatorAddr -> PrivValidatorListenAddr. Update ADR008
2018-03-05 21:48:16 +04:00
533ed2a876 adr: Amend decisions for PrivValidator 2018-03-05 17:38:05 +01:00
d4e4055d57 PrivValidatorAddr -> PrivValidatorListenAddr. Update ADR008 2018-03-05 17:11:43 +01:00
ee51ad8e29 Make RPC handler protocol agnostic (#1276) 2018-03-05 19:59:04 +04:00
bdd50c5f37 fix docs links & stuff (#1273)
* fix links in docs/spec etc, closes #1261

* spec: remove ref to non-existant repo

* codecov you weirdo
2018-03-05 16:30:36 +04:00
3d88612690 Merge pull request #1274 from tendermint/codecov
Codecov
2018-03-05 15:54:33 +04:00
630d54c95a return back threshold and ignore sections 2018-03-05 15:16:24 +04:00
d5361de300 Merge pull request #209 from zmanian/transitive_deps
Move the tmlibs dependency to develop
2018-03-05 12:12:56 +08:00
a38ad4e21b Move the tmlibs dependency to develop 2018-03-04 20:00:42 -08:00
a29163d85b Merge pull request #208 from tendermint/zramsay-patch-1
update spec formatting for docs
2018-03-05 10:48:26 +08:00
a183219659 update spec formatting for docs
this file is pulled in by tendermint's doc building
2018-03-05 10:46:51 +08:00
7579abd710 bring back dummy for backwards compatibility ... 2018-03-03 20:40:43 -05:00
5cb7e151fb persistent_peers fix 2018-03-03 05:06:53 -05:00
426938e2b4 persistent_peers changes 2018-03-03 05:06:03 -05:00
2429cfb2b7 p2p ids in config.toml 2018-03-02 23:14:42 -05:00
7d414cb7b2 node ID fix 2018-03-02 22:50:30 -05:00
e893f9bc1f basecoind service fix 2018-03-02 21:38:54 -05:00
71e133553e basecoind genesis fix 2018-03-02 21:22:28 -05:00
82106913f1 basecoin - basecoind rename 2018-03-02 20:36:37 -05:00
69e960da42 Merge pull request #71 from zmanian/dep
Switch to dep from glide for dependency resolution
2018-03-02 11:54:26 -05:00
5e07356264 use previously working new go-wire. not bleeding edge 2018-03-02 11:43:58 -05:00
e05ba9511a Merge branch 'master' into develop 2018-03-02 11:42:06 -05:00
3cedd8cf07 Merge pull request #1265 from tendermint/bucky/new-wire-api
Bucky/new wire api
2018-03-02 10:56:24 -05:00
929f326dd2 update dep 2018-03-02 10:59:10 -05:00
c3e19f3ea2 Merge pull request #73 from tendermint/develop-pre-wire
Develop pre wire
2018-03-02 10:40:13 -05:00
3a92931657 changelog, version, glide 2018-03-02 10:40:36 -05:00
ff8c648c23 types: uncomment some tests 2018-03-02 09:26:37 -05:00
8bceb5ce36 Merge pull request #1233 from tendermint/feature/xla-dial-seed-without-timeout
p2p: if we have no peers we should dial seeds right away
2018-03-02 09:07:01 -05:00
8f2703e8b2 Dial seeds directly without potential peers
In order to improve the operator experience we want the node to dial
seeds immediately if there are no peers to connect to. Until now the
routine responsible for ensuring peers are connected to would wait
a random amount of time up to 30s (if not configured otherwise).
2018-03-02 12:55:01 +01:00
c394eef7b8 types: TestValidatorSetVerifyCommit 2018-03-02 04:21:23 -05:00
f9921ae362 types/validator_set_test: move funcs around 2018-03-02 03:52:44 -05:00
fff0c6cd8e Add app_state from genesis file in InitChain message 2018-03-02 03:46:04 -05:00
6c6d01b51c Keybase refactor
Same as 788cc0a792 but without the new go-wire
2018-03-02 03:08:48 -05:00
59872bf335 update dep for new go-wire API 2018-03-02 02:28:53 -05:00
656854186c state: fix txResult issue with UnmarshalBinary into ptr 2018-03-02 02:28:17 -05:00
6596bff8ec types: bring back json.Marshal/Unmarshal for genesis/priv_val 2018-03-02 02:09:28 -05:00
eaafd9d61c state: builds 2018-03-02 01:51:27 -05:00
5378bfc5c7 types.SignBytes -> o.SignBytes 2018-03-02 01:50:17 -05:00
abeeeeb611 types: fix validator_set_test issue with UnmarshalBinary into ptr 2018-03-02 01:49:59 -05:00
ca3655a409 types: p2pID -> P2PID 2018-03-02 01:42:56 -05:00
6cf5100645 types: working on tests... 2018-03-02 01:34:23 -05:00
51628aea08 types: revert to old wire. builds 2018-03-02 01:33:38 -05:00
3395f5fb0e types: builds 2018-03-02 01:28:38 -05:00
d2cd079541 types: tests build 2018-03-02 01:28:21 -05:00
fc35e3b8c5 wire: no codec yet 2018-03-02 01:27:52 -05:00
085b4f5f2e add wire pkg with global codec 2018-03-02 01:26:38 -05:00
fd58645dd2 types: remove dep on p2p 2018-03-02 01:26:03 -05:00
200787ede2 types: update for new go-wire. WriteSignBytes -> SignBytes 2018-03-02 01:25:54 -05:00
9e0e00bef4 Merge branch 'master' into develop 2018-03-01 23:55:14 -05:00
9cdba04fe9 Merge pull request #1142 from tendermint/add_valid_value_mechanism
Add support for ValidBlock mechanism for the simplest case
2018-03-01 23:33:46 -05:00
c015e7a23d Merge pull request #206 from tendermint/bucky/fix-spec-and-changelog-for-v0.10.0
update CHANGELOG, README, spec for v0.10. Fixes #205
2018-03-01 19:50:05 -05:00
fb808a00d5 update CHANGELOG, README, spec for v0.10. Fixes #205 2018-03-01 19:52:01 -05:00
e92c87630d Merge pull request #1258 from tendermint/return-dummy-app
return back dummy & persistent_dummy as options for proxy_app
2018-03-01 15:14:07 +04:00
d4e93a6de3 Separate ValidBlock rule from unlocking rule 2018-03-01 11:42:22 +01:00
4670857c15 Add support for ValidBlock mechanism for the simplest case 2018-03-01 11:42:22 +01:00
e8d8aedd1f update changelog 2018-03-01 12:00:09 +04:00
87372da730 return back dummy & persistent_dummy as options for proxy_app 2018-03-01 11:54:08 +04:00
031be404cf Merge pull request #203 from tendermint/fix-dockerfile-develop
fix Dockerfile.develop
2018-03-01 14:43:43 +08:00
3b40b62d04 Merge pull request #1198 from tendermint/feature/genesisrawjson
SDK: AppOptions -> AppState
2018-03-01 00:55:13 +04:00
c41cbf2a07 add missing golang.org/x/net/netutil package 2018-02-28 23:44:18 +04:00
1a3faa8db1 add app_state field to docs 2018-02-28 23:44:10 +04:00
4ce79baac7 rename app_options to app_state in genesis_test 2018-02-28 23:44:10 +04:00
056b70b4ce update changelog 2018-02-28 23:44:10 +04:00
4806b3b9bf AppOptions -> AppStateJSON 2018-02-28 23:44:10 +04:00
2a8f0000b2 Merge pull request #1250 from tendermint/ditch-glide
Ditch glide
2018-02-28 09:52:12 -05:00
dd2d846c02 Merge pull request #1203 from tendermint/feature/priv_val
types/priv_validator package
2018-02-28 09:27:03 -05:00
2ae87eee4e style fixes from @xla 2018-02-28 12:24:26 +04:00
4be23027ed adding recipe for minimalistic deps analysis (#1218) 2018-02-28 11:23:31 +04:00
c19bbb2403 switch back to parsing .lock file 2018-02-28 11:15:40 +04:00
edb871f514 Merge pull request #1237 from tendermint/feature/priv_val_socket_client
privVal: Integrate socket client
2018-02-28 00:57:51 -05:00
9c5937df96 Merge pull request #1247 from tendermint/feature/xla-integrate-codecov
Integrate CodeCov as change acceptance stage
2018-02-28 00:38:37 -05:00
be6082df8e Merge pull request #1043 from tendermint/lite-binary-vs-linear-search+optimize-insertions
lite: memStoreProvider GetHeightBinarySearch method + fix ValKeys.signHeaders
2018-02-28 00:33:59 -05:00
0192e101ce Quick, temporary fix for basecoin rename 2018-02-27 18:14:09 -05:00
66354de219 cd into tendermint before calling dep status 2018-02-27 18:47:53 +04:00
458a40f74e Integrate CodeCov as change acceptance stage
As a rough measure to keep quality up we want to integrate our code
coverage tooling to the point where it is required for changes to be
merged.

Example taken from https://github.com/cosmos/voyager/blob/develop/codecov.yaml
2018-02-27 15:39:28 +01:00
0821384ac6 update abci version 2018-02-27 18:34:32 +04:00
e01650f21d fix Dockerfile.develop 2018-02-27 18:02:40 +04:00
8dd06cf197 ditch glide 2018-02-27 18:02:40 +04:00
93732b4c1e remove old network tests
Refs #1249
2018-02-27 18:02:25 +04:00
2cc63069c6 rename dummy to kvstore (#1223)
* remove accidental binary

* docs: s/Dummy&dummy/KVStore&kvstore/g

* glide update to abci

* update abci import paths

* dummy begone, hello kvstore

* RequestInitChain needs genesisBytes

* glide update
2018-02-27 18:01:10 +04:00
345a5a5a34 remove glide 2018-02-27 17:54:25 +04:00
c57ab8724e fix Dockerfile.develop 2018-02-27 17:54:25 +04:00
3d5f0a8b94 Switch dependency management to dep from glide (#202) 2018-02-27 17:24:09 +04:00
192fb2aabc Fix string formatting error for go1.10 (#201) 2018-02-27 16:03:21 +04:00
26f2ab65f8 Switch to dep from glide (#155) 2018-02-27 16:01:49 +04:00
6270ecef8c Switch to dep from glide for dependency management (#1243)
* Switch to dep from glide for dependency management

* Update CI dockerfile to use dep instead of glide

* Wrong file extension

* Run 'dep ensure' after copying code

* Install glide to handle abci dependencies in testing

* Use `dep ensure -vendor-only` to setup vendor directory before installing source code on ci
2018-02-27 15:59:50 +04:00
9293ae76bf p2p: introduce peerConn to simplify peer creation (#1226)
* expose AuthEnc in the P2P config

if AuthEnc is true, dialed peers must have a node ID in the address and
it must match the persistent pubkey from the secret handshake.

Refs #1157

* fixes after my own review

* fix docs

* fix build failure

```
p2p/pex/pex_reactor_test.go:288:88: cannot use seed.NodeInfo().NetAddress() (type *p2p.NetAddress) as type string in array or slice literal
```

* p2p: introduce peerConn to simplify peer creation

* Introduce `peerConn` containing the known fields of `peer`
* `peer` only created in `sw.addPeer` once handshake is complete and NodeInfo is checked
* Eliminates some mutable variables and makes the code flow better
* Simplifies the `newXxxPeer` funcs
* Use ID instead of PubKey where possible.
        * SetPubKeyFilter -> SetIDFilter
        * nodeInfo.Validate takes ID
        * remove peer.PubKey()

* persistent node ids

* fixes from review

* test: use ip_plus_id.sh more

* fix invalid memory panic during fast_sync test

```
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: panic: runtime error: invalid memory address or nil pointer dereference
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x98dd3e]
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]:
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: goroutine 3432 [running]:
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.newOutboundPeerConn(0xc423fd1380, 0xc420933e00, 0x1, 0x1239a60, 0
xc420128c40, 0x2, 0x42caf6, 0xc42001f300, 0xc422831d98, 0xc4227951c0, ...)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/peer.go:123 +0x31e
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.(*Switch).addOutboundPeerWithConfig(0xc4200ad040, 0xc423fd1380, 0
xc420933e00, 0xc423f48801, 0x28, 0x2)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:455 +0x12b
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.(*Switch).DialPeerWithAddress(0xc4200ad040, 0xc423fd1380, 0x1, 0x
0, 0x0)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:371 +0xdc
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.(*Switch).reconnectToPeer(0xc4200ad040, 0x123e000, 0xc42007bb00)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:290 +0x25f
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: created by github.com/tendermint/tendermint/p2p.(*Switch).StopPeerForError
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:256 +0x1b7
```
2018-02-27 15:54:40 +04:00
3570c2eb9e Fix test in makefile 2018-02-25 09:41:32 -08:00
b6d029050b Switch to dep from glide for dependency resolution 2018-02-25 08:48:53 -08:00
a7c9de49c0 unsafe reset fix 2018-02-23 08:44:39 -05:00
74d3f7e1fd Integrate private validator socket client
Following ADDR 008 the node will connect to an external
process to handle signing requests. Operation of the external process is
left to the user.

* introduce alias for PrivValidator interface on socket client
* integrate socket client in node
* structure tests
* remove unnecessary flag
2018-02-23 13:58:22 +01:00
2fd023a239 remove accidental binary 2018-02-21 00:04:53 -05:00
6d47f4afe2 Merge pull request #197 from tendermint/sed-dummy-kvstore
rename dummy to kvstore
2018-02-21 00:03:44 -05:00
c8a2bdf78b Merge pull request #1225 from tendermint/release-v0.16.0
Release v0.16.0
2018-02-20 23:23:48 -05:00
3cd604562c RequestInitChain needs genesisBytes 2018-02-21 03:43:47 +00:00
7c6c0dba53 glide update 2018-02-21 03:32:02 +00:00
68592f4d8e Merge pull request #198 from tendermint/develop
v0.10.0
2018-02-20 22:10:11 -05:00
9b6088cc26 glide and changelog 2018-02-20 22:06:27 -05:00
1b9b5652a1 changelog date 2018-02-20 22:00:20 -05:00
3e79f9e198 Merge pull request #154 from tendermint/develop
v0.7.0 (aka "sdk2")
2018-02-20 21:55:52 -05:00
77cbccdd55 show_validator fix 2018-02-19 21:41:47 -05:00
de4022dcce config.toml extensions 2018-02-19 20:16:14 -05:00
e3d403e6b7 Re-added tendermint binary installation for show_validator command (temporarily) 2018-02-19 20:05:43 -05:00
e31150398e Removed unused files, removed tendermint package dependency 2018-02-19 19:49:26 -05:00
1eb7a8a2cc Removed trackomatron, updated config to tendermint 0.16 (config dir) and changed services to in-process 2018-02-19 19:38:29 -05:00
fe7e26eecf changelog and version bump 2018-02-19 17:44:49 -05:00
ec2f3f49ef changelog date and version 2018-02-19 17:35:46 -05:00
8bba7c64bc update version and changelog [ci skip] 2018-02-19 17:33:48 -05:00
c6163bdab2 version bump and changelog 2018-02-19 17:05:36 -05:00
ffd2483e67 Merge pull request #1204 from tendermint/feature/priv_val_sockets
Feature/priv val sockets
2018-02-19 16:06:07 -05:00
831e10f15d finish the job, dummy 2018-02-19 20:43:36 +00:00
594db86069 rename dummy*.go files to kvstore*.go 2018-02-19 20:40:33 +00:00
a3362ccf35 s/Dummy/KVStore/g 2018-02-19 20:38:22 +00:00
0467de890a Merge pull request #1202 from tendermint/restore-mempool-memory-leak-tests
restore mempool memory leak tests
2018-02-19 15:36:19 -05:00
0ae0155cba restore mempool memory leak tests 2018-02-19 15:34:33 -05:00
f4feb7703b fix appHash log. closes #1207 2018-02-19 15:32:09 -05:00
a14aab67de Integrate PrivValidator socket server 2018-02-19 19:20:01 +01:00
c960c52756 Merge pull request #193 from tendermint/feature/init-chain-app-state
types: RequestInitChain.AppStateBytes
2018-02-17 12:51:05 -05:00
a6be687088 types: RequestInitChain.AppStateBytes 2018-02-16 19:49:33 -05:00
b1e29d22f6 Merge pull request #192 from tendermint/feature/fix_glide_yaml
Pin tmlibs to develop
2018-02-16 19:37:09 -05:00
7a6a079afe Pin tmlibs to develop 2018-02-15 12:28:05 +01:00
a0f652dc2e Merge pull request #151 from tendermint/fix/nit
minor nit
2018-02-14 11:57:38 -05:00
106d804357 Correct config description 2018-02-14 02:51:05 +01:00
a1020307a0 Clean up flags 2018-02-14 02:41:16 +01:00
6c70b4ce05 Apply connection deadline consistently 2018-02-14 02:25:17 +01:00
2a292efb56 Return error for all PrivValidator methoods
As calls to the private validator can involve side-effects like network
communication it is desirable for all methods returning an error to not
break the control flow of the caller.

* adjust PrivValidator interface
2018-02-13 19:34:50 +01:00
82b1a34a36 Separate connect logic
* break out connect functionality out of OnStart
* introduce max retries
2018-02-13 19:08:21 +01:00
0e68638af3 update glide abci/tmlibs to develop 2018-02-12 19:13:36 -05:00
737c30c19d minor nit 2018-02-12 19:12:24 -05:00
d3e276bf80 Merge pull request #1209 from tendermint/1205-fixes-for-p2p-memory-leak-and-pong
Fixes for p2p memory leak and pong
2018-02-12 19:04:31 -05:00
bf70f5e273 Merge pull request #191 from tendermint/tm-1205-quit-method-added
Quit method was added to Service/BaseService
2018-02-12 19:04:04 -05:00
c858b3ba78 Merge pull request #150 from tendermint/tm-1205-add-quit-method-to-service
add Quit method to Service interface
2018-02-12 18:39:26 -05:00
9bd1f28b8d Minor package changes 2018-02-12 09:41:54 -05:00
fc585bcdec do not block when writing to pongTimeoutCh
Refs #1205
2018-02-12 17:04:07 +04:00
2a24ae90c1 fixes from Jae's review
1. remove pointer
2. add Quit() method to Service interface
2018-02-12 14:32:09 +04:00
5913ae8960 Quit method was added to Service/BaseService
Refs https://github.com/tendermint/tendermint/issues/1205
2018-02-12 12:22:32 +04:00
a57340ffb5 add Quit method to Service interface
remove deprecated QuitService
2018-02-12 11:40:42 +04:00
8da2a6a147 types/priv_validator: fixes for latest p2p and cmn 2018-02-09 17:24:30 -05:00
7d71e702d8 Integrate privVal client with node secret 2018-02-09 16:54:43 -05:00
38d18ca11a Harden tests 2018-02-09 16:53:17 -05:00
32d9563a15 Format and consolidate 2018-02-09 16:53:17 -05:00
18f7e52562 Use secret connection 2018-02-09 16:53:17 -05:00
fec541373d Correct server protocol 2018-02-09 16:53:17 -05:00
ff600e9aa0 wip: check error of wire read 2018-02-09 16:53:17 -05:00
a49357b19e wip: Avoid underscore in var name 2018-02-09 16:53:17 -05:00
4b997c29ee wip: fix nil pointer deference 2018-02-09 16:53:17 -05:00
d321839669 wip: fix code block in ADR 2018-02-09 16:53:17 -05:00
c27fda09dd wip: Comment types
* add comments to all public types
* fix comments to adhere to comment standards
2018-02-09 16:53:15 -05:00
23eb84db35 wip: priv val via sockets 2018-02-09 16:52:58 -05:00
bef91ea7fe adr-008-priv-validator 2018-02-09 16:52:05 -05:00
459633fb4c types/priv_validator 2018-02-09 16:38:23 -05:00
f1c8489270 Merge pull request #1201 from tendermint/1022-do-not-enforce-1/3-val-changes
do not enforce 1/3 validator power change
2018-02-09 16:15:38 -05:00
2d10c8f15b Merge pull request #1095 from tendermint/804-p2p-issues
[p2p] Pong Timeout
2018-02-09 14:38:24 -05:00
106cdb74e5 do not enforce 1/3 validator power change
leave it to the app

Refs #1022
2018-02-09 23:30:04 +04:00
22b038810a do not block in recvRoutine 2018-02-09 23:03:26 +04:00
45750e1b29 fix race by sending signal instead of stopping pongTimer 2018-02-09 21:32:29 +04:00
26419fba28 refactor code plus add one more test
* extract stopPongTimer method
* TestMConnectionMultiplePings
2018-02-09 21:32:29 +04:00
ac0123d249 drain pongTimeoutCh and pongTimer's channel to prevent leaks 2018-02-09 21:32:29 +04:00
f4ff66de30 rewrite pong timer to use time.AfterFunc 2018-02-09 21:32:29 +04:00
747b73cb95 fix merge conflicts 2018-02-09 21:32:29 +04:00
161e100a24 close return channel when we're done
Benchmark results:

```
BenchmarkSwitchBroadcast-2         30000             71275 ns/op
--- BENCH: BenchmarkSwitchBroadcast-2
        switch_test.go:339: success: 1, failure: 0
        switch_test.go:339: success: 100, failure: 0
        switch_test.go:339: success: 10000, failure: 0
        switch_test.go:339: success: 30000, failure: 0
```
2018-02-09 21:32:29 +04:00
3ae738f453 increase timeouts 2018-02-09 21:32:29 +04:00
d14d4a2527 remove TryBroadcast 2018-02-09 21:32:29 +04:00
860da464df remove weird concurrency testing 2018-02-09 21:32:28 +04:00
4e2000abfe control order by sending msgs from one goroutine 2018-02-09 21:32:28 +04:00
5834a59816 read ping 2018-02-09 21:32:28 +04:00
b28b76ddf7 rename pingTimeout to pingInterval, pongTimer is now time.Timer 2018-02-09 21:32:28 +04:00
91e4f4b786 ping/pong timeout in config 2018-02-09 21:32:28 +04:00
9b554fb2c4 switch test modification 2018-02-09 21:32:28 +04:00
f97ead4f5f prep for merge 2018-02-09 21:32:28 +04:00
5af22d6ee6 remove SwitchEventNewPeer, SwitchEventDonePeer 2018-02-09 21:32:28 +04:00
1d16df6a92 add test, TrySend in broadcast 2018-02-09 21:32:27 +04:00
e7bc946760 Merge pull request #1200 from tendermint/update-deps
Update tmlibs & protobuf deps
2018-02-09 11:00:43 -05:00
cf1e1f5899 Merge pull request #1194 from tendermint/1177-semantics-of-currate-low-msg
improve "curRate too low" message
2018-02-09 11:00:09 -05:00
2f8372d629 update protobuf 2018-02-09 13:58:36 +04:00
d84e4effce update tmlibs 2018-02-09 13:47:51 +04:00
52ce4c20f8 Fix RepeatTimer memory leak (#137)
fix RepeatTimer memory leak (Refs #137)

* test case

* drain channels on reset

Leaking memory:
```
leaktest.go:144: leaktest: leaked goroutine: goroutine 116 [chan send]:
        github.com/tendermint/tmlibs/common.(*RepeatTimer).fireRoutine(0xc42006a410, 0xc4203403c0, 0xc42031b2c0)
                /go/src/github.com/tendermint/tmlibs/common/repeat_timer.go:160 +0x6e
        created by github.com/tendermint/tmlibs/common.(*RepeatTimer).reset
                /go/src/github.com/tendermint/tmlibs/common/repeat_timer.go:196 +0xe9
```

The alternative solution could be draining channels on the client side.

* add one more select instead of draining

thanks to Jae
2018-02-09 13:31:32 +04:00
0c1b91b762 revert back curRate != 0 2018-02-09 13:02:44 +04:00
c8990d06d9 remove curRate != 0 2018-02-09 12:01:13 +04:00
b0a55882b2 lower the minRecvRate
See https://github.com/tendermint/tendermint/issues/1177#issuecomment-363720118
2018-02-09 12:01:12 +04:00
d1fa44e816 improve "curRate too low" message
Refs #1177

Note on labels:
KB - 1024
kB - 1000
https://ux.stackexchange.com/questions/13815/files-size-units-kib-vs-kb-vs-kb
2018-02-09 12:01:12 +04:00
199ea40980 Merge pull request #1196 from tendermint/1149-TestReactorValidatorSetChanges-fails-non-deterministically
WIP: TestReactorValidatorSetChanges fails non deterministically
2018-02-09 01:51:17 -05:00
66fc476e1e Merge pull request #1173 from tendermint/memory-leak-in-reconnect-to-peer-2
fix memory leak in mempool reactor
2018-02-09 01:50:34 -05:00
82ab92da9a Merge pull request #139 from tendermint/expose-channel-on-clist
add waitCh as an alternative to waitGroup
2018-02-09 01:18:39 -05:00
6b347200d9 Merge pull request #1197 from tendermint/1155-seed-mode-flag
add seed_mode flag (`--p2p.seed_mode`)
2018-02-08 17:48:39 -05:00
8a908a7cf9 Merge pull request #1193 from tendermint/return-back-cmd-logging
With must be called on log.filter, otherwise "main" entries get filtered
2018-02-08 16:30:29 -05:00
0bcc11c9bc Merge pull request #1191 from tendermint/event-buffer-slice-clearing-on-flush
types: TxEventBuffer.Flush now uses capacity preserving slice clearing idiom
2018-02-08 16:28:47 -05:00
35bb398b1f Merge pull request #147 from tendermint/reduce-bitArray-fragility
common/BitArray: reduce fragility with methods
2018-02-08 15:31:30 -05:00
0247a21a93 Merge pull request #1086 from tendermint/966-deterministic-tooling-for-releases
Distribution improvements (freeze glide version + get rid of gox)
2018-02-08 15:26:11 -05:00
cf1f483526 add seed_mode flag (--p2p.seed_mode) 2018-02-08 17:20:55 +04:00
3f9aa8d8fa document that msgBytes in p2p/connection change 2018-02-08 13:25:26 +04:00
d6d1f8512d do not reset pingTimer
don't bother with this "only ping when we havent heard from them". lets
just always ping every peer from the sendRoutine every 10s no matter
what. if they dont pong within pongTimeout, disconnect :)
2018-02-08 13:08:11 +04:00
2b2c233977 write docs for Reactor interface 2018-02-08 13:07:40 +04:00
7640e6a29f add some p2p TODOs 2018-02-08 12:46:04 +04:00
ffb806f2b2 Updated go version to 1.9.4 on build 2018-02-07 16:22:51 -05:00
b0ca8a0872 With must be called on log.filter, otherwise "main" entries get filtered
Also, we should allow "main" module to log INFO messages like

```
I[02-07|07:57:25.074] Found private validator                      module=main path=/home/vagrant/.tendermint/config/priv_validator.json
I[02-07|07:57:25.076] Found genesis file                           module=main path=/home/vagrant/.tendermint/config/genesis.json
```

Refs https://github.com/cosmos/gaia/issues/118

**BEFORE**:
```
$ tendermint init

```

**AFTER**:
```
$ tendermint init
I[02-07|07:57:25.074] Found private validator                      module=main path=/home/vagrant/.tendermint/config/priv_validator.json
I[02-07|07:57:25.076] Found genesis file                           module=main path=/home/vagrant/.tendermint/config/genesis.json
```
2018-02-07 12:08:13 +04:00
9e767771fc Merge pull request #1188 from ltfschoen/patch-1
Update getting-started.rst with Python 3 example
2018-02-06 12:53:47 -05:00
763dc21393 common/BitArray: reduce fragility with methods
Fixes https://github.com/tendermint/tmlibs/issues/145
Fixes https://github.com/tendermint/tmlibs/issues/146

The code in here has been fragile when it comes to nil
but these edge cases were never tested, although they've
showed up in the wild and were only noticed because
the reporter actually read the logs otherwise
we'd have never known.

This changes covers some of these cases and adds some tests.
2018-02-06 01:12:24 -08:00
6c8d7a8c19 deterministic tooling for releases
get rid of gox

build target builds inside docker, dev-build - locally

Revert "build target builds inside docker, dev-build - locally"

This reverts commit 8ba89d5e8c5668e3839ff49952a9166d1158f6e8.

add build tags to make build/build_race/install

use tendermint's fork of glide instead of tar.gz

remove TMHOME unused var + set length for git hash

get rid of GOTOOLS_CHECK

fixes after review

zip

needed for distribution
2018-02-06 12:46:13 +04:00
15ef57c6d0 types: TxEventBuffer.Flush now uses capacity preserving slice clearing idiom
Fixes https://github.com/tendermint/tendermint/issues/1189

For every TxEventBuffer.Flush() invoking, we were invoking
a:
  b.events = make([]EventDataTx, 0, b.capacity)
whose intention is to innocently clear the events slice but
maintain the underlying capacity.

However, unfortunately this is memory and garbage collection intensive
which is linear in the number of events added. If an attack had access
to our code somehow, invoking .Flush() in tight loops would be a sure
way to cause huge GC pressure, and say if they added about 1e9
events maliciously, every Flush() would take at least 3.2seconds
which is enough to now control our application.

The new using of the capacity preserving slice clearing idiom
takes a constant time regardless of the number of elements with zero
allocations so we are killing many birds with one stone i.e
  b.events = b.events[:0]

For benchmarking results, please see
https://gist.github.com/odeke-em/532c14ab67d71c9c0b95518a7a526058
for a reference on how things can get out of hand easily.
2018-02-05 23:34:15 -08:00
f37c502fd8 Update getting-started.rst with Python 3 example 2018-02-06 16:00:51 +11:00
945b0e6eca cleanup glide.yaml 2018-02-05 22:53:44 +04:00
84a0a1987c comment out tests for now
https://github.com/tendermint/tendermint/pull/1173#issuecomment-363173047
2018-02-05 22:26:14 +04:00
11b68f1934 rewrite broadcastTxRoutine to use channels
https://play.golang.org/p/gN21yO9IRs3

```
func waitWithCancel(f func() *clist.CElement, ctx context.Context) *clist.CElement {
	el := make(chan *clist.CElement, 1)
	select {
	case el <- f():
```
will just run f() blockingly, so this doesn't change much in terms of behavior.
2018-02-05 16:36:26 +04:00
202d9a2c0c fix memory leak in mempool reactor
Leaking goroutine:
```
114 @ 0x42f2bc 0x42f3ae 0x440794 0x4403b9 0x468002 0x9fe32d 0x9ff78f 0xa025ed 0x45e571
```

Explanation:
it blocks on an empty clist forever. so unless theres txs coming in,
this go routine will just sit there, holding onto the peer too.
if we're constantly reconnecting to some peer, old instances are not
garbage collected, leading to memory leak.

Fixes https://github.com/cosmos/gaia/issues/108
Previous attempt https://github.com/tendermint/tendermint/pull/1156
2018-02-05 13:52:18 +04:00
19e818fdf7 Merge pull request #142 from tendermint/ishex-fragility
common: IsHex should be able to handle 0X prefixed strings
2018-02-05 13:14:53 +04:00
91b41ddd59 add waitCh as an alternative to waitGroup
new methods:
 - [CList] WaitChan()
 - [CElement] NextWaitChan()
 - [CElement] PrevWaitChan()

Refs https://github.com/tendermint/tendermint/pull/1173
2018-02-05 11:36:36 +04:00
bf84e82577 Merge pull request #1184 from tendermint/sdk2-tmlibs-abci
Updates for tmlibs and abci (sdk2)
2018-02-03 10:45:54 -05:00
abca9a2d61 woops - bring back glide.lock file 2018-02-03 03:59:16 -05:00
d34286c421 minor fixes - tests pass 2018-02-03 03:54:49 -05:00
bb2bdbc0e1 add missing element (tag.Value) to keyForTag
encoded as %s. not sure this will work with raw bytes
2018-02-03 03:52:25 -05:00
e7747f7d66 it compiles 2018-02-03 03:52:17 -05:00
7a5060dc52 replace data.Bytes with cmn.HexBytes 2018-02-03 03:47:01 -05:00
426379dc47 remove use of wire/nowriter 2018-02-03 03:39:14 -05:00
cd0fd06b0d update for sdk2 libs. need to fix kv test
NOTE we only updating for tmlibs and abci
2018-02-03 03:35:02 -05:00
4e3488c677 update types 2018-02-03 03:23:10 -05:00
061ad355bb update glide 2018-02-03 03:22:56 -05:00
2679b7554b lite: comment out iavl code - TODO #1183 2018-02-03 03:02:49 -05:00
5a4f56056e Merge pull request #189 from tendermint/no-wire-crypto
remove go-wire and go-crypto deps
2018-02-03 02:55:22 -05:00
1148027baf remove go-wire and go-crypto deps 2018-02-03 02:39:34 -05:00
21dd648732 Merge pull request #187 from tendermint/no-iavl
Remove IAVL dependency
2018-02-03 02:26:26 -05:00
baea45177d example/dummy: remove iavl dep - just use raw db 2018-02-03 02:02:40 -05:00
deaaf014d8 Merge pull request #141 from tendermint/no-wire
merkle: remove go-wire dep by copying EncodeByteSlice
2018-02-03 01:57:27 -05:00
951333ecb0 common: IsHex should be able to handle 0X prefixed strings
IsHex should also successfully decode strings prefixed with
0X instead of only 0x strings.

Also add tests generally for IsHex.
2018-02-02 23:41:24 -07:00
d6d97889f2 merkle: remove go-wire dep by copying EncodeByteSlice 2018-02-03 01:29:39 -05:00
c617737e03 Merge pull request #184 from tendermint/sdk2
update for go-wire sdk2
2018-02-03 00:22:50 -05:00
4450a20bde types: check bufio.Reader 2018-02-03 00:24:48 -05:00
d2845d923b add more versions to glide 2018-02-03 00:14:15 -05:00
700792bc10 update glide 2018-02-03 00:08:39 -05:00
11d383f1c7 update for go-wire sdk2 2018-02-02 23:56:19 -05:00
4fc3055dbd update glide again 2018-02-02 23:50:24 -05:00
1d7fc78ea1 update glide 2018-02-02 23:49:14 -05:00
5a94049dbc update glide again 2018-02-02 23:42:22 -05:00
9e897ab8b0 update glide 2018-02-02 23:34:07 -05:00
690d6c6070 cli: WriteDemoConfig -> WriteConfigVals 2018-02-02 23:05:28 -05:00
4542cc5a71 Merge pull request #64 from tendermint/sdk2
Merge sdk2 into develop
2018-02-02 22:48:01 -05:00
027c37281d Merge pull request #123 from tendermint/sdk2
Merge sdk2 into develop
2018-02-02 22:32:33 -05:00
1b5176003a DbBackend -> DBBackend 2018-02-02 22:31:17 -05:00
45b71f7d11 Bump tmlibs commit. Needs to be changed to develop as soon as tmlibs PR is merged 2018-02-02 18:51:41 +01:00
cbc63518e5 Export DbBackendType in order to fix IAVL tests 2018-02-02 18:50:24 +01:00
0391e499fb Clean up glide.yaml 2018-02-02 18:31:25 +01:00
2e76546223 Clean up glide.yaml 2018-02-02 18:09:48 +01:00
6b2409f714 Update go-wire to develop 2018-02-02 14:12:29 +01:00
95b53c80e1 Merge pull request #140 from tendermint/sdk2-hashers-and-simple-map
Sdk2 hashers and simple map
2018-02-02 14:15:56 +04:00
9ccfe161ad lowercase memDB type key 2018-02-02 14:08:05 +04:00
f6dbe9ba05 Refactor string -> dbBackendType 2018-02-02 14:08:05 +04:00
b95cac5f4f Remove unnecessary Byteser interface 2018-02-02 14:08:05 +04:00
c75298e359 Update SimpleMap to hash both keys and values for benefit; Hashable is Hasher; Don't assume go-wire 2018-02-02 14:08:05 +04:00
580c3db8f9 Hashable -> Hasher; SimpleMap upgrade; No "SimpleHashFromBinary" (#128)
* Update SimpleMap to hash both keys and values for benefit; Hashable is Hasher; Don't assume go-wire
2018-02-02 12:51:30 +04:00
7ef6d4b813 Glide update 2018-02-02 12:51:30 +04:00
ff230682d1 Fix logical time (#122)
Should fix a nondeterministic bug so...
2018-02-02 12:51:30 +04:00
cfbb9338bd use go-wire sdk2 2018-02-02 12:51:30 +04:00
6637c202bf Revert "Update to use tmlibs sdk2"
This reverts commit ae58af0be534a5c344896461b97a6490d428deb4.
Breaks the tests.
2018-02-02 12:51:30 +04:00
4e2a275a67 Update to use tmlibs sdk2 2018-02-02 12:51:30 +04:00
bcd8d403dc Remove encoding from common cli 2018-02-02 12:51:29 +04:00
62c9cad484 Merge pull request #1180 from tendermint/1146-add-BFT-time-spec
Add BFT time spec
2018-02-01 16:38:05 -05:00
4cbdbbaac9 Add BFT time spec 2018-02-01 15:22:08 +01:00
9ed296ae71 GetByHeight switches between linear & binary search on >=50 items
* GetByHeight will now switch to using binary search once
we have  >=50 items.
* Feedback from @ebuchman to catch a missed spot where
we forgot about lazy sorting that the original code
assumed would always have sorted commits by height.
Added a lazy sorting routine here too.
A test as well to ensure that we always get the properly
sorted and last value.
2018-01-31 20:53:03 -07:00
e8d0960cef nolint 2018-01-31 20:52:12 -07:00
2023115ff8 lite: TestCacheGetsBestHeight with GetByHeight and GetByHeightBinarySearch
Addressing PR review requests from @melekes and @ebuchman to
add a test that checks that the heights returned from both are
the same thus providing a perceptible equivalence of the code
linear range search vs binary range search code.
2018-01-31 20:52:12 -07:00
7790ae9e6f Fix spelling mistake 2018-01-31 20:52:12 -07:00
206da7a1b8 lite: < len(v) in for loop check, as per @melekes' recommendation
Also lazily load the commits to only be run once when
the benchmarks are activated, lest it slows down all the tests
2018-01-31 20:52:11 -07:00
14eaba9ec3 lite: memStoreProvider GetHeightBinarySearch method + fix ValKeys.signHeaders
Updates #1021

* Implement a GetHeightBinarySearch method that looks for
the height using the binary search algorithm guaranteeing
worst case iteration time of O(log2(n))
whereas
worst case iteration time of O(n) for the current linear search

So if n we had 500 commits stored by height and sorted, to
trigger the worst case scenario for each, pass in
the most negative height you can find e.g. -1
Linear search: 500 iterations
Binary search: 9 iterations

with n=1000, qHeight = -1
Linear search: 1000 iterations
Binary search: 10 iterations

with n=1e6, qHeight = -1
Linear search: 1e6 iterations
Binary search: 20 iterations

Of course there are realistic expectations e.g. a max of
commits that may be saved so linear search might be useful
for very small size set because it has less preparing overhead
and only ~2 types of comparisons, but nonetheless binary search
shines as soon as we start to hit say 50 commits to search from
as you can see below:

```shell
$ go test -v -run=^$ -bench=MemStore
goos: darwin
goarch: amd64
pkg: github.com/tendermint/tendermint/lite
BenchmarkMemStoreProviderGetByHeightLinearSearch5-4     300000        6491 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch50-4      200000       12064 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch100-4      50000       32987 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch500-4       5000      395521 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch1000-4	       500     2940724 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch5-4     300000        6281 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch50-4      200000       10117 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch100-4     100000       18447 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch500-4      20000       89029 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch1000-4	      5000      265719 ns/op      1600 B/op       15 allocs/op
PASS
ok    github.com/tendermint/tendermint/lite 86.614s
$ go test -v -run=^$ -bench=MemStore
goos: darwin
goarch: amd64
pkg: github.com/tendermint/tendermint/lite
BenchmarkMemStoreProviderGetByHeightLinearSearch5-4     300000        6779 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch50-4      100000       12980 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch100-4      30000       43598 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch500-4       5000      377462 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightLinearSearch1000-4	       500     3278122 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch5-4     300000        7084 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch50-4      200000        9852 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch100-4     100000       19020 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch500-4      20000       99463 ns/op      1600 B/op       15 allocs/op
BenchmarkMemStoreProviderGetByHeightBinarySearch1000-4	      5000      259293 ns/op      1600 B/op       15 allocs/op
PASS
ok    github.com/tendermint/tendermint/lite 86.204s
```

which gives
```shell
$ benchstat old.txt new.txt
name                               old time/op    new time/op    delta
MemStoreProviderGetByHeight5-4       6.63µs ± 2%    6.68µs ± 6%   ~             (p=1.000 n=2+2)
MemStoreProviderGetByHeight50-4      12.5µs ± 4%    10.0µs ± 1%   ~             (p=0.333 n=2+2)
MemStoreProviderGetByHeight100-4     38.3µs ±14%    18.7µs ± 2%   ~             (p=0.333 n=2+2)
MemStoreProviderGetByHeight500-4      386µs ± 2%      94µs ± 6%   ~             (p=0.333 n=2+2)
MemStoreProviderGetByHeight1000-4    3.11ms ± 5%    0.26ms ± 1%   ~             (p=0.333 n=2+2)
```

If need be we can make a hybrid algorithm that switches between the
linear and binary search depending on the number of items.
This is reminiscent of Python's TimSort algorithm.
2018-01-31 20:52:11 -07:00
2919bc3f7f Merge pull request #1178 from tendermint/nice-err-msg
improve error message
2018-01-31 21:32:58 -05:00
1c01671ec6 improve vague error msg, closes #1158 2018-01-31 17:44:19 +00:00
af30cef574 Coin changes for Peng's faucet 2018-01-30 09:45:05 -05:00
13f009bf68 Merge pull request #136 from tendermint/fix-bitArray-nil-update
common: fix BitArray.Update to avoid nil dereference
2018-01-29 17:17:18 -05:00
85be26c675 common: BitArray: feedback from @adrianbrink to simplify tests 2018-01-28 22:02:51 -07:00
73a4cfb06a moer basecoin build fixes 2018-01-28 22:49:44 -05:00
c6190b3859 basecoin build typo fix 2018-01-28 22:37:58 -05:00
1f3e1eec83 basecoin build copy fix 2018-01-28 21:14:50 -05:00
b3a14da617 basecoin build fix 2018-01-28 21:11:37 -05:00
84afef20f5 common: fix BitArray.Update to avoid nil dereference
Update previously only checked that the receiver was
non-nil but didn't check that the input parameter to update
"o" was non-nil causing a nil dereference in cases such as
fe632ea32a/consensus/reactor.go (L306)

Fixes https://github.com/tendermint/tendermint/issues/1169
2018-01-28 10:39:42 -07:00
fe632ea32a spec: minor fixes 2018-01-26 17:26:33 -05:00
5b368252ac spec: more fixes 2018-01-26 17:26:33 -05:00
8cca953590 spec: remove notes, see #1152 2018-01-26 17:26:33 -05:00
4b4a2029c4 spec: typos & other fixes 2018-01-26 17:26:33 -05:00
6aa85357b6 Merge pull request #1160 from shapeshed/patch-1
Fix documentation typos
2018-01-26 17:17:43 -05:00
eae62ec09b Merge branch 'develop' into patch-1 2018-01-26 17:17:28 -05:00
18d96266bc Merge pull request #1140 from tendermint/feature/vagrant
Fix Vagrantfile
2018-01-26 17:12:06 -05:00
4529fd6787 Fix documentation typos 2018-01-26 14:44:48 +00:00
c00faa8960 Token spitter wallet 2018-01-26 08:08:18 -05:00
4a99a2a07d update contributing.md 2018-01-26 01:18:33 -05:00
4b63b3aa0b Switch to correct directory in Vagrant 2018-01-26 01:16:07 -05:00
fc860c3a07 Final Vagrantfile 2018-01-26 01:16:07 -05:00
2f147ec000 Remove upgrade step 2018-01-26 01:16:07 -05:00
0a7a190cd1 Fix vagrantfile
If you get an error, please run `vagrant box update`.
2018-01-26 01:16:07 -05:00
3366dfe32a Merge pull request #1151 from tendermint/fix/p2p-stop-conn
p2p/conn: fix blocking on pong during quit and break out of loops
2018-01-25 02:45:06 -05:00
baff4bd8cc p2p/conn: better handling for some stop conditions 2018-01-25 02:11:16 -05:00
fb109db33d update changelog 2018-01-25 02:10:01 -05:00
2f5971532e Merge pull request #1154 from tendermint/fix/consensus-tests
consensus: fix SetLogger in tests
2018-01-25 02:07:20 -05:00
ab13806276 consensus: print go routines in failed test 2018-01-25 01:22:53 -05:00
3ae26bd6e6 consensus: fix SetLogger in tests 2018-01-24 23:34:57 -05:00
fa8c374aff Merge branch 'master' into develop 2018-01-25 00:10:39 +00:00
27ef3489a0 Merge pull request #1049 from tendermint/p2p-channels
p2p: add Channels to NodeInfo and don't send for unknown channels
2018-01-24 15:29:38 -05:00
b6eb275b22 p2p: fix break in double loop 2018-01-24 14:27:37 -05:00
57cc8ab977 Merge pull request #1143 from tendermint/1091-race-condition
call FlushSync before calling CommitSync
2018-01-24 14:22:43 -05:00
99034904f8 p2p: fix tests for required channels 2018-01-23 23:45:51 -05:00
a0ffcbcee4 Merge pull request #1137 from tendermint/docs-consolidate
WIP: docs consolidation
2018-01-23 23:45:20 -05:00
260affd037 docs consolidation 2018-01-23 23:46:28 -05:00
d7b1b8d3d5 Merge pull request #1129 from tendermint/addrbook
p2p: bust up into sub dirs
2018-01-23 23:10:50 -05:00
50129ad8ac p2p: add Channels to NodeInfo and don't send for unknown channels 2018-01-23 22:43:56 -05:00
5c9cb5e6a2 Merge pull request #1133 from tendermint/fix/stop-peer-for-error
StopPeerForError in blockchain and consensus
2018-01-23 22:26:52 -05:00
4051391039 blockchain: test wip for hard to test functionality [ci skip] 2018-01-23 22:27:33 -05:00
8f3bd3f209 p2p: addrBook.Save() on DialPeersAsync 2018-01-23 22:25:39 -05:00
85816877c6 config: fix addrbook path to go in config 2018-01-23 22:21:17 -05:00
87087b8acd consensus: minor cosmetic 2018-01-23 21:41:13 -05:00
775bb85efb p2p/pex: wait to connect to all peers in reactor test 2018-01-23 21:30:53 -05:00
21ce5856b3 p2p: notes about ListenAddr 2018-01-23 21:26:19 -05:00
f5226e0008 Merge pull request #1144 from tendermint/create-logs-tarball
mercy for developers with slow Internet
2018-01-23 12:47:45 -05:00
a745fe2eed mercy for developers with slow Internet 2018-01-23 20:37:38 +04:00
5f3048bd09 call FlushSync before calling CommitSync
if we call it after, we might receive a "fresh" transaction from
  `broadcast_tx_sync` before old transactions (which were not
  committed).

Refs #1091

```
Commit is called with a lock on the mempool, meaning no calls to CheckTx
can start. However, since CheckTx is called async in the mempool
connection, some CheckTx might have already "sailed", when the lock is
released in the mempool and Commit proceeds.

Then, that spurious CheckTx has not yet "begun" in the ABCI app (stuck
in transport?). Instead, ABCI app manages to start to process the
Commit. Next, the spurious, "sailed" CheckTx happens in the wrong place.
```
2018-01-23 16:56:14 +04:00
6a5818e107 Merge pull request #1138 from tendermint/small-fix
Small fix in example
2018-01-22 17:27:35 -05:00
dfdfd6c98e Small fix in example 2018-01-22 13:10:54 +01:00
12142af1cb Remove reliance on global wire.Marshal 2018-01-21 19:03:23 -08:00
3090b05eb4 p2p: use conn.Close when peer is nil 2018-01-21 16:26:59 -05:00
ee674f919f StopPeerForError in blockchain and consensus 2018-01-21 13:32:04 -05:00
1d10217df2 tendermint build fix 2018-01-21 13:01:50 -05:00
813bb6af96 Merge pull request #1092 from tendermint/add-consensus-reactor-doc
Add consensus reactor doc
2018-01-21 12:40:28 -05:00
aecbff725f Merge pull request #1082 from tendermint/document-proposer-selection
Document proposer selection procedure
2018-01-21 12:39:43 -05:00
6679fef2be Merge pull request #1056 from tendermint/feature/mempool-spec
WIP: Mempool specification
2018-01-21 12:39:10 -05:00
c070ed056a Merge pull request #1051 from tendermint/feature/blockchain_reactor_docs
docs: Blockchain Reactor Documentation
2018-01-21 12:38:32 -05:00
2c6ed302b7 minor changes [ci skip] 2018-01-21 12:36:46 -05:00
0eb85161aa More specification 2018-01-21 12:35:09 -05:00
940145b368 Bullet points for reactor and poolRoutine 2018-01-21 12:32:45 -05:00
a30315276b Formatting and documentation 2018-01-21 12:32:23 -05:00
6366eb9d99 Cleanup build and structure 2018-01-21 12:31:14 -05:00
44e967184a p2p: tmconn->conn and types->p2p 2018-01-21 00:34:41 -05:00
2ec425ae4b Merge pull request #1128 from tendermint/862-seed-crawler-mode
seed crawler mode
2018-01-20 23:35:26 -05:00
0d7d16005a fixes 2018-01-20 21:44:30 -05:00
5b5cbaa66a p2p: use sub dirs 2018-01-20 21:35:37 -05:00
03550c7076 wip addrbook 2018-01-20 21:33:43 -05:00
930fde056a p2p: add back lost func 2018-01-20 21:28:00 -05:00
8d758560d8 p2p/trustmetric: non-deterministic test 2018-01-20 21:24:22 -05:00
7b87cdaed8 p2p: seed disconnects after sending addrs 2018-01-20 21:24:22 -05:00
c2f97e6454 p2p: seed mode fixes from rebase and review 2018-01-20 21:24:22 -05:00
88eb3e7af0 some minor renames 2018-01-20 21:24:20 -05:00
949211a137 added a test for PEX reactor seed mode 2018-01-20 21:23:48 -05:00
39d8da3536 docs: update getting started [ci skip] 2018-01-20 21:21:50 -05:00
ae27e85bf7 add warnings about new spec 2018-01-20 21:20:15 -05:00
f2d19162d2 fixes from caffix review 2018-01-20 21:20:09 -05:00
d36e118bf6 Add Consensus reactor spec 2018-01-19 19:57:08 +01:00
02c1aef48b Merge pull request #1121 from tendermint/consensus-tests
Consensus tests
2018-01-19 12:50:32 -05:00
6f3d9b4be3 fix race 2018-01-19 01:36:52 -05:00
f06cc6630b mempool: cfg.CacheSize and expose InitWAL 2018-01-19 01:03:03 -05:00
8171628ee5 make tests run faster 2018-01-19 00:59:09 -05:00
1cb76625d3 consensus: rename test funcs 2018-01-19 00:59:09 -05:00
ebeadfc57e dont run metalinter 2018-01-19 00:58:54 -05:00
cca597a9c0 fix and test config file 2018-01-19 00:08:19 -05:00
940db715f4 Merge pull request #1104 from tendermint/p2p-consolidate
WIP: P2P consolidate
2018-01-18 19:00:35 -05:00
ec2b038493 Merge pull request #1103 from tendermint/1100-document-event-subscriptions
document event subscriptions
2018-01-18 19:00:01 -05:00
ba0cb4f10e Merge pull request #1115 from tendermint/docs-tx-format
document tx formats
2018-01-18 18:57:23 -05:00
e764a180d8 docs: fix tx formats [ci skip] 2018-01-18 18:58:33 -05:00
bc19e7843c Merge branch 'develop' into p2p-consolidate 2018-01-18 18:30:37 -05:00
f57f97c4bd fix bash tests 2018-01-18 17:40:12 -05:00
b32474bb1a Merge pull request #1116 from tendermint/feature/prs
Create PULL_REQUEST_TEMPLATE.md
2018-01-18 13:52:18 -05:00
0a20e8f268 Create PULL_REQUEST_TEMPLATE.md 2018-01-18 13:53:18 -05:00
9d4d939b89 docs: tx formats: closes #1083, #536 2018-01-18 15:37:56 +00:00
c1e6e73bb1 Merge pull request #1108 from tendermint/zramsay-patch-1
Update p2p README
2018-01-15 10:31:31 -05:00
32741be212 update glide for go-wire and tmlibs 2018-01-14 17:40:16 -05:00
442dab45a5 Merge pull request #63 from tendermint/sdk2-newwire
Use new go-wire; PubKey etc are interfaces; Keybase refactor
2018-01-14 13:32:38 -08:00
620c957a44 fix test 2018-01-14 13:24:43 -05:00
64ce7eef16 Merge pull request #1107 from tendermint/p2p-pex-abuse
better abuse handling in pex
2018-01-14 13:03:02 -05:00
fc7915ab4c fixes from review 2018-01-14 13:03:57 -05:00
26aaa283a9 p2p: remove deprecated Dockerfile 2018-01-14 13:51:28 +00:00
a29c67563c Update p2p README, closes #1102 2018-01-14 13:50:34 +00:00
788cc0a792 Use new go-wire; PubKey etc are interfaces; Keybase refactor 2018-01-14 01:09:30 -08:00
17f7a9b510 improve seed dialing logic 2018-01-14 03:56:15 -05:00
3df5fd21cd better abuse handling in pex 2018-01-14 03:22:01 -05:00
99076f1942 Merge pull request #1105 from tendermint/p2p-switch
cleanup switch
2018-01-14 01:20:13 -05:00
3368eeb03e fix tests 2018-01-14 01:19:07 -05:00
68237911ba NetAddress.Same checks ID or DialString 2018-01-14 01:15:37 -05:00
f9e4f6eb6b reorder peer.go methods 2018-01-14 01:15:37 -05:00
8b74a8d6ac NodeInfo not a pointer 2018-01-14 01:15:33 -05:00
08f84cd712 a little more moving around 2018-01-13 23:56:57 -05:00
452d10f368 cleanup switch 2018-01-13 17:37:52 -05:00
8b3fb743cf Merge pull request #1048 from tendermint/p2p-id
P2P ID
2018-01-13 17:35:21 -05:00
7667e11973 remove RemoteAddr from NodeInfo 2018-01-13 17:36:03 -05:00
53a5498fc5 more fixes from review 2018-01-13 17:34:12 -05:00
e4d52401cf some fixes from review 2018-01-13 16:06:51 -05:00
9670519a21 remove PoW from ID 2018-01-13 15:50:59 -05:00
b1485b181a Merge branch 'p2p-consolidate' into p2p-id 2018-01-13 15:20:23 -05:00
47a6928890 Merge pull request #1030 from tendermint/864-distinguish-between-seeds-and-manual-peers
Distinguish between seeds and manual peers
2018-01-13 15:12:47 -05:00
c1e167e330 note in trust metric test 2018-01-13 15:11:13 -05:00
e2b3b5b58c dial_persistent_peers -> dial_peers with persistent option 2018-01-13 14:50:58 -05:00
e6b70baae0 Merge branch 'develop' into 864-distinguish-between-seeds-and-manual-peers 2018-01-13 14:34:32 -05:00
b40aa91b41 document event subscriptions
Refs #1100
2018-01-12 12:53:34 -06:00
a13b17ec6c Merge pull request #792 from tendermint/config
Config Improvements
2018-01-10 14:41:30 -05:00
b32a507a1b Merge pull request #1088 from tendermint/1087-update-docker
Update docker image
2018-01-10 14:23:06 -05:00
d6e01e8cee Merge pull request #1089 from tendermint/1075-document-underflow-overflow
document the maximum supported voting power due to overflow [ci skip]
2018-01-10 14:20:31 -05:00
c79ba3c349 document the maximum supported voting power due to overflow [ci skip]
Refs #1075
2018-01-10 14:21:26 -05:00
12ca972761 Merge branch 'develop' into 1087-update-docker 2018-01-10 11:08:14 -06:00
657ad214cb p2p tests: put priv_val in right place 2018-01-10 16:30:00 +00:00
39acf1c5e8 Merge branch 'develop' into config 2018-01-10 14:21:24 +00:00
075ae1e301 minimal test for dialing seeds in pex reactor 2018-01-09 18:29:29 -06:00
705d51aa42 move dialSeedsIfAddrBookIsEmptyOrPEXFailedToConnect into PEX reactor 2018-01-09 17:54:29 -06:00
ef0493ddf3 rewrite Peers section of Using Tendermint guide [ci skip] 2018-01-09 17:54:28 -06:00
1b455883d2 readd /dial_seeds 2018-01-09 17:54:28 -06:00
e4897b7bdd rename manual peers to persistent peers 2018-01-09 16:18:05 -06:00
37f86f9518 update changelog [ci skip] 2018-01-09 16:04:07 -06:00
28fc15028a distinguish between seeds and manual peers in the config/flags
- we only use seeds if we can’t connect to peers in the addrbook.
- we always connect to nodes given in config/flags

Refs #864
2018-01-09 16:03:24 -06:00
179d6062e4 try to connect through addrbook before requesting peers from seeds
we only use seeds if we can’t connect to peers in the addrbook.

Refs #864
2018-01-09 16:03:24 -06:00
c521f385a6 add quick start guide (#1069) 2018-01-09 20:35:47 +00:00
b8214fce66 Merge branch 'develop' into 1087-update-docker 2018-01-09 12:21:23 -06:00
03a14d8342 docs/p2p: updates from review (#1076) 2018-01-09 11:44:49 -06:00
48638eaa20 update docker readme 2018-01-09 11:05:15 -06:00
170777300e update docker
Closes #1087
2018-01-09 11:04:37 -06:00
32311acd01 Vulnerability in light client proxy (#1081)
* Vulnerability in light client proxy

When calling GetCertifiedCommit the light client proxy would call
Certify and even on error return the Commit as if it had been correctly
certified.

Now it returns the error correctly and returns an empty Commit on error.

* Improve names for clarity

The lite package now contains StaticCertifier, DynamicCertifier and
InqueringCertifier. This also changes the method receivers from one
letter to two letter names, which will make future refactoring easier
and follows the coding standards.

* Fix test failures

* Rename files

* remove dead code
2018-01-09 10:36:11 -06:00
b9cbaf8f10 priv-val: fix timestamp for signing things that only differ by timestamp 2018-01-08 16:36:16 -05:00
8d86b6c2d2 Merge pull request #1084 from tendermint/fix-make-dist-script
fix broken `make dist` target
2018-01-08 16:20:36 -05:00
555f560ecd fix broken make dist target 2018-01-08 13:13:47 -06:00
dba4815616 Define requirements of the proposer selection procedure 2018-01-08 14:10:01 +01:00
cf42611187 Merge pull request #997 from tendermint/919-careful-with-validator-voting
check for overflow and underflow while choosing proposer
2018-01-07 16:48:39 -05:00
90c691df2b Merge pull request #1063 from tendermint/feature/Issue1020
NewInquiring returns error instead of swallowing it
2018-01-07 16:30:33 -05:00
13fa23c568 Add error checking 2018-01-06 22:24:58 +01:00
67a47e6a0b Address is a type alias 2018-01-06 16:05:50 -05:00
124c58d48f Merge pull request #1071 from tendermint/revert-1053-feature/buildprocess
Revert "Changes to achieve a standardized build process and deterministic builds"
2018-01-05 22:42:19 -08:00
a034600024 Revert "Changes to achieve a standardized build process and deterministic builds" 2018-01-05 22:35:57 -08:00
ffbe912ff3 Merge pull request #171 from tendermint/sdk2
WIP: Sdk2
2018-01-06 01:29:55 -05:00
e0e600df05 Merge branch 'develop' into config 2018-01-06 05:30:38 +00:00
2bd556205d disable fragile bash test 2018-01-05 22:57:45 -05:00
a55adfaa4f tests: use shasum to avoid rarer dependency 2018-01-05 22:33:18 -05:00
92f5ae5a84 fix vagrant [ci skip] 2018-01-05 22:26:10 -05:00
e1e3ea4e7f fix a get_tools 2018-01-05 22:22:55 -05:00
a488c0f027 update changelog and glide and a fix 2018-01-05 22:19:37 -05:00
629e2fc2a0 update readme 2018-01-05 21:52:52 -05:00
c38ac88d69 Merge branch 'develop' into sdk2 2018-01-05 21:45:48 -05:00
91ce3af564 Makefile fix for new deterministic makefile in tendermint repo 2018-01-05 21:25:28 -05:00
d57ddec302 Merge pull request #1053 from tendermint/feature/buildprocess
Changes to achieve a standardized build process and deterministic builds
2018-01-05 21:13:42 -05:00
bb3dc10f24 Makefile improvements for deterministic builds based on Bucky's feedback 2018-01-05 14:22:13 -05:00
2cc50938a4 Merge branch 'develop' into feature/buildprocess 2018-01-05 13:01:40 -05:00
ba475d3128 Fix formatting 2018-01-05 13:25:58 +01:00
ed81fb54ec NewInquiring returns error instead of swallowing it 2018-01-05 13:24:16 +01:00
8481da2405 Merge pull request #1046 from tendermint/abci-spec-docs
docs: add abci spec
2018-01-04 13:57:40 -05:00
ecb7303e35 Merge branch 'develop' into abci-spec-docs 2018-01-04 13:57:08 -05:00
9cb45eb7df Add skeleton for functionality and concurrency 2018-01-04 19:08:03 +01:00
6855e62f0a Merge pull request #1052 from tendermint/feature/p2p_docs
docs: P2P Documentation
2018-01-04 12:32:28 -05:00
82aed60acb Merge pull request #173 from tendermint/cobra-helpers
fill in empty command helpers
2018-01-04 12:19:55 -05:00
19e065b6f5 Merge pull request #174 from tendermint/examples-in-readme
update readme with example code
2018-01-04 12:19:18 -05:00
f205a937cf Merge pull request #172 from tendermint/spec-docs
convert spec to .rst for consumption by tendermint RTD
2018-01-04 12:16:00 -05:00
17b61db40a Document p2p and rpc messages 2018-01-04 18:12:48 +01:00
7b52499463 Start writing mempool specification
Include overview and configuration options.
2018-01-04 17:11:35 +01:00
f6172e84a9 Merge pull request #176 from tendermint/shasum
use sha256sum because more secure
2018-01-04 15:53:56 +00:00
f47b8f8a2d use sha256sum because more secure 2018-01-04 15:41:25 +00:00
3ebe3250ff Merge pull request #58 from tendermint/sdk2
SDK2
2018-01-03 20:32:07 -05:00
f67f99c227 Extended install document with docker option. Added extra checks to developer's build target. 2018-01-03 17:24:11 -05:00
0430ebf95c Makefile changes for cross-building and standardized builds using gox 2018-01-03 14:58:23 -05:00
f602de437e Move P2P docs into docs folder 2018-01-03 10:49:47 +01:00
a573b20888 docs: add counter/dummy code snippets
closes https://github.com/tendermint/abci/issues/134
2018-01-03 01:23:38 +00:00
a77213e6c5 update readme, closes #134 2018-01-03 00:48:00 +00:00
156416fe27 fix wordlist paths 2018-01-02 16:39:43 -05:00
793d7717dc no metalinter for now 2018-01-02 16:34:25 -05:00
1afc034006 Merge pull request #119 from tendermint/sdk2
Sdk2
2018-01-02 11:37:17 -05:00
2bb538b150 cmn: fix HexBytes.MarshalJSON 2018-01-02 11:05:53 -05:00
1460540acd metalinter is for another time 2018-01-02 11:05:39 -05:00
8bb383c264 Merge pull request #59 from tendermint/sdk2-cleanup
Sdk2 cleanup
2018-01-02 10:54:40 -05:00
1838db2880 circle 2018-01-02 10:53:56 -05:00
7fe3d5dac2 metalinter 2018-01-02 10:48:36 -05:00
a991e2fe9c Merge branch 'develop' into sdk2 2018-01-02 10:29:04 -05:00
488ae529ad p2p: authenticate peer ID 2018-01-01 23:23:11 -05:00
6e823c6e87 p2p: support addr format ID@IP:PORT 2018-01-01 23:08:20 -05:00
7d35500e6b p2p: add ID to NetAddress and use for AddrBook 2018-01-01 22:39:08 -05:00
a17105fd46 p2p: peer.Key -> peer.ID 2018-01-01 22:39:05 -05:00
b289d2baf4 persistent node key and ID 2018-01-01 21:21:42 -05:00
f2e0abf1dc p2p: reorder some checks in addPeer; add comments to NodeInfo 2018-01-01 21:21:39 -05:00
528154f1a2 p2p: PrivKey need not be Ed25519 2018-01-01 19:44:01 -05:00
bc71840f06 more p2p docs 2018-01-01 16:30:36 -05:00
47d5fd0f1b prettify the command helpers 2018-01-01 16:21:36 +00:00
cd15b677ec docs: add abci spec 2018-01-01 15:35:28 +00:00
12fd445e6f spec: convert to rst 2018-01-01 14:48:29 +00:00
e9ff0eefbb move spec from readme to own file 2018-01-01 14:45:57 +00:00
1acb12edf5 p2p docs 2017-12-31 17:11:09 -05:00
008de93bbe Merge pull request #1039 from tendermint/add_consensus_spec
Spec of consensus/gossip protocol
2017-12-31 14:59:32 -05:00
4e834baa9a docs: update ecosystem.rst (#1037)
* docs: update ecosystem.rst

* typo [ci skip]
2017-12-31 13:54:50 +00:00
b31d37b480 update circle.yml 2017-12-30 18:25:42 -05:00
d058d0098f keys/bcrypt 2017-12-30 17:30:18 -05:00
8c61bb27b7 fix nano test 2017-12-30 17:30:18 -05:00
bd30cb4de9 keys/keybase.go: comments and fixes 2017-12-30 17:30:18 -05:00
f3f49c2362 keys/words 2017-12-30 17:30:18 -05:00
1f8e66fdb3 nano: update comments 2017-12-30 17:29:51 -05:00
7c77f6b2da move hd into keys/hd 2017-12-30 17:29:51 -05:00
87f2005fa8 hd: comments and some cleanup 2017-12-30 17:29:51 -05:00
96e0e4ab5a Describe messages sent as part of consensus/gossip protocol 2017-12-30 21:18:12 +01:00
f2bfa83b42 Merge pull request #116 from tendermint/remove-logger-package
remove deprecated logger package
2017-12-29 20:50:03 -05:00
381fe19335 changelog date [ci skip] 2017-12-29 17:51:19 -05:00
ff99ca7cdf bump wal test timeout 2017-12-29 17:51:13 -05:00
d8dd7491e2 Added get_tools to build tendermint 2017-12-29 13:48:14 -05:00
60f95cd9ea changelog and version 2017-12-29 11:28:44 -05:00
28bbeac763 state: send byzantine validators in BeginBlock 2017-12-29 11:26:55 -05:00
a84bc2f5b2 logger is deprecated, removed; closes #115 2017-12-29 16:25:15 +00:00
9f72e25b23 readme 2017-12-29 16:25:15 +00:00
e97e0bacd1 update glide 2017-12-29 11:11:13 -05:00
91b4b534ad Merge pull request #118 from tendermint/develop
v0.6.0
2017-12-29 11:05:12 -05:00
abfdfe67e8 test/p2p: add some timeouts 2017-12-29 11:02:47 -05:00
35e6f11ad4 changelog and version 2017-12-29 11:01:37 -05:00
b54da51c0c Merge pull request #111 from tendermint/timers_jae
WIP RepeatTimer fix
2017-12-29 10:52:25 -05:00
92c17f3f25 give test more time 2017-12-29 10:49:49 -05:00
71f13cc071 drop metalinter 2017-12-29 10:42:02 -05:00
5d5ea6869b Merge pull request #170 from tendermint/develop
v0.9.0
2017-12-29 10:36:33 -05:00
70da70d852 abandon the metalinter because honestly who has the time 2017-12-29 10:30:59 -05:00
a171d90611 Fix possibly incorrect usage of conversion 2017-12-29 10:28:00 -05:00
558f8e7769 fix recursion 2017-12-29 10:28:00 -05:00
76433d9040 little things 2017-12-29 10:28:00 -05:00
6b5d08f7da RepeatTimer fix 2017-12-29 10:27:54 -05:00
992371b4cf Merge pull request #1035 from tendermint/readme-min-requirements
README: document the minimum Go version
2017-12-29 10:24:57 -05:00
07eeddc5e1 Merge pull request #1015 from tendermint/state_funcs
state: move methods to funcs
2017-12-29 10:24:22 -05:00
3b70c89e07 README: document the minimum Go version
Solidify in writing, the minimum Go version that
we support, as Go1.9.
2017-12-28 23:26:45 -07:00
444db4c242 metalinter 2017-12-28 23:15:54 -05:00
cb845ebff5 fix EvidencePool and VerifyEvidence 2017-12-28 23:15:54 -05:00
6112578d07 ValidateBlock is a method on blockExec 2017-12-28 23:15:54 -05:00
ae68fcb78a move fireEvents to ApplyBlock 2017-12-28 23:15:54 -05:00
8d8d63c94c changelog 2017-12-28 23:15:54 -05:00
1d6f00859d fixes from review 2017-12-28 23:15:54 -05:00
397251b0f4 fix evidence 2017-12-28 23:15:54 -05:00
537b0dfa1a use NopEventBus 2017-12-28 23:15:54 -05:00
0acca7fe69 final updates for state 2017-12-28 23:15:54 -05:00
bac60f2067 blockchain: update for new state 2017-12-28 23:15:54 -05:00
f82b7e2a13 state: re-order funcs. fix tests 2017-12-28 23:15:54 -05:00
9e6d088757 state: BlockExecutor 2017-12-28 23:15:54 -05:00
c915719f85 *State->State; SetBlockAndValidators->NextState 2017-12-28 23:15:54 -05:00
f55135578c state: move methods to funcs 2017-12-28 23:15:54 -05:00
6372c415a5 Merge pull request #113 from tendermint/hotfix/clist
Fix #112 by using RWMutex per element
2017-12-28 22:23:02 -05:00
b31397aff5 Fix GoLevelDB Iterator which needs to copy a temp []byte 2017-12-28 18:30:56 -08:00
38eb32d7bf version and changelog 2017-12-28 17:28:07 -05:00
139eca0177 Merge pull request #1027 from tendermint/1026-error-signing-vote-wal-gen
change directory for each call, not only for each test
2017-12-28 16:08:52 -05:00
a8e625e99d config: unexpose chainID 2017-12-28 20:49:02 +00:00
a92a32b862 config: lil fixes 2017-12-28 20:49:02 +00:00
9da5cd0180 rebase fix 2017-12-28 20:49:02 +00:00
a6f2e502e7 move genesis.json file into config dir 2017-12-28 20:49:02 +00:00
69d8c2e554 fixes after my own review 2017-12-28 20:49:02 +00:00
70ba608850 config: write all default options to config file
config: test the default file

docs: spiff up config

config: minor fixes & comments

config: simplify test

config; use a seperate config directory, #556

config: update docs & parameterize file paths

config: PR comments

config: use the default object

fix a rebase error
2017-12-28 20:49:02 +00:00
75182f7205 change directory for each call, not only for each test
Fixes #1026
2017-12-28 11:17:15 -06:00
41caa4415c Merge pull request #1024 from tendermint/1023-tendermint-version
remove quotes from `tendermint version`
2017-12-28 10:14:39 -05:00
c611cc7268 remove quotes from tendermint version
before:
0.14.0-'88f5f21d'

after:
0.14.0-88f5f21d

Fixes #1023
2017-12-28 09:02:25 -06:00
e47ce81422 Comment fixes from Emmanuel 2017-12-28 03:05:55 -08:00
f48baf86fb Add Address type which is HexBytes 2017-12-27 14:37:37 -08:00
93c05aa8c0 Add back on HexBytes 2017-12-27 13:52:32 -08:00
d14ec7d7d2 Merge pull request #1011 from tendermint/1006-panic-on-light-client-startup
protect memStoreProvider#byHash map by mutex
2017-12-27 15:30:59 -05:00
4ca19e33c2 add mutex to memStoreProvider
Fixes #1006

```
goroutine 230 [runnable]:
github.com/cosmos/gaia/vendor/golang.org/x/crypto/ripemd160.(*digest).Sum(0xc420ac2af0, 0x0, 0x0, 0x0, 0xc420c01360, 0xc420c01378, 0x20)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/golang.org/x/crypto/ripemd160/ripemd160.go:119 +0x2c9
github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle.KVPair.Hash(0x49447e8, 0x7, 0x47ff760, 0xc420048d50, 0xc420aba9a0, 0x14, 0x20)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle/simple_tree.go:122 +0x200
github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle.(*KVPair).Hash(0xc4200f7ae0, 0xc420aba9a0, 0x14, 0x20)
	<autogenerated>:1 +0x57
github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle.SimpleHashFromHashables(0xc420111900, 0x9, 0x10, 0x10, 0xc420ad06c0, 0xc420087500)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle/simple_tree.go:87 +0xaa
github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle.SimpleHashFromMap(0xc420b987e0, 0xc420b987e0, 0x4941892, 0x3)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tmlibs/merkle/simple_tree.go:96 +0x4d
github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/types.(*Header).Hash(0xc420a541a0, 0x4034f, 0xc420a28530, 0xa)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/types/block.go:177 +0x54a
github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite.Commit.ValidateBasic(0xc420a541a0, 0xc420a1e300, 0xc420a28530, 0xa, 0xb, 0x27)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite/commit.go:83 +0x1c9
github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite/files.(*provider).StoreCommit(0xc4202f2780, 0xc420a541a0, 0xc420a1e300, 0xc420a24870, 0x0, 0x0)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite/files/provider.go:71 +0x5e
github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite.cacheProvider.StoreCommit(0xc4202f27a0, 0x2, 0x2, 0xc420a541a0, 0xc420a1e300, 0xc420a24870, 0xc420a541a0, 0xc420a1e300)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite/provider.go:39 +0x8f
github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite.(*cacheProvider).StoreCommit(0xc4202f27c0, 0xc420a541a0, 0xc420a1e300, 0xc420a24870, 0x2, 0xc420a541a0)
	<autogenerated>:1 +0x70
github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite.NewInquiring(0xc420990610, 0xa, 0xc420a541a0, 0xc420a1e300, 0xc420a24870, 0x4f3eb80, 0xc4202f27c0, 0x4f3e5c0, 0xc4202f2840, 0xa)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/lite/inquirer.go:29 +0x5c
github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client.GetCertifier(0xc420990610, 0xa, 0x4f3eb80, 0xc4202f27c0, 0x4f3e5c0, 0xc4202f2840, 0xc4200f68a0, 0xc420b21888, 0x470eece)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/common.go:47 +0x141
github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands.GetCertifier(0x4f46aa0, 0xc4200f68a0, 0xc420b218e0)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/common.go:82 +0x83
github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/query.GetWithProof(0xc420a260c0, 0x22, 0x30, 0x0, 0x4947dd6, 0xc42016a000, 0xc420b219a0, 0x4389d85, 0x0, 0x0, ...)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/query/get.go:73 +0x52
github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/query.Get(0xc420a260c0, 0x22, 0x30, 0x0, 0x1, 0x0, 0xc420b21a08, 0x43c9c91, 0xc4200a20f0, 0x4947dd6, ...)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/query/get.go:64 +0x178
github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/query.GetParsed(0xc420a260c0, 0x22, 0x30, 0x47d1440, 0xc420b984e0, 0x0, 0x1, 0x30, 0x1d, 0x40)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/client/commands/query/get.go:31 +0x5f
github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/modules/coin/rest.doQueryAccount(0x4f3d300, 0xc4201ee0e0, 0xc420111500)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/cosmos/cosmos-sdk/modules/coin/rest/handlers.go:66 +0x3a5
net/http.HandlerFunc.ServeHTTP(0x4a9d808, 0x4f3d300, 0xc4201ee0e0, 0xc420111500)
	/usr/local/go/src/net/http/server.go:1918 +0x44
github.com/cosmos/gaia/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201aab40, 0x4f3d300, 0xc4201ee0e0, 0xc420111500)
	/Users/mappum/go/src/github.com/cosmos/gaia/vendor/github.com/gorilla/mux/mux.go:150 +0xed
net/http.serverHandler.ServeHTTP(0xc4209992b0, 0x4f3d300, 0xc4201ee0e0, 0xc420111300)
	/usr/local/go/src/net/http/server.go:2619 +0xb4
net/http.(*conn).serve(0xc4200b5540, 0x4f3df80, 0xc420086900)
	/usr/local/go/src/net/http/server.go:1801 +0x71d
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2720 +0x288
```
2017-12-27 15:29:17 -05:00
1a0db878bf Merge pull request #1009 from tendermint/spec
Spec
2017-12-27 15:23:13 -05:00
53eb9aca2b Merge pull request #592 from tendermint/evidence
track evidence, include in block
2017-12-27 15:22:24 -05:00
caccabd4e5 spec: fixes from review 2017-12-27 15:14:49 -05:00
d0e0ac5fac types: better error messages for votes 2017-12-27 14:46:24 -05:00
7d81a3f4a5 address some comments from review 2017-12-27 01:27:03 -05:00
4041adbf92 Merge pull request #54 from tendermint/cRandHex-doc-fix
CRandHex: fix up doc to mention length of digits
2017-12-26 23:48:05 -05:00
f95b7529eb Merge pull request #999 from tendermint/feature/result-hash-header
Add results hash to header
2017-12-26 20:49:20 -05:00
6a4fd46479 fixes from rebase 2017-12-26 20:42:34 -05:00
b01b1e4758 remove unused var 2017-12-26 20:27:40 -05:00
014b0b9944 evidence: reactor test 2017-12-26 20:27:40 -05:00
5904f6df8b minor fixes from review 2017-12-26 20:27:40 -05:00
0f293bfc2b remove some TODOs 2017-12-26 20:27:40 -05:00
cfbedec719 evidence: reactor test 2017-12-26 20:27:40 -05:00
666ae244b3 evidence: pool test 2017-12-26 20:27:40 -05:00
c13e93d63e evidence: store tests and fixes 2017-12-26 20:27:40 -05:00
c2585b5525 evidence_pool.go -> pool.go. remove old test files 2017-12-26 20:27:40 -05:00
1d021c2790 update consensus/test_data/many_blocks.cswal 2017-12-26 20:27:40 -05:00
cc418e5dab state.VerifyEvidence enforces EvidenceParams.MaxAge 2017-12-26 20:27:32 -05:00
c7acdfadf2 evidence: more funcs in store.go 2017-12-26 20:27:32 -05:00
869d873d5c state.ApplyBlock takes evpool and calls MarkEvidenceAsCommitted 2017-12-26 20:27:32 -05:00
3271634e7a types: evidence cleanup 2017-12-26 20:26:21 -05:00
4854c231e1 evidence store comments and cleanup 2017-12-26 20:26:21 -05:00
7a18fa887d evidence linked with consensus/node. compiles 2017-12-26 20:26:21 -05:00
6c4a0f9363 cleanup evidence pkg. state.VerifyEvidence 2017-12-26 20:26:21 -05:00
f7731d38f6 some comments and cleanup 2017-12-26 20:25:14 -05:00
df3f4de7c3 check evidence is from validator; some cleanup 2017-12-26 20:25:14 -05:00
10c43c9edc introduce evidence store 2017-12-26 20:25:14 -05:00
fe4b53a463 EvidencePool 2017-12-26 20:24:54 -05:00
5b1f987ed1 mempool: remove Peer interface. use p2p.Peer 2017-12-26 20:24:12 -05:00
48d778c4b3 types/params: introduce EvidenceParams 2017-12-26 20:24:12 -05:00
7d086e9524 check if we already have evidence 2017-12-26 20:21:17 -05:00
6e9433c7a8 post rebase fix 2017-12-26 20:21:17 -05:00
39299e5cc1 consensus: note about duplicate evidence 2017-12-26 20:21:17 -05:00
eeab0efa56 types: tx.go comments 2017-12-26 20:21:17 -05:00
77e45756f2 types: Evidences for merkle hashing; Evidence.String() 2017-12-26 20:21:17 -05:00
9cdcffbe4b types: comments; compiles; evidence test 2017-12-26 20:21:17 -05:00
50850cf8a2 verify sigs on both votes; note about indices 2017-12-26 20:21:17 -05:00
35587658cd verify evidence in block 2017-12-26 20:21:17 -05:00
4661c98c17 add pubkey to conflicting vote evidence 2017-12-26 20:21:17 -05:00
7928659f70 track evidence, include in block 2017-12-26 20:21:17 -05:00
f80f6445a6 fix test 2017-12-26 20:15:09 -05:00
336c2f4fe1 rpc: fix getHeight 2017-12-26 20:08:25 -05:00
bfcb40bf6b validate block.ValidatorsHash 2017-12-26 20:00:45 -05:00
051c2701ab remove LastConsensusParams 2017-12-26 19:56:39 -05:00
028ee58580 call it LastResultsHash 2017-12-26 19:53:26 -05:00
801e3dfacf rpc: getHeight helper function 2017-12-26 19:37:42 -05:00
4171bd3bae fixes 2017-12-26 19:24:45 -05:00
73fb1c3a17 consolidate saveResults/SaveABCIResponses 2017-12-26 19:24:45 -05:00
d65234ed51 Add /block_results?height=H as rpc endpoint
Expose it in rpc client
Move ABCIResults into tendermint/types from tendermint/state
2017-12-26 19:24:25 -05:00
58c5df729b Add ResultHash to header 2017-12-26 19:24:25 -05:00
632cc918b4 Save/Load Results for every height
Add some tests.
Behaves like saving validator set, except it always saves at each height
instead of a reference to last changed.
2017-12-26 19:24:25 -05:00
f870a49f42 Add ABCIResults with Hash and Proof to State
State maintains LastResultsHash
Verify that we can produce unique hashes for each result,
and provide valid proofs from the root hash.
2017-12-26 19:24:25 -05:00
d844799b3b Merge branch '950-enforce-less-13-val-changes-per-block' into develop 2017-12-26 19:22:21 -05:00
3ea1145486 bring back test 2017-12-26 19:22:15 -05:00
8f87efd7f8 ABCI message updates (code/log/info)
* Add info to Response[CheckTx/DeliverTx/Query]
* Remove code and log from Response[SetOption/Commit]
2017-12-26 15:46:06 -08:00
d4716fc03c state 2017-12-26 18:43:03 -05:00
16227594ef notes about block 1 2017-12-26 16:33:42 -05:00
65cdb07f0c merkle 2017-12-26 15:48:17 -05:00
eb73e82279 encoding.md 2017-12-26 15:30:56 -05:00
d6fbfddddd spec.md -> blockchain.md. some fixes 2017-12-26 15:30:27 -05:00
1339a44402 add safe*Clip funcs 2017-12-26 14:13:12 -06:00
b8215d8ac8 more test cases 2017-12-26 13:30:00 -06:00
289d92c97d consensus: remove log stmt. closes #987 2017-12-26 10:41:31 -05:00
6c39c77fc5 Merge pull request #996 from ricardohsd/types-add-tests-to-vote
Add more tests to types/vote.go
2017-12-26 10:32:07 -05:00
66580408f8 GasWanted and GasUsed for Check & Deliver 2017-12-26 05:29:33 -08:00
e1ff53fd0b Use []byte instead of Bytes, use tmlibs/common.KVPair 2017-12-26 04:52:02 -08:00
b25df389db Remove Bytes, just use []byte; Use protobuf for KVPair/KI64Pair 2017-12-26 04:40:35 -08:00
a861d68a31 Update glide.yaml and fix tests 2017-12-26 00:45:31 -08:00
bf644b0984 Do not shadow assert 2017-12-26 00:36:58 -08:00
9472476a8b Update Makefile 2017-12-26 00:28:07 -08:00
6ec8c1602f Update Makefile 2017-12-25 22:41:40 -08:00
0f8ebd024d Update clist.go
Add more justification of synchrony primitives in documentation.
2017-12-25 22:28:15 -08:00
2fd8f35b74 Fix #112 by using RWMutex per element 2017-12-25 21:12:14 -08:00
797bcdd9e0 Remove common/http 2017-12-25 17:46:21 -08:00
69c3a7640b add safeAdd & safeSub plus quickcheck tests 2017-12-25 18:39:14 -06:00
e8b0458f16 check for overflow and underflow while choosing proposer
Refs #919
2017-12-25 18:39:14 -06:00
6b89639f90 update docs 2 [ci skip] 2017-12-25 17:58:15 -06:00
9b25f7325a update docs [ci skip] 2017-12-25 17:53:54 -06:00
0093f9877a change voting power change, not number of vals 2017-12-25 17:49:36 -06:00
96c816f428 Merge pull request #160 from KrzysiekJ/test-cmd-short-circuit
Short-circuit assertions in test command
2017-12-25 20:21:24 +00:00
f2a8e95248 Add KI64Pair(s) 2017-12-25 11:40:05 -08:00
cf0b5d3715 enforce <1/3 validator updates
Refs #950
2017-12-25 12:10:53 -06:00
616f7e74db Merge pull request #1001 from tendermint/makefile
Cleaned up makefile
2017-12-25 12:09:10 -05:00
14c812a39c tmlibs timer fix 2017-12-25 11:11:55 -05:00
1e52751344 update tests for makefile 2017-12-25 10:24:41 -05:00
ff65421324 Proposal: New Makefile standard template (#168)
* Cleaned up makefile.
* Improve 'make all' order
* Add devdoc
* Update circle.yml
2017-12-25 00:14:13 -08:00
f390385baf Fee is a KNPair (#167)
KVPair is {[]byte,[]byte}
2017-12-24 18:39:16 -08:00
d7ac6e516a Cleaned up makefile 2017-12-23 02:23:05 -08:00
62115b55ef CRandHex: fix up doc to mention length of digits
The previous doc seemed misleading and was out of date i.e.
RandHex(24)
not
CRandHex.

Anyways provide a doc of what the function does in relation to
the length of digits of the hex value returned i.e.
  floor(numDigits / 2) * 2
so the even lowest number
  e.g:
  * len(CRandHex(5)) = 4
  * len(CRandHex(4)) = 4
2017-12-22 23:16:34 -07:00
aaaacba1cd Use gogoproto's nullable=false (#166)
* Use gogoproto's nullable=false where appropriate.
2017-12-22 19:41:19 -08:00
f297602c14 Merge pull request #69 from tendermint/master
Backmerge to jenkins branch
2017-12-22 03:00:46 -05:00
cbfbc72ad8 Perftest config change 2017-12-22 01:53:10 -05:00
c2436c46e6 Merge pull request #972 from tendermint/feature/enhance-endblock
Update EndBlock parameters
2017-12-22 01:30:58 -05:00
e3585a6eb0 wip: tendermint specification 2017-12-21 22:36:37 -05:00
43cc4fb645 Merge pull request #53 from tendermint/constant-time-equals
Constant time equals
2017-12-21 20:03:53 -05:00
eaf4b8c795 fix Equals 2017-12-21 19:51:57 -05:00
38608b1b0f comment and tmlibs fix 2017-12-21 18:32:40 -05:00
2b634dab32 Merge pull request #994 from tendermint/clean/block-validation
Clean/block validation
2017-12-21 17:53:11 -05:00
91acc51cd1 fix test 2017-12-21 17:52:06 -05:00
dc54ba67e4 state: TestValidateBlock 2017-12-21 17:51:03 -05:00
35521b553a save historical consensus params 2017-12-21 17:46:25 -05:00
70a744558c types: params.Update() 2017-12-21 17:00:52 -05:00
4b789ff7e9 another cmn fix 2017-12-21 16:49:47 -05:00
306657a118 no patience for metalinter right now 2017-12-21 16:49:47 -05:00
be765e4cb9 update glide for cmn fixes 2017-12-21 16:49:47 -05:00
b5857da877 forgot file 2017-12-21 16:49:47 -05:00
3ad055ef3a fix randPort 2017-12-21 16:49:47 -05:00
3d00c477fc separate block vs state based validation 2017-12-21 16:49:47 -05:00
c2912d612a update glide 2017-12-21 16:49:47 -05:00
218acc2224 Merge pull request #107 from tendermint/fix/cmn
Fix/cmn
2017-12-21 16:30:45 -05:00
a3c7525249 Merge pull request #993 from tendermint/984-priv-validator-signing
priv validator returns last sign bytes if h/r/s matches
2017-12-21 16:30:22 -05:00
f81025631e update comment [ci skip] 2017-12-21 16:28:05 -05:00
9c03c58de2 priv validator checks if only difference is timestamp; else error 2017-12-21 15:37:27 -05:00
e2d7f1aa41 cmn: fix race 2017-12-21 14:21:15 -05:00
0ffd60b8cf ValidatorSetUpdates -> ValidatorUpdates 2017-12-21 11:52:26 -06:00
d5baa6601c types: Add test for IsVoteTypeValid 2017-12-21 18:13:31 +01:00
19eeef0aad types: Rename exampleVote to examplePrecommit on vote_test
exampleVote doesn't express the type of the vote.
2017-12-21 18:13:31 +01:00
b0b740210c cmn: fix repeate timer test with manual ticker 2017-12-21 11:15:17 -05:00
a25ed5ba1b cmn: fix race condition in prng 2017-12-21 10:02:25 -05:00
e4b9f1abe7 Id -> ID using gogo 2017-12-20 17:33:59 -08:00
e76392e330 types: Update String() test to assert Prevote type 2017-12-20 23:21:30 +01:00
98a38737c4 Merge pull request #156 from tendermint/use-single-connection-in-console
cmd/abci-cli: use a single connection per session
2017-12-20 16:11:25 -05:00
9c145a9e19 Merge branch 'develop' into use-single-connection-in-console 2017-12-20 15:55:36 -05:00
2927caa0eb fix flag parsing in console mode 2017-12-20 15:54:14 -05:00
a1cc9ac642 priv validator returns last sign bytes if h/r/s matches
since now we have time in the msgs and we might crash between writing
the priv val and writing to wal.

Refs #984
2017-12-20 14:41:43 -06:00
c03928766d Merge pull request #163 from tendermint/feature/enhance-endblock
Update the ResponseEndBlock values
2017-12-20 15:16:09 -05:00
fa15e4f554 update changelog [ci skip] 2017-12-20 15:16:15 -05:00
0d69ace961 fix circleci config 2017-12-20 13:40:26 -06:00
e46a99a32f Fix Makefile 2017-12-20 11:02:22 -08:00
67c3af3bf8 cmd/tendermint: fix initialization file creation checks (#991)
* cmd/tendermint: fix initialization file creation checks

Fixes #989.

The original initialization sequence started to inexplicably
fail
```shell
tendermint unsafe_reset_all
tendermint init
tendermint node --proxy_app=dummy
```

used to fail with
```shell
ERROR: Failed to create node: Couldn't read GenesisDoc file: open
/Users/emmanuelodeke/.tendermint/genesis.json: no such file or directory
```

because the initialization sequence always assumed that the
genesisDoc would only be set if the privValidator was generated.

However, `tendermint unsafe_reset_all` only created the
`priv_validator.json` file which would mean that then running
`tendermint init` would never create the `genesis.json` file
which if following the recommended sequence would then fail
since the `genesis.json` was absent.

* cmd/tendermint: Load PrivValidatorFS if existent, lest generate it

Feedback from @melekes

* change logging messages for init cmd

Refs #989
2017-12-20 12:50:27 -06:00
9692f68d50 Generic service fix 2017-12-20 05:09:42 -05:00
57c49cc825 Include unsaved circle.yml file 2017-12-20 10:40:35 +01:00
c268c4e767 Update Circle and Makefile to run tests/linting on CI 2017-12-20 10:33:24 +01:00
57a83fe73e Merge branch 'develop' into feature/enhance-endblock 2017-12-20 00:11:57 -08:00
3798f9fa8e Reorder README 2017-12-20 00:07:58 -08:00
c14d3982ac ValidatorSetUpdates -> ValidatorUpdates 2017-12-20 00:02:41 -08:00
b70ae4919b Update glide file 2017-12-19 20:47:22 -08:00
ca56a274bd Nil bytes are OK for Get/Set etc
And s/Release/Close/g
2017-12-19 20:36:37 -08:00
c8ddf156a7 Merge pull request #104 from tendermint/revert-94-feature/timer-refactor
Revert "Refactor throttle timer"
2017-12-19 16:32:21 -06:00
e17e8e425f Revert "Refactor throttle timer" 2017-12-19 16:23:20 -06:00
be2b0fa31e Merge pull request #103 from tendermint/revert-95-feature/repeat-timer
Revert "Refactor repeat timer"
2017-12-19 16:22:48 -06:00
70e30f74e6 Revert "Refactor repeat timer" 2017-12-19 16:16:16 -06:00
9a5b943e77 update changelog [ci skip] 2017-12-19 13:17:29 -06:00
843e1ed400 Updates -> ValidatoSetUpdates 2017-12-19 13:03:39 -06:00
4ddf212286 Merge pull request #100 from tendermint/internal-randSource
common: no more relying on math/rand.DefaultSource
2017-12-19 12:54:54 -06:00
811dc071aa protoc: "//nolint: gas" directive after pb generation (#164)
* protoc: "//nolint: gas" directive after pb generation

Fixes #138

Since we can't add package directives through the protoc
compiler, yet we need to "//nolint: gas" the Go generated
protobuf file, added a script whose purpose is to
go find the "package (\w+)$" declaration after go fmt
was run by protoc.

The competing solutions were more complex and can be
examined by visiting
https://github.com/tendermint/abci/issues/138#issuecomment-352226217

* simplify script

* rewrite script to work on Mac
2017-12-19 12:29:59 -06:00
66296fe11a updates -> validator_set_updates
ConsensusParamChanges -> ConsensusParamUpdates
2017-12-19 12:13:45 -06:00
4bca6bf6f5 fix test 2017-12-19 12:30:34 -05:00
960b25408f Store LastConsensusHash in State as well
Update all BlockValidation that it matches the last state
2017-12-19 12:28:08 -05:00
45bc106de7 Updated lite tests to set ConsensusHash in header 2017-12-19 12:28:08 -05:00
d151e36ea8 Add ConsensusHash to header 2017-12-19 12:28:08 -05:00
56cada6a0c Validate ConsensusParams returned from abci app 2017-12-19 12:28:08 -05:00
a0b2d77bef Add hash to ConsensusParams 2017-12-19 12:28:08 -05:00
030fd00232 Added tests for applying consensus param changes 2017-12-19 12:28:08 -05:00
d21f39160f Apply ConsensusParamChanges to state/State 2017-12-19 12:28:08 -05:00
4265a94bfe Update EndBlock parameters
* Update abci dependencies
* Modify references from Diffs to Changes
* Fixes issues #924
2017-12-19 12:28:08 -05:00
652d1e3de8 Merge pull request #979 from tendermint/934-node-fails-to-parse-seeds
strip protocol if defined
2017-12-19 12:26:32 -05:00
b33cff4cb7 Merge pull request #981 from tendermint/977-wal-generator
enable logging for wal_generator and set timeout to 1 min
2017-12-19 12:25:58 -05:00
e0fe84a856 Merge branch 'develop' into 977-wal-generator 2017-12-19 11:11:26 -05:00
783ffdb7fd Merge pull request #983 from tendermint/circle-testing
Circle testing
2017-12-19 11:09:22 -05:00
cb3ac6987e remove some debugs 2017-12-19 10:11:37 -05:00
5a83e58428 stop eventBus 2017-12-17 20:16:02 -06:00
4ce8448d7f Nil keys are OK, deprecate BeginningKey/EndingKey (#101)
* Nil keys are OK, deprecate BeginningKey/EndingKey
2017-12-17 13:11:28 -08:00
aab2d70dd3 Sdk2 kvpair (#102)
* Canonical KVPair in common
* Simplify common/Bytes to just hex encode
2017-12-17 13:04:15 -08:00
843b10ed26 Merge pull request #157 from tendermint/linter-fix-v2
enable linter & make deterministic
2017-12-16 23:02:05 -06:00
dd7728c4c5 Merge pull request #161 from tendermint/fix-some-vet-issues
all: fix vet issues with build tags, formatting
2017-12-16 22:40:51 -06:00
3f02ab0ead unidirectional channel 2017-12-16 22:20:07 -06:00
99c58fc561 enable logging for wal_generator and set timeout to 1 min
Refs #977
2017-12-16 21:59:10 -06:00
a86df17ceb crank city 2017-12-16 19:55:04 -05:00
5d04ccbe51 excessive logging. update tmlibs for timer fix 2017-12-16 19:16:08 -05:00
e3d244091d cleanup requested from review by @melekes 2017-12-16 15:49:38 -07:00
61dc357bb3 test/p2p/kill_all: longer timeout 2017-12-16 13:36:52 -05:00
d7cb2f850d more logs in p2p 2017-12-16 13:36:52 -05:00
bfe0a4a8ac more logging 2017-12-16 13:36:52 -05:00
0ec7909ec3 more logging in p2p and consensus 2017-12-16 13:36:52 -05:00
b5b912e2c4 Merge remote-tracking branch 'origin/977-wal-generator' into develop 2017-12-16 13:36:32 -05:00
8638961f02 common: Rand* warnings about cryptographic unsafety
Lesson articulated by @jaekwon on why we need 80 bits
of entropy at least before we can think of cryptographic
safety. math/rand's seed is a max of 64 bits so can never
be cryptographically secure.

Also added some benchmarks for RandBytes
2017-12-15 22:41:36 -07:00
e3bffd8fbd readme 2017-12-16 00:04:06 -05:00
9504a593e9 Merge pull request #980 from tendermint/fix-test-in-develop
add missing Timestamp to Votes
2017-12-15 22:11:47 -05:00
f8f28c8942 enable logging for wal_generator and set timeout to 1 min
Refs #977
2017-12-15 16:15:09 -06:00
9226659413 Merge pull request #98 from tendermint/sdk2-iterator
Sdk2 iterator
2017-12-15 15:58:48 -05:00
66b0e8fa2d fix c level db iterator 2017-12-15 15:58:23 -05:00
225eace316 dont run metalinter on circle ... 2017-12-15 15:14:48 -05:00
8fc7d63cf8 add missing Timestamp to Votes
Fixes:

```
panic: Panicked on a Sanity Check: can't encode times below 1970 [recovered]
        panic: Panicked on a Sanity Check: can't encode times below 1970

goroutine 2042 [running]:
testing.tRunner.func1(0xc420e8c0f0)
        /usr/local/go/src/testing/testing.go:711 +0x5d9
panic(0xcd9e20, 0xc420c8c270)
        /usr/local/go/src/runtime/panic.go:491 +0x2a2
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.PanicSanity(0xcd9e20, 0xf8ddd0)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/errors.go:26 +0x120
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.WriteTime(0x0, 0x0, 0x0, 0x1306440, 0xc4201607e0, 0xc420e31658, 0xc420e31680)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/time.go:19 +0x11e
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.writeReflectBinary(0xdc9e40, 0xc4201fcf30, 0x199, 0x1317b80, 0xdc9e40, 0xc98451, 0x9, 0x0, 0xdc9e40, 0xc420ead9c0, ...)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/reflect.go:525 +0x22f0
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.writeReflectBinary(0xd25400, 0xc42000e2e8, 0x196, 0x1317b80, 0xd92d60, 0xc9a195, 0xa, 0x0, 0xcc8ce0, 0xc420164920, ...)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/reflect.go:530 +0x21e7
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.writeReflectBinary(0xcc8ce0, 0xc4209f95b8, 0x197, 0x1317b80, 0xcc8ce0, 0xc9a195, 0xa, 0x0, 0xcc8ce0, 0xc420164920, ...)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/reflect.go:518 +0x2509
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.writeReflectBinary(0xd873e0, 0xc4209f9580, 0x16, 0x1317b80, 0xd79400, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/reflect.go:530 +0x21e7
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.WriteBinary(0xd873e0, 0xc4209f9580, 0x1306440, 0xc4201607e0, 0xc420e31658, 0xc420e31680)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/wire.go:80 +0x15f
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.BinaryBytes(0xd873e0, 0xc4209f9580, 0x3, 0x8, 0xc420160798)
        /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/util.go:15 +0xb8
github.com/tendermint/tendermint/blockchain.(*BlockStore).SaveBlock(0xc4201342a0, 0xc420eac180, 0xc420130640, 0xc4209f9580)
        github.com/tendermint/tendermint/blockchain/_test/_obj_test/store.go:192 +0x439
github.com/tendermint/tendermint/blockchain.TestBlockStoreSaveLoadBlock(0xc420e8c0f0)
        /go/src/github.com/tendermint/tendermint/blockchain/store_test.go:128 +0x609
testing.tRunner(0xc420e8c0f0, 0xf20830)
        /usr/local/go/src/testing/testing.go:746 +0x16d
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:789 +0x569
exit status 2
FAIL
```
2017-12-15 13:59:25 -06:00
c513649df4 strip protocol if defined
Fixes #934
2017-12-15 13:36:08 -06:00
a6911825b0 PanicCrisis is deprecated 2017-12-15 13:35:49 -06:00
eddabab5e4 Merge pull request #965 from tendermint/573-handle-corrupt-wal-file
Handle corrupt WAL file
2017-12-15 14:33:16 -05:00
3eee69de2d Merge pull request #954 from tendermint/668-send-absent-validators
Send absent validators
2017-12-15 13:55:52 -05:00
068d83bce8 Merge pull request #677 from tendermint/blockchain-test-store
blockchain: add tests for BlockStore
2017-12-15 13:33:55 -05:00
7f649ccf23 fixes from Frey's review 2017-12-15 12:21:15 -06:00
808b830942 add a unit test
Refs #668
2017-12-15 12:13:02 -06:00
d669816a1b send absent validators in BeginBlock
Refs #668
2017-12-15 12:13:02 -06:00
e40689b9cc PanicCrisis is deprecated 2017-12-15 11:59:45 -06:00
709cf18aef add gofuzz test for consensus wal 2017-12-15 11:56:24 -06:00
e57cad6c3f correct maxMsgSizeBytes 2017-12-15 11:42:53 -06:00
4f94caa1b9 explain what to do in case of truncation [ci skip] 2017-12-15 11:11:21 -06:00
78a682e4b6 blockchain: test fixes 2017-12-15 12:07:48 -05:00
a7b20d4e46 db: Simplify exists check, fix IsKeyInDomain signature, Iterator Close
+ *FSDB.HasKey now uses common.FileExists to test for file existence
+ IsKeyInDomain takes key as a []byte slice instead of as a string
to avoid extraneous []byte<-->string conversions for start and end
+ Iterator.Close() instead of Iterator.Release()
+ withDB helper to encapsulate DB creation, deferred cleanups
so that for loops can use opened DBs and discard them ASAP

Addressing accepted changes from review with @jaekwon
2017-12-15 02:58:51 -07:00
cdc7988823 common: use genius simplification of tests from @ebuchman
Massive test simplication for more reliable tests from @ebuchman
2017-12-15 02:14:08 -07:00
b5f465b4ec common: use names prng and mrand 2017-12-15 00:23:25 -05:00
21d030dbfb Merge pull request #975 from tendermint/974-fix-test-in-develop
add missing Timestamp to Vote
2017-12-14 09:22:11 -05:00
eb6d412a82 Add tests to protobuf objects for pr coverage 2017-12-14 09:35:33 +01:00
9c5e1a824d Updated naming of EndBlock parameters
* Changes -> Updates for validators
* ConsensusParams.XXXParams -> ConsensusParams.XXX
* As per feedback from Jae on PR
2017-12-14 09:27:20 +01:00
29471d75cb common: no more relying on math/rand.DefaultSource
Fixes https://github.com/tendermint/tmlibs/issues/99
Updates https://github.com/tendermint/tendermint/issues/973

Removed usages of math/rand.DefaultSource in favour of our
own source that's seeded with a completely random source
and is safe for use in concurrent in multiple goroutines.
Also extend some functionality that the stdlib exposes such as
* RandPerm
* RandIntn
* RandInt31
* RandInt63

Also added an integration test whose purpose is to be run as
a consistency check to ensure that our results never repeat
hence that our internal PRNG is uniquely seeded each time.
This integration test can be triggered by setting environment variable:
`TENDERMINT_INTEGRATION_TESTS=true`
for example
```shell
TENDERMINT_INTEGRATION_TESTS=true go test
```
2017-12-14 00:18:30 -07:00
6680240fbe Coin changes, config changes 2017-12-14 01:06:45 -05:00
72da553ed9 add missing Timestamp to Vote
Fixes #974
2017-12-13 22:24:06 -06:00
a2f7898b6d db: fix c and go iterators 2017-12-13 22:28:37 -05:00
d4aeca8ce3 fixes from @melekes 2017-12-13 20:11:11 -05:00
b78606d94f Merge pull request #967 from tendermint/feature/total-tx
Add TotalTx to block header
2017-12-13 17:09:48 -06:00
a6f719a402 Add tests for block validation 2017-12-13 19:54:16 +01:00
e0fbd148ef Merge pull request #958 from tendermint/pex-on-by-default
activate PEX reactor by default
2017-12-13 12:52:17 -06:00
2f91289880 update changelog [ci skip] 2017-12-13 12:26:12 -06:00
462b755a60 activate PEX reactor by default 2017-12-13 12:25:48 -06:00
0a2ecaa393 Merge pull request #953 from tendermint/feature/time-fields
Add Timestamp to Proposal/Vote
2017-12-13 12:18:55 -06:00
895e14d6bd Update Diffs to Changes, fix README 2017-12-13 17:57:43 +01:00
25f6f6518c Update the ResponseEndBlock values
* Rename diffs -> changes
* Add consensus_param_changes

For context, see:
https://github.com/tendermint/tendermint/issues/924
https://github.com/tendermint/tendermint/issues/952
2017-12-13 17:50:24 +01:00
85710237fd Fabo coin 2017-12-13 10:25:23 -05:00
dedf03bb81 Add TotalTx to block header, issue #952
Update state to keep track of this info.
Change function args as needed.
Make NumTx also an int64 for consistency.
2017-12-13 12:20:53 +01:00
318982c0ba checkKeyCondition -> IsKeyInDomain 2017-12-13 01:34:00 -05:00
a80b66268f Merge pull request #97 from tendermint/rm-root-flag
remove deprecated --root flag
2017-12-12 23:29:36 -06:00
541780c6df uncomment tests 2017-12-12 23:23:49 -06:00
c532e8cabc add \n to Printf lines 2017-12-12 22:44:55 -06:00
5636a02d03 Remove GetError() from Iterator 2017-12-12 19:19:26 -08:00
edf07760d6 db: fsdb iterator 2017-12-12 21:08:38 -05:00
bcacaf164b db: cleveldb iterator 2017-12-12 20:58:35 -05:00
3e5dbef6a2 db: goleveldb iterator 2017-12-12 20:38:03 -05:00
39e40ff5ce db: memdb iterator 2017-12-12 20:06:50 -05:00
bb115d4d61 cleanupDBDir 2017-12-12 19:28:52 -05:00
bbc3b807c6 all: fix vet issues with build tags, formatting
* Build tags need to come before the package name
and have at least a blank line, between them and
the package, please see
  https://golang.org/pkg/go/build/#hdr-Build_Constraints
* fmt.Println doesn't take formatting verbs
* Fix a missing formatting argument to fmt.Printf
2017-12-12 17:23:16 -07:00
ba8c5045b5 db: fixes to fsdb and clevledb 2017-12-12 19:22:08 -05:00
c547caf04f db: some test cleanup 2017-12-12 19:08:22 -05:00
5ea42475ce cmd/abci-cli: implement batch
Can now run batch which can be tested by:
```shell
echo -e "echo foo\necho blue" | abci-cli batch
```

giving
```shell
I[12-12|07:55:55.513] Starting socketClient
module=abci-client impl=socketClient
-> code: OK
-> data: foo
-> data.hex: 0x666F6F

-> code: OK
-> data: blue
-> data.hex: 0x626C7565

```
2017-12-12 16:57:51 -07:00
cabc516726 batch: progress 2017-12-12 16:57:51 -07:00
ecc13d5a8e cmd/abci-cli: use a single connection per session
Use the single client connection at startup time
for sending over commands instead of shelling out
for every command.
This code fixes the regression from
https://github.com/tendermint/abci/pull/117
which instead used "os/exec".Command with:
    "abci-cli <the_command> [args...]"

The purpose of this code is to restore us
back to the state after cobra replace urlfave/cli.
There is still a bit of work to implement Batch
itself, but that should be simpler as a focused
command.

Fixes #133
2017-12-12 16:57:51 -07:00
5b7f90dfb2 db: test panic on nil key 2017-12-12 18:42:47 -05:00
781f6c5d22 db: some comments in types.go 2017-12-12 18:04:05 -05:00
7f650cea86 Remove Prev from Iterator 2017-12-12 14:45:31 -08:00
0d03cd9e31 Make it compile 2017-12-12 14:00:03 -08:00
64f056b57d Merge branch '916-remove-sleeps-from-tests' into develop 2017-12-12 16:43:36 -05:00
90df9fa1bf p2p/trust: remove extra channels 2017-12-12 16:43:19 -05:00
50a30aafc1 New canonical Iterator 2017-12-12 12:44:47 -08:00
eae6e6381e trust metric is now a service and the test ticker has been added 2017-12-12 15:33:42 -05:00
6633889632 Short-circuit assertions in test command 2017-12-12 21:06:56 +01:00
04a18e0a97 briefly describe the recover process [ci skip] 2017-12-12 13:03:09 -06:00
06aece31cf lower the max message size 2017-12-12 13:02:40 -06:00
e0296d6c3c consensus: fix makeBlockchainFromWAL 2017-12-12 12:14:15 -05:00
f39b575503 remove deprecated --root flag 2017-12-12 16:55:41 +00:00
310beae63c types: check ResponseCheckTx too 2017-12-12 10:14:50 -05:00
5ffb5f01cc Add more tests for Proposal/Vote serialization
String() and Proposal valid after serializing.
To be safe, but mainly to increase test coverage for the PR
2017-12-12 12:59:51 +01:00
8576ad58bd Cleanup canonical json 2017-12-12 12:59:51 +01:00
c4860f6c29 Force CanonicalTime to UTC
fixes issue with vote serialization breaking the signatures
2017-12-12 12:59:51 +01:00
850310b034 Add test to isolate precommit failure
types/vote_test.go now checks signature on a serialized and
then deserialized vote. Turns out go-wire time encoding doesn't
respect timezones, and the signatures don't check out.
2017-12-12 12:59:51 +01:00
a29c781295 Add default timestamp to all instances of *types.Vote 2017-12-12 12:59:51 +01:00
599673690c Add timestamp to vote canonical encoding 2017-12-12 12:59:51 +01:00
7deda53b7c Add Timestamp to Proposal for issue #929
Store it as time.Timestamp locally, encode it as RFC3339 with milliseconds
before signing the canonical form.
2017-12-12 12:59:51 +01:00
7167d4e4c7 types: compile type assertions to avoid sneaky runtime surprises
Ensure that the types in result.go implement both
json.Marshaler and json.Unmarshaler
and thus avoid any accidental deletions of their respective
methods which would then cause surprises at runtime.
2017-12-12 01:15:39 -07:00
5ecae52bf1 Merge branch 'master' into develop 2017-12-12 02:31:47 -05:00
ac2d0edb2f Merge pull request #964 from tendermint/fix-gometa-makefile
fix gometalinter.v2 automatically
2017-12-12 02:26:18 -05:00
ae632654d2 add tools check with short circuit 2017-12-11 23:00:18 -08:00
88f5f21dbb Merge pull request #960 from tendermint/release-v0.14.0
Release v0.14.0
2017-12-12 01:28:35 -05:00
49e5510953 remove tools from all 2017-12-11 21:44:53 -08:00
a6644f7477 remove gopath prefixes
it's safe because I added GOPATH to PATH earlier today
2017-12-11 23:05:22 -06:00
10265d8667 add tools to make all because it's required for test target 2017-12-11 23:02:42 -06:00
d5ffce28fd gaia node start added to building package 2017-12-12 00:01:50 -05:00
8be708fe5b fix spelling and makefile gometalinter.v2 2017-12-11 20:48:15 -08:00
5facfafbd5 Merge branch 'develop' into release-v0.14.0 2017-12-11 23:09:04 -05:00
11761d1769 initial port of cosmos-sdk basecli proxy 2017-12-11 22:23:13 -05:00
2c14488b93 Merge pull request #963 from tendermint/remove-get-deps-from-makefile
Remove get_deps, update_deps and list_deps from Makefile
2017-12-11 21:56:05 -05:00
c127bce73b Merge pull request #962 from tendermint/wait-a-little-longet-on-ci
wait 5 sec for a block on CircleCI
2017-12-11 21:54:57 -05:00
af79a2a59e fix error msg 2017-12-11 19:50:05 -06:00
ee66476d62 set max msg size
otherwise, it is easy to get OutOfMemory panic (somebody can even expoit
this)
2017-12-11 19:48:57 -06:00
40f9261d48 handle data corruption errors
Refs #573
2017-12-11 19:48:20 -06:00
69205594cc add gopath to path on CircleCI 2017-12-11 16:59:08 -06:00
d943f66abc remove get_deps, update_deps and list_deps
Rationale: they only lead to broken builds and should not be used by
anyone.
2017-12-11 16:55:40 -06:00
b2385b46cf wait 5 sec for a block on CircleCI
Fixes:
```
--- FAIL: TestHandshakeReplaySome (12.40s)
        replay_test.go:332: waited too long for tendermint to produce 6 blocks
```
2017-12-11 16:22:27 -06:00
2af32d6665 changelog and version bump 2017-12-11 15:05:56 -05:00
5c58db3bb4 changelog [ci skip] 2017-12-11 14:49:34 -05:00
24a9491203 Merge pull request #955 from tendermint/939-p2p-exponential-backoff-on-reconnect
p2p: exponential backoff on reconnect. closes #939
2017-12-11 14:25:39 -05:00
5511bd8e85 p2p: exponential backoff on reconnect. closes #939 2017-12-11 13:41:09 -05:00
f1ca2b3a3a Merge pull request #698 from tendermint/feat-appveyor
WIP: Run tests on AppVeyor
2017-12-10 20:06:34 -05:00
10fcefe346 appveyor: use make 2017-12-10 20:07:44 -05:00
0bfc11f1ba blockchain: note about store tests needing simplification ... 2017-12-10 20:03:58 -05:00
96998a5498 blockchain: Block creator helper for compressing tests as per @ebuchman 2017-12-10 19:58:22 -05:00
2da5299924 blockchain: less fragile and involved tests for blockstore
With feedback from @ebuchman, to make the tests nicer
and less fragile.
2017-12-10 19:58:22 -05:00
83b40b25d6 blockchain: deduplicate store header value tests 2017-12-10 19:57:06 -05:00
05f30b3e28 blockchain: updated store docs/comments from review 2017-12-10 19:57:06 -05:00
116a61beb1 blockchain: update store comments 2017-12-10 19:57:06 -05:00
8c86bb8024 blockchain: add tests and more docs for BlockStore
Add tests to test store, to the fullest reasonable extent for
paths that can taken by input arguments altering internal behavior,
as well as by mutating content in the DB.
2017-12-10 19:54:34 -05:00
41bb2c2663 Merge pull request #931 from tendermint/785-wal-improvements
[consensus] remove WAL separator
2017-12-10 19:46:02 -05:00
e7b9cd8ee8 Merge branch 'develop' into 785-wal-improvements 2017-12-10 19:45:52 -05:00
3019b9f320 Merge pull request #948 from tendermint/945-transparent-websocket
bring back transparent websocket (Refs #945)
2017-12-10 19:05:32 -05:00
d836ee056d Merge pull request #96 from tendermint/tm-945
add String method to Query interface
2017-12-10 19:05:00 -05:00
60872d7d7c Merge pull request #949 from tendermint/docs/trust-metric-usage
Docs/trust metric usage
2017-12-10 19:01:16 -05:00
a37c1143ca adr: update 007 trust metric usage 2017-12-10 19:00:44 -05:00
d6e821ea4f linter: enable in CI & make deterministic 2017-12-10 22:34:38 +00:00
a0b692c86d Add PushBytes to Heap 2017-12-10 14:23:27 -08:00
4e08ee1833 made clarifications based on odeke-em's PR comments 2017-12-10 15:39:43 -05:00
7563870d11 added the trust metric usage guide 2017-12-10 15:39:43 -05:00
03dfb724c7 Change heap.Push to mean int priority 2017-12-10 10:18:35 -08:00
12c5a57415 determinisitic linter (#902)
* linter: address gosimple lints

* linter: make deterministic & a rebase fix

* lint/rpc: fix a gosimple lint

* run linter in CI

* fix rebase mistake

* fix makefile

* ugh

* revert Makefile

* add metalinter to CI

* try this

* linter: last little fix

* need glide

* better

* okayy circle, have it your way

* lints: gosimple

* pr comments
2017-12-10 17:44:22 +00:00
101680d603 update changelog [ci skip] 2017-12-10 11:35:22 -06:00
d819d5d324 update changelog [ci skip] 2017-12-10 11:34:08 -06:00
90cdffa067 fixes after my own review (Refs #945) 2017-12-10 11:29:36 -06:00
080640a171 Merge pull request #936 from tendermint/update-dockerfile-to-0.12.1
Update dockerfile to 0.12.1
2017-12-10 12:15:09 -05:00
950a64f756 bring back transparent websocket (Refs #945) 2017-12-10 01:18:10 -06:00
e4ef2835f0 return error if client already subscribed 2017-12-09 23:35:14 -06:00
cb4ba522ef add String method to Query interface
Required for https://github.com/tendermint/tendermint/issues/945
2017-12-09 23:05:13 -06:00
b50cef742d Merge pull request #943 from tendermint/feature/update-vagrantfile
Update Vagrantfile to xenial (16.04 LTS)
2017-12-09 17:03:44 -06:00
4f50935aa2 Merge pull request #946 from ricardohsd/fix-typo
consensus: Fix typo on ticker.go documentation
2017-12-09 17:03:12 -06:00
44f62e5e27 built the WaitForStop functionality into the Stop method 2017-12-09 13:25:28 -05:00
988e190ef7 Deprecated Panic* 2017-12-09 09:26:03 -08:00
59e89e7664 consensus: Fix typo on ticker.go documentation 2017-12-09 13:14:53 +01:00
5d464364a8 fixed the racy test and removed all the calls to Sleep 2017-12-08 15:51:18 -05:00
2112299586 Cleanup apt-get ala PR comments 2017-12-08 19:20:53 +01:00
c771964a40 Add vagrant_test to Makefile for integration tests 2017-12-08 18:36:58 +01:00
a199ec2813 update docker readme 2017-12-08 11:35:35 -06:00
a28b3fff49 update Dockerfile to 0.13.0 2017-12-08 11:34:34 -06:00
b49bce2bc3 Merge pull request #95 from tendermint/feature/repeat-timer
Refactor repeat timer
2017-12-08 11:31:27 -06:00
ff2fd63bf7 rename trySend to send 2017-12-08 11:17:07 -06:00
5bcd95f01f Use apt-get/ppa instead of tarballs for golang/docker
Minor cleanup and comments
2017-12-08 18:10:39 +01:00
c84494b36b Update Vagrantfile to xenial (16.04 LTS)
Note default username changed from vagrant to ubuntu in the base image.
2017-12-08 18:10:39 +01:00
7e3a5b7ce8 Merge pull request #942 from tendermint/bugfix/install-stdlib
From CGO_ENABLED=0 from make install
2017-12-08 11:03:05 -06:00
fbfd11de2c add @melekes as codeowner 2017-12-08 11:48:05 -05:00
9657d183f8 Remove CGO_ENABLED=0 from make install
It was writing to stdlib packages net, x/crypto, etc. and failing when it didn't have write access to them (which it often shouldn't)

Fixes issue #941

Explained in golang issue: golang/go#18981 (fixed in develop/1.10)
2017-12-08 17:03:09 +01:00
ec4adf21e0 Cleanup from PR comments 2017-12-08 10:15:26 +01:00
9620e36ed7 Permanent journald fix 2017-12-07 22:24:17 -05:00
b98098b1f0 Merge pull request #932 from tendermint/920-default-moniker-to-host-name
default moniker to the host name
2017-12-07 18:34:38 -05:00
1ae14e5a3d Merge pull request #933 from tendermint/880-node-fails-if-one-of-the-seeds-cannot-be-resolved
tolerate unresolvable seeds
2017-12-07 18:27:58 -05:00
1644773e69 Merge pull request #68 from tendermint/ugrade-tm-monitor-and-tm-bench
Ugrade tm monitor and tm bench
2017-12-07 14:59:01 -06:00
8879640901 [tm-monitor] fix build-all target in Makefile 2017-12-07 14:56:08 -06:00
02afeba9fa extend the list of osarch to build for 2017-12-07 14:19:06 -06:00
6f77e1cec4 update tm-monitor version to 0.3.1 2017-12-07 14:03:24 -06:00
705bf7dd1f update tm-bench version to 0.2.1 2017-12-07 14:03:05 -06:00
7a92a3b729 update docker readme 2017-12-07 13:49:29 -06:00
457c688346 update Dockerfile to point to 0.12.1 2017-12-07 13:48:31 -06:00
38b3cfafb8 update tm version to 0.12.1 in readme 2017-12-07 13:32:34 -06:00
39e354e12e [tm-bench] update to tm 0.12.1 2017-12-07 13:25:57 -06:00
c245768377 [tm-bench] update Makefile 2017-12-07 13:25:35 -06:00
c609b18698 tolerate unresolvable seeds (Refs #880) 2017-12-07 13:17:09 -06:00
5ff0bb2100 default moniker to the host name (Refs #920) 2017-12-07 12:49:29 -06:00
90944bb1a2 be specific about what type we're encoding
to be consistent with Decode, which returns TimedWALMessage
2017-12-07 11:45:50 -06:00
07571741c5 [consensus] remove WAL separator (Refs #785)
We don't really need a separator unless we have complex structures
(rows, cells like RDBMS have https://www.sqlite.org/fileformat.html).
2017-12-07 11:36:46 -06:00
cc7a87e27c Use Ticker in Repeat again to avoid drift 2017-12-07 11:22:54 +01:00
8797197cdf No more blocking on multiple Stop() 2017-12-07 10:38:50 +01:00
887d766c86 Refactored RepeatTimer, tests hang 2017-12-07 10:15:38 +01:00
14ccc8bc4c Merge pull request #930 from tendermint/468-make-consensus-data-deterministic
make consensus/test_data deterministic
2017-12-06 22:28:03 -05:00
daa6c39dcb Merge pull request #94 from tendermint/feature/timer-refactor
Refactor throttle timer
2017-12-06 18:58:23 -06:00
3779310c72 return back output internal channel (way go does with Timer) 2017-12-06 18:48:39 -06:00
5cb936fa00 fixes after my own review 2017-12-06 18:28:14 -06:00
c6f025f40e generate WAL on the fly (Refs #468) 2017-12-06 16:01:08 -06:00
8b518fadb2 Don't close throttle channel, explain why 2017-12-06 22:28:18 +01:00
e430d3f844 One more attempt with a read-only channel 2017-12-06 21:51:23 +01:00
c36867e971 upgrade tm-monitor to use tm 0.12.1 and tmlibs 0.4.1 2017-12-06 14:21:32 -06:00
9ffbb92e1a [tm-monitor] update Makefile 2017-12-06 14:21:02 -06:00
1ac4c5dd6d Made throttle output non-blocking 2017-12-06 21:20:30 +01:00
0a8721113a First pass of PR updates 2017-12-06 21:08:55 +01:00
1ade893555 More gaiacli cleanup 2017-12-06 09:41:16 -05:00
62c6b48277 Gaia build deprecated gaiacli 2017-12-06 09:39:33 -05:00
4ec7883891 Cleanup 2017-12-06 11:21:01 +01:00
dcb4395604 Refactor throttle timer 2017-12-06 11:17:50 +01:00
a2b92c0745 Merge pull request #927 from tendermint/release-v0.13.0
Release v0.13.0
2017-12-06 03:57:49 -05:00
6884463ba2 update changelog [ci skip] 2017-12-06 03:38:03 -05:00
167d0e82f9 fixes and version bump 2017-12-06 03:33:03 -05:00
fca2b508c1 Merge pull request #155 from tendermint/develop
v0.8.0 take II
2017-12-06 03:26:47 -05:00
47216538fd types: add UnmarshalJSON funcs for Response types 2017-12-06 03:19:28 -05:00
3d9113c16e Add a bit more padding to tests so they pass on osx with -race 2017-12-06 09:18:04 +01:00
42e77de6a3 changelog; minor stuff; update glide 2017-12-06 02:45:38 -05:00
12dca48768 Merge pull request #154 from tendermint/develop
Release 0.8.0
2017-12-06 02:39:56 -05:00
293cf5e634 minor fix [ci skip] 2017-12-06 02:41:14 -05:00
f860c33515 changelog and version 2017-12-06 02:33:35 -05:00
58b4a8395b Merge pull request #917 from tendermint/trust-metric-cleanup
Trust metric cleanup
2017-12-06 02:11:38 -05:00
bfcc0217f1 Merge pull request #93 from tendermint/release/0.5.0
Release/0.5.0
2017-12-06 02:08:29 -05:00
e6be03db31 update license and changelog 2017-12-06 02:05:57 -05:00
e1ee4d6bf5 types: add MarshalJSON funcs for Response types with a Code 2017-12-06 01:56:39 -05:00
d0dc04001e rpc: make time human readable. closes #926 2017-12-06 01:25:11 -05:00
e101aa9fc8 fix for legacy gowire 2017-12-06 01:21:14 -05:00
b166d627f3 bump up version to 0.5.0 2017-12-05 18:04:28 -06:00
303b6df812 update changelog 2017-12-05 18:04:07 -06:00
283462dfe4 Merge pull request #86 from tendermint/fix-lint
fix warnings
2017-12-05 17:53:38 -06:00
c325ce2182 use NoErrorf and Errorf functions 2017-12-05 17:49:42 -06:00
4b9cae8998 Merge pull request #151 from tendermint/set-option-code
ResponseSetOption includes a response Code. Closes #64"
2017-12-05 18:48:02 -05:00
1b2c383205 ResponseSetOption includes a response Code. Closes #64" 2017-12-05 18:41:52 -05:00
fff8e963f8 update readme 2017-12-05 17:45:26 -05:00
cfa14074df Merge branch 'server-test' into develop 2017-12-05 17:39:30 -05:00
f6e22e4296 update readme for notes about grpc 2017-12-05 17:22:06 -05:00
27ab1f6bd9 Merge pull request #90 from tendermint/feature/throttle-timer
test timers
2017-12-05 14:17:41 -06:00
8357326db0 Fix test command 2017-12-05 18:28:15 +01:00
2a0fbdfc97 Makefile fixes for empty GOPATH directories 2017-12-05 09:16:50 -05:00
26abd65e34 Add tests for repeat timer 2017-12-05 15:01:07 +01:00
53cdb6cf82 Demo throttle timer is broken 2017-12-05 14:49:16 +01:00
6a7c399c2d Merge pull request #923 from tendermint/enable-homebrew-installation-from-source
Enable homebrew installation from source
2017-12-05 00:50:52 -05:00
b3e1341e44 use get rev-parse --short HEAD everywhere instead of GitCommit[:8] 2017-12-04 22:16:19 -06:00
ebdc7ddf20 add missing get_vendor_deps to "make all" 2017-12-04 19:04:15 -06:00
f30ce8b210 remove GitDescribe - no such variable defined in version package
- add "-w -s" flags to reduce binary size (they remove debug info)
2017-12-04 18:19:11 -06:00
76cccfaabd get_vendor_deps does not require all the tools
- remove revision cmd
- rename ensure_tools to tools
2017-12-04 18:19:11 -06:00
440d76647d rename release to test_release 2017-12-04 17:37:32 -06:00
2cc2fade06 remove -extldflags "-static"
golang builds static libraries by default.
2017-12-04 17:35:42 -06:00
e50173c7dc merge 2 rules in .editorconfig 2017-12-04 15:01:28 -06:00
3318cf9aec do not suppose that GOPATH is added to PATH
```
brew install tendermint --HEAD
==> Installing tendermint from tendermint/tendermint
==> Cloning https://github.com/tendermint/tendermint.git
Cloning into '/Users/antonk/Library/Caches/Homebrew/tendermint--git'...
remote: Counting objects: 437, done.
remote: Compressing objects: 100% (412/412), done.
remote: Total 437 (delta 7), reused 129 (delta 2), pack-reused 0
Receiving objects: 100% (437/437), 3.04 MiB | 1006.00 KiB/s, done.
Resolving deltas: 100% (7/7), done.
==> Checking out branch develop
==> make get_vendor_deps
Last 15 lines from /Users/antonk/Library/Logs/Homebrew/tendermint/01.make:
2017-12-04 14:54:54 -0600

make
get_vendor_deps

go get github.com/mitchellh/gox github.com/tcnksm/ghr github.com/Masterminds/glide github.com/alecthomas/gometalinter
make: gometalinter: No such file or directory
make: *** [ensure_tools] Error 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/tendermint/homebrew-tendermint/issues
```
2017-12-04 15:00:16 -06:00
4769719a4b fix Errorf 2017-12-04 08:54:19 -08:00
d625020c90 Merge pull request #89 from tendermint/license
add license file (Fixes #87) [ci skip]
2017-12-04 10:39:56 -06:00
3af6044fdf add license file (Fixes #87) [ci skip] 2017-12-04 10:38:55 -06:00
e99e6ea0c7 Extend abci-cli to allow integration tests
This commit adds the basic test command 'abci-cli test' that will
allow developers of server for their own language to continuously test
their implementation.
2017-12-04 11:33:39 +01:00
17dc8a7449 SetDeleter/Batch separation 2017-12-03 21:44:48 -08:00
b37230f6db Merge pull request #918 from tendermint/abci-update
Abci update
2017-12-03 01:36:59 -05:00
1bf57a90df glide: update grpc version 2017-12-02 23:41:12 -05:00
d2db202a2d mempool: assert -> require in test 2017-12-02 23:41:09 -05:00
08857606dc test: fix test/app/counter_test.sh 2017-12-02 23:39:19 -05:00
72e389041c Merge pull request #914 from tendermint/11-response-info-with-invalid-height-crashes-tm
int64 height (Refs #911)
2017-12-02 23:17:41 -05:00
d41c0b10c8 change delta's type from int to int64 2017-12-02 11:48:24 -06:00
898ae53672 types: fix for broken customtype int in gogo 2017-12-02 12:00:46 -05:00
48413b4839 Merge pull request #149 from tendermint/gogo-int
Gogo int
2017-12-02 11:52:50 -05:00
2b804bb5a1 remove custom type int https://github.com/gogo/protobuf/issues/359 2017-12-02 11:47:02 -05:00
9e20cfee0e glide 2017-12-02 01:56:40 -05:00
9afd3da3b2 changelog 2017-12-02 01:56:21 -05:00
82d56571b5 types: int32 with gogo int 2017-12-02 01:48:46 -05:00
3890a2058f types: IsOK() 2017-12-02 01:48:37 -05:00
9af8da7aad update for new abci int types 2017-12-02 01:47:55 -05:00
c9be2b89f9 mempool: return error on cached txs 2017-12-02 01:15:11 -05:00
388f66c9b3 types: drop uint64 from protobuf.go 2017-12-02 01:07:17 -05:00
cd5a5d332f remove comments for uint64 related to possible underflow [ci skip] 2017-12-01 23:30:08 -06:00
cb9a1dbb4f p2p/trust: lock on Copy() 2017-12-01 23:35:17 -05:00
814541f6d9 p2p/trust: split into multiple files and improve function order 2017-12-01 23:35:12 -05:00
89cbcceac4 error if app returned negative last block height (Fixes #911) 2017-12-01 21:56:08 -06:00
10f7858453 use rand.Int63n, remove underflow check, remove unnecessary cast 2017-12-01 19:22:18 -06:00
922af7c405 int64 height
uint64 is considered dangerous. the details will follow in a blog post.
2017-12-01 19:04:53 -06:00
e9f8e56895 fixes from rebase 2017-12-01 17:25:44 -05:00
3eb069a50c no need in this hack since we have replay now 2017-12-01 17:17:22 -05:00
f1fbf995f7 protect ourselves again underflow (Refs #911) 2017-12-01 17:17:22 -05:00
86af889dfb remove unnecessary casts (Refs #911) 2017-12-01 17:17:22 -05:00
b3492356e6 uint64 height (Refs #911) 2017-12-01 17:17:22 -05:00
8831249e95 Merge pull request #147 from tendermint/int64
Int64
2017-12-01 16:12:20 -05:00
026ff5e89f Merge pull request #148 from tendermint/begin_block
Begin block
2017-12-01 16:11:49 -05:00
ebc543ebe3 fix warnings 2017-12-01 09:51:37 -08:00
3905c11934 Crude hack from developers to fix gometalinter dependency 2017-12-01 12:03:16 -05:00
fc90b2de1c fix dummy test 2017-12-01 11:33:07 -05:00
b20273439d types: RequestBeginBlock includes absent and byzantine validators 2017-12-01 03:00:11 -05:00
9272756c49 types: add note about ReadMessage having no cap 2017-12-01 03:00:11 -05:00
3d3d1288d1 types: consolidate some file 2017-12-01 03:00:11 -05:00
b2489b4318 Merge pull request #912 from bluecollarcoding/fix/docs
docs:clarify py-abci/py-tendermint
2017-12-01 02:57:32 -05:00
a5a7e7ac56 Merge pull request #913 from bluecollarcoding/zramsay-patch-1
codecov: ignore docs files
2017-12-01 02:56:34 -05:00
74cbfc68a1 Merge pull request #835 from tendermint/feature/indexing
Indexing DeliverTx tags
2017-12-01 02:54:30 -05:00
b39e768a1a disable metalinter on CI 2017-12-01 02:50:17 -05:00
b7a75ce8c3 update readme 2017-12-01 01:16:00 -05:00
0ad7dea71f uint64 -> int64 2017-12-01 00:41:07 -05:00
b59fe60e65 abci-cli: prefix flag variables with flag 2017-12-01 00:35:14 -05:00
6423306980 TestIndexAllTags (unit) 2017-11-30 23:02:40 -06:00
c5b62ce1ee correct abci version 2017-11-30 20:20:35 -06:00
e538e0e077 config variable to index all tags 2017-11-30 20:02:39 -06:00
d9d5e35ca5 Merge pull request #145 from tendermint/types-makeover
Types makeover
2017-11-30 20:19:21 -05:00
5d2838ebab fix from review 2017-11-30 20:17:06 -05:00
ed393f9934 abci-cli: print OK if code is 0 2017-11-30 17:51:40 -05:00
e3f6666ecc update changelog; add rudis script for safe keeping 2017-11-30 17:48:05 -05:00
f00a19eaad fix tutorial output to remove code msg 2017-11-30 17:36:16 -05:00
10031f57d5 fix grpc version; add log_level and some logging 2017-11-30 17:20:36 -05:00
550d6a6081 shame: forgot to add new code pkg 2017-11-30 15:37:31 -05:00
81e4effbdb types: use data.Bytes directly in type.proto via gogo/protobuf. wow 2017-11-30 15:31:12 -05:00
24fbe291ab update glide; update services for new signature 2017-11-30 15:21:00 -05:00
308cb8e454 use gogo/protobuf 2017-11-30 14:47:09 -05:00
42a8e3240c remove CodeType 2017-11-30 14:29:12 -05:00
9314e451c8 Update .codecov.yml 2017-11-30 19:01:50 +00:00
3b61e2854a docs: correction, closes #910 2017-11-30 18:27:46 +00:00
03222d834b update abci dependency 2017-11-30 11:46:28 -06:00
22b491bb19 Merge pull request #144 from tendermint/feature/tags-helper-methods
add 2 helper methods for building KVPair(s)
2017-11-30 11:37:03 -06:00
20befcf6d6 add 2 helper methods for building KVPair(s) 2017-11-30 11:17:35 -06:00
5efc536ba3 Merge pull request #64 from tendermint/883-improve-docker-docs
Improve docker docs
2017-11-30 13:29:10 +00:00
b89fd815a5 Merge pull request #141 from tendermint/feature/add-tags-to-dummy-app
include tags into dummy application DeliverTx response
2017-11-30 03:02:11 +00:00
32a6545604 changelog [ci skip] 2017-11-30 03:02:48 +00:00
3b994b4e8a dummy: include app.key tag 2017-11-30 02:45:40 +00:00
cb9743e567 dummy app now returns one DeliverTx tag 2017-11-29 20:30:37 -06:00
72c3ea3872 include tags into dummy application DeliverTx response
Refs https://github.com/tendermint/tendermint/pull/835
2017-11-29 20:19:58 -06:00
66ad366a4f test searching for tx with multiple same tags 2017-11-29 20:04:26 -06:00
864ad8546e more test cases 2017-11-29 20:04:00 -06:00
58789c52cd add example for tx_search endpoint 2017-11-29 15:30:12 -06:00
a762253e24 do not use AddBatch, prefer copying for now 2017-11-29 15:25:12 -06:00
10d893ee9b update deps 2017-11-29 15:19:45 -06:00
acbc0717d4 add client methods 2017-11-29 15:19:44 -06:00
1e19860585 fixes from my own review 2017-11-29 14:24:18 -06:00
09941b9aa9 fix metalinter warnings 2017-11-29 14:24:18 -06:00
2a5e8c4a47 add minimal documentation for tx_search RPC method [ci skip] 2017-11-29 14:24:18 -06:00
686e0eea9f extract indexing goroutine to a separate indexer service 2017-11-29 14:24:18 -06:00
91f2184003 fixes after bucky's review 2017-11-29 14:24:18 -06:00
3e577ccf4f add tx_search RPC endpoint 2017-11-29 14:24:18 -06:00
ea0b205455 searching transaction results 2017-11-29 14:24:18 -06:00
16cf7a5e0a use a switch when validating tags 2017-11-29 14:23:44 -06:00
56abea7427 rename tm.events.type to just tm.event 2017-11-29 14:23:44 -06:00
461a143a2b remove tx.hash tag from config because it's mandatory 2017-11-29 14:23:44 -06:00
f65e357d2b adapt Tendermint to new abci.Client interface
which was introduced in https://github.com/tendermint/abci/pull/130
2017-11-29 14:23:44 -06:00
4a31532897 remove unreachable code 2017-11-29 14:23:44 -06:00
29cd1a1b8f rewrite indexer to be a listener of eventBus 2017-11-29 14:23:44 -06:00
cd4be1f308 add tx_index config 2017-11-29 14:23:43 -06:00
acae38ab9e validate tags 2017-11-29 14:23:43 -06:00
a52cdbfe43 extract tags from DeliverTx/Result
and send them along with predefined
2017-11-29 14:23:43 -06:00
f233cde9a9 Merge pull request #807 from tendermint/45-change-common-start-signature
service#Start, service#Stop signatures were changed
2017-11-29 20:23:07 +00:00
ceb8ba2e15 comment out gas linter for now 2017-11-29 13:18:34 -06:00
21fb781989 Merge pull request #84 from tendermint/85-indexing
query#Conditions for indexing
2017-11-29 12:49:38 -06:00
c9694b1ba1 fix warnings 2017-11-29 12:44:16 -06:00
3822727981 add Conditions function
Refs https://github.com/tendermint/tendermint/pull/835
2017-11-29 12:44:16 -06:00
850fd24ee9 Merge pull request #85 from tendermint/85-indexing-2
IntInSlice and StringInSlice functions
2017-11-29 12:37:33 -06:00
33abe87c5b IntInSlice and StringInSlice functions
Refs https://github.com/tendermint/tendermint/pull/835
2017-11-29 12:18:03 -06:00
aab54011b3 docs/install: add note about putting GOPATH/bin on PATH 2017-11-29 18:05:51 +00:00
691e266bef ignore ErrAlreadyStarted when starting addrbook in PEXReactor 2017-11-29 10:53:30 -06:00
c6b2334fa3 check for error when stopping WSClient 2017-11-29 10:38:58 -06:00
69b5da766c service#Start, service#Stop signatures were changed
See https://github.com/tendermint/tmlibs/issues/45
2017-11-29 10:38:58 -06:00
468c4188c1 Merge pull request #51 from tendermint/keystore
Keybase
2017-11-29 15:25:59 +01:00
1e12754b3a Merge pull request #75 from tendermint/45-change-common-start-signature
change common start signature
2017-11-29 06:05:50 +00:00
4d991acae0 common: comments for Service 2017-11-29 05:16:15 +00:00
ddd141c1c5 Merge branch 'develop' into 45-change-common-start-signature 2017-11-29 05:08:12 +00:00
57fea1335a Makefile and linter 2017-11-29 05:08:05 +00:00
a393cf4109 Merge pull request #904 from tendermint/fix-atomic-broadcast-test
test/p2p/atomic_broadcast: wait for node heights before checking app hash
2017-11-28 08:21:15 +00:00
5c29adc081 Merge pull request #139 from tendermint/sunset-tmlibs-process
tests: sunset tmlibs/process.Process
2017-11-28 08:04:27 +00:00
67a81c13e2 run linter on make test 2017-11-28 07:55:07 +00:00
bb141794c8 client: use vars for retry intervals 2017-11-28 07:47:51 +00:00
9ed5787b6a tests: fix ensureABCIIsUp 2017-11-28 07:38:01 +00:00
1b120466ee Merge pull request #892 from tendermint/mempool-Stop-method
mempool: implement Mempool.CloseWAL
2017-11-28 06:58:01 +00:00
c8c533cc23 test/p2p/atomic_broadcast: wait for node heights before checking app hash 2017-11-28 05:51:32 +00:00
6231652e87 tests: sunset tmlibs/process.Process
Updates https://github.com/tendermint/tmlibs/issues/81

No longer using tmlibs/process.Process as we deemed
it racy and would incur a maintenance cost yet not
used anywhere else but in these tests and not in actual
code.
2017-11-27 22:50:31 -07:00
c2fcc093b2 remove bool from Service#Reset 2017-11-27 23:42:36 -06:00
1e8deacf2e Merge branch 'master' into develop 2017-11-28 04:39:41 +00:00
f75339264f Merge pull request #83 from tendermint/gut-process
remove package process
2017-11-27 22:37:35 -06:00
3595b5931a mempool: implement Mempool.CloseWAL
Fixes https://github.com/tendermint/tendermint/issues/890

Add a CloseWAL method to Mempool to close the underlying WAL file
and then discard it so that further writes to it will have no effect.
2017-11-27 21:37:25 -07:00
c7f923c5b0 Merge pull request #903 from tendermint/hotfix-v0.12.1
Upgrade tmlibs dependency to build on Windows
2017-11-28 04:36:52 +00:00
e07ad01f62 remove package process
Fixes https://github.com/tendermint/tmlibs/issues/81

That package is untested and racy, and not used except in
a test, but even that's now gutted with
  https://github.com/tendermint/abci/pull/139
so the general consensus is that we sunset this package.
2017-11-27 21:24:46 -07:00
25f9eb782b Upgrade tmlibs dependency to build on Windows 2017-11-28 04:04:58 +00:00
2009c3d4f1 Merge pull request #884 from tendermint/wal-benchmark-decode
consensus/WAL: benchmark WALDecode across data sizes
2017-11-28 03:39:55 +00:00
eb31c04f47 Merge tag 'v0.4.1' into develop
Tagged 0.4.1 release
2017-11-27 21:38:24 -06:00
b854baa1fc Merge branch 'release/0.4.1' 2017-11-27 21:38:12 -06:00
3244f73f32 update version 2017-11-27 21:37:39 -06:00
4e705a3157 update changelog 2017-11-27 21:37:15 -06:00
c3632bc54a Merge pull request #703 from tendermint/fix-linting
add metalinter to CI and include fixes
2017-11-28 00:02:52 +00:00
460c045fcc Merge pull request #130 from tendermint/feature/tags-in-deliver-tx
Tags in DeliverTx response
2017-11-27 22:41:57 +00:00
d9c87a21a6 run metalinter in make test and run_test.sh 2017-11-27 22:39:12 +00:00
2e76b23c9a rpc: fix tests 2017-11-27 22:39:12 +00:00
9529f12c28 more linting 2017-11-27 22:39:12 +00:00
55b81cc1a1 address linting FIXMEs 2017-11-27 22:39:12 +00:00
c4caad7720 lint madness 2017-11-27 22:39:12 +00:00
2563b4fc92 lint fixes 2017-11-27 22:39:12 +00:00
6f3c05545d fix new linting errors 2017-11-27 22:39:12 +00:00
414a8cb0ba pass tests! 2017-11-27 22:39:12 +00:00
c84c7250ba linting: few more fixes 2017-11-27 22:39:12 +00:00
c7b6faf96a bad goimports 2017-11-27 22:39:12 +00:00
fe37afc0d7 do i need this? 2017-11-27 22:39:12 +00:00
478a10aa41 Write doesn't need error checked 2017-11-27 22:39:12 +00:00
d033470817 lil fixes 2017-11-27 22:39:12 +00:00
7ad8a8ab55 Tests almost passing 2017-11-27 22:39:12 +00:00
a15c7f221d linting: moar fixes 2017-11-27 22:39:11 +00:00
d7cb291fb2 errcheck; sort some stuff out 2017-11-27 22:39:11 +00:00
563faa98de address comments, pr #643 2017-11-27 22:39:11 +00:00
9c62ed4595 run linting first for tests 2017-11-27 22:39:11 +00:00
fe694e1fe1 ... 2017-11-27 22:39:11 +00:00
bc2aa79f9a linter: sort through each kind and address small fixes 2017-11-27 22:39:11 +00:00
48aca642e3 linter: address deadcode, implement incremental lint testing 2017-11-27 22:39:11 +00:00
15651a931e linting errors: tackle p2p package 2017-11-27 22:39:11 +00:00
68e7983c70 linting errors: afew more 2017-11-27 22:39:11 +00:00
8f0237610e linting errors: clean it all up 2017-11-27 22:39:11 +00:00
b75d4f73e7 errcheck: PR comment fixes 2017-11-27 22:39:11 +00:00
b3c5933a23 state: return to-be-used function 2017-11-27 22:39:11 +00:00
331857c9e6 linting: apply errcheck part2 2017-11-27 22:39:11 +00:00
57ea4987f7 linting: apply errcheck part1 2017-11-27 22:39:11 +00:00
d95ba866b8 lint: apply deadcode/unused 2017-11-27 22:39:11 +00:00
1721543e5c linting: apply misspell 2017-11-27 22:39:11 +00:00
46ccbcbff6 linting: apply 'gofmt -s -w' throughout 2017-11-27 22:39:11 +00:00
fc33576bac linting: replace megacheck with metalinter 2017-11-27 22:39:11 +00:00
a0bf6dc1a1 move comment 2017-11-27 16:28:34 -06:00
0981c174cc update README for CheckTx Gas and Fee 2017-11-27 22:28:41 +00:00
366bc00b70 Merge pull request #895 from tendermint/894-vagrant-instructions
add Vagrant instructions to CONTRIBUTING guides (Refs #894) [ci skip]
2017-11-27 20:54:32 +00:00
ab51bdef99 types.pb.go isnt linted. use nolint :( 2017-11-27 20:53:03 +00:00
26d967af7e linter 2017-11-27 20:42:30 +00:00
5a46675185 minor things 2017-11-27 20:27:18 +00:00
e9094fbee3 update changelog 2017-11-27 20:19:04 +00:00
e08885e3cd minor fix 2017-11-27 20:16:35 +00:00
7dc5b746ac types: add gas and fee fields to CheckTx 2017-11-27 20:10:11 +00:00
fb612e5a7b fixup tests 2017-11-27 19:52:06 +00:00
d3bac7a6fe clist: reduce numTimes in test 2017-11-27 19:49:30 +00:00
c7f54fb56c everything takes Request, returns Response; expect DeliverTx/CheckTx/Commit 2017-11-27 19:04:21 +00:00
d5cd3a111f Merge pull request #899 from tendermint/feature/lite-client
Rename certifier to lite (#784) and add godocs
2017-11-27 17:21:15 +00:00
94e400a5d6 Merge pull request #896 from tendermint/normalize-priority-and-id
normalize priority and id and remove pointers in ChannelDescriptor
2017-11-27 17:05:38 +00:00
7dd249f754 Merge pull request #882 from caffix/develop
fixed race condition reported in issue #881
2017-11-27 16:50:57 +00:00
12ae1bb5e5 Address comments 2017-11-27 16:23:56 +01:00
248f176c1f Rename light to lite 2017-11-27 16:19:00 +01:00
1871a7c3d0 Rename certifier to light (#784) and add godocs
The certifier package is renamed to light. This is more descriptive
especially in the wider blockchain context. Moreover we are building
light-clients using the light package.

This also adds godocs to all exported functions.

Furthermore it introduces some extra error handling. I've added one TODO
where I would like someone else's opinion on how to handle the error.
2017-11-27 16:18:27 +01:00
59b3dcb5cf normalize priority and id and remove pointers in ChannelDescriptor 2017-11-25 22:01:23 -08:00
30d602d6ed Merge pull request #63 from tendermint/tm-889-dev-docs
add dev docs section to readme [ci skip]
2017-11-25 13:45:28 +00:00
67d2a5f66d set Code to OK in ResponseQuery in BaseApplication
See https://github.com/tendermint/abci/pull/130#discussion_r152713220
2017-11-24 16:45:36 -06:00
fb87590c82 add Vagrant instructions to CONTRIBUTING guides (Refs #894) [ci skip] 2017-11-24 16:42:46 -06:00
38c4de3fc7 Merge pull request #891 from tendermint/fix-vagrantfile
go requires Git (Fixes #879)
2017-11-24 22:07:29 +00:00
5dd6fbcd04 rewrite ethermint section 2017-11-23 18:39:24 -06:00
5c74dd7f5b basecoin is deprecated 2017-11-23 18:39:24 -06:00
e77e5d013a don't force users to build docker 2017-11-23 18:39:23 -06:00
ae67408d13 go requires Git (Fixes #879) 2017-11-23 16:55:57 -06:00
42da8cd297 consensus/WAL: benchmark WALDecode across data sizes 2017-11-23 12:43:11 -07:00
c36ba95cf7 add dev docs section to readme [ci skip]
Refs https://github.com/tendermint/tendermint/issues/889
2017-11-23 11:22:30 -06:00
8bfb54d1aa Build Makefile changes 2017-11-23 00:10:09 -05:00
4b7260cdc5 Build Makefile changes 2017-11-23 00:07:03 -05:00
ae85a7ae41 Build Makefile changes 2017-11-22 23:59:10 -05:00
dd5f81e430 Reset Makefile changes 2017-11-22 23:56:57 -05:00
887cb6d0cd added public methods to handle locking within the trust metric 2017-11-22 23:42:38 -05:00
aeaf2d0b20 Merge branch 'develop' of https://github.com/tendermint/tendermint into develop 2017-11-22 23:11:01 -05:00
9b30fab4fc preserve behaviour of BaseApplication 2017-11-22 19:38:28 -06:00
03fafeec2f fix formatting of panicf function 2017-11-22 19:38:04 -06:00
0176a834d1 refactor code 2017-11-22 19:37:51 -06:00
cbf347e2aa add comment for Client interface [ci skip] 2017-11-22 19:07:36 -06:00
a1d529e5cf folder test fix in build 2017-11-22 19:32:39 -05:00
2cfad8523a test HumanCode 2017-11-22 18:24:53 -06:00
ce6eab5ea9 Makefile build test 2017-11-22 19:24:42 -05:00
1726e82865 add IsErr and Error method for ResultQuery 2017-11-22 18:19:41 -06:00
afb7feeea2 update CHANGELOG 2017-11-22 17:51:36 -06:00
91efacfabc remove types.Result 2017-11-22 17:44:39 -06:00
f01f2bbf3a DeliverTxSync/CheckTxSync/CommitSync now return error as well 2017-11-22 17:34:00 -06:00
01252e8cc8 mark Result as deprecated 2017-11-22 16:18:06 -06:00
5fd83b3eee implement error interface for ResponseDeliverTx/CheckTx/Commit 2017-11-22 16:17:34 -06:00
932e472986 Merge pull request #885 from AFDudley/patch-1
Update getting-started.rst to fix broken link
2017-11-22 20:29:30 +00:00
e845987503 p2p: disable trustmetric test while being fixed 2017-11-22 20:20:53 +00:00
531b1197a7 Merge pull request #843 from tendermint/refactor-mconnection-with-go-wire-1
WIP: begin parallel refactoring: go-wire Write methods and MConnection
2017-11-22 19:34:22 +00:00
52ad6242f4 Merge pull request #888 from tendermint/rm-dead-file
remove unused file
2017-11-22 18:47:30 +00:00
969b34057b remove unused file 2017-11-22 17:22:53 +00:00
e110f70b5c update glide.yaml versions with go-wire at develop branch 2017-11-22 07:34:10 -08:00
7868a3358f gather test coverage 2017-11-21 19:07:39 -06:00
52ec4efe27 retire test_integrations in favor of just make test 2017-11-21 18:11:23 -06:00
5be9c50b47 fix megacheck warning 2017-11-21 17:53:48 -06:00
f6a79dd7c5 add interface assertions for all clients 2017-11-21 17:50:06 -06:00
e6fdc98aeb update changelog 2017-11-21 17:44:22 -06:00
fbe7234639 remove Result from the client package
plus make Client interface more consistent. All *Sync functions now
return an error as a second return param. Deliver/Check/Commit use Code
to indicate errors and have IsErr() func defined on ResponseXYZ structs.
2017-11-21 17:44:13 -06:00
8e6269ce93 update README 2017-11-21 15:24:29 -06:00
e997db7a23 Merge pull request #859 from tendermint/fix/addrbook
Fix/addrbook
2017-11-21 15:31:48 +00:00
c4b695f78d minor fixes from review 2017-11-21 15:30:19 +00:00
75463b8331 Merge pull request #877 from tendermint/p2p-switch-DialSeeds-undeterministically
p2p: make Switch.DialSeeds use a new PRNG per call
2017-11-21 15:24:29 +00:00
882c25f292 Update getting-started.rst to fix broken link
fixes broken link to introduction.html
2017-11-21 10:11:48 -05:00
3a3d508e5c CheckTx and DeliverTx return ResponseCheckTx and ResponseDeliverTx respectively
Commit now returns ResponseCommit
2017-11-20 20:36:42 -06:00
92801dbd72 [dockerfile] install psmisc for tests 2017-11-20 18:30:10 -06:00
fc7db13fa8 remove tags from CheckTx
add value_type field to KVPair
2017-11-20 18:21:59 -06:00
02399071ff add ldconfig cmd to Dockerfile 2017-11-20 18:17:56 -06:00
9c8100043e made changes to address suggestions from the PR comments 2017-11-20 19:15:11 -05:00
29c1cd03ea [make install_protoc] fix folder name 2017-11-20 17:09:18 -06:00
3cbf44058d no need for protoc in make all since we have types.pb.go generated 2017-11-20 16:56:57 -06:00
8b71e47002 add linter for proto files (Fixes #128) 2017-11-20 16:56:57 -06:00
76bd68f881 add docker commands to Makefile 2017-11-20 16:56:57 -06:00
33b51378f2 reformat types.proto 2017-11-20 16:56:57 -06:00
bb0d7e9526 add tags field to DeliverTx and CheckTx 2017-11-20 16:56:57 -06:00
f07c300c14 add proto section to .editorconfig 2017-11-20 16:56:57 -06:00
87072d3810 add Dockerfile for development 2017-11-20 16:56:56 -06:00
480e4e4444 install protoc 2017-11-20 16:56:56 -06:00
031e10133c p2p: make Switch.DialSeeds use a new PRNG per call
Fixes https://github.com/tendermint/tendermint/issues/875

Ensure that every DialSeeds call uses a new PRNG seeded from
tendermint/tmlibs/common.RandInt which internally uses
crypto/rand to seed its source.
2017-11-20 15:28:42 -07:00
4087326f45 fixed race condition reported in issue #881 2017-11-20 16:47:05 -05:00
f9bc22ec6a p2p: fix comment on addPeer (thanks @odeke-em) 2017-11-20 21:36:01 +00:00
26cd99c66e p2p: fix non-routable addr in test 2017-11-20 19:56:44 +00:00
9334aad906 Merge pull request #871 from tendermint/fix/docs-860
docs: fix links
2017-11-20 19:47:18 +00:00
c695c53259 Merge pull request #876 from tendermint/p2p-extract-key-lex-check-to-variable-for-clarity
p2p: use bytes.Equal for key comparison
2017-11-20 19:33:58 +00:00
5c4397ab30 Run tests on AppVeyor 2017-11-20 13:23:28 +01:00
135a1a7cd7 db: sort keys for memdb iterator 2017-11-20 03:06:18 +00:00
5c34d087d9 p2p: use bytes.Equal for key comparison
Updates https://github.com/tendermint/tendermint/issues/850

My security alarms falsely blarred when I skimmed and noticed
keys being compared with `==`, without the proper context
so I mistakenly filed an issue, yet the purpose of that
comparison was to check if the local ephemeral public key
was just the least, sorted lexicographically.

Anyways, let's use the proper bytes.Equal check, to save future labor.
2017-11-18 23:34:27 -07:00
559bd169bd docs: fix links, closes #860 2017-11-17 14:03:43 +00:00
f8c969f5a5 Merge pull request #868 from tendermint/small-things
node: clean makeNodeInfo
2017-11-17 01:22:45 +00:00
c5253c7a31 node: clean makeNodeInfo 2017-11-17 01:22:38 +00:00
53f15fde07 update changelog 2017-11-17 00:04:03 +00:00
814f9cb566 Merge pull request #856 from tendermint/small-things
Small things
2017-11-17 00:03:57 +00:00
af0db599b0 minor fixes 2017-11-16 23:57:00 +00:00
104368bd84 Merge pull request #787 from caffix/develop
Initial Trust Metric Implementation
2017-11-16 23:51:53 +00:00
99461a178e Merge pull request #857 from gguoss/patch-1
Failed to compile comment code
2017-11-16 18:35:18 +00:00
feb3230160 some comments 2017-11-16 04:43:07 +00:00
be1a16a601 p2p/pex: simplify ensurePeers 2017-11-16 04:30:38 +00:00
8e044b0e6d p2p/addrbook: some comments 2017-11-16 04:30:23 +00:00
40e93a5f9e p2p/addrbook: fix addToOldBucket 2017-11-16 04:08:46 +00:00
435eb6e2b3 p2p/addrbook: add non-terminating test 2017-11-16 04:04:54 +00:00
8c88cc017a p2p/addrbook: addAddress returns error. more defensive PickAddress 2017-11-16 03:59:54 +00:00
ed95cc160a p2p/addrbook: simplify PickAddress 2017-11-16 02:31:47 +00:00
2f067a3f65 p2p/addrbook: addrNew/Old -> bucketsNew/Old 2017-11-16 02:28:11 +00:00
498a82784d p2p/addrbook: comments 2017-11-16 02:25:00 +00:00
b5708825a7 Failed to compile comment code 2017-11-16 09:45:58 +08:00
a724ffab25 added changes based on PR comments to the proposal 2017-11-15 17:59:48 -05:00
de34ef91d7 Merge pull request #854 from tendermint/add-go-version-to-readme
add Go version badge to README [ci skip]
2017-11-15 20:49:36 +00:00
248a9383a0 add Go version badge to README [ci skip] 2017-11-15 10:22:02 -06:00
78b4ad291c Merge pull request #853 from tendermint/p2p-netPipe-own-file
p2p: netPipe for <Go1.10 in own file with own build tag
2017-11-15 16:09:48 +00:00
086e1f6508 Make vetshadow and zach happy 2017-11-15 13:57:17 +01:00
3f9dff9aac p2p: netPipe for <Go1.10 in own file with own build tag
Follow up of 283544c7f3
putting <Go1.10 implementation of netPipe in its own
file and protect it with its separate build tag.
2017-11-14 22:23:48 -07:00
443854222c Merge pull request #852 from tendermint/net-conn-SetDeadline-wraps
p2p: use fake net.Pipe since only >=Go1.10 implements SetDeadline
2017-11-15 05:09:39 +00:00
283544c7f3 p2p: use fake net.Pipe since only >=Go1.10 implements SetDeadline
Fixes https://github.com/tendermint/tendermint/issues/851

Go1.9 and below's net.Pipe did not implement the SetDeadline
method so after commit
e2dd8ca946
this problem was exposed since now we check for errors.

To counter this problem, implement a simple composition for
net.Conn that always returns nil on SetDeadline instead of
tripping out.

Added build tags so that anyone using go1.10 when it is released
will be able to automatically use net.Pipe's net.Conns
2017-11-14 22:03:23 -07:00
20576cab5f go 1.9.2 dependency added 2017-11-14 23:17:41 -05:00
49faa79bdc Merge pull request #848 from tendermint/p2p-catch-conn.SetDeadline-errors
p2p: peer should respect errors from SetDeadline
2017-11-15 03:34:58 +00:00
7670049a31 Merge pull request #845 from tendermint/fix/826-wait-for-rpc
rpc: wait for rpc servers to be available in tests
2017-11-15 03:29:05 +00:00
0cd642bca7 Merge pull request #849 from tendermint/846-fix-TestFullRound1-race
fix TestFullRound1 race (Refs #846)
2017-11-15 03:27:59 +00:00
fe3c92ecce unescape $NODE_FLAGS (see comment) 2017-11-14 20:56:39 -06:00
a969e24177 crank context timeouts 2017-11-15 01:42:15 +00:00
7b0fa6c889 p2p: peer should respect errors from SetDeadline
Noticed while auditing the code that we aren't respecting
(*net.Conn) SetDeadline errors which return after
a connection has been killed and is simultaneously
being used.

For example given program, without SetDeadline error checks
```go
package main

import (
  "log"
  "net"
  "time"
)

func main() {
  conn, err := net.Dial("tcp", "tendermint.com:443")
  if err != nil {
    log.Fatal(err)
  }
  go func() {
    <-time.After(400 * time.Millisecond)
    conn.Close()
  }()
  for i := 0; i < 5; i++ {
    if err := conn.SetDeadline(time.Now().Add(time.Duration(10 * time.Second))); err != nil {
      log.Fatalf("set deadline #%d, err: %v", i, err)
    }
    log.Printf("Successfully set deadline #%d", i)
    <-time.After(150 * time.Millisecond)
  }
}
```

erraneously gives
```shell
2017/11/14 17:46:28 Successfully set deadline #0
2017/11/14 17:46:29 Successfully set deadline #1
2017/11/14 17:46:29 Successfully set deadline #2
2017/11/14 17:46:29 Successfully set deadline #3
2017/11/14 17:46:29 Successfully set deadline #4
```

However, if we properly fix it to respect that error with
```diff
--- wild.go 2017-11-14 17:44:38.000000000 -0700
+++ main.go 2017-11-14 17:45:40.000000000 -0700
@@ -16,7 +16,9 @@
    conn.Close()
  }()
  for i := 0; i < 5; i++ {
-   conn.SetDeadline(time.Now().Add(time.Duration(10 * time.Second)))
+   if err := conn.SetDeadline(time.Now().Add(time.Duration(10 *
time.Second))); err != nil {
+     log.Fatalf("set deadline #%d, err: %v", i, err)
+   }
    log.Printf("Successfully set deadline #%d", i)
    <-time.After(150 * time.Millisecond)
  }
```

properly catches any problems and gives
```shell
$ go run main.go
2017/11/14 17:43:44 Successfully set deadline #0
2017/11/14 17:43:45 Successfully set deadline #1
2017/11/14 17:43:45 Successfully set deadline #2
2017/11/14 17:43:45 set deadline #3, err: set tcp 10.182.253.51:57395:
use of closed network connection
exit status 1
```
2017-11-14 18:01:51 -07:00
fa60d8120e fix TestFullRound1 race (Refs #846)
```
==================
WARNING: DATA RACE
Write at 0x00c42d7605f0 by goroutine 844:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).updateToState()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:465 +0x59e
I[11-14|22:37:28.781] Added to prevote                             vote="Vote{0:646753DCE124 1/02/1(Prevote) E9B19636DCDB {/CAD5FA805E8C.../}}" prevotes="VoteSet{H:1 R:2 T:1 +2/3:<nil> BA{2:X_} map[]}"
  github.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1229 +0x16a9
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1135 +0x721
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1087 +0x153
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1114 +0xa34
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1423 +0xdd6
  github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:1317 +0x77
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:565 +0x7a9
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:523 +0x6d2

Previous read at 0x00c42d7605f0 by goroutine 654:
  github.com/tendermint/tendermint/consensus.validatePrevote()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/common_test.go:149 +0x57
  github.com/tendermint/tendermint/consensus.TestFullRound1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state_test.go:256 +0x3c5
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:746 +0x16c

Goroutine 844 (running) created at:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).startRoutines()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state.go:258 +0x8c
  github.com/tendermint/tendermint/consensus.startTestRound()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/common_test.go:118 +0x63
  github.com/tendermint/tendermint/consensus.TestFullRound1()
      /home/vagrant/go/src/github.com/tendermint/tendermint/consensus/state_test.go:247 +0x1fb
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:746 +0x16c

Goroutine 654 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:789 +0x568
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1004 +0xa7
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:746 +0x16c
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1002 +0x521
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:921 +0x206
  main.main()
      github.com/tendermint/tendermint/consensus/_test/_testmain.go:106 +0x1d3
==================
```
2017-11-14 17:41:30 -06:00
8b7649b90c enhancements made in response to PR full review comments 2017-11-14 18:26:06 -05:00
687834c99e added initial trust metric test routines 2017-11-14 18:26:06 -05:00
54c25ccbf5 integrated trust metric store as per PR comments 2017-11-14 18:26:06 -05:00
e160a6198c added initial trust metric design doc and code 2017-11-14 18:26:06 -05:00
e69d36d54f some more robust sleeps 2017-11-14 22:31:23 +00:00
844c43e044 use stdlib context 2017-11-14 22:30:00 +00:00
194712fd3b rpc: wait for rpc servers to be available in tests 2017-11-14 21:51:49 +00:00
bee7c5c7aa Merge tag 'v0.7.1' into develop
Tagged 0.7.1 release
2017-11-14 13:10:35 -06:00
76ef8a0697 Merge branch 'release/0.7.1' 2017-11-14 13:10:17 -06:00
bac924e399 update version 2017-11-14 13:09:27 -06:00
f808dd5596 update CHANGELOG 2017-11-14 13:09:19 -06:00
a5f624174d Merge pull request #135 from tendermint/server/minor-refactor
server: minor refactor
2017-11-14 13:02:05 -06:00
bf34c378e9 Merge pull request #136 from tendermint/update-go-version-and-deps
Update go version and deps
2017-11-14 12:58:35 -06:00
1d49453ffb fix integration tests (Fixes #131) 2017-11-14 12:53:40 -06:00
f2bf7d1b2d update go version to 1.9.2 2017-11-14 12:26:01 -06:00
a52b98c70e update deps 2017-11-14 12:25:52 -06:00
30f675aafa Merge pull request #839 from tendermint/bugfix/pubsub-failures
Fix nondeterministic tests failures related to pubsub
2017-11-14 18:13:47 +00:00
695266e907 Merge pull request #844 from tendermint/bunch-up-p2p.AddrBook-wg-calls
p2p: comment on the wg.Add before go saveRoutine()
2017-11-14 17:18:27 +00:00
3bd8782ab2 server: minor refactor 2017-11-14 17:10:22 +00:00
3972635c23 Merge pull request #129 from paulrd/patch-1
Wrong 'error' variable is being read in socket_server.go
2017-11-14 16:54:49 +00:00
3db44dacae Merge pull request #840 from tendermint/fix/tests
Fix/tests
2017-11-14 15:48:17 +00:00
62c1bc0a20 p2p: comment on the wg.Add before go saveRoutine()
Just noticed while auditing the code in p2p/addrbook.go,
wg.Add(1) but no subsequent defer.
@jaekwon and I had a discussion offline and we agreed to
comment about why the code was that way and why
we shouldn't move the wg.Add(1) into .saveRoutine() because
if go a.saveRoutine() isn't started before anyone invokes
a.Wait(), then we'd have raced a.saveRoutine().
2017-11-13 18:14:58 -07:00
2649c056cd Minor cleanup 2017-11-13 14:54:14 +01:00
9d78be41b5 Update tmlibs to sdk-develop, fix broken test 2017-11-13 14:41:00 +01:00
2d4544d6ce Tests compile 2017-11-13 14:36:43 +01:00
4173d1031e go build compiles 2017-11-13 14:36:43 +01:00
9ef978c5ec Fix errors except for es missing 2017-11-13 14:36:43 +01:00
946c9c573e Handle generating keys 2017-11-13 14:36:43 +01:00
ac841a6124 Fixed imports 2017-11-13 14:36:43 +01:00
a2583e2783 Draft of suggested changes 2017-11-13 14:36:43 +01:00
3863885c71 WIP: begin parallel refactoring with go-wire Write methods and MConnection 2017-11-12 22:11:15 -08:00
7dbf69df7d Merge pull request #132 from tendermint/use-makefile-commands-in-readme
use Makefile commands in readme [ci skip]
2017-11-12 22:31:55 -05:00
64c756de47 use Makefile commands in readme [ci skip] 2017-11-12 22:30:41 -05:00
238e2b72ee Merge pull request #834 from tendermint/829-enable-logs-by-default
Enable logs by default
2017-11-12 07:06:14 +00:00
a65ab3b0e0 Merge pull request #838 from tendermint/docker
docker update || 0.12.0
2017-11-12 06:51:01 +00:00
aba8a8f4fc consensus: crank timeout in timeoutWaitGroup 2017-11-12 06:41:15 +00:00
0448c2b437 consensus: fix LastCommit log 2017-11-12 06:40:27 +00:00
0ada0cf525 certifiers: test uses WaitForHeight 2017-11-12 00:43:16 +00:00
56e51bc113 CacheWrap() -> CacheDB() CacheDB 2017-11-11 17:37:30 -05:00
2442a0a698 Merge pull request #78 from tendermint/editorconfig
add .editorconfig
2017-11-11 11:32:59 -05:00
4ea6340f1a add .editorconfig 2017-11-11 11:25:30 -05:00
7fa12662c4 check whatever we can read from the channel
```
panic: interface conversion: interface {} is nil, not types.TMEventData

goroutine 7690 [running]:
github.com/tendermint/tendermint/consensus.waitForAndValidateBlock.func1(0xc427727620, 0x3)
        /go/src/github.com/tendermint/tendermint/consensus/reactor_test.go:292 +0x62b
created by github.com/tendermint/tendermint/consensus.timeoutWaitGroup
        /go/src/github.com/tendermint/tendermint/consensus/reactor_test.go:349 +0xa4
exit status 2
FAIL    github.com/tendermint/tendermint/consensus      38.614s

```
2017-11-10 18:16:31 -05:00
bc9c4e8dee update readme [ci skip] 2017-11-10 15:38:32 -05:00
8004af2519 update docker readme 2017-11-10 15:17:13 -05:00
21e87ebc11 update Go version to 1.9.2 2017-11-10 15:10:52 -05:00
70d8afa6e9 update Dockerfile 2017-11-10 15:09:38 -05:00
847f865438 Merge pull request #836 from tendermint/fix/tests
consensus: make mempool_test deterministic
2017-11-10 05:08:54 +00:00
2cda777900 consensus: make mempool_test deterministic 2017-11-09 23:54:02 +00:00
8481c49c82 CacheDB (#67)
* Add CacheDB & SimpleMap
* Generic memBatch; Fix cLevelDB tests
* CacheWrap() for CacheDB and MemDB
* Change Iterator to match LeviGo Iterator
* Fixes from review
* cacheWrapWriteMutex and some race fixes
* Use tmlibs/common
* NewCWWMutex is exposed.  DB can be CacheWrap'd
* Remove GetOK, not needed
* Fsdb (#72)
* Add FSDB
* Review fixes from Anton
* Review changes
* Fixes from review
2017-11-09 17:42:32 -05:00
0f96d5d1f6 Merge pull request #126 from tendermint/124-version-command
version command
2017-11-09 17:08:02 -05:00
432a7276e2 [test_integrations] enable logs from peers by default (Refs #829) 2017-11-09 15:19:49 -05:00
533f7c45eb fix bash linter warnings for atomic_broadcast integration test 2017-11-09 14:58:16 -05:00
a1cdc2b68a set logger for peer's MConnection 2017-11-09 14:57:40 -05:00
9c4d533695 Merge pull request #833 from tendermint/fix/consensus-tests
consensus: fix for initializing block parts during catchup
2017-11-09 19:04:21 +00:00
ad03491ee6 remove duplicated key 2017-11-09 13:37:29 -05:00
4b9dfc8990 consensus: fix for initializing block parts during catchup 2017-11-09 18:14:41 +00:00
43c64163d8 Update socket_server.go
This is likely related to #125
2017-11-09 13:16:35 -04:00
862d7eb82c ulimit in ansible fix 2017-11-09 11:19:06 -05:00
a46f64cd1e Merge pull request #824 from tendermint/bugfix/node_test
rewrite node test to use new pubsub
2017-11-09 01:35:35 +00:00
10e1233f14 fix megacheck issues 2017-11-08 17:29:15 -05:00
430c49ea14 update deps 2017-11-08 17:20:20 -05:00
5efe88cd10 simplify Makefile install and build commands 2017-11-08 17:20:20 -05:00
ecb1f02f77 add version cmd (Refs #124) 2017-11-08 17:20:10 -05:00
b1e7163689 rewrite node test to use new pubsub 2017-11-08 13:12:48 -05:00
c931279960 p2p: some fixes re @odeke-em issues #813,#816,#817 2017-11-08 17:54:29 +00:00
12b25fdf6e blockchain: add comment in AddPeer. closes #666 2017-11-08 02:42:27 +00:00
176c2ceed6 Merge pull request #77 from tendermint/18-unsupported-value-type
encode complex types as "%+v"
2017-11-07 21:29:54 -05:00
798848320f Merge pull request #76 from tendermint/29-log-logger-errors
log logger's errors
2017-11-07 21:29:35 -05:00
c0e2649ed6 Merge pull request #788 from tendermint/feature/548-indexing-tags
new pubsub package
2017-11-08 01:02:48 +00:00
593c127257 rpc/lib/types: RPCResponse.Result is not a pointer 2017-11-08 01:00:15 +00:00
9f6a09277e Merge pull request #812 from tendermint/808-make-connected-switches
MakeConnectedSwitches: connect first switch to others
2017-11-08 00:54:23 +00:00
dd47884661 Merge pull request #820 from tendermint/790-use-tickers-instead-of-time-Sleep
prefer tickers to time.Sleep
2017-11-08 00:53:42 +00:00
a01c226dc4 wsConnection: call onDisconnect 2017-11-07 19:22:01 -05:00
47f5e37205 copy RoundState for event 2017-11-07 23:57:23 +00:00
51c9211cf4 add test for MConnection TrySend and Send 2017-11-07 23:35:25 +00:00
7869e541f6 change MakeConnectedSwitches to not connect to itself
and a test for it
2017-11-07 18:33:00 -05:00
e0daca5693 fixes from Bucky's review 2017-11-07 18:20:24 -05:00
e8e512f1fa Merge pull request #815 from tendermint/p2p-readme-tests
P2P: readme and tests
2017-11-07 23:01:15 +00:00
37ce171061 p2p/connetion: remove panics, test error cases 2017-11-07 23:00:52 +00:00
e01986e2b3 p2p: update readme, some minor things 2017-11-07 23:00:49 +00:00
433416fef8 Merge pull request #818 from tendermint/fix/810-stuck-trailing-node
consensus: ensure prs.ProposalBlockParts is initialized. fixes #810
2017-11-07 21:52:08 +00:00
32ead683ce Adding debug option 2017-11-07 16:52:02 -05:00
2d4ad02356 prefer tickers to time.Sleep (Refs #790) 2017-11-07 15:38:25 -05:00
3b81d3fea4 consensus: ensure prs.ProposalBlockParts is initialized. fixes #810 2017-11-07 17:14:40 +00:00
e785697a64 connect first switch to others (Refs #808) 2017-11-06 23:43:40 -05:00
69447564b8 encode complex types as "%+v" (Refs #18) 2017-11-06 15:44:21 -05:00
bbe151c1d2 change max_peer_num 2017-11-06 14:25:29 -05:00
4b989151ed log logger's errors (Refs #29) 2017-11-06 14:18:42 -05:00
b4f04f196c Merge pull request #49 from tendermint/pubKey-invalid-data-returns-empty-pubKey
PubKeyFromBytes: return zero value PubKey on error
2017-11-06 13:05:06 -06:00
e6164d4052 change service#Stop to be similar to Start 2017-11-06 12:47:23 -05:00
4123d54bf6 change service#Start to return just error (Refs #45)
```
@melekes
yeah, bool is superfluous
@ethanfrey
If I remember correctly when I was writing test code, if I call Start() on a Service that is already running, it returns (false, nil). Only if I try to legitimately start it, but it fails in startup do I get an error.
The distinction is quite important to make it safe for reentrant calls. The other approach would be to have a special error type like ErrAlreadyStarted, then check for that in your code explicitly. Kind of like if I make a db call in gorm, and get an error, I check if it is a RecordNotFound error, or whether there was a real error with the db query.
@melekes
Ah, I see. Thanks. I must say I like ErrAlreadyStarted approach more (not just in Golang)
```
2017-11-06 12:18:04 -05:00
060091402b config.toml changes 2017-11-06 02:51:33 -05:00
b1d433314b app options cahgnes 2017-11-06 01:00:05 -05:00
ac0cf0b2e2 Merge pull request #74 from tendermint/73-undefined-syscall-kill
use os.Process#Kill (Fixes #73)
2017-11-04 09:07:03 -05:00
49d75e223e use os.Process#Kill (Fixes #73) 2017-11-04 08:14:47 -05:00
b658294a13 use assert.Contains in cmap_test 2017-11-04 00:10:59 -05:00
88481fc363 Make iterating over keys possible (#63)
* Make iterating over keys possible

* add test for cmap
- test Keys() and Values() respectively

* one cmap per test-case
2017-11-04 00:06:20 -05:00
0f555f8d2c Merge pull request #71 from tendermint/69-read-impl-and-tests
[autofile] test GroupReader more extensively (Refs #69)
2017-11-04 00:02:02 -05:00
4ffe9304ba unsubscribe from all subscriptions on WS disconnect 2017-11-02 14:00:18 -05:00
b1eec3a5d3 remove test_data/empty_block and test_data/small_blockN 2017-11-02 13:20:14 -05:00
fcdd30b2d3 fixes from Bucky's review 2 2017-11-02 13:20:05 -05:00
ec87c740a7 Merge pull request #794 from tendermint/243-restart-app-via-os
Kill Tendermint when App dies
2017-10-31 16:27:23 -04:00
6b737d2c1b Merge pull request #745 from tendermint/test-rpc-server-handlers
rpc/lib/server: add handlers tests for params inclusion
2017-10-31 15:42:24 -04:00
f7f4ba5e90 rpc/lib/server: minor changes to test 2017-10-31 15:41:25 -04:00
5466720d75 minor changes from @odeke-em PR #725 2017-10-31 15:32:07 -04:00
7c3cf316f1 rpc/wsevents: small cleanup 2017-10-31 15:16:08 -04:00
d71aed309f some minor changes 2017-10-30 22:52:03 -04:00
d6beb60bf7 Merge pull request #799 from petabytestorage/fix-typo-switch-comment
fix comment typos
2017-10-30 18:01:32 -04:00
d8dd497069 fix metalinter errors 2017-10-30 13:01:18 -05:00
668698584d [autofile] test GroupReader more extensively (Refs #69) 2017-10-30 12:48:51 -05:00
61d76a273f fixes from Bucky's and Emmanuel's reviews 2017-10-30 11:12:01 -05:00
6d18e2f447 do not send whole round state via eventHub
Fixes

```
WARNING: DATA RACE
Write at 0x00c4200715b8 by goroutine 24:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrevote.func1()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:359 +0x3f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrevote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:897 +0x8de
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addProposalBlockPart()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1303 +0x701
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:560 +0x88c
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:525 +0x6d2

Previous read at 0x00c4200715b8 by goroutine 19:
  github.com/tendermint/tendermint/consensus.makeRoundStepMessages()
      /go/src/github.com/tendermint/tendermint/consensus/reactor.go:415 +0x192
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).broadcastNewRoundStep()
      /go/src/github.com/tendermint/tendermint/consensus/reactor.go:377 +0x3c
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).broadcastNewRoundStepsAndVotes.func1()
      /go/src/github.com/tendermint/tendermint/consensus/reactor.go:350 +0x275
```
2017-10-30 00:32:23 -05:00
1c1c68df8d fixes from my own review 2017-10-30 00:32:23 -05:00
f6539737de new pubsub package
comment out failing consensus tests for now

rewrite rpc httpclient to use new pubsub package

import pubsub as tmpubsub, query as tmquery

make event IDs constants
EventKey -> EventTypeKey

rename EventsPubsub to PubSub

mempool does not use pubsub

rename eventsSub to pubsub

new subscribe API

fix channel size issues and consensus tests bugs

refactor rpc client

add missing discardFromChan method

add mutex

rename pubsub to eventBus

remove IsRunning from WSRPCConnection interface (not needed)

add a comment in broadcastNewRoundStepsAndVotes

rename registerEventCallbacks to broadcastNewRoundStepsAndVotes

See https://dave.cheney.net/2014/03/19/channel-axioms

stop eventBuses after reactor tests

remove unnecessary Unsubscribe

return subscribe helper function

move discardFromChan to where it is used

subscribe now returns an err

this gives us ability to refuse to subscribe if pubsub is at its max
capacity.

use context for control overflow

cache queries

handle err when subscribing in replay_test

rename testClientID to testSubscriber

extract var

set channel buffer capacity to 1 in replay_file

fix byzantine_test

unsubscribe from single event, not all events

refactor httpclient to return events to appropriate channels

return failing testReplayCrashBeforeWriteVote test

fix TestValidatorSetChanges

refactor code a bit

fix testReplayCrashBeforeWriteVote

add comment

fix TestValidatorSetChanges

fixes from Bucky's review

update comment [ci skip]

test TxEventBuffer

update changelog

fix TestValidatorSetChanges (2nd attempt)

only do wg.Done when no errors

benchmark event bus

create pubsub server inside NewEventBus

only expose config params (later if needed)

set buffer capacity to 0 so we are not testing cache

new tx event format: key = "Tx" plus a tag {"tx.hash": XYZ}

This should allow to subscribe to all transactions! or a specific one
using a query: "tm.events.type = Tx and tx.hash = '013ABF99434...'"

use TimeoutCommit instead of afterPublishEventNewBlockTimeout

TimeoutCommit is the time a node waits after committing a block, before
it goes into the next height. So it will finish everything from the last
block, but then wait a bit. The idea is this gives it time to hear more
votes from other validators, to strengthen the commit it includes in the
next block. But it also gives it time to hear about new transactions.

waitForBlockWithUpdatedVals

rewrite WAL crash tests

Task:
test that we can recover from any WAL crash.

Solution:
the old tests were relying on event hub being run in the same thread (we
were injecting the private validator's last signature).

when considering a rewrite, we considered two possible solutions: write
a "fuzzy" testing system where WAL is crashing upon receiving a new
message, or inject failures and trigger them in tests using something
like https://github.com/coreos/gofail.

remove sleep

no cs.Lock around wal.Save

test different cases (empty block, non-empty block, ...)

comments

add comments

test 4 cases: empty block, non-empty block, non-empty block with smaller part size, many blocks

fixes as per Bucky's last review

reset subscriptions on UnsubscribeAll

use a simple counter to track message for which we panicked

also, set a smaller part size for all test cases
2017-10-30 00:32:22 -05:00
fe9ff62297 fix comment typos 2017-10-28 22:01:45 -07:00
7c85f15a6c Merge pull request #798 from petabytestorage/fix-test-uncommon-names
fix test using uncommon names
2017-10-28 23:47:31 -04:00
6b366b2443 fix test using uncommon names 2017-10-28 20:29:11 -07:00
a8b77359df rpc/lib/server: separate out Notifications test
Addressing feedback from @ebuchman
2017-10-28 15:24:40 -07:00
e7fab7d4bf rpc/lib/server: update with @melekes and @ebuchman feedback 2017-10-28 15:11:21 -07:00
59556ab030 rpc/lib/server: add handlers tests
Follow up of PR https://github.com/tendermint/tendermint/pull/724
For https://github.com/tendermint/tendermint/issues/708

Reported initially in #708, this bug was reconfirmed
by the fuzzer.

This fix ensures that:
* if the user doesn't pass in `"id"` that we send them back
a message in an error telling them to send `"id"`. Previously
we let the handler return a 200 with nothing.
* passing in nil `params` doesn't crash
* not passing in `params` doesn't crash
* passing in non-JSON parseable data to `params` doesn't crash
2017-10-28 15:11:21 -07:00
b0cf4b4757 PubKeyFromBytes: return zero value PubKey on error
Fixes https://github.com/tendermint/go-crypto/issues/48.

This previously skewed up my fuzzing tests so ensure
that on error we return the zero value PubKey.
2017-10-28 14:11:22 -07:00
128e2a1d9e Merge branch 'master' into develop 2017-10-28 00:09:03 -04:00
e236302256 Merge pull request #793 from tendermint/release-v0.12.0
Release v0.12.0
2017-10-28 00:06:53 -04:00
dfe28c8855 test: update for abci-cli consolidation. shell formatting 2017-10-27 23:09:50 -04:00
4b616344fa update glide, again 2017-10-27 22:36:03 -04:00
dd20358a26 Merge pull request #47 from tendermint/release-v0.4.1
Release v0.4.1
2017-10-27 22:28:35 -04:00
d2b1a7096e changelog 2017-10-27 22:17:34 -04:00
377d3c7e11 fix from revert 2017-10-27 22:04:22 -04:00
6405618220 Revert "Upgrade keys to use bcrypt with salts (#38)"
This reverts commit 8e7f0e7701.
2017-10-27 22:02:44 -04:00
87badb090f Revert "Parameterize and lower bcrypt cost"
This reverts commit dfc4cdd2d7.
2017-10-27 21:58:02 -04:00
1ecd580061 Merge pull request #773 from tendermint/docs-staging
docs improvements
2017-10-27 16:18:56 -04:00
21dcb4f290 update glide 2017-10-27 13:55:56 -04:00
d1f00be7a0 Merge pull request #46 from tendermint/develop
Develop
2017-10-27 12:57:37 -04:00
8630b724b2 version and changelog 2017-10-27 12:57:26 -04:00
ad31f6a953 osx + hid = <3 2017-10-27 18:46:21 +02:00
dc33aad9b4 Merge pull request #122 from tendermint/develop
Develop
2017-10-27 12:25:50 -04:00
c9612f094b glide 2017-10-27 12:13:16 -04:00
d973cb5df9 changelog and version 2017-10-27 12:12:34 -04:00
d9525c0fb6 Merge pull request #70 from tendermint/develop
Develop
2017-10-27 12:05:43 -04:00
944d36ab00 changelog 2017-10-27 12:04:31 -04:00
b2b35d7dc1 update changelog 2017-10-27 11:54:20 -04:00
a1501dcde8 version bump 2017-10-27 11:54:20 -04:00
b14c996698 update changelog 2017-10-27 11:52:10 -04:00
3319ad03b8 Merge pull request #791 from tendermint/740-no-wal-after-fast-sync
dont catchupReplay on wal if we fast synced
2017-10-27 11:49:54 -04:00
092eb701c7 cmn: Kill 2017-10-27 11:01:40 -04:00
fe1c60b5cf consensus: kill process on app error 2017-10-27 10:55:20 -04:00
591dd9e662 dont catchupReplay on wal if we fast synced 2017-10-27 10:46:19 -04:00
66de53292e Merge pull request #117 from tendermint/cobra-not-urfave
use spf13/cobra instead of urfave/cli
2017-10-27 02:47:21 -04:00
42145a82bd version and changelog 2017-10-26 20:57:33 -04:00
8e0ed4ddd0 genesis deployment fixes 2017-10-26 19:44:58 -04:00
57346134a5 keys: transactions.go -> types.go 2017-10-26 16:43:32 -04:00
db5603e374 Merge pull request #45 from tendermint/bugfix/nano-hid
Bugfix: ledger nano/hid compiles on osx/golang1.9
2017-10-26 06:52:52 -07:00
bb6c15b00a CHANGELOG [ci skip] 2017-10-26 09:42:46 -04:00
f013ee5cf9 cli: use cobra's new ExactArgs() feature 2017-10-26 08:51:43 -04:00
461191d2f7 cli: clean up error handling 2017-10-26 08:37:42 -04:00
b5bdb6ec54 Merge pull request #119 from tendermint/93-fix-console-output
fix console output
2017-10-26 07:58:16 -04:00
5d8890530a Update glide deps, nano/hid for osx/golang1.9 2017-10-26 12:00:42 +02:00
c496dea2e5 Merge pull request #42 from tendermint/feature/bcrypt-usability
Bcrypt usability
2017-10-26 11:59:32 +02:00
6af28ead87 Merge pull request #672 from tendermint/573-wal-issues
Add checksum and length to CS WAL record
2017-10-26 00:31:38 -04:00
fcf459158d CHANGELOG [ci skip] 2017-10-26 00:29:58 -04:00
e76ef2a8a1 types: unexpose valset.To/FromBytes 2017-10-26 00:27:02 -04:00
3c92bea519 glide: more external deps locked to versions 2017-10-26 00:07:43 -04:00
12c703c1c3 Merge branch 'develop' into 573-wal-issues 2017-10-25 23:56:08 -04:00
a0e38dc583 dummy: verify pubkey is go-crypto encoded in DeliverTx. closes #51 2017-10-25 23:34:37 -04:00
4884747eb7 tests: add simple client/server test with no addr prefix 2017-10-25 23:23:23 -04:00
b6a4ca6b3c remove testutil 2017-10-25 23:15:57 -04:00
6c41ec65bc server: use cmn.ProtocolAndAddress 2017-10-25 23:04:20 -04:00
3df2ca128d make PrivateKey + Signature comparisons use constant time comparisons
Fixes https://github.com/tendermint/go-crypto/issues/43

Avoid susceptibility to timing/side channel attacks by ensuring
that private key and signature comparisons use
`subtle.ConstantTimeCompare`
instead of
`bytes.Equal`
2017-10-25 19:56:13 -07:00
376f47e030 Merge pull request #775 from tendermint/rpc-client-jitter
rpc/lib/client: add jitter for exponential backoff of WSClient
2017-10-25 22:53:50 -04:00
ceedd4d968 remove unnecessary plus [ci skip] 2017-10-25 22:28:20 -04:00
c595636999 glide 2017-10-25 22:23:55 -04:00
6e5cd10399 rpc/lib/client: jitter test updates and only to-be run on releases
* Updated code with feedback from @melekes, @ebuchman and @silasdavis.
* Added Makefile clause `release` to only run the test on seeing tag
`release` during releases i.e
```shell
make release
```
which will run the comprehensive and long integration-ish tests.
2017-10-25 19:20:55 -07:00
b30e3ba26d Merge pull request #65 from tendermint/573-wal-issues-2
[autofile] Support for the new WAL format
2017-10-25 22:00:36 -04:00
57a684d5ac fixes from review 2017-10-25 21:54:56 -04:00
5534eb4707 Merge pull request #776 from tendermint/feature/merge-light-client
Merge light client
2017-10-25 16:12:39 -04:00
b2d5546cf8 Merge pull request #777 from silasdavis/fix-blocking-ws-client
Fix WSClient deadlock in the readRoutine after Stop() is called
2017-10-25 11:00:30 -04:00
f653ba63bf Separated out certifiers.Commit from rpc structs 2017-10-25 16:43:18 +02:00
0396b6d521 Rename checkpoint.go 2017-10-25 16:13:04 +02:00
94b36bb65e Move VerifyCommitAny into the types package 2017-10-25 16:13:04 +02:00
b4fd6e876e Copy certifiers from light-client 2017-10-25 16:13:04 +02:00
775e100d2c Merge pull request #783 from tendermint/782-tendermint-invalid-command-panics
fix panic: failed to determine gopath: exec: "go"
2017-10-25 08:50:16 -04:00
4cb02d0bf2 Exploit the fact the BaseService's closed Quit channel will keep emitting quit signals to close both readRoutine and writeRoutine 2017-10-25 10:19:18 +01:00
ae538337ba fix panic: failed to determine gopath: exec: "go" (Refs #782)
```
-bash-4.2$ tendermint show_validators
panic: failed to determine gopath: exec: "go": executable file not found in $PATH

goroutine 1 [running]:
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.gopath(0xc4200632c0, 0x18)
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/os.go:26 +0x1b5
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/os.go:17 +0x13c
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/wire.go:165 +0x50
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/data.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/data/wrapper.go:89 +0x50
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli/setup.go:190 +0x76
main.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/cmd/tendermint/main.go:42 +0x49```

An error message instead would be nice.
```

Now GoPath() is a function instead of a variable.
2017-10-25 11:19:53 +04:00
0a652499ea Merge pull request #68 from tendermint/bugfix/gopath-executes-go
make GoPath a function
2017-10-25 11:12:13 +04:00
bcf15e527d make GoPath a function
otherwise it could try to execute go binary and panic if no go binary
found. See https://github.com/tendermint/tendermint/issues/782
2017-10-25 11:01:52 +04:00
62a7beec21 Merge pull request #780 from ericdmann/769-error-msg-while-testnet-sync
Change log level to Info when proposal block hashing fails
2017-10-24 23:27:20 -04:00
93bd2081dd Merge pull request #66 from tendermint/codecov
add codecov
2017-10-24 23:05:32 -04:00
45e18a1832 Change log level to Info when proposal block hashing fails due to partially complete block 2017-10-24 14:13:35 -07:00
f99c73502c add codecov 2017-10-24 23:36:10 +04:00
103fee6192 add tests for autofile group Write, reader#Read 2017-10-24 23:20:17 +04:00
81591e288e fix metalinter warnings 2017-10-24 23:19:53 +04:00
f6adddb4a8 Replace ResultsCh with ResponsesCh 2017-10-24 17:45:13 +01:00
38fc351532 Merge pull request #765 from tendermint/762-blockchain-reactor-timeout
blockchain reactor timeout
2017-10-24 09:13:26 -04:00
01be6fa309 Fix WSClient blocking in the readRoutine after Stop() as it tries to write to ResultsCh 2017-10-24 13:31:24 +01:00
e06bbaf303 refactor TestNoBlockMessageResponse to eliminate a race condition 2017-10-24 15:32:01 +04:00
dfc4cdd2d7 Parameterize and lower bcrypt cost 2017-10-24 12:19:45 +02:00
0a5b1d979a Merge pull request #37 from tendermint/nano
Nano Support
2017-10-24 12:18:45 +02:00
d4c6a68e58 Merge pull request #64 from silasdavis/event-cache
Fix zeroed buffer getting flushed to the empty event
2017-10-24 14:16:18 +04:00
0219ba2a63 Fix bug introduced by metalinting... 2017-10-24 12:14:20 +02:00
69a7b389b8 Removed keys/server as it is now in cosmos-sdk 2017-10-24 11:59:44 +02:00
6f6bbf718e Fix metalinter complaints 2017-10-24 11:56:37 +02:00
2d04544088 Addressed Buckys PR review comments 2017-10-24 11:38:06 +02:00
4a2c63f5e1 Update ledger names to specify ed25519 2017-10-24 11:38:06 +02:00
9601e48ab4 Improve error message 2017-10-24 11:38:06 +02:00
61d1bdb5ed Test error handling, load without ledger 2017-10-24 11:38:06 +02:00
9afceb7ee8 ledger pubkey serializes properly, better load checks 2017-10-24 11:38:06 +02:00
2490952515 nano validates key on load 2017-10-24 11:38:06 +02:00
bce88a20df Enable privkey validity checking on load 2017-10-24 11:38:06 +02:00
1b8d52bb82 Rename NameLedger to NameLedgerEd25519 2017-10-24 11:38:06 +02:00
ae078ee915 Generate/recover can return error, not panic on ledger 2017-10-24 11:38:06 +02:00
085d72d212 Cleanup nano calls, cannot run parallel test on one hardware device 2017-10-24 11:38:06 +02:00
91fccb8b14 Add test for cryptostore working with ledger 2017-10-24 11:38:06 +02:00
88475230c4 Re-enabled crypostore example usage 2017-10-24 11:38:06 +02:00
34b9309f24 Re-enable signing tests with cryptostore 2017-10-24 11:38:06 +02:00
8c98c4fdf4 Add nano ledger to key manager 2017-10-24 11:38:06 +02:00
0383feab49 Add and test serialization of ledger privkey 2017-10-24 11:38:06 +02:00
3edeb0cd45 Ledger caches pubkey, works with newer firmware 2017-10-24 11:38:06 +02:00
081f21af11 Add glide version for ledger drivers 2017-10-24 11:38:06 +02:00
008dba3af8 Test ledger calls 2017-10-24 11:38:06 +02:00
623bd803c2 write code to actually call ledger app 2017-10-24 11:38:06 +02:00
265e261c63 Add more test cases from running the ledger 2017-10-24 11:38:06 +02:00
7c5a10a7d4 Add tests for pub/priv key validation 2017-10-24 11:38:06 +02:00
06d74b24dd Wrote PrivKey/PubKey for ledger 2017-10-24 11:38:06 +02:00
74878ee313 Update code to work with current nano implementation 2017-10-24 11:38:06 +02:00
8220d59178 Work on using returned bytes as crypto keys 2017-10-24 11:38:06 +02:00
0781c12ede Message encoding for nano 2017-10-24 11:38:06 +02:00
bb7b152af5 write docs for cutWALUntil and wal2json binaries 2017-10-24 13:25:47 +04:00
5504920ba3 rpc/lib/client: add jitter for exponential backoff of WSClient
Fixes https://github.com/tendermint/tendermint/issues/751.

Adds jitter to our exponential backoff to mitigate a self DDOS
vector. The jitter is a randomly picked percentage of a second
whose purpose is to ensure that each exponential backoff retry
occurs within (1<<attempts) == 2**attempts, but with the delay
each client will have a random buffer time before it tries to
reconnect instead of all at once reconnections that might even
bring back the previous conditions that might have caused the
dial to the WSServer to have failed e.g
* Network outage
* File descriptor exhaustion
* False positives from firewalls
etc
2017-10-24 02:00:20 -07:00
c74a359c46 fixes per Bucky's review 2017-10-24 12:14:21 +04:00
ee9dc6ce59 docs: fixup abci guide 2017-10-23 20:56:49 -04:00
4479e95709 console: fix tests 2017-10-23 19:54:38 -04:00
62e8ec34d1 fix comment, #723 2017-10-23 19:51:09 -04:00
6a5254c475 Added local blockchain sync benchmark script 2017-10-23 19:46:57 -04:00
2802a06a08 blockchain/store: comment about panics 2017-10-23 19:46:14 -04:00
36de70be10 console: fix output, closes #93 2017-10-23 19:35:02 -04:00
a6e6b58c6b Merge pull request #41 from tendermint/metalinter
add metalinter to Makefile & apply some fixes
2017-10-23 19:32:07 -04:00
8ac430813d Merge pull request #772 from tendermint/docs/flow
moar docs updates
2017-10-23 19:14:06 -04:00
3e61b8c17a docs: comb through step by step 2017-10-23 19:11:51 -04:00
9e277d1596 docs: smaller logo (200px) 2017-10-23 17:34:27 -04:00
4c9d5244a5 Merge pull request #759 from tendermint/improve-docs
docs: update abci example details
2017-10-23 17:29:34 -04:00
3330cb4856 cleanup 2017-10-23 17:27:59 -04:00
631844895f fixes 2017-10-23 17:18:46 -04:00
f9e14ad61b disable PersistenPreRun for counter/dummy 2017-10-23 17:18:46 -04:00
df5d9ac1bb consolidate counter/dummy into the binary, #95 2017-10-23 17:18:46 -04:00
56f7d9627f update deps 2017-10-23 17:18:46 -04:00
f67e43625b Makefile: fix linter 2017-10-23 17:17:57 -04:00
9883013adf use cobra, closes #101 2017-10-23 17:17:05 -04:00
87cc277b38 Merge pull request #721 from tendermint/564-add-app-options-to-genesis-resp
Add app_options to GenesisDoc
2017-10-23 16:03:45 -04:00
3115c23762 binary format for WAL 2017-10-23 22:27:24 +04:00
31030c6514 make crc32c a global var
change echo format in build.sh script
2017-10-23 22:09:42 +04:00
7b8ffc9981 add checksum and msg size to TimedWALMessage
updated test_data/build.sh script
2017-10-23 22:09:17 +04:00
0eff425bc7 fix zeroed buffer getting flushed to the empty event 2017-10-23 18:52:31 +01:00
a75bccfbc4 Merge branch 'develop' into 564-add-app-options-to-genesis-resp 2017-10-23 11:30:00 -04:00
f97229f05a Merge pull request #748 from tendermint/params-test
types: ConsensusParams test + document the ranges/limits
2017-10-23 11:18:00 -04:00
ac2ef9e0ea Merge pull request #750 from tendermint/feature/cleanup
Cleanup of code and code docs
2017-10-23 11:14:15 -04:00
c2803b80e8 update changelog; fixes from rebase 2017-10-23 11:13:12 -04:00
7a6876bc62 Merge pull request #768 from tendermint/feature/merkleeyes-to-iavl
Feature/merkleeyes to iavl
2017-10-23 11:07:21 -04:00
819f81f702 Change NOTE to CONTRACT 2017-10-23 11:04:45 -04:00
036d3b59a3 Address reviews 2017-10-23 11:04:45 -04:00
782a836db0 Cleanup of code and code docs
This cleans up some of the code in the state package
2017-10-23 11:04:45 -04:00
bd46b78785 Merge pull request #755 from tendermint/753-notified-mempool-txs-but-mempool-empty
WIP: only notify when there are some txs (Refs #753)
2017-10-23 10:31:38 -04:00
f908dd0e55 only notify when there are some txs (Refs #753) 2017-10-23 10:31:00 -04:00
0bbf38141a blockchain/pool: some comments and small changes 2017-10-23 10:13:46 -04:00
f188366e26 update glide 2017-10-23 10:04:00 -04:00
fd60621a8e update cswal test 2017-10-23 10:03:54 -04:00
47d3fa4741 linting: a few fixes 2017-10-23 08:30:18 -04:00
bb9bb4aa46 Merge pull request #116 from tendermint/feature/merkleeyes-to-iavl
merkleeyes to iavl
2017-10-23 14:26:12 +02:00
446e50ca9e Moved RandVal into test helper functions, as needed in other repos for testing 2017-10-23 14:20:15 +02:00
e7ebf62092 Remove empty check after iavl fixup 2017-10-23 14:08:36 +02:00
21b2c26fb1 GroupReader#Read: return io.EOF if file is empty 2017-10-23 13:02:14 +04:00
c75ddd0fa3 return err if empty slice given 2017-10-23 13:02:02 +04:00
60b7f2c61b Merge pull request #767 from silasdavis/do-not-swallow
Make RPCError an actual error and don't swallow its companion data
2017-10-23 01:51:40 -04:00
a4443ddb0c update persistent dummy for versioned iavl 2017-10-23 00:06:50 -04:00
8e031b367f Merge branch 'develop' into metalinter 2017-10-22 19:53:39 -04:00
3e3d53daef Make RPCError an actual error and don't swallow its companion data 2017-10-22 15:14:21 +01:00
45021f017b log level 2017-10-20 23:15:54 -04:00
cc45151c4d Testnet stuff 2017-10-20 22:54:24 -04:00
d64a48e0ee set logger on blockchain pool 2017-10-20 23:56:21 +04:00
0a7b2ab52c fix invalid memory address or nil pointer dereference error (Refs #762)
https://github.com/tendermint/tendermint/issues/762#issuecomment-338276055
```
E[10-19|04:52:38.969] Stopping peer for error                      module=p2p peer="Peer{MConn{178.62.46.14:46656} B14916FAF38A out}" err="Error: runtime error: invalid memory address or nil pointer dereference\nStack: goroutine 529485 [running]:\nruntime/debug.Stack(0xc4355cfb38, 0xb463e0, 0x11b1c30)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0xa7\ngithub.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p.(*MConnection)._recover(0xc439a28870)\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p/connection.go:206 +0x6e\npanic(0xb463e0, 0x11b1c30)\n\t/usr/local/go/src/runtime/panic.go:491 +0x283\ngithub.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/blockchain.(*bpPeer).decrPending(0x0, 0x381)\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/blockchain/pool.go:376 +0x22\ngithub.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/blockchain.(*BlockPool).AddBlock(0xc4200e4000, 0xc4266d1f00, 0x40, 0xc432ac9640, 0x381)\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/blockchain/pool.go:215 +0x139\ngithub.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/blockchain.(*BlockchainReactor).Receive(0xc42050a780, 0xc420257740, 0x1171be0, 0xc42ff302d0, 0xc4384b2000, 0x381, 0x1000)\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/blockchain/reactor.go:160 +0x712\ngithub.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p.createMConnection.func1(0x11e5040, 0xc4384b2000, 0x381, 0x1000)\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p/peer.go:334 +0xbd\ngithub.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p.(*MConnection).recvRoutine(0xc439a28870)\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p/connection.go:475 +0x4a3\ncreated by github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p.(*MConnection).OnStart\n\t/home/ubuntu/go/src/github.com/cosmos/gaia/vendor/github.com/tendermint/tendermint/p2p/connection.go:170 +0x187\n"
```
2017-10-20 21:56:10 +04:00
8a69f1087b docs: typo 2017-10-20 07:56:26 -04:00
35e81018e9 add MinIndex method to Group 2017-10-20 13:09:51 +04:00
aace56018a add Read method to GroupReader 2017-10-20 12:38:45 +04:00
f24f03906f types: ConsensusParams: add feedback from @ebuchman and @melekes 2017-10-20 00:11:30 -06:00
5162ed1b2b Remove gotype from metalinter so it passes (need newer go on circleci) 2017-10-19 15:21:03 +02:00
7aa00e9ddd Fix metalinter errors 2017-10-19 14:48:07 +02:00
46e1f1ae65 Cleaup based on Antons PR comments 2017-10-19 14:43:34 +02:00
d236e0eef9 Fix trailing whitespace in tutorial test 2017-10-19 14:38:30 +02:00
bae4e4acce Fix up commits, debug cli tests 2017-10-19 14:38:29 +02:00
9aff9f94dd dummy app now uses iavl 2017-10-19 14:38:29 +02:00
5231003bfc Merge pull request #115 from tendermint/socket_client_StopOnErrorDeadlock-fix
socketClient: fix and test for StopForError deadlock
2017-10-18 20:54:42 -04:00
fa56e8c0ce Merge pull request #676 from tendermint/state-unexpose-genesisDoc-chainID
all, state: unexpose GenesisDoc, ChainID fields make them accessor methods
2017-10-18 20:10:02 -04:00
fc406d1657 docs: update abci example details [ci skip] 2017-10-18 16:33:37 -04:00
9dcefd0e1e Merge pull request #754 from tendermint/improve-docs
add tm-migrator to docs
2017-10-18 13:04:12 -04:00
a2dc53d43d Merge pull request #757 from tendermint/756-specification-validators
correct an error in validator's specification [ci skip] (Refs #756)
2017-10-18 13:02:13 -04:00
b9c4fab96e correct an error in validator's specification [ci skip] (Refs #756) 2017-10-18 19:23:30 +04:00
fa07dbd7ec docs: add info about tm-migrate 2017-10-18 08:47:58 -04:00
9b382d7a11 docs: remove mention of type byte 2017-10-18 08:00:01 -04:00
46d94f8325 socketClient: fix and test for StopForError deadlock
Fixes https://github.com/tendermint/abci/issues/114.

Fix and test for StopForError deadlock due to accidental
Mutex misuse. The test should return instantenously if
StopForError works without erraneous contention, lest it regressed.
2017-10-17 22:08:22 -06:00
45095e83e7 add Write method to autofile/Group 2017-10-17 16:48:44 +04:00
498fb1134a write docs for autofile/group 2017-10-17 16:48:34 +04:00
8e5266a9ef Merge pull request #62 from tendermint/tests-fix
fix goLevelDBIterator
2017-10-17 16:06:41 +04:00
75b78bfb72 panic on marshal/unmarshal failures for genesisDoc 2017-10-17 13:33:57 +04:00
1f15ade60d Merge pull request #61 from tendermint/60-cmn-gopath-needs-a-default
call go env GOPATH if env var is not found (Refs #60)
2017-10-17 12:26:20 +04:00
b234f7aba2 Merge pull request #741 from tendermint/client-compile-time-assertions
rpc/client: use compile time assertions instead of methods
2017-10-17 03:41:24 -04:00
0b22b27bbb avoid infinite recursion by proxying to iterator
```
WARNING: staticcheck, gosimple and unused are all set, using megacheck instead
db/go_level_db.go:126:15⚠️ infinite recursive call (SA5007) (megacheck)
db/go_level_db.go:135:17⚠️ infinite recursive call (SA5007) (megacheck)
db/mem_db.go:106:2⚠️ redundant return statement (S1023) (megacheck)
```

https://circleci.com/gh/tendermint/tmlibs/220

Also remove unnecessary return statement
2017-10-17 11:01:46 +04:00
bff069f83c types: ConsensusParams test + document the ranges/limits
Fixes https://github.com/tendermint/tendermint/issues/747
Updates https://github.com/tendermint/tendermint/issues/693

* Document the unmentioned limits for ConsensusParams.Validate()
* Make the limit for ConsensusParams.BlockSizeParams.MaxBytes
clear at 100MiB
2017-10-16 16:57:44 -06:00
616b07ff6b make AppOptions an interface{} 2017-10-16 10:58:52 +04:00
b26f812399 update changelog 2017-10-16 10:58:52 +04:00
321061125f add app_options to GenesisDoc (Refs #564) 2017-10-16 10:58:52 +04:00
6469e2ccca save genesis doc in DB to prevent user errors
https://github.com/tendermint/tendermint/pull/676#discussion_r144411458
2017-10-16 10:51:58 +04:00
c4646bf87f make state#Params not a pointer
also remove the comment
2017-10-16 10:34:02 +04:00
716364182d [state] expose ChainID and Params
```
jaekwon
Yeah we should definitely expose ChainID.
ConsensusParams is small enough, we can just write it.
```
https://github.com/tendermint/tendermint/pull/676#discussion_r144123203
2017-10-16 10:34:02 +04:00
1971e149fb ChainID() and Params() do not return errors
- remove state#GenesisDoc() method
2017-10-16 10:34:02 +04:00
7939d62ef0 all, state: unexpose GenesisDoc, ChainID fields make them accessor methods
Fixes #671

Unexpose GenesisDoc and ChainID fields to avoid them being
serialized to the DB on every block write/state.Save()

A GenesisDoc can now be alternatively written to the state's
database, by serializing its JSON as a value of key "genesis-doc".

There are now accessors and a setter for these attributes:
- state.GenesisDoc() (*types.GenesisDoc, error)
- state.ChainID() (string, error)
- state.SetGenesisDoc(*types.GenesisDoc)

This is a breaking change since it changes how the state's
serialization and requires that if loading the GenesisDoc entirely
from the database, you'll need to set its value in the database
as the GenesisDoc's JSON marshaled bytes.
2017-10-16 10:34:01 +04:00
4c1f1e4e57 Merge pull request #746 from srmo/701-add-dev-docs-in-java
701 add dev docs in java
2017-10-15 11:02:36 -04:00
09170f76fe Merge pull request #743 from tendermint/zramsay-patch-1
Update getting-started.rst
2017-10-15 11:01:19 -04:00
9e1edf8685 [docs] add Java examples for each section 2017-10-15 13:45:43 +02:00
e7fe299504 [docs] replace all GO snippets with collapsible blocks 2017-10-15 12:21:06 +02:00
b90edffe28 [docs] add first java block for deliverTx 2017-10-15 12:00:08 +02:00
f361092ed9 [docs] provide means to have collapsible code blocks without adding a new theme 2017-10-15 11:59:37 +02:00
c0e373bad0 bump bucky fermions 2017-10-14 08:46:06 -04:00
a1e0f0ba95 docs/ecosystem: add py-tendermint to abci-servers 2017-10-14 00:59:34 -04:00
95048b21b2 Added fermion to bucky 2017-10-13 21:45:17 -04:00
5f218a43fd rpc/client: use compile time assertions instead of methods 2017-10-13 14:30:54 -06:00
7fe470fc76 Update getting-started.rst 2017-10-13 14:50:54 -04:00
cd2ad19db4 Merge pull request #57 from tendermint/feature/improve-db-interface
WIP: Improve db interface
2017-10-13 18:31:05 +04:00
d490c25807 Merge pull request #720 from tendermint/types-heartbeat-test
types/heartbeat: test all Heartbeat functions
2017-10-13 09:22:59 -04:00
340f33b475 Merge pull request #734 from tendermint/482-support-historical-abci-queries
support historical abci queries
2017-10-13 09:14:32 -04:00
639aedd5a1 Changed wallets 2017-10-13 08:31:15 -04:00
6b1e3bcee3 Add comments about copying 2017-10-13 13:03:43 +02:00
7518c4a9be [rpc] update comment [ci skip] 2017-10-13 15:03:21 +04:00
db413aadfd fixes from @cloudhead review 2017-10-13 15:03:21 +04:00
5433e5771e support historical abci queries (Refs #482) 2017-10-13 15:03:20 +04:00
43c86c2a9c Ansible 2.2 compatibility fix 2017-10-12 14:55:24 -04:00
7aa0957fc5 Changed fermion numbers 2017-10-12 14:42:59 -04:00
e0fbe6fb3e Version parsing changed in build to accommodate Gaia's extra space 2017-10-12 14:08:29 -04:00
51d74ebdfa Zaki added 2017-10-12 12:49:26 -04:00
7872ade626 testnet specification fixes 2017-10-12 10:17:38 -04:00
8e7f0e7701 Upgrade keys to use bcrypt with salts (#38)
This commit adds salts to the library using bcrypt.
2017-10-12 14:26:59 +02:00
f152658f6c Introducing neutrino denom 2017-10-11 13:05:15 -04:00
e2e50bc0fc rpc: use /iavl repo in test (#713) 2017-10-11 10:35:22 -04:00
7166252a52 add codeowners file [ci skip] 2017-10-11 12:48:05 +04:00
35e38e8932 call go env GOPATH if env var is not found (Refs #60) 2017-10-11 12:42:54 +04:00
27245ce6f6 Merge branch 'master' into develop 2017-10-10 19:12:40 -04:00
d4634dc683 Merge pull request #729 from tendermint/release/0.11.1
Release/0.11.1
2017-10-10 18:50:15 -04:00
8c08fc671c fix version 2017-10-10 18:49:08 -04:00
32dec98c1c example: fix func suffix 2017-10-10 17:33:51 -04:00
a2d40580d7 Merge pull request #732 from sbellem/docs-install-typo-fix
[docs: typo fix] add missing "have"
2017-10-10 11:22:39 -04:00
0011af7adf Merge pull request #727 from sbellem/docs-typo-fix
[docs:typo fix] remove misplaced "the"
2017-10-10 11:20:34 -04:00
1764106606 [docs: typo fix] add missing "have" 2017-10-10 17:15:35 +02:00
3356544706 update changelog 2017-10-10 11:10:48 -04:00
335e012b6a Merge branch 'develop' into release/0.11.1 2017-10-10 11:08:14 -04:00
a458da8f92 Merge pull request #724 from tendermint/708-leaving-out-params-crashes-tm-rpc
Leaving out params crashes tm rpc
2017-10-10 10:53:21 -04:00
9fb45c5b5a remove a stale comment 2017-10-10 10:52:26 -04:00
aae4e94998 make RPCRequest params not a pointer
https://github.com/tendermint/tendermint/pull/724#issuecomment-335362927
2017-10-10 13:50:06 +04:00
d935a4f0a8 recover from panic in WS JSON RPC readRoutine
https://github.com/tendermint/tendermint/pull/724#issuecomment-335316484
2017-10-10 13:48:56 +04:00
5c331d8276 log a notification to help debug user issues 2017-10-10 13:01:25 +04:00
13b9de6778 return missing package declaration 2017-10-10 12:48:36 +04:00
dc0e8de9b0 extract some of the consensus types into ./types
so they can be used in rpc/core/types/responses.go.

```
So, it seems like we could use the actual structs here, but we don't want to have to import consensus to get them, as then clients are importing too much crap. So probably we should move some types from consensus into consensus/types so we can import.

Will these raw messages be identical to:

type ResultDumpConsensusState struct {
  RoundState cstypes.RoundState
  PeerRoundStates map[string]cstypes.PeerRoundState
}
```
https://github.com/tendermint/tendermint/pull/724#discussion_r143598193
2017-10-10 12:39:21 +04:00
90a2335267 bump version to 0.11.1 2017-10-10 01:18:33 +04:00
99c4e48038 return missing package declaration 2017-10-10 01:14:42 +04:00
4bd4d59af5 update changelog [ci skip] 2017-10-10 01:14:00 +04:00
8219abc552 [docs:typo fix] remove misplaced "the" 2017-10-09 20:06:43 +02:00
a754009f6b Merge pull request #60 from tendermint/feature/jenkins
Feature/jenkins
2017-10-09 17:39:05 +04:00
d6a87d3c43 [rpc] DumpConsensusState: output state as json rather than string
Before:

```
{
  "jsonrpc": "2.0",
  "id": "",
  "result": {
    "round_state": "RoundState{\n  H:10 R:0 S:RoundStepNewHeight\n  StartTime:     2017-10-09 13:07:24.841134374 +0400 +04\n  CommitTime:    2017-10-09 13:07:23.841134374 +0400 +04\n  Validators:    ValidatorSet{\n      Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n      Validators:\n        Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n    }\n  Proposal:      \u003cnil\u003e\n  ProposalBlock: nil-PartSet nil-Block\n  LockedRound:   0\n  LockedBlock:   nil-PartSet nil-Block\n  Votes:         HeightVoteSet{H:10 R:0~0\n      VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n      VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n    }\n  LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n  LastValidators:    ValidatorSet{\n      Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n      Validators:\n        Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n    }\n}",
    "peer_round_states": []
  }
}
```

After:

```
{
  "jsonrpc": "2.0",
  "id": "",
  "result": {
    "round_state": {
      "Height": 1691,
      "Round": 0,
      "Step": 1,
      "StartTime": "2017-10-09T14:08:09.129491764+04:00",
      "CommitTime": "2017-10-09T14:08:08.129491764+04:00",
      "Validators": {
        "validators": [
          {
            "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
            "pub_key": {
              "type": "ed25519",
              "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
            },
            "voting_power": 10,
            "accum": 0
          }
        ],
        "proposer": {
          "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
          "pub_key": {
            "type": "ed25519",
            "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
          },
          "voting_power": 10,
          "accum": 0
        }
      },
      "Proposal": null,
      "ProposalBlock": null,
      "ProposalBlockParts": null,
      "LockedRound": 0,
      "LockedBlock": null,
      "LockedBlockParts": null,
      "Votes": {},
      "CommitRound": -1,
      "LastCommit": {},
      "LastValidators": {
        "validators": [
          {
            "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
            "pub_key": {
              "type": "ed25519",
              "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
            },
            "voting_power": 10,
            "accum": 0
          }
        ],
        "proposer": {
          "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
          "pub_key": {
            "type": "ed25519",
            "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
          },
          "voting_power": 10,
          "accum": 0
        }
      }
    },
    "peer_round_states": {
      "75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": {
        "Height": 1691,
        "Round": 0,
        "Step": 1,
        "StartTime": "2017-10-09T14:08:08.563251997+04:00",
        "Proposal": false,
        "ProposalBlockPartsHeader": {
          "total": 0,
          "hash": ""
        },
        "ProposalBlockParts": null,
        "ProposalPOLRound": -1,
        "ProposalPOL": null,
        "Prevotes": null,
        "Precommits": null,
        "LastCommitRound": 0,
        "LastCommit": null,
        "CatchupCommitRound": -1,
        "CatchupCommit": null
      }
    }
  }
}
```
2017-10-09 14:09:26 +04:00
a3adac3787 [rpc] do not try to parse params if they were not provided (Refs #708) 2017-10-09 13:30:52 +04:00
6544b4fb77 Merge pull request #59 from tendermint/develop
Develop
2017-10-06 16:57:26 +04:00
8869363697 update readme info 2017-10-06 16:41:02 +04:00
38d51cf9cd [tm-monitor/tm-bench] fewer platforms
also update dist command to produce SHA256 sums file
2017-10-06 14:54:59 +04:00
f73b089e3f Merge pull request #57 from tendermint/develop
add CODEOWNERS
2017-10-06 14:12:59 +04:00
94ed32b80d add CODEOWNERS 2017-10-06 14:10:20 +04:00
47931208b5 Merge pull request #56 from tendermint/develop
Merge develop into master
2017-10-06 12:16:21 +04:00
f927f0a736 Merge branch 'master' into develop 2017-10-06 12:16:07 +04:00
43f8ea58ba Merge pull request #44 from tendermint/bugfix/ws-io-timeout
update WSClient plus fix IO timeout error
2017-10-06 12:06:01 +04:00
4c4a945658 [tm-bench] update deps 2017-10-06 12:04:44 +04:00
769c7d015e [tm-bench] bump version to 0.2.0 2017-10-06 11:38:31 +04:00
989ff83c4c [tm-bench] refactor code
- set ID in RPCRequest
- rename get_deps to get_vendor_deps
2017-10-06 11:38:21 +04:00
9708c66576 [tm-monitor] bump version to 0.3.0 2017-10-06 11:38:13 +04:00
cd7666c4ce [tm-monitor] update deps
rename get_deps to get_vendor_deps
2017-10-06 11:38:04 +04:00
76da726d2a Changed transaction message size to 250 bytes 2017-10-06 11:36:50 +04:00
279d6a0ebb Typo fix in transacter.go 2017-10-06 11:36:50 +04:00
45a7ae2e62 Fixes to tm-bench transaction content
- Initialize random with current time as seed so transaction messages are different at every run
- Added hash of hostname to make transactions coming from different hosts different in every case
- Added current time to transaction to make sure that messages are different even if random numbers are the same in subsequent runs
- Shortened the transaction size to 64 bytes from the original 250
2017-10-06 11:36:50 +04:00
cd5173f9a5 update tm-bench 2017-10-06 11:36:50 +04:00
e1e50843ed update tm-monitor 2017-10-06 11:36:49 +04:00
9667e027f3 [tm-monitor] fix TestNodeConnectionLost test 2017-10-06 11:36:49 +04:00
42f58ceb4b [tm-monitor] call latency callback in a separate goroutine 2017-10-06 11:36:49 +04:00
081bd0805e [tm-bench] increase pong write timeout by overriding the default handler 2017-10-06 11:36:49 +04:00
877e8e31f7 [tm-bench] update tm-monitor 2017-10-06 11:36:49 +04:00
330f38a77a [tm-monitor] update WSClient 2017-10-06 11:36:49 +04:00
af04238bb9 [tm-monitor] rename var 2017-10-06 11:36:49 +04:00
d294200176 Create README.md 2017-10-06 11:36:48 +04:00
34fe5274e0 take into account status codes by leveraging --fail curl option (Refs #37) 2017-10-06 11:36:48 +04:00
6fc82f3824 types/heartbeat: test all Heartbeat functions
Updates https://github.com/tendermint/tendermint/issues/693

* Adjusted Heartbeat.Copy to return nil on
trying to copy a nil value instead of panicking.
* Also documented that WriteSignBytes panics
if the Heartbeat is nil.
2017-10-05 21:24:36 -06:00
1775be1cd9 remove some assertXxx funcs 2017-10-05 22:19:48 -04:00
bcca27ee20 Merge pull request #718 from tendermint/restore-rpc-lib-readme
restore rpc/lib readme as doc.go (Refs #710) [ci skip]
2017-10-05 22:08:17 -04:00
28c248f747 plugin options added for genesis 2017-10-05 20:34:40 -04:00
38f321f843 Makefile typo fix 2017-10-05 15:28:07 -04:00
4dfe77416a MAkefile fixes and debug info, gaia dependency fix 2017-10-05 15:25:51 -04:00
2c2164c0ca public_testnet accounts file typo fix 2017-10-05 10:53:15 -04:00
621b67e145 Organized public testnet play coins 2017-10-05 10:22:54 -04:00
728ac86ab1 Added version check fix for build process 2017-10-05 09:51:45 -04:00
3702cb7e7c restore rpc/lib readme as doc.go (Refs #710) [ci skip]
I don't want to lose any documentation. Correct me if I am wrong, but we
don't have this docs anywhere else.
2017-10-05 11:44:02 +04:00
49653d3e31 CODEOWNERS file 2017-10-04 23:44:55 -04:00
ddb8430341 Merge pull request #716 from tendermint/unstable
Unstable
2017-10-04 23:43:36 -04:00
697b71ee8d Merged config dir fixes 2017-10-04 23:37:46 -04:00
91a3cb0f21 makefile: remove megacheck 2017-10-04 23:20:22 -04:00
12baa7c1c5 Package fixes 2017-10-04 23:10:30 -04:00
765c325441 Merge pull request #714 from tendermint/feature/no-block-response
Feature/no block response
2017-10-04 22:27:06 -04:00
659768783f blockchain: fixing reactor tests 2017-10-04 22:26:00 -04:00
e756906a0e Merge pull request #711 from tendermint/imports
get rid of anonymous imports
2017-10-04 22:16:07 -04:00
796024f42f linting: little more fixes 2017-10-04 18:27:35 -04:00
87cb57c3e5 linting: fixup some stuffs 2017-10-04 18:16:48 -04:00
7921fb0c05 linter: last fixes & add to circle 2017-10-04 17:53:56 -04:00
fe66a683bc linter: add metalinter to Makefile & apply some fixes 2017-10-04 17:53:56 -04:00
7e81a89919 Minor feaure addition 2017-10-04 17:47:44 -04:00
136b6a7673 rpc/lib: remove dead files, closes #710 2017-10-04 17:45:15 -04:00
068f01368f blockchain/reactor: respondWithNoResponseMessage for missing height
Fixes #514
Replaces #540

If a peer requests a block with a height that we don't have
respond with a bcNoBlockResponseMessage.
However, according to the Tendermint spec, if all nodes are honest
this condition shouldn't occur, so this is a possible hint of an
dishonest node.
2017-10-04 17:27:10 -04:00
f23d47e5d2 upnp: keep a link 2017-10-04 17:19:49 -04:00
09aed7ee89 Merge pull request #707 from tendermint/619-how-to-read-logs
How To Read Logs guide
2017-10-04 16:55:20 -04:00
d56b44f3a5 all: no more anonymous imports 2017-10-04 16:40:45 -04:00
9e4c25761c relative links [ci skip] 2017-10-04 23:33:31 +04:00
7e6df2fce4 Added more accounts 2017-10-04 14:00:24 -04:00
54f2cc9709 [docs] add how to read logs guide [ci skip] 2017-10-04 18:35:22 +04:00
9a971d8a19 Changed merged config parameters on package builds 2017-10-04 02:53:28 -04:00
28e9a0addd Merged config of application and tendermint 2017-10-04 02:51:37 -04:00
a0d21cef7d Switched service startup dependencies, removed old basecoin build 2017-10-04 02:32:19 -04:00
e105b10fc8 Version parsing fix 2017-10-04 00:54:02 -04:00
7dd6b3d3f8 Merge pull request #53 from tendermint/metalinter
add metalinter to CI and address some lint warnings
2017-10-04 00:21:24 -04:00
c8805fd7de metalinter fixes from review 2017-10-04 00:13:58 -04:00
31a7e2b3b4 Merge pull request #704 from tendermint/no-empty-docs
document no empty blocks
2017-10-03 23:56:05 -04:00
00ab3daa0c document no empty blocks, closes #605 [ci skip] 2017-10-03 23:55:45 -04:00
eb3f6e65a0 New package build process with merged configuration folders 2017-10-03 23:47:59 -04:00
bbf0228aa7 Merge pull request #700 from tendermint/695-improve-app-dev-docs
Improve app dev docs
2017-10-03 23:40:21 -04:00
6550199751 [docs] minor fixes from review [ci skip] 2017-10-03 23:39:46 -04:00
9ff1bd8c9c More accounts to public_testnet 2017-10-03 22:15:09 -04:00
cf49ba876f linter: couple fixes 2017-10-03 17:23:14 -04:00
15cd7fb1e3 fix comment [ci skip] 2017-10-04 00:06:46 +04:00
10f361fcd0 [docs] use persistent_dummy only when needed [ci skip] 2017-10-04 00:04:45 +04:00
4a0ae17401 [docs] include examples from the persistent_dummy app [ci skip] 2017-10-04 00:04:32 +04:00
8537070575 [docs] restructure sentence [ci skip] 2017-10-04 00:04:22 +04:00
5109f89516 Changed Adrian address, added ansible tag, basecoin debug 2017-10-03 12:57:21 -04:00
9cbcd4b5e3 Merge pull request #692 from tendermint/unstable
add the unstable changes
2017-10-03 12:47:16 -04:00
4fa4e617b7 docs/ecosystem: add stratumn 2017-10-03 12:47:01 -04:00
2e598a7caf one more fix 2017-10-03 11:26:32 -04:00
031eb23dc8 docs: fix build warnings 2017-10-03 11:23:08 -04:00
f3c02f587b fix ansible readme for tendermint docs 2017-10-03 11:19:12 -04:00
edd718c580 Update ecosystem.rst 2017-10-03 11:14:24 -04:00
392a041c2b Merge pull request #699 from tendermint/update-getting-started-docs
remove unnecessary args in abci_query call in getting-started [ci skip]
2017-10-03 10:41:36 -04:00
8727bfc265 remove unnecessary args in abci_query call in getting-started [ci skip]
Since 0.10.0, RPC does not require all args (default values will be used).
2017-10-03 16:21:48 +04:00
42394aec2b Added peng coins 2017-10-03 01:47:31 -04:00
84e39203bb readme points to ecosystem doc; add lotion, clean up 2017-10-02 23:46:35 -04:00
97e9802255 fix out of range error in VoteSet.addVote 2017-10-02 23:34:06 -04:00
8c6bd44929 log stack trace on consensus failure 2017-10-02 23:34:06 -04:00
ed5511dc08 glide: update for autofile fix 2017-10-02 23:34:02 -04:00
096dcb90e6 Merge pull request #59 from tendermint/develop
Develop
2017-10-02 23:29:35 -04:00
e9c83b3005 version and changelog 2017-10-02 23:26:45 -04:00
a55ec427bd Merge pull request #56 from tendermint/memdb-fix-close
db: fix MemDB.Close
2017-10-02 22:38:19 -04:00
aa57e89e21 changelog: add genesis amount->power 2017-10-02 14:28:04 -04:00
0948343a6f autofile: ensure file is open in Sync 2017-10-02 14:17:16 -04:00
c2f6ff759b typo 2017-10-02 13:02:45 -04:00
45ff7cdd0c rewrite ws client to expose a callback instead of a channel
callback gives more power to the publisher. plus it is optional
comparing to a channel, which will block the whole client if you won't
read from it.
2017-10-02 13:00:20 -04:00
ce36a0111a rpc: subscribe on reconnection (#689)
* rpc: subscribe on reconnection

* rpc: fix unit tests
2017-10-02 13:00:20 -04:00
b61f5482d4 Fix broken reference to ABCI 2017-10-02 13:00:20 -04:00
40b5defe18 release script [ci skip] 2017-10-02 13:00:20 -04:00
e40d1b36f7 docs: added passchain to the ecosystem.rst in the applications section; 2017-10-02 13:00:20 -04:00
60a2867af2 docs/ecosystem: add ABCI implementations 2017-10-02 12:59:32 -04:00
bfdad916a2 Update ecosystem.rst 2017-10-02 12:59:32 -04:00
498ff803db [README] added passchain to application list;
This adds passchain to the 'applications' part of the toplevel README.md file.
Passchain is a distributed password sharing system built on top of tendermint.
2017-10-02 12:59:32 -04:00
c8789492dc update docker readme [ci skip] 2017-10-02 12:59:32 -04:00
1723836014 update Dockerfile [ci skip] 2017-10-02 12:59:32 -04:00
2d6bc8d7d7 bump up Golang version to 1.9.0 2017-10-02 12:59:32 -04:00
7448c4adde Merge pull request #690 from etherealmachine/patch-1
Fix typo in using-tendermint.rst
2017-10-01 11:03:16 -04:00
a221736eee Fix typo in using-tendermint.rst
configutation -> configuration
2017-09-29 23:18:45 -07:00
382bead548 rpc: fix client websocket timeout (#687) 2017-09-29 13:32:30 +04:00
e9e6ec3a2c Implement Key/Value on Iterator for GoLevelDB
This is needed because leveldb reuses the keys on each iteration.
In our wrapper, we copy the key/value so that it is safe to store.
2017-09-28 17:43:47 +02:00
219d4e8427 Add IteratorPrefix method to Iterator 2017-09-28 17:35:01 +02:00
296d223545 Add Release & Error methods to Iterator
We need this to properly support LevelDB backend, which needs
to be released if we don't want to leak memory.
2017-09-28 17:26:24 +02:00
f9479b34cb sleep time should be greater than readTimeout (5 sec)
otherwise, we're not testing ping/pongs.
see https://github.com/tendermint/tendermint/pull/687#issuecomment-332494735
2017-09-27 15:44:19 +04:00
8be8127351 db: fix MemDB.Close
Fixes https://github.com/tendermint/tmlibs/issues/55

MemDB previously mistakenly set the actual DB pointer to nil
although that side effect is not visible to the outside world
since p is an identifier within the scope of just that function
call. However, @melekes and I had a discussion in which we
came to the conclusion that Close for an in-memory DB should
instead be a noop and not cause any data loss. See the
discussion on https://github.com/tendermint/tmlibs/pull/56.
2017-09-26 15:29:51 -06:00
85e562004c tendermint 0.11.0 compatibility 2017-09-25 11:11:20 -04:00
925696ca65 Merge branch 'p2p-prune-unused-IPRangeCount-funcs' into develop 2017-09-22 21:09:41 -06:00
0418d32276 Merge branch 'doc-file-started' into develop 2017-09-22 20:46:10 -06:00
7682ad9a60 Merge pull request #675 from tendermint/release-v0.11.0
Release v0.11.0
2017-09-22 13:48:52 -04:00
3e92d295e4 glide for tmlibs 0.3.1 2017-09-22 13:25:10 -04:00
9997e3a3b4 Merge pull request #54 from tendermint/develop
common: WriteFileAtomic use tempfile in current dir
2017-09-22 13:23:12 -04:00
35838b6af8 changeloge, version 2017-09-22 13:22:02 -04:00
3d98504c4c common: WriteFileAtomic use tempfile in current dir 2017-09-22 13:20:13 -04:00
2681f32bdd circle: add metalinter to test 2017-09-22 12:35:52 -04:00
661d336dd5 glide 2017-09-22 12:29:53 -04:00
3c57c24921 linting: next round of fixes 2017-09-22 12:14:27 -04:00
d1a00c684e types: comments 2017-09-22 12:00:37 -04:00
db034e079a version bump 2017-09-22 11:44:57 -04:00
7d983a548b changelog 2017-09-22 11:44:25 -04:00
8311f5c611 abci.Info takes a struct; less merkleeyes 2017-09-22 11:42:40 -04:00
d6e03d2368 linting: add to Makefile & do some fixes 2017-09-22 11:42:29 -04:00
191c4b6d17 Merge pull request #111 from tendermint/develop
Develop
2017-09-22 11:16:23 -04:00
88cb73d95a changelog 2017-09-22 11:16:09 -04:00
667c2543ea use request struct for Info 2017-09-22 11:10:55 -04:00
3d1fd4cefa Merge pull request #110 from tendermint/update-readme
readme: re-organize & update docs links
2017-09-22 10:45:59 -04:00
39b206f2c1 version bump, changelog, glide 2017-09-22 10:38:45 -04:00
311e8c1bf0 Merge pull request #30 from tendermint/develop
Develop
2017-09-22 10:29:28 -04:00
e6ea9499ff glide and changelog 2017-09-22 10:22:55 -04:00
628791e5a5 Merge pull request #665 from tendermint/no-internet
p2p: allow listener with no external connection
2017-09-22 10:16:50 -04:00
df857266b6 update glide 2017-09-22 10:14:05 -04:00
ddb3d8945d p2p: allow listener with no external connection 2017-09-22 10:13:23 -04:00
47d6f71e5a Makefile: remove redundant lint 2017-09-22 10:11:22 -04:00
96d2a2c92f readme: re-organize & update docs links 2017-09-22 10:10:56 -04:00
94d1b8d364 Merge pull request #109 from tendermint/metalinter
Metalinter
2017-09-22 09:52:15 -04:00
fe426de5d4 lint: couple more fixes 2017-09-22 09:45:50 -04:00
2130c329eb Merge pull request #46 from tendermint/develop
v0.3.0
2017-09-22 09:41:12 -04:00
bffe6744ec changelog 2017-09-22 09:38:58 -04:00
c3108f14c8 Merge pull request #52 from tendermint/573-wal-issues
call fsync after flush
2017-09-22 09:35:52 -04:00
a3ac825490 small fix 2017-09-22 09:14:45 -04:00
0e7d974410 install 2017-09-22 09:14:42 -04:00
65eb7e8974 linted, somewhat 2017-09-22 09:14:25 -04:00
36e96c5bf1 linting: catch some errors 2017-09-22 09:14:25 -04:00
6a378d30f3 linting: cover the basics 2017-09-22 09:14:25 -04:00
bd9f1d0d4c metalinter: add linter to Makefile like tendermint 2017-09-22 09:14:25 -04:00
7f5908b622 Merge pull request #637 from tendermint/feature/hsm
PrivValidator Interface
2017-09-22 00:28:40 -04:00
34e70090e6 Merge pull request #108 from tendermint/app-interface-upgrade
use request structs for InitChain and BeginBlock
2017-09-22 00:18:52 -04:00
318345f996 fix tests 2017-09-22 00:10:13 -04:00
24f7b9387a more tests 2017-09-22 00:05:39 -04:00
756818f940 fixes from review 2017-09-21 21:44:36 -04:00
d71d1394ec call fsync after flush (Refs #573)
short: flushing the bufio buffer is not enough to ensure data
consistency.

long:
Saving an entry to the WAL calls writeLine to append data to the
autofile group backing the WAL, then calls group.Flush() to flush that
data to persistent storage. group.Flush() in turn proxies to
headBuf.flush(), flushing the active bufio.BufferedWriter. However,
BufferedWriter wraps a Writer, not another BufferedWriter, and the way
it flushes is by calling io.Writer.Write() to clear the BufferedWriter's
buffer. The io.Writer we're wrapping here is AutoFile, whose Write
method calls os.File.Write(), performing an unbuffered write to the
operating system, where, I assume, it sits in the OS buffers awaiting
sync. This means that Wal.Save does not, in fact, ensure the saved
operation is synced to disk before returning.
2017-09-21 16:11:28 -07:00
2131f8d330 some fixes from review 2017-09-21 17:21:20 -04:00
8ae2ffda89 put funcs back in order to simplify review 2017-09-21 16:59:25 -04:00
75b97a5a65 PrivValidatorFS is like old PrivValidator, for now 2017-09-21 16:46:31 -04:00
7b99039c34 make signBytesHRS a method on LastSignedInfo 2017-09-21 15:54:33 -04:00
3ca7b10ad4 types: more . -> cmn 2017-09-21 15:54:33 -04:00
779c2a22d0 node: NewNode takes DBProvider and GenDocProvider 2017-09-21 15:54:33 -04:00
147a18b34a fix some comments 2017-09-21 15:52:25 -04:00
4382c8d28b fix tests 2017-09-21 15:52:25 -04:00
944ebccfe9 more PrivValidator interface 2017-09-21 15:51:20 -04:00
fd1b0b997a PrivValidator interface 2017-09-21 15:51:20 -04:00
abe912c610 FuncSignerAndApp allows custom signer and abci app 2017-09-21 15:50:43 -04:00
66fcdf7c7a minor fixes 2017-09-21 15:50:43 -04:00
4e13a19339 Add ability to construct new instance of Tendermint core from scratch 2017-09-21 15:50:43 -04:00
7dd3c007c7 Refactor priv_validator
Users can now just pass an object that implements the Signer interface.
2017-09-21 15:50:43 -04:00
0d392a0442 Allow Signer to be generated with priv key
Prior to this change, a custom Signer would have no knowledge of the private
key stored in the configuration file. This changes introduces a generator
function, which creates a Signer based on the private key. This provides an
opportunity for customer Signers to adjust behaviour based on the key
contents. (E.g. imagine key contents are a key label, rather than the key
itself).
2017-09-21 15:50:43 -04:00
7e4a704bd1 Remove reliance on default Signer
This change allows the default privValidator to use a custom Signer
implementation with no reliance on the default Signer implementation.
2017-09-21 15:50:43 -04:00
bf5e956087 Change capitalisation 2017-09-21 15:50:43 -04:00
2ccc3326ec Remove redundant file 2017-09-21 15:50:43 -04:00
83f7d5c95a Setup custom tendermint node
By exporting all of the commands, we allow users to setup their own
tendermint node cli. This enables users to provide a different
pivValidator without the need to fork tendermint.
2017-09-21 15:50:43 -04:00
2c129447fd Example that showcases how to build your own tendermint node
This example shows how a user of the tendermint library can build their
own node and supply it with its own commands. It includes two todos in
order to make it easier for library users to use tendermint.
2017-09-21 15:50:43 -04:00
b50339e8e7 p2p: sw.AddPeer -> sw.addPeer 2017-09-21 15:47:41 -04:00
8ff5b365dd Merge pull request #650 from tendermint/consensus_params
Consensus params
2017-09-21 15:46:57 -04:00
1f0985689d ConsensusParams ptr in GenesisDoc for json 2017-09-21 15:22:58 -04:00
3089bbf2b8 Amount -> Power. Closes #166 2017-09-21 14:59:27 -04:00
5feeb65cf0 dont use pointers for ConsensusParams 2017-09-21 14:59:24 -04:00
715e74186c fixes from review 2017-09-21 14:51:29 -04:00
3a03fe5a15 updated to match adr 005 2017-09-21 14:51:29 -04:00
d343560108 adr: add 005 consensus params 2017-09-21 14:51:29 -04:00
2b6db268cf genesis json tests and mv ConsensusParams to types 2017-09-21 14:51:29 -04:00
14abdd57f3 genDoc.ValidateAndComplete 2017-09-21 14:51:29 -04:00
1f3e4d2d9a move PartSetSize out of the config, into ConsensusParams 2017-09-21 14:51:29 -04:00
29bfcb0a31 minor comments/changes 2017-09-21 14:51:29 -04:00
301845943c Merge pull request #663 from tendermint/readme-update
update readme and other files
2017-09-21 12:36:11 -04:00
b0017c5460 update CHANGELOG [ci skip] 2017-09-21 12:34:37 -04:00
0b61d22652 Merge pull request #664 from tendermint/windows-path
use filepath for windows compatibility
2017-09-21 07:34:20 -04:00
246082368a add changelog entry [ci skip] 2017-09-20 02:49:51 -04:00
65a07b80a3 change logger interface to not return errors (Refs #50)
See https://github.com/go-kit/kit/issues/164 for discussion of why
kitlog returns an error.

```
Package log is designed to be used for more than simple application info/warning/error logging; it's suitable for log-structured data in an e.g. Lambda architecture, where each invocation is important. I agree with you that if we were doing only application logging the error would be more noise than signal. But the scope of the package is larger than that.
```

Since we are doing only application logging and we're not checking
errors, it is safe to get rid them.
2017-09-20 02:49:51 -04:00
9a2438e0dc common: Fingerprint comment 2017-09-20 02:49:51 -04:00
94a5087e0f made setfile playbook faster 2017-09-20 00:33:29 -04:00
6e2caf5a06 sudo fix 2017-09-19 23:51:40 -04:00
83f49f0dff Added unzip to packages to install 2017-09-19 23:49:26 -04:00
f9ae600a61 Introduced setfile playbook 2017-09-19 23:40:32 -04:00
23ad16b90e Merge pull request #52 from tendermint/lil-fix
lil fixes
2017-09-19 14:35:34 -04:00
94f0c7449a lil fix 2017-09-19 14:32:55 -04:00
b818d98875 jsonconfig playbook fix 2017-09-19 14:24:27 -04:00
8f657f8862 Added getfile ansible playbook 2017-09-19 13:18:22 -04:00
6848f8b407 Introduced jsonconfig task for ansible playbooks 2017-09-19 12:47:05 -04:00
7dc7109dc9 config.toml fix 2017-09-19 11:09:04 -04:00
2cad2d22fd Added data folder removal to unsafe reset 2017-09-19 10:58:14 -04:00
70b95135e6 consensus: use filepath for windows compatibility, closes #595 2017-09-18 17:49:43 -04:00
a3d925ac1d pr fixes 2017-09-18 16:52:00 -04:00
cf9a03f698 docs: organize install a bit better 2017-09-18 16:42:24 -04:00
7f8240dfde Merge pull request #521 from tendermint/json-rpc-patch
updated json response to match spec by @davebryson
2017-09-18 16:37:34 -04:00
f8b152972f return method not found error
if somebody tries to access WS method in non-ws context
2017-09-18 16:36:03 -04:00
95875c55fc ID must be present in both request and response
from the spec:
This member is REQUIRED.
It MUST be the same as the value of the id member in the Request Object.
If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.
2017-09-18 16:36:03 -04:00
7fadde0b37 check for request ID after receiving it 2017-09-18 16:36:03 -04:00
e36c79f713 capitalize RpcError 2017-09-18 16:36:03 -04:00
2252071866 update changelog 2017-09-18 16:36:03 -04:00
b700ed8e31 remove check for non-empty message as it should always be present 2017-09-18 16:36:03 -04:00
e1fd587ddd we now omit error if empty 2017-09-18 16:36:03 -04:00
f74de4cb86 include optional data field in error object
```
data
A Primitive or Structured value that contains additional information about the error.
This may be omitted.
The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
```
2017-09-18 16:36:02 -04:00
6c1572c9b8 fix invalid memory address or nil pointer dereference 2017-09-18 16:36:02 -04:00
60a1f49a5c updated json response to match spec by @davebryson 2017-09-18 16:35:50 -04:00
740167202f readme & al., update links to docs 2017-09-18 16:23:22 -04:00
f279171a28 use request structs for InitChain and BeginBlock 2017-09-18 15:51:48 -04:00
e0017c8a97 Merge pull request #654 from tendermint/docs-add-tools
consolidate docs from tools repo
2017-09-18 13:55:37 -04:00
4a78c1bb28 Merge pull request #661 from tendermint/docs-add-ecosystem
docs: add ecosystem from website
2017-09-18 13:55:09 -04:00
1d3f723ccc docs: remove last section from ecosystem 2017-09-18 13:41:12 -04:00
77408b7bde docs: using ABCI-CLI 2017-09-18 13:31:18 -04:00
0cd1bd6d8b Merge pull request #658 from tendermint/organize-docs
docs: organize the directory
2017-09-18 13:08:38 -04:00
94c721641c ansible playbook getconfigtoml fix 2017-09-18 12:19:16 -04:00
881d2ce31e docs: pull from tools' master branch 2017-09-18 12:14:23 -04:00
99ac80f39b Merge pull request #51 from tendermint/cleanup-and-move-docs
transfer README's for each tool to tendermint docs
2017-09-18 12:10:49 -04:00
ad79ead93d docs: add and re-format the ecosystem from website 2017-09-18 11:57:35 -04:00
d9824c1cc4 Added getconfigtoml playbook 2017-09-18 11:26:34 -04:00
17a748c796 docs: rename file 2017-09-18 09:39:23 -04:00
583599b19f docs: add software.json from website (ecosystem) 2017-09-18 09:38:22 -04:00
044fe56b43 update changelog 2017-09-16 15:24:30 -04:00
b46da19b74 docs: organize the directory, #656 2017-09-16 15:19:22 -04:00
d635783d07 docs: finish pull from tools 2017-09-16 15:11:10 -04:00
f79e13af38 docs: pull from tools on build 2017-09-16 15:11:10 -04:00
34e6474ad9 docs: organize tm-bench/monitor description 2017-09-16 15:11:10 -04:00
5c96e0c812 docs: add original tm-bench/monitor files 2017-09-16 15:11:10 -04:00
921a2b41f0 docs: add kubes docs to mintnet doc, from tools 2017-09-16 15:11:10 -04:00
a8cec967ac docs: harmonize headers for tools docs 2017-09-16 15:11:10 -04:00
044c500cc0 docs: move images in from tools repo 2017-09-16 15:11:10 -04:00
a917ec9ea2 docs: update index.rst 2017-09-16 15:11:10 -04:00
d4ccc88676 docs: convert from md to rst 2017-09-16 15:11:10 -04:00
12c85c4e60 docs: add original README's from tools repo 2017-09-16 15:11:10 -04:00
b08326cb3b docs: re-add the images 2017-09-16 14:33:47 -04:00
3f55cc3430 docs: use README.rst to be pulled from tendermint 2017-09-16 14:13:09 -04:00
90c0267bc1 types: privVal.Sign returns an error 2017-09-16 01:07:04 -04:00
4e955434aa Merge pull request #48 from tendermint/log_tweak
Log tweak
2017-09-16 00:40:44 -04:00
f6a2509764 doc.go file started
Fixes #35
Updates https://github.com/tendermint/coding/issues/27

Started a doc.go file to provide an overview/high level
dive into the functionality of this repo.

Also added an example_test.go file in which we can
put end-to-end code examples/actual usage patterns
that can be copied and pasted and will always have to
compile when tests are run to ensure that we don't regress.
2017-09-15 17:35:33 -06:00
8963bf08aa Merge pull request #657 from tendermint/fix/adr
docs: update and clean up adr
2017-09-15 19:32:58 -04:00
ede4f818fd docs: update and clean up adr 2017-09-15 19:31:37 -04:00
126f63c0a2 Merge pull request #653 from tendermint/improvement/peer_interface
peer interface
2017-09-15 18:43:53 -04:00
aea8629272 peer interface 2017-09-15 18:40:59 -04:00
5138bcb1c7 p2p: delete unused and untested *IPRangeCount functions
Fixes #602

Delete unused and untested functions:
- AddToIPRangeCounts
- CheckIPRangeCounts
2017-09-15 14:03:01 -06:00
be9c7fce9c Made the tomlconfig playbook even faster 2017-09-15 14:54:23 -04:00
e8d2c0b0db Reorganized package installations in Ansible to make tomlconfig faster 2017-09-15 11:42:23 -04:00
4f47a762a0 Introduced tomlconfig playbook 2017-09-15 02:10:29 -04:00
961e936100 remove tm-bench/monitor README's destined for tmint docs 2017-09-13 15:47:41 -04:00
87724cc451 remove mintnet docs 2017-09-13 14:09:22 -04:00
9dc43e0d1c remove unused terraform-aws 2017-09-13 10:08:51 -04:00
f1ae1ec8f9 remove tool README's to put in tendermint docs 2017-09-13 10:06:46 -04:00
00a0f4e6c4 remove create DO testnet file 2017-09-13 09:17:52 -04:00
50e7c07817 Use longer checksum again 2017-09-13 14:03:28 +02:00
c8b6d29161 version bump and changelog 2017-09-12 19:31:00 -04:00
bed33467b1 cosmos-sdk RPM package fixes 2017-09-12 18:01:29 -04:00
96828217c3 cosmos-sdk package fix 2017-09-12 17:25:47 -04:00
dfee48fcff cosmos-sdk package modifications 2017-09-12 16:07:15 -04:00
92869b5b35 Added devops_path to Ansible playbooks 2017-09-12 15:56:09 -04:00
2055ae2e2a cosmos-sdk package fix 2017-09-12 15:45:37 -04:00
7146619aa8 Added placeholder for cosmos-sdk package 2017-09-12 15:41:39 -04:00
191b2301a1 Cosmos-SDK package additional files 2017-09-12 15:33:09 -04:00
8f438fa893 Makefile fixes for cosmos-sdk 2017-09-12 15:21:05 -04:00
69cfb9c88e cosmossdk build fixes 2017-09-12 15:08:22 -04:00
8aeb5a98bd Changed cosmos-sdk to cosmossdk for the Makefile 2017-09-12 15:01:28 -04:00
bb2bfbc22a Added cosmos-sdk build steps 2017-09-12 14:53:34 -04:00
09447fc059 Merge pull request #34 from tendermint/feature/remove-cli
Removed all cli as it goes into cosmos-sdk
2017-09-12 14:48:29 -04:00
cc50dc076a Merge pull request #638 from tendermint/feature/state_tests
Upgrade state_test.go
2017-09-12 14:37:59 -04:00
bf576f0097 state: minor comment fixes 2017-09-12 14:37:32 -04:00
1b1462607b Added option to push to devops repo 2017-09-12 12:51:12 -04:00
377747b061 Merge pull request #651 from tendermint/doc/testnet
Started expanding "automated deployments" in documentation
2017-09-12 12:41:42 -04:00
870a98ccc3 Last fixes 2017-09-12 17:12:19 +02:00
8eda3efa28 Cleanup lines to fit within 72 characters 2017-09-12 17:08:30 +02:00
e2c3cc9685 docs: give index a Tools section 2017-09-12 10:57:34 -04:00
2a6e71a753 Reformat tests to extract common setup 2017-09-12 16:57:10 +02:00
340d273f83 Started expanding "automated deployments" 2017-09-11 11:34:36 -04:00
3a36776d4a Reorder file for grokability 2017-09-10 18:45:20 -07:00
21f6b346a3 Removed all cli as it goes into cosmos-sdk 2017-09-08 20:26:56 +02:00
ad42794b2e Merge pull request #33 from tendermint/feature/support-fundraiser-seeds
Import unencrypted private key
2017-09-08 20:23:44 +02:00
e283f580b7 Test importing raw private key 2017-09-08 20:14:51 +02:00
54260853d5 encoder accepts empty string as unencoded bytes 2017-09-08 20:14:51 +02:00
555d591c80 Reorganized public_testnet app_option, changed config.toml to create empty blocks every second 2017-09-07 17:23:13 -04:00
63ba27f186 Merge pull request #36 from Greg-Szabo/master
New set of DevOps scripts
2017-09-07 14:08:05 -04:00
a072429659 Fix blog post link for ABCI
We moved our blog to Medium.
2017-09-07 13:32:56 +08:00
b6a7dc4832 public_testnet app_option fix 2017-09-06 23:12:42 -04:00
717c612ba7 Debian/RedHat repo fixes, added greg money to public_testnet 2017-09-06 21:39:57 -04:00
3485cac7fb rpm -K check fix 2017-09-06 20:01:31 -04:00
54c63726b0 p2p: minor comment fixes 2017-09-06 16:40:21 -04:00
cb80ab2965 Merge remote-tracking branch 'orijtech/p2p-full-test-PeerSet' into develop 2017-09-06 16:40:07 -04:00
c48e772115 p2p: fully test PeerSet, more docs, parallelize PeerSet tests
* Full test PeerSet and check its concurrent guarantees
* Improve the doc for PeerSet.Has and remove unnecessary
defer for a path that sets a variable, make it fast anyways.
* Parallelize PeerSet tests with t.Parallel()
* Document functions in peer_set.go more.
2017-09-06 02:47:31 -06:00
1bc8de4caa remove String() from Signature. closes #29 2017-09-06 02:32:37 -04:00
f1094f760b types: remove redundant version file 2017-09-06 02:22:59 -04:00
e86930c431 Merge pull request #106 from tendermint/develop
Develop
2017-09-06 02:22:01 -04:00
aa78fc14b5 cmd: dont wait for genesis. closes #562 2017-09-06 01:57:21 -04:00
399fb9aa70 consensus: remove support for replay by #HEIGHT. closes #567 2017-09-06 01:53:41 -04:00
ec3c91ac14 Merge pull request #618 from tendermint/historical_validators
Historical validators
2017-09-06 01:46:31 -04:00
fae0603413 more fixes from review 2017-09-06 01:25:57 -04:00
9af837c24d Merge pull request #644 from tendermint/release-v0.10.4
Release v0.10.4
2017-09-05 17:44:48 -04:00
cc2b418f7f p2p: test fix 2017-09-05 17:10:11 -04:00
6ddc30ffc7 Merge branch 'master' into release-v0.10.4 2017-09-05 16:49:57 -04:00
aa7d63f2ff bump version to 0.10.4 2017-09-05 16:46:56 -04:00
50f2ef548c Merge pull request #642 from tendermint/zramsay-patch-1
Delete roadmap.md
2017-09-05 16:26:04 -04:00
b9637f7185 Update changelog and add roadmap 2017-09-05 16:25:02 -04:00
88138c38cf mempool: reactor test 2017-09-05 16:25:02 -04:00
5ad0da1750 Merge pull request #640 from tendermint/read-the-docs
Implement read the docs
2017-09-05 15:37:24 -04:00
cad2b3ce5a fix journald restart in ansible 2017-09-05 02:07:08 -04:00
9deb647303 fixes from review 2017-09-04 18:29:51 -04:00
b6bc56e906 Introduced cloudfront repository hosting 2017-09-04 14:55:46 -04:00
b856c45b9c Merge pull request #634 from tendermint/config-p2p
p2p: put maxMsgPacketPayloadSize, recvRate, sendRate in config
2017-09-04 14:16:16 -04:00
f0f1ebe013 rpc: Block and Commit take pointers; return latest on nil 2017-09-03 16:07:37 -04:00
34beff117a state: comments; use wire.BinaryBytes 2017-09-03 16:07:37 -04:00
e2e8746044 rpc: historical validators 2017-09-03 16:07:37 -04:00
78446fd99c state: persist validators 2017-09-03 16:07:37 -04:00
daa258ea6d p2p: put maxMsgPacketPayloadSize, recvRate, sendRate in config
Updates #628
2017-09-01 21:44:15 -04:00
54c85ef8b9 try image 2017-09-01 21:14:26 -04:00
de512c5923 fix 2017-09-01 21:05:12 -04:00
8fd133ff19 docs: pretty-fy 2017-09-01 20:59:27 -04:00
f5ba931115 docs: logo, add readme, fixes 2017-09-01 20:08:22 -04:00
3370e40fe1 Delete roadmap.md
file is out of date & provides no useful information
2017-09-01 19:38:11 -04:00
e509e8f354 docs: clean a bunch of stuff up 2017-08-31 15:30:17 -04:00
e9918a7323 config.toml changes 2017-08-31 13:38:38 -04:00
aaef2f7c84 docs: link fixes 2017-08-30 22:26:26 -04:00
369aa5854f docs: fix image links 2017-08-30 22:11:21 -04:00
9d12e485e5 docs: rst-ify the intro 2017-08-30 21:43:39 -04:00
dc54fc707e docs: port website's intro for rtd 2017-08-30 21:34:51 -04:00
212a5ebc2e docs: use maxdepth 2 for spec 2017-08-30 21:17:07 -04:00
2d2e769e96 rtd: build fixes 2017-08-30 21:01:05 -04:00
bba35c1486 docs: rpc docs to be slate, see #526, #629 2017-08-30 20:51:48 -04:00
0a902ebf61 docs: organize the specification 2017-08-30 20:47:37 -04:00
70c0f4b936 docs: convert markdown to rst 2017-08-30 17:54:25 -04:00
e19fa59b63 docs: consolidate ADRs 2017-08-30 17:43:39 -04:00
30d351b0c1 Merge pull request #623 from tendermint/fix/no-config-on-version
cmd: don't load config for version command. closes #620
2017-08-30 16:42:58 -04:00
818314c5db docs: add sphinx Makefile & requirements 2017-08-30 16:37:51 -04:00
700e4bb29d docs: test 2017-08-30 15:26:32 -04:00
8ad4a1341f docs: add conf.py 2017-08-30 15:16:39 -04:00
d46b5db056 config.toml change, removed rsyslog install 2017-08-30 10:38:02 -04:00
b64a323da7 config.toml changes 2017-08-29 19:07:18 -04:00
6890cd2ae5 config.toml changes, unsafe_reset role fix 2017-08-29 19:06:27 -04:00
d87acc2d1b cmd: don't load config for version command. closes #620 2017-08-28 15:01:51 -04:00
f2349b1092 Merge pull request #526 from tendermint/feature/rpc-docs
RPC docs
2017-08-25 18:10:21 -04:00
7824b66f5b Merge pull request #548 from tendermint/indexing-proposal
Indexing proposal
2017-08-25 18:02:18 -04:00
83048fb2fe Merge pull request #604 from tendermint/bugfix/ws-io-timeout
Biff up RPC WSClient
2017-08-25 17:59:34 -04:00
9dde1a0bd4 rpc: comments 2017-08-25 17:57:09 -04:00
bfec1ff1cd bump version to 0.3.0 2017-08-25 16:58:59 -04:00
bdfd978b68 update changelog 2017-08-25 16:58:37 -04:00
8f1dea89f5 db: fix memdb iterator 2017-08-25 16:35:37 -04:00
fe08fc00c8 Merge pull request #34 from orijtech/develop
common/IsDirEmpty: do not mask non-existance errors
2017-08-25 16:01:30 -04:00
271145ee72 Merge pull request #32 from tendermint/bugfix/write-file-atomic
Fix rename /root/.tendermint_test/consensus_replay_test/priv_validator.json.new /root/.tendermint_test/consensus_replay_test/priv_validator.json: no such file or directory
2017-08-25 15:58:09 -04:00
38846aebfe Install rsyslog for CentOS for troubleshooting purposes 2017-08-25 10:57:15 -04:00
01181721ad readme: update install instruction (#100) 2017-08-24 17:02:14 +02:00
212df60671 Raised max tx in a block to 10000 2017-08-23 14:30:47 -04:00
6bfcc917ad config.toml tweaks for tendermint 2017-08-22 17:21:08 -04:00
e6ed8e70ac Changes to tendermint config for better performance 2017-08-22 16:32:03 -04:00
36db612249 tendermint memcheck recheck disabled 2017-08-22 14:30:37 -04:00
76fbcadf2b Added option to tendermint service to not create empty blocks 2017-08-22 13:49:45 -04:00
bc9092d7db Merge pull request #609 from orijtech/parseConfig-doc-update
cmd/tendermint/commands: update ParseConfig doc
2017-08-21 13:55:45 -04:00
56b959b9f9 Merge pull request #611 from tendermint/dont_panic
Dont panic
2017-08-21 13:54:58 -04:00
b3796e0aaa rpc: typo fixes 2017-08-16 15:18:55 -04:00
d24083b257 generate md for Slate 2017-08-16 15:17:08 -04:00
83ec9f773a wrote docs for rpc methods [ci skip]
for all of them except unsafe
2017-08-16 15:17:08 -04:00
a05c3ceb46 Merge pull request #42 from tendermint/zramsay-patch-1
create readme
2017-08-16 15:06:33 -04:00
9ceccbe9a4 consensus: recover panics in receive routine 2017-08-16 01:01:09 -04:00
35a4912449 dont panic on getVoteBitArray 2017-08-16 00:43:55 -04:00
01e008cedd Merge pull request #607 from tendermint/zramsay-patch-1
fix link from slack to rocket
2017-08-15 12:40:07 -04:00
d8af26e75a cmd/tendermint/commands: update ParseConfig doc 2017-08-12 16:29:11 -06:00
956966e658 add missing validator package to glide.yaml 2017-08-11 16:36:26 -04:00
20c7a8f035 Merge pull request #31 from tendermint/bugfix/escape-syntax-for-base-16-hashes
[pubsub/query] quote values using single quotes
2017-08-11 12:33:48 -04:00
03ddb109ec fix link from slack to rocket 2017-08-11 10:30:04 -04:00
fa990f0803 add test case for hex 2017-08-10 19:46:59 -04:00
2fd8496bc1 correct handling of pings and pongs
server:
- always has read & write timeouts
- ping handler never blocks the reader (see A)
- sends regular pings to check up on a client

A:
at some point server write buffer can become full, so in order not to
block reads from a client (see
https://github.com/gorilla/websocket/issues/97), server may skip some
pongs. As a result, client may disconnect. But you either have to do
that or block the reader. There is no third way.

client:
- optional read & write timeouts
- optional ping/pong to measure latency
2017-08-10 17:53:49 -04:00
8d7640894d Merge pull request #606 from tendermint/release-v0.10.3
Release v0.10.3
2017-08-10 10:25:48 -04:00
c5a657f540 consensus: test proposal heartbeat 2017-08-10 01:24:23 -04:00
1ea43e513d version bump 2017-08-10 00:14:49 -04:00
c9e11de2a7 consensus: log ProposalHeartbeat msg 2017-08-10 00:12:16 -04:00
f644fc5725 changelog 2017-08-10 00:04:07 -04:00
49278a7f9c Merge pull request #579 from tendermint/feature/sync_status
Add fast-sync status to Status() call
2017-08-09 23:51:25 -04:00
b0728260e9 comments 2017-08-09 23:51:09 -04:00
92ada55e5a make conR.FastSync() thread safe 2017-08-09 14:55:21 -04:00
8840ae6ae2 Merge pull request #597 from zramsay/tendermint-types-links
fix dead tendermint types links in specs
2017-08-08 22:19:10 -04:00
21dab22f17 Merge pull request #599 from zramsay/docs-getting-started
docs fixes throughout
2017-08-08 22:17:44 -04:00
10a849c27e Merge pull request #596 from zramsay/deduplications
Deduplications
2017-08-08 22:16:25 -04:00
236489aecf backlog must always have higher priority 2017-08-08 19:03:48 -04:00
7108c66e3b Merge pull request #584 from tendermint/no-empty-blocks
No empty blocks
2017-08-08 18:10:04 -04:00
797acbe911 ws: small comment 2017-08-08 17:33:17 -04:00
0bf66deb3c fixes from review 2017-08-08 17:09:04 -04:00
d2f3e9faf4 test CreateEmptyBlocksInterval 2017-08-08 16:35:25 -04:00
37f1390473 CreateEmptyBlocks and CreateEmptyBlocksInterval 2017-08-08 16:22:37 -04:00
9b5f21a650 [ws-server] reset readTimeout when we receive something 2017-08-08 16:03:04 -04:00
8267920749 [ws-client] write normal close message 2017-08-08 16:02:37 -04:00
6c85e4be4f change server ping period to be less frequent
no need to ping ws every 10 sec
2017-08-08 13:21:59 -04:00
23a87304cc add a comment for PingPongLatencyTimer [ci skip] 2017-08-08 13:20:58 -04:00
c14b39da5f make RPC server's ping period and pong wait configurable via options 2017-08-07 18:29:55 -04:00
57eee2466b make WSClient thread-safe 2017-08-07 17:56:38 -04:00
5d66d1c28c fixes from review 2017-08-05 13:11:00 -04:00
fb47ca6d35 fixes from review 2017-08-04 21:36:11 -04:00
0013053fae allow to change pong wait and ping period 2017-08-04 10:42:55 -04:00
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
124032e3e9 NoEmptyBlocks config option 2017-07-28 22:11:45 -04:00
4beac54bd9 no empty blocks 2017-07-28 22:11:45 -04:00
39493bcd9a consensus: isProposer func 2017-07-28 22:11:10 -04:00
73ced040a3 [tm-bench] updated deps 2017-07-28 18:13:39 -04:00
f96771e753 cleanup CONTRIBUTING.md, part of https://github.com/zramsay/tendermint/issues/7 2017-07-28 16:45:03 -04:00
62f94a7948 deduplicate install, closes https://github.com/zramsay/tendermint/issues/2 2017-07-28 16:34:38 -04:00
d7c936abfa Added timezone setting for CentOS 2017-07-28 19:30:59 +00:00
03d2b2446e Merge pull request #28 from odeke-em/godoc-for-references
README: add godoc instead of tedious MD regeneration
2017-07-28 15:09:54 -04:00
ce80f234c7 README: add godoc instead of tedious MD regeneration
Add a godoc reference to delegate indexing and references
to that service, thus keeping our library and usages upto date,
instead of relying on generated markdown that goes stale
especially for changing API signatures, and becomes tedious
where someone has to remember to always regenerate the README
markdown and then commit it.

Fixes #24
2017-07-28 13:01:31 -06:00
773f7aac5b Debugging perftestnets 2017-07-28 18:32:29 +00:00
f2c881573c Merge pull request #26 from odeke-em/improve-reverse-bytes+tests
hd: optimize ReverseBytes + add tests
2017-07-28 14:28:16 -04:00
ae9c5b1ca0 hd: optimize ReverseBytes + add tests
* Optimized ReverseBytes to:
a) Minimally allocate --> 60.0% reduction in the number of allocations
b) Only walk halfway the length of the string thus performing
byte swaps from left to right. Improves the performance as well.
Complexity is O(n/2) instead of O(n) which is still O(n) but
benchmarks show the new time is in deed 1/2 of the original time.

* Added unit tests and some common cases to ensure correctness.

* Benchmark shoot out results:
```shell
name            old time/op    new time/op    delta
ReverseBytes-4     554ns ± 4%     242ns ± 3%  -56.20%  (p=0.000 n=10+10)

name            old alloc/op   new alloc/op   delta
ReverseBytes-4      208B ± 0%      114B ± 0%  -45.19%  (p=0.000 n=10+10)

name            old allocs/op  new allocs/op  delta
ReverseBytes-4      10.0 ± 0%       4.0 ± 0%  -60.00%  (p=0.000 n=10+10)
```
2017-07-28 12:21:41 -06:00
e212bf1aa0 config ansible role fix 2017-07-28 17:48:53 +00:00
dcb86f4d12 Fix: ansible playbook to deploy tendermint 2017-07-28 17:22:08 +00:00
55c0a79aa6 Fixed templates to run on AWS, added option to install tendermint with dummy app 2017-07-28 15:52:15 +00:00
d1ca2c6f83 [common] add a test for WriteFileAtomic 2017-07-28 11:40:21 -04:00
b25aa3b472 [common] do not create {filePath}.bak in WriteFileAtomic
We use WriteFileAtomic in two places:

```
p2p/addrbook.go
338:    err = cmn.WriteFileAtomic(filePath, jsonBytes, 0644)

types/priv_validator.go
162:    err = WriteFileAtomic(privVal.filePath, jsonBytes, 0600)
```

and we don't need .bak in any of the above. We save priv_validator every
10ms and addrbook every 2 min.
2017-07-28 11:40:21 -04:00
8a51210efc [common] use temp intead of {filePath}.new
The problem with {filePath}.new is that it is not safe for concurrent
use! Calling this function with the same params results in the following
error:

```
panic: Panicked on a Crisis: rename /root/.tendermint_test/consensus_replay_test/priv_validator.json.new /root/.tendermint_test/consensus_replay_test/priv_validator.json: no such file or directory

goroutine 47860 [running]:
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.PanicCrisis(0xcba800, 0xc42152d640)
	/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/errors.go:33 +0x10f
github.com/tendermint/tendermint/types.(*PrivValidator).save(0xc42235f2c0)
	/go/src/github.com/tendermint/tendermint/types/priv_validator.go:165 +0x159
github.com/tendermint/tendermint/types.(*PrivValidator).signBytesHRS(0xc42235f2c0, 0x6, 0x0, 0xc424e88f03, 0xc429908580, 0xca, 0x155, 0x80, 0xc424e88f00, 0x7f4ecafc88d0, ...)
	/go/src/github.com/tendermint/tendermint/types/priv_validator.go:249 +0x2bb
github.com/tendermint/tendermint/types.(*PrivValidator).SignVote(0xc42235f2c0, 0xc4228c7460, 0xf, 0xc424e88f00, 0x0, 0x0)
	/go/src/github.com/tendermint/tendermint/types/priv_validator.go:186 +0x1a2
github.com/tendermint/tendermint/consensus.(*ConsensusState).signVote(0xc424efd520, 0xc400000002, 0xc422d5e3c0, 0x14, 0x20, 0x1, 0xc4247b6560, 0x14, 0x20, 0x0, ...)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:1556 +0x35e
github.com/tendermint/tendermint/consensus.(*ConsensusState).signAddVote(0xc424efd520, 0x2, 0xc422d5e3c0, 0x14, 0x20, 0x1, 0xc4247b6560, 0x14, 0x20, 0xc42001b300)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:1568 +0x200
github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrecommit(0xc424efd520, 0x6, 0x0)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:1082 +0x13a4
github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote(0xc424efd520, 0xc424e88780, 0x0, 0x0, 0x39, 0x1dc, 0x28c)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:1477 +0x1be5
github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote(0xc424efd520, 0xc424e88780, 0x0, 0x0, 0xd7fb00, 0xc42152ce00)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:1382 +0x93
github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg(0xc424efd520, 0xcb58e0, 0xc42547feb8, 0x0, 0x0, 0x6, 0x0, 0x4, 0xed10ca07e, 0x3077bfea, ...)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:660 +0x9fc
github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine(0xc424efd520, 0x0)
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:615 +0x5f5
created by github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart
	github.com/tendermint/tendermint/consensus/_test/_obj_test/state.go:332 +0x4a7
exit status 2
FAIL	github.com/tendermint/tendermint/consensus	76.644s
make: *** [test_integrations] Error 1
```

See https://github.com/tendermint/tendermint/pull/568
2017-07-28 11:39:59 -04:00
bc398a5859 Removed useradd dependency so package works for Amazon Linux 2017-07-27 20:48:57 +00:00
4cb362d625 Preparations and fixes for AWS deployments 2017-07-27 20:40:10 +00:00
bf355d1b58 Merge pull request #23 from tendermint/feature/short-recover-text
Shorter recovery seed
2017-07-27 16:11:03 -04:00
050b965708 Code cleanup ala Emmanuel 2017-07-27 15:59:59 -04:00
b6af7e78d8 build process fix: tendermint folder permission 2017-07-26 21:39:48 +00:00
22fb175d62 CentOS build fix: home folder of app is readable by all 2017-07-26 21:07:27 +00:00
10222adaf1 Remove deprecated code. Now in basecoin/weave 2017-07-26 16:12:25 -04:00
c20e83565c Recovery also works with secp256 keys 2017-07-22 05:53:46 -04:00
4ff889a236 Use 16 random bytes for seed and key, crc16 by default 2017-07-22 05:44:09 -04:00
65da3cf340 Add crc16 support 2017-07-22 05:25:59 -04:00
a6a06f820f [pubsub/query] quote values using single quotes
This fixes the problem with base-16 encoded values which may start with
digits: 015AB.... In such cases, the parser recognizes them as numbers
but fails to parse because of the follow-up characters (AB).

```
failed to parse tm.events.type=Tx AND hash=136E18F7E4C348B780CF873A0BF43922E5BAFA63:
parse error near digit (line 1 symbol 31 - line 1 symbol 32):
  "6"
```

So, from now on we should quote any values. This seems to be the way
Postgresql has chosen.
2017-07-21 13:20:32 +03:00
2f6f3e6aa7 Merge pull request #28 from tendermint/feature/376-events.v2
New pubsub package plus the query subpackage
2017-07-20 15:03:02 -04:00
77f6febb03 rename TestClientResubscribes to TestClientSubscribesTwice
test UnsubscribeAll properly
test BufferCapacity getter
2017-07-20 11:46:22 +03:00
e9b7221292 consensus: more comments 2017-07-20 00:59:28 -04:00
3c6c1b7d33 common: ProtocolAndAddress 2017-07-19 15:02:04 -04:00
5fea1d2675 [.editorconfig] add rule for .proto files [ci skip] 2017-07-19 12:29:10 +03:00
7a492e3612 Merge pull request #549 from tendermint/rpc-server-proposal
RPC server ADR
2017-07-19 10:44:12 +03:00
b893df3348 add rpc server proposal [ci skip] 2017-07-19 10:43:30 +03:00
742b5b705f update link to contributing guidelines in README.md [ci skip] 2017-07-19 10:35:54 +03:00
0153d21f3b Update website links on README.md (#589) [ci skip]
* Update website links on README.md

Changed the blog links to Medium.
Updated Tendermint website links.

* correct link for Tendermint blog [ci skip]
2017-07-19 10:31:49 +03:00
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
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
8355fee16a Merge pull request #563 from tendermint/bugfix/ignore-tmhome-in-tests
Do some cleanup in the test, so it doesn't fail in my shell
2017-07-06 21:48:40 -04:00
cb45f21888 trackomatron service fixes 2017-07-07 00:13:12 +00:00
27643cd9f9 Fixed trackomatron Debian package bug 2017-07-06 20:36:57 +00:00
620713de77 Comment typo fix 2017-07-06 20:20:34 +00:00
b2c3951c5c trackomatron directory name fix 2017-07-06 20:14:50 +00:00
1c5e36725f Makefile workaround for different binary name for trackomatron (tracko) 2017-07-06 20:08:36 +00:00
ccf13fae0c Makefile fix for trackomatron 2017-07-06 20:03:12 +00:00
54a9364565 Added trackomatron build process 2017-07-06 20:00:06 +00:00
7942f216fc Added -K option note to ansible readme for OSX 2017-07-04 21:53:45 +00:00
f0c733ccbd Added brew install description to ansible readme 2017-07-04 20:53:50 +00:00
be8b7124aa Fixed ansible readme and unsafe_reset role 2017-07-04 20:45:03 +00:00
d268b1558e Fixed genesis json data type - reported by melekes 2017-07-04 19:47:29 +00:00
db4bba72a2 Added dockerfiles for applications 2017-07-04 16:23:51 +00:00
e7a96b469a Added ansible functionality to extract the testnet configuration to a folder. 2017-06-28 15:50:23 +00:00
7f3c697b6e Merge pull request #559 from tendermint/release-v0.10.1
Release v0.10.1
2017-06-28 11:45:41 -04:00
0d1fa8e884 fixes from review 2017-06-28 11:12:45 -04:00
2e0a4aafa7 Update glide files to proper versions 2017-06-28 13:05:51 +02:00
bfecb5a135 some fixes from review 2017-06-27 16:05:21 -04:00
213833d9e2 Bash example script fix 2017-06-27 18:40:15 +00:00
9b8e2ece03 Ethermint service environment variable fix 2017-06-27 16:41:22 +00:00
850da13622 Do some cleanup in the test, so it doesn't fail in my shell 2017-06-27 13:31:32 +02:00
b284d39e05 update changelog 2017-06-26 17:29:39 -04:00
23d8de8962 Merge branch 'develop' into release-v0.10.1 2017-06-26 17:22:57 -04:00
3065059da7 update changelog 2017-06-26 17:20:27 -04:00
e2ed15fa02 rpc: SetWriteDeadline for ws ping. fixes #553 2017-06-26 17:13:39 -04:00
b92814c933 Merge pull request #560 from tendermint/feature/docker-build-automation
Docker build automation
2017-06-26 16:20:05 -04:00
12c084c8c0 ParseGenesisFile -> types.GenesisDocFromFile 2017-06-26 16:16:54 -04:00
f67b87b548 Added new SSH key 2017-06-26 15:24:03 +00:00
e4caf96bcb Calculate validator hash from genesis doc 2017-06-26 17:06:49 +02:00
10982f4d8f Add argument to ParseGenesis to use in light-client 2017-06-26 16:56:51 +02:00
6b38abd57b Cleanup for loop in genesis file load 2017-06-26 13:58:34 +02:00
58105dbd4e Refactored some commands to be more reusable 2017-06-26 13:58:34 +02:00
d0b1bf4e26 [docker] bump golang version to 1.8.3 2017-06-26 12:08:38 +04:00
aa7b3a73f5 [docker] remove dummy app as default [ci skip] 2017-06-26 12:05:50 +04:00
852375be00 [docker] update link to mintnet-k8s [ci skip] 2017-06-26 12:05:50 +04:00
9a80730f38 [docker] fix link to 0.10.0 Dockerfile [ci skip] 2017-06-26 12:05:40 +04:00
24a1b130f9 [docker] build and push scripts [ci skip] 2017-06-26 12:05:34 +04:00
e2fe4a6e9b [docker] bump alpine version [ci skip] 2017-06-26 12:05:23 +04:00
4f5b6528a1 version bump 2017-06-24 22:56:31 -04:00
10828ad063 changelog 2017-06-24 22:55:48 -04:00
b6031d5f4b rpc/lib: set logger on ws conn 2017-06-24 21:55:31 -04:00
5c29d7aba9 rpc/lib: test tcp and unix 2017-06-24 21:27:19 -04:00
bdbefe334d Merge pull request #539 from tendermint/feature/readme_update
Add Code of Conduct
2017-06-24 00:14:08 -04:00
77a3d03385 blockchain: explain isCaughtUp logic 2017-06-23 22:34:38 -04:00
efb56aaea7 Merge pull request #25 from tendermint/stderr
CLI Execute Error prints to stderr
2017-06-23 22:22:07 -04:00
a28e35fd98 Merge branch 'develop' into stderr 2017-06-23 22:21:36 -04:00
bf55624f75 Merge pull request #24 from tendermint/dateparse
common date parsing
2017-06-23 22:20:32 -04:00
7fbe6adf24 Merge branch 'develop' into dateparse 2017-06-23 22:16:37 -04:00
468982ffe4 fixes 2017-06-23 22:12:45 -04:00
2750343de5 Merge branch 'apply-megacheck' into unstable 2017-06-23 21:38:22 -04:00
3c0128a680 undo some megacheck suggestions 2017-06-23 21:36:47 -04:00
4522456d55 Merge remote-tracking branch 'origin/feature/496-deduplicate-tests-in-rpc-tests-and-rpc-client' into unstable 2017-06-23 21:24:09 -04:00
dcc538ff32 Merge remote-tracking branch 'origin/feature/506-tracing-logger' into unstable 2017-06-23 21:16:02 -04:00
7736585d46 ethermint hack: do not override genesis.json for ethermint application 2017-06-23 16:00:23 +00:00
f65977b019 ethermint dev moved to setup folder 2017-06-23 14:40:03 +00:00
95b7c9e09c Merge branch 'develop' 2017-06-23 09:11:30 +02:00
d31cfbaeaa Fixed up help text for "keys recover" 2017-06-23 09:10:59 +02:00
a22f7358cd Merge pull request #552 from tendermint/feature/551-default-to-tcp
httpDialer accepts no prefix or http:// as tcp://
2017-06-22 23:49:50 -04:00
d9a9dcf757 New ansible commands introduced 2017-06-23 02:23:18 +00:00
b715d3caf7 Added binary upgrade option 2017-06-23 00:34:42 +00:00
f38703a9f4 Added status command 2017-06-22 20:07:21 +00:00
08bb01cb55 added more cleanup for rmdb 2017-06-22 20:03:02 +00:00
aac85a14f0 httpDialer accepts no prefix or http:// as tcp:// 2017-06-22 20:56:57 +02:00
35525d5281 added relay only option 2017-06-22 17:44:59 +00:00
8896959014 added rigel's money and relay 2017-06-22 17:36:23 +00:00
2af729727f basecoin 0.6.0 package fixes 2017-06-22 15:06:19 +00:00
856e428057 Added branch option to build 2017-06-22 14:39:32 +00:00
19bd8dc3a6 Merge branch 'develop' 2017-06-21 19:36:11 +02:00
ad70b22226 Update to 0.2.1 2017-06-21 19:35:57 +02:00
8bdb5ceda4 Merge pull request #19 from tendermint/feature/cli-improvements
cli improvements
2017-06-21 19:00:25 +02:00
d665c9ef10 Code cleanup from review comments 2017-06-21 18:57:32 +02:00
a676b2aa10 add indexing proposal [ci skip] 2017-06-21 15:07:45 +04:00
cc364b14e2 changelog and PR changes 2017-06-20 17:18:55 -04:00
f3eaf9b870 quickfix 2017-06-20 16:52:22 -04:00
34bcb30f1c changelog 2017-06-20 16:40:32 -04:00
a944bdebfc Make sure prompt looks good in interactive mode 2017-06-20 20:46:00 +02:00
1ab9ab9494 Add delete and recover commands, and test them 2017-06-20 20:34:13 +02:00
e9537b2da6 Freshen up existing cmd files 2017-06-20 19:50:39 +02:00
f1e2f0a1f6 Changed digitalocean region to NYC2 -> NYC3 because NYC2 is not available 2017-06-20 16:56:51 +00:00
7d08ea4c09 Fixed all tests and binaries to compile 2017-06-20 18:50:53 +02:00
f66e92d5fb ansible app_options empty file added 2017-06-20 16:41:33 +00:00
53e19e3dfa Add codec to keys.Manager, recovery test passes 2017-06-20 18:35:16 +02:00
7108dedc21 Fix broken key manager tests 2017-06-20 18:19:13 +02:00
15609e1219 Updated Manager interface to return seed on create, fix server tests 2017-06-20 18:15:49 +02:00
56200e167a Use go-bindata to embed wordlist in a binary 2017-06-20 18:03:17 +02:00
878c8b3a87 Removed obsolete file 2017-06-20 17:51:25 +02:00
1e15c8f75b Extend wordcodec benchmarks 2017-06-20 17:13:10 +02:00
fba994d5ba config.toml fix in ansible playbooks 2017-06-20 15:12:58 +00:00
daab270ff7 First obvious speedup 2017-06-20 17:02:58 +02:00
1e978ba838 Import multiple language wordbanks, test them 2017-06-20 16:53:07 +02:00
2c0d52f4b5 Add typo detector test, fix panics 2017-06-20 16:52:04 +02:00
65c880e753 Test validation of word banks upon load 2017-06-20 16:32:33 +02:00
ad029d1293 Integrate ecc into word-byte codec 2017-06-20 16:10:15 +02:00
0b0e994cd1 Add crc64, constructors 2017-06-20 16:02:47 +02:00
ce6b08761e Improve crc32 2017-06-20 15:56:12 +02:00
55a25f0f62 Add first pass of ecc checksuming 2017-06-20 15:49:17 +02:00
065bd80846 packaging bugfix 2017-06-20 13:26:43 +00:00
59ac3973d3 package build modifications based on adrian's feedback 2017-06-20 13:24:54 +00:00
e20cdfcbae Cleanup wordcodec 2017-06-20 15:20:40 +02:00
e280cbdead Reorganized extrafiles to prepare for non-rpmbuild build. 2017-06-20 13:07:01 +00:00
2278f566bf Add beginning of wordcodec for bytes 2017-06-20 14:57:49 +02:00
2efdd069c6 workaround for tendermint bug #541 2017-06-20 00:24:05 +00:00
cb8e2e46d0 Ansible CentOs fix 2017-06-19 23:48:22 +00:00
2c1261c3b7 basecoin back on default port, CentOS repo signature change 2017-06-19 23:38:31 +00:00
1cea4dd43f Still fixing rpm 2017-06-19 20:27:10 +00:00
6398aa7b5a CentOS rpm fixes 2017-06-19 20:16:48 +00:00
a789923d73 ansible fix for CentOS repo 2017-06-19 20:01:59 +00:00
78ddcc08e1 removed python dependency from package, remove jq dependency from ansible 2017-06-19 19:04:34 +00:00
571cebc826 RPM build repodata fix 2017-06-19 17:15:38 +00:00
993c016b70 CentOS ansible install fixes 2017-06-19 16:50:11 +00:00
103e339dec CentOS ansible install fixes 2017-06-19 16:42:10 +00:00
3e4259e264 CentOS ansible install fixes 2017-06-19 16:41:02 +00:00
01aebbb6ee CentOS ansible install fixes 2017-06-19 16:37:26 +00:00
c30893d867 basecoin rpm package fix with show_validator 2017-06-19 16:16:39 +00:00
ea4f45828d Update circle ci for new cli tests 2017-06-19 17:52:45 +02:00
0c32d2722f #17 - better support passwords in tests, more cli tests 2017-06-19 17:49:16 +02:00
0edd1297a9 Got basic key test working 2017-06-19 17:07:12 +02:00
9a0629564a Added ubuntu patch 2017-06-19 14:38:15 +00:00
df934c1707 Add Code of Conduct 2017-06-19 15:46:15 +02:00
08a079ce16 ansible fixes 2017-06-19 01:21:24 +00:00
7239e41c4a Ansible refactor: uses package repositories. Added option to separately update service/tendermint genesis.json 2017-06-18 01:57:07 +00:00
0a3a08a3bc stderr PR revisions 2017-06-17 18:35:05 -04:00
c996b13dae Added Debian packaging and package repository for basecoin and ethermint 2017-06-17 08:26:56 +00:00
e3d43c8d45 Added Debian/Ubuntu package build 2017-06-16 21:31:25 +00:00
7ce4da1eee Merge pull request #26 from tendermint/develop
v0.2.2
2017-06-16 11:42:58 -04:00
bd9d0d1637 changelog and version 2017-06-16 11:40:14 -04:00
eaec0c8ea5 deduplicate tests in rpc/test and rpc/client (Refs #496) 2017-06-16 17:14:27 +04:00
3400cee845 Handle --two-words as TMTWO_WORDS env var 2017-06-15 20:16:22 +02:00
75fa12cabf repository signing fix 2017-06-14 19:57:38 +00:00
76f4a964e4 Wait added after interact in signing 2017-06-14 19:36:55 +00:00
a758baf37e More sign messages in Makefile 2017-06-14 19:34:03 +00:00
f29a97c4df Added install options to Makefile 2017-06-14 19:31:19 +00:00
72169b0bc1 rpmmacros was fixed to work with Jenkins 2017-06-14 18:45:37 +00:00
c8778ff790 Automated signing fixes 2017-06-14 18:40:11 +00:00
59a77e7bef Remove Printf 2017-06-14 17:01:15 +02:00
0ecb38c6da Return exit code on error, disable in tests 2017-06-14 16:51:33 +02:00
4f0f50c62d Merge pull request #535 from tendermint/bugfix/fix-invalid-logger-keys
Fix invalid logger keys
2017-06-14 13:20:10 +04:00
b4ece65726 standardize key for errors (should be "err") 2017-06-14 12:50:49 +04:00
562dd67e16 fix invalid keys (space is prohibited by logfmt encoder) 2017-06-14 12:50:01 +04:00
da646a8986 Merge pull request #534 from hxzqlh/master
logger key doesn't support blank space
2017-06-14 12:38:13 +04:00
b9b2782c3c logger key doesn't support space 2017-06-14 14:41:36 +08:00
e14cbf3cca Refactored files going into rpm package 2017-06-14 00:49:46 +00:00
aa3ec15dc4 Added option to publish new packages to S3 and create Yum repository 2017-06-13 17:01:05 +00:00
f1c087116f Merge pull request #518 from tendermint/feature/504-move-log-level-parsing-to-cli-package
move log level parsing to tmlibs/cli package (Refs #504)
2017-06-12 19:47:22 +04:00
9dcf130d67 update tmlibs (Refs #504) 2017-06-12 19:25:34 +04:00
ed7183936d move log level parsing to tmlibs/cli package (Refs #504) 2017-06-12 19:08:39 +04:00
1494c953e3 Added GPG signing and rpmmacros example 2017-06-12 05:39:50 +00:00
7fc429b72f terraform-digitalocean image option added; rpmbuild folder to build tendermint, basecoin and ethermint packages added 2017-06-11 04:51:35 +00:00
eaa3fa28ed Updated devops/README.md 2017-06-09 04:03:18 +00:00
92f10e9206 ansible: added option to provide accounts for genesis generation, terraform: added option to secure DigitalOcean servers, devops: added DNS name creation to tendermint terraform 2017-06-08 18:57:48 +00:00
c5644aad31 Merge pull request #21 from tendermint/feature/tracing-logger
[log] tracing logger
2017-06-07 13:26:27 -04:00
d184ca1432 Added Terraform-DigitalOcean security option, added ansible featrues. (ethermint, separated tendermint and basecoin) 2017-06-07 09:18:33 -04:00
c332a21fb2 Merge pull request #20 from tendermint/bugfix/16-flowrate
[flowrate] refactor clock functions (Refs #16)
2017-06-07 13:14:47 +03:00
94c0172618 doc update 2017-06-07 05:05:11 -04:00
33d0dd0bfc add stderr to tests 2017-06-06 18:36:28 -04:00
c76dca0456 cli stderr output for Execute 2017-06-06 16:13:44 -04:00
f913ed8134 date simplify 2017-06-06 16:08:57 -04:00
86d999a4e9 Merge pull request #2 from tendermint/refactor
Refactor branch to master
2017-06-06 11:51:22 -04:00
9577fb0ca4 Merge pull request #1 from tendermint/master
Merging from tendermint/tools
2017-06-06 11:40:10 -04:00
304be4ec2f date parse functionality 2017-06-06 04:00:36 -04:00
462243e31a Merge pull request #23 from tendermint/hexfuncs
IsHex and StripHex
2017-06-05 17:32:49 -04:00
925f2b3350 golint corrections 2017-06-05 16:22:01 -04:00
295f6c2cc6 IsHex and StripHex 2017-06-05 15:50:11 -04:00
44613da2b0 ansible: update tendermint and basecoin versions 2017-06-05 00:33:30 -04:00
1ce930157f minor readme fixes 2017-06-05 00:16:30 -04:00
b25e2b4eeb Merge pull request #33 from Greg-Szabo/master
Refactor and finish ansible playbooks, refactor and simplify terraform config
2017-06-05 00:12:30 -04:00
e5342f4054 docker: update for 0.10.0 [ci skip]" 2017-06-03 21:37:59 -04:00
92438185fc Clarified Ansible installation instructions and added slacknotification.py script. 2017-06-03 01:10:44 -04:00
2e173d4abf Merge branch 'master' into develop 2017-06-03 00:13:14 -04:00
ca632c9e90 Merge pull request #527 from tendermint/release-v0.10.0
Release v0.10.0
2017-06-02 23:59:46 -04:00
c94a92b30d update changelog and readme 2017-06-02 23:33:03 -04:00
84fea82043 dist: dont mkdir in container 2017-06-02 23:20:02 -04:00
d608e2b7ad bump version to 0.10.0 2017-06-02 23:19:30 -04:00
d19d8e7914 update readme and changelog 2017-06-02 23:18:10 -04:00
7f5f48b6b9 dist: dont mkdir in container 2017-06-02 12:44:00 -04:00
a24a0ff003 Merge tag 'v0.2.1' into develop
v0.2.1
2017-06-02 11:57:04 +03:00
6b619742ac Merge branch 'release/0.2.1' 2017-06-02 11:56:17 +03:00
4ef77c008c update changelog 2017-06-02 11:55:43 +03:00
8c0959604c Merge pull request #19 from tendermint/feature/log-level-parsing-from-tendermint
copy log level parsing from tendemint
2017-06-02 10:42:23 +03:00
b86da57571 scripts for building 2017-06-01 23:32:55 -04:00
ea8c171bc0 Release v0.5.0 2017-06-01 23:04:32 -04:00
ee74f9a3a8 Enhancements to README.md 2017-06-01 00:11:38 -04:00
07baf56cde Typo fixes and enhancements to README.md 2017-06-01 00:08:22 -04:00
ab5802a50f Fixed typo in README.md 2017-05-31 23:49:20 -04:00
457516b194 tendermint+basecoin configuration fixes 2017-05-31 23:46:02 -04:00
4e16ee6d78 Refactored Ansible, added tendermint and basecoin configuration and multiple playbooks 2017-05-31 19:58:55 -04:00
f427590622 [mintnet-kubernetes] fix tr command in basecoin readme 2017-06-01 01:15:49 +03:00
7587726f6e Merge pull request #32 from tendermint/feature/upgrade-mintnet-k8s-to-work-with-tm-0.10
[mintnet-kubernetes] upgrade to work with tm 0.10.0 and basecoin 0.5.0
2017-06-01 01:13:22 +03:00
f62aae63de add chain-id flag
without it basecoin fails with

```
ERROR: BroadcastTxCommit got non-zero exit code: BaseInvalidSignature. ; Error in CheckTx;in validateInputsAdvanced();Error (base) invalid signature;SignBytes: 010C636861696E2D745448346D690100000000000000000104636F696E000000000000000001010114A677E98456071E3240EF0A2E0B80FFE7D36515BF010101066D79636F696E000000000000000501010001793B7E33EF94132E16534CC9BA59F74944065FA917A98DB68ABA806D219A452901010114E2AFEA4A193E85A2DBB8668D4EA0DC0B1A6AD63A010101066D79636F696E0000000000000005
```
2017-06-01 01:12:22 +03:00
62e6344473 update basecoin version 2017-06-01 01:03:15 +03:00
fb457c2c9c DigitalOcean example and genesis file creation added 2017-05-30 17:39:50 -04:00
9c3eee0b00 Makefile: add megacheck & some additional fixes 2017-05-30 13:35:34 -04:00
bf5181d9ca address PR comments 2017-05-30 13:27:08 -04:00
e1f268b9d2 [mintnet-kubernetes] upgrade to work with tm 0.10.0 and basecoin 0.5.0 2017-05-30 18:23:26 +03:00
989cb6dd2e update Dockerfile [ci skip] 2017-05-30 16:33:48 +03:00
cf31f8d06f core: apply megacheck vet tool (unused, gosimple, staticcheck) 2017-05-29 23:11:40 -04:00
c7cd62b449 Merge branch 'master' into develop 2017-05-29 10:53:33 -04:00
2b5b017253 Merge pull request #516 from tendermint/release-v0.10.0-rc2
fixes to changelog, config, default logging
2017-05-29 08:58:20 -04:00
630c6ef7b5 bump version 2017-05-29 02:47:09 -04:00
ee88272216 enable unsafe rpc routes in tests via flag 2017-05-26 14:20:23 -04:00
bd7ec18c19 fix tests 2017-05-26 12:17:32 -04:00
42626d9e16 [types] overwrite pubkey/addr in LoadPrivValidator. closes #500 2017-05-25 13:40:13 -04:00
5f20b3323e don't do DeepEqual, compare ranges for durations and rates (Refs #16) 2017-05-25 13:06:42 +02:00
fc6611b2d9 [config] RPCConfig 2017-05-24 13:56:12 -04:00
4f27752468 [rpc] dont enable unsafe by default; limit /blockchain_info to 20 blocks 2017-05-24 11:31:31 -04:00
9bc1790320 tracing logger (Refs #506)
DEPENDS ON https://github.com/tendermint/tmlibs/pull/21
2017-05-24 14:28:25 +02:00
b36203bb02 [cli] add a test case to TestParseLogLevel where there is no module key 2017-05-23 23:31:29 +02:00
ddaa4d9b4c [log] tracing logger 2017-05-23 23:06:20 +02:00
de02488778 Enhance the tests to make it clearer how these levels work together 2017-05-23 23:04:33 +02:00
b5c57967b7 [flowrate] improve error formatting (Refs #16) 2017-05-23 15:24:00 +02:00
6b10432463 [flowrate] refactor clock functions (Refs #16)
this commit does not fix the original bug
2017-05-23 15:20:27 +02:00
5032b224bc copy log level parsing from tendemint
API change due to me not wanting `flags` package to depend on
tendermint's config package.

Refs https://github.com/tendermint/tendermint/issues/504
2017-05-23 00:43:12 +02:00
3fbe286e5a small fixes to changelog, config, default logging 2017-05-22 08:16:25 -04:00
aa22bd8464 Merge pull request #511 from spring1843/fix-typos
Fix commonly misspelled words
2017-05-21 13:24:35 +02:00
cf686d4f83 Fix commonly misspelled words 2017-05-20 21:43:00 -07:00
3d5abdc3bd Merge pull request #31 from tendermint/develop
Develop
2017-05-20 17:54:30 -04:00
76e18e7eba [tm-monitor] update glide 2017-05-20 17:53:42 -04:00
309812389a [tm-monitor] update to tendermint 0.10.0 2017-05-20 17:53:33 -04:00
1c1fbcd70f update tm-bench glide to develop 2017-05-20 17:37:30 -04:00
ec2e1d4460 update tm-monitor glide to develop 2017-05-20 17:37:30 -04:00
f53fb46302 add terraforce deployment method 2017-05-20 17:37:30 -04:00
267f134d44 Merge pull request #508 from tendermint/release-v0.10.0-rc1
Release v0.10.0 rc1
2017-05-18 13:45:17 +02:00
d4fa98de68 update version for rc1 2017-05-18 07:20:37 -04:00
790e04ed3e add link to list of breaking funcs/methods 2017-05-18 12:32:34 +02:00
772306cac8 update changelog and glide 2017-05-18 06:16:08 -04:00
864d1f80b3 Merge pull request #90 from tendermint/develop
v0.5.0
2017-05-18 11:39:39 +02:00
609c0dbc3e CHANGELOG update release date 2017-05-18 11:39:12 +02:00
7dff40942a Merge pull request #15 from tendermint/develop
v0.2.0
2017-05-18 11:37:23 +02:00
c61497b56e CHANGELOG: update release date 2017-05-18 11:35:32 +02:00
306795ae1d Merge pull request #15 from tendermint/develop
v0.2.0
2017-05-18 11:28:34 +02:00
2733f5a738 CHANGELOG: update release date 2017-05-18 11:27:26 +02:00
30a19fc899 [consensus] Info->Debug for is a validator log msg 2017-05-18 11:26:15 +02:00
8af1c70a8b Renamed --debug to --trace, used for light-client and basecoin 2017-05-17 12:03:26 +02:00
6a30a902c9 [types] more []byte->data.Bytes and some %X->%v 2017-05-17 01:08:41 +02:00
883b71ca70 update CHANGELOG 2017-05-17 00:27:03 +02:00
11b5d11e9e Merge pull request #505 from tendermint/dont-hash-accum
[types] dont hash validator.Accum
2017-05-17 00:19:28 +02:00
6d83c60c40 [types] dont hash validator.Accum 2017-05-17 00:16:38 +02:00
cc2b430e68 update glide and changelog 2017-05-17 00:12:56 +02:00
9d7d8075d1 Merge remote-tracking branch 'origin/update-for-new-abci-api' into develop 2017-05-16 23:58:48 +02:00
fe87623674 Merge pull request #501 from tendermint/feature/493-per-module-log-levels
Feature/493 per module log levels
2017-05-16 23:33:21 +02:00
67f558cff0 Merge pull request #17 from tendermint/feature/log-levels-per-key-in-filter
Allow custom levels for the keyvals in filter
2017-05-16 23:29:02 +02:00
91dc87e7c4 update for a new ABCI API 2017-05-16 19:06:35 +02:00
438b16f1f8 Merge pull request #16 from tendermint/data-codegen
Use codegen to create wrappers for interfaces
2017-05-16 17:10:26 +02:00
db5cb8d92c Change codegen name holder->wrapper 2017-05-16 17:02:48 +02:00
bee63ce4ff Cleaned up build process, moved codegen to separate package in go-wire 2017-05-16 17:01:30 +02:00
79c580492e add make codegen for gen 2017-05-16 17:01:15 +02:00
746a2e286d Codegen wrappers for privkey and signature as well 2017-05-16 17:01:15 +02:00
ee200d998f Fix unwrap for proper json format 2017-05-16 17:01:15 +02:00
f16f711992 First code from codegen... wrong names 2017-05-16 17:01:03 +02:00
c38a6f55b3 Prepare for codegen 2017-05-16 17:01:03 +02:00
fb0df75de0 changes per Frey comments (Refs #493) 2017-05-16 15:16:50 +02:00
e1792c1ea5 fix tx string format take 2 2017-05-16 14:12:48 +02:00
d5113377e2 fix tx string format 2017-05-16 14:01:52 +02:00
eb9ca23250 log whether node is a validator in each round 2017-05-16 14:01:52 +02:00
05a8204508 per module log levels (Refs #493) 2017-05-16 13:57:28 +02:00
d0cae7b6ed [log] change helper func 2017-05-16 12:49:23 +02:00
761b1553aa [log] allow filtering with fields 2017-05-16 12:48:01 +02:00
e041b2eee6 Merge pull request #502 from tendermint/adrianbrink-patch-1
Update README.md
2017-05-16 10:13:31 +02:00
0a4ab7e38f Update README.md 2017-05-16 09:50:52 +02:00
c4ad0f76e6 Merge pull request #494 from tendermint/json-naming
Clean up json output
2017-05-15 19:03:25 +02:00
0f1edcd57d Merge pull request #497 from tendermint/feature/color-code-different-consensus-instances
Color code different consensus instances in consensus tests
2017-05-15 19:02:02 +02:00
5dabeffb35 fixes from review 2017-05-15 12:59:44 -04:00
d82c7edf3a update changelog and bump version 2017-05-15 12:52:33 -04:00
d07b2352ad NewXXXServer doesnt run Start or return error 2017-05-15 12:51:24 -04:00
21fff49f2c Merge branch 'feature/adrian-extendABCIcli' into develop 2017-05-15 12:30:02 -04:00
894f3fca73 cmd: query params are flags 2017-05-15 12:28:37 -04:00
eda4f2dddc NewXXXClient doesnt run Start or return error 2017-05-15 11:29:34 -04:00
fadfcfdcb0 Merge pull request #82 from tendermint/feature/adrian-#79
Update grpc_server.go - 2
2017-05-15 15:52:24 +02:00
20159f6081 Merge pull request #87 from tendermint/ResultsLike
Abci result error type comparison
2017-05-15 15:51:29 +02:00
05dc4d12dd result.IsSameCode 2017-05-15 09:50:49 -04:00
a42b10e0fe update glide 2017-05-15 09:41:07 -04:00
d901fba662 add changelog and version 2017-05-15 09:40:20 -04:00
812d9f9b84 add changelog 2017-05-15 09:09:42 -04:00
da68014a50 Merge pull request #10 from tendermint/bugfix/rotating-fails-on-windows
Close file before renaming it
2017-05-15 14:47:57 +02:00
74a7f8c92b [autofile] close file before renaming it
this might fix our windows bug https://github.com/tendermint/tendermint/issues/444

0980f8e197
2017-05-15 10:47:16 +02:00
118d565534 Merge pull request #472 from tendermint/string_reprs
Add Tx String representation. Got the ok from Anton.
2017-05-15 09:49:40 +02:00
1dfb95f719 [consensus] color code different consensus instances in consensus tests
(Refs #492)
2017-05-15 09:35:29 +02:00
4fdeaa70af Merge pull request #14 from tendermint/feature/allow-for-custom-color-functions
[log] allow for custom color funcs
2017-05-14 23:24:03 +02:00
33f807d9a1 Merge pull request #489 from tendermint/feature/adrian-#469
Use ld flags to set git hash instead of "revision_file"
2017-05-14 21:52:29 +02:00
926fb83e33 Re-added comment 2017-05-14 19:10:58 +02:00
2b324b7eb9 RPC returns pretty formated json 2017-05-14 19:06:34 +02:00
157ec8af2d Add json tags to validator set 2017-05-14 19:06:33 +02:00
a5fcc94a3b [log] allow for custom color funcs 2017-05-14 12:03:45 +02:00
f14f167297 Merge pull request #491 from tendermint/feature/new-logging
New logging
2017-05-14 00:45:21 +02:00
4fe67652ff move SetLogger down 2017-05-14 00:24:58 +02:00
b55e695d3d Remove debug statement 2017-05-13 21:08:34 +02:00
4674bf96b0 Extend the query command 2017-05-13 18:37:00 +02:00
c5bccc5474 set missing logger on switch
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x882cec]

goroutine 328 [running]:
github.com/tendermint/tendermint/p2p.(*Switch).DialPeerWithAddress(0xc42000a500, 0xc4202088d0, 0xc420403500, 0x0, 0x0, 0x0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch.go:324 +0x2fc
github.com/tendermint/tendermint/p2p.(*PEXReactor).ensurePeers.func1(0xc4201663f0, 0xc4202088d0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/pex_reactor.go:280 +0x3e
created by github.com/tendermint/tendermint/p2p.(*PEXReactor).ensurePeers
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/pex_reactor.go:284 +0x5d4
```
2017-05-13 17:05:44 +02:00
f8fdbe3dbc changes as per Bucky's review 2017-05-13 16:22:51 +02:00
8f5a175ff4 Merge pull request #13 from tendermint/feature/filter-returns-error
[log] NewFilterByLevel returns an error
2017-05-13 16:01:02 +02:00
dd3e433d32 [log] NewFilterByLevel returns an error 2017-05-13 15:54:11 +02:00
c9cd8de9c6 set logger 2017-05-13 10:25:00 +02:00
3e1343dc6b has as a base16 string 2017-05-13 10:24:59 +02:00
bc4e6566e7 [p2p] refactor upnp to use new logger 2017-05-13 10:24:59 +02:00
16509ac3db p2p: fix race by peer.Start() before peers.Add() 2017-05-13 10:24:59 +02:00
f803544195 new logging 2017-05-13 10:24:58 +02:00
b662bc7d34 Merge pull request #81 from tendermint/feature/adrian-#68
Comment out MessageType - 2
2017-05-13 10:02:07 +02:00
ea2d83e513 Clean up comments 2017-05-13 10:01:16 +02:00
9e1852c08d Merge pull request #12 from tendermint/feature/helper-log-func
[log] add NewFilterByLevel helper func
2017-05-12 23:12:36 +02:00
3007668274 [log] add NewFilterByLevel helper func 2017-05-12 22:59:31 +02:00
dd592a21b9 Merge pull request #11 from tendermint/bugfix/multiple-module-keys
Squash module keyvals if multiple keyvals were provided
2017-05-12 22:08:36 +02:00
8eb07800b3 Merge pull request #473 from tendermint/logging-arch-proposal
Logging architecture proposal
2017-05-12 20:40:28 +02:00
538b325150 update arch proposal [ci skip] [circleci skip] 2017-05-12 20:32:57 +02:00
f202d02d0d [log] add separator 2017-05-12 17:39:00 +02:00
e43bcf3f26 Move package comment 2017-05-09 12:40:49 +02:00
840e658ec0 Update grpc_server.go 2017-05-09 12:40:49 +02:00
577ec5452f Fix indentation 2017-05-09 12:33:38 +02:00
322b4e54de Remove unused enum MessageTypes 2017-05-09 12:23:37 +02:00
a3d4e5797d Comment out MessageType
As it is an unused enum, leaving it uncommented causes dead Protocol
Buffers code to be generated.
2017-05-09 12:23:37 +02:00
cd3c3c3bad Modify makefile 2017-05-09 11:39:46 +02:00
8c91014cd8 Add git commit hash to version. 2017-05-09 11:37:59 +02:00
b2a116863c squash module key if multiple keyvals were provided
last keyvalue wins
2017-05-08 17:30:21 +04:00
25a5bc2697 Merge pull request #9 from tendermint/bugfix/filter-with-func
[log] proper impl of With for filter
2017-05-08 14:42:21 +04:00
d07e164796 Merge pull request #13 from tendermint/bugfix/6-tm-monitor-does-not-reconnect-to-a-node
tm monitor does not reconnect to a node
2017-05-06 22:38:10 +04:00
6312eb91be Change "make build" to set GitCommit variable
As described above.
2017-05-06 12:37:48 +02:00
bc6baf6774 [log] proper impl of With for filter 2017-05-06 11:21:07 +04:00
d3e3eca3fe update glide 2017-05-05 14:57:33 -04:00
bd2b87dd3d Merge pull request #78 from tendermint/feature/new-logging
New logging
2017-05-05 14:52:49 -04:00
d72136da0d Merge pull request #7 from tendermint/log
Log
2017-05-05 14:02:38 -04:00
240215f2aa return back all in Makefile 2017-05-05 21:52:01 +04:00
f4be75cb1e remove warn mentions 2017-05-05 21:48:03 +04:00
2bf6ebf379 filter 2017-05-05 21:48:03 +04:00
ea01d003d1 changes per @ethanfrey comments 2017-05-05 21:48:03 +04:00
b2bd039923 correct impl of WithLevel 2017-05-05 21:48:03 +04:00
6ff7b4395d update glide.yaml and glide.lock files 2017-05-05 21:48:02 +04:00
d2ae7e164a Make testify a testImport for consistency 2017-05-05 19:46:32 +02:00
3420b389e9 Add testify version for consistency 2017-05-05 19:45:02 +02:00
520561e94a add testing logger 2017-05-05 21:43:07 +04:00
66c9401c07 log: Tm -> TM 2017-05-05 21:43:07 +04:00
ed76afd409 Logger interface and tmLogger impl based on go-kit 2017-05-05 21:43:07 +04:00
e71bbb2509 Update to make full use of new tmlibs/cli helpers 2017-05-05 19:25:44 +02:00
627a686f90 Merge pull request #487 from tendermint/fixp2ptests
One silly tests passes on osx, fails on linux...
2017-05-05 12:53:39 -04:00
57527f9f67 One silly tests passes on osx, fails on linux... comment out so i can develop 2017-05-05 18:48:39 +02:00
14d0d395f2 Merge pull request #484 from tendermint/config
Config
2017-05-05 12:46:39 -04:00
edd7263f06 fixes from review 2017-05-05 12:25:53 -04:00
706b9fbd67 Merge pull request #8 from tendermint/cli
Cli
2017-05-05 11:45:54 -04:00
2a9e89b34f Add basic tests on config, mainly to raise test coverage 2017-05-05 15:50:23 +02:00
dd1f5a2268 Test config parsing in root command 2017-05-05 15:30:39 +02:00
2f02ed18e9 One more helper function for cli tests... 2017-05-05 14:58:53 +02:00
d0132b0fff Moved helper functions into non-test code for reuse elsewhere 2017-05-05 14:46:04 +02:00
50a9967c79 change tmlibs package version to "log" 2017-05-05 16:32:23 +04:00
8a0466d81d config: pex_reactor -> pex 2017-05-05 02:04:24 -04:00
fb9d3842e4 test: p2p.seeds and p2p.pex 2017-05-05 01:28:43 -04:00
8c3823545d update glide 2017-05-05 00:51:03 -04:00
3585a542a0 cli: viper.Set(HomeFlag, rootDir) 2017-05-05 00:48:35 -04:00
75989342b0 fixes from rebase 2017-05-04 23:03:42 -04:00
46151720f8 fix tests 2017-05-04 22:46:41 -04:00
9109b20852 SetRoot 2017-05-04 22:46:41 -04:00
6b059e0063 Accept relative paths in all configs, TODO: must SetRoot 2017-05-04 22:46:40 -04:00
92dee7ea3c Commands compile (mostly) with new config reading 2017-05-04 22:46:40 -04:00
604bf03f3a Pulled out all config structs (except p2p.PeerConfig) into config package 2017-05-04 22:46:40 -04:00
f217f2b2c5 cleanup run_node flags 2017-05-04 22:46:13 -04:00
92bafa7ecd consensus: fix tests 2017-05-04 22:46:13 -04:00
6afee8f117 rpc: fix tests 2017-05-04 22:45:13 -04:00
1ef7c1d25b cmd: fixes for new config 2017-05-04 22:43:55 -04:00
7db7bbe464 node: ConfigFromViper 2017-05-04 22:43:55 -04:00
57151d6043 p2p: use cmn instead of . 2017-05-04 22:43:55 -04:00
5d660e073a remove viper from p2p 2017-05-04 22:43:55 -04:00
4982cb4d1f fix tests for state and mempool 2017-05-04 22:43:55 -04:00
24ce90fc72 fix up config defaults 2017-05-04 22:43:55 -04:00
75b6c5215f fewer structs. remove viper from consensus 2017-05-04 22:43:55 -04:00
d8fb226ec4 new config 2017-05-04 22:43:55 -04:00
95c74b2ccd remove some more viper 2017-05-04 22:43:55 -04:00
f0e7f0acf8 remove viper from rpc except test 2017-05-04 22:43:55 -04:00
1fcc9dc654 remove viper from proxy 2017-05-04 22:39:22 -04:00
7c0f51e24b remove viper from mempool 2017-05-04 22:39:22 -04:00
29c0e6e4f4 remove viper from blockchain and state 2017-05-04 22:39:21 -04:00
56a1a2d917 remove logrotate.config 2017-05-04 22:39:03 -04:00
ee45dbdc8b Test how unmarshall plays with flags/env/config/default struct 2017-05-04 19:44:53 -04:00
8efeeb5f38 Add --debug flag to return full stack trace on error 2017-05-04 19:44:53 -04:00
ef3b9610a1 Fixed up the --home flag, ebuchman check this out 2017-05-04 19:44:53 -04:00
d05b8131a3 Updated glide with cobra/viper, fixed Makefile typo 2017-05-04 19:44:48 -04:00
5637a78854 Test setting config file as root 2017-05-04 19:43:33 -04:00
62427adbec First basic test case on setup functionality 2017-05-04 19:43:33 -04:00
435fd0ece7 Add clarifying comments as requested by Rigel 2017-05-04 19:43:33 -04:00
7becd35126 cli: more descriptive naming 2017-05-04 19:43:33 -04:00
a95a60cb0b cli: support --root and --home 2017-05-04 19:43:33 -04:00
317e91748f remove all .sock files! 2017-05-04 23:24:58 +04:00
1dc3629b1a update log interface 2017-05-04 23:17:16 +04:00
d2a4b16b28 introduce testing logger 2017-05-04 16:50:00 +04:00
6baaad9975 update glide 2017-05-04 16:50:00 +04:00
ce124c4aeb modify test scripts to use relative paths 2017-05-04 16:50:00 +04:00
9a6d190282 remove stdlog 2017-05-04 16:49:59 +04:00
986bdd00a5 new logging 2017-05-04 16:49:59 +04:00
4871e64b03 update docker README [ci skip] [circleci skip] 2017-05-04 13:36:27 +04:00
809e0e8c59 update Dockerfile [ci skip] [circleci skip] 2017-05-04 13:32:46 +04:00
4305d054d6 Merge pull request #465 from tendermint/bytes
RPC Serialization Overhaul
2017-05-03 14:37:21 -04:00
9860c8fee1 rpc: cleanup some comments [ci skip] 2017-05-03 14:33:07 -04:00
7ebf011fcd Fixed rpctypes.Request creation to new format 2017-05-03 16:58:21 +02:00
4a1b714ca4 All tests pass without go-wire json ptr madness 2017-05-03 16:45:00 +02:00
4c1d41c12e Test json rpc parsing 2017-05-03 16:26:18 +02:00
6ba799132c json.RawMessage in RPCRequest to defer parsing 2017-05-03 16:13:58 +02:00
e5d8fcd198 Merge pull request #474 from faddat/patch-4
Fix Mintnet Kubernetes link
2017-05-03 13:56:45 +02:00
f31d6ffb8c Fix Mintnet kubernetes url 2017-05-03 13:55:42 +02:00
524ba917a3 Use new PrepareMainCmd from tmlibs/cli 2017-05-02 17:18:08 +02:00
d4ab9679d7 Fix up error in copyEnv 2017-05-02 17:16:22 +02:00
b92bd8f6a8 Separate out PrepareBaseCmd, try to set env vars 2017-05-02 17:04:46 +02:00
2608b95b4b Merge pull request #463 from tendermint/feature/adrian-initchain
InitChain message gets send at genesis.
2017-05-01 12:00:29 -04:00
f7c872981f Merge pull request #2 from tendermint/make_and_circle
Makefile and circle.yml
2017-05-01 11:33:24 -04:00
af637abf12 Makefile and circle.yml 2017-05-01 11:30:24 -04:00
2bf8c40cff Add extra memory to virtual machine and add coverage report to gitignore. 2017-05-01 17:29:44 +02:00
b5ab74fd38 Update README.md
updated mintnet to mintnet-kubernetes
2017-05-01 15:50:11 +07:00
556fbf0c4c logging arch proposal [ci skip] [circleci skip] 2017-05-01 11:58:43 +04:00
4c7a2be06a Add Tx String representation 2017-04-30 16:06:49 -07:00
6dbcfb32d2 comment on copied wire file 2017-04-28 23:22:54 -04:00
efeadcc0f4 some cleanup from review 2017-04-28 23:18:38 -04:00
297772e009 Merge pull request #467 from tendermint/nowire
Nowire
2017-04-28 22:58:39 -04:00
aa9e673ed7 test: jq .result[1] -> jq .result 2017-04-28 22:31:30 -04:00
4e781961e9 remove TMResult. ::drinks champagne:: 2017-04-28 22:26:23 -04:00
884060eb9b rpc/lib: no Result wrapper 2017-04-28 22:04:14 -04:00
07e59e63f9 TMEventDataInner 2017-04-28 17:57:06 -04:00
ac28b12fa8 add readReflectJSON from wire 2017-04-28 17:56:44 -04:00
257f45b768 ebuchman: added some demos on how to parse unknown types 2017-04-28 22:01:46 +02:00
acfbea6d49 rpc: decode args without wire 2017-04-28 14:36:38 -04:00
6c60c07f16 BROKEN: attempt to replace go-wire.JSON with json.Unmarshall in rpc 2017-04-28 16:24:06 +02:00
bff8402fe8 Fix json for TMResult to not include "TMResultInner" 2017-04-28 15:26:06 +02:00
f6f1f1992c Prepare rpc responses for go-data compatibility, still use go-wire 2017-04-28 14:46:04 +02:00
194f345470 Use non-standard port so tests don't die when I am running basecoin 2017-04-28 14:45:34 +02:00
2bf7e9c968 update glide 2017-04-27 19:58:12 -04:00
c930f43cbe rpc: fix tests 2017-04-27 19:56:14 -04:00
8d8e35ae53 types: methods convert pb types to use data.Bytes 2017-04-27 19:53:22 -04:00
a518d08839 rpc: response types use Result instead of pb Response 2017-04-27 19:34:25 -04:00
8339dc3b1a types: Result and Validator use data.Bytes 2017-04-27 19:21:26 -04:00
cdf650fba9 rpc: repsonse types use data.Bytes 2017-04-27 19:06:07 -04:00
bdb34f9f4e types: []byte -> data.Bytes 2017-04-27 19:01:18 -04:00
0be3480729 consensus: comment about test_data [ci skip] 2017-04-27 18:34:57 -04:00
495283e2d4 fix replay tests and update test wals for InitChain 2017-04-27 18:30:43 -04:00
197a2b270f Consolidate keys.Manager interface 2017-04-27 20:59:48 +02:00
842609ddcb Send InitChain message from ABCI to Core on Genesis
InitChain is send from the ABCI to the Core node when the ABCI
app has no blocks stored.
2017-04-27 20:22:11 +02:00
1310c72647 version bump and changelog 2017-04-26 20:06:45 -04:00
cc6dde96c1 rpc -> rpc/lib and rpc/tendermint -> rpc 2017-04-26 19:57:33 -04:00
cc7b2d26e5 Merge branch 'master' into develop 2017-04-26 19:21:06 -04:00
1781a52147 Merge pull request #459 from tendermint/http_codes
rpc: use HTTP error codes
2017-04-26 19:05:43 -04:00
0ba449c8ba Merge pull request #455 from tendermint/unstable
Unstable
2017-04-26 19:04:52 -04:00
f6e28c4975 Merge pull request #461 from tendermint/release-v0.9.2
Release v0.9.2
2017-04-26 11:07:00 -04:00
6bcd4242f1 CHANGELOG and version bump 2017-04-26 00:17:53 -04:00
9851265d4f rpc: use HTTP error codes 2017-04-25 23:09:47 -04:00
098646c5ff test: test_libs all use Makefile 2017-04-25 18:35:22 -04:00
0e5cd6dc2f Merge pull request #442 from tendermint/viper
go-config -> viper, commands: Run -> RunE
2017-04-25 17:59:17 -04:00
2fcb2b9232 remove unsafe_set_config 2017-04-25 17:58:26 -04:00
fcf78a5da7 cleanup go-config/viper and some unnamed imports 2017-04-25 14:54:56 -04:00
72c4be35e8 tiny fix 2017-04-25 13:44:13 -04:00
5d0c2a1414 commands: Run -> RunE 2017-04-25 13:44:13 -04:00
7bb638e3b8 fix test_integrations error 2017-04-25 13:44:13 -04:00
7448753257 fixing tests 2017-04-25 13:43:57 -04:00
6e662337ff dont export resetPrivValidator 2017-04-25 13:43:57 -04:00
270b68a893 glide lock updates 2017-04-25 13:43:22 -04:00
cefb2bede0 adding viper
int

int
2017-04-25 13:42:22 -04:00
47852122d0 changed reset commands 2017-04-25 13:34:46 -04:00
00055fa2e8 Merge pull request #456 from tendermint/repo-merge
Repo merge
2017-04-25 13:13:32 -04:00
bd93f76950 Improve rpc to properly format any alias for []byte in URIClient 2017-04-25 17:17:51 +02:00
803b1f2115 Improve client test cases 2017-04-25 16:49:01 +02:00
3cdd2daf08 fix tests 2017-04-21 18:44:37 -04:00
c709d3cc85 update merkleeyes 2017-04-21 18:39:18 -04:00
4e0afc55e6 glide update 2017-04-21 18:35:48 -04:00
be61e273ce update glide 2017-04-21 18:32:46 -04:00
078e617d1c go-merkle -> merkleeyes/iavl and tmlibs/merkle 2017-04-21 18:28:49 -04:00
dd303dc119 go-data -> go-wire/data 2017-04-21 18:25:30 -04:00
28d042fdae use tmlibs 2017-04-21 18:25:13 -04:00
03012a0532 update glide 2017-04-21 18:24:18 -04:00
e160318eef glide update 2017-04-21 18:21:59 -04:00
56c60fba23 go-p2p -> tendermint/p2p 2017-04-21 18:19:41 -04:00
9e82d132ce go-rpc -> tendermint/rpc 2017-04-21 18:19:29 -04:00
a70c95b79e tmlibs/common/test -> tmlibs/test 2017-04-21 18:18:22 -04:00
d5b524e309 go-merkle -> merkleeyes/iavl and tmlibs/merkle 2017-04-21 18:16:05 -04:00
e6fe6b5b76 go-data -> go-wire/data 2017-04-21 18:13:25 -04:00
d1926bcad1 use tmlibs 2017-04-21 18:12:54 -04:00
fa451fc55c tendermint/rpc -> tendermint/rpc/tendermint 2017-04-21 18:10:41 -04:00
5da9b3a803 postmerge 2017-04-21 18:09:47 -04:00
93c58d0b24 remove glide and license from rpc and p2p 2017-04-21 18:08:25 -04:00
23a6a6f8fc move into p2p package 2017-04-21 18:07:52 -04:00
63f546497b Merge remote-tracking branch 'p2p/develop' into repo-merge 2017-04-21 18:06:57 -04:00
c55d83281a move into rpc package 2017-04-21 18:05:39 -04:00
35f1db09a9 Merge remote-tracking branch 'rpc/develop' into repo-merge 2017-04-21 18:04:42 -04:00
34965f610d crypto Wrap/Unwrap 2017-04-21 18:02:25 -04:00
eaeb547938 use tmlibs 2017-04-21 17:53:22 -04:00
15d5b2ac49 use tmlibs 2017-04-21 17:51:11 -04:00
992b11c450 premerge2: rpc -> rpc/tendermint 2017-04-21 17:39:56 -04:00
0017fb7ffe premerge 2017-04-21 17:38:40 -04:00
3240ce21b8 update glide 2017-04-21 17:28:13 -04:00
207798b09a Merge pull request #454 from tendermint/reset_fix
reset fix
2017-04-21 17:27:29 -04:00
543eea4f4e update deps to unstable 2017-04-21 16:56:10 -04:00
6d223d5526 Update to latest go-crypto 2017-04-21 16:55:58 -04:00
3d9ca32e95 Update all config for p2p integration tests 2017-04-21 16:55:38 -04:00
90abc61c56 Improve go-data json support in rpc 2017-04-21 16:55:37 -04:00
6a0217688f Ensure private validator addresses are hex 2017-04-21 16:51:17 -04:00
b798169c6e Update go-crypto to read/write properly with go-wire in wal files 2017-04-21 16:51:17 -04:00
7e56aad51a [consensus/test_data/build.sh] install tendermint if absent 2017-04-21 16:51:17 -04:00
e325ffc681 Lots of updates to use new go-crypto / json style 2017-04-21 16:51:17 -04:00
516e78ea54 Fix types to use updated go-crypto 2017-04-21 16:50:27 -04:00
c21cec002c reset fix 2017-04-21 16:39:50 -04:00
df250b6941 docs: go-events -> tmlibs/events 2017-04-21 16:25:23 -04:00
9b95da8fa4 go-data -> go-wire/data 2017-04-21 16:10:06 -04:00
1ea866fd69 glide 2017-04-21 16:05:03 -04:00
56d36c8f25 merkle: go-common -> tmlibs 2017-04-21 16:04:58 -04:00
fd296811df simple merkle tree 2017-04-21 15:33:25 -04:00
6c49312aa2 Merge pull request #11 from tendermint/unstable
Unstable
2017-04-21 14:43:55 -04:00
e3f9b8731b circle.yml 2017-04-21 14:41:14 -04:00
f89279cf11 fix CHANGELOG 2017-04-21 13:39:02 -04:00
2c8df0ee6b Merge pull request #17 from tendermint/develop
v0.7.0
2017-04-21 13:08:14 -04:00
e8f33a4784 Merge pull request #25 from tendermint/develop
v0.5.0
2017-04-21 13:06:44 -04:00
58ccefa407 update changelog 2017-04-21 13:06:26 -04:00
559613689d Merge pull request #18 from tendermint/bugfix/fix-backward-compatibility-for-ws
fix backward compatibility for WS
2017-04-21 12:20:34 -04:00
a01cff9ce6 jsonParamsToArgsRPC func 2017-04-21 12:18:21 -04:00
d6fd0c4ca0 fix backward compatibility for WS 2017-04-21 18:30:22 +03:00
17124989a9 Merge pull request #10 from tendermint/pex-reactor-fixes-#9
Pex reactor fixes #9
2017-04-20 17:32:38 -04:00
75bad132fc msgCountByPeer is a CMap 2017-04-20 17:29:43 -04:00
391c738959 update comment about outbound peers and addrbook 2017-04-20 12:21:45 -04:00
8655e2456e it is non-deterministic (could fail sometimes) 2017-04-20 13:37:06 +04:00
17ec70fc09 revert 2710873 2017-04-20 13:36:40 +04:00
9ce71013df revert e448199 2017-04-20 13:36:40 +04:00
5ab8ca0868 fix race 2017-04-20 13:36:40 +04:00
4c0d1d3ad2 return wg to addrbook 2017-04-20 13:36:39 +04:00
0277e52bd5 fix merge 2017-04-20 13:36:39 +04:00
cf18bf2966 add public RemoveAddress API
after discussion with @ebuchman (https://github.com/tendermint/go-p2p/pull/10#discussion_r96471729)
2017-04-20 13:36:39 +04:00
324293f4cb note on preventing abuse [ci skip] 2017-04-20 13:36:39 +04:00
52d9cf080e make GoLint happy 2017-04-20 13:36:39 +04:00
590efc1040 call saveToFile OnStop
This is better than waiting because while we wait, anything could happen
(crash, timeout of the code who's using addrbook, ...). If we save
immediately, we have much greater chances of success.
2017-04-20 13:36:38 +04:00
5eeaffd38e do not create file, just temp dir 2017-04-20 13:36:38 +04:00
07e7b98c70 improve ensurePeers routine
optimizations:

- if we move peer to the old bucket as soon as connected and pick only
  from new group, we can skip alreadyConnected check
2017-04-20 13:36:38 +04:00
873d34157d prevent abuse from peers 2017-04-20 13:36:38 +04:00
47df1fb7d4 test PEXReactor#Receive 2017-04-20 13:36:38 +04:00
1a59b6a3b4 replace repeate timer with simple ticker
no need for repeate timer here (no need for goroutine safety)
2017-04-20 13:36:38 +04:00
0109f1e524 test ensurePeers goroutine 2017-04-20 13:36:37 +04:00
37d5a2cf3e implement RemovePeer for PEXReactor 2017-04-20 13:36:37 +04:00
3af7c67757 add Dockerfile 2017-04-20 13:36:37 +04:00
26f661a5dd prefer short names 2017-04-20 13:36:37 +04:00
057cfb30f1 remove unused error 2017-04-20 13:36:37 +04:00
91bd7efb7b Fixed all imports in keys 2017-04-19 17:25:53 +02:00
0bfae964e1 Moved keys cmd to top level 2017-04-19 17:07:12 +02:00
9016390a6e Moved crypto code to top level again 2017-04-19 16:55:15 +02:00
68948a5f13 Import go-keys as subdir 2017-04-19 16:53:28 +02:00
17ed6d178d move go-crypto files pre-keys merge 2017-04-19 16:51:29 +02:00
1a42f946dc version bump 2017-04-19 00:05:18 -04:00
e05052b079 update glide 2017-04-19 00:01:55 -04:00
7d5b62b61f CHANGELOG and version bump 2017-04-18 23:58:24 -04:00
56e13d87f4 Merge pull request #71 from tendermint/develop
Develop
2017-04-18 23:41:35 -04:00
1002a8c5d0 bump version 2017-04-18 23:31:30 -04:00
1aa663d907 update glide 2017-04-18 23:31:12 -04:00
e6b7e66bbe Merge pull request #23 from tendermint/more-tests
More tests
2017-04-18 20:26:54 -04:00
8bb25ec5ed update paths 2017-04-18 18:17:02 -04:00
2f8551d3b6 go-common -> tmlibs 2017-04-18 17:56:05 -04:00
900be74e8f update import paths 2017-04-18 16:33:51 -04:00
6f49ba4c3e merge go-process 2017-04-18 16:33:44 -04:00
5b4dcddb59 Merge remote-tracking branch 'process/master' into unstable 2017-04-18 16:33:44 -04:00
024fcb4fdb merge go-logger 2017-04-18 16:33:43 -04:00
e8ab6b7496 Merge remote-tracking branch 'logger/master' into unstable 2017-04-18 16:33:43 -04:00
44274eeb58 merge go-flowrate 2017-04-18 16:33:42 -04:00
125e25a929 Merge remote-tracking branch 'flowrate/master' into unstable 2017-04-18 16:33:42 -04:00
fe92e62a19 merge go-events 2017-04-18 16:33:40 -04:00
3e8b7df789 Merge remote-tracking branch 'events/master' into unstable 2017-04-18 16:33:39 -04:00
fdbb10827d merge go-db 2017-04-18 16:33:35 -04:00
d234a164f7 Merge remote-tracking branch 'db/master' into unstable 2017-04-18 16:33:32 -04:00
acbd7caaf8 merge go-clist 2017-04-18 16:33:27 -04:00
7ed7422e7f Merge remote-tracking branch 'clist/master' into unstable 2017-04-18 16:33:27 -04:00
a893bb119b merge go-autofile 2017-04-18 16:33:26 -04:00
e01445ea94 Merge remote-tracking branch 'autofile/master' into unstable 2017-04-18 16:33:26 -04:00
356657a37b move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
5aecd32554 merge.sh file for the repo merge 2017-04-18 16:33:07 -04:00
9643f60bc2 Merge pull request #5 from tendermint/iterate-data
Exposed an iterator to access all of the underlying key/value pairs for all databases.
2017-04-18 15:47:42 -04:00
f9e3db0373 Merge pull request #11 from tendermint/develop
Develop
2017-04-18 15:39:03 -04:00
2ac69176e1 add a comment for MConnection#CanSend
also add a note to TestMConnectionSend
2017-04-18 12:11:48 +04:00
f285114579 add Erlang implementation to readme [ci skip] [circleci skip] 2017-04-15 11:00:47 +04:00
35a2a58ac0 update minikube version 2017-04-14 18:38:59 +04:00
fbedb426ce tests for NetAddress 2017-04-14 16:37:07 +04:00
6dc113aa80 [netaddress] panic only when normal run 2017-04-14 14:56:02 +04:00
ebe23f1379 refactor MConnection#sendBytes 2017-04-14 14:21:58 +04:00
06d219db8e test peer with no auth enc 2017-04-14 12:43:28 +04:00
0ca2c6fdb0 Merge pull request #9 from tendermint/develop
Develop
2017-04-13 18:50:47 -04:00
714fdaee3b Merge pull request #9 from tendermint/bugfix/check-for-error-returned-by-impl
[service] check for error returned by impl
2017-04-13 13:52:23 -04:00
1d01f6af98 2 kinds of peers: outbound and inbound 2017-04-13 12:36:16 +04:00
715b8c629f use the peer struct to simulate remote peer 2017-04-13 12:09:43 +04:00
a63e1bb2dc fix possible panic 2017-04-13 12:08:57 +04:00
5965578c56 [fuzz] only one way to set config variables 2017-04-13 11:55:14 +04:00
3b96458416 specify ubuntu version in readme 2017-04-13 11:26:37 +04:00
4671c44b2d Merge pull request #13 from tendermint/allow-for-multiple-restarts
[WSClient] allow for multiple restarts
2017-04-12 19:32:24 -04:00
052c2c1575 Merge pull request #11 from tendermint/feature/refactor-tests
WSClient failing to echo bytes
2017-04-12 19:32:14 -04:00
4b30cb3083 test: check err on cmd.Wait 2017-04-12 19:30:05 -04:00
8c38543357 fix error msg 2017-04-12 18:15:51 -04:00
c3295f4878 RPCRequest.Params can be map[string]interface{} or []interface{} 2017-04-12 13:42:19 -04:00
7dcc3dbcd1 test peer 2017-04-12 16:55:17 +04:00
c39e001a95 Merge pull request #22 from tendermint/persistent
fix closing conn
2017-04-11 13:40:06 -04:00
8067cdb5f2 fix closing conn 2017-04-11 12:42:11 -04:00
9d18cbe74e Remove race condition between read go-routine and stop 2017-04-11 13:38:15 +02:00
31eafe8f8e Update dependencies to newest develop branches 2017-04-10 22:24:54 +02:00
ebd3929c0d Merge pull request #18 from tendermint/13-reconnect-to-seeds
persistent peers (Refs 13)
2017-04-10 16:21:02 -04:00
9a1a6c56b4 dont expose makePersistent 2017-04-10 16:05:00 -04:00
b6f744c732 fix AddPeerWithConnection 2017-04-10 16:03:14 -04:00
a9bb6734e7 SetDeadline for authEnc. Stop peer if Add fails 2017-04-10 16:02:01 -04:00
8bb3a2e1d7 persistent peers (Refs #13) 2017-04-10 22:47:05 +04:00
f88d56b2f8 add glide 2017-04-10 22:47:04 +04:00
5b0489cdb4 use plain struct instead of go-config 2017-04-10 22:46:49 +04:00
b8a939a894 test non persistent mconnection 2017-04-10 22:46:48 +04:00
2b02843453 remove unused const 2017-04-10 22:46:48 +04:00
5be72672fe use golang time datatype instead of time units in name 2017-04-10 22:46:48 +04:00
549d3bd09a tests for MConnection 2017-04-10 22:46:48 +04:00
868017cf1a import go-common as cmn 2017-04-10 22:46:48 +04:00
c410fc5e24 Add extra test for encoding with sig,for p2p test fail 2017-04-10 19:51:02 +02:00
aecc32d363 Make dependencies explicit in glide.yaml 2017-04-10 19:51:02 +02:00
9e57d521ef Add type assertions for sig/pub/privkey implemenetations 2017-04-10 19:51:02 +02:00
f17e6bf44c Fix bitcoin addr scheme 2017-04-10 19:51:02 +02:00
926741c0a1 remove coin param 2017-04-10 19:51:02 +02:00
a3324cc97b Cleanup; Implement .Wrap() 2017-04-10 19:51:02 +02:00
eb6fcef8d2 Better docs and naming thanks to bucky 2017-04-10 19:51:01 +02:00
5b94758d4c Make PubKey struct compatible with go-wire.JSONBytes/ReadJSON 2017-04-10 19:51:01 +02:00
66ecd7705f Use new naming scheme PubKey{PubKeyInner} 2017-04-10 19:51:01 +02:00
750b25c47a Update go-data, test embedding strategies 2017-04-10 19:41:30 +02:00
49569ac244 Wrap constructor to create xxxS structs and avoid recursion 2017-04-10 19:41:30 +02:00
e49fdf7be7 Add HD functions 2017-04-08 22:57:59 -07:00
c94c1ff89a [ansible-tendermint] add missing handler to readme 2017-04-04 18:28:12 +04:00
294292f586 [ansible-tendermint] specify what this role does 2017-04-04 18:25:50 +04:00
4911c66b6d Merge pull request #25 from tendermint/23-tendermint-seeds
[ansible-tendermint] tendermint_validators variable (Refs #23)
2017-04-04 13:11:07 +04:00
667e92e635 [ansible-tendermint] tendermint_validators variable (Refs #23) 2017-04-04 13:04:34 +04:00
aa0fa0e6d8 Merge pull request #26 from tendermint/24-more-config-variables
[ansible-tendermint] more configuration options (Refs #24)
2017-04-04 13:01:22 +04:00
19e332840b [ansible-tendermint] more configuration options (Refs #24) 2017-04-04 12:58:22 +04:00
649a485275 [ansible-tendermint] systemd template 2017-04-03 21:01:41 +04:00
4c4bce9469 [mintnet-kubernetes] use tr -d as per Frey suggestion 2017-04-03 15:03:13 +04:00
2feff1ea16 Commented the empty table in c_level_db, and cleaned up the mem_db Value call. 2017-04-01 15:44:41 -04:00
121926d898 [ansible-tendermint] quick fix for #22 2017-03-31 21:53:24 +04:00
5e5968801c [ansible-tendermint] make seeds explicit 2017-03-31 21:49:13 +04:00
4750dbba77 [ansible-tendermint] rename playbook for clarity 2017-03-31 21:31:46 +04:00
5e56b2ea0e [ansible-tendermint] add TOC 2017-03-31 21:23:42 +04:00
f33edeb23a [ansible-tendermint] add image 2017-03-31 21:18:45 +04:00
a8d530dfda change title 2017-03-31 21:09:35 +04:00
b552974a09 Merge pull request #20 from tendermint/mintnet-ansible
Ansible playbook for Tendermint
2017-03-31 21:08:01 +04:00
b708e91bce mintnet-ansible
update readme, add license

rename mintnet-ansible to ansible-tendermint

fix name

text format for log file

include start into main

update readme
2017-03-31 21:06:49 +04:00
eee17f2a5c [mintnet-kubernetes] make sure not to read and write the same file in the same pipeline 2017-03-30 20:36:16 +04:00
4fdcf51467 Refactored the iterator to follow Go constructor conventions. 2017-03-30 11:51:11 -04:00
05e6a730eb [mintnet-kubernetes] add rancher as an option for DO [ci skip] 2017-03-30 12:42:12 +04:00
ae55713864 Move tx from light-client and add tests 2017-03-29 20:41:11 +02:00
34e2d6638d Fixed a typo in LevelDB property names. 2017-03-29 09:09:01 -04:00
dec518eb06 update comment [ci skip] [circleci skip] 2017-03-29 16:03:05 +04:00
58e537a42d Refactor setting up the key manager from config 2017-03-28 19:05:33 +02:00
6af2364fa9 Merge pull request #10 from tendermint/recreate-quit-channel-on-reset
Recreate Quit channel on reset
2017-03-28 12:26:02 -04:00
ba5382b70e open result&error channels on start 2017-03-28 14:17:40 +04:00
b0d2032488 use BaseService.OnReset method to recreate channels 2017-03-28 14:01:22 +04:00
7a12594edb [service] recreate Quit channel on reset
don't think that user should do this thing him/herself
2017-03-28 13:56:48 +04:00
9442a069a3 [tm-monitor] use BaseService.Reset method 2017-03-28 13:51:14 +04:00
a416c37ebd Merge pull request #12 from tendermint/close-ws-connection
close ws connection on Stop
2017-03-27 20:50:18 +04:00
c46ffe39a8 [service] check for error returned by impl
otherwise, we mark it as started when it is not in fact
2017-03-27 20:46:46 +04:00
75a539ae3d Merge pull request #3 from silasdavis/master
From the department of pedantry
2017-03-27 15:23:47 +04:00
ed9dda0c17 [mintnet-kubernetes] increase tm memory limit 2017-03-27 13:12:23 +04:00
115b1505f7 [tm-monitor] proposed solution for idea #1 2017-03-24 16:59:12 +04:00
5a9d14f025 [tm-monitor] expand ideas section 2017-03-24 16:22:58 +04:00
398ac046da Reorganize cobra cmd to enable better reuse 2017-03-23 21:23:05 +01:00
097e0abca9 Added in locking 2017-03-23 14:46:40 -04:00
d00b637959 [tm-bench] remove .pre prefix from version 2017-03-23 22:04:49 +04:00
de94e9b4ea [tm-bench] add missing flag in README 2017-03-23 20:18:04 +04:00
7522dea243 Merge pull request #15 from tendermint/bugfix/9-ws-performance
[tm-bench] go-rpc -> plain gorilla/websocket
2017-03-23 19:55:56 +04:00
08166b05f5 [tm-bench] use plain ws connection instead of go-rpc (Refs #9, Fixes #14)
Also:
- use go-kit/log

Reasoning:
I found that we just don't need this layer of abstraction here. Plus
go-rpc is buggy and lacking proper closing of ws connections.
2017-03-23 19:55:01 +04:00
14b0589d6b [tm-bench] nice formatting for error 2017-03-23 19:45:14 +04:00
31ee29d2f0 [tm-bench] add Dockerfile 2017-03-23 19:45:03 +04:00
6064c80250 Modified all db types to conform to the interface changes. 2017-03-23 11:37:46 -04:00
6fddcdf245 hd test: check masters too 2017-03-22 20:13:16 -04:00
c6be97c71c error testing the hd 2017-03-22 16:45:30 -04:00
ce9c57fca8 hd test 2017-03-22 15:59:48 -04:00
3a1313ab7d secp256k1: use compressed pubkey, bitcoin-style address 2017-03-22 01:18:56 -04:00
d6587be7bc [WSClient] allow for multiple restarts
needed for 3044f66ba9
See https://github.com/tendermint/tools/issues/6
2017-03-21 22:08:08 +04:00
afc39febed close ws connection on Stop 2017-03-21 22:02:25 +04:00
3044f66ba9 [tm-monitor] now EventMeter can be restarted multiple times (Refs #6)
with one caveat: go-common and go-rpc need to be updated as well
2017-03-21 20:42:31 +04:00
c053c15231 [tm-monitor] only restart EventMeter 2017-03-21 20:37:52 +04:00
6e00ce9bbd [tm-monitor] fix blocking issue
as you can see the mistake is that we listen for quit instead of closing
it.
2017-03-21 20:35:40 +04:00
dee06a92d9 [tm-monitor] rewrite eventmeter to use go-kit/log 2017-03-21 17:44:12 +04:00
06e5b8c2df [mintnet-kubernetes] join commands in the QuickStart examples 2017-03-21 13:10:08 +04:00
a83c27a282 copy mintnet-kubernetes from https://github.com/tendermint/mintnet-kubernetes 2017-03-21 13:06:30 +04:00
1c8496406a [tm-monitor] fix build-docker 2017-03-20 18:41:38 +04:00
81dbd7afc5 [tm-monitor] set current version to 0.2.1 2017-03-20 18:36:36 +04:00
7d95b5232f Merge pull request #12 from tendermint/bugfix/11-nodes-not-sorted
preserve nodes ordering (Fixes #11)
2017-03-20 18:34:14 +04:00
4ae36d4e76 [tm-monitor] preserve nodes ordering (Fixes #11) 2017-03-20 18:33:32 +04:00
76ace96925 Create nested directories as needed to store keys 2017-03-20 09:55:07 +01:00
07ac3201c2 Merge pull request #4 from tendermint/glide
Added glide dependency handling
2017-03-20 09:41:51 +01:00
d6205eb4ca Changed the iterations 2017-03-17 14:34:11 -04:00
bb8104b624 Exposed the LevelDB iterator in the DB struct. 2017-03-17 13:27:20 -04:00
c8e0eca7e5 Merge pull request #8 from tendermint/tm-bench
tm-bench
2017-03-17 14:54:44 +04:00
101418cf75 update readme 2017-03-17 14:54:27 +04:00
a6130910bf use math/rand, no need in crypto 2017-03-17 14:52:14 +04:00
68b07b9c97 connections flag 2017-03-17 13:13:06 +04:00
674d1d3e1b update readme 2017-03-17 01:12:53 +04:00
f36d60552f remove listenAddr flag 2017-03-17 01:12:37 +04:00
7ee9bb4ea2 more accurate statistics 2017-03-17 00:56:22 +04:00
8af2fe79e1 [tm-bench] show basic stats
```
===
Avg block time: 1225.504 ms
Avg tx throughput: 905 per sec
Avg block latency: 6.121 ms
===
```
2017-03-16 20:53:09 +04:00
da08d589b5 [tm-bench] initial commit 2017-03-16 19:01:56 +04:00
fb28fd4c13 Merge pull request #7 from tendermint/feature/extract-lib
[tm-monitor] extract lib to monitor/ dir
2017-03-16 19:00:24 +04:00
31a54b0840 [tm-monitor] extract lib to monitor/ dir
because tm-bench needs these structures
2017-03-16 14:53:32 +04:00
af792eac77 readme: js-tmsp -> js-abci 2017-03-13 17:20:31 -04:00
1a565b83ec fix readme 2017-03-13 17:18:10 -04:00
c32338f29b Merge pull request #66 from tendermint/readme
update readme
2017-03-13 16:54:00 -04:00
e6a5b060f9 update readme 2017-03-13 16:46:45 -04:00
b54b9b4ecc update url to network monitor [ci skip] [circleci skip] 2017-03-13 14:25:57 +04:00
5d19a008ce add Call method to WSClient, which does proper encoding of params 2017-03-10 15:33:45 +04:00
3233c9c003 WSClient failed to "echo_bytes"
Error:
```
Expected nil, but got: encoding/hex: invalid byte: U+0078 'x'
```
2017-03-10 14:56:04 +04:00
c88257b038 rename rpc function status to echo
echo means we're returning the input, which is exactly what this
function does.
2017-03-10 12:57:14 +04:00
0874c72819 refactor tests 2017-03-10 12:52:40 +04:00
d66ebbd904 use testify package 2017-03-10 12:03:16 +04:00
1a3573bf17 Merge pull request #10 from tendermint/feature/4-rename-http-clients
rename ClientURI -> URIClient, ClientJSONRPC -> JSONRPCClient
2017-03-10 10:42:22 +04:00
e6c083f589 rename ClientURI -> URIClient, ClientJSONRPC -> JSONRPCClient (Refs #4) 2017-03-10 10:41:10 +04:00
759060f47e Merge pull request #9 from tendermint/feature/8-http-interface-and-1-key-value-params-json-rpc
support key-value params in JSONRPC
2017-03-10 10:29:00 +04:00
715f78e26a Properly encode json.RawMessage 2017-03-10 10:20:38 +04:00
db69845ded introduce errors pkg 2017-03-09 19:01:37 +04:00
ff90224ba8 fix "Expected map but got type string" error
Error from tendermint:

```
panic: Expected map but got type string [recovered]
        panic: Expected map but got type string

goroutine 82 [running]:
testing.tRunner.func1(0xc420464000)
        /usr/local/go/src/testing/testing.go:622 +0x29d
panic(0xa1fda0, 0xc4201eecd0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/tendermint/tendermint/rpc/test.waitForEvent(0xc420464000, 0xc420064000, 0xae6fae, 0x8, 0xae6f01, 0xc2e998, 0xc2e9a0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/test/helpers.go:179 +0x53a
github.com/tendermint/tendermint/rpc/test.TestWSNewBlock(0xc420464000)
        /home/vagrant/go/src/github.com/tendermint/tendermint/rpc/test/client_test.go:190 +0x12e
testing.tRunner(0xc420464000, 0xc2e9a8)
        /usr/local/go/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:697 +0x2ca
```
2017-03-09 19:01:32 +04:00
720b74d89e read from ErrorsCh also 2017-03-09 17:44:00 +04:00
05e1a22d5b encode params before sending in JSONRPC 2017-03-09 13:46:48 +04:00
cf11e6ba65 add CHANGELOG 2017-03-09 12:43:24 +04:00
1ddb60b6e7 refactor jsonParamsToArgs
Suggested in https://github.com/tendermint/go-rpc/pull/9#discussion_r105098390
2017-03-09 12:23:21 +04:00
fed84f875c fix jsonParamsToArgsWS index error
Error from tendermint:
```
panic: runtime error: index out of range

goroutine 82 [running]:
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-rpc/server.jsonParamsToArgsWS(0xc4200960e0, 0xc42024d4a0, 0xc420215380, 0x3, 0x0, 0x0, 0xc420215383, 0x9, 0xc42024d4a0, 0xf1ecc0, ...)
        /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-rpc/server/handlers.go:184 +0x654
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-rpc/server.(*wsConnection).readRoutine(0xc4201fd0e0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-rpc/server/handlers.go:496 +0x3a9
created by github.com/tendermint/tendermint/vendor/github.com/tendermint/go-rpc/server.(*wsConnection).OnStart
        /home/vagrant/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-rpc/server/handlers.go:377 +0x45
```
2017-03-08 17:55:08 +04:00
1842e03315 revert using local import
this breaks the client's code (e.g. tendermint)
2017-03-08 17:33:46 +04:00
d033cd54b8 add editorconfig 2017-03-08 17:17:42 +04:00
2dc6ab3896 use golang default if an arg is missing (Refs #7) 2017-03-08 17:16:01 +04:00
6d66cc68ed make sure we are using correct server
also remove it afterwards
2017-03-08 16:55:15 +04:00
51d760f29f use local import for testing 2017-03-08 16:23:38 +04:00
22ba8bdef8 fix Call method signature in HTTPClient interface 2017-03-08 10:26:13 +04:00
d43e3db978 fix circleci 2017-03-07 19:28:00 +04:00
26ccb4c94a remove private call methods
Q: what was the reason to create them?
2017-03-07 19:27:52 +04:00
c128957723 "must remove file for test to run again" - no way I am doing this by hands, too lazy :) 2017-03-07 19:27:38 +04:00
66867bf949 remove "rpc" prefix from package imports 2017-03-07 19:27:32 +04:00
e1d5873bdf support key-value params in JSONRPC (Refs #1)
More changes:

- remove Client interface (reason: empty)
- introduce HTTPClient interface, which can be used for both ClientURI
  and ClientJSONRPC clients (so our users don't have to create their own) (Refs #8)
- rename integration tests script to `integration_test.sh`
- do not update deps on `get_deps`
2017-03-07 19:27:27 +04:00
b03facd828 add Dockerfile 2017-03-07 18:34:13 +04:00
ce69eaa75e [tm-monitor] mark next version as pre until release 2017-03-07 12:53:06 +04:00
4be0a1017b Merge pull request #5 from tendermint/feature/4-merge-eventmeter
merge go-event-meter into tm-monitor (Refs #4)
2017-03-07 12:47:02 +04:00
df98d5e1af merge go-event-meter into tm-monitor (Refs #4)
https://github.com/tendermint/go-event-meter
2017-03-07 12:39:33 +04:00
4bcf61129d [tm-monitor] new screencast 2017-03-06 22:41:02 +04:00
4f39f0be48 [tm-monitor] rename docker image to just tendermint/monitor 2017-03-06 22:29:06 +04:00
f7f64a58d6 [tm-monitor] rename netmon to tools 2017-03-06 22:02:15 +04:00
6a30f422ce Merge pull request #3 from tendermint/tm-monitor
New netmon
2017-03-06 21:36:23 +04:00
975807c744 fix Health calculation logic 2017-03-06 20:21:18 +04:00
1a65dbebb9 tests for Network 2017-03-06 19:51:51 +04:00
5c9ec9344a tests for node and monitor 2017-03-06 18:35:52 +04:00
fd3dc5f5a7 improve ton output 2017-03-06 12:31:53 +04:00
97a5ed2d1a Merge pull request #16 from tendermint/develop
v0.4.0
2017-03-06 03:11:04 -05:00
1236e8fb6e Merge pull request #65 from tendermint/develop
v0.4.0
2017-03-06 03:10:22 -05:00
be5a4345a3 formatting and update CHANGELOG 2017-03-06 02:58:26 -05:00
700a62c22e CHANGELOG 2017-03-06 02:53:15 -05:00
53d777a2d5 CHANGELOG.md 2017-03-06 01:30:41 -05:00
beb3eda438 fix addrbook start/stop 2017-03-05 22:59:18 -05:00
c94bc2bc2b DialSeeds takes an addrbook 2017-03-05 21:57:07 -05:00
dcb015dff6 repeat_timer: drain channel in Stop; done -> wg 2017-03-05 03:33:35 -05:00
eac3f2bc14 Merge remote-tracking branch 'origin/master' into develop
Conflicts:
	LICENSE.md
2017-03-05 00:16:10 -05:00
56eebb95ee Merge pull request #12 from tendermint/bugfix/pex-issues-335
PEX issues #335
2017-03-04 23:19:51 -05:00
88b5c724f2 remove public addr book funcs from pex 2017-03-04 22:55:42 -05:00
65b1756978 expose 2 API functions for tendermint#node/node.go 2017-03-04 22:44:25 -05:00
108beae7a8 more tests for AddrBook 2017-03-04 22:44:25 -05:00
2773410de4 prevent nil addr
Error:

```
Error: runtime error: invalid memoryaddress or nil pointer dereference\nStack:
goroutine 549 [running]:\nruntime/debug.Stack(0x0, 0x0,
0x0)\n\t/usr/local/go/src/runtime/debug/stack.go:24
+0x80\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*MConnection)._recover(0xc821723b00)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/connection.go:173
+0x53\npanic(0xbe1500, 0xc820012080)\n\t/usr/local/go/src/runtime/panic.go:443
+0x4e9\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*NetAddress).Valid(0x0,
0x0)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/netaddress.go:125
+0x1c\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*NetAddress).Routable(0x0,
0xc8217bb740)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/netaddress.go:117
+0x25\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*AddrBook).addAddress(0xc820108380,
0x0,
0xc821739590)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/addrbook.go:524
+0x45\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*AddrBook).AddAddress(0xc820108380,
0x0,
0xc821739590)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/addrbook.go:160
+0x286\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*PEXReactor).Receive(0xc82000be60,
0xc820149f00, 0xc8218163f0, 0xc82184e000, 0x5b,
0x1000)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/pex_reactor.go:109
+0x457\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.newPeer.func1(0xc82011d500,
0xc82184e000, 0x5b,
0x1000)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/peer.go:58
+0x202\ngithub.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*MConnection).recvRoutine(0xc821723b00)\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/connection.go:439
+0x1177\ncreated by
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p.(*MConnection).OnStart\n\t/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-p2p/connection.go:138
+0x1a1\n
```
2017-03-04 22:40:48 -05:00
e7656873c1 public save API 2017-03-04 22:40:48 -05:00
332f7056f7 start/stop the book with reactor
Refs https://github.com/tendermint/tendermint/issues/335
2017-03-04 22:40:48 -05:00
286cbbd99d Update LICENSE.md 2017-03-04 17:12:18 -08:00
ab0cca734a Update LICENSE.md 2017-03-04 17:11:59 -08:00
0b1ee4b673 version bump to 0.4.0 2017-03-03 18:43:08 -05:00
eaeb2658ea fixes from review 2017-03-03 18:39:10 -05:00
17e6ae813f Merge pull request #15 from tendermint/seedsfix
Seedsfix
2017-03-03 17:33:23 -05:00
dab31d0166 version bump to 0.4.0 2017-03-03 17:30:38 -05:00
0e7baf027b some dial seeds fixes 2017-03-03 16:42:10 -05:00
26275ba66c dial seeds error handling 2017-03-03 16:42:10 -05:00
c1f5a96382 Merge branch 'master' into develop
Conflicts:
	README.md
2017-03-03 01:17:54 -05:00
3f47cfac5f Merge pull request #4 from tendermint/develop
go-data support
2017-03-03 00:17:33 -05:00
6141dc6eed Merge pull request #7 from tendermint/develop
Develop
2017-03-03 00:06:45 -05:00
959efd3127 Merge branch 'master' into develop 2017-03-03 00:05:51 -05:00
95c14fbd65 Merge branch 'master' into develop 2017-03-03 00:03:39 -05:00
f8ffbfb2be Merge pull request #9 from tendermint/develop
Add test
2017-03-03 00:02:46 -05:00
af7e312088 Added glide dependency handling 2017-03-02 17:16:15 -05:00
315dcd449b update readme 2017-03-03 00:14:58 +04:00
5406622a64 add asciicast 2017-03-03 00:03:55 +04:00
201c8864b6 link 2 docker containers 2017-03-02 22:14:32 +04:00
09eb442de7 done all items from the TODO 2017-03-02 22:07:03 +04:00
94b8e28b21 Dockerfile and Makefile 2017-03-02 22:03:35 +04:00
11230b8aea no-ton flag to disable ton (default to false) 2017-03-02 21:02:30 +04:00
069c870614 differentiate between monitored nodes and nodes in a cluster 2017-03-02 18:59:12 +04:00
8c6ae55bd0 set network's NumValidators and node's IsValidator 2017-03-02 12:53:05 +04:00
d3b54b204f tm-monitor 0.1.0 2017-03-01 23:01:52 +04:00
0c92c8516f Rename proxy to server for clarity 2017-02-28 21:53:05 +01:00
6389d208cc Key server API integrated in CLI 2017-02-28 21:33:27 +01:00
6ec2330eb8 Import keys server from light-client, with changes 2017-02-28 21:09:35 +01:00
e1c717a048 Add support for hex / base64 / btc (b58) encoding of binary data 2017-02-28 20:31:08 +01:00
c59e2d7d13 Expose address in keyinfo, add get command 2017-02-28 20:07:44 +01:00
d5931c9ee3 Set key algorithm on key creation 2017-02-28 19:43:18 +01:00
9c427e95e2 Add update cli command, cleanup 2017-02-28 19:02:24 +01:00
506ff7d85a Expose new and list via cli 2017-02-28 18:52:52 +01:00
78bb9f9cd8 Import keystore logic from light-client 2017-02-28 18:07:59 +01:00
d979bfc49e Add flag validation 2017-02-28 16:56:17 +01:00
f80957ad3c Basic cobra/viper cli framework 2017-02-28 16:30:15 +01:00
a816ff0bab Add test 2017-02-27 14:52:48 +01:00
562b4cc9ef Merge pull request #3 from tendermint/feature/go-data
Use go-data for nice json un/marshaling
2017-02-23 19:14:53 -05:00
0e92dd5bb5 One name, type byte per algorithm 2017-02-24 00:31:43 +01:00
8c9b889ccf Support json encode/decode for nil values in S structs 2017-02-23 18:11:20 +01:00
b6a2c5949f Add helper methods for nil checks in structs 2017-02-23 15:35:04 +01:00
cbe35e07d1 Add more tests for de/en-coding public and private keys 2017-02-23 14:56:25 +01:00
6c2bf8c24b Clean up test cases -> testify 2017-02-23 13:20:30 +01:00
1bc1947e3f First tests of go-data encoding 2017-02-22 23:43:26 +01:00
e6d35ee641 Add structs for go-data support 2017-02-22 23:15:10 +01:00
33e52343d0 Merge branch '4gn3s-patch-1' into develop 2017-02-20 16:59:20 +04:00
b350b08021 Update README.md
Typo fixed
2017-02-20 16:58:50 +04:00
1e8791bc9a Merge pull request #62 from wolfposd/patch-1
Update: jTMSP -> jABCI
2017-02-19 10:51:49 -05:00
d299afe630 Update: jTMSP -> jABCI 2017-02-19 16:46:57 +01:00
f81a9c647d Update README.md 2017-02-18 07:36:14 +01:00
31bdda27ad Query: LastHeight -> Height :) 2017-02-14 16:53:21 -05:00
2a3f638495 Merge pull request #61 from tendermint/interface-fixes
Interface fixes
2017-02-13 20:19:24 -05:00
e909cafa0b BaseApplication 2017-02-13 20:16:21 -05:00
b6afa8d85b Query: Height -> LastHeight 2017-02-13 20:16:17 -05:00
5d673ecf31 Fix comment for BeginBlock hash 2017-02-12 18:38:10 -08:00
b025c13f67 drop BlockchainAware 2017-02-06 19:20:02 -05:00
a954f91e5f Merge pull request #60 from tendermint/readme
fixes #38 and #59
2017-02-06 18:37:33 -05:00
dafcc3d3e3 fixes #38 and #59 2017-02-06 18:11:17 -05:00
48b17de829 Merge pull request #2 from alessio/master
Add LICENSE file
2017-01-28 08:01:48 -08:00
1c977f78fd Update LICENSE 2017-01-28 08:01:29 -08:00
c3b8006166 Add LICENSE file 2017-01-28 12:42:01 +00:00
8df0bc3a40 Merge branch 'abci_proof' into develop 2017-01-27 22:27:32 -08:00
b9e2ad12e6 Merge pull request #58 from tendermint/abci_proof_jae
Updates to ABCI_Proof PR
2017-01-27 21:58:52 -08:00
339e135776 Add IsDirEmpty 2017-01-27 20:37:04 -08:00
2a4894310d Remove Proof message, replace with more flexible Query 2017-01-27 10:35:27 -08:00
4bdddf9829 First commit to demonstrate change 2017-01-23 20:54:24 -08:00
9745f07bee common -> cmn 2017-01-23 20:26:17 -08:00
a33b75fe8b Merge pull request #54 from roylee17/lint
Lint
2017-01-23 20:23:14 -08:00
6efadac330 Merge pull request #53 from roylee17/makefile
Makefile: add fmt and lint targets
2017-01-23 20:18:19 -08:00
f94ae5eeed TSP -> Socket 2017-01-23 20:14:14 -08:00
366479c7ad Merge branch 'readme' into hotfix_readme 2017-01-23 20:09:03 -08:00
fdc047ae7a Proof uses uint64 for blockHeight 2017-01-17 17:22:34 +01:00
e0309007ad Improve Makefile 2017-01-17 15:53:24 +01:00
dde413d44b Cleaned up text 2017-01-17 15:53:24 +01:00
732274b7f6 Add tests for client-server proofs over socket and grpc 2017-01-17 15:53:24 +01:00
cfc3f24751 Everything compiles, test proof in dummy app 2017-01-17 15:44:41 +01:00
7cd39dafea Update protocol buffers 2017-01-17 15:44:40 +01:00
58ea995032 Begin adding proof calls 2017-01-17 15:42:54 +01:00
98c4679f39 Fixed Makefile to cleanup after run 2017-01-17 15:41:11 +01:00
55cb08722d lint: s/+=1/++, remove else clauses 2017-01-17 00:30:36 -08:00
af2a66b226 test_app: unexport internal function.
This reverts commit 24c9b2761d7da5ab5084310f0cb3e51c7fc9738d.
2017-01-16 23:23:19 -08:00
9134905f42 cleanup: replace common.Exit with log.Crit or log.Fatal
Later we can pick another logger that has fatal, like zap?
2017-01-16 23:23:19 -08:00
1150bbfe36 lint: s/common.Fmt/fmt.Sprintf 2017-01-16 23:20:04 -08:00
fcaa545e1e lint: remove dot import (go-common)
Spell out the package explicitly.
This commit is totally textual, and does not change any logic.

The swiss-army knife package may serve a kick-start in early
stage development. But as the codebase growing, we might want
to retire it gradually:

  For simple wrapping functions, just inline it on the call site.
  For larger pice of code, make it an independent package.
2017-01-16 23:20:04 -08:00
c65bb21a51 Makefile: add 'build' target 2017-01-16 22:33:48 -08:00
aae3c91e88 fmt: run 'make fmt' 2017-01-16 22:03:27 -08:00
235b18d694 Makefile: add gmt and lint 2017-01-16 22:02:45 -08:00
05096de368 Add Result.String 2017-01-15 14:43:16 -08:00
6526ab2137 Merge pull request #50 from tendermint/hotfix_make
Make sure we install before test, since test relies on counter etc
2017-01-13 13:17:24 -05:00
b9d1465488 Make sure we install before test, since test relies on counter etc 2017-01-13 10:12:38 -08:00
68ef6bc1bf update README 2017-01-13 03:17:53 -05:00
699d45bc67 Merge pull request #48 from tendermint/develop
move glide deps to master
2017-01-13 00:26:36 -05:00
5626a1125a move glide deps to master 2017-01-13 00:24:38 -05:00
72f6dacd22 fix tests 2017-01-12 22:32:20 -05:00
068afb5b7f Merge pull request #36 from tendermint/develop
v0.3.0, for Tendermint v0.8.0
2017-01-12 22:03:00 -05:00
fcea0cda21 Merge pull request #6 from tendermint/develop
v0.6.0
2017-01-12 22:02:40 -05:00
6177eb8398 love you circley 2017-01-12 22:01:20 -05:00
ac443fa61f run tests from bash script 2017-01-12 21:59:02 -05:00
08f2b5bc84 get deps for testing 2017-01-12 21:51:34 -05:00
b5ca28d60f Merge branch 'master' into develop
Conflicts:
	README.md
2017-01-12 21:44:09 -05:00
de56442660 Merge branch 'master' into develop 2017-01-12 21:40:43 -05:00
3d98f675f3 Merge pull request #11 from tendermint/develop
Develop
2017-01-12 21:39:57 -05:00
b27edfd189 Merge pull request #1 from tendermint/develop
Include pwd dir to StartProcess
2017-01-12 21:39:27 -05:00
fddee66d90 Merge pull request #8 from tendermint/develop
use mtx in OnStop
2017-01-12 21:38:04 -05:00
996c483f23 Merge pull request #4 from tendermint/develop
C LevelDB
2017-01-12 21:37:57 -05:00
e289af53b6 Merge pull request #6 from tendermint/develop
Develop
2017-01-12 21:37:18 -05:00
42b7bfbf0c update version and glide 2017-01-12 21:20:09 -05:00
67c9086b74 optional panic on AddPeer err 2017-01-12 21:09:24 -05:00
e47722ecb2 Connect2Switches: panic on err 2017-01-12 20:49:48 -05:00
2b750ea49f Make Connect2Switches blocking 2017-01-12 20:49:48 -05:00
58e42397f8 close conns on filter; fix order in MakeConnectedSwitch 2017-01-12 20:49:48 -05:00
bd353e004a QuitService->BaseService 2017-01-12 20:49:48 -05:00
624dca61b3 Merge pull request #47 from tendermint/rename
Rename
2017-01-12 16:06:40 -05:00
5189a2248d TMSP -> ABCI 2017-01-12 16:04:32 -05:00
80f377135b AppendTx -> DeliverTx 2017-01-12 15:27:08 -05:00
2e414ebe6b Merge pull request #42 from tendermint/collapse_info
Flatten ResponseInfo
2017-01-12 15:20:59 -05:00
490a96ef66 drop unneeded variable copy 2017-01-12 15:18:38 -05:00
f8167872d8 EndBlock also returns ResponseEndBlock 2017-01-12 14:50:41 -05:00
8b76f3dd00 Make fields in ResponseInfo be flat 2017-01-12 14:50:41 -05:00
0d82d26408 Frist commit on types.proto 2017-01-12 14:50:08 -05:00
2337086736 use mtx in OnStop 2017-01-12 14:32:48 -05:00
94fed25975 fix test 2017-01-12 10:22:23 -05:00
a7b7fe83d6 Merge pull request #46 from tendermint/updates
Updates
2017-01-12 01:11:11 -05:00
831cb4adcd update glide 2017-01-12 01:08:31 -05:00
e6b9a2b6aa response struct and persistent args 2017-01-12 01:04:25 -05:00
81b2697cce fix console exit, closes #35 2017-01-12 01:04:25 -05:00
c31df4081c added counter query support 2017-01-12 01:04:22 -05:00
465c77e120 Merge pull request #43 from mappum/develop
tmsp-cli arg string handling + Make dummy query response values more clear
2017-01-12 00:23:33 -05:00
0eb278ad3b version bump 0.6.0 2017-01-12 00:13:20 -05:00
b494cc5219 Merge pull request #5 from mappum/develop
Fix hex string handling
2017-01-12 00:12:11 -05:00
4d7aa62a10 Added test for unexpected hex string type HTTP args 2017-01-07 20:40:45 -08:00
86506cd4f8 Handle quoted and hex string type HTTP args for both 'string' and '[]byte' type function args 2017-01-07 20:40:29 -08:00
af1212897c Exit early in bash tests 2017-01-07 14:00:27 -08:00
34a806578a Handle hex strings and quoted strings in HTTP params
Use 0x-prefixed hex strings in client

server: Decode hex string args

Encode all string args as 0x<hex> without trying to encode as JSON

Added tests for special string arguments

Fix server handling quoted string args

Added string arg handling test cases to bash test script
2017-01-07 13:59:33 -08:00
4bb65366f4 Update CLI test string args 2017-01-03 19:26:37 -08:00
cd6fa3018c Return errors from cmd functions instead of printing 2017-01-03 10:53:14 -08:00
86a6deba3f Remove debug printing 2017-01-02 18:49:54 -08:00
e748127b7f Don't include quotes in quoted string args 2017-01-02 18:49:10 -08:00
115e6939d0 Require quotes or 0x<hex> for string args 2017-01-02 18:28:47 -08:00
ab211d2dbe Include 'value' and 'valueHex' fields in dummy query response 2017-01-02 18:20:30 -08:00
75ea378a6a Encode dummy query values as hex strings 2017-01-02 18:10:12 -08:00
c9b6b6e591 Merge pull request #39 from sjamayee/develop
link to TMSP Blog post
2017-01-02 12:37:48 -08:00
b0a17b1804 Fix blog link 2017-01-02 12:12:23 -08:00
2645626c33 Merge pull request #3 from tendermint/swap_go_c
go and c strings were swapped
2016-12-22 21:07:31 -05:00
33e35c4732 go and c strings were swapped 2016-12-22 15:44:51 -05:00
jac
5f6ad831b0 link to TMSP Blog post 2016-12-15 14:47:31 +01:00
a552e49b50 Reverts commit f40b1b to a6a67e 2016-12-12 23:08:31 -05:00
c5f008d60f Fix TMSP tutorial outputs 2016-12-06 03:57:09 -08:00
b3e5d0afa1 Update glide.* 2016-12-06 03:22:53 -08:00
5e83e481bf Fix tests; Update go-merkle API 2016-12-06 02:15:32 -08:00
7f507d69fa Include pwd dir to StartProcess 2016-12-06 02:08:05 -08:00
0416e0aa9c Close opened files 2016-12-06 01:46:23 -08:00
70e694ee76 Fix ThrottleTimer null-pointer error / race condition 2016-12-06 01:39:04 -08:00
eab2baa363 use go-flowrate instead of flowcontrol 2016-12-04 18:20:37 -08:00
5e2a1d3e30 Fix tests; Support 'leveldb' for legacy 2016-11-30 20:22:35 -08:00
5ab5538d6c Move cleveldb to own file w/ build tag condition 'gcc' 2016-11-30 20:15:29 -08:00
2cee364692 addrbook: toggle strict routability 2016-11-30 22:57:21 -05:00
226eb6554f Support for Run() convenience function 2016-11-29 16:55:32 -08:00
9f81134388 Add support for levigo bindings 2016-11-29 16:06:36 -08:00
40448a3897 types: update LastBlockInfo and ConfigInfo 2016-11-23 18:27:27 -05:00
2dce41ad6a types: pretty print validators 2016-11-23 18:22:44 -05:00
e813b8c71d counter: fix tx buffer overflow 2016-11-23 18:22:22 -05:00
f4e97a5db1 Merge pull request #37 from tendermint/valset
Valset
2016-11-22 21:10:26 -05:00
37b5cca87c update cli example for new query result format 2016-11-22 21:06:50 -05:00
ef3eb4a30e update glide 2016-11-22 21:06:39 -05:00
dc13ec05a1 NewIAVLTree takes waldir 2016-11-22 20:44:41 -05:00
b200b82418 dummy: valset changes and tests 2016-11-22 14:01:25 -05:00
9a2d3e51ed heights are uint64 2016-11-22 14:00:31 -05:00
63186e34b3 Fix race condition 2016-11-21 20:26:47 -08:00
2a306419c8 Remove spurious fmt 2016-11-21 20:19:01 -08:00
f40b1b65f8 Add Tempdir 2016-11-21 20:03:59 -08:00
890e240730 Remove AutoFile tests 2016-11-21 20:03:59 -08:00
25dc9ae345 QuitService->BaseService 2016-11-21 20:03:59 -08:00
a6a67ea9b2 Remove AutoFile; Use go-autofile instead 2016-11-21 20:03:59 -08:00
6b4160f2a5 Add Tempdir 2016-11-21 20:01:11 -08:00
dd12bd8f1b Fix checkTotalSizeLimit bug; remove more than 1 file at a time 2016-11-21 19:57:17 -08:00
a528af55d3 Group is a BaseService; TotalSizeLimit enforced; tests fixed 2016-11-21 19:09:14 -08:00
d1848762cf Fix issue where buffered writes may split a line to two files 2016-11-20 17:19:15 -08:00
3a70c07ed1 Merge pull request #29 from tendermint/info_and_header
Info and header
2016-11-16 16:26:58 -05:00
0bdb3b887e fix chain_aware app 2016-11-16 16:22:52 -05:00
60e0842ef9 Header.LastBlockID 2016-11-16 16:11:36 -05:00
df299d03c4 block_height is int32 2016-11-16 13:32:18 -05:00
ddb2b01631 BeginBlock(hash, header) 2016-11-16 13:32:18 -05:00
7901825ad9 persistent dummy 2016-11-16 13:32:01 -05:00
debbf122db add version/block/config to Info. add header to BeginBlock 2016-11-16 13:32:01 -05:00
eece35eeeb glide: update go-common 2016-11-15 14:47:39 -05:00
1dafd3a89b Remove spurious fmt call 2016-11-15 14:39:13 -05:00
6aa85b642e BeginBlock 2016-11-15 14:39:13 -05:00
7998ba668a QuitService->BaseService 2016-11-15 14:39:13 -05:00
8374785c1d update glide, grpc to v4 2016-11-15 14:11:01 -05:00
fe96cfc56d Merge pull request #34 from tendermint/glide
Glide
2016-11-10 02:43:53 +00:00
1f9142873b add glide 2016-11-10 02:32:23 +00:00
dc8fa06e64 Add MakeSimpleSearchFunc 2016-11-05 17:58:50 -07:00
a20c98e619 Add Monitor.SetREMA() 2016-11-04 06:14:49 -07:00
1261fca160 FindLast 2016-10-30 04:29:40 -07:00
916f3d789b Size() returns 0 if file doesn't exist 2016-10-28 14:50:46 -07:00
5e9c5dc413 Add Group.WriteLine 2016-10-28 13:56:31 -07:00
fa3daa7abc Remove AutoFile tests 2016-10-28 12:11:23 -07:00
2781df39e5 QuitService->BaseService 2016-10-28 12:09:22 -07:00
161e36fd56 QuitService->BaseService 2016-10-28 12:04:58 -07:00
0311042336 Add CHALLENGE 2016-10-28 09:10:33 -07:00
d741b81ab5 Add better docs for Group 2016-10-26 22:12:56 -07:00
44f2818a3d Remove AutoFile; Use go-autofile instead 2016-10-26 21:50:28 -07:00
c26b857900 Fix Search and add test 2016-10-26 21:50:07 -07:00
1859c4d5fe First commit 2016-10-26 16:23:19 -07:00
28b3d52948 first commit 2016-10-26 16:22:43 -07:00
ab98bffbb1 codegangsta => urfave 2016-10-20 21:57:33 -04:00
e6e3853dc7 Merge pull request #3 from tendermint/develop
use EventSwitch interface; less logging
2016-10-20 21:31:26 -04:00
1c85cb98a4 Merge pull request #7 from tendermint/develop
EventSwitch is an interface
2016-10-20 21:23:35 -04:00
1c62bb6dad Merge pull request #5 from tendermint/develop
Reset() and SIGHUP for AutoFiles
2016-10-20 02:01:00 -07:00
1a24e6e237 Let SIGHUP close AutoFiles 2016-10-17 16:24:55 -07:00
2e424ee663 service: Reset() for restarts 2016-10-17 16:24:55 -07:00
ee4f8c2ab2 add glide 2016-10-12 11:40:40 -04:00
1eb390680d Merge pull request #8 from tendermint/develop
update MakeConnectedSwitches
2016-10-10 14:48:58 -04:00
855255d73e use EventSwitch interface; less logging 2016-10-10 03:22:34 -04:00
1652dc8b3f EventSwitch is an interface 2016-10-10 03:20:42 -04:00
5d3eb0328a Update README.md 2016-09-28 09:57:04 +09:00
153ac88672 update MakeConnectedSwitches 2016-09-14 00:57:53 -04:00
538862321a bump version 2016-09-12 12:23:36 -04:00
dcd4ab5cd2 Make console more robust to typos 2016-09-12 10:21:20 +02:00
ead192adbb test: more verbosity 2016-09-10 20:10:59 -04:00
0e2a6b41f8 Merge pull request #30 from tendermint/develop
Develop
2016-09-10 19:04:30 -04:00
47e06734f6 Merge pull request #4 from tendermint/throttle
throttle_timer: fix race, use mtx instead of atomic
2016-09-10 17:59:15 -04:00
930880f574 throttle_timer: fix race, use mtx instead of atomic 2016-09-10 17:52:26 -04:00
f508f3f20b Merge pull request #6 from tendermint/develop
filter conn by addr/pubkey. closes #3
2016-09-09 19:45:12 -04:00
42e4f4693c client: safe error handling 2016-09-08 21:41:35 -04:00
9dc4dc1960 Add BitArray.Update() 2016-09-05 18:26:43 -07:00
642901d5aa filter conn by addr/pubkey. closes #3 2016-08-25 13:46:43 -04:00
cb12ff94d3 Merge pull request #28 from tendermint/fix_circle
fix tests
2016-08-24 20:19:44 -04:00
22894d2f60 fix tests 2016-08-24 20:16:55 -04:00
3329868a1d grpc fix 2016-08-24 02:11:31 -04:00
706d443617 Merge pull request #27 from tendermint/disconnect
Disconnect
2016-08-23 11:34:42 -04:00
83920a1c37 fixes from review 2016-08-17 23:27:49 -04:00
1b13f14e08 consolidate example tests; grpc fail fast 2016-08-15 15:04:32 -04:00
a8066f9c82 return error if not running 2016-08-10 19:35:54 -04:00
d3bdb49aae remote_client -> socket_client; use logger 2016-08-10 19:35:50 -04:00
479510be0e support full urls (with eg tcp:// prefix) 2016-08-10 01:13:13 -04:00
60cea4415b update logger 2016-08-04 17:49:02 -04:00
4b11d62bdb Add Signature.Equals 2016-07-24 13:35:44 -07:00
58bacfb04e Merge pull request #21 from tendermint/develop
Develop
2016-07-23 19:23:33 -04:00
fbbf82ec64 update README.md 2016-07-23 19:05:46 -04:00
3b329039d8 better testing. cli test for tutorial 2016-07-23 18:57:05 -04:00
a263323d5c update readme. --verbose makes batch look like console 2016-07-23 17:37:09 -04:00
3baa390bba reduce numTimes in test 2016-07-23 11:24:48 -04:00
ba11348508 update make test 2016-07-22 01:23:13 -04:00
dea910cd3e Makefile: go test --race 2016-07-22 01:15:52 -04:00
39ee59c26e server: return result with error 2016-07-22 01:13:16 -04:00
b0c0631468 Spelling 2016-07-13 18:50:06 +01:00
49a67aee8a add circle.yml. disable js test 2016-07-06 17:13:33 -04:00
732634112b run grpc finishAsyncCall in go routine 2016-07-06 16:57:02 -04:00
88f8141ab8 cleanup cli, drop expr 2016-07-01 20:22:58 -04:00
3dabf304a1 fix race condition in repeat_timer 2016-06-26 01:00:51 -04:00
cefb3a45c0 expose LvlNotice 2016-06-26 00:45:56 -04:00
929cf433b9 fix chDesc race 2016-06-26 00:34:34 -04:00
711d2541f5 MakeConnectedSwitches function 2016-06-26 00:34:23 -04:00
a8ac819139 link issue from readme 2016-06-23 20:40:16 -04:00
a44e0e0f4b add test example 2016-06-23 20:37:35 -04:00
0c70a4636a add better docs to readme 2016-06-23 20:33:04 -04:00
2c21c7be89 call reqRes.SetDone in grpc client 2016-06-22 14:25:18 -04:00
7ea86f6506 fix test race and update readme 2016-06-21 15:19:56 -04:00
7376a72dd7 circle badge 2016-06-21 14:40:24 -04:00
981c6868ad fix race conditions in tests 2016-06-21 14:35:29 -04:00
48fa21511b Merge pull request #4 from benjaminbollen/issue1_concurreny_bug_in_remove_listener
Fixes #1 concurreny bug in remove listener
2016-06-21 10:48:51 -04:00
c15bcd487f fixes #1; events.go: claim full lock on delete listener 2016-06-17 14:53:19 +02:00
acabc4d3bb Introduce events_test.go with five unit tests asserting normal behaviour
and a sixth unit test to probe race conditions on RemoveListener.
2016-06-17 14:53:01 +02:00
73e5c3cb7b update grpc version 2016-06-16 19:12:54 -04:00
8c947760e6 grpc.SupportPackageIsVersion3 2016-06-16 19:04:59 -04:00
f41bc5f119 Merge pull request #13 from tendermint/protobuf
Protobuf + GRPC
2016-06-11 11:12:49 -07:00
516a929e5f some cleanup 2016-05-24 22:40:47 -04:00
1ab3c74718 silly grpc client 2016-05-23 14:45:07 -04:00
f84f11ffe7 base grpc support 2016-05-18 18:29:52 -04:00
c3cc5375be ignore mustConnect for now. fix test_counter 2016-05-17 22:45:45 -04:00
5dc7bee57b Responses/Requests -> Value 2016-05-17 20:06:24 -04:00
32f83f9494 fix up tmsp-cli, tests 2016-05-14 03:09:47 -04:00
35f4f0e271 use real protobuf message types 2016-05-14 02:22:32 -04:00
5bd7692323 version bump 2016-05-12 00:10:46 -04:00
6684a18730 fix test 2016-05-12 00:08:41 -04:00
0dc6ebc325 configurable fuzz conn 2016-05-12 00:00:52 -04:00
ffbd6d8782 drop the p2p_ 2016-05-11 23:47:51 -04:00
529efe50ea No global config 2016-05-08 15:00:33 -07:00
31fdd21c7e No global config 2016-05-08 15:00:13 -07:00
7d997ca8e6 No global config 2016-05-08 14:59:27 -07:00
1d9e89812a Remove go-alert dependency 2016-05-08 14:58:28 -07:00
7ffd289909 Conform to new codegangsta.cli ActionFunc interface 2016-05-05 14:11:18 -07:00
3910f871dd Trivial 2016-05-05 13:58:39 -07:00
9a8d40b87c Update README.md 2016-05-04 13:37:22 -07:00
e8538d606a add blank client interface 2016-05-04 10:39:43 -04:00
41cfb7b677 Remove ReadSignature* methods 2016-04-21 18:05:15 -07:00
5f721bcfa0 remove vendor 2016-04-20 14:52:56 -04:00
1b81863ef7 NewBlockHeader event 2016-04-20 14:52:11 -04:00
7e767e9548 Secp256k1 pubkeys are 64 bytes. Strip btcec prefix byte 2016-04-20 08:46:07 -07:00
c121163635 ReadSignature* 2016-04-19 08:49:41 -07:00
d57d5ff3c9 PrivKey.Equals 2016-04-19 01:26:40 -07:00
8b34fd2e51 Add secp256k1 support 2016-04-19 01:02:31 -07:00
d471b06bd8 Added C++ and Javascript impls 2016-04-15 15:01:05 -07:00
ca95184373 s/Invalid[Address,Amount]/Invalid[Input,Output]/g 2016-04-13 14:42:00 -07:00
78c9d526c3 change some log.Info to log.Debug 2016-03-29 11:37:51 -07:00
4baf007fb8 Merge pull request #2 from tendermint/develop
make some params configurable
2016-03-27 20:44:10 -07:00
82a411fca5 New TMSP message BeginBlock 2016-03-26 22:35:23 -07:00
121db71f48 Add ErrBaseUnknownPlugin 2016-03-24 14:17:48 -07:00
1dfc6950dd TMSPResult tweak 2016-03-24 11:27:04 -07:00
ccc55bd304 Add ErrUnknownAddress 2016-03-24 11:12:16 -07:00
062c33c109 TMSP Client is an interface 2016-03-24 10:42:25 -07:00
83fc4fc3b6 Allow late connecting 2016-03-23 21:07:03 -07:00
6785b9a3b6 CommitSync returns tmsp.Result 2016-03-23 02:50:29 -07:00
3f0d9b3f29 Signature bytes 2016-03-22 15:21:18 -07:00
5a3975d54a Add wire expression support 2016-03-22 15:18:03 -07:00
3d2d8c7d6a Result convenience methods; Shuffled Base* code types 2016-03-21 15:33:16 -07:00
82882bf7c2 bench by nblocks or ntxs 2016-03-21 16:34:52 -04:00
8cac8600e5 Return NewServer listener start error 2016-03-20 17:38:03 -07:00
06a0ac8188 Add NewError -> Result with no data 2016-03-20 17:20:41 -07:00
55e2ce9de2 Group (code,data,log) return values into types.Result 2016-03-20 17:10:13 -07:00
dcfa46af13 BitArray.IsEmpty() 2016-03-18 02:30:15 -04:00
eddde7f46a Added customized bcrypt 2016-03-17 20:37:30 -07:00
69c7ae5e3f version bump 2016-03-17 05:05:02 -04:00
114d90bec8 don't reallocate on recvMsgPacket 2016-03-17 05:05:02 -04:00
8152c18c35 Revert Address() scheme change 2016-03-15 15:58:43 -07:00
29a6d511b4 Add testutil; Clean gov return codes 2016-03-15 11:39:20 -07:00
9a95e7b7a5 Added Bytes() and *FromBytes() 2016-03-15 11:11:54 -07:00
185547efc1 Add ascii armor support 2016-03-13 14:00:27 -07:00
181aa56c87 Added symmetric encrypt/decrypt methods 2016-03-13 12:55:02 -07:00
f59fe0c8e0 s/Seed/MixEntropy/g 2016-03-13 10:14:24 -07:00
461c3b9785 Remove CRand* from go-common 2016-03-13 09:57:10 -07:00
10619248c6 Use go-crypto CRand* 2016-03-13 09:42:36 -07:00
264d2a3eef Add seed-able cryptographic random. 2016-03-13 09:40:15 -07:00
389e4b8b69 config: toggle authenticated encryption 2016-03-10 19:07:01 -05:00
61c34ade0d Remove BeginBlock 2016-03-06 18:01:37 -08:00
1bc871162d Conform to new go-config behavior; ApplyConfig not needed 2016-03-06 12:33:07 -08:00
84391b36d3 Conform to new go-config default config behavior 2016-03-06 12:31:22 -08:00
f28f791fff make some params configurable 2016-03-06 12:24:01 -08:00
36c25f242f s/InitValidators/InitChain/g, s/SyncValidators/EndBlock/g, added BeginBlock 2016-03-05 19:18:34 -08:00
7f6aad20fb Add note on nondeterminism of Broadcast 2016-03-04 22:04:05 -08:00
72540f9cac Fix tests to clean up after themselves 2016-02-29 21:53:04 -08:00
8b88496550 Merge branch 'validators' 2016-02-29 18:53:06 -08:00
dcabdad9b9 Implement Init/Sync Validators 2016-02-28 19:46:01 -08:00
1ffe780976 Initial update for Init/SyncValidators 2016-02-28 18:53:24 -08:00
f23822bf55 export NewReqRes 2016-02-27 07:02:34 +00:00
bb72373f30 support benchmarking txs 2016-02-27 00:31:28 -05:00
0925afcd18 app init script 2016-02-26 21:20:29 -05:00
500c173604 nil app 2016-02-26 20:04:28 -05:00
727fcd4ada get_hash -> commit; printResponse improvement 2016-02-23 13:36:18 -05:00
b2bd661a61 s/TMSPClient/Client/g 2016-02-21 23:55:45 -08:00
2c1aa7af2b s/StartListener/NewServer/g 2016-02-21 23:44:33 -08:00
1559ae1ac9 Add BitArray.Bytes() 2016-02-21 00:14:08 -08:00
1410693eae support unix domain websockets 2016-02-19 02:05:24 +00:00
74130008f7 deduplicate dialFunc 2016-02-19 00:20:20 +00:00
6607232a5d add support for unix sockets 2016-02-18 22:45:55 +00:00
90e38f08f4 Added counter test written in Golang 2016-02-14 14:59:53 -08:00
88fcacac7a s/GetHash/Commit/g 2016-02-14 13:11:06 -08:00
851b961daf Update README 2016-02-14 12:51:49 -08:00
089489cbf5 Merge branch 'blackstar' 2016-02-08 13:48:01 -08:00
b9499ad03e Implemented dummy query 2016-02-08 13:47:47 -08:00
adf0392e56 Callbacks for ReqRes 2016-02-08 13:30:30 -08:00
1370f89864 Fix bug in receiveEventsRoutine error handling 2016-02-08 02:20:34 -08:00
76ba23e4c0 Fix bug in GenPrivKeyEd25519FromSecret 2016-02-08 02:18:06 -08:00
8b7969d6ea Add comments about goroutine-safety 2016-02-08 00:58:12 -08:00
62550f474f Merge branch 'master' of https://github.com/tendermint/go-crypto 2016-02-08 00:53:00 -08:00
372191dd5f KeyString() in PubKey; Fix tests 2016-02-08 00:50:52 -08:00
2d5e1e8340 Callbacks for ReqRes 2016-02-08 00:50:00 -08:00
b35492d9e7 better response printing 2016-02-07 19:59:19 -08:00
75d31daacd update event meter 2016-02-07 14:08:09 -08:00
b6090ad183 fixes for mintnet types 2016-02-07 12:11:12 -08:00
cf0ad66d51 Compile new types.proto for new CodeType enums 2016-02-05 23:15:08 -08:00
4901b71ade SetLogLevel 2016-02-05 23:00:03 +00:00
2281bba708 Add two new CodeTypes 2016-02-03 01:58:23 -08:00
8b735b36be concurrent shutdown 2016-02-03 02:15:33 -05:00
9364accf1f service: start/stop logs are info, ignored are debug 2016-02-03 02:04:00 -05:00
45f57198cc client: wsc.String() 2016-02-03 02:01:28 -05:00
0825aa5d64 improve some logging 2016-02-02 23:04:54 -05:00
d52f690e56 reconnect validator 2016-02-02 20:21:16 -05:00
2b3fc11697 go vendor; track uptime, health 2016-02-02 16:20:07 -05:00
02022e356a make ignore already stopped service Debug 2016-02-02 16:19:46 -05:00
69e587f57f Use protobuf enums for RetCode. s/RetCode/CodeType/g 2016-01-31 20:39:43 -08:00
012abc437b Use protobuf enums 2016-01-31 19:56:02 -08:00
028cc4aa06 Query returns Code 2016-01-31 18:11:24 -08:00
e110a04ae2 Fix benchmark -- needed to flush 2016-01-30 19:44:04 -08:00
2936c68339 Convert TMSP to use Protobuf 2016-01-30 19:36:33 -08:00
6132ad7d6e Do not exit upon error, for tmsp-cli console 2016-01-29 16:06:39 -08:00
799ae4c006 Move js example to js-tmsp/example 2016-01-29 11:47:13 -08:00
bfbfb646b9 agpl 2016-01-27 10:59:01 -05:00
bb52f23ff6 use milliseconds 2016-01-27 10:59:01 -05:00
85874a3765 comments; fix locks 2016-01-27 10:58:54 -05:00
b21c6b5e5b s/logstr/logStr/g 2016-01-25 14:15:17 -08:00
9696a71f6e Log not error; Remove Listener TMSP messages...; Make counter BigEndian 2016-01-25 13:58:34 -08:00
c4b87dcf14 new_message 2016-01-23 20:49:15 -08:00
e2426d2944 Start TMSPClient automatically 2016-01-22 17:56:56 -08:00
53a8a40785 Swap Query return params 2016-01-22 16:18:35 -08:00
8ae0a0a481 Add Query; Add TMSPClient 2016-01-22 15:50:11 -08:00
ec8fd017a5 add setup.sh 2016-01-21 23:06:14 -05:00
b7be9208fd godep 2016-01-21 23:05:39 -05:00
fbc5ac8052 print method in client log 2016-01-21 23:03:39 -05:00
de1d5f6353 fixes; load from file with valsets and chains 2016-01-21 22:57:24 -05:00
b9eec7e438 version bump 2016-01-20 13:07:57 -05:00
9bc75eaf24 move DialSeeds in from tendermint/tendermint/node 2016-01-20 11:32:23 -05:00
3f812038a4 Add Query; Add benchmark tests 2016-01-18 14:37:42 -08:00
19f5a93cff Adjust Service log notice for duplicate stops 2016-01-18 13:19:11 -08:00
7b75ca7bb5 Remove SubscribeToEvent 2016-01-18 11:15:46 -08:00
0380e404bd Conform to go-wire version 0.6.0 2016-01-17 21:30:06 -08:00
ca259ce82a Conform to go-merkle version 0.2.0 2016-01-17 21:29:18 -08:00
a7878f1d0d Add basic test for level_db 2016-01-17 13:13:19 -08:00
1fb7234ff5 fix test 2016-01-16 13:49:16 -05:00
1af021846e fill in metrics 2016-01-15 23:41:31 -05:00
673e346ba4 some refactoring; fixes; readme 2016-01-15 17:01:01 -05:00
e8ffe6bb4c Remove AssertIsEventData; Remove EventResult 2016-01-14 11:01:44 -08:00
e6e9f3ac6b updates from go-rpc, go-event-meter 2016-01-13 22:19:45 -05:00
14735d5eb5 RawMessage fix 2016-01-13 22:16:56 -05:00
91c734d02e client: ResultsCh chan json.RawMessage, ErrorsCh 2016-01-13 21:21:16 -05:00
aff561d8c3 RPCResponse.Result is json.RawMessage 2016-01-13 18:37:35 -05:00
d835cfe3e7 refactor, fixes 2016-01-12 19:07:45 -05:00
a5f26a8999 EventResult 2016-01-12 18:35:42 -05:00
0bcae125c2 use comma separated string for arg names 2016-01-12 18:29:31 -05:00
44f22e351b Add RetCodeBadNonce and fix response formats 2016-01-12 14:06:31 -08:00
3d59e13dd8 move from tendermint/tendermint 2016-01-12 16:50:06 -05:00
089435d31b move from tendermint/tendermint 2016-01-12 16:21:43 -05:00
e85e2842a0 Initial commit 2016-01-12 16:13:26 -05:00
c52524a215 Initial commit 2016-01-12 15:26:00 -05:00
8dacd4172e Fix bug where Unset halts ThrottleTimer 2016-01-11 17:12:38 -08:00
1b8aacd2ee generic event meter 2016-01-10 14:49:09 -05:00
c58b1cbf8a Add ThrottleTimer.Unset 2016-01-10 08:12:10 -08:00
87b9866d1f Fix Makefile to get_deps then install 2016-01-09 19:05:41 -08:00
f15476b157 Remove TMSP Commit/Rollback; Add CheckTx 2016-01-08 17:07:19 -08:00
aa3e87450a fix tests 2016-01-08 16:06:33 -05:00
a24a364fb3 Initial commit 2016-01-07 20:00:43 -05:00
271a424d42 Merge pull request #7 from readevalprint/python3
Python3 example
2016-01-05 14:54:40 -08:00
57ce0c12e8 Merge pull request #6 from readevalprint/pep8
Python Pep8 style fixes
2016-01-05 14:54:12 -08:00
eece2ae7a5 use floor division 2016-01-05 22:37:22 +00:00
3092d2c043 missing modulename and fix refactoring 2016-01-05 22:00:19 +00:00
65a0156412 python3 example 2016-01-05 21:49:21 +00:00
8267f2ba4a Fix except/pass 2016-01-03 16:42:58 +00:00
06b48fe99f pep8 style fixes 2016-01-03 16:35:23 +00:00
1f2c1d0760 Fix prioritization logic; Add Status() 2016-01-03 06:20:18 -08:00
3abc18d7ba Add MConnection.Status() 2016-01-02 20:53:10 -08:00
ba01cfbb58 Remove spurious fmt.Print 2016-01-02 16:20:39 -08:00
1b7243a990 Update README to point to blog post only 2016-01-01 19:09:03 -08:00
0c4650f329 Update README.md
Added introduction by Zaki
2016-01-01 18:19:58 -08:00
980f02a500 Change license to Apache2.0 2015-12-23 14:19:50 -08:00
634527f5b6 Change license to Apache2.0 2015-12-23 14:18:53 -08:00
ea56ed5ea2 Change license to Apache2.0 2015-12-23 14:17:27 -08:00
b24269fefc Change license to Apache2.0 2015-12-23 14:16:29 -08:00
f592570310 Change license to Apache2.0 2015-12-23 14:14:41 -08:00
16e5e4e8c8 Change license format 2015-12-23 14:11:59 -08:00
0c9b9fe8bb Change license to Apache2.0 2015-12-23 14:08:39 -08:00
da1ef93cef Added link to tendermint.com blog post 2015-12-21 17:41:35 -08:00
20913c5e0e Add .pyc to gitignore; Fix js example 2015-12-21 17:23:05 -08:00
cf3b287245 Remove spurious tmsp_cli.go 2015-12-21 16:36:50 -08:00
13c50a5fdf Merge pull request #5 from tendermint/js
Length prefixed tmsp messages; counter app in javascript
2015-12-21 16:35:10 -08:00
844c4a519d Fix tmsp-cli to conform to go-wire new TypeByte behavior; Rename tmsp_cli to tmsp-cli 2015-12-21 16:18:41 -08:00
3fb3a81b92 fix js 2015-12-21 18:47:14 -05:00
dc75b71f55 tmsp_cli -> tmsp-cli 2015-12-21 18:12:38 -05:00
d560c1d455 example/js 2015-12-21 18:03:57 -05:00
b7b4109413 msg prefix python 2015-12-21 18:03:57 -05:00
44d8e62689 Confirm to go-wire new TypeByte behavior 2015-12-21 12:55:52 -08:00
2d9abb06ca Conform to new go-wire TypeByte behavior 2015-12-21 09:58:27 -08:00
3393fc34c2 Use wire.*LengthPrefixed 2015-12-20 09:16:05 -08:00
a357f3156a RetCodeEncodingError 2015-12-17 13:48:36 -08:00
4b67e9e9d2 Add Makefile 2015-12-17 13:46:04 -08:00
035966d273 Merge pull request #4 from tendermint/python
add counter app in python
2015-12-17 13:41:56 -08:00
36b7045f5c example/golang 2015-12-14 20:00:48 -05:00
af2a1a6fc1 python fixes, tests 2015-12-14 20:00:48 -05:00
bb4a58aa0a add counter app in python 2015-12-14 19:58:51 -05:00
8b308c1c08 Tweak send/recv rates for performance test 2015-12-09 13:53:50 -08:00
acdbd88e88 Add BypassHandler and NewBypass to bypass main filter 2015-12-09 09:38:40 -08:00
4a0469d3ec Make counter app use LittleEndian uint64 encoding 2015-12-08 21:52:40 -08:00
5c20d1b3e5 Add way to enforce serial order in counter app from command line 2015-12-08 21:12:11 -08:00
36e89b606e fix test 2015-12-05 17:52:40 +00:00
4347b91b89 Remove wrong comment 2015-12-05 09:48:08 -08:00
432a37857d Add RemoteAddr and ListenAddr to NodeInfo; Refactor IPRange logic 2015-12-05 09:44:03 -08:00
21abda0602 Make Counter app return nil hash initially 2015-12-04 01:01:07 -08:00
c37e25e76b Conform to go-common WriteFile*(path, mode) 2015-12-04 00:02:44 -08:00
3b50efbe02 WriteFile*() takes file mode 2015-12-03 23:56:50 -08:00
4b6741ca3b EnsureDir() takes file mode 2015-12-03 23:44:24 -08:00
7b1ebb9245 Update README.md 2015-12-03 15:47:20 -08:00
bbaacce472 Change server listener addr to 0.0.0.0 2015-12-02 00:25:39 -08:00
7931e2b9ca Change port 8080 to 46658 2015-12-01 15:27:50 -08:00
4fc7aa234f Merge pull request #3 from tendermint/console
tmsp cli enhancements and simple tests
2015-12-01 11:26:18 -08:00
3e721456f5 tmsp batch and some tests 2015-12-01 01:49:54 -05:00
86c2484c29 cmdInfo, cmdSetOption; append_tx can take hex 2015-11-30 23:49:18 -05:00
93308a3e6f interactive tmsp console 2015-11-30 20:56:36 -05:00
7448cdc154 Add serial=on option for CounterApplication 2015-11-30 15:22:42 -08:00
e3d88d2d79 Add ScanRightDeleteRandom test; Add GCRandom test 2015-11-30 12:59:05 -08:00
dbd04eadeb Remove CList, moved to go-clist 2015-11-29 21:23:33 -08:00
d939cd964b First commit of CList 2015-11-29 21:22:55 -08:00
6a5b804523 Refactor CounterApplication to implement AppContext 2015-11-29 14:34:15 -08:00
5d994944c6 Refactor Application to Application & AppContext 2015-11-29 14:22:30 -08:00
8b9df7d685 Merge pull request #2 from tendermint/cli
refactor dummy; flush tmsp reqs
2015-11-29 13:07:43 -08:00
fe782cb8ac server: allow multiple connections 2015-11-29 10:35:37 -05:00
c21c2ed69b counter example 2015-11-29 03:43:49 -05:00
2de72d26cf refactor dummy; flush tmsp reqs 2015-11-27 18:45:27 -05:00
80c7e26bee Fix memory-leak in CList; Patched with DetachPrev/DetachHead 2015-11-27 14:09:15 -08:00
76189fde0d Add Remove() implementation, CList is doubly-linked 2015-11-27 13:04:24 -08:00
e40c4834a8 Replace SetEventsMode with SetOption 2015-11-27 10:14:46 -08:00
9a72da4fcd Add .gitignore file 2015-11-27 09:57:08 -08:00
edf3abaf8f Merge pull request #1 from tendermint/retcode
retcode.Error() from go generate
2015-11-27 08:51:06 -08:00
32937f2815 Add Apache2.0 license 2015-11-27 08:51:49 -08:00
4d0eb1d95a retcode.Error() from go generate 2015-11-27 11:07:16 -05:00
c65e9e7d91 Added CList 2015-11-25 16:50:28 -08:00
201bf2374b Update README; Remove GetEvents() from Application 2015-11-16 15:50:26 -08:00
d319c5be0d Conform to go-wire 1.0 2015-11-10 12:49:07 -08:00
1c628a97ad Conform to go-wire 1.0 2015-11-10 12:29:43 -08:00
32b3a27a9a Conform to new go-wire 1.0 2015-11-10 11:53:35 -08:00
e8505a714b Handle RequestInfo in handleRequest 2015-11-09 18:17:00 -08:00
5aec38bdc6 Fix DummyyApplication usage bug; Should call New 2015-11-09 18:16:35 -08:00
cce812b1fa Remove retcode from echo; Add Info message 2015-11-09 16:29:45 -08:00
ef93c95853 Added new Flush request/response type 2015-11-08 15:18:58 -08:00
0bd4061cf6 initial commit 2015-11-07 20:42:02 -08:00
0424228e97 Added net.go Connect() 2015-11-05 15:00:42 -08:00
70b9a368ca ... 2015-11-05 14:21:33 -08:00
db87630689 initial commit 2015-11-05 10:54:58 -08:00
abc3a2cc3c initial commit 2015-10-25 18:21:51 -07:00
31a456c8d4 update package name 2015-10-25 13:45:13 -07:00
fcdea621bf first commit 2015-10-25 13:42:49 -07:00
b072ed3173 ... 2015-10-22 12:33:53 -07:00
28d39f8726 ... 2015-10-22 12:31:02 -07:00
6b54e7b8d9 Added License 2015-10-22 12:30:20 -07:00
cfeac977fd first commit 2015-10-21 18:19:14 -07:00
16372365c4 First commit 2015-10-21 12:15:19 -07:00
cca7078d47 Fix project name in LICENSE 2014-04-18 21:45:27 -04:00
3524264add Add LICENSE and README files 2014-04-18 20:43:33 -04:00
6a20af8766 Rename package to 'flowrate' 2014-04-18 20:41:01 -04:00
10e10fd81d Rename 'flowcontrol' directory 2014-04-18 20:32:46 -04:00
bec34fc8d7 Import flowcontrol package from Google Code 2014-04-18 20:31:57 -04:00
1100 changed files with 166867 additions and 12579 deletions

1550
.circleci/codecov.sh Normal file

File diff suppressed because it is too large Load Diff

421
.circleci/config.yml Normal file
View File

@ -0,0 +1,421 @@
version: 2
defaults: &defaults
working_directory: /go/src/github.com/tendermint/tendermint
docker:
- image: circleci/golang
environment:
GOBIN: /tmp/workspace/bin
docs_update_config: &docs_update_config
working_directory: ~/repo
docker:
- image: tendermintdev/jq_curl
environment:
AWS_REGION: us-east-1
release_management_docker: &release_management_docker
machine: true
jobs:
setup_dependencies:
<<: *defaults
steps:
- run: mkdir -p /tmp/workspace/bin
- run: mkdir -p /tmp/workspace/profiles
- checkout
- restore_cache:
keys:
- v4-pkg-cache
- run:
name: tools
command: |
export PATH="$GOBIN:$PATH"
make get_tools
- run:
name: binaries
command: |
export PATH="$GOBIN:$PATH"
make install install_abci
- persist_to_workspace:
root: /tmp/workspace
paths:
- bin
- profiles
- save_cache:
key: v4-pkg-cache
paths:
- /go/pkg
- save_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
paths:
- /go/src/github.com/tendermint/tendermint
build_slate:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: slate docs
command: |
set -ex
export PATH="$GOBIN:$PATH"
make build-slate
test_abci_apps:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Run abci apps tests
command: |
export PATH="$GOBIN:$PATH"
bash abci/tests/test_app/test.sh
# if this test fails, fix it and update the docs at:
# https://github.com/tendermint/tendermint/blob/develop/docs/abci-cli.md
test_abci_cli:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Run abci-cli tests
command: |
export PATH="$GOBIN:$PATH"
bash abci/tests/test_cli/test.sh
test_apps:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends bsdmainutils
- run:
name: Run tests
command: bash test/app/test.sh
test_cover:
<<: *defaults
parallelism: 4
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run: mkdir -p /tmp/logs
- run:
name: Run tests
command: |
for pkg in $(go list github.com/tendermint/tendermint/... | circleci tests split --split-by=timings); do
id=$(basename "$pkg")
GO111MODULE=on go test -v -timeout 5m -mod=readonly -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
done
- persist_to_workspace:
root: /tmp/workspace
paths:
- "profiles/*"
- store_artifacts:
path: /tmp/logs
test_persistence:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Run tests
command: bash test/persist/test_failure_indices.sh
localnet:
working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
machine:
image: circleci/classic:latest
environment:
GOBIN: /home/circleci/.go_workspace/bin
GOPATH: /home/circleci/.go_workspace/
GOOS: linux
GOARCH: amd64
parallelism: 1
steps:
- checkout
- run:
name: run localnet and exit on failure
command: |
set -x
docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux
make localnet-start &
./scripts/localnet-blocks-test.sh 40 5 10 localhost
test_p2p:
environment:
GOBIN: /home/circleci/.go_workspace/bin
GOPATH: /home/circleci/.go_workspace
machine:
image: circleci/classic:latest
steps:
- checkout
- run: mkdir -p $GOPATH/src/github.com/tendermint
- run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint
- run: bash test/p2p/circleci.sh
- store_artifacts:
path: /home/circleci/project/test/p2p/logs
upload_coverage:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v4-pkg-cache
- restore_cache:
key: v3-tree-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: gather
command: |
set -ex
echo "mode: atomic" > coverage.txt
for prof in $(ls /tmp/workspace/profiles/); do
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
done
- run:
name: upload
command: bash .circleci/codecov.sh -f coverage.txt
deploy_docs:
<<: *docs_update_config
steps:
- checkout
- run:
name: Trigger website build
command: |
curl --silent \
--show-error \
-X POST \
--header "Content-Type: application/json" \
-d "{\"branch\": \"$CIRCLE_BRANCH\"}" \
"https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$WEBSITE_REPO_NAME/build?circle-token=$TENDERBOT_API_TOKEN" > response.json
RESULT=`jq -r '.status' response.json`
MESSAGE=`jq -r '.message' response.json`
if [[ ${RESULT} == "null" ]] || [[ ${RESULT} -ne "200" ]]; then
echo "CircleCI API call failed: $MESSAGE"
exit 1
else
echo "Website build started"
fi
prepare_build:
<<: *defaults
steps:
- checkout
- run:
name: Get next release number
command: |
export LAST_TAG="`git describe --tags --abbrev=0 --match "${CIRCLE_BRANCH}.*"`"
echo "Last tag: ${LAST_TAG}"
if [ -z "${LAST_TAG}" ]; then
export LAST_TAG="${CIRCLE_BRANCH}"
echo "Last tag not found. Possibly fresh branch or feature branch. Setting ${LAST_TAG} as tag."
fi
export NEXT_TAG="`python -u scripts/release_management/bump-semver.py --version "${LAST_TAG}"`"
echo "Next tag: ${NEXT_TAG}"
echo "export CIRCLE_TAG=\"${NEXT_TAG}\"" > release-version.source
- run:
name: Build dependencies
command: |
make get_tools
- persist_to_workspace:
root: .
paths:
- "release-version.source"
- save_cache:
key: v2-release-deps-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
build_artifacts:
<<: *defaults
parallelism: 4
steps:
- checkout
- restore_cache:
keys:
- v2-release-deps-{{ checksum "go.sum" }}
- attach_workspace:
at: /tmp/workspace
- run:
name: Build artifact
command: |
# Setting CIRCLE_TAG because we do not tag the release ourselves.
source /tmp/workspace/release-version.source
if test ${CIRCLE_NODE_INDEX:-0} == 0 ;then export GOOS=linux GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
if test ${CIRCLE_NODE_INDEX:-0} == 1 ;then export GOOS=darwin GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
if test ${CIRCLE_NODE_INDEX:-0} == 2 ;then export GOOS=windows GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
if test ${CIRCLE_NODE_INDEX:-0} == 3 ;then export GOOS=linux GOARCH=arm && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
- persist_to_workspace:
root: build
paths:
- "*.zip"
- "tendermint_linux_amd64"
release_artifacts:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Deploy to GitHub
command: |
# Setting CIRCLE_TAG because we do not tag the release ourselves.
source /tmp/workspace/release-version.source
echo "---"
ls -la /tmp/workspace/*.zip
echo "---"
python -u scripts/release_management/sha-files.py
echo "---"
cat /tmp/workspace/SHA256SUMS
echo "---"
export RELEASE_ID="`python -u scripts/release_management/github-draft.py`"
echo "Release ID: ${RELEASE_ID}"
#Todo: Parallelize uploads
export GOOS=linux GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
export GOOS=darwin GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
export GOOS=windows GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
export GOOS=linux GOARCH=arm && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
python -u scripts/release_management/github-upload.py --file "/tmp/workspace/SHA256SUMS" --id "${RELEASE_ID}"
python -u scripts/release_management/github-publish.py --id "${RELEASE_ID}"
release_docker:
<<: *release_management_docker
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Deploy to Docker Hub
command: |
# Setting CIRCLE_TAG because we do not tag the release ourselves.
source /tmp/workspace/release-version.source
cp /tmp/workspace/tendermint_linux_amd64 DOCKER/tendermint
docker build --label="tendermint" --tag="tendermint/tendermint:${CIRCLE_TAG}" --tag="tendermint/tendermint:latest" "DOCKER"
docker login -u "${DOCKERHUB_USER}" --password-stdin <<< "${DOCKERHUB_PASS}"
docker push "tendermint/tendermint"
docker logout
reproducible_builds:
<<: *defaults
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build tendermint
no_output_timeout: 20m
command: |
sudo apt-get install -y ruby
bash -x ./scripts/gitian-build.sh all
for os in darwin linux windows; do
cp gitian-build-${os}/result/tendermint-${os}-res.yml .
cp gitian-build-${os}/build/out/tendermint-*.tar.gz .
rm -rf gitian-build-${os}/
done
- store_artifacts:
path: /go/src/github.com/tendermint/tendermint/tendermint-darwin-res.yml
- store_artifacts:
path: /go/src/github.com/tendermint/tendermint/tendermint-linux-res.yml
- store_artifacts:
path: /go/src/github.com/tendermint/tendermint/tendermint-windows-res.yml
- store_artifacts:
path: /go/src/github.com/tendermint/tendermint/tendermint-*.tar.gz
workflows:
version: 2
test-suite:
jobs:
- deploy_docs:
filters:
branches:
only:
- master
- setup_dependencies
- test_abci_apps:
requires:
- setup_dependencies
- test_abci_cli:
requires:
- setup_dependencies
- test_apps:
requires:
- setup_dependencies
- test_cover:
requires:
- setup_dependencies
- test_persistence:
requires:
- setup_dependencies
- localnet:
requires:
- setup_dependencies
- test_p2p
- upload_coverage:
requires:
- test_cover
- reproducible_builds:
filters:
branches:
only:
- master
- /v[0-9]+\.[0-9]+/
release:
jobs:
- prepare_build
- build_artifacts:
requires:
- prepare_build
- release_artifacts:
requires:
- prepare_build
- build_artifacts
filters:
branches:
only:
- /v[0-9]+\.[0-9]+/
- release_docker:
requires:
- prepare_build
- build_artifacts
filters:
branches:
only:
- /v[0-9]+\.[0-9]+/

View File

@ -1,21 +0,0 @@
#
# This codecov.yml is the default configuration for
# all repositories on Codecov. You may adjust the settings
# below in your own codecov.yml in your repository.
#
coverage:
precision: 2
round: down
range: 70...100
status:
# Learn more at https://codecov.io/docs#yaml_default_commit_status
project:
default:
threshold: 1% # allow this much decrease on project
changes: false
comment:
layout: "header, diff"
behavior: default # update if exists else create new

View File

@ -8,8 +8,9 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[Makefile]
[*.{sh,Makefile}]
indent_style = tab
[*.sh]
indent_style = tab
[*.proto]
indent_style = space
indent_size = 2

9
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,9 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
# Everything goes through Bucky, Anton, Alex. For now.
* @ebuchman @melekes @xla
# Precious documentation
/docs/README.md @zramsay
/docs/DOCS_README.md @zramsay
/docs/.vuepress/ @zramsay

View File

@ -1,41 +0,0 @@
<!-- Thanks for filing an issue! Before hitting the button, please answer these questions.-->
**Is this a BUG REPORT or FEATURE REQUEST?** (choose one):
<!--
If this is a BUG REPORT, please:
- Fill in as much of the template below as you can.
If this is a FEATURE REQUEST, please:
- Describe *in detail* the feature/behavior/change you'd like to see.
In both cases, be ready for followup questions, and please respond in a timely
manner. We might ask you to provide additional logs and data (tendermint & app)
in a case of bug.
-->
**Tendermint version** (use `tendermint version` or `git rev-parse --verify HEAD` if installed from source):
**ABCI app** (name for built-in, URL for self-written if it's publicly available):
**Merkleeyes version** (use `git rev-parse --verify HEAD`, skip if you don't use it):
**Environment**:
- **OS** (e.g. from /etc/os-release):
- **Install tools**:
- **Others**:
**What happened**:
**What you expected to happen**:
**How to reproduce it** (as minimally and precisely as possible):
**Anything else do we need to know**:

42
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@ -0,0 +1,42 @@
---
name: Bug Report
about: Create a report to help us squash bugs!
---
<!--
Please fill in as much of the template below as you can.
Be ready for followup questions, and please respond in a timely
manner. We might ask you to provide additional logs and data (tendermint & app).
-->
**Tendermint version** (use `tendermint version` or `git rev-parse --verify HEAD` if installed from source):
**ABCI app** (name for built-in, URL for self-written if it's publicly available):
**Environment**:
- **OS** (e.g. from /etc/os-release):
- **Install tools**:
- **Others**:
**What happened**:
**What you expected to happen**:
**Have you tried the latest version**: yes/no
**How to reproduce it** (as minimally and precisely as possible):
**Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file)**:
**Config (you can paste only the changes you've made)**:
**node command runtime flags**:
**`/dump_consensus_state` output for consensus bugs**
**Anything else we need to know**:

View File

@ -0,0 +1,13 @@
---
name: Feature Request
about: Create a proposal to request a feature
---
<!--
Please describe *in detail* the feature/behavior/change you'd like to see.
Be ready for followup questions, and please respond in a timely
manner.
Word of caution: poorly thought out proposals may be rejected without deliberation
-->

13
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,13 @@
<!--
Thanks for filing a PR! Before hitting the button, please check the following items.
Please note that every non-trivial PR must reference an issue that explains the
changes in the PR.
-->
* [ ] Referenced an issue explaining the need for the change
* [ ] Updated all relevant documentation in docs
* [ ] Updated all code comments where relevant
* [ ] Wrote tests
* [ ] Updated CHANGELOG_PENDING.md

35
.gitignore vendored
View File

@ -5,7 +5,6 @@
.DS_Store
build/*
rpc/test/.tendermint
.debora
.tendermint
remote_dump
.revision
@ -13,4 +12,36 @@ vendor
.vagrant
test/p2p/data/
test/logs
.glide
coverage.txt
docs/_build
docs/dist
*.log
abci-cli
docs/node_modules/
index.html.md
scripts/wal2json/wal2json
scripts/cutWALUntil/cutWALUntil
.idea/
*.iml
.vscode/
libs/pubsub/query/fuzz_test/output
shunit2
.tendermint-lite
addrbook.json
*/vendor
.vendor-new/
*/.glide
.terraform
terraform.tfstate
terraform.tfstate.backup
terraform.tfstate.d
.vscode
profile\.out

54
.golangci.yml Normal file
View File

@ -0,0 +1,54 @@
run:
deadline: 1m
linters:
enable-all: true
disable:
- gocyclo
- golint
- maligned
- errcheck
- interfacer
- unconvert
- goconst
- unparam
- nakedret
- lll
- gochecknoglobals
- gochecknoinits
- scopelint
- stylecheck
# linters-settings:
# govet:
# check-shadowing: true
# golint:
# min-confidence: 0
# gocyclo:
# min-complexity: 10
# maligned:
# suggest-new: true
# dupl:
# threshold: 100
# goconst:
# min-len: 2
# min-occurrences: 2
# depguard:
# list-type: blacklist
# packages:
# # logging is allowed only by logutils.Log, logrus
# # is allowed to use only in logutils package
# - github.com/sirupsen/logrus
# misspell:
# locale: US
# lll:
# line-length: 140
# goimports:
# local-prefixes: github.com/golangci/golangci-lint
# gocritic:
# enabled-tags:
# - performance
# - style
# - experimental
# disabled-checks:
# - wrapperFunc
# - commentFormatting # https://github.com/go-critic/go-critic/issues/755

File diff suppressed because it is too large Load Diff

29
CHANGELOG_PENDING.md Normal file
View File

@ -0,0 +1,29 @@
## v0.32.3
\*\*
Special thanks to external contributors on this release:
Friendly reminder, we have a [bug bounty
program](https://hackerone.com/tendermint).
### BREAKING CHANGES:
- CLI/RPC/Config
- Apps
- Go API
### FEATURES:
### IMPROVEMENTS:
- [privval] \#3370 Refactors and simplifies validator/kms connection handling. Please refer to thttps://github.com/tendermint/tendermint/pull/3370#issue-257360971
- [consensus] \#3839 Reduce "Error attempting to add vote" message severity (Error -> Info)
- [mempool] \#3877 Make `max_tx_bytes` configurable instead of `max_msg_bytes`
### BUG FIXES:
- [config] \#3868 move misplaced `max_msg_bytes` into mempool section
- [store] \#3893 register block amino, not just crypto

56
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,56 @@
# The Tendermint Code of Conduct
This code of conduct applies to all projects run by the Tendermint/COSMOS team and hence to tendermint.
----
# Conduct
## Contact: conduct@tendermint.com
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
* On Slack, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
* Please be kind and courteous. Theres no need to be mean or rude.
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we dont tolerate behavior that excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel admins or the person mentioned above immediately. Whether youre a regular contributor or a newcomer, we care about making this community a safe place for you and weve got your back.
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.
----
# Moderation
These are the policies for upholding our communitys standards of conduct. If you feel that a thread needs moderation, please contact the above mentioned person.
1. Remarks that violate the Tendermint/COSMOS standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
3. Moderators will first respond to such remarks with a warning.
4. If the warning is unheeded, the user will be “kicked,” i.e., kicked out of the communication channel to cool off.
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, in private. Complaints about bans in-channel are not allowed.
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.
In the Tendermint/COSMOS community we strive to go the extra step to look out for each other. Dont just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if theyre off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you couldve communicated better — remember that its your responsibility to make your fellow Cosmonauts comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
The enforcement policies listed above apply to all official Tendermint/COSMOS venues.For other projects adopting the Tendermint/COSMOS Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling), the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/) and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).

View File

@ -1,16 +1,185 @@
# Contributing guidelines
# Contributing
**Thanks for considering making contributions to Tendermint!**
Thank you for considering making contributions to Tendermint and related repositories! Start by taking a look at the [coding repo](https://github.com/tendermint/coding) for overall information on repository workflow and standards.
Please follow standard github best practices: fork the repo, **branch from the
tip of develop**, make some commits, test your code changes with `make test`,
and submit a pull request to develop.
Please follow standard github best practices: fork the repo, branch from the tip of `master`, make some commits, and submit a pull request to `master`.
See the [open issues](https://github.com/tendermint/tendermint/issues) for things we need help with!
See the [open issues](https://github.com/tendermint/tendermint/issues) for
things we need help with!
Before making a pull request, please open an issue describing the
change you would like to make. If an issue for your change already exists,
please comment on it that you will submit a pull request. Be sure to reference the issue in the opening
comment of your pull request. If your change is substantial, you will be asked
to write a more detailed design document in the form of an
Architectural Decision Record (ie. see [here](./docs/architecture/)) before submitting code
changes.
Please make sure to use `gofmt` before every commit - the easiest way to do
this is have your editor run it for you upon saving a file.
Please open a [Draft PR](https://github.blog/2019-02-14-introducing-draft-pull-requests/), even if your contribution is incomplete, this inidicates to the community you're working on something and allows them to provide comments early in the development process. When the code is complete it can be marked as ready-for-review.
You can read the full guide [on our
site](https://tendermint.com/docs/guides/contributing).
Please make sure to use `gofmt` before every commit - the easiest way to do this is have your editor run it for you upon saving a file. Additionally please ensure that your code is lint compliant by running `make lint`
## Forking
Please note that Go requires code to live under absolute paths, which complicates forking.
While my fork lives at `https://github.com/ebuchman/tendermint`,
the code should never exist at `$GOPATH/src/github.com/ebuchman/tendermint`.
Instead, we use `git remote` to add the fork as a new remote for the original repo,
`$GOPATH/src/github.com/tendermint/tendermint `, and do all the work there.
For instance, to create a fork and work on a branch of it, I would:
* Create the fork on github, using the fork button.
* Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/tendermint/tendermint`)
* `git remote rename origin upstream`
* `git remote add origin git@github.com:ebuchman/basecoin.git`
Now `origin` refers to my fork and `upstream` refers to the tendermint version.
So I can `git push -u origin master` to update my fork, and make pull requests to tendermint from there.
Of course, replace `ebuchman` with your git handle.
To pull in updates from the origin repo, run
* `git fetch upstream`
* `git rebase upstream/master` (or whatever branch you want)
## Dependencies
We use [go modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
That said, the master branch of every Tendermint repository should just build
with `go get`, which means they should be kept up-to-date with their
dependencies so we can get away with telling people they can just `go get` our
software.
Since some dependencies are not under our control, a third party may break our
build, in which case we can fall back on `go mod tidy`. Even for dependencies under our control, go helps us to
keep multiple repos in sync as they evolve. Anything with an executable, such
as apps, tools, and the core, should use dep.
Run `go list -u -m all` to get a list of dependencies that may not be
up-to-date.
When updating dependencies, please only update the particular dependencies you
need. Instead of running `go get -u=patch`, which will update anything,
specify exactly the dependency you want to update, eg.
`GO111MODULE=on go get -u github.com/tendermint/go-amino@master`.
## Vagrant
If you are a [Vagrant](https://www.vagrantup.com/) user, you can get started
hacking Tendermint with the commands below.
NOTE: In case you installed Vagrant in 2017, you might need to run
`vagrant box update` to upgrade to the latest `ubuntu/xenial64`.
```
vagrant up
vagrant ssh
make test
```
## Changelog
Every fix, improvement, feature, or breaking change should be made in a
pull-request that includes an update to the `CHANGELOG_PENDING.md` file.
Changelog entries should be formatted as follows:
```
- [module] \#xxx Some description about the change (@contributor)
```
Here, `module` is the part of the code that changed (typically a
top-level Go package), `xxx` is the pull-request number, and `contributor`
is the author/s of the change.
It's also acceptable for `xxx` to refer to the relevent issue number, but pull-request
numbers are preferred.
Note this means pull-requests should be opened first so the changelog can then
be updated with the pull-request's number.
There is no need to include the full link, as this will be added
automatically during release. But please include the backslash and pound, eg. `\#2313`.
Changelog entries should be ordered alphabetically according to the
`module`, and numerically according to the pull-request number.
Changes with multiple classifications should be doubly included (eg. a bug fix
that is also a breaking change should be recorded under both).
Breaking changes are further subdivided according to the APIs/users they impact.
Any change that effects multiple APIs/users should be recorded multiply - for
instance, a change to the `Blockchain Protocol` that removes a field from the
header should also be recorded under `CLI/RPC/Config` since the field will be
removed from the header in rpc responses as well.
## Branching Model and Release
The main development branch is master.
Every release is maintained in a release branch named `vX.Y.Z`.
Note all pull requests should be squash merged except for merging to a release branch (named `vX.Y`). This keeps the commit history clean and makes it
easy to reference the pull request where a change was introduced.
### Development Procedure
- the latest state of development is on `master`
- `master` must never fail `make test`
- never --force onto `master` (except when reverting a broken commit, which should seldom happen)
- create a development branch either on github.com/tendermint/tendermint, or your fork (using `git remote add origin`)
- make changes and update the `CHANGELOG_PENDING.md` to record your change
- before submitting a pull request, run `git rebase` on top of the latest `master`
### Pull Merge Procedure
- ensure pull branch is based on a recent `master`
- run `make test` to ensure that all tests pass
- squash merge pull request
- the `unstable` branch may be used to aggregate pull merges before fixing tests
### Release Procedure
#### Major Release
1. start on `master`
2. run integration tests (see `test_integrations` in Makefile)
3. prepare release in a pull request against `master` (to be squash merged):
- copy `CHANGELOG_PENDING.md` to top of `CHANGELOG.md`
- run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
all issues
- run `bash ./scripts/authors.sh` to get a list of authors since the latest
release, and add the github aliases of external contributors to the top of
the changelog. To lookup an alias from an email, try `bash
./scripts/authors.sh <email>`
- reset the `CHANGELOG_PENDING.md`
- bump versions
4. push your changes with prepared release details to `vX.X` (this will trigger the release `vX.X.0`)
5. merge back to master (don't squash merge!)
#### Minor Release
If there were no breaking changes and you need to create a release nonetheless,
the procedure is almost exactly like with a new release above.
The only difference is that in the end you create a pull request against the existing `X.X` branch.
The branch name should match the release number you want to create.
Merging this PR will trigger the next release.
For example, if the PR is against an existing 0.34 branch which already contains a v0.34.0 release/tag,
the patch version will be incremented and the created release will be v0.34.1.
#### Backport Release
1. start from the existing release branch you want to backport changes to (e.g. v0.30)
Branch to a release/vX.X.X branch locally (e.g. release/v0.30.7)
2. cherry pick the commit(s) that contain the changes you want to backport (usually these commits are from squash-merged PRs which were already reviewed)
3. steps 2 and 3 from [Major Release](#major-release)
4. push changes to release/vX.X.X branch
5. open a PR against the existing vX.X branch
## Testing
All repos should be hooked up to [CircleCI](https://circleci.com/).
If they have `.go` files in the root directory, they will be automatically
tested by circle using `go test -v -race ./...`. If not, they will need a
`circle.yml`. Ideally, every repo has a `Makefile` that defines `make test` and
includes its continuous integration status using a badge in the `README.md`.

1
DOCKER/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tendermint

View File

@ -1,46 +1,39 @@
FROM alpine:3.5
FROM alpine:3.9
LABEL maintainer="hello@tendermint.com"
# This is the release of tendermint to pull in.
ENV TM_VERSION 0.9.0
ENV TM_SHA256SUM 697033ea0f34f8b34a8a2b74c4dd730b47dd4efcfce65e53e953bdae8eb14364
# Tendermint will be looking for genesis file in /tendermint (unless you change
# `genesis_file` in config.toml). You can put your config.toml and private
# validator file into /tendermint.
# Tendermint will be looking for the genesis file in /tendermint/config/genesis.json
# (unless you change `genesis_file` in config.toml). You can put your config.toml and
# private validator file into /tendermint/config.
#
# The /tendermint/data dir is used by tendermint to store state.
ENV DATA_ROOT /tendermint
ENV TMHOME $DATA_ROOT
# Set user right away for determinism
RUN addgroup tmuser && \
adduser -S -G tmuser tmuser
# Create directory for persistence and give our user ownership
RUN mkdir -p $DATA_ROOT && \
chown -R tmuser:tmuser $DATA_ROOT
ENV TMHOME /tendermint
# OS environment setup
# Set user right away for determinism, create directory for persistence and give our user ownership
# jq and curl used for extracting `pub_key` from private validator while
# deploying tendermint with Kubernetes. It is nice to have bash so the users
# could execute bash commands.
RUN apk add --no-cache bash curl jq
RUN apk update && \
apk upgrade && \
apk --no-cache add curl jq bash && \
addgroup tmuser && \
adduser -S -G tmuser tmuser -h "$TMHOME"
RUN apk add --no-cache openssl && \
wget https://s3-us-west-2.amazonaws.com/tendermint/${TM_VERSION}/tendermint_${TM_VERSION}_linux_amd64.zip && \
echo "${TM_SHA256SUM} tendermint_${TM_VERSION}_linux_amd64.zip" | sha256sum -c && \
unzip -d /bin tendermint_${TM_VERSION}_linux_amd64.zip && \
apk del openssl && \
rm -f tendermint_${TM_VERSION}_linux_amd64.zip
# Run the container with tmuser by default. (UID=100, GID=1000)
USER tmuser
# Expose the data directory as a volume since there's mutable state in there
VOLUME $DATA_ROOT
VOLUME [ $TMHOME ]
# p2p port
EXPOSE 46656
# rpc port
EXPOSE 46657
WORKDIR $TMHOME
ENTRYPOINT ["tendermint"]
# p2p and rpc port
EXPOSE 26656 26657
ENTRYPOINT ["/usr/bin/tendermint"]
CMD ["node", "--moniker=`hostname`"]
STOPSIGNAL SIGTERM
ARG BINARY=tendermint
COPY $BINARY /usr/bin/tendermint
# By default you'll get the dummy app
CMD ["node", "--moniker=`hostname`", "--proxy_app=dummy"]

23
DOCKER/Dockerfile.abci Normal file
View File

@ -0,0 +1,23 @@
FROM golang:latest
RUN mkdir -p /go/src/github.com/tendermint/abci
WORKDIR /go/src/github.com/tendermint/abci
COPY Makefile /go/src/github.com/tendermint/abci/
# see make protoc for details on ldconfig
RUN make get_protoc && ldconfig
# killall is used in tests
RUN apt-get update && apt-get install -y \
psmisc \
&& rm -rf /var/lib/apt/lists/*
COPY Gopkg.toml /go/src/github.com/tendermint/abci/
COPY Gopkg.lock /go/src/github.com/tendermint/abci/
RUN make get_tools
# see https://github.com/golang/dep/issues/1312
RUN dep ensure -vendor-only
COPY . /go/src/github.com/tendermint/abci

View File

@ -1,35 +0,0 @@
FROM alpine:3.5
ENV DATA_ROOT /tendermint
ENV TMHOME $DATA_ROOT
RUN addgroup tmuser && \
adduser -S -G tmuser tmuser
RUN mkdir -p $DATA_ROOT && \
chown -R tmuser:tmuser $DATA_ROOT
RUN apk add --no-cache bash curl jq
ENV GOPATH /go
ENV PATH "$PATH:/go/bin"
RUN mkdir -p /go/src/github.com/tendermint/tendermint && \
apk add --no-cache go build-base git && \
cd /go/src/github.com/tendermint/tendermint && \
git clone https://github.com/tendermint/tendermint . && \
git checkout develop && \
make get_vendor_deps && \
make install && \
glide cc && \
cd - && \
rm -rf /go/src/github.com/tendermint/tendermint && \
apk del go build-base git
VOLUME $DATA_ROOT
EXPOSE 46656
EXPOSE 46657
ENTRYPOINT ["tendermint"]
CMD ["node", "--moniker=`hostname`", "--proxy_app=dummy"]

18
DOCKER/Dockerfile.testing Normal file
View File

@ -0,0 +1,18 @@
FROM golang:1.12
# Grab deps (jq, hexdump, xxd, killall)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
jq bsdmainutils vim-common psmisc netcat
# Add testing deps for curl
RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends curl
VOLUME /go
EXPOSE 26656
EXPOSE 26657

View File

@ -1,14 +1,15 @@
build:
# TAG=0.8.0 TAG_NO_PATCH=0.8
docker build -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .
@sh -c "'$(CURDIR)/build.sh'"
push:
# TAG=0.8.0 TAG_NO_PATCH=0.8
docker push "tendermint/tendermint" "tendermint/tendermint:$TAG" "tendermint/tendermint:$TAG_NO_PATCH"
@sh -c "'$(CURDIR)/push.sh'"
build_develop:
docker build -t "tendermint/tendermint:develop" -f Dockerfile.develop .
build_testing:
docker build --tag tendermint/testing -f ./Dockerfile.testing .
push_develop:
docker push "tendermint/tendermint:develop"

View File

@ -1,56 +1,64 @@
# Supported tags and respective `Dockerfile` links
# Docker
- `0.9.0`, `0.9`, `latest` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/d474baeeea6c22b289e7402449572f7c89ee21da/DOCKER/Dockerfile)
## Supported tags and respective `Dockerfile` links
- `0.17.1`, `latest` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/208ac32fa266657bd6c304e84ec828aa252bb0b8/DOCKER/Dockerfile)
- `0.15.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/170777300ea92dc21a8aec1abc16cb51812513a4/DOCKER/Dockerfile)
- `0.13.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/a28b3fff49dce2fb31f90abb2fc693834e0029c2/DOCKER/Dockerfile)
- `0.12.1` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/457c688346b565e90735431619ca3ca597ef9007/DOCKER/Dockerfile)
- `0.12.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/70d8afa6e952e24c573ece345560a5971bf2cc0e/DOCKER/Dockerfile)
- `0.11.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/9177cc1f64ca88a4a0243c5d1773d10fba67e201/DOCKER/Dockerfile)
- `0.10.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/e5342f4054ab784b2cd6150e14f01053d7c8deb2/DOCKER/Dockerfile)
- `0.9.1`, `0.9`, [(Dockerfile)](https://github.com/tendermint/tendermint/blob/809e0e8c5933604ba8b2d096803ada7c5ec4dfd3/DOCKER/Dockerfile)
- `0.9.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/d474baeeea6c22b289e7402449572f7c89ee21da/DOCKER/Dockerfile)
- `0.8.0`, `0.8` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/bf64dd21fdb193e54d8addaaaa2ecf7ac371de8c/DOCKER/Dockerfile)
- `develop` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/master/DOCKER/Dockerfile.develop)
`develop` tag points to the [develop](https://github.com/tendermint/tendermint/tree/develop) branch.
## Quick reference
# Tendermint
- **Where to get help:**
[cosmos.network/ecosystem](https://cosmos.network/ecosystem)
- **Where to file issues:**
[Tendermint Issues](https://github.com/tendermint/tendermint/issues)
- **Supported Docker versions:**
[the latest release](https://github.com/moby/moby/releases) (down to 1.6 on a best-effort basis)
## Tendermint
Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines.
For more background, see the [introduction](https://tendermint.com/intro).
For more background, see the [the docs](https://tendermint.com/docs/introduction/#quick-start).
To get started developing applications, see the [application developers guide](https://tendermint.com/docs/guides/app-development).
To get started developing applications, see the [application developers guide](https://tendermint.com/docs/introduction/quick-start.html).
# How to use this image
## How to use this image
## Start one instance of the Tendermint core with the `dummy` app
### Start one instance of the Tendermint core with the `kvstore` app
A very simple example of a built-in app and Tendermint core in one container.
A quick example of a built-in app and Tendermint core in one container.
```
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint node --proxy_app=kvstore
```
## mintnet-kubernetes
## Local cluster
If you want to see many containers talking to each other, consider using [mintnet-kubernetes](https://github.com/tendermint/mintnet-kubernetes), which is a tool for running Tendermint-based applications on a Kubernetes cluster.
To run a 4-node network, see the `Makefile` in the root of [the repo](https://github.com/tendermint/tendermint/blob/master/Makefile) and run:
# Supported Docker versions
```
make build-linux
make build-docker-localnode
make localnet-start
```
This image is officially supported on Docker version 1.13.1.
Note that this will build and use a different image than the ones provided here.
Support for older versions (down to 1.6) is provided on a best-effort basis.
## License
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
# License
View [license information](https://raw.githubusercontent.com/tendermint/tendermint/master/LICENSE) for the software contained in this image.
# User Feedback
## Issues
If you have any problems with or questions about this image, please contact us through a [GitHub](https://github.com/tendermint/tendermint/issues) issue. If the issue is related to a CVE, please check for [a `cve-tracker` issue on the `official-images` repository](https://github.com/docker-library/official-images/issues?q=label%3Acve-tracker) first.
You can also reach the image maintainers via [Slack](http://forum.tendermint.com:3000/).
- Tendermint's license is [Apache 2.0](https://github.com/tendermint/tendermint/blob/master/LICENSE).
## Contributing
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a [GitHub](https://github.com/tendermint/tendermint/issues) issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
Contributions are most welcome! See the [contributing file](https://github.com/tendermint/tendermint/blob/master/CONTRIBUTING.md) for more information.

20
DOCKER/build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
# Get the tag from the version, or try to figure it out.
if [ -z "$TAG" ]; then
TAG=$(awk -F\" '/TMCoreSemVer =/ { print $2; exit }' < ../version/version.go)
fi
if [ -z "$TAG" ]; then
echo "Please specify a tag."
exit 1
fi
TAG_NO_PATCH=${TAG%.*}
read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? y/n" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker build -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .
fi

22
DOCKER/push.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
# Get the tag from the version, or try to figure it out.
if [ -z "$TAG" ]; then
TAG=$(awk -F\" '/TMCoreSemVer =/ { print $2; exit }' < ../version/version.go)
fi
if [ -z "$TAG" ]; then
echo "Please specify a tag."
exit 1
fi
TAG_NO_PATCH=${TAG%.*}
read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? y/n" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker push "tendermint/tendermint:latest"
docker push "tendermint/tendermint:$TAG"
docker push "tendermint/tendermint:$TAG_NO_PATCH"
fi

View File

@ -1,57 +0,0 @@
# Install Go
[Install Go, set the `GOPATH`, and put `GOPATH/bin` on your `PATH`](https://github.com/tendermint/tendermint/wiki/Setting-GOPATH).
# Install Tendermint
You should be able to install the latest with a simple `go get -u github.com/tendermint/tendermint/cmd/tendermint`.
The `-u` makes sure all dependencies are updated as well.
Run `tendermint version` and `tendermint --help`.
If the install falied, see [vendored dependencies below](#vendored-dependencies).
To start a one-node blockchain with a simple in-process application:
```
tendermint init
tendermint node --proxy_app=dummy
```
See the [application developers guide](https://github.com/tendermint/tendermint/wiki/Application-Developers) for more details on building and running applications.
## Vendored dependencies
If the `go get` failed, updated dependencies may have broken the build.
Install the correct version of each dependency using `glide`.
Fist, install `glide`:
```
go get github.com/Masterminds/glide
```
Now, fetch the dependencies and install them with `glide` and `go`:
```
cd $GOPATH/src/github.com/tendermint/tendermint
glide install
go install ./cmd/tendermint
```
Sometimes `glide install` is painfully slow. Hang in there champ.
The latest Tendermint Core version is now installed. Check by running `tendermint version`.
## Troubleshooting
If `go get` failing bothers you, fetch the code using `git`:
```
mkdir -p $GOPATH/src/github.com/tendermint
git clone https://github.com/tendermint/tendermint $GOPATH/src/github.com/tendermint/tendermint
cd $GOPATH/src/github.com/tendermint/tendermint
glide install
go install ./cmd/tendermint
```

334
Makefile
View File

@ -1,74 +1,314 @@
GOTOOLS = \
github.com/mitchellh/gox \
github.com/Masterminds/glide
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
BUILD_TAGS?=tendermint
TMHOME = $${TMHOME:-$$HOME/.tendermint}
github.com/mitchellh/gox \
github.com/golangci/golangci-lint/cmd/golangci-lint \
github.com/gogo/protobuf/protoc-gen-gogo \
github.com/square/certstrap
GOBIN?=${GOPATH}/bin
PACKAGES=$(shell go list ./...)
OUTPUT?=build/tendermint
all: install test
export GO111MODULE = on
install: get_vendor_deps
@go install ./cmd/tendermint
INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf
BUILD_TAGS?='tendermint'
LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
all: check build test install
check: check_tools
########################################
### Build Tendermint
build:
go build -o build/tendermint ./cmd/tendermint
CGO_ENABLED=0 go build $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(OUTPUT) ./cmd/tendermint/
build_c:
CGO_ENABLED=1 go build $(BUILD_FLAGS) -tags "$(BUILD_TAGS) cleveldb" -o $(OUTPUT) ./cmd/tendermint/
build_race:
go build -race -o build/tendermint ./cmd/tendermint
CGO_ENABLED=0 go build -race $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(OUTPUT) ./cmd/tendermint
install:
CGO_ENABLED=0 go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint
install_c:
CGO_ENABLED=1 go install $(BUILD_FLAGS) -tags "$(BUILD_TAGS) cleveldb" ./cmd/tendermint
########################################
### Protobuf
protoc_all: protoc_libs protoc_merkle protoc_abci protoc_grpc protoc_proto3types
%.pb.go: %.proto
## If you get the following error,
## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
## See https://stackoverflow.com/a/25518702
## Note the $< here is substituted for the %.proto
## Note the $@ here is substituted for the %.pb.go
protoc $(INCLUDE) $< --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,plugins=grpc:.
########################################
### Build ABCI
# see protobuf section above
protoc_abci: abci/types/types.pb.go
protoc_proto3types: types/proto3/block.pb.go
build_abci:
@go build -mod=readonly -i ./abci/cmd/...
install_abci:
@go install -mod=readonly ./abci/cmd/...
########################################
### Distribution
# dist builds binaries for all platforms and packages them for distribution
# TODO add abci to these scripts
dist:
@BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"
@BUILD_TAGS=$(BUILD_TAGS) sh -c "'$(CURDIR)/scripts/dist.sh'"
test:
@echo "--> Running go test"
@go test $(PACKAGES)
########################################
### Tools & dependencies
test_race:
@echo "--> Running go test --race"
@go test -v -race $(PACKAGES)
check_tools:
@# https://stackoverflow.com/a/25668869
@echo "Found tools: $(foreach tool,$(notdir $(GOTOOLS)),\
$(if $(shell which $(tool)),$(tool),$(error "No $(tool) in PATH")))"
get_tools:
@echo "--> Installing tools"
./scripts/get_tools.sh
update_tools:
@echo "--> Updating tools"
./scripts/get_tools.sh
#For ABCI and libs
get_protoc:
@# https://github.com/google/protobuf/releases
curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gz | tar xvz && \
cd protobuf-3.6.1 && \
DIST_LANG=cpp ./configure && \
make && \
make check && \
sudo make install && \
sudo ldconfig && \
cd .. && \
rm -rf protobuf-3.6.1
draw_deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
get_deps_bin_size:
@# Copy of build recipe with additional flags to perform binary size analysis
$(eval $(shell go build -work -a $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(OUTPUT) ./cmd/tendermint/ 2>&1))
@find $(WORK) -type f -name "*.a" | xargs -I{} du -hxs "{}" | sort -rh | sed -e s:${WORK}/::g > deps_bin_size.log
@echo "Results can be found here: $(CURDIR)/deps_bin_size.log"
########################################
### Libs
protoc_libs: libs/common/types.pb.go
# generates certificates for TLS testing in remotedb and RPC server
gen_certs: clean_certs
certstrap init --common-name "tendermint.com" --passphrase ""
certstrap request-cert --common-name "remotedb" -ip "127.0.0.1" --passphrase ""
certstrap sign "remotedb" --CA "tendermint.com" --passphrase ""
mv out/remotedb.crt libs/db/remotedb/test.crt
mv out/remotedb.key libs/db/remotedb/test.key
certstrap request-cert --common-name "server" -ip "127.0.0.1" --passphrase ""
certstrap sign "server" --CA "tendermint.com" --passphrase ""
mv out/server.crt rpc/lib/server/test.crt
mv out/server.key rpc/lib/server/test.key
rm -rf out
# deletes generated certificates
clean_certs:
rm -f libs/db/remotedb/test.crt
rm -f libs/db/remotedb/test.key
rm -f rpc/lib/server/test.crt
rm -f rpc/lib/server/test.key
test_libs:
go test -tags clevedb boltdb $(PACKAGES)
grpc_dbserver:
protoc -I libs/db/remotedb/proto/ libs/db/remotedb/proto/defs.proto --go_out=plugins=grpc:libs/db/remotedb/proto
protoc_grpc: rpc/grpc/types.pb.go
protoc_merkle: crypto/merkle/merkle.pb.go
########################################
### Testing
## required to be run first by most tests
build_docker_test_image:
docker build -t tester -f ./test/docker/Dockerfile .
### coverage, app, persistence, and libs tests
test_cover:
# run the go unit tests with coverage
bash test/test_cover.sh
test_apps:
# run the app tests using bash
# requires `abci-cli` and `tendermint` binaries installed
bash test/app/test.sh
test_abci_apps:
bash abci/tests/test_app/test.sh
test_abci_cli:
# test the cli against the examples in the tutorial at:
# ./docs/abci-cli.md
# if test fails, update the docs ^
@ bash abci/tests/test_cli/test.sh
test_persistence:
# run the persistence tests using bash
# requires `abci-cli` installed
docker run --name run_persistence -t tester bash test/persist/test_failure_indices.sh
# TODO undockerize
# bash test/persist/test_failure_indices.sh
test_p2p:
docker rm -f rsyslog || true
rm -rf test/logs || true
mkdir test/logs
cd test/
docker run -d -v "logs:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
cd ..
# requires 'tester' the image from above
bash test/p2p/test.sh tester
# the `docker cp` takes a really long time; uncomment for debugging
#
# mkdir -p test/p2p/logs && docker cp rsyslog:/var/log test/p2p/logs
test_integrations:
@bash ./test/test.sh
make build_docker_test_image
make get_tools
make install
make test_cover
make test_apps
make test_abci_apps
make test_abci_cli
make test_libs
make test_persistence
make test_p2p
test_release:
@go test -tags release $(PACKAGES)
test100:
@for i in {1..100}; do make test; done
draw_deps:
# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
vagrant_test:
vagrant up
vagrant ssh -c 'make test_integrations'
list_deps:
@go list -f '{{join .Deps "\n"}}' ./... | \
grep -v /vendor/ | sort | uniq | \
xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
### go tests
test:
@echo "--> Running go test"
@go test -p 1 $(PACKAGES)
get_deps:
@echo "--> Running go get"
@go get -v -d $(PACKAGES)
@go list -f '{{join .TestImports "\n"}}' ./... | \
grep -v /vendor/ | sort | uniq | \
xargs go get -v -d
test_race:
@echo "--> Running go test --race"
@go test -p 1 -v -race $(PACKAGES)
get_vendor_deps: ensure_tools
@rm -rf vendor/
@echo "--> Running glide install"
@glide install
# uses https://github.com/sasha-s/go-deadlock/ to detect potential deadlocks
test_with_deadlock:
make set_with_deadlock
make test
make cleanup_after_test_with_deadlock
update_deps: tools
@echo "--> Updating dependencies"
@go get -d -u ./...
set_with_deadlock:
find . -name "*.go" | grep -v "vendor/" | xargs -n 1 sed -i.bak 's/sync.RWMutex/deadlock.RWMutex/'
find . -name "*.go" | grep -v "vendor/" | xargs -n 1 sed -i.bak 's/sync.Mutex/deadlock.Mutex/'
find . -name "*.go" | grep -v "vendor/" | xargs -n 1 goimports -w
revision:
-echo `git rev-parse --verify HEAD` > $(TMHOME)/revision
-echo `git rev-parse --verify HEAD` >> $(TMHOME)/revision_history
# cleanes up after you ran test_with_deadlock
cleanup_after_test_with_deadlock:
find . -name "*.go" | grep -v "vendor/" | xargs -n 1 sed -i.bak 's/deadlock.RWMutex/sync.RWMutex/'
find . -name "*.go" | grep -v "vendor/" | xargs -n 1 sed -i.bak 's/deadlock.Mutex/sync.Mutex/'
find . -name "*.go" | grep -v "vendor/" | xargs -n 1 goimports -w
tools:
go get -u -v $(GOTOOLS)
########################################
### Formatting, linting, and vetting
ensure_tools:
go get $(GOTOOLS)
fmt:
@go fmt ./...
lint:
@echo "--> Running linter"
@golangci-lint run
.PHONY: install build build_race dist test test_race test_integrations test100 draw_deps list_deps get_deps get_vendor_deps update_deps revision tools
DESTINATION = ./index.html.md
rpc-docs:
cat rpc/core/slate_header.txt > $(DESTINATION)
godoc2md -template rpc/core/doc_template.txt github.com/tendermint/tendermint/rpc/core | grep -v -e "pipe.go" -e "routes.go" -e "dev.go" | sed 's,/src/target,https://github.com/tendermint/tendermint/tree/master/rpc/core,' >> $(DESTINATION)
###########################################################
### Docker image
build-docker:
cp $(OUTPUT) DOCKER/tendermint
docker build --label=tendermint --tag="tendermint/tendermint" DOCKER
rm -rf DOCKER/tendermint
###########################################################
### Local testnet using docker
# Build linux binary on other platforms
build-linux: get_tools
GOOS=linux GOARCH=amd64 $(MAKE) build
build-docker-localnode:
@cd networks/local && make
# Run a 4-node testnet locally
localnet-start: localnet-stop build-docker-localnode
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --config /etc/tendermint/config-template.toml --v 4 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2; fi
docker-compose up
# Stop testnet
localnet-stop:
docker-compose down
###########################################################
### Remote full-nodes (sentry) using terraform and ansible
# Server management
sentry-start:
@if [ -z "$(DO_API_TOKEN)" ]; then echo "DO_API_TOKEN environment variable not set." ; false ; fi
@if ! [ -f $(HOME)/.ssh/id_rsa.pub ]; then ssh-keygen ; fi
cd networks/remote/terraform && terraform init && terraform apply -var DO_API_TOKEN="$(DO_API_TOKEN)" -var SSH_KEY_FILE="$(HOME)/.ssh/id_rsa.pub"
@if ! [ -f $(CURDIR)/build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 0 --n 4 --o . ; fi
cd networks/remote/ansible && ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/digital_ocean.py -l sentrynet install.yml
@echo "Next step: Add your validator setup in the genesis.json and config.tml files and run \"make sentry-config\". (Public key of validator, chain ID, peer IP and node ID.)"
# Configuration management
sentry-config:
cd networks/remote/ansible && ansible-playbook -i inventory/digital_ocean.py -l sentrynet config.yml -e BINARY=$(CURDIR)/build/tendermint -e CONFIGDIR=$(CURDIR)/build
sentry-stop:
@if [ -z "$(DO_API_TOKEN)" ]; then echo "DO_API_TOKEN environment variable not set." ; false ; fi
cd networks/remote/terraform && terraform destroy -var DO_API_TOKEN="$(DO_API_TOKEN)" -var SSH_KEY_FILE="$(HOME)/.ssh/id_rsa.pub"
# meant for the CI, inspect script & adapt accordingly
build-slate:
bash scripts/slate.sh
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: check build build_race build_abci dist install install_abci check_tools get_tools update_tools draw_deps get_protoc protoc_abci protoc_libs gen_certs clean_certs grpc_dbserver test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt rpc-docs build-linux localnet-start localnet-stop build-docker build-docker-localnode sentry-start sentry-config sentry-stop build-slate protoc_grpc protoc_all build_c install_c test_with_deadlock cleanup_after_test_with_deadlock lint

158
PHILOSOPHY.md Normal file
View File

@ -0,0 +1,158 @@
## Design goals
The design goals for Tendermint (and the SDK and related libraries) are:
* Simplicity and Legibility
* Parallel performance, namely ability to utilize multicore architecture
* Ability to evolve the codebase bug-free
* Debuggability
* Complete correctness that considers all edge cases, esp in concurrency
* Future-proof modular architecture, message protocol, APIs, and encapsulation
### Justification
Legibility is key to maintaining bug-free software as it evolves toward more
optimizations, more ease of debugging, and additional features.
It is too easy to introduce bugs over time by replacing lines of code with
those that may panic, which means ideally locks are unlocked by defer
statements.
For example,
```go
func (obj *MyObj) something() {
mtx.Lock()
obj.something = other
mtx.Unlock()
}
```
It is too easy to refactor the codebase in the future to replace `other` with
`other.String()` for example, and this may introduce a bug that causes a
deadlock. So as much as reasonably possible, we need to be using defer
statements, even though it introduces additional overhead.
If it is necessary to optimize the unlocking of mutex locks, the solution is
more modularity via smaller functions, so that defer'd unlocks are scoped
within a smaller function.
Similarly, idiomatic for-loops should always be preferred over those that use
custom counters, because it is too easy to evolve the body of a for-loop to
become more complicated over time, and it becomes more and more difficult to
assess the correctness of such a for-loop by visual inspection.
### On performance
It doesn't matter whether there are alternative implementations that are 2x or
3x more performant, when the software doesn't work, deadlocks, or if bugs
cannot be debugged. By taking advantage of multicore concurrency, the
Tendermint implementation will at least be an order of magnitude within the
range of what is theoretically possible. The design philosophy of Tendermint,
and the choice of Go as implementation language, is designed to make Tendermint
implementation the standard specification for concurrent BFT software.
By focusing on the message protocols (e.g. ABCI, p2p messages), and
encapsulation e.g. IAVL module, (relatively) independent reactors, we are both
implementing a standard implementation to be used as the specification for
future implementations in more optimizable languages like Rust, Java, and C++;
as well as creating sufficiently performant software. Tendermint Core will
never be as fast as future implementations of the Tendermint Spec, because Go
isn't designed to be as fast as possible. The advantage of using Go is that we
can develop the whole stack of modular components **faster** than in other
languages.
Furthermore, the real bottleneck is in the application layer, and it isn't
necessary to support more than a sufficiently decentralized set of validators
(e.g. 100 ~ 300 validators is sufficient, with delegated bonded PoS).
Instead of optimizing Tendermint performance down to the metal, lets focus on
optimizing on other matters, namely ability to push feature complete software
that works well enough, can be debugged and maintained, and can serve as a spec
for future implementations.
### On encapsulation
In order to create maintainable, forward-optimizable software, it is critical
to develop well-encapsulated objects that have well understood properties, and
to re-use these easy-to-use-correctly components as building blocks for further
encapsulated meta-objects.
For example, mutexes are cheap enough for Tendermint's design goals when there
isn't goroutine contention, so it is encouraged to create concurrency safe
structures with struct-level mutexes. If they are used in the context of
non-concurrent logic, then the performance is good enough. If they are used in
the context of concurrent logic, then it will still perform correctly.
Examples of this design principle can be seen in the types.ValidatorSet struct,
and the cmn.Rand struct. It's one single struct declaration that can be used
in both concurrent and non-concurrent logic, and due to its well encapsulation,
it's easy to get the usage of the mutex right.
#### example: cmn.Rand:
`The default Source is safe for concurrent use by multiple goroutines, but
Sources created by NewSource are not`. The reason why the default
package-level source is safe for concurrent use is because it is protected (see
`lockedSource` in https://golang.org/src/math/rand/rand.go).
But we shouldn't rely on the global source, we should be creating our own
Rand/Source instances and using them, especially for determinism in testing.
So it is reasonable to have cmn.Rand be protected by a mutex. Whether we want
our own implementation of Rand is another question, but the answer there is
also in the affirmative. Sometimes you want to know where Rand is being used
in your code, so it becomes a simple matter of dropping in a log statement to
inject inspectability into Rand usage. Also, it is nice to be able to extend
the functionality of Rand with custom methods. For these reasons, and for the
reasons which is outlined in this design philosophy document, we should
continue to use the cmn.Rand object, with mutex protection.
Another key aspect of good encapsulation is the choice of exposed vs unexposed
methods. It should be clear to the reader of the code, which methods are
intended to be used in what context, and what safe usage is. Part of this is
solved by hiding methods via unexported methods. Another part of this is
naming conventions on the methods (e.g. underscores) with good documentation,
and code organization. If there are too many exposed methods and it isn't
clear what methods have what side effects, then there is something wrong about
the design of abstractions that should be revisited.
### On concurrency
In order for Tendermint to remain relevant in the years to come, it is vital
for Tendermint to take advantage of multicore architectures. Due to the nature
of the problem, namely consensus across a concurrent p2p gossip network, and to
handle RPC requests for a large number of consuming subscribers, it is
unavoidable for Tendermint development to require expertise in concurrency
design, especially when it comes to the reactor design, and also for RPC
request handling.
## Guidelines
Here are some guidelines for designing for (sufficient) performance and concurrency:
* Mutex locks are cheap enough when there isn't contention.
* Do not optimize code without analytical or observed proof that it is in a hot path.
* Don't over-use channels when mutex locks w/ encapsulation are sufficient.
* The need to drain channels are often a hint of unconsidered edge cases.
* The creation of O(N) one-off goroutines is generally technical debt that
needs to get addressed sooner than later. Avoid creating too many
goroutines as a patch around incomplete concurrency design, or at least be
aware of the debt and do not invest in the debt. On the other hand, Tendermint
is designed to have a limited number of peers (e.g. 10 or 20), so the creation
of O(C) goroutines per O(P) peers is still O(C\*P=constant).
* Use defer statements to unlock as much as possible. If you want to unlock sooner,
try to create more modular functions that do make use of defer statements.
## Matras
* Premature optimization kills
* Readability is paramount
* Beautiful is better than fast.
* In the face of ambiguity, refuse the temptation to guess.
* In the face of bugs, refuse the temptation to cover the bug.
* There should be one-- and preferably only one --obvious way to do it.

167
README.md
View File

@ -1,71 +1,162 @@
# Tendermint
![banner](docs/tendermint-core-image.jpg)
[Byzantine-Fault Tolerant](https://en.wikipedia.org/wiki/Byzantine_fault_tolerance)
[State Machine Replication](https://en.wikipedia.org/wiki/State_machine_replication).
Or [Blockchain](https://en.wikipedia.org/wiki/Blockchain_(database)) for short.
[State Machines](https://en.wikipedia.org/wiki/State_machine_replication).
Or [Blockchain](<https://en.wikipedia.org/wiki/Blockchain_(database)>), for short.
[![version](https://img.shields.io/github/tag/tendermint/tendermint.svg)](https://github.com/tendermint/tendermint/releases/latest)
[![API Reference](
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
)](https://godoc.org/github.com/tendermint/tendermint)
[![chat](https://img.shields.io/badge/slack-join%20chat-pink.svg)](http://forum.tendermint.com:3000/)
[![API Reference](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667)](https://godoc.org/github.com/tendermint/tendermint)
[![Go version](https://img.shields.io/badge/go-1.12.0-blue.svg)](https://github.com/moovweb/gvm)
[![riot.im](https://img.shields.io/badge/riot.im-JOIN%20CHAT-green.svg)](https://riot.im/app/#/room/#tendermint:matrix.org)
[![license](https://img.shields.io/github/license/tendermint/tendermint.svg)](https://github.com/tendermint/tendermint/blob/master/LICENSE)
[![](https://tokei.rs/b1/github/tendermint/tendermint?category=lines)](https://github.com/tendermint/tendermint)
| Branch | Tests | Coverage |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| master | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/master.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/master) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/master/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) |
Branch | Tests | Coverage | Report Card
----------|-------|----------|-------------
develop | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/develop.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/develop) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/develop/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) | [![Go Report Card](https://goreportcard.com/badge/github.com/tendermint/tendermint/tree/develop)](https://goreportcard.com/report/github.com/tendermint/tendermint/tree/develop)
master | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/master.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/master) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/master/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) | [![Go Report Card](https://goreportcard.com/badge/github.com/tendermint/tendermint/tree/master)](https://goreportcard.com/report/github.com/tendermint/tendermint/tree/master)
_NOTE: This is alpha software. Please contact us if you intend to run it in production._
Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language,
Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine - written in any programming language -
and securely replicates it on many machines.
For more background, see the [introduction](https://tendermint.com/intro).
For protocol details, see [the specification](/docs/spec).
To get started developing applications, see the [application developers guide](https://tendermint.com/docs/guides/app-development).
For detailed analysis of the consensus protocol, including safety and liveness proofs,
see our recent paper, "[The latest gossip on BFT consensus](https://arxiv.org/abs/1807.04938)".
## Install
## Releases
To download pre-built binaries, see our [downloads page](https://tendermint.com/intro/getting-started/download).
NOTE: The master branch is now an active development branch (starting with `v0.32`). Please, do not depend on it and
use [releases](https://github.com/tendermint/tendermint/releases) instead.
To install from source, you should be able to:
Tendermint is being used in production in both private and public environments,
most notably the blockchains of the [Cosmos Network](https://cosmos.network/).
However, we are still making breaking changes to the protocol and the APIs and have not yet released v1.0.
See below for more details about [versioning](#versioning).
`go get -u github.com/tendermint/tendermint/cmd/tendermint`
In any case, if you intend to run Tendermint in production,
please [contact us](mailto:partners@tendermint.com) and [join the chat](https://riot.im/app/#/room/#tendermint:matrix.org).
For more details (or if it fails), see the [install guide](https://tendermint.com/docs/guides/install).
## Security
To report a security vulnerability, see our [bug bounty
program](https://hackerone.com/tendermint)
For examples of the kinds of bugs we're looking for, see [SECURITY.md](SECURITY.md)
## Minimum requirements
| Requirement | Notes |
| ----------- | ------------------ |
| Go version | Go1.11.4 or higher |
## Documentation
Complete documentation can be found on the [website](https://tendermint.com/docs/).
### Install
See the [install instructions](/docs/introduction/install.md)
### Quick Start
- [Single node](/docs/introduction/quick-start.md)
- [Local cluster using docker-compose](/docs/networks/docker-compose.md)
- [Remote cluster using terraform and ansible](/docs/networks/terraform-and-ansible.md)
- [Join the Cosmos testnet](https://cosmos.network/testnet)
## Contributing
Yay open source! Please see our [contributing guidelines](https://tendermint.com/docs/guides/contributing).
Please abide by the [Code of Conduct](CODE_OF_CONDUCT.md) in all interactions,
and the [contributing guidelines](CONTRIBUTING.md) when submitting code.
Join the larger community on the [forum](https://forum.cosmos.network/) and the [chat](https://riot.im/app/#/room/#tendermint:matrix.org).
To learn more about the structure of the software, watch the [Developer
Sessions](https://www.youtube.com/playlist?list=PLdQIb0qr3pnBbG5ZG-0gr3zM86_s8Rpqv)
and read some [Architectural
Decision Records](https://github.com/tendermint/tendermint/tree/master/docs/architecture).
Learn more by reading the code and comparing it to the
[specification](https://github.com/tendermint/tendermint/tree/develop/docs/spec).
## Versioning
### Semantic Versioning
Tendermint uses [Semantic Versioning](http://semver.org/) to determine when and how the version changes.
According to SemVer, anything in the public API can change at any time before version 1.0.0
To provide some stability to Tendermint users in these 0.X.X days, the MINOR version is used
to signal breaking changes across a subset of the total public API. This subset includes all
interfaces exposed to other processes (cli, rpc, p2p, etc.), but does not
include the in-process Go APIs.
That said, breaking changes in the following packages will be documented in the
CHANGELOG even if they don't lead to MINOR version bumps:
- crypto
- types
- rpc/client
- config
- node
- libs
- bech32
- common
- db
- errors
- log
Exported objects in these packages that are not covered by the versioning scheme
are explicitly marked by `// UNSTABLE` in their go doc comment and may change at any
time without notice. Functions, types, and values in any other package may also change at any time.
### Upgrades
In an effort to avoid accumulating technical debt prior to 1.0.0,
we do not guarantee that breaking changes (ie. bumps in the MINOR version)
will work with existing tendermint blockchains. In these cases you will
have to start a new blockchain, or write something custom to get the old
data into the new chain.
However, any bump in the PATCH version should be compatible with existing histories
(if not please open an [issue](https://github.com/tendermint/tendermint/issues)).
For more information on upgrading, see [UPGRADING.md](./UPGRADING.md)
## Resources
### Tendermint Core
- [Introduction](https://tendermint.com/intro)
- [Docs](https://tendermint.com/docs)
- [Software using Tendermint](https://tendermint.com/ecosystem)
For details about the blockchain data structures and the p2p protocols, see the
[Tendermint specification](/docs/spec).
For details on using the software, see the [documentation](/docs/) which is also
hosted at: https://tendermint.com/docs/
### Tools
Benchmarking and monitoring is provided by `tm-bench` and `tm-monitor`, respectively.
Their code is found [here](/tools) and these binaries need to be built seperately.
Additional documentation is found [here](/docs/tools).
### Sub-projects
* [ABCI](http://github.com/tendermint/abci)
* [Mintnet](http://github.com/tendermint/mintnet)
* [Go-Wire](http://github.com/tendermint/go-wire)
* [Go-P2P](http://github.com/tendermint/go-p2p)
* [Go-Merkle](http://github.com/tendermint/go-merkle)
- [Amino](http://github.com/tendermint/go-amino), reflection-based proto3, with
interfaces
- [IAVL](http://github.com/tendermint/iavl), Merkleized IAVL+ Tree implementation
- [Tm-cmn](http://github.com/tendermint/tm-cmn), Commonly used libs across Tendermint & Cosmos repos
### Applications
* [Ethermint](http://github.com/tendermint/ethermint)
* [Basecoin](http://github.com/tendermint/basecoin)
- [Cosmos SDK](http://github.com/cosmos/cosmos-sdk); a cryptocurrency application framework
- [Ethermint](http://github.com/cosmos/ethermint); Ethereum on Tendermint
- [Many more](https://tendermint.com/ecosystem)
### More
* [Tendermint Blog](https://tendermint.com/blog)
* [Cosmos Blog](https://cosmos.network/blog)
* [Original Whitepaper (out-of-date)](http://www.the-blockchain.com/docs/Tendermint%20Consensus%20without%20Mining.pdf)
* [Master's Thesis on Tendermint](https://atrium.lib.uoguelph.ca/xmlui/handle/10214/9769)
### Research
- [The latest gossip on BFT consensus](https://arxiv.org/abs/1807.04938)
- [Master's Thesis on Tendermint](https://atrium.lib.uoguelph.ca/xmlui/handle/10214/9769)
- [Original Whitepaper](https://tendermint.com/static/docs/tendermint.pdf)
- [Blog](https://blog.cosmos.network/tendermint/home)

23
ROADMAP.md Normal file
View File

@ -0,0 +1,23 @@
# Roadmap
BREAKING CHANGES:
- Better support for injecting randomness
- Upgrade consensus for more real-time use of evidence
FEATURES:
- Use the chain as its own CA for nodes and validators
- Tooling to run multiple blockchains/apps, possibly in a single process
- State syncing (without transaction replay)
- Add authentication and rate-limitting to the RPC
IMPROVEMENTS:
- Improve subtleties around mempool caching and logic
- Consensus optimizations:
- cache block parts for faster agreement after round changes
- propagate block parts rarest first
- Better testing of the consensus state machine (ie. use a DSL)
- Auto compiled serialization/deserialization code instead of go-wire reflection
BUG FIXES:
- Graceful handling/recovery for apps that have non-determinism or fail to halt
- Graceful handling/recovery for violations of safety, or liveness

72
SECURITY.md Normal file
View File

@ -0,0 +1,72 @@
# Security
As part of our [Coordinated Vulnerability Disclosure
Policy](https://tendermint.com/security), we operate a [bug
bounty](https://hackerone.com/tendermint).
See the policy for more details on submissions and rewards.
Here is a list of examples of the kinds of bugs we're most interested in:
## Specification
- Conceptual flaws
- Ambiguities, inconsistencies, or incorrect statements
- Mis-match between specification and implementation of any component
## Consensus
Assuming less than 1/3 of the voting power is Byzantine (malicious):
- Validation of blockchain data structures, including blocks, block parts,
votes, and so on
- Execution of blocks
- Validator set changes
- Proposer round robin
- Two nodes committing conflicting blocks for the same height (safety failure)
- A correct node signing conflicting votes
- A node halting (liveness failure)
- Syncing new and old nodes
## Networking
- Authenticated encryption (MITM, information leakage)
- Eclipse attacks
- Sybil attacks
- Long-range attacks
- Denial-of-Service
## RPC
- Write-access to anything besides sending transactions
- Denial-of-Service
- Leakage of secrets
## Denial-of-Service
Attacks may come through the P2P network or the RPC:
- Amplification attacks
- Resource abuse
- Deadlocks and race conditions
- Panics and unhandled errors
## Libraries
- Serialization (Amino)
- Reading/Writing files and databases
- Logging and monitoring
## Cryptography
- Elliptic curves for validator signatures
- Hash algorithms and Merkle trees for block validation
- Authenticated encryption for P2P connections
## Light Client
- Validation of blockchain data structures
- Correctly validating an incorrect proof
- Incorrectly validating a correct proof
- Syncing validator set changes

446
UPGRADING.md Normal file
View File

@ -0,0 +1,446 @@
# Upgrading Tendermint Core
This guide provides steps to be followed when you upgrade your applications to
a newer version of Tendermint Core.
## v0.32.0
This release is compatible with previous blockchains,
however the new ABCI Events mechanism may create some complexity
for nodes wishing to continue operation with v0.32 from a previous version.
There are some minor breaking changes to the RPC.
### Config Changes
If you have `db_backend` set to `leveldb` in your config file, please change it
to `goleveldb` or `cleveldb`.
### RPC Changes
The default listen address for the RPC is now `127.0.0.1`. If you want to expose
it publicly, you have to explicitly configure it. Note exposing the RPC to the
public internet may not be safe - endpoints which return a lot of data may
enable resource exhaustion attacks on your node, causing the process to crash.
Any consumers of `/block_results` need to be mindful of the change in all field
names from CamelCase to Snake case, eg. `results.DeliverTx` is now `results.deliver_tx`.
This is a fix, but it's breaking.
### ABCI Changes
ABCI responses which previously had a `Tags` field now have an `Events` field
instead. The original `Tags` field was simply a list of key-value pairs, where
each key effectively represented some attribute of an event occuring in the
blockchain, like `sender`, `receiver`, or `amount`. However, it was difficult to
represent the occurence of multiple events (for instance, multiple transfers) in a single list.
The new `Events` field contains a list of `Event`, where each `Event` is itself a list
of key-value pairs, allowing for more natural expression of multiple events in
eg. a single DeliverTx or EndBlock. Note each `Event` also includes a `Type`, which is meant to categorize the
event.
For transaction indexing, the index key is
prefixed with the event type: `{eventType}.{attributeKey}`.
If the same event type and attribute key appear multiple times, the values are
appended in a list.
To make queries, include the event type as a prefix. For instance if you
previously queried for `recipient = 'XYZ'`, and after the upgrade you name your event `transfer`,
the new query would be for `transfer.recipient = 'XYZ'`.
Note that transactions indexed on a node before upgrading to v0.32 will still be indexed
using the old scheme. For instance, if a node upgraded at height 100,
transactions before 100 would be queried with `recipient = 'XYZ'` and
transactions after 100 would be queried with `transfer.recipient = 'XYZ'`.
While this presents additional complexity to clients, it avoids the need to
reindex. Of course, you can reset the node and sync from scratch to re-index
entirely using the new scheme.
We illustrate further with a more complete example.
Prior to the update, suppose your `ResponseDeliverTx` look like:
```go
abci.ResponseDeliverTx{
Tags: []cmn.KVPair{
{Key: []byte("sender"), Value: []byte("foo")},
{Key: []byte("recipient"), Value: []byte("bar")},
{Key: []byte("amount"), Value: []byte("35")},
}
}
```
The following queries would match this transaction:
```go
query.MustParse("tm.event = 'Tx' AND sender = 'foo'")
query.MustParse("tm.event = 'Tx' AND recipient = 'bar'")
query.MustParse("tm.event = 'Tx' AND sender = 'foo' AND recipient = 'bar'")
```
Following the upgrade, your `ResponseDeliverTx` would look something like:
the following `Events`:
```go
abci.ResponseDeliverTx{
Events: []abci.Event{
{
Type: "transfer",
Attributes: cmn.KVPairs{
{Key: []byte("sender"), Value: []byte("foo")},
{Key: []byte("recipient"), Value: []byte("bar")},
{Key: []byte("amount"), Value: []byte("35")},
},
}
}
```
Now the following queries would match this transaction:
```go
query.MustParse("tm.event = 'Tx' AND transfer.sender = 'foo'")
query.MustParse("tm.event = 'Tx' AND transfer.recipient = 'bar'")
query.MustParse("tm.event = 'Tx' AND transfer.sender = 'foo' AND transfer.recipient = 'bar'")
```
For further documentation on `Events`, see the [docs](https://github.com/tendermint/tendermint/blob/60827f75623b92eff132dc0eff5b49d2025c591e/docs/spec/abci/abci.md#events).
### Go Applications
The ABCI Application interface changed slightly so the CheckTx and DeliverTx
methods now take Request structs. The contents of these structs are just the raw
tx bytes, which were previously passed in as the argument.
## v0.31.6
There are no breaking changes in this release except Go API of p2p and
mempool packages. Hovewer, if you're using cleveldb, you'll need to change
the compilation tag:
Use `cleveldb` tag instead of `gcc` to compile Tendermint with CLevelDB or
use `make build_c` / `make install_c` (full instructions can be found at
https://tendermint.com/docs/introduction/install.html#compile-with-cleveldb-support)
## v0.31.0
This release contains a breaking change to the behaviour of the pubsub system.
It also contains some minor breaking changes in the Go API and ABCI.
There are no changes to the block or p2p protocols, so v0.31.0 should work fine
with blockchains created from the v0.30 series.
### RPC
The pubsub no longer blocks on publishing. This may cause some WebSocket (WS) clients to stop working as expected.
If your WS client is not consuming events fast enough, Tendermint can terminate the subscription.
In this case, the WS client will receive an error with description:
```json
{
"jsonrpc": "2.0",
"id": "{ID}#event",
"error": {
"code": -32000,
"msg": "Server error",
"data": "subscription was cancelled (reason: client is not pulling messages fast enough)" // or "subscription was cancelled (reason: Tendermint exited)"
}
}
Additionally, there are now limits on the number of subscribers and
subscriptions that can be active at once. See the new
`rpc.max_subscription_clients` and `rpc.max_subscriptions_per_client` values to
configure this.
```
### Applications
Simple rename of `ConsensusParams.BlockSize` to `ConsensusParams.Block`.
The `ConsensusParams.Block.TimeIotaMS` field was also removed. It's configured
in the ConsensusParsm in genesis.
### Go API
See the [CHANGELOG](CHANGELOG.md). These are relatively straight forward.
## v0.30.0
This release contains a breaking change to both the block and p2p protocols,
however it may be compatible with blockchains created with v0.29.0 depending on
the chain history. If your blockchain has not included any pieces of evidence,
or no piece of evidence has been included in more than one block,
and if your application has never returned multiple updates
for the same validator in a single block, then v0.30.0 will work fine with
blockchains created with v0.29.0.
The p2p protocol change is to fix the proposer selection algorithm again.
Note that proposer selection is purely a p2p concern right
now since the algorithm is only relevant during real time consensus.
This change is thus compatible with v0.29.0, but
all nodes must be upgraded to avoid disagreements on the proposer.
### Applications
Applications must ensure they do not return duplicates in
`ResponseEndBlock.ValidatorUpdates`. A pubkey must only appear once per set of
updates. Duplicates will cause irrecoverable failure. If you have a very good
reason why we shouldn't do this, please open an issue.
## v0.29.0
This release contains some breaking changes to the block and p2p protocols,
and will not be compatible with any previous versions of the software, primarily
due to changes in how various data structures are hashed.
Any implementations of Tendermint blockchain verification, including lite clients,
will need to be updated. For specific details:
- [Merkle tree](./docs/spec/blockchain/encoding.md#merkle-trees)
- [ConsensusParams](./docs/spec/blockchain/state.md#consensusparams)
There was also a small change to field ordering in the vote struct. Any
implementations of an out-of-process validator (like a Key-Management Server)
will need to be updated. For specific details:
- [Vote](https://github.com/tendermint/tendermint/blob/develop/docs/spec/consensus/signing.md#votes)
Finally, the proposer selection algorithm continues to evolve. See the
[work-in-progress
specification](https://github.com/tendermint/tendermint/pull/3140).
For everything else, please see the [CHANGELOG](./CHANGELOG.md#v0.29.0).
## v0.28.0
This release breaks the format for the `priv_validator.json` file
and the protocol used for the external validator process.
It is compatible with v0.27.0 blockchains (neither the BlockProtocol nor the
P2PProtocol have changed).
Please read carefully for details about upgrading.
**Note:** Backup your `config/priv_validator.json`
before proceeding.
### `priv_validator.json`
The `config/priv_validator.json` is now two files:
`config/priv_validator_key.json` and `data/priv_validator_state.json`.
The former contains the key material, the later contains the details on the last
message signed.
When running v0.28.0 for the first time, it will back up any pre-existing
`priv_validator.json` file and proceed to split it into the two new files.
Upgrading should happen automatically without problem.
To upgrade manually, use the provided `privValUpgrade.go` script, with exact paths for the old
`priv_validator.json` and the locations for the two new files. It's recomended
to use the default paths, of `config/priv_validator_key.json` and
`data/priv_validator_state.json`, respectively:
```
go run scripts/privValUpgrade.go <old-path> <new-key-path> <new-state-path>
```
### External validator signers
The Unix and TCP implementations of the remote signing validator
have been consolidated into a single implementation.
Thus in both cases, the external process is expected to dial
Tendermint. This is different from how Unix sockets used to work, where
Tendermint dialed the external process.
The `PubKeyMsg` was also split into separate `Request` and `Response` types
for consistency with other messages.
Note that the TCP sockets don't yet use a persistent key,
so while they're encrypted, they can't yet be properly authenticated.
See [#3105](https://github.com/tendermint/tendermint/issues/3105).
Note the Unix socket has neither encryption nor authentication, but will
add a shared-secret in [#3099](https://github.com/tendermint/tendermint/issues/3099).
## v0.27.0
This release contains some breaking changes to the block and p2p protocols,
but does not change any core data structures, so it should be compatible with
existing blockchains from the v0.26 series that only used Ed25519 validator keys.
Blockchains using Secp256k1 for validators will not be compatible. This is due
to the fact that we now enforce which key types validators can use as a
consensus param. The default is Ed25519, and Secp256k1 must be activated
explicitly.
It is recommended to upgrade all nodes at once to avoid incompatibilities at the
peer layer - namely, the heartbeat consensus message has been removed (only
relevant if `create_empty_blocks=false` or `create_empty_blocks_interval > 0`),
and the proposer selection algorithm has changed. Since proposer information is
never included in the blockchain, this change only affects the peer layer.
### Go API Changes
#### libs/db
The ReverseIterator API has changed the meaning of `start` and `end`.
Before, iteration was from `start` to `end`, where
`start > end`. Now, iteration is from `end` to `start`, where `start < end`.
The iterator also excludes `end`. This change allows a simplified and more
intuitive logic, aligning the semantic meaning of `start` and `end` in the
`Iterator` and `ReverseIterator`.
### Applications
This release enforces a new consensus parameter, the
ValidatorParams.PubKeyTypes. Applications must ensure that they only return
validator updates with the allowed PubKeyTypes. If a validator update includes a
pubkey type that is not included in the ConsensusParams.Validator.PubKeyTypes,
block execution will fail and the consensus will halt.
By default, only Ed25519 pubkeys may be used for validators. Enabling
Secp256k1 requires explicit modification of the ConsensusParams.
Please update your application accordingly (ie. restrict validators to only be
able to use Ed25519 keys, or explicitly add additional key types to the genesis
file).
## v0.26.0
This release contains a lot of changes to core data types and protocols. It is not
compatible to the old versions and there is no straight forward way to update
old data to be compatible with the new version.
To reset the state do:
```
$ tendermint unsafe_reset_all
```
Here we summarize some other notable changes to be mindful of.
### Config Changes
All timeouts must be changed from integers to strings with their duration, for
instance `flush_throttle_timeout = 100` would be changed to
`flush_throttle_timeout = "100ms"` and `timeout_propose = 3000` would be changed
to `timeout_propose = "3s"`.
### RPC Changes
The default behaviour of `/abci_query` has been changed to not return a proof,
and the name of the parameter that controls this has been changed from `trusted`
to `prove`. To get proofs with your queries, ensure you set `prove=true`.
Various version fields like `amino_version`, `p2p_version`, `consensus_version`,
and `rpc_version` have been removed from the `node_info.other` and are
consolidated under the tendermint semantic version (ie. `node_info.version`) and
the new `block` and `p2p` protocol versions under `node_info.protocol_version`.
### ABCI Changes
Field numbers were bumped in the `Header` and `ResponseInfo` messages to make
room for new `version` fields. It should be straight forward to recompile the
protobuf file for these changes.
#### Proofs
The `ResponseQuery.Proof` field is now structured as a `[]ProofOp` to support
generalized Merkle tree constructions where the leaves of one Merkle tree are
the root of another. If you don't need this functionality, and you used to
return `<proof bytes>` here, you should instead return a single `ProofOp` with
just the `Data` field set:
```
[]ProofOp{
ProofOp{
Data: <proof bytes>,
}
}
```
For more information, see:
- [ADR-026](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/architecture/adr-026-general-merkle-proof.md)
- [Relevant ABCI
documentation](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/spec/abci/apps.md#query-proofs)
- [Description of
keys](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/crypto/merkle/proof_key_path.go#L14)
### Go API Changes
#### crypto/merkle
The `merkle.Hasher` interface was removed. Functions which used to take `Hasher`
now simply take `[]byte`. This means that any objects being Merklized should be
serialized before they are passed in.
#### node
The `node.RunForever` function was removed. Signal handling and running forever
should instead be explicitly configured by the caller. See how we do it
[here](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/cmd/tendermint/commands/run_node.go#L60).
### Other
All hashes, except for public key addresses, are now 32-bytes.
## v0.25.0
This release has minimal impact.
If you use GasWanted in ABCI and want to enforce it, set the MaxGas in the genesis file (default is no max).
## v0.24.0
New 0.24.0 release contains a lot of changes to the state and types. It's not
compatible to the old versions and there is no straight forward way to update
old data to be compatible with the new version.
To reset the state do:
```
$ tendermint unsafe_reset_all
```
Here we summarize some other notable changes to be mindful of.
### Config changes
`p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and
`p2p.max_num_outbound_peers`.
```
# Maximum number of inbound peers
max_num_inbound_peers = 40
# Maximum number of outbound peers to connect to, excluding persistent peers
max_num_outbound_peers = 10
```
As you can see, the default ratio of inbound/outbound peers is 4/1. The reason
is we want it to be easier for new nodes to connect to the network. You can
tweak these parameters to alter the network topology.
### RPC Changes
The result of `/commit` used to contain `header` and `commit` fields at the top level. These are now contained under the `signed_header` field.
### ABCI Changes
The header has been upgraded and contains new fields, but none of the existing
fields were changed, except their order.
The `Validator` type was split into two, one containing an `Address` and one
containing a `PubKey`. When processing `RequestBeginBlock`, use the `Validator`
type, which contains just the `Address`. When returning `ResponseEndBlock`, use
the `ValidatorUpdate` type, which contains just the `PubKey`.
### Validator Set Updates
Validator set updates returned in ResponseEndBlock for height `H` used to take
effect immediately at height `H+1`. Now they will be delayed one block, to take
effect at height `H+2`. Note this means that the change will be seen by the ABCI
app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. Apps were already
required to maintain a map from validator addresses to pubkeys since v0.23 (when
pubkeys were removed from RequestBeginBlock), but now they may need to track
multiple validator sets at once to accomodate this delay.
### Block Size
The `ConsensusParams.BlockSize.MaxTxs` was removed in favour of
`ConsensusParams.BlockSize.MaxBytes`, which is now enforced. This means blocks
are limitted only by byte-size, not by number of transactions.

50
Vagrantfile vendored
View File

@ -2,37 +2,61 @@
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box = "ubuntu/xenial64"
config.vm.provider "virtualbox" do |v|
v.memory = 3072
v.memory = 4096
v.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y --no-install-recommends wget curl jq shellcheck bsdmainutils psmisc
wget -qO- https://get.docker.com/ | sh
# install base requirements
apt-get install -y --no-install-recommends wget curl jq zip \
make shellcheck bsdmainutils psmisc
apt-get install -y language-pack-en
# install docker
apt-get install -y --no-install-recommends apt-transport-https \
ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get install -y docker-ce
usermod -a -G docker vagrant
# install go
wget -q https://dl.google.com/go/go1.12.linux-amd64.tar.gz
tar -xvf go1.12.linux-amd64.tar.gz
mv go /usr/local
rm -f go1.12.linux-amd64.tar.gz
# install nodejs (for docs)
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
# cleanup
apt-get autoremove -y
curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
tar -xvf go1.8.linux-amd64.tar.gz
rm -rf /usr/local/go
mv go /usr/local
rm -f go1.8.linux-amd64.tar.gz
mkdir -p /home/vagrant/go/bin
echo 'export PATH=$PATH:/usr/local/go/bin:/home/vagrant/go/bin' >> /home/vagrant/.bash_profile
# set env variables
echo 'export GOROOT=/usr/local/go' >> /home/vagrant/.bash_profile
echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/vagrant/.bash_profile
echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
echo 'cd go/src/github.com/tendermint/tendermint' >> /home/vagrant/.bash_profile
mkdir -p /home/vagrant/go/bin
mkdir -p /home/vagrant/go/src/github.com/tendermint
ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/tendermint
chown -R vagrant:vagrant /home/vagrant/go
chown vagrant:vagrant /home/vagrant/.bash_profile
su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make get_vendor_deps'
# get all deps and tools, ready to install/test
su - vagrant -c 'source /home/vagrant/.bash_profile'
su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make get_tools'
SHELL
end

37
abci/README.md Normal file
View File

@ -0,0 +1,37 @@
# Application BlockChain Interface (ABCI)
Blockchains are systems for multi-master state machine replication.
**ABCI** is an interface that defines the boundary between the replication engine (the blockchain),
and the state machine (the application).
Using a socket protocol, a consensus engine running in one process
can manage an application state running in another.
Previously, the ABCI was referred to as TMSP.
The community has provided a number of addtional implementations, see the [Tendermint Ecosystem](https://tendermint.com/ecosystem)
## Installation & Usage
To get up and running quickly, see the [getting started guide](../docs/app-dev/getting-started.md) along with the [abci-cli documentation](../docs/app-dev/abci-cli.md) which will go through the examples found in the [examples](./example/) directory.
## Specification
A detailed description of the ABCI methods and message types is contained in:
- [The main spec](../docs/spec/abci/abci.md)
- [A protobuf file](./types/types.proto)
- [A Go interface](./types/application.go)
## Protocol Buffers
To compile the protobuf file, run (from the root of the repo):
```
make protoc_abci
```
See `protoc --help` and [the Protocol Buffers site](https://developers.google.com/protocol-buffers)
for details on compiling for other languages. Note we also include a [GRPC](https://www.grpc.io/docs)
service definition.

129
abci/client/client.go Normal file
View File

@ -0,0 +1,129 @@
package abcicli
import (
"fmt"
"sync"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
const (
dialRetryIntervalSeconds = 3
echoRetryIntervalSeconds = 1
)
// Client defines an interface for an ABCI client.
// All `Async` methods return a `ReqRes` object.
// All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error.
// Note these are client errors, eg. ABCI socket connectivity issues.
// Application-related errors are reflected in response via ABCI error codes and logs.
type Client interface {
cmn.Service
SetResponseCallback(Callback)
Error() error
FlushAsync() *ReqRes
EchoAsync(msg string) *ReqRes
InfoAsync(types.RequestInfo) *ReqRes
SetOptionAsync(types.RequestSetOption) *ReqRes
DeliverTxAsync(types.RequestDeliverTx) *ReqRes
CheckTxAsync(types.RequestCheckTx) *ReqRes
QueryAsync(types.RequestQuery) *ReqRes
CommitAsync() *ReqRes
InitChainAsync(types.RequestInitChain) *ReqRes
BeginBlockAsync(types.RequestBeginBlock) *ReqRes
EndBlockAsync(types.RequestEndBlock) *ReqRes
FlushSync() error
EchoSync(msg string) (*types.ResponseEcho, error)
InfoSync(types.RequestInfo) (*types.ResponseInfo, error)
SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error)
DeliverTxSync(types.RequestDeliverTx) (*types.ResponseDeliverTx, error)
CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error)
QuerySync(types.RequestQuery) (*types.ResponseQuery, error)
CommitSync() (*types.ResponseCommit, error)
InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error)
BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error)
EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error)
}
//----------------------------------------
// NewClient returns a new ABCI client of the specified transport type.
// It returns an error if the transport is not "socket" or "grpc"
func NewClient(addr, transport string, mustConnect bool) (client Client, err error) {
switch transport {
case "socket":
client = NewSocketClient(addr, mustConnect)
case "grpc":
client = NewGRPCClient(addr, mustConnect)
default:
err = fmt.Errorf("Unknown abci transport %s", transport)
}
return
}
//----------------------------------------
type Callback func(*types.Request, *types.Response)
//----------------------------------------
type ReqRes struct {
*types.Request
*sync.WaitGroup
*types.Response // Not set atomically, so be sure to use WaitGroup.
mtx sync.Mutex
done bool // Gets set to true once *after* WaitGroup.Done().
cb func(*types.Response) // A single callback that may be set.
}
func NewReqRes(req *types.Request) *ReqRes {
return &ReqRes{
Request: req,
WaitGroup: waitGroup1(),
Response: nil,
done: false,
cb: nil,
}
}
// Sets the callback for this ReqRes atomically.
// If reqRes is already done, calls cb immediately.
// NOTE: reqRes.cb should not change if reqRes.done.
// NOTE: only one callback is supported.
func (reqRes *ReqRes) SetCallback(cb func(res *types.Response)) {
reqRes.mtx.Lock()
if reqRes.done {
reqRes.mtx.Unlock()
cb(reqRes.Response)
return
}
reqRes.cb = cb
reqRes.mtx.Unlock()
}
func (reqRes *ReqRes) GetCallback() func(*types.Response) {
reqRes.mtx.Lock()
defer reqRes.mtx.Unlock()
return reqRes.cb
}
// NOTE: it should be safe to read reqRes.cb without locks after this.
func (reqRes *ReqRes) SetDone() {
reqRes.mtx.Lock()
reqRes.done = true
reqRes.mtx.Unlock()
}
func waitGroup1() (wg *sync.WaitGroup) {
wg = &sync.WaitGroup{}
wg.Add(1)
return
}

305
abci/client/grpc_client.go Normal file
View File

@ -0,0 +1,305 @@
package abcicli
import (
"fmt"
"net"
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
var _ Client = (*grpcClient)(nil)
// A stripped copy of the remoteClient that makes
// synchronous calls using grpc
type grpcClient struct {
cmn.BaseService
mustConnect bool
client types.ABCIApplicationClient
conn *grpc.ClientConn
mtx sync.Mutex
addr string
err error
resCb func(*types.Request, *types.Response) // listens to all callbacks
}
func NewGRPCClient(addr string, mustConnect bool) *grpcClient {
cli := &grpcClient{
addr: addr,
mustConnect: mustConnect,
}
cli.BaseService = *cmn.NewBaseService(nil, "grpcClient", cli)
return cli
}
func dialerFunc(ctx context.Context, addr string) (net.Conn, error) {
return cmn.Connect(addr)
}
func (cli *grpcClient) OnStart() error {
if err := cli.BaseService.OnStart(); err != nil {
return err
}
RETRY_LOOP:
for {
conn, err := grpc.Dial(cli.addr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc))
if err != nil {
if cli.mustConnect {
return err
}
cli.Logger.Error(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr), "err", err)
time.Sleep(time.Second * dialRetryIntervalSeconds)
continue RETRY_LOOP
}
cli.Logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr)
client := types.NewABCIApplicationClient(conn)
cli.conn = conn
ENSURE_CONNECTED:
for {
_, err := client.Echo(context.Background(), &types.RequestEcho{Message: "hello"}, grpc.WaitForReady(true))
if err == nil {
break ENSURE_CONNECTED
}
cli.Logger.Error("Echo failed", "err", err)
time.Sleep(time.Second * echoRetryIntervalSeconds)
}
cli.client = client
return nil
}
}
func (cli *grpcClient) OnStop() {
cli.BaseService.OnStop()
if cli.conn != nil {
cli.conn.Close()
}
}
func (cli *grpcClient) StopForError(err error) {
cli.mtx.Lock()
if !cli.IsRunning() {
return
}
if cli.err == nil {
cli.err = err
}
cli.mtx.Unlock()
cli.Logger.Error(fmt.Sprintf("Stopping abci.grpcClient for error: %v", err.Error()))
cli.Stop()
}
func (cli *grpcClient) Error() error {
cli.mtx.Lock()
defer cli.mtx.Unlock()
return cli.err
}
// Set listener for all responses
// NOTE: callback may get internally generated flush responses.
func (cli *grpcClient) SetResponseCallback(resCb Callback) {
cli.mtx.Lock()
cli.resCb = resCb
cli.mtx.Unlock()
}
//----------------------------------------
// GRPC calls are synchronous, but some callbacks expect to be called asynchronously
// (eg. the mempool expects to be able to lock to remove bad txs from cache).
// To accommodate, we finish each call in its own go-routine,
// which is expensive, but easy - if you want something better, use the socket protocol!
// maybe one day, if people really want it, we use grpc streams,
// but hopefully not :D
func (cli *grpcClient) EchoAsync(msg string) *ReqRes {
req := types.ToRequestEcho(msg)
res, err := cli.client.Echo(context.Background(), req.GetEcho(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Echo{Echo: res}})
}
func (cli *grpcClient) FlushAsync() *ReqRes {
req := types.ToRequestFlush()
res, err := cli.client.Flush(context.Background(), req.GetFlush(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Flush{Flush: res}})
}
func (cli *grpcClient) InfoAsync(params types.RequestInfo) *ReqRes {
req := types.ToRequestInfo(params)
res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Info{Info: res}})
}
func (cli *grpcClient) SetOptionAsync(params types.RequestSetOption) *ReqRes {
req := types.ToRequestSetOption(params)
res, err := cli.client.SetOption(context.Background(), req.GetSetOption(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_SetOption{SetOption: res}})
}
func (cli *grpcClient) DeliverTxAsync(params types.RequestDeliverTx) *ReqRes {
req := types.ToRequestDeliverTx(params)
res, err := cli.client.DeliverTx(context.Background(), req.GetDeliverTx(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_DeliverTx{DeliverTx: res}})
}
func (cli *grpcClient) CheckTxAsync(params types.RequestCheckTx) *ReqRes {
req := types.ToRequestCheckTx(params)
res, err := cli.client.CheckTx(context.Background(), req.GetCheckTx(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_CheckTx{CheckTx: res}})
}
func (cli *grpcClient) QueryAsync(params types.RequestQuery) *ReqRes {
req := types.ToRequestQuery(params)
res, err := cli.client.Query(context.Background(), req.GetQuery(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Query{Query: res}})
}
func (cli *grpcClient) CommitAsync() *ReqRes {
req := types.ToRequestCommit()
res, err := cli.client.Commit(context.Background(), req.GetCommit(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Commit{Commit: res}})
}
func (cli *grpcClient) InitChainAsync(params types.RequestInitChain) *ReqRes {
req := types.ToRequestInitChain(params)
res, err := cli.client.InitChain(context.Background(), req.GetInitChain(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_InitChain{InitChain: res}})
}
func (cli *grpcClient) BeginBlockAsync(params types.RequestBeginBlock) *ReqRes {
req := types.ToRequestBeginBlock(params)
res, err := cli.client.BeginBlock(context.Background(), req.GetBeginBlock(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_BeginBlock{BeginBlock: res}})
}
func (cli *grpcClient) EndBlockAsync(params types.RequestEndBlock) *ReqRes {
req := types.ToRequestEndBlock(params)
res, err := cli.client.EndBlock(context.Background(), req.GetEndBlock(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_EndBlock{EndBlock: res}})
}
func (cli *grpcClient) finishAsyncCall(req *types.Request, res *types.Response) *ReqRes {
reqres := NewReqRes(req)
reqres.Response = res // Set response
reqres.Done() // Release waiters
reqres.SetDone() // so reqRes.SetCallback will run the callback
// goroutine for callbacks
go func() {
cli.mtx.Lock()
defer cli.mtx.Unlock()
// Notify client listener if set
if cli.resCb != nil {
cli.resCb(reqres.Request, res)
}
// Notify reqRes listener if set
if cb := reqres.GetCallback(); cb != nil {
cb(res)
}
}()
return reqres
}
//----------------------------------------
func (cli *grpcClient) FlushSync() error {
return nil
}
func (cli *grpcClient) EchoSync(msg string) (*types.ResponseEcho, error) {
reqres := cli.EchoAsync(msg)
// StopForError should already have been called if error is set
return reqres.Response.GetEcho(), cli.Error()
}
func (cli *grpcClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) {
reqres := cli.InfoAsync(req)
return reqres.Response.GetInfo(), cli.Error()
}
func (cli *grpcClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) {
reqres := cli.SetOptionAsync(req)
return reqres.Response.GetSetOption(), cli.Error()
}
func (cli *grpcClient) DeliverTxSync(params types.RequestDeliverTx) (*types.ResponseDeliverTx, error) {
reqres := cli.DeliverTxAsync(params)
return reqres.Response.GetDeliverTx(), cli.Error()
}
func (cli *grpcClient) CheckTxSync(params types.RequestCheckTx) (*types.ResponseCheckTx, error) {
reqres := cli.CheckTxAsync(params)
return reqres.Response.GetCheckTx(), cli.Error()
}
func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) {
reqres := cli.QueryAsync(req)
return reqres.Response.GetQuery(), cli.Error()
}
func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) {
reqres := cli.CommitAsync()
return reqres.Response.GetCommit(), cli.Error()
}
func (cli *grpcClient) InitChainSync(params types.RequestInitChain) (*types.ResponseInitChain, error) {
reqres := cli.InitChainAsync(params)
return reqres.Response.GetInitChain(), cli.Error()
}
func (cli *grpcClient) BeginBlockSync(params types.RequestBeginBlock) (*types.ResponseBeginBlock, error) {
reqres := cli.BeginBlockAsync(params)
return reqres.Response.GetBeginBlock(), cli.Error()
}
func (cli *grpcClient) EndBlockSync(params types.RequestEndBlock) (*types.ResponseEndBlock, error) {
reqres := cli.EndBlockAsync(params)
return reqres.Response.GetEndBlock(), cli.Error()
}

255
abci/client/local_client.go Normal file
View File

@ -0,0 +1,255 @@
package abcicli
import (
"sync"
types "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
var _ Client = (*localClient)(nil)
// NOTE: use defer to unlock mutex because Application might panic (e.g., in
// case of malicious tx or query). It only makes sense for publicly exposed
// methods like CheckTx (/broadcast_tx_* RPC endpoint) or Query (/abci_query
// RPC endpoint), but defers are used everywhere for the sake of consistency.
type localClient struct {
cmn.BaseService
mtx *sync.Mutex
types.Application
Callback
}
func NewLocalClient(mtx *sync.Mutex, app types.Application) *localClient {
if mtx == nil {
mtx = new(sync.Mutex)
}
cli := &localClient{
mtx: mtx,
Application: app,
}
cli.BaseService = *cmn.NewBaseService(nil, "localClient", cli)
return cli
}
func (app *localClient) SetResponseCallback(cb Callback) {
app.mtx.Lock()
app.Callback = cb
app.mtx.Unlock()
}
// TODO: change types.Application to include Error()?
func (app *localClient) Error() error {
return nil
}
func (app *localClient) FlushAsync() *ReqRes {
// Do nothing
return newLocalReqRes(types.ToRequestFlush(), nil)
}
func (app *localClient) EchoAsync(msg string) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
return app.callback(
types.ToRequestEcho(msg),
types.ToResponseEcho(msg),
)
}
func (app *localClient) InfoAsync(req types.RequestInfo) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.Info(req)
return app.callback(
types.ToRequestInfo(req),
types.ToResponseInfo(res),
)
}
func (app *localClient) SetOptionAsync(req types.RequestSetOption) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.SetOption(req)
return app.callback(
types.ToRequestSetOption(req),
types.ToResponseSetOption(res),
)
}
func (app *localClient) DeliverTxAsync(params types.RequestDeliverTx) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.DeliverTx(params)
return app.callback(
types.ToRequestDeliverTx(params),
types.ToResponseDeliverTx(res),
)
}
func (app *localClient) CheckTxAsync(req types.RequestCheckTx) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.CheckTx(req)
return app.callback(
types.ToRequestCheckTx(req),
types.ToResponseCheckTx(res),
)
}
func (app *localClient) QueryAsync(req types.RequestQuery) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.Query(req)
return app.callback(
types.ToRequestQuery(req),
types.ToResponseQuery(res),
)
}
func (app *localClient) CommitAsync() *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.Commit()
return app.callback(
types.ToRequestCommit(),
types.ToResponseCommit(res),
)
}
func (app *localClient) InitChainAsync(req types.RequestInitChain) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.InitChain(req)
return app.callback(
types.ToRequestInitChain(req),
types.ToResponseInitChain(res),
)
}
func (app *localClient) BeginBlockAsync(req types.RequestBeginBlock) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.BeginBlock(req)
return app.callback(
types.ToRequestBeginBlock(req),
types.ToResponseBeginBlock(res),
)
}
func (app *localClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.EndBlock(req)
return app.callback(
types.ToRequestEndBlock(req),
types.ToResponseEndBlock(res),
)
}
//-------------------------------------------------------
func (app *localClient) FlushSync() error {
return nil
}
func (app *localClient) EchoSync(msg string) (*types.ResponseEcho, error) {
return &types.ResponseEcho{Message: msg}, nil
}
func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.Info(req)
return &res, nil
}
func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.SetOption(req)
return &res, nil
}
func (app *localClient) DeliverTxSync(req types.RequestDeliverTx) (*types.ResponseDeliverTx, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.DeliverTx(req)
return &res, nil
}
func (app *localClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.CheckTx(req)
return &res, nil
}
func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.Query(req)
return &res, nil
}
func (app *localClient) CommitSync() (*types.ResponseCommit, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.Commit()
return &res, nil
}
func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.InitChain(req)
return &res, nil
}
func (app *localClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.BeginBlock(req)
return &res, nil
}
func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.EndBlock(req)
return &res, nil
}
//-------------------------------------------------------
func (app *localClient) callback(req *types.Request, res *types.Response) *ReqRes {
app.Callback(req, res)
return newLocalReqRes(req, res)
}
func newLocalReqRes(req *types.Request, res *types.Response) *ReqRes {
reqRes := NewReqRes(req)
reqRes.Response = res
reqRes.SetDone()
return reqRes
}

View File

@ -0,0 +1,403 @@
package abcicli
import (
"bufio"
"container/list"
"errors"
"fmt"
"net"
"reflect"
"sync"
"time"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
const reqQueueSize = 256 // TODO make configurable
// const maxResponseSize = 1048576 // 1MB TODO make configurable
const flushThrottleMS = 20 // Don't wait longer than...
var _ Client = (*socketClient)(nil)
// This is goroutine-safe, but users should beware that
// the application in general is not meant to be interfaced
// with concurrent callers.
type socketClient struct {
cmn.BaseService
addr string
mustConnect bool
conn net.Conn
reqQueue chan *ReqRes
flushTimer *cmn.ThrottleTimer
mtx sync.Mutex
err error
reqSent *list.List // list of requests sent, waiting for response
resCb func(*types.Request, *types.Response) // called on all requests, if set.
}
func NewSocketClient(addr string, mustConnect bool) *socketClient {
cli := &socketClient{
reqQueue: make(chan *ReqRes, reqQueueSize),
flushTimer: cmn.NewThrottleTimer("socketClient", flushThrottleMS),
mustConnect: mustConnect,
addr: addr,
reqSent: list.New(),
resCb: nil,
}
cli.BaseService = *cmn.NewBaseService(nil, "socketClient", cli)
return cli
}
func (cli *socketClient) OnStart() error {
var err error
var conn net.Conn
RETRY_LOOP:
for {
conn, err = cmn.Connect(cli.addr)
if err != nil {
if cli.mustConnect {
return err
}
cli.Logger.Error(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr), "err", err)
time.Sleep(time.Second * dialRetryIntervalSeconds)
continue RETRY_LOOP
}
cli.conn = conn
go cli.sendRequestsRoutine(conn)
go cli.recvResponseRoutine(conn)
return nil
}
}
func (cli *socketClient) OnStop() {
if cli.conn != nil {
cli.conn.Close()
}
cli.mtx.Lock()
defer cli.mtx.Unlock()
cli.flushQueue()
}
// Stop the client and set the error
func (cli *socketClient) StopForError(err error) {
if !cli.IsRunning() {
return
}
cli.mtx.Lock()
if cli.err == nil {
cli.err = err
}
cli.mtx.Unlock()
cli.Logger.Error(fmt.Sprintf("Stopping abci.socketClient for error: %v", err.Error()))
cli.Stop()
}
func (cli *socketClient) Error() error {
cli.mtx.Lock()
defer cli.mtx.Unlock()
return cli.err
}
// Set listener for all responses
// NOTE: callback may get internally generated flush responses.
func (cli *socketClient) SetResponseCallback(resCb Callback) {
cli.mtx.Lock()
cli.resCb = resCb
cli.mtx.Unlock()
}
//----------------------------------------
func (cli *socketClient) sendRequestsRoutine(conn net.Conn) {
w := bufio.NewWriter(conn)
for {
select {
case <-cli.flushTimer.Ch:
select {
case cli.reqQueue <- NewReqRes(types.ToRequestFlush()):
default:
// Probably will fill the buffer, or retry later.
}
case <-cli.Quit():
return
case reqres := <-cli.reqQueue:
cli.willSendReq(reqres)
err := types.WriteMessage(reqres.Request, w)
if err != nil {
cli.StopForError(fmt.Errorf("Error writing msg: %v", err))
return
}
// cli.Logger.Debug("Sent request", "requestType", reflect.TypeOf(reqres.Request), "request", reqres.Request)
if _, ok := reqres.Request.Value.(*types.Request_Flush); ok {
err = w.Flush()
if err != nil {
cli.StopForError(fmt.Errorf("Error flushing writer: %v", err))
return
}
}
}
}
}
func (cli *socketClient) recvResponseRoutine(conn net.Conn) {
r := bufio.NewReader(conn) // Buffer reads
for {
var res = &types.Response{}
err := types.ReadMessage(r, res)
if err != nil {
cli.StopForError(err)
return
}
switch r := res.Value.(type) {
case *types.Response_Exception:
// XXX After setting cli.err, release waiters (e.g. reqres.Done())
cli.StopForError(errors.New(r.Exception.Error))
return
default:
// cli.Logger.Debug("Received response", "responseType", reflect.TypeOf(res), "response", res)
err := cli.didRecvResponse(res)
if err != nil {
cli.StopForError(err)
return
}
}
}
}
func (cli *socketClient) willSendReq(reqres *ReqRes) {
cli.mtx.Lock()
defer cli.mtx.Unlock()
cli.reqSent.PushBack(reqres)
}
func (cli *socketClient) didRecvResponse(res *types.Response) error {
cli.mtx.Lock()
defer cli.mtx.Unlock()
// Get the first ReqRes
next := cli.reqSent.Front()
if next == nil {
return fmt.Errorf("Unexpected result type %v when nothing expected", reflect.TypeOf(res.Value))
}
reqres := next.Value.(*ReqRes)
if !resMatchesReq(reqres.Request, res) {
return fmt.Errorf("Unexpected result type %v when response to %v expected",
reflect.TypeOf(res.Value), reflect.TypeOf(reqres.Request.Value))
}
reqres.Response = res // Set response
reqres.Done() // Release waiters
cli.reqSent.Remove(next) // Pop first item from linked list
// Notify client listener if set (global callback).
if cli.resCb != nil {
cli.resCb(reqres.Request, res)
}
// Notify reqRes listener if set (request specific callback).
// NOTE: it is possible this callback isn't set on the reqres object.
// at this point, in which case it will be called after, when it is set.
if cb := reqres.GetCallback(); cb != nil {
cb(res)
}
return nil
}
//----------------------------------------
func (cli *socketClient) EchoAsync(msg string) *ReqRes {
return cli.queueRequest(types.ToRequestEcho(msg))
}
func (cli *socketClient) FlushAsync() *ReqRes {
return cli.queueRequest(types.ToRequestFlush())
}
func (cli *socketClient) InfoAsync(req types.RequestInfo) *ReqRes {
return cli.queueRequest(types.ToRequestInfo(req))
}
func (cli *socketClient) SetOptionAsync(req types.RequestSetOption) *ReqRes {
return cli.queueRequest(types.ToRequestSetOption(req))
}
func (cli *socketClient) DeliverTxAsync(req types.RequestDeliverTx) *ReqRes {
return cli.queueRequest(types.ToRequestDeliverTx(req))
}
func (cli *socketClient) CheckTxAsync(req types.RequestCheckTx) *ReqRes {
return cli.queueRequest(types.ToRequestCheckTx(req))
}
func (cli *socketClient) QueryAsync(req types.RequestQuery) *ReqRes {
return cli.queueRequest(types.ToRequestQuery(req))
}
func (cli *socketClient) CommitAsync() *ReqRes {
return cli.queueRequest(types.ToRequestCommit())
}
func (cli *socketClient) InitChainAsync(req types.RequestInitChain) *ReqRes {
return cli.queueRequest(types.ToRequestInitChain(req))
}
func (cli *socketClient) BeginBlockAsync(req types.RequestBeginBlock) *ReqRes {
return cli.queueRequest(types.ToRequestBeginBlock(req))
}
func (cli *socketClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes {
return cli.queueRequest(types.ToRequestEndBlock(req))
}
//----------------------------------------
func (cli *socketClient) FlushSync() error {
reqRes := cli.queueRequest(types.ToRequestFlush())
if err := cli.Error(); err != nil {
return err
}
reqRes.Wait() // NOTE: if we don't flush the queue, its possible to get stuck here
return cli.Error()
}
func (cli *socketClient) EchoSync(msg string) (*types.ResponseEcho, error) {
reqres := cli.queueRequest(types.ToRequestEcho(msg))
cli.FlushSync()
return reqres.Response.GetEcho(), cli.Error()
}
func (cli *socketClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) {
reqres := cli.queueRequest(types.ToRequestInfo(req))
cli.FlushSync()
return reqres.Response.GetInfo(), cli.Error()
}
func (cli *socketClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) {
reqres := cli.queueRequest(types.ToRequestSetOption(req))
cli.FlushSync()
return reqres.Response.GetSetOption(), cli.Error()
}
func (cli *socketClient) DeliverTxSync(req types.RequestDeliverTx) (*types.ResponseDeliverTx, error) {
reqres := cli.queueRequest(types.ToRequestDeliverTx(req))
cli.FlushSync()
return reqres.Response.GetDeliverTx(), cli.Error()
}
func (cli *socketClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) {
reqres := cli.queueRequest(types.ToRequestCheckTx(req))
cli.FlushSync()
return reqres.Response.GetCheckTx(), cli.Error()
}
func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) {
reqres := cli.queueRequest(types.ToRequestQuery(req))
cli.FlushSync()
return reqres.Response.GetQuery(), cli.Error()
}
func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) {
reqres := cli.queueRequest(types.ToRequestCommit())
cli.FlushSync()
return reqres.Response.GetCommit(), cli.Error()
}
func (cli *socketClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) {
reqres := cli.queueRequest(types.ToRequestInitChain(req))
cli.FlushSync()
return reqres.Response.GetInitChain(), cli.Error()
}
func (cli *socketClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) {
reqres := cli.queueRequest(types.ToRequestBeginBlock(req))
cli.FlushSync()
return reqres.Response.GetBeginBlock(), cli.Error()
}
func (cli *socketClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) {
reqres := cli.queueRequest(types.ToRequestEndBlock(req))
cli.FlushSync()
return reqres.Response.GetEndBlock(), cli.Error()
}
//----------------------------------------
func (cli *socketClient) queueRequest(req *types.Request) *ReqRes {
reqres := NewReqRes(req)
// TODO: set cli.err if reqQueue times out
cli.reqQueue <- reqres
// Maybe auto-flush, or unset auto-flush
switch req.Value.(type) {
case *types.Request_Flush:
cli.flushTimer.Unset()
default:
cli.flushTimer.Set()
}
return reqres
}
func (cli *socketClient) flushQueue() {
// mark all in-flight messages as resolved (they will get cli.Error())
for req := cli.reqSent.Front(); req != nil; req = req.Next() {
reqres := req.Value.(*ReqRes)
reqres.Done()
}
// mark all queued messages as resolved
LOOP:
for {
select {
case reqres := <-cli.reqQueue:
reqres.Done()
default:
break LOOP
}
}
}
//----------------------------------------
func resMatchesReq(req *types.Request, res *types.Response) (ok bool) {
switch req.Value.(type) {
case *types.Request_Echo:
_, ok = res.Value.(*types.Response_Echo)
case *types.Request_Flush:
_, ok = res.Value.(*types.Response_Flush)
case *types.Request_Info:
_, ok = res.Value.(*types.Response_Info)
case *types.Request_SetOption:
_, ok = res.Value.(*types.Response_SetOption)
case *types.Request_DeliverTx:
_, ok = res.Value.(*types.Response_DeliverTx)
case *types.Request_CheckTx:
_, ok = res.Value.(*types.Response_CheckTx)
case *types.Request_Commit:
_, ok = res.Value.(*types.Response_Commit)
case *types.Request_Query:
_, ok = res.Value.(*types.Response_Query)
case *types.Request_InitChain:
_, ok = res.Value.(*types.Response_InitChain)
case *types.Request_BeginBlock:
_, ok = res.Value.(*types.Response_BeginBlock)
case *types.Request_EndBlock:
_, ok = res.Value.(*types.Response_EndBlock)
}
return ok
}

View File

@ -0,0 +1,121 @@
package abcicli_test
import (
"errors"
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
func TestSocketClientStopForErrorDeadlock(t *testing.T) {
c := abcicli.NewSocketClient(":80", false)
err := errors.New("foo-tendermint")
// See Issue https://github.com/tendermint/abci/issues/114
doneChan := make(chan bool)
go func() {
defer close(doneChan)
c.StopForError(err)
c.StopForError(err)
}()
select {
case <-doneChan:
case <-time.After(time.Second * 4):
t.Fatalf("Test took too long, potential deadlock still exists")
}
}
func TestProperSyncCalls(t *testing.T) {
app := slowApp{}
s, c := setupClientServer(t, app)
defer s.Stop()
defer c.Stop()
resp := make(chan error, 1)
go func() {
// This is BeginBlockSync unrolled....
reqres := c.BeginBlockAsync(types.RequestBeginBlock{})
c.FlushSync()
res := reqres.Response.GetBeginBlock()
require.NotNil(t, res)
resp <- c.Error()
}()
select {
case <-time.After(time.Second):
require.Fail(t, "No response arrived")
case err, ok := <-resp:
require.True(t, ok, "Must not close channel")
assert.NoError(t, err, "This should return success")
}
}
func TestHangingSyncCalls(t *testing.T) {
app := slowApp{}
s, c := setupClientServer(t, app)
defer s.Stop()
defer c.Stop()
resp := make(chan error, 1)
go func() {
// Start BeginBlock and flush it
reqres := c.BeginBlockAsync(types.RequestBeginBlock{})
flush := c.FlushAsync()
// wait 20 ms for all events to travel socket, but
// no response yet from server
time.Sleep(20 * time.Millisecond)
// kill the server, so the connections break
s.Stop()
// wait for the response from BeginBlock
reqres.Wait()
flush.Wait()
resp <- c.Error()
}()
select {
case <-time.After(time.Second):
require.Fail(t, "No response arrived")
case err, ok := <-resp:
require.True(t, ok, "Must not close channel")
assert.Error(t, err, "We should get EOF error")
}
}
func setupClientServer(t *testing.T, app types.Application) (
cmn.Service, abcicli.Client) {
// some port between 20k and 30k
port := 20000 + cmn.RandInt32()%10000
addr := fmt.Sprintf("localhost:%d", port)
s, err := server.NewServer(addr, "socket", app)
require.NoError(t, err)
err = s.Start()
require.NoError(t, err)
c := abcicli.NewSocketClient(addr, true)
err = c.Start()
require.NoError(t, err)
return s, c
}
type slowApp struct {
types.BaseApplication
}
func (slowApp) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock {
time.Sleep(200 * time.Millisecond)
return types.ResponseBeginBlock{}
}

View File

@ -0,0 +1,733 @@
package main
import (
"bufio"
"encoding/hex"
"errors"
"fmt"
"io"
"os"
"strings"
"github.com/spf13/cobra"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/example/counter"
"github.com/tendermint/tendermint/abci/example/kvstore"
"github.com/tendermint/tendermint/abci/server"
servertest "github.com/tendermint/tendermint/abci/tests/server"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/abci/version"
"github.com/tendermint/tendermint/crypto/merkle"
)
// client is a global variable so it can be reused by the console
var (
client abcicli.Client
logger log.Logger
)
// flags
var (
// global
flagAddress string
flagAbci string
flagVerbose bool // for the println output
flagLogLevel string // for the logger
// query
flagPath string
flagHeight int
flagProve bool
// counter
flagSerial bool
// kvstore
flagPersist string
)
var RootCmd = &cobra.Command{
Use: "abci-cli",
Short: "the ABCI CLI tool wraps an ABCI client",
Long: "the ABCI CLI tool wraps an ABCI client and is used for testing ABCI servers",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
switch cmd.Use {
case "counter", "kvstore": // for the examples apps, don't pre-run
return nil
case "version": // skip running for version command
return nil
}
if logger == nil {
allowLevel, err := log.AllowLevel(flagLogLevel)
if err != nil {
return err
}
logger = log.NewFilter(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), allowLevel)
}
if client == nil {
var err error
client, err = abcicli.NewClient(flagAddress, flagAbci, false)
if err != nil {
return err
}
client.SetLogger(logger.With("module", "abci-client"))
if err := client.Start(); err != nil {
return err
}
}
return nil
},
}
// Structure for data passed to print response.
type response struct {
// generic abci response
Data []byte
Code uint32
Info string
Log string
Query *queryResponse
}
type queryResponse struct {
Key []byte
Value []byte
Height int64
Proof *merkle.Proof
}
func Execute() error {
addGlobalFlags()
addCommands()
return RootCmd.Execute()
}
func addGlobalFlags() {
RootCmd.PersistentFlags().StringVarP(&flagAddress, "address", "", "tcp://0.0.0.0:26658", "address of application socket")
RootCmd.PersistentFlags().StringVarP(&flagAbci, "abci", "", "socket", "either socket or grpc")
RootCmd.PersistentFlags().BoolVarP(&flagVerbose, "verbose", "v", false, "print the command and results as if it were a console session")
RootCmd.PersistentFlags().StringVarP(&flagLogLevel, "log_level", "", "debug", "set the logger level")
}
func addQueryFlags() {
queryCmd.PersistentFlags().StringVarP(&flagPath, "path", "", "/store", "path to prefix query with")
queryCmd.PersistentFlags().IntVarP(&flagHeight, "height", "", 0, "height to query the blockchain at")
queryCmd.PersistentFlags().BoolVarP(&flagProve, "prove", "", false, "whether or not to return a merkle proof of the query result")
}
func addCounterFlags() {
counterCmd.PersistentFlags().BoolVarP(&flagSerial, "serial", "", false, "enforce incrementing (serial) transactions")
}
func addKVStoreFlags() {
kvstoreCmd.PersistentFlags().StringVarP(&flagPersist, "persist", "", "", "directory to use for a database")
}
func addCommands() {
RootCmd.AddCommand(batchCmd)
RootCmd.AddCommand(consoleCmd)
RootCmd.AddCommand(echoCmd)
RootCmd.AddCommand(infoCmd)
RootCmd.AddCommand(setOptionCmd)
RootCmd.AddCommand(deliverTxCmd)
RootCmd.AddCommand(checkTxCmd)
RootCmd.AddCommand(commitCmd)
RootCmd.AddCommand(versionCmd)
RootCmd.AddCommand(testCmd)
addQueryFlags()
RootCmd.AddCommand(queryCmd)
// examples
addCounterFlags()
RootCmd.AddCommand(counterCmd)
addKVStoreFlags()
RootCmd.AddCommand(kvstoreCmd)
}
var batchCmd = &cobra.Command{
Use: "batch",
Short: "run a batch of abci commands against an application",
Long: `run a batch of abci commands against an application
This command is run by piping in a file containing a series of commands
you'd like to run:
abci-cli batch < example.file
where example.file looks something like:
set_option serial on
check_tx 0x00
check_tx 0xff
deliver_tx 0x00
check_tx 0x00
deliver_tx 0x01
deliver_tx 0x04
info
`,
Args: cobra.ExactArgs(0),
RunE: cmdBatch,
}
var consoleCmd = &cobra.Command{
Use: "console",
Short: "start an interactive ABCI console for multiple commands",
Long: `start an interactive ABCI console for multiple commands
This command opens an interactive console for running any of the other commands
without opening a new connection each time
`,
Args: cobra.ExactArgs(0),
ValidArgs: []string{"echo", "info", "set_option", "deliver_tx", "check_tx", "commit", "query"},
RunE: cmdConsole,
}
var echoCmd = &cobra.Command{
Use: "echo",
Short: "have the application echo a message",
Long: "have the application echo a message",
Args: cobra.ExactArgs(1),
RunE: cmdEcho,
}
var infoCmd = &cobra.Command{
Use: "info",
Short: "get some info about the application",
Long: "get some info about the application",
Args: cobra.ExactArgs(0),
RunE: cmdInfo,
}
var setOptionCmd = &cobra.Command{
Use: "set_option",
Short: "set an option on the application",
Long: "set an option on the application",
Args: cobra.ExactArgs(2),
RunE: cmdSetOption,
}
var deliverTxCmd = &cobra.Command{
Use: "deliver_tx",
Short: "deliver a new transaction to the application",
Long: "deliver a new transaction to the application",
Args: cobra.ExactArgs(1),
RunE: cmdDeliverTx,
}
var checkTxCmd = &cobra.Command{
Use: "check_tx",
Short: "validate a transaction",
Long: "validate a transaction",
Args: cobra.ExactArgs(1),
RunE: cmdCheckTx,
}
var commitCmd = &cobra.Command{
Use: "commit",
Short: "commit the application state and return the Merkle root hash",
Long: "commit the application state and return the Merkle root hash",
Args: cobra.ExactArgs(0),
RunE: cmdCommit,
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "print ABCI console version",
Long: "print ABCI console version",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println(version.Version)
return nil
},
}
var queryCmd = &cobra.Command{
Use: "query",
Short: "query the application state",
Long: "query the application state",
Args: cobra.ExactArgs(1),
RunE: cmdQuery,
}
var counterCmd = &cobra.Command{
Use: "counter",
Short: "ABCI demo example",
Long: "ABCI demo example",
Args: cobra.ExactArgs(0),
RunE: cmdCounter,
}
var kvstoreCmd = &cobra.Command{
Use: "kvstore",
Short: "ABCI demo example",
Long: "ABCI demo example",
Args: cobra.ExactArgs(0),
RunE: cmdKVStore,
}
var testCmd = &cobra.Command{
Use: "test",
Short: "run integration tests",
Long: "run integration tests",
Args: cobra.ExactArgs(0),
RunE: cmdTest,
}
// Generates new Args array based off of previous call args to maintain flag persistence
func persistentArgs(line []byte) []string {
// generate the arguments to run from original os.Args
// to maintain flag arguments
args := os.Args
args = args[:len(args)-1] // remove the previous command argument
if len(line) > 0 { // prevents introduction of extra space leading to argument parse errors
args = append(args, strings.Split(string(line), " ")...)
}
return args
}
//--------------------------------------------------------------------------------
func compose(fs []func() error) error {
if len(fs) == 0 {
return nil
} else {
err := fs[0]()
if err == nil {
return compose(fs[1:])
} else {
return err
}
}
}
func cmdTest(cmd *cobra.Command, args []string) error {
return compose(
[]func() error{
func() error { return servertest.InitChain(client) },
func() error { return servertest.SetOption(client, "serial", "on") },
func() error { return servertest.Commit(client, nil) },
func() error { return servertest.DeliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil) },
func() error { return servertest.Commit(client, nil) },
func() error { return servertest.DeliverTx(client, []byte{0x00}, code.CodeTypeOK, nil) },
func() error { return servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) },
func() error { return servertest.DeliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil) },
func() error { return servertest.DeliverTx(client, []byte{0x01}, code.CodeTypeOK, nil) },
func() error { return servertest.DeliverTx(client, []byte{0x00, 0x02}, code.CodeTypeOK, nil) },
func() error { return servertest.DeliverTx(client, []byte{0x00, 0x03}, code.CodeTypeOK, nil) },
func() error { return servertest.DeliverTx(client, []byte{0x00, 0x00, 0x04}, code.CodeTypeOK, nil) },
func() error {
return servertest.DeliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil)
},
func() error { return servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) },
})
}
func cmdBatch(cmd *cobra.Command, args []string) error {
bufReader := bufio.NewReader(os.Stdin)
LOOP:
for {
line, more, err := bufReader.ReadLine()
switch {
case more:
return errors.New("Input line is too long")
case err == io.EOF:
break LOOP
case len(line) == 0:
continue
case err != nil:
return err
}
cmdArgs := persistentArgs(line)
if err := muxOnCommands(cmd, cmdArgs); err != nil {
return err
}
fmt.Println()
}
return nil
}
func cmdConsole(cmd *cobra.Command, args []string) error {
for {
fmt.Printf("> ")
bufReader := bufio.NewReader(os.Stdin)
line, more, err := bufReader.ReadLine()
if more {
return errors.New("Input is too long")
} else if err != nil {
return err
}
pArgs := persistentArgs(line)
if err := muxOnCommands(cmd, pArgs); err != nil {
return err
}
}
}
func muxOnCommands(cmd *cobra.Command, pArgs []string) error {
if len(pArgs) < 2 {
return errors.New("expecting persistent args of the form: abci-cli [command] <...>")
}
// TODO: this parsing is fragile
args := []string{}
for i := 0; i < len(pArgs); i++ {
arg := pArgs[i]
// check for flags
if strings.HasPrefix(arg, "-") {
// if it has an equal, we can just skip
if strings.Contains(arg, "=") {
continue
}
// if its a boolean, we can just skip
_, err := cmd.Flags().GetBool(strings.TrimLeft(arg, "-"))
if err == nil {
continue
}
// otherwise, we need to skip the next one too
i++
continue
}
// append the actual arg
args = append(args, arg)
}
var subCommand string
var actualArgs []string
if len(args) > 1 {
subCommand = args[1]
}
if len(args) > 2 {
actualArgs = args[2:]
}
cmd.Use = subCommand // for later print statements ...
switch strings.ToLower(subCommand) {
case "check_tx":
return cmdCheckTx(cmd, actualArgs)
case "commit":
return cmdCommit(cmd, actualArgs)
case "deliver_tx":
return cmdDeliverTx(cmd, actualArgs)
case "echo":
return cmdEcho(cmd, actualArgs)
case "info":
return cmdInfo(cmd, actualArgs)
case "query":
return cmdQuery(cmd, actualArgs)
case "set_option":
return cmdSetOption(cmd, actualArgs)
default:
return cmdUnimplemented(cmd, pArgs)
}
}
func cmdUnimplemented(cmd *cobra.Command, args []string) error {
msg := "unimplemented command"
if len(args) > 0 {
msg += fmt.Sprintf(" args: [%s]", strings.Join(args, " "))
}
printResponse(cmd, args, response{
Code: codeBad,
Log: msg,
})
fmt.Println("Available commands:")
fmt.Printf("%s: %s\n", echoCmd.Use, echoCmd.Short)
fmt.Printf("%s: %s\n", infoCmd.Use, infoCmd.Short)
fmt.Printf("%s: %s\n", checkTxCmd.Use, checkTxCmd.Short)
fmt.Printf("%s: %s\n", deliverTxCmd.Use, deliverTxCmd.Short)
fmt.Printf("%s: %s\n", queryCmd.Use, queryCmd.Short)
fmt.Printf("%s: %s\n", commitCmd.Use, commitCmd.Short)
fmt.Printf("%s: %s\n", setOptionCmd.Use, setOptionCmd.Short)
fmt.Println("Use \"[command] --help\" for more information about a command.")
return nil
}
// Have the application echo a message
func cmdEcho(cmd *cobra.Command, args []string) error {
msg := ""
if len(args) > 0 {
msg = args[0]
}
res, err := client.EchoSync(msg)
if err != nil {
return err
}
printResponse(cmd, args, response{
Data: []byte(res.Message),
})
return nil
}
// Get some info from the application
func cmdInfo(cmd *cobra.Command, args []string) error {
var version string
if len(args) == 1 {
version = args[0]
}
res, err := client.InfoSync(types.RequestInfo{Version: version})
if err != nil {
return err
}
printResponse(cmd, args, response{
Data: []byte(res.Data),
})
return nil
}
const codeBad uint32 = 10
// Set an option on the application
func cmdSetOption(cmd *cobra.Command, args []string) error {
if len(args) < 2 {
printResponse(cmd, args, response{
Code: codeBad,
Log: "want at least arguments of the form: <key> <value>",
})
return nil
}
key, val := args[0], args[1]
_, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: val})
if err != nil {
return err
}
printResponse(cmd, args, response{Log: "OK (SetOption doesn't return anything.)"}) // NOTE: Nothing to show...
return nil
}
// Append a new tx to application
func cmdDeliverTx(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
printResponse(cmd, args, response{
Code: codeBad,
Log: "want the tx",
})
return nil
}
txBytes, err := stringOrHexToBytes(args[0])
if err != nil {
return err
}
res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes})
if err != nil {
return err
}
printResponse(cmd, args, response{
Code: res.Code,
Data: res.Data,
Info: res.Info,
Log: res.Log,
})
return nil
}
// Validate a tx
func cmdCheckTx(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
printResponse(cmd, args, response{
Code: codeBad,
Info: "want the tx",
})
return nil
}
txBytes, err := stringOrHexToBytes(args[0])
if err != nil {
return err
}
res, err := client.CheckTxSync(types.RequestCheckTx{Tx: txBytes})
if err != nil {
return err
}
printResponse(cmd, args, response{
Code: res.Code,
Data: res.Data,
Info: res.Info,
Log: res.Log,
})
return nil
}
// Get application Merkle root hash
func cmdCommit(cmd *cobra.Command, args []string) error {
res, err := client.CommitSync()
if err != nil {
return err
}
printResponse(cmd, args, response{
Data: res.Data,
})
return nil
}
// Query application state
func cmdQuery(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
printResponse(cmd, args, response{
Code: codeBad,
Info: "want the query",
Log: "",
})
return nil
}
queryBytes, err := stringOrHexToBytes(args[0])
if err != nil {
return err
}
resQuery, err := client.QuerySync(types.RequestQuery{
Data: queryBytes,
Path: flagPath,
Height: int64(flagHeight),
Prove: flagProve,
})
if err != nil {
return err
}
printResponse(cmd, args, response{
Code: resQuery.Code,
Info: resQuery.Info,
Log: resQuery.Log,
Query: &queryResponse{
Key: resQuery.Key,
Value: resQuery.Value,
Height: resQuery.Height,
Proof: resQuery.Proof,
},
})
return nil
}
func cmdCounter(cmd *cobra.Command, args []string) error {
app := counter.NewCounterApplication(flagSerial)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
// Start the listener
srv, err := server.NewServer(flagAddress, flagAbci, app)
if err != nil {
return err
}
srv.SetLogger(logger.With("module", "abci-server"))
if err := srv.Start(); err != nil {
return err
}
// Stop upon receiving SIGTERM or CTRL-C.
cmn.TrapSignal(logger, func() {
// Cleanup
srv.Stop()
})
// Run forever.
select {}
}
func cmdKVStore(cmd *cobra.Command, args []string) error {
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
// Create the application - in memory or persisted to disk
var app types.Application
if flagPersist == "" {
app = kvstore.NewKVStoreApplication()
} else {
app = kvstore.NewPersistentKVStoreApplication(flagPersist)
app.(*kvstore.PersistentKVStoreApplication).SetLogger(logger.With("module", "kvstore"))
}
// Start the listener
srv, err := server.NewServer(flagAddress, flagAbci, app)
if err != nil {
return err
}
srv.SetLogger(logger.With("module", "abci-server"))
if err := srv.Start(); err != nil {
return err
}
// Stop upon receiving SIGTERM or CTRL-C.
cmn.TrapSignal(logger, func() {
// Cleanup
srv.Stop()
})
// Run forever.
select {}
}
//--------------------------------------------------------------------------------
func printResponse(cmd *cobra.Command, args []string, rsp response) {
if flagVerbose {
fmt.Println(">", cmd.Use, strings.Join(args, " "))
}
// Always print the status code.
if rsp.Code == types.CodeTypeOK {
fmt.Printf("-> code: OK\n")
} else {
fmt.Printf("-> code: %d\n", rsp.Code)
}
if len(rsp.Data) != 0 {
// Do no print this line when using the commit command
// because the string comes out as gibberish
if cmd.Use != "commit" {
fmt.Printf("-> data: %s\n", rsp.Data)
}
fmt.Printf("-> data.hex: 0x%X\n", rsp.Data)
}
if rsp.Log != "" {
fmt.Printf("-> log: %s\n", rsp.Log)
}
if rsp.Query != nil {
fmt.Printf("-> height: %d\n", rsp.Query.Height)
if rsp.Query.Key != nil {
fmt.Printf("-> key: %s\n", rsp.Query.Key)
fmt.Printf("-> key.hex: %X\n", rsp.Query.Key)
}
if rsp.Query.Value != nil {
fmt.Printf("-> value: %s\n", rsp.Query.Value)
fmt.Printf("-> value.hex: %X\n", rsp.Query.Value)
}
if rsp.Query.Proof != nil {
fmt.Printf("-> proof: %#v\n", rsp.Query.Proof)
}
}
}
// NOTE: s is interpreted as a string unless prefixed with 0x
func stringOrHexToBytes(s string) ([]byte, error) {
if len(s) > 2 && strings.ToLower(s[:2]) == "0x" {
b, err := hex.DecodeString(s[2:])
if err != nil {
err = fmt.Errorf("Error decoding hex argument: %s", err.Error())
return nil, err
}
return b, nil
}
if !strings.HasPrefix(s, "\"") || !strings.HasSuffix(s, "\"") {
err := fmt.Errorf("Invalid string arg: \"%s\". Must be quoted or a \"0x\"-prefixed hex string", s)
return nil, err
}
return []byte(s[1 : len(s)-1]), nil
}

14
abci/cmd/abci-cli/main.go Normal file
View File

@ -0,0 +1,14 @@
package main
import (
"fmt"
"os"
)
func main() {
err := Execute()
if err != nil {
fmt.Print(err)
os.Exit(1)
}
}

10
abci/example/code/code.go Normal file
View File

@ -0,0 +1,10 @@
package code
// Return codes for the examples
const (
CodeTypeOK uint32 = 0
CodeTypeEncodingError uint32 = 1
CodeTypeBadNonce uint32 = 2
CodeTypeUnauthorized uint32 = 3
CodeTypeUnknownError uint32 = 4
)

View File

@ -0,0 +1,103 @@
package counter
import (
"encoding/binary"
"fmt"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
)
type CounterApplication struct {
types.BaseApplication
hashCount int
txCount int
serial bool
}
func NewCounterApplication(serial bool) *CounterApplication {
return &CounterApplication{serial: serial}
}
func (app *CounterApplication) Info(req types.RequestInfo) types.ResponseInfo {
return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)}
}
func (app *CounterApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption {
key, value := req.Key, req.Value
if key == "serial" && value == "on" {
app.serial = true
} else {
/*
TODO Panic and have the ABCI server pass an exception.
The client can call SetOptionSync() and get an `error`.
return types.ResponseSetOption{
Error: fmt.Sprintf("Unknown key (%s) or value (%s)", key, value),
}
*/
return types.ResponseSetOption{}
}
return types.ResponseSetOption{}
}
func (app *CounterApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx {
if app.serial {
if len(req.Tx) > 8 {
return types.ResponseDeliverTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))}
}
tx8 := make([]byte, 8)
copy(tx8[len(tx8)-len(req.Tx):], req.Tx)
txValue := binary.BigEndian.Uint64(tx8)
if txValue != uint64(app.txCount) {
return types.ResponseDeliverTx{
Code: code.CodeTypeBadNonce,
Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)}
}
}
app.txCount++
return types.ResponseDeliverTx{Code: code.CodeTypeOK}
}
func (app *CounterApplication) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx {
if app.serial {
if len(req.Tx) > 8 {
return types.ResponseCheckTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))}
}
tx8 := make([]byte, 8)
copy(tx8[len(tx8)-len(req.Tx):], req.Tx)
txValue := binary.BigEndian.Uint64(tx8)
if txValue < uint64(app.txCount) {
return types.ResponseCheckTx{
Code: code.CodeTypeBadNonce,
Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)}
}
}
return types.ResponseCheckTx{Code: code.CodeTypeOK}
}
func (app *CounterApplication) Commit() (resp types.ResponseCommit) {
app.hashCount++
if app.txCount == 0 {
return types.ResponseCommit{}
}
hash := make([]byte, 8)
binary.BigEndian.PutUint64(hash, uint64(app.txCount))
return types.ResponseCommit{Data: hash}
}
func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery {
switch reqQuery.Path {
case "hash":
return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))}
case "tx":
return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))}
default:
return types.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)}
}
}

3
abci/example/example.go Normal file
View File

@ -0,0 +1,3 @@
package example
// so the go tool doesn't return errors about no buildable go files ...

View File

@ -0,0 +1,156 @@
package example
import (
"fmt"
"net"
"reflect"
"testing"
"time"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"golang.org/x/net/context"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/example/kvstore"
abciserver "github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
)
func TestKVStore(t *testing.T) {
fmt.Println("### Testing KVStore")
testStream(t, kvstore.NewKVStoreApplication())
}
func TestBaseApp(t *testing.T) {
fmt.Println("### Testing BaseApp")
testStream(t, types.NewBaseApplication())
}
func TestGRPC(t *testing.T) {
fmt.Println("### Testing GRPC")
testGRPCSync(t, types.NewGRPCApplication(types.NewBaseApplication()))
}
func testStream(t *testing.T, app types.Application) {
numDeliverTxs := 20000
// Start the listener
server := abciserver.NewSocketServer("unix://test.sock", app)
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
if err := server.Start(); err != nil {
require.NoError(t, err, "Error starting socket server")
}
defer server.Stop()
// Connect to the socket
client := abcicli.NewSocketClient("unix://test.sock", false)
client.SetLogger(log.TestingLogger().With("module", "abci-client"))
if err := client.Start(); err != nil {
t.Fatalf("Error starting socket client: %v", err.Error())
}
defer client.Stop()
done := make(chan struct{})
counter := 0
client.SetResponseCallback(func(req *types.Request, res *types.Response) {
// Process response
switch r := res.Value.(type) {
case *types.Response_DeliverTx:
counter++
if r.DeliverTx.Code != code.CodeTypeOK {
t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code)
}
if counter > numDeliverTxs {
t.Fatalf("Too many DeliverTx responses. Got %d, expected %d", counter, numDeliverTxs)
}
if counter == numDeliverTxs {
go func() {
time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow
close(done)
}()
return
}
case *types.Response_Flush:
// ignore
default:
t.Error("Unexpected response type", reflect.TypeOf(res.Value))
}
})
// Write requests
for counter := 0; counter < numDeliverTxs; counter++ {
// Send request
reqRes := client.DeliverTxAsync(types.RequestDeliverTx{Tx: []byte("test")})
_ = reqRes
// check err ?
// Sometimes send flush messages
if counter%123 == 0 {
client.FlushAsync()
// check err ?
}
}
// Send final flush message
client.FlushAsync()
<-done
}
//-------------------------
// test grpc
func dialerFunc(ctx context.Context, addr string) (net.Conn, error) {
return cmn.Connect(addr)
}
func testGRPCSync(t *testing.T, app *types.GRPCApplication) {
numDeliverTxs := 2000
// Start the listener
server := abciserver.NewGRPCServer("unix://test.sock", app)
server.SetLogger(log.TestingLogger().With("module", "abci-server"))
if err := server.Start(); err != nil {
t.Fatalf("Error starting GRPC server: %v", err.Error())
}
defer server.Stop()
// Connect to the socket
conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc))
if err != nil {
t.Fatalf("Error dialing GRPC server: %v", err.Error())
}
defer conn.Close()
client := types.NewABCIApplicationClient(conn)
// Write requests
for counter := 0; counter < numDeliverTxs; counter++ {
// Send request
response, err := client.DeliverTx(context.Background(), &types.RequestDeliverTx{Tx: []byte("test")})
if err != nil {
t.Fatalf("Error in GRPC DeliverTx: %v", err.Error())
}
counter++
if response.Code != code.CodeTypeOK {
t.Error("DeliverTx failed with ret_code", response.Code)
}
if counter > numDeliverTxs {
t.Fatal("Too many DeliverTx responses")
}
t.Log("response", counter)
if counter == numDeliverTxs {
go func() {
time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow
}()
}
}
}

1
abci/example/js/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -0,0 +1 @@
This example has been moved here: https://github.com/tendermint/js-abci/tree/master/example

View File

@ -0,0 +1,31 @@
# KVStore
There are two app's here: the KVStoreApplication and the PersistentKVStoreApplication.
## KVStoreApplication
The KVStoreApplication is a simple merkle key-value store.
Transactions of the form `key=value` are stored as key-value pairs in the tree.
Transactions without an `=` sign set the value to the key.
The app has no replay protection (other than what the mempool provides).
## PersistentKVStoreApplication
The PersistentKVStoreApplication wraps the KVStoreApplication
and provides two additional features:
1) persistence of state across app restarts (using Tendermint's ABCI-Handshake mechanism)
2) validator set changes
The state is persisted in leveldb along with the last block committed,
and the Handshake allows any necessary blocks to be replayed.
Validator set changes are effected using the following transaction format:
```
"val:pubkey1!power1,pubkey2!power2,pubkey3!power3"
```
where `pubkeyN` is a base64-encoded 32-byte ed25519 key and `powerN` is a new voting power for the validator with `pubkeyN` (possibly a new one).
To remove a validator from the validator set, set power to `0`.
There is no sybil protection against new validators joining.

View File

@ -0,0 +1,36 @@
package kvstore
import (
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
// RandVal creates one random validator, with a key derived
// from the input value
func RandVal(i int) types.ValidatorUpdate {
pubkey := cmn.RandBytes(32)
power := cmn.RandUint16() + 1
v := types.Ed25519ValidatorUpdate(pubkey, int64(power))
return v
}
// RandVals returns a list of cnt validators for initializing
// the application. Note that the keys are deterministically
// derived from the index in the array, while the power is
// random (Change this if not desired)
func RandVals(cnt int) []types.ValidatorUpdate {
res := make([]types.ValidatorUpdate, cnt)
for i := 0; i < cnt; i++ {
res[i] = RandVal(i)
}
return res
}
// InitKVStore initializes the kvstore app with some data,
// which allows tests to pass and is fine as long as you
// don't make any tx that modify the validator state
func InitKVStore(app *PersistentKVStoreApplication) {
app.InitChain(types.RequestInitChain{
Validators: RandVals(1),
})
}

View File

@ -0,0 +1,142 @@
package kvstore
import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/version"
dbm "github.com/tendermint/tm-db"
)
var (
stateKey = []byte("stateKey")
kvPairPrefixKey = []byte("kvPairKey:")
ProtocolVersion version.Protocol = 0x1
)
type State struct {
db dbm.DB
Size int64 `json:"size"`
Height int64 `json:"height"`
AppHash []byte `json:"app_hash"`
}
func loadState(db dbm.DB) State {
stateBytes := db.Get(stateKey)
var state State
if len(stateBytes) != 0 {
err := json.Unmarshal(stateBytes, &state)
if err != nil {
panic(err)
}
}
state.db = db
return state
}
func saveState(state State) {
stateBytes, err := json.Marshal(state)
if err != nil {
panic(err)
}
state.db.Set(stateKey, stateBytes)
}
func prefixKey(key []byte) []byte {
return append(kvPairPrefixKey, key...)
}
//---------------------------------------------------
var _ types.Application = (*KVStoreApplication)(nil)
type KVStoreApplication struct {
types.BaseApplication
state State
}
func NewKVStoreApplication() *KVStoreApplication {
state := loadState(dbm.NewMemDB())
return &KVStoreApplication{state: state}
}
func (app *KVStoreApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo) {
return types.ResponseInfo{
Data: fmt.Sprintf("{\"size\":%v}", app.state.Size),
Version: version.ABCIVersion,
AppVersion: ProtocolVersion.Uint64(),
}
}
// tx is either "key=value" or just arbitrary bytes
func (app *KVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx {
var key, value []byte
parts := bytes.Split(req.Tx, []byte("="))
if len(parts) == 2 {
key, value = parts[0], parts[1]
} else {
key, value = req.Tx, req.Tx
}
app.state.db.Set(prefixKey(key), value)
app.state.Size += 1
events := []types.Event{
{
Type: "app",
Attributes: []cmn.KVPair{
{Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko")},
{Key: []byte("key"), Value: key},
},
},
}
return types.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events}
}
func (app *KVStoreApplication) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx {
return types.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1}
}
func (app *KVStoreApplication) Commit() types.ResponseCommit {
// Using a memdb - just return the big endian size of the db
appHash := make([]byte, 8)
binary.PutVarint(appHash, app.state.Size)
app.state.AppHash = appHash
app.state.Height += 1
saveState(app.state)
return types.ResponseCommit{Data: appHash}
}
// Returns an associated value or nil if missing.
func (app *KVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) {
if reqQuery.Prove {
value := app.state.db.Get(prefixKey(reqQuery.Data))
resQuery.Index = -1 // TODO make Proof return index
resQuery.Key = reqQuery.Data
resQuery.Value = value
if value != nil {
resQuery.Log = "exists"
} else {
resQuery.Log = "does not exist"
}
return
} else {
resQuery.Key = reqQuery.Data
value := app.state.db.Get(prefixKey(reqQuery.Data))
resQuery.Value = value
if value != nil {
resQuery.Log = "exists"
} else {
resQuery.Log = "does not exist"
}
return
}
}

View File

@ -0,0 +1,312 @@
package kvstore
import (
"bytes"
"fmt"
"io/ioutil"
"sort"
"testing"
"github.com/stretchr/testify/require"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/example/code"
abciserver "github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
)
func testKVStore(t *testing.T, app types.Application, tx []byte, key, value string) {
req := types.RequestDeliverTx{Tx: tx}
ar := app.DeliverTx(req)
require.False(t, ar.IsErr(), ar)
// repeating tx doesn't raise error
ar = app.DeliverTx(req)
require.False(t, ar.IsErr(), ar)
// make sure query is fine
resQuery := app.Query(types.RequestQuery{
Path: "/store",
Data: []byte(key),
})
require.Equal(t, code.CodeTypeOK, resQuery.Code)
require.Equal(t, value, string(resQuery.Value))
// make sure proof is fine
resQuery = app.Query(types.RequestQuery{
Path: "/store",
Data: []byte(key),
Prove: true,
})
require.EqualValues(t, code.CodeTypeOK, resQuery.Code)
require.Equal(t, value, string(resQuery.Value))
}
func TestKVStoreKV(t *testing.T) {
kvstore := NewKVStoreApplication()
key := "abc"
value := key
tx := []byte(key)
testKVStore(t, kvstore, tx, key, value)
value = "def"
tx = []byte(key + "=" + value)
testKVStore(t, kvstore, tx, key, value)
}
func TestPersistentKVStoreKV(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-kvstore-test") // TODO
if err != nil {
t.Fatal(err)
}
kvstore := NewPersistentKVStoreApplication(dir)
key := "abc"
value := key
tx := []byte(key)
testKVStore(t, kvstore, tx, key, value)
value = "def"
tx = []byte(key + "=" + value)
testKVStore(t, kvstore, tx, key, value)
}
func TestPersistentKVStoreInfo(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-kvstore-test") // TODO
if err != nil {
t.Fatal(err)
}
kvstore := NewPersistentKVStoreApplication(dir)
InitKVStore(kvstore)
height := int64(0)
resInfo := kvstore.Info(types.RequestInfo{})
if resInfo.LastBlockHeight != height {
t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight)
}
// make and apply block
height = int64(1)
hash := []byte("foo")
header := types.Header{
Height: int64(height),
}
kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header})
kvstore.EndBlock(types.RequestEndBlock{Height: header.Height})
kvstore.Commit()
resInfo = kvstore.Info(types.RequestInfo{})
if resInfo.LastBlockHeight != height {
t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight)
}
}
// add a validator, remove a validator, update a validator
func TestValUpdates(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-kvstore-test") // TODO
if err != nil {
t.Fatal(err)
}
kvstore := NewPersistentKVStoreApplication(dir)
// init with some validators
total := 10
nInit := 5
vals := RandVals(total)
// iniitalize with the first nInit
kvstore.InitChain(types.RequestInitChain{
Validators: vals[:nInit],
})
vals1, vals2 := vals[:nInit], kvstore.Validators()
valsEqual(t, vals1, vals2)
var v1, v2, v3 types.ValidatorUpdate
// add some validators
v1, v2 = vals[nInit], vals[nInit+1]
diff := []types.ValidatorUpdate{v1, v2}
tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power)
tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power)
makeApplyBlock(t, kvstore, 1, diff, tx1, tx2)
vals1, vals2 = vals[:nInit+2], kvstore.Validators()
valsEqual(t, vals1, vals2)
// remove some validators
v1, v2, v3 = vals[nInit-2], vals[nInit-1], vals[nInit]
v1.Power = 0
v2.Power = 0
v3.Power = 0
diff = []types.ValidatorUpdate{v1, v2, v3}
tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power)
tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power)
tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power)
makeApplyBlock(t, kvstore, 2, diff, tx1, tx2, tx3)
vals1 = append(vals[:nInit-2], vals[nInit+1]) // nolint: gocritic
vals2 = kvstore.Validators()
valsEqual(t, vals1, vals2)
// update some validators
v1 = vals[0]
if v1.Power == 5 {
v1.Power = 6
} else {
v1.Power = 5
}
diff = []types.ValidatorUpdate{v1}
tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power)
makeApplyBlock(t, kvstore, 3, diff, tx1)
vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...)
vals2 = kvstore.Validators()
valsEqual(t, vals1, vals2)
}
func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff []types.ValidatorUpdate, txs ...[]byte) {
// make and apply block
height := int64(heightInt)
hash := []byte("foo")
header := types.Header{
Height: height,
}
kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header})
for _, tx := range txs {
if r := kvstore.DeliverTx(types.RequestDeliverTx{Tx: tx}); r.IsErr() {
t.Fatal(r)
}
}
resEndBlock := kvstore.EndBlock(types.RequestEndBlock{Height: header.Height})
kvstore.Commit()
valsEqual(t, diff, resEndBlock.ValidatorUpdates)
}
// order doesn't matter
func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) {
if len(vals1) != len(vals2) {
t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1))
}
sort.Sort(types.ValidatorUpdates(vals1))
sort.Sort(types.ValidatorUpdates(vals2))
for i, v1 := range vals1 {
v2 := vals2[i]
if !bytes.Equal(v1.PubKey.Data, v2.PubKey.Data) ||
v1.Power != v2.Power {
t.Fatalf("vals dont match at index %d. got %X/%d , expected %X/%d", i, v2.PubKey, v2.Power, v1.PubKey, v1.Power)
}
}
}
func makeSocketClientServer(app types.Application, name string) (abcicli.Client, cmn.Service, error) {
// Start the listener
socket := fmt.Sprintf("unix://%s.sock", name)
logger := log.TestingLogger()
server := abciserver.NewSocketServer(socket, app)
server.SetLogger(logger.With("module", "abci-server"))
if err := server.Start(); err != nil {
return nil, nil, err
}
// Connect to the socket
client := abcicli.NewSocketClient(socket, false)
client.SetLogger(logger.With("module", "abci-client"))
if err := client.Start(); err != nil {
server.Stop()
return nil, nil, err
}
return client, server, nil
}
func makeGRPCClientServer(app types.Application, name string) (abcicli.Client, cmn.Service, error) {
// Start the listener
socket := fmt.Sprintf("unix://%s.sock", name)
logger := log.TestingLogger()
gapp := types.NewGRPCApplication(app)
server := abciserver.NewGRPCServer(socket, gapp)
server.SetLogger(logger.With("module", "abci-server"))
if err := server.Start(); err != nil {
return nil, nil, err
}
client := abcicli.NewGRPCClient(socket, true)
client.SetLogger(logger.With("module", "abci-client"))
if err := client.Start(); err != nil {
server.Stop()
return nil, nil, err
}
return client, server, nil
}
func TestClientServer(t *testing.T) {
// set up socket app
kvstore := NewKVStoreApplication()
client, server, err := makeSocketClientServer(kvstore, "kvstore-socket")
require.Nil(t, err)
defer server.Stop()
defer client.Stop()
runClientTests(t, client)
// set up grpc app
kvstore = NewKVStoreApplication()
gclient, gserver, err := makeGRPCClientServer(kvstore, "kvstore-grpc")
require.Nil(t, err)
defer gserver.Stop()
defer gclient.Stop()
runClientTests(t, gclient)
}
func runClientTests(t *testing.T, client abcicli.Client) {
// run some tests....
key := "abc"
value := key
tx := []byte(key)
testClient(t, client, tx, key, value)
value = "def"
tx = []byte(key + "=" + value)
testClient(t, client, tx, key, value)
}
func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) {
ar, err := app.DeliverTxSync(types.RequestDeliverTx{Tx: tx})
require.NoError(t, err)
require.False(t, ar.IsErr(), ar)
// repeating tx doesn't raise error
ar, err = app.DeliverTxSync(types.RequestDeliverTx{Tx: tx})
require.NoError(t, err)
require.False(t, ar.IsErr(), ar)
// make sure query is fine
resQuery, err := app.QuerySync(types.RequestQuery{
Path: "/store",
Data: []byte(key),
})
require.Nil(t, err)
require.Equal(t, code.CodeTypeOK, resQuery.Code)
require.Equal(t, value, string(resQuery.Value))
// make sure proof is fine
resQuery, err = app.QuerySync(types.RequestQuery{
Path: "/store",
Data: []byte(key),
Prove: true,
})
require.Nil(t, err)
require.Equal(t, code.CodeTypeOK, resQuery.Code)
require.Equal(t, value, string(resQuery.Value))
}

View File

@ -0,0 +1,237 @@
package kvstore
import (
"bytes"
"encoding/base64"
"fmt"
"strconv"
"strings"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/libs/log"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
)
const (
ValidatorSetChangePrefix string = "val:"
)
//-----------------------------------------
var _ types.Application = (*PersistentKVStoreApplication)(nil)
type PersistentKVStoreApplication struct {
app *KVStoreApplication
// validator set
ValUpdates []types.ValidatorUpdate
valAddrToPubKeyMap map[string]types.PubKey
logger log.Logger
}
func NewPersistentKVStoreApplication(dbDir string) *PersistentKVStoreApplication {
name := "kvstore"
db, err := dbm.NewGoLevelDB(name, dbDir)
if err != nil {
panic(err)
}
state := loadState(db)
return &PersistentKVStoreApplication{
app: &KVStoreApplication{state: state},
valAddrToPubKeyMap: make(map[string]types.PubKey),
logger: log.NewNopLogger(),
}
}
func (app *PersistentKVStoreApplication) SetLogger(l log.Logger) {
app.logger = l
}
func (app *PersistentKVStoreApplication) Info(req types.RequestInfo) types.ResponseInfo {
res := app.app.Info(req)
res.LastBlockHeight = app.app.state.Height
res.LastBlockAppHash = app.app.state.AppHash
return res
}
func (app *PersistentKVStoreApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption {
return app.app.SetOption(req)
}
// tx is either "val:pubkey!power" or "key=value" or just arbitrary bytes
func (app *PersistentKVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx {
// if it starts with "val:", update the validator set
// format is "val:pubkey!power"
if isValidatorTx(req.Tx) {
// update validators in the merkle tree
// and in app.ValUpdates
return app.execValidatorTx(req.Tx)
}
// otherwise, update the key-value store
return app.app.DeliverTx(req)
}
func (app *PersistentKVStoreApplication) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx {
return app.app.CheckTx(req)
}
// Commit will panic if InitChain was not called
func (app *PersistentKVStoreApplication) Commit() types.ResponseCommit {
return app.app.Commit()
}
// When path=/val and data={validator address}, returns the validator update (types.ValidatorUpdate) varint encoded.
// For any other path, returns an associated value or nil if missing.
func (app *PersistentKVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) {
switch reqQuery.Path {
case "/val":
key := []byte("val:" + string(reqQuery.Data))
value := app.app.state.db.Get(key)
resQuery.Key = reqQuery.Data
resQuery.Value = value
return
default:
return app.app.Query(reqQuery)
}
}
// Save the validators in the merkle tree
func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain {
for _, v := range req.Validators {
r := app.updateValidator(v)
if r.IsErr() {
app.logger.Error("Error updating validators", "r", r)
}
}
return types.ResponseInitChain{}
}
// Track the block hash and header information
func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock {
// reset valset changes
app.ValUpdates = make([]types.ValidatorUpdate, 0)
for _, ev := range req.ByzantineValidators {
if ev.Type == tmtypes.ABCIEvidenceTypeDuplicateVote {
// decrease voting power by 1
if ev.TotalVotingPower == 0 {
continue
}
app.updateValidator(types.ValidatorUpdate{
PubKey: app.valAddrToPubKeyMap[string(ev.Validator.Address)],
Power: ev.TotalVotingPower - 1,
})
}
}
return types.ResponseBeginBlock{}
}
// Update the validator set
func (app *PersistentKVStoreApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock {
return types.ResponseEndBlock{ValidatorUpdates: app.ValUpdates}
}
//---------------------------------------------
// update validators
func (app *PersistentKVStoreApplication) Validators() (validators []types.ValidatorUpdate) {
itr := app.app.state.db.Iterator(nil, nil)
for ; itr.Valid(); itr.Next() {
if isValidatorTx(itr.Key()) {
validator := new(types.ValidatorUpdate)
err := types.ReadMessage(bytes.NewBuffer(itr.Value()), validator)
if err != nil {
panic(err)
}
validators = append(validators, *validator)
}
}
return
}
func MakeValSetChangeTx(pubkey types.PubKey, power int64) []byte {
pubStr := base64.StdEncoding.EncodeToString(pubkey.Data)
return []byte(fmt.Sprintf("val:%s!%d", pubStr, power))
}
func isValidatorTx(tx []byte) bool {
return strings.HasPrefix(string(tx), ValidatorSetChangePrefix)
}
// format is "val:pubkey!power"
// pubkey is a base64-encoded 32-byte ed25519 key
func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.ResponseDeliverTx {
tx = tx[len(ValidatorSetChangePrefix):]
//get the pubkey and power
pubKeyAndPower := strings.Split(string(tx), "!")
if len(pubKeyAndPower) != 2 {
return types.ResponseDeliverTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Expected 'pubkey!power'. Got %v", pubKeyAndPower)}
}
pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1]
// decode the pubkey
pubkey, err := base64.StdEncoding.DecodeString(pubkeyS)
if err != nil {
return types.ResponseDeliverTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Pubkey (%s) is invalid base64", pubkeyS)}
}
// decode the power
power, err := strconv.ParseInt(powerS, 10, 64)
if err != nil {
return types.ResponseDeliverTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Power (%s) is not an int", powerS)}
}
// update
return app.updateValidator(types.Ed25519ValidatorUpdate(pubkey, int64(power)))
}
// add, update, or remove a validator
func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) types.ResponseDeliverTx {
key := []byte("val:" + string(v.PubKey.Data))
pubkey := ed25519.PubKeyEd25519{}
copy(pubkey[:], v.PubKey.Data)
if v.Power == 0 {
// remove validator
if !app.app.state.db.Has(key) {
pubStr := base64.StdEncoding.EncodeToString(v.PubKey.Data)
return types.ResponseDeliverTx{
Code: code.CodeTypeUnauthorized,
Log: fmt.Sprintf("Cannot remove non-existent validator %s", pubStr)}
}
app.app.state.db.Delete(key)
delete(app.valAddrToPubKeyMap, string(pubkey.Address()))
} else {
// add or update validator
value := bytes.NewBuffer(make([]byte, 0))
if err := types.WriteMessage(&v, value); err != nil {
return types.ResponseDeliverTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Error encoding validator: %v", err)}
}
app.app.state.db.Set(key, value.Bytes())
app.valAddrToPubKeyMap[string(pubkey.Address())] = v.PubKey
}
// we only update the changes array if we successfully updated the tree
app.ValUpdates = append(app.ValUpdates, v)
return types.ResponseDeliverTx{Code: code.CodeTypeOK}
}

View File

View File

@ -0,0 +1,50 @@
from wire import decode_string
# map type_byte to message name
message_types = {
0x01: "echo",
0x02: "flush",
0x03: "info",
0x04: "set_option",
0x21: "deliver_tx",
0x22: "check_tx",
0x23: "commit",
0x24: "add_listener",
0x25: "rm_listener",
}
# return the decoded arguments of abci messages
class RequestDecoder():
def __init__(self, reader):
self.reader = reader
def echo(self):
return decode_string(self.reader)
def flush(self):
return
def info(self):
return
def set_option(self):
return decode_string(self.reader), decode_string(self.reader)
def deliver_tx(self):
return decode_string(self.reader)
def check_tx(self):
return decode_string(self.reader)
def commit(self):
return
def add_listener(self):
# TODO
return
def rm_listener(self):
# TODO
return

View File

@ -0,0 +1,56 @@
# Simple read() method around a bytearray
class BytesBuffer():
def __init__(self, b):
self.buf = b
self.readCount = 0
def count(self):
return self.readCount
def reset_count(self):
self.readCount = 0
def size(self):
return len(self.buf)
def peek(self):
return self.buf[0]
def write(self, b):
# b should be castable to byte array
self.buf += bytearray(b)
def read(self, n):
if len(self.buf) < n:
print "reader err: buf less than n"
# TODO: exception
return
self.readCount += n
r = self.buf[:n]
self.buf = self.buf[n:]
return r
# Buffer bytes off a tcp connection and read them off in chunks
class ConnReader():
def __init__(self, conn):
self.conn = conn
self.buf = bytearray()
# blocking
def read(self, n):
while n > len(self.buf):
moreBuf = self.conn.recv(1024)
if not moreBuf:
raise IOError("dead connection")
self.buf = self.buf + bytearray(moreBuf)
r = self.buf[:n]
self.buf = self.buf[n:]
return r

View File

@ -0,0 +1,202 @@
import socket
import select
import sys
from wire import decode_varint, encode
from reader import BytesBuffer
from msg import RequestDecoder, message_types
# hold the asyncronous state of a connection
# ie. we may not get enough bytes on one read to decode the message
class Connection():
def __init__(self, fd, app):
self.fd = fd
self.app = app
self.recBuf = BytesBuffer(bytearray())
self.resBuf = BytesBuffer(bytearray())
self.msgLength = 0
self.decoder = RequestDecoder(self.recBuf)
self.inProgress = False # are we in the middle of a message
def recv(this):
data = this.fd.recv(1024)
if not data: # what about len(data) == 0
raise IOError("dead connection")
this.recBuf.write(data)
# ABCI server responds to messges by calling methods on the app
class ABCIServer():
def __init__(self, app, port=5410):
self.app = app
# map conn file descriptors to (app, reqBuf, resBuf, msgDecoder)
self.appMap = {}
self.port = port
self.listen_backlog = 10
self.listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.listener.setblocking(0)
self.listener.bind(('', port))
self.listener.listen(self.listen_backlog)
self.shutdown = False
self.read_list = [self.listener]
self.write_list = []
def handle_new_connection(self, r):
new_fd, new_addr = r.accept()
new_fd.setblocking(0) # non-blocking
self.read_list.append(new_fd)
self.write_list.append(new_fd)
print 'new connection to', new_addr
self.appMap[new_fd] = Connection(new_fd, self.app)
def handle_conn_closed(self, r):
self.read_list.remove(r)
self.write_list.remove(r)
r.close()
print "connection closed"
def handle_recv(self, r):
# app, recBuf, resBuf, conn
conn = self.appMap[r]
while True:
try:
print "recv loop"
# check if we need more data first
if conn.inProgress:
if (conn.msgLength == 0 or conn.recBuf.size() < conn.msgLength):
conn.recv()
else:
if conn.recBuf.size() == 0:
conn.recv()
conn.inProgress = True
# see if we have enough to get the message length
if conn.msgLength == 0:
ll = conn.recBuf.peek()
if conn.recBuf.size() < 1 + ll:
# we don't have enough bytes to read the length yet
return
print "decoding msg length"
conn.msgLength = decode_varint(conn.recBuf)
# see if we have enough to decode the message
if conn.recBuf.size() < conn.msgLength:
return
# now we can decode the message
# first read the request type and get the particular msg
# decoder
typeByte = conn.recBuf.read(1)
typeByte = int(typeByte[0])
resTypeByte = typeByte + 0x10
req_type = message_types[typeByte]
if req_type == "flush":
# messages are length prefixed
conn.resBuf.write(encode(1))
conn.resBuf.write([resTypeByte])
conn.fd.send(str(conn.resBuf.buf))
conn.msgLength = 0
conn.inProgress = False
conn.resBuf = BytesBuffer(bytearray())
return
decoder = getattr(conn.decoder, req_type)
print "decoding args"
req_args = decoder()
print "got args", req_args
# done decoding message
conn.msgLength = 0
conn.inProgress = False
req_f = getattr(conn.app, req_type)
if req_args is None:
res = req_f()
elif isinstance(req_args, tuple):
res = req_f(*req_args)
else:
res = req_f(req_args)
if isinstance(res, tuple):
res, ret_code = res
else:
ret_code = res
res = None
print "called", req_type, "ret code:", ret_code
if ret_code != 0:
print "non-zero retcode:", ret_code
if req_type in ("echo", "info"): # these dont return a ret code
enc = encode(res)
# messages are length prefixed
conn.resBuf.write(encode(len(enc) + 1))
conn.resBuf.write([resTypeByte])
conn.resBuf.write(enc)
else:
enc, encRet = encode(res), encode(ret_code)
# messages are length prefixed
conn.resBuf.write(encode(len(enc) + len(encRet) + 1))
conn.resBuf.write([resTypeByte])
conn.resBuf.write(encRet)
conn.resBuf.write(enc)
except TypeError as e:
print "TypeError on reading from connection:", e
self.handle_conn_closed(r)
return
except ValueError as e:
print "ValueError on reading from connection:", e
self.handle_conn_closed(r)
return
except IOError as e:
print "IOError on reading from connection:", e
self.handle_conn_closed(r)
return
except Exception as e:
# sys.exc_info()[0] # TODO better
print "error reading from connection", str(e)
self.handle_conn_closed(r)
return
def main_loop(self):
while not self.shutdown:
r_list, w_list, _ = select.select(
self.read_list, self.write_list, [], 2.5)
for r in r_list:
if (r == self.listener):
try:
self.handle_new_connection(r)
# undo adding to read list ...
except NameError as e:
print "Could not connect due to NameError:", e
except TypeError as e:
print "Could not connect due to TypeError:", e
except:
print "Could not connect due to unexpected error:", sys.exc_info()[0]
else:
self.handle_recv(r)
def handle_shutdown(self):
for r in self.read_list:
r.close()
for w in self.write_list:
try:
w.close()
except Exception as e:
print(e) # TODO: add logging
self.shutdown = True

View File

@ -0,0 +1,115 @@
# the decoder works off a reader
# the encoder returns bytearray
def hex2bytes(h):
return bytearray(h.decode('hex'))
def bytes2hex(b):
if type(b) in (str, unicode):
return "".join([hex(ord(c))[2:].zfill(2) for c in b])
else:
return bytes2hex(b.decode())
# expects uvarint64 (no crazy big nums!)
def uvarint_size(i):
if i == 0:
return 0
for j in xrange(1, 8):
if i < 1 << j * 8:
return j
return 8
# expects i < 2**size
def encode_big_endian(i, size):
if size == 0:
return bytearray()
return encode_big_endian(i / 256, size - 1) + bytearray([i % 256])
def decode_big_endian(reader, size):
if size == 0:
return 0
firstByte = reader.read(1)[0]
return firstByte * (256 ** (size - 1)) + decode_big_endian(reader, size - 1)
# ints are max 16 bytes long
def encode_varint(i):
negate = False
if i < 0:
negate = True
i = -i
size = uvarint_size(i)
if size == 0:
return bytearray([0])
big_end = encode_big_endian(i, size)
if negate:
size += 0xF0
return bytearray([size]) + big_end
# returns the int and whats left of the byte array
def decode_varint(reader):
size = reader.read(1)[0]
if size == 0:
return 0
negate = True if size > int(0xF0) else False
if negate:
size = size - 0xF0
i = decode_big_endian(reader, size)
if negate:
i = i * (-1)
return i
def encode_string(s):
size = encode_varint(len(s))
return size + bytearray(s)
def decode_string(reader):
length = decode_varint(reader)
return str(reader.read(length))
def encode_list(s):
b = bytearray()
map(b.extend, map(encode, s))
return encode_varint(len(s)) + b
def encode(s):
if s is None:
return bytearray()
if isinstance(s, int):
return encode_varint(s)
elif isinstance(s, str):
return encode_string(s)
elif isinstance(s, list):
return encode_list(s)
else:
print "UNSUPPORTED TYPE!", type(s), s
if __name__ == '__main__':
ns = [100, 100, 1000, 256]
ss = [2, 5, 5, 2]
bs = map(encode_big_endian, ns, ss)
ds = map(decode_big_endian, bs, ss)
print ns
print [i[0] for i in ds]
ss = ["abc", "hi there jim", "ok now what"]
e = map(encode_string, ss)
d = map(decode_string, e)
print ss
print [i[0] for i in d]

View File

@ -0,0 +1,82 @@
import sys
from abci.wire import hex2bytes, decode_big_endian, encode_big_endian
from abci.server import ABCIServer
from abci.reader import BytesBuffer
class CounterApplication():
def __init__(self):
sys.exit("The python example is out of date. Upgrading the Python examples is currently left as an exercise to you.")
self.hashCount = 0
self.txCount = 0
self.serial = False
def echo(self, msg):
return msg, 0
def info(self):
return ["hashes:%d, txs:%d" % (self.hashCount, self.txCount)], 0
def set_option(self, key, value):
if key == "serial" and value == "on":
self.serial = True
return 0
def deliver_tx(self, txBytes):
if self.serial:
txByteArray = bytearray(txBytes)
if len(txBytes) >= 2 and txBytes[:2] == "0x":
txByteArray = hex2bytes(txBytes[2:])
txValue = decode_big_endian(
BytesBuffer(txByteArray), len(txBytes))
if txValue != self.txCount:
return None, 6
self.txCount += 1
return None, 0
def check_tx(self, txBytes):
if self.serial:
txByteArray = bytearray(txBytes)
if len(txBytes) >= 2 and txBytes[:2] == "0x":
txByteArray = hex2bytes(txBytes[2:])
txValue = decode_big_endian(
BytesBuffer(txByteArray), len(txBytes))
if txValue < self.txCount:
return 6
return 0
def commit(self):
self.hashCount += 1
if self.txCount == 0:
return "", 0
h = encode_big_endian(self.txCount, 8)
h.reverse()
return str(h), 0
def add_listener(self):
return 0
def rm_listener(self):
return 0
def event(self):
return
if __name__ == '__main__':
l = len(sys.argv)
if l == 1:
port = 26658
elif l == 2:
port = int(sys.argv[1])
else:
print "too many arguments"
quit()
print 'ABCI Demo APP (Python)'
app = CounterApplication()
server = ABCIServer(app, port)
server.main_loop()

View File

View File

@ -0,0 +1,50 @@
from .wire import decode_string
# map type_byte to message name
message_types = {
0x01: "echo",
0x02: "flush",
0x03: "info",
0x04: "set_option",
0x21: "deliver_tx",
0x22: "check_tx",
0x23: "commit",
0x24: "add_listener",
0x25: "rm_listener",
}
# return the decoded arguments of abci messages
class RequestDecoder():
def __init__(self, reader):
self.reader = reader
def echo(self):
return decode_string(self.reader)
def flush(self):
return
def info(self):
return
def set_option(self):
return decode_string(self.reader), decode_string(self.reader)
def deliver_tx(self):
return decode_string(self.reader)
def check_tx(self):
return decode_string(self.reader)
def commit(self):
return
def add_listener(self):
# TODO
return
def rm_listener(self):
# TODO
return

View File

@ -0,0 +1,56 @@
# Simple read() method around a bytearray
class BytesBuffer():
def __init__(self, b):
self.buf = b
self.readCount = 0
def count(self):
return self.readCount
def reset_count(self):
self.readCount = 0
def size(self):
return len(self.buf)
def peek(self):
return self.buf[0]
def write(self, b):
# b should be castable to byte array
self.buf += bytearray(b)
def read(self, n):
if len(self.buf) < n:
print("reader err: buf less than n")
# TODO: exception
return
self.readCount += n
r = self.buf[:n]
self.buf = self.buf[n:]
return r
# Buffer bytes off a tcp connection and read them off in chunks
class ConnReader():
def __init__(self, conn):
self.conn = conn
self.buf = bytearray()
# blocking
def read(self, n):
while n > len(self.buf):
moreBuf = self.conn.recv(1024)
if not moreBuf:
raise IOError("dead connection")
self.buf = self.buf + bytearray(moreBuf)
r = self.buf[:n]
self.buf = self.buf[n:]
return r

View File

@ -0,0 +1,196 @@
import socket
import select
import sys
import logging
from .wire import decode_varint, encode
from .reader import BytesBuffer
from .msg import RequestDecoder, message_types
# hold the asyncronous state of a connection
# ie. we may not get enough bytes on one read to decode the message
logger = logging.getLogger(__name__)
class Connection():
def __init__(self, fd, app):
self.fd = fd
self.app = app
self.recBuf = BytesBuffer(bytearray())
self.resBuf = BytesBuffer(bytearray())
self.msgLength = 0
self.decoder = RequestDecoder(self.recBuf)
self.inProgress = False # are we in the middle of a message
def recv(this):
data = this.fd.recv(1024)
if not data: # what about len(data) == 0
raise IOError("dead connection")
this.recBuf.write(data)
# ABCI server responds to messges by calling methods on the app
class ABCIServer():
def __init__(self, app, port=5410):
self.app = app
# map conn file descriptors to (app, reqBuf, resBuf, msgDecoder)
self.appMap = {}
self.port = port
self.listen_backlog = 10
self.listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.listener.setblocking(0)
self.listener.bind(('', port))
self.listener.listen(self.listen_backlog)
self.shutdown = False
self.read_list = [self.listener]
self.write_list = []
def handle_new_connection(self, r):
new_fd, new_addr = r.accept()
new_fd.setblocking(0) # non-blocking
self.read_list.append(new_fd)
self.write_list.append(new_fd)
print('new connection to', new_addr)
self.appMap[new_fd] = Connection(new_fd, self.app)
def handle_conn_closed(self, r):
self.read_list.remove(r)
self.write_list.remove(r)
r.close()
print("connection closed")
def handle_recv(self, r):
# app, recBuf, resBuf, conn
conn = self.appMap[r]
while True:
try:
print("recv loop")
# check if we need more data first
if conn.inProgress:
if (conn.msgLength == 0 or conn.recBuf.size() < conn.msgLength):
conn.recv()
else:
if conn.recBuf.size() == 0:
conn.recv()
conn.inProgress = True
# see if we have enough to get the message length
if conn.msgLength == 0:
ll = conn.recBuf.peek()
if conn.recBuf.size() < 1 + ll:
# we don't have enough bytes to read the length yet
return
print("decoding msg length")
conn.msgLength = decode_varint(conn.recBuf)
# see if we have enough to decode the message
if conn.recBuf.size() < conn.msgLength:
return
# now we can decode the message
# first read the request type and get the particular msg
# decoder
typeByte = conn.recBuf.read(1)
typeByte = int(typeByte[0])
resTypeByte = typeByte + 0x10
req_type = message_types[typeByte]
if req_type == "flush":
# messages are length prefixed
conn.resBuf.write(encode(1))
conn.resBuf.write([resTypeByte])
conn.fd.send(conn.resBuf.buf)
conn.msgLength = 0
conn.inProgress = False
conn.resBuf = BytesBuffer(bytearray())
return
decoder = getattr(conn.decoder, req_type)
print("decoding args")
req_args = decoder()
print("got args", req_args)
# done decoding message
conn.msgLength = 0
conn.inProgress = False
req_f = getattr(conn.app, req_type)
if req_args is None:
res = req_f()
elif isinstance(req_args, tuple):
res = req_f(*req_args)
else:
res = req_f(req_args)
if isinstance(res, tuple):
res, ret_code = res
else:
ret_code = res
res = None
print("called", req_type, "ret code:", ret_code, 'res:', res)
if ret_code != 0:
print("non-zero retcode:", ret_code)
if req_type in ("echo", "info"): # these dont return a ret code
enc = encode(res)
# messages are length prefixed
conn.resBuf.write(encode(len(enc) + 1))
conn.resBuf.write([resTypeByte])
conn.resBuf.write(enc)
else:
enc, encRet = encode(res), encode(ret_code)
# messages are length prefixed
conn.resBuf.write(encode(len(enc) + len(encRet) + 1))
conn.resBuf.write([resTypeByte])
conn.resBuf.write(encRet)
conn.resBuf.write(enc)
except IOError as e:
print("IOError on reading from connection:", e)
self.handle_conn_closed(r)
return
except Exception as e:
logger.exception("error reading from connection")
self.handle_conn_closed(r)
return
def main_loop(self):
while not self.shutdown:
r_list, w_list, _ = select.select(
self.read_list, self.write_list, [], 2.5)
for r in r_list:
if (r == self.listener):
try:
self.handle_new_connection(r)
# undo adding to read list ...
except NameError as e:
print("Could not connect due to NameError:", e)
except TypeError as e:
print("Could not connect due to TypeError:", e)
except:
print("Could not connect due to unexpected error:", sys.exc_info()[0])
else:
self.handle_recv(r)
def handle_shutdown(self):
for r in self.read_list:
r.close()
for w in self.write_list:
try:
w.close()
except Exception as e:
print(e) # TODO: add logging
self.shutdown = True

View File

@ -0,0 +1,119 @@
# the decoder works off a reader
# the encoder returns bytearray
def hex2bytes(h):
return bytearray(h.decode('hex'))
def bytes2hex(b):
if type(b) in (str, str):
return "".join([hex(ord(c))[2:].zfill(2) for c in b])
else:
return bytes2hex(b.decode())
# expects uvarint64 (no crazy big nums!)
def uvarint_size(i):
if i == 0:
return 0
for j in range(1, 8):
if i < 1 << j * 8:
return j
return 8
# expects i < 2**size
def encode_big_endian(i, size):
if size == 0:
return bytearray()
return encode_big_endian(i // 256, size - 1) + bytearray([i % 256])
def decode_big_endian(reader, size):
if size == 0:
return 0
firstByte = reader.read(1)[0]
return firstByte * (256 ** (size - 1)) + decode_big_endian(reader, size - 1)
# ints are max 16 bytes long
def encode_varint(i):
negate = False
if i < 0:
negate = True
i = -i
size = uvarint_size(i)
if size == 0:
return bytearray([0])
big_end = encode_big_endian(i, size)
if negate:
size += 0xF0
return bytearray([size]) + big_end
# returns the int and whats left of the byte array
def decode_varint(reader):
size = reader.read(1)[0]
if size == 0:
return 0
negate = True if size > int(0xF0) else False
if negate:
size = size - 0xF0
i = decode_big_endian(reader, size)
if negate:
i = i * (-1)
return i
def encode_string(s):
size = encode_varint(len(s))
return size + bytearray(s, 'utf8')
def decode_string(reader):
length = decode_varint(reader)
raw_data = reader.read(length)
return raw_data.decode()
def encode_list(s):
b = bytearray()
list(map(b.extend, list(map(encode, s))))
return encode_varint(len(s)) + b
def encode(s):
print('encoding', repr(s))
if s is None:
return bytearray()
if isinstance(s, int):
return encode_varint(s)
elif isinstance(s, str):
return encode_string(s)
elif isinstance(s, list):
return encode_list(s)
elif isinstance(s, bytearray):
return encode_string(s)
else:
print("UNSUPPORTED TYPE!", type(s), s)
if __name__ == '__main__':
ns = [100, 100, 1000, 256]
ss = [2, 5, 5, 2]
bs = list(map(encode_big_endian, ns, ss))
ds = list(map(decode_big_endian, bs, ss))
print(ns)
print([i[0] for i in ds])
ss = ["abc", "hi there jim", "ok now what"]
e = list(map(encode_string, ss))
d = list(map(decode_string, e))
print(ss)
print([i[0] for i in d])

View File

@ -0,0 +1,82 @@
import sys
from abci.wire import hex2bytes, decode_big_endian, encode_big_endian
from abci.server import ABCIServer
from abci.reader import BytesBuffer
class CounterApplication():
def __init__(self):
sys.exit("The python example is out of date. Upgrading the Python examples is currently left as an exercise to you.")
self.hashCount = 0
self.txCount = 0
self.serial = False
def echo(self, msg):
return msg, 0
def info(self):
return ["hashes:%d, txs:%d" % (self.hashCount, self.txCount)], 0
def set_option(self, key, value):
if key == "serial" and value == "on":
self.serial = True
return 0
def deliver_tx(self, txBytes):
if self.serial:
txByteArray = bytearray(txBytes)
if len(txBytes) >= 2 and txBytes[:2] == "0x":
txByteArray = hex2bytes(txBytes[2:])
txValue = decode_big_endian(
BytesBuffer(txByteArray), len(txBytes))
if txValue != self.txCount:
return None, 6
self.txCount += 1
return None, 0
def check_tx(self, txBytes):
if self.serial:
txByteArray = bytearray(txBytes)
if len(txBytes) >= 2 and txBytes[:2] == "0x":
txByteArray = hex2bytes(txBytes[2:])
txValue = decode_big_endian(
BytesBuffer(txByteArray), len(txBytes))
if txValue < self.txCount:
return 6
return 0
def commit(self):
self.hashCount += 1
if self.txCount == 0:
return "", 0
h = encode_big_endian(self.txCount, 8)
h.reverse()
return h.decode(), 0
def add_listener(self):
return 0
def rm_listener(self):
return 0
def event(self):
return
if __name__ == '__main__':
l = len(sys.argv)
if l == 1:
port = 26658
elif l == 2:
port = int(sys.argv[1])
else:
print("too many arguments")
quit()
print('ABCI Demo APP (Python)')
app = CounterApplication()
server = ABCIServer(app, port)
server.main_loop()

View File

@ -0,0 +1,57 @@
package server
import (
"net"
"google.golang.org/grpc"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
type GRPCServer struct {
cmn.BaseService
proto string
addr string
listener net.Listener
server *grpc.Server
app types.ABCIApplicationServer
}
// NewGRPCServer returns a new gRPC ABCI server
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) cmn.Service {
proto, addr := cmn.ProtocolAndAddress(protoAddr)
s := &GRPCServer{
proto: proto,
addr: addr,
listener: nil,
app: app,
}
s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s)
return s
}
// OnStart starts the gRPC service
func (s *GRPCServer) OnStart() error {
if err := s.BaseService.OnStart(); err != nil {
return err
}
ln, err := net.Listen(s.proto, s.addr)
if err != nil {
return err
}
s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr)
s.listener = ln
s.server = grpc.NewServer()
types.RegisterABCIApplicationServer(s.server, s.app)
go s.server.Serve(s.listener)
return nil
}
// OnStop stops the gRPC server
func (s *GRPCServer) OnStop() {
s.BaseService.OnStop()
s.server.Stop()
}

31
abci/server/server.go Normal file
View File

@ -0,0 +1,31 @@
/*
Package server is used to start a new ABCI server.
It contains two server implementation:
* gRPC server
* socket server
*/
package server
import (
"fmt"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
func NewServer(protoAddr, transport string, app types.Application) (cmn.Service, error) {
var s cmn.Service
var err error
switch transport {
case "socket":
s = NewSocketServer(protoAddr, app)
case "grpc":
s = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
default:
err = fmt.Errorf("Unknown server type %s", transport)
}
return s, err
}

View File

@ -0,0 +1,237 @@
package server
import (
"bufio"
"fmt"
"io"
"net"
"sync"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
// var maxNumberConnections = 2
type SocketServer struct {
cmn.BaseService
proto string
addr string
listener net.Listener
connsMtx sync.Mutex
conns map[int]net.Conn
nextConnID int
appMtx sync.Mutex
app types.Application
}
func NewSocketServer(protoAddr string, app types.Application) cmn.Service {
proto, addr := cmn.ProtocolAndAddress(protoAddr)
s := &SocketServer{
proto: proto,
addr: addr,
listener: nil,
app: app,
conns: make(map[int]net.Conn),
}
s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s)
return s
}
func (s *SocketServer) OnStart() error {
if err := s.BaseService.OnStart(); err != nil {
return err
}
ln, err := net.Listen(s.proto, s.addr)
if err != nil {
return err
}
s.listener = ln
go s.acceptConnectionsRoutine()
return nil
}
func (s *SocketServer) OnStop() {
s.BaseService.OnStop()
if err := s.listener.Close(); err != nil {
s.Logger.Error("Error closing listener", "err", err)
}
s.connsMtx.Lock()
defer s.connsMtx.Unlock()
for id, conn := range s.conns {
delete(s.conns, id)
if err := conn.Close(); err != nil {
s.Logger.Error("Error closing connection", "id", id, "conn", conn, "err", err)
}
}
}
func (s *SocketServer) addConn(conn net.Conn) int {
s.connsMtx.Lock()
defer s.connsMtx.Unlock()
connID := s.nextConnID
s.nextConnID++
s.conns[connID] = conn
return connID
}
// deletes conn even if close errs
func (s *SocketServer) rmConn(connID int) error {
s.connsMtx.Lock()
defer s.connsMtx.Unlock()
conn, ok := s.conns[connID]
if !ok {
return fmt.Errorf("Connection %d does not exist", connID)
}
delete(s.conns, connID)
return conn.Close()
}
func (s *SocketServer) acceptConnectionsRoutine() {
for {
// Accept a connection
s.Logger.Info("Waiting for new connection...")
conn, err := s.listener.Accept()
if err != nil {
if !s.IsRunning() {
return // Ignore error from listener closing.
}
s.Logger.Error("Failed to accept connection: " + err.Error())
continue
}
s.Logger.Info("Accepted a new connection")
connID := s.addConn(conn)
closeConn := make(chan error, 2) // Push to signal connection closed
responses := make(chan *types.Response, 1000) // A channel to buffer responses
// Read requests from conn and deal with them
go s.handleRequests(closeConn, conn, responses)
// Pull responses from 'responses' and write them to conn.
go s.handleResponses(closeConn, conn, responses)
// Wait until signal to close connection
go s.waitForClose(closeConn, connID)
}
}
func (s *SocketServer) waitForClose(closeConn chan error, connID int) {
err := <-closeConn
switch {
case err == io.EOF:
s.Logger.Error("Connection was closed by client")
case err != nil:
s.Logger.Error("Connection error", "error", err)
default:
// never happens
s.Logger.Error("Connection was closed.")
}
// Close the connection
if err := s.rmConn(connID); err != nil {
s.Logger.Error("Error in closing connection", "error", err)
}
}
// Read requests from conn and deal with them
func (s *SocketServer) handleRequests(closeConn chan error, conn net.Conn, responses chan<- *types.Response) {
var count int
var bufReader = bufio.NewReader(conn)
defer func() {
// make sure to recover from any app-related panics to allow proper socket cleanup
r := recover()
if r != nil {
closeConn <- fmt.Errorf("recovered from panic: %v", r)
s.appMtx.Unlock()
}
}()
for {
var req = &types.Request{}
err := types.ReadMessage(bufReader, req)
if err != nil {
if err == io.EOF {
closeConn <- err
} else {
closeConn <- fmt.Errorf("error reading message: %v", err)
}
return
}
s.appMtx.Lock()
count++
s.handleRequest(req, responses)
s.appMtx.Unlock()
}
}
func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types.Response) {
switch r := req.Value.(type) {
case *types.Request_Echo:
responses <- types.ToResponseEcho(r.Echo.Message)
case *types.Request_Flush:
responses <- types.ToResponseFlush()
case *types.Request_Info:
res := s.app.Info(*r.Info)
responses <- types.ToResponseInfo(res)
case *types.Request_SetOption:
res := s.app.SetOption(*r.SetOption)
responses <- types.ToResponseSetOption(res)
case *types.Request_DeliverTx:
res := s.app.DeliverTx(*r.DeliverTx)
responses <- types.ToResponseDeliverTx(res)
case *types.Request_CheckTx:
res := s.app.CheckTx(*r.CheckTx)
responses <- types.ToResponseCheckTx(res)
case *types.Request_Commit:
res := s.app.Commit()
responses <- types.ToResponseCommit(res)
case *types.Request_Query:
res := s.app.Query(*r.Query)
responses <- types.ToResponseQuery(res)
case *types.Request_InitChain:
res := s.app.InitChain(*r.InitChain)
responses <- types.ToResponseInitChain(res)
case *types.Request_BeginBlock:
res := s.app.BeginBlock(*r.BeginBlock)
responses <- types.ToResponseBeginBlock(res)
case *types.Request_EndBlock:
res := s.app.EndBlock(*r.EndBlock)
responses <- types.ToResponseEndBlock(res)
default:
responses <- types.ToResponseException("Unknown request")
}
}
// Pull responses from 'responses' and write them to conn.
func (s *SocketServer) handleResponses(closeConn chan error, conn net.Conn, responses <-chan *types.Response) {
var count int
var bufWriter = bufio.NewWriter(conn)
for {
var res = <-responses
err := types.WriteMessage(res, bufWriter)
if err != nil {
closeConn <- fmt.Errorf("Error writing message: %v", err.Error())
return
}
if _, ok := res.Value.(*types.Response_Flush); ok {
err = bufWriter.Flush()
if err != nil {
closeConn <- fmt.Errorf("Error flushing write buffer: %v", err.Error())
return
}
}
count++
}
}

View File

@ -0,0 +1 @@
package benchmarks

View File

@ -0,0 +1,55 @@
package main
import (
"bufio"
"fmt"
"log"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
func main() {
conn, err := cmn.Connect("unix://test.sock")
if err != nil {
log.Fatal(err.Error())
}
// Read a bunch of responses
go func() {
counter := 0
for {
var res = &types.Response{}
err := types.ReadMessage(conn, res)
if err != nil {
log.Fatal(err.Error())
}
counter++
if counter%1000 == 0 {
fmt.Println("Read", counter)
}
}
}()
// Write a bunch of requests
counter := 0
for i := 0; ; i++ {
var bufWriter = bufio.NewWriter(conn)
var req = types.ToRequestEcho("foobar")
err := types.WriteMessage(req, bufWriter)
if err != nil {
log.Fatal(err.Error())
}
err = bufWriter.Flush()
if err != nil {
log.Fatal(err.Error())
}
counter++
if counter%1000 == 0 {
fmt.Println("Write", counter)
}
}
}

View File

@ -0,0 +1,69 @@
package main
import (
"bufio"
"fmt"
"log"
"net"
"reflect"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
func main() {
conn, err := cmn.Connect("unix://test.sock")
if err != nil {
log.Fatal(err.Error())
}
// Make a bunch of requests
counter := 0
for i := 0; ; i++ {
req := types.ToRequestEcho("foobar")
_, err := makeRequest(conn, req)
if err != nil {
log.Fatal(err.Error())
}
counter++
if counter%1000 == 0 {
fmt.Println(counter)
}
}
}
func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) {
var bufWriter = bufio.NewWriter(conn)
// Write desired request
err := types.WriteMessage(req, bufWriter)
if err != nil {
return nil, err
}
err = types.WriteMessage(types.ToRequestFlush(), bufWriter)
if err != nil {
return nil, err
}
err = bufWriter.Flush()
if err != nil {
return nil, err
}
// Read desired response
var res = &types.Response{}
err = types.ReadMessage(conn, res)
if err != nil {
return nil, err
}
var resFlush = &types.Response{}
err = types.ReadMessage(conn, resFlush)
if err != nil {
return nil, err
}
if _, ok := resFlush.Value.(*types.Response_Flush); !ok {
return nil, fmt.Errorf("Expected flush response but got something else: %v", reflect.TypeOf(resFlush))
}
return res, nil
}

View File

@ -0,0 +1,27 @@
package tests
import (
"testing"
"github.com/stretchr/testify/assert"
abciclient "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/example/kvstore"
abciserver "github.com/tendermint/tendermint/abci/server"
)
func TestClientServerNoAddrPrefix(t *testing.T) {
addr := "localhost:26658"
transport := "socket"
app := kvstore.NewKVStoreApplication()
server, err := abciserver.NewServer(addr, transport, app)
assert.NoError(t, err, "expected no error on NewServer")
err = server.Start()
assert.NoError(t, err, "expected no error on server.Start")
client, err := abciclient.NewClient(addr, transport, true)
assert.NoError(t, err, "expected no error on NewClient")
err = client.Start()
assert.NoError(t, err, "expected no error on client.Start")
}

View File

@ -0,0 +1,96 @@
package testsuite
import (
"bytes"
"errors"
"fmt"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
)
func InitChain(client abcicli.Client) error {
total := 10
vals := make([]types.ValidatorUpdate, total)
for i := 0; i < total; i++ {
pubkey := cmn.RandBytes(33)
power := cmn.RandInt()
vals[i] = types.Ed25519ValidatorUpdate(pubkey, int64(power))
}
_, err := client.InitChainSync(types.RequestInitChain{
Validators: vals,
})
if err != nil {
fmt.Printf("Failed test: InitChain - %v\n", err)
return err
}
fmt.Println("Passed test: InitChain")
return nil
}
func SetOption(client abcicli.Client, key, value string) error {
_, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value})
if err != nil {
fmt.Println("Failed test: SetOption")
fmt.Printf("error while setting %v=%v: \nerror: %v\n", key, value, err)
return err
}
fmt.Println("Passed test: SetOption")
return nil
}
func Commit(client abcicli.Client, hashExp []byte) error {
res, err := client.CommitSync()
data := res.Data
if err != nil {
fmt.Println("Failed test: Commit")
fmt.Printf("error while committing: %v\n", err)
return err
}
if !bytes.Equal(data, hashExp) {
fmt.Println("Failed test: Commit")
fmt.Printf("Commit hash was unexpected. Got %X expected %X\n", data, hashExp)
return errors.New("CommitTx failed")
}
fmt.Println("Passed test: Commit")
return nil
}
func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error {
res, _ := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes})
code, data, log := res.Code, res.Data, res.Log
if code != codeExp {
fmt.Println("Failed test: DeliverTx")
fmt.Printf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v\n",
code, codeExp, log)
return errors.New("DeliverTx error")
}
if !bytes.Equal(data, dataExp) {
fmt.Println("Failed test: DeliverTx")
fmt.Printf("DeliverTx response data was unexpected. Got %X expected %X\n",
data, dataExp)
return errors.New("DeliverTx error")
}
fmt.Println("Passed test: DeliverTx")
return nil
}
func CheckTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error {
res, _ := client.CheckTxSync(types.RequestCheckTx{Tx: txBytes})
code, data, log := res.Code, res.Data, res.Log
if code != codeExp {
fmt.Println("Failed test: CheckTx")
fmt.Printf("CheckTx response code was unexpected. Got %v expected %v. Log: %v\n",
code, codeExp, log)
return errors.New("CheckTx")
}
if !bytes.Equal(data, dataExp) {
fmt.Println("Failed test: CheckTx")
fmt.Printf("CheckTx response data was unexpected. Got %X expected %X\n",
data, dataExp)
return errors.New("CheckTx")
}
fmt.Println("Passed test: CheckTx")
return nil
}

View File

@ -0,0 +1,78 @@
package main
import (
"bytes"
"fmt"
"os"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
)
func startClient(abciType string) abcicli.Client {
// Start client
client, err := abcicli.NewClient("tcp://127.0.0.1:26658", abciType, true)
if err != nil {
panic(err.Error())
}
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
client.SetLogger(logger.With("module", "abcicli"))
if err := client.Start(); err != nil {
panicf("connecting to abci_app: %v", err.Error())
}
return client
}
func setOption(client abcicli.Client, key, value string) {
_, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value})
if err != nil {
panicf("setting %v=%v: \nerr: %v", key, value, err)
}
}
func commit(client abcicli.Client, hashExp []byte) {
res, err := client.CommitSync()
if err != nil {
panicf("client error: %v", err)
}
if !bytes.Equal(res.Data, hashExp) {
panicf("Commit hash was unexpected. Got %X expected %X", res.Data, hashExp)
}
}
func deliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) {
res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes})
if err != nil {
panicf("client error: %v", err)
}
if res.Code != codeExp {
panicf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", res.Code, codeExp, res.Log)
}
if !bytes.Equal(res.Data, dataExp) {
panicf("DeliverTx response data was unexpected. Got %X expected %X", res.Data, dataExp)
}
}
/*func checkTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) {
res, err := client.CheckTxSync(txBytes)
if err != nil {
panicf("client error: %v", err)
}
if res.IsErr() {
panicf("checking tx %X: %v\nlog: %v", txBytes, res.Log)
}
if res.Code != codeExp {
panicf("CheckTx response code was unexpected. Got %v expected %v. Log: %v",
res.Code, codeExp, res.Log)
}
if !bytes.Equal(res.Data, dataExp) {
panicf("CheckTx response data was unexpected. Got %X expected %X",
res.Data, dataExp)
}
}*/
func panicf(format string, a ...interface{}) {
panic(fmt.Sprintf(format, a...))
}

View File

@ -0,0 +1,84 @@
package main
import (
"fmt"
"log"
"os"
"os/exec"
"time"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
)
var abciType string
func init() {
abciType = os.Getenv("ABCI")
if abciType == "" {
abciType = "socket"
}
}
func main() {
testCounter()
}
const (
maxABCIConnectTries = 10
)
func ensureABCIIsUp(typ string, n int) error {
var err error
cmdString := "abci-cli echo hello"
if typ == "grpc" {
cmdString = "abci-cli --abci grpc echo hello"
}
for i := 0; i < n; i++ {
cmd := exec.Command("bash", "-c", cmdString) // nolint: gas
_, err = cmd.CombinedOutput()
if err == nil {
break
}
<-time.After(500 * time.Millisecond)
}
return err
}
func testCounter() {
abciApp := os.Getenv("ABCI_APP")
if abciApp == "" {
panic("No ABCI_APP specified")
}
fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType)
cmd := exec.Command("bash", "-c", fmt.Sprintf("abci-cli %s", abciApp)) // nolint: gas
cmd.Stdout = os.Stdout
if err := cmd.Start(); err != nil {
log.Fatalf("starting %q err: %v", abciApp, err)
}
defer cmd.Wait()
defer cmd.Process.Kill()
if err := ensureABCIIsUp(abciType, maxABCIConnectTries); err != nil {
log.Fatalf("echo failed: %v", err)
}
client := startClient(abciType)
defer client.Stop()
setOption(client, "serial", "on")
commit(client, nil)
deliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil)
commit(client, nil)
deliverTx(client, []byte{0x00}, types.CodeTypeOK, nil)
commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1})
deliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil)
deliverTx(client, []byte{0x01}, types.CodeTypeOK, nil)
deliverTx(client, []byte{0x00, 0x02}, types.CodeTypeOK, nil)
deliverTx(client, []byte{0x00, 0x03}, types.CodeTypeOK, nil)
deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeTypeOK, nil)
deliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil)
commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5})
}

29
abci/tests/test_app/test.sh Executable file
View File

@ -0,0 +1,29 @@
#! /bin/bash
set -e
# These tests spawn the counter app and server by execing the ABCI_APP command and run some simple client tests against it
export GO111MODULE=on
# Get the directory of where this script is.
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Change into that dir because we expect that.
cd "$DIR"
echo "RUN COUNTER OVER SOCKET"
# test golang counter
ABCI_APP="counter" go run -mod=readonly ./*.go
echo "----------------------"
echo "RUN COUNTER OVER GRPC"
# test golang counter via grpc
ABCI_APP="counter --abci=grpc" ABCI="grpc" go run -mod=readonly ./*.go
echo "----------------------"
# test nodejs counter
# TODO: fix node app
#ABCI_APP="node $GOPATH/src/github.com/tendermint/js-abci/example/app.js" go test -test.run TestCounter

View File

@ -0,0 +1,10 @@
echo hello
info
commit
deliver_tx "abc"
info
commit
query "abc"
deliver_tx "def=xyz"
commit
query "def"

View File

@ -0,0 +1,51 @@
> echo hello
-> code: OK
-> data: hello
-> data.hex: 0x68656C6C6F
> info
-> code: OK
-> data: {"size":0}
-> data.hex: 0x7B2273697A65223A307D
> commit
-> code: OK
-> data.hex: 0x0000000000000000
> deliver_tx "abc"
-> code: OK
> info
-> code: OK
-> data: {"size":1}
-> data.hex: 0x7B2273697A65223A317D
> commit
-> code: OK
-> data.hex: 0x0200000000000000
> query "abc"
-> code: OK
-> log: exists
-> height: 0
-> key: abc
-> key.hex: 616263
-> value: abc
-> value.hex: 616263
> deliver_tx "def=xyz"
-> code: OK
> commit
-> code: OK
-> data.hex: 0x0400000000000000
> query "def"
-> code: OK
-> log: exists
-> height: 0
-> key: def
-> key.hex: 646566
-> value: xyz
-> value.hex: 78797A

View File

@ -0,0 +1,8 @@
set_option serial on
check_tx 0x00
check_tx 0xff
deliver_tx 0x00
check_tx 0x00
deliver_tx 0x01
deliver_tx 0x04
info

View File

@ -0,0 +1,29 @@
> set_option serial on
-> code: OK
-> log: OK (SetOption doesn't return anything.)
> check_tx 0x00
-> code: OK
> check_tx 0xff
-> code: OK
> deliver_tx 0x00
-> code: OK
> check_tx 0x00
-> code: 2
-> log: Invalid nonce. Expected >= 1, got 0
> deliver_tx 0x01
-> code: OK
> deliver_tx 0x04
-> code: 2
-> log: Invalid nonce. Expected 2, got 4
> info
-> code: OK
-> data: {"hashes":0,"txs":2}
-> data.hex: 0x7B22686173686573223A302C22747873223A327D

42
abci/tests/test_cli/test.sh Executable file
View File

@ -0,0 +1,42 @@
#! /bin/bash
set -e
# Get the root directory.
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
# Change into that dir because we expect that.
cd "$DIR" || exit
function testExample() {
N=$1
INPUT=$2
APP="$3 $4"
echo "Example $N: $APP"
$APP &> /dev/null &
sleep 2
abci-cli --log_level=error --verbose batch < "$INPUT" > "${INPUT}.out.new"
killall "$3"
pre=$(shasum < "${INPUT}.out")
post=$(shasum < "${INPUT}.out.new")
if [[ "$pre" != "$post" ]]; then
echo "You broke the tutorial"
echo "Got:"
cat "${INPUT}.out.new"
echo "Expected:"
cat "${INPUT}.out"
exit 1
fi
rm "${INPUT}".out.new
}
testExample 1 tests/test_cli/ex1.abci abci-cli kvstore
testExample 2 tests/test_cli/ex2.abci abci-cli counter
echo ""
echo "PASS"

1
abci/tests/tests.go Normal file
View File

@ -0,0 +1 @@
package tests

138
abci/types/application.go Normal file
View File

@ -0,0 +1,138 @@
package types // nolint: goimports
import (
context "golang.org/x/net/context"
)
// Application is an interface that enables any finite, deterministic state machine
// to be driven by a blockchain-based replication engine via the ABCI.
// All methods take a RequestXxx argument and return a ResponseXxx argument,
// except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing.
type Application interface {
// Info/Query Connection
Info(RequestInfo) ResponseInfo // Return application info
SetOption(RequestSetOption) ResponseSetOption // Set application option
Query(RequestQuery) ResponseQuery // Query for state
// Mempool Connection
CheckTx(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool
// Consensus Connection
InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain with validators and other info from TendermintCore
BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block
DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing
EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set
Commit() ResponseCommit // Commit the state and return the application Merkle root hash
}
//-------------------------------------------------------
// BaseApplication is a base form of Application
var _ Application = (*BaseApplication)(nil)
type BaseApplication struct {
}
func NewBaseApplication() *BaseApplication {
return &BaseApplication{}
}
func (BaseApplication) Info(req RequestInfo) ResponseInfo {
return ResponseInfo{}
}
func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption {
return ResponseSetOption{}
}
func (BaseApplication) DeliverTx(req RequestDeliverTx) ResponseDeliverTx {
return ResponseDeliverTx{Code: CodeTypeOK}
}
func (BaseApplication) CheckTx(req RequestCheckTx) ResponseCheckTx {
return ResponseCheckTx{Code: CodeTypeOK}
}
func (BaseApplication) Commit() ResponseCommit {
return ResponseCommit{}
}
func (BaseApplication) Query(req RequestQuery) ResponseQuery {
return ResponseQuery{Code: CodeTypeOK}
}
func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain {
return ResponseInitChain{}
}
func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock {
return ResponseBeginBlock{}
}
func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock {
return ResponseEndBlock{}
}
//-------------------------------------------------------
// GRPCApplication is a GRPC wrapper for Application
type GRPCApplication struct {
app Application
}
func NewGRPCApplication(app Application) *GRPCApplication {
return &GRPCApplication{app}
}
func (app *GRPCApplication) Echo(ctx context.Context, req *RequestEcho) (*ResponseEcho, error) {
return &ResponseEcho{Message: req.Message}, nil
}
func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*ResponseFlush, error) {
return &ResponseFlush{}, nil
}
func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) {
res := app.app.Info(*req)
return &res, nil
}
func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) {
res := app.app.SetOption(*req)
return &res, nil
}
func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) {
res := app.app.DeliverTx(*req)
return &res, nil
}
func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) {
res := app.app.CheckTx(*req)
return &res, nil
}
func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) {
res := app.app.Query(*req)
return &res, nil
}
func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*ResponseCommit, error) {
res := app.app.Commit()
return &res, nil
}
func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) {
res := app.app.InitChain(*req)
return &res, nil
}
func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) {
res := app.app.BeginBlock(*req)
return &res, nil
}
func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) {
res := app.app.EndBlock(*req)
return &res, nil
}

210
abci/types/messages.go Normal file
View File

@ -0,0 +1,210 @@
package types
import (
"bufio"
"encoding/binary"
"io"
"github.com/gogo/protobuf/proto"
)
const (
maxMsgSize = 104857600 // 100MB
)
// WriteMessage writes a varint length-delimited protobuf message.
func WriteMessage(msg proto.Message, w io.Writer) error {
bz, err := proto.Marshal(msg)
if err != nil {
return err
}
return encodeByteSlice(w, bz)
}
// ReadMessage reads a varint length-delimited protobuf message.
func ReadMessage(r io.Reader, msg proto.Message) error {
return readProtoMsg(r, msg, maxMsgSize)
}
func readProtoMsg(r io.Reader, msg proto.Message, maxSize int) error {
// binary.ReadVarint takes an io.ByteReader, eg. a bufio.Reader
reader, ok := r.(*bufio.Reader)
if !ok {
reader = bufio.NewReader(r)
}
length64, err := binary.ReadVarint(reader)
if err != nil {
return err
}
length := int(length64)
if length < 0 || length > maxSize {
return io.ErrShortBuffer
}
buf := make([]byte, length)
if _, err := io.ReadFull(reader, buf); err != nil {
return err
}
return proto.Unmarshal(buf, msg)
}
//-----------------------------------------------------------------------
// NOTE: we copied wire.EncodeByteSlice from go-wire rather than keep
// go-wire as a dep
func encodeByteSlice(w io.Writer, bz []byte) (err error) {
err = encodeVarint(w, int64(len(bz)))
if err != nil {
return
}
_, err = w.Write(bz)
return
}
func encodeVarint(w io.Writer, i int64) (err error) {
var buf [10]byte
n := binary.PutVarint(buf[:], i)
_, err = w.Write(buf[0:n])
return
}
//----------------------------------------
func ToRequestEcho(message string) *Request {
return &Request{
Value: &Request_Echo{&RequestEcho{Message: message}},
}
}
func ToRequestFlush() *Request {
return &Request{
Value: &Request_Flush{&RequestFlush{}},
}
}
func ToRequestInfo(req RequestInfo) *Request {
return &Request{
Value: &Request_Info{&req},
}
}
func ToRequestSetOption(req RequestSetOption) *Request {
return &Request{
Value: &Request_SetOption{&req},
}
}
func ToRequestDeliverTx(req RequestDeliverTx) *Request {
return &Request{
Value: &Request_DeliverTx{&req},
}
}
func ToRequestCheckTx(req RequestCheckTx) *Request {
return &Request{
Value: &Request_CheckTx{&req},
}
}
func ToRequestCommit() *Request {
return &Request{
Value: &Request_Commit{&RequestCommit{}},
}
}
func ToRequestQuery(req RequestQuery) *Request {
return &Request{
Value: &Request_Query{&req},
}
}
func ToRequestInitChain(req RequestInitChain) *Request {
return &Request{
Value: &Request_InitChain{&req},
}
}
func ToRequestBeginBlock(req RequestBeginBlock) *Request {
return &Request{
Value: &Request_BeginBlock{&req},
}
}
func ToRequestEndBlock(req RequestEndBlock) *Request {
return &Request{
Value: &Request_EndBlock{&req},
}
}
//----------------------------------------
func ToResponseException(errStr string) *Response {
return &Response{
Value: &Response_Exception{&ResponseException{Error: errStr}},
}
}
func ToResponseEcho(message string) *Response {
return &Response{
Value: &Response_Echo{&ResponseEcho{Message: message}},
}
}
func ToResponseFlush() *Response {
return &Response{
Value: &Response_Flush{&ResponseFlush{}},
}
}
func ToResponseInfo(res ResponseInfo) *Response {
return &Response{
Value: &Response_Info{&res},
}
}
func ToResponseSetOption(res ResponseSetOption) *Response {
return &Response{
Value: &Response_SetOption{&res},
}
}
func ToResponseDeliverTx(res ResponseDeliverTx) *Response {
return &Response{
Value: &Response_DeliverTx{&res},
}
}
func ToResponseCheckTx(res ResponseCheckTx) *Response {
return &Response{
Value: &Response_CheckTx{&res},
}
}
func ToResponseCommit(res ResponseCommit) *Response {
return &Response{
Value: &Response_Commit{&res},
}
}
func ToResponseQuery(res ResponseQuery) *Response {
return &Response{
Value: &Response_Query{&res},
}
}
func ToResponseInitChain(res ResponseInitChain) *Response {
return &Response{
Value: &Response_InitChain{&res},
}
}
func ToResponseBeginBlock(res ResponseBeginBlock) *Response {
return &Response{
Value: &Response_BeginBlock{&res},
}
}
func ToResponseEndBlock(res ResponseEndBlock) *Response {
return &Response{
Value: &Response_EndBlock{&res},
}
}

114
abci/types/messages_test.go Normal file
View File

@ -0,0 +1,114 @@
package types
import (
"bytes"
"encoding/json"
"strings"
"testing"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/assert"
cmn "github.com/tendermint/tendermint/libs/common"
)
func TestMarshalJSON(t *testing.T) {
b, err := json.Marshal(&ResponseDeliverTx{})
assert.Nil(t, err)
// Do not include empty fields.
assert.False(t, strings.Contains(string(b), "code"))
r1 := ResponseCheckTx{
Code: 1,
Data: []byte("hello"),
GasWanted: 43,
Events: []Event{
{
Type: "testEvent",
Attributes: []cmn.KVPair{
{Key: []byte("pho"), Value: []byte("bo")},
},
},
},
}
b, err = json.Marshal(&r1)
assert.Nil(t, err)
var r2 ResponseCheckTx
err = json.Unmarshal(b, &r2)
assert.Nil(t, err)
assert.Equal(t, r1, r2)
}
func TestWriteReadMessageSimple(t *testing.T) {
cases := []proto.Message{
&RequestEcho{
Message: "Hello",
},
}
for _, c := range cases {
buf := new(bytes.Buffer)
err := WriteMessage(c, buf)
assert.Nil(t, err)
msg := new(RequestEcho)
err = ReadMessage(buf, msg)
assert.Nil(t, err)
assert.Equal(t, c, msg)
}
}
func TestWriteReadMessage(t *testing.T) {
cases := []proto.Message{
&Header{
NumTxs: 4,
},
// TODO: add the rest
}
for _, c := range cases {
buf := new(bytes.Buffer)
err := WriteMessage(c, buf)
assert.Nil(t, err)
msg := new(Header)
err = ReadMessage(buf, msg)
assert.Nil(t, err)
assert.Equal(t, c, msg)
}
}
func TestWriteReadMessage2(t *testing.T) {
phrase := "hello-world"
cases := []proto.Message{
&ResponseCheckTx{
Data: []byte(phrase),
Log: phrase,
GasWanted: 10,
Events: []Event{
{
Type: "testEvent",
Attributes: []cmn.KVPair{
{Key: []byte("abc"), Value: []byte("def")},
},
},
},
},
// TODO: add the rest
}
for _, c := range cases {
buf := new(bytes.Buffer)
err := WriteMessage(c, buf)
assert.Nil(t, err)
msg := new(ResponseCheckTx)
err = ReadMessage(buf, msg)
assert.Nil(t, err)
assert.Equal(t, c, msg)
}
}

View File

@ -0,0 +1,55 @@
// +build ignore
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"regexp"
"strings"
)
// This script replaces most `[]byte` with `data.Bytes` in a `.pb.go` file.
// It was written before we realized we could use `gogo/protobuf` to achieve
// this more natively. So it's here for safe keeping in case we ever need to
// abandon `gogo/protobuf`.
func main() {
bytePattern := regexp.MustCompile("[[][]]byte")
const oldPath = "types/types.pb.go"
const tmpPath = "types/types.pb.new"
content, err := ioutil.ReadFile(oldPath)
if err != nil {
panic("cannot read " + oldPath)
os.Exit(1)
}
lines := bytes.Split(content, []byte("\n"))
outFile, _ := os.Create(tmpPath)
wroteImport := false
for _, line_bytes := range lines {
line := string(line_bytes)
gotPackageLine := strings.HasPrefix(line, "package ")
writeImportTime := strings.HasPrefix(line, "import ")
containsDescriptor := strings.Contains(line, "Descriptor")
containsByteArray := strings.Contains(line, "[]byte")
if containsByteArray && !containsDescriptor {
line = string(bytePattern.ReplaceAll([]byte(line), []byte("data.Bytes")))
}
if writeImportTime && !wroteImport {
wroteImport = true
fmt.Fprintf(outFile, "import \"github.com/tendermint/go-wire/data\"\n")
}
if gotPackageLine {
fmt.Fprintf(outFile, "%s\n", "//nolint: gas")
}
fmt.Fprintf(outFile, "%s\n", line)
}
outFile.Close()
os.Remove(oldPath)
os.Rename(tmpPath, oldPath)
exec.Command("goimports", "-w", oldPath)
}

16
abci/types/pubkey.go Normal file
View File

@ -0,0 +1,16 @@
package types
const (
PubKeyEd25519 = "ed25519"
)
func Ed25519ValidatorUpdate(pubkey []byte, power int64) ValidatorUpdate {
return ValidatorUpdate{
// Address:
PubKey: PubKey{
Type: PubKeyEd25519,
Data: pubkey,
},
Power: power,
}
}

121
abci/types/result.go Normal file
View File

@ -0,0 +1,121 @@
package types
import (
"bytes"
"encoding/json"
"github.com/gogo/protobuf/jsonpb"
)
const (
CodeTypeOK uint32 = 0
)
// IsOK returns true if Code is OK.
func (r ResponseCheckTx) IsOK() bool {
return r.Code == CodeTypeOK
}
// IsErr returns true if Code is something other than OK.
func (r ResponseCheckTx) IsErr() bool {
return r.Code != CodeTypeOK
}
// IsOK returns true if Code is OK.
func (r ResponseDeliverTx) IsOK() bool {
return r.Code == CodeTypeOK
}
// IsErr returns true if Code is something other than OK.
func (r ResponseDeliverTx) IsErr() bool {
return r.Code != CodeTypeOK
}
// IsOK returns true if Code is OK.
func (r ResponseQuery) IsOK() bool {
return r.Code == CodeTypeOK
}
// IsErr returns true if Code is something other than OK.
func (r ResponseQuery) IsErr() bool {
return r.Code != CodeTypeOK
}
//---------------------------------------------------------------------------
// override JSON marshalling so we dont emit defaults (ie. disable omitempty)
// note we need Unmarshal functions too because protobuf had the bright idea
// to marshal int64->string. cool. cool, cool, cool: https://developers.google.com/protocol-buffers/docs/proto3#json
var (
jsonpbMarshaller = jsonpb.Marshaler{
EnumsAsInts: true,
EmitDefaults: false,
}
jsonpbUnmarshaller = jsonpb.Unmarshaler{}
)
func (r *ResponseSetOption) MarshalJSON() ([]byte, error) {
s, err := jsonpbMarshaller.MarshalToString(r)
return []byte(s), err
}
func (r *ResponseSetOption) UnmarshalJSON(b []byte) error {
reader := bytes.NewBuffer(b)
return jsonpbUnmarshaller.Unmarshal(reader, r)
}
func (r *ResponseCheckTx) MarshalJSON() ([]byte, error) {
s, err := jsonpbMarshaller.MarshalToString(r)
return []byte(s), err
}
func (r *ResponseCheckTx) UnmarshalJSON(b []byte) error {
reader := bytes.NewBuffer(b)
return jsonpbUnmarshaller.Unmarshal(reader, r)
}
func (r *ResponseDeliverTx) MarshalJSON() ([]byte, error) {
s, err := jsonpbMarshaller.MarshalToString(r)
return []byte(s), err
}
func (r *ResponseDeliverTx) UnmarshalJSON(b []byte) error {
reader := bytes.NewBuffer(b)
return jsonpbUnmarshaller.Unmarshal(reader, r)
}
func (r *ResponseQuery) MarshalJSON() ([]byte, error) {
s, err := jsonpbMarshaller.MarshalToString(r)
return []byte(s), err
}
func (r *ResponseQuery) UnmarshalJSON(b []byte) error {
reader := bytes.NewBuffer(b)
return jsonpbUnmarshaller.Unmarshal(reader, r)
}
func (r *ResponseCommit) MarshalJSON() ([]byte, error) {
s, err := jsonpbMarshaller.MarshalToString(r)
return []byte(s), err
}
func (r *ResponseCommit) UnmarshalJSON(b []byte) error {
reader := bytes.NewBuffer(b)
return jsonpbUnmarshaller.Unmarshal(reader, r)
}
// Some compile time assertions to ensure we don't
// have accidental runtime surprises later on.
// jsonEncodingRoundTripper ensures that asserted
// interfaces implement both MarshalJSON and UnmarshalJSON
type jsonRoundTripper interface {
json.Marshaler
json.Unmarshaler
}
var _ jsonRoundTripper = (*ResponseCommit)(nil)
var _ jsonRoundTripper = (*ResponseQuery)(nil)
var _ jsonRoundTripper = (*ResponseDeliverTx)(nil)
var _ jsonRoundTripper = (*ResponseCheckTx)(nil)
var _ jsonRoundTripper = (*ResponseSetOption)(nil)

15855
abci/types/types.pb.go Normal file

File diff suppressed because it is too large Load Diff

344
abci/types/types.proto Normal file
View File

@ -0,0 +1,344 @@
syntax = "proto3";
package types;
// For more information on gogo.proto, see:
// https://github.com/gogo/protobuf/blob/master/extensions.md
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "github.com/tendermint/tendermint/crypto/merkle/merkle.proto";
import "github.com/tendermint/tendermint/libs/common/types.proto";
import "google/protobuf/timestamp.proto";
// This file is copied from http://github.com/tendermint/abci
// NOTE: When using custom types, mind the warnings.
// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.goproto_registration) = true;
// Generate tests
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.testgen_all) = true;
//----------------------------------------
// Request types
message Request {
oneof value {
RequestEcho echo = 2;
RequestFlush flush = 3;
RequestInfo info = 4;
RequestSetOption set_option = 5;
RequestInitChain init_chain = 6;
RequestQuery query = 7;
RequestBeginBlock begin_block = 8;
RequestCheckTx check_tx = 9;
RequestDeliverTx deliver_tx = 19;
RequestEndBlock end_block = 11;
RequestCommit commit = 12;
}
}
message RequestEcho {
string message = 1;
}
message RequestFlush {
}
message RequestInfo {
string version = 1;
uint64 block_version = 2;
uint64 p2p_version = 3;
}
// nondeterministic
message RequestSetOption {
string key = 1;
string value = 2;
}
message RequestInitChain {
google.protobuf.Timestamp time = 1 [(gogoproto.nullable)=false, (gogoproto.stdtime)=true];
string chain_id = 2;
ConsensusParams consensus_params = 3;
repeated ValidatorUpdate validators = 4 [(gogoproto.nullable)=false];
bytes app_state_bytes = 5;
}
message RequestQuery {
bytes data = 1;
string path = 2;
int64 height = 3;
bool prove = 4;
}
message RequestBeginBlock {
bytes hash = 1;
Header header = 2 [(gogoproto.nullable)=false];
LastCommitInfo last_commit_info = 3 [(gogoproto.nullable)=false];
repeated Evidence byzantine_validators = 4 [(gogoproto.nullable)=false];
}
enum CheckTxType {
New = 0;
Recheck = 1;
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
message RequestDeliverTx {
bytes tx = 1;
}
message RequestEndBlock {
int64 height = 1;
}
message RequestCommit {
}
//----------------------------------------
// Response types
message Response {
oneof value {
ResponseException exception = 1;
ResponseEcho echo = 2;
ResponseFlush flush = 3;
ResponseInfo info = 4;
ResponseSetOption set_option = 5;
ResponseInitChain init_chain = 6;
ResponseQuery query = 7;
ResponseBeginBlock begin_block = 8;
ResponseCheckTx check_tx = 9;
ResponseDeliverTx deliver_tx = 10;
ResponseEndBlock end_block = 11;
ResponseCommit commit = 12;
}
}
// nondeterministic
message ResponseException {
string error = 1;
}
message ResponseEcho {
string message = 1;
}
message ResponseFlush {
}
message ResponseInfo {
string data = 1;
string version = 2;
uint64 app_version = 3;
int64 last_block_height = 4;
bytes last_block_app_hash = 5;
}
// nondeterministic
message ResponseSetOption {
uint32 code = 1;
// bytes data = 2;
string log = 3;
string info = 4;
}
message ResponseInitChain {
ConsensusParams consensus_params = 1;
repeated ValidatorUpdate validators = 2 [(gogoproto.nullable)=false];
}
message ResponseQuery {
uint32 code = 1;
// bytes data = 2; // use "value" instead.
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 index = 5;
bytes key = 6;
bytes value = 7;
merkle.Proof proof = 8;
int64 height = 9;
string codespace = 10;
}
message ResponseBeginBlock {
repeated Event events = 1 [(gogoproto.nullable)=false, (gogoproto.jsontag)="events,omitempty"];
}
message ResponseCheckTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 gas_wanted = 5;
int64 gas_used = 6;
repeated Event events = 7 [(gogoproto.nullable)=false, (gogoproto.jsontag)="events,omitempty"];
string codespace = 8;
}
message ResponseDeliverTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 gas_wanted = 5;
int64 gas_used = 6;
repeated Event events = 7 [(gogoproto.nullable)=false, (gogoproto.jsontag)="events,omitempty"];
string codespace = 8;
}
message ResponseEndBlock {
repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable)=false];
ConsensusParams consensus_param_updates = 2;
repeated Event events = 3 [(gogoproto.nullable)=false, (gogoproto.jsontag)="events,omitempty"];
}
message ResponseCommit {
// reserve 1
bytes data = 2;
}
//----------------------------------------
// Misc.
// ConsensusParams contains all consensus-relevant parameters
// that can be adjusted by the abci app
message ConsensusParams {
BlockParams block = 1;
EvidenceParams evidence = 2;
ValidatorParams validator = 3;
}
// BlockParams contains limits on the block size.
message BlockParams {
// Note: must be greater than 0
int64 max_bytes = 1;
// Note: must be greater or equal to -1
int64 max_gas = 2;
}
// EvidenceParams contains limits on the evidence.
message EvidenceParams {
// Note: must be greater than 0
int64 max_age = 1;
}
// ValidatorParams contains limits on validators.
message ValidatorParams {
repeated string pub_key_types = 1;
}
message LastCommitInfo {
int32 round = 1;
repeated VoteInfo votes = 2 [(gogoproto.nullable)=false];
}
message Event {
string type = 1;
repeated common.KVPair attributes = 2 [(gogoproto.nullable)=false, (gogoproto.jsontag)="attributes,omitempty"];
}
//----------------------------------------
// Blockchain Types
message Header {
// basic block info
Version version = 1 [(gogoproto.nullable)=false];
string chain_id = 2 [(gogoproto.customname)="ChainID"];
int64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable)=false, (gogoproto.stdtime)=true];
int64 num_txs = 5;
int64 total_txs = 6;
// prev block info
BlockID last_block_id = 7 [(gogoproto.nullable)=false];
// hashes of block data
bytes last_commit_hash = 8; // commit from validators from the last block
bytes data_hash = 9; // transactions
// hashes from the app output from the prev block
bytes validators_hash = 10; // validators for the current block
bytes next_validators_hash = 11; // validators for the next block
bytes consensus_hash = 12; // consensus params for current block
bytes app_hash = 13; // state after txs from the previous block
bytes last_results_hash = 14;// root hash of all results from the txs from the previous block
// consensus info
bytes evidence_hash = 15; // evidence included in the block
bytes proposer_address = 16; // original proposer of the block
}
message Version {
uint64 Block = 1;
uint64 App = 2;
}
message BlockID {
bytes hash = 1;
PartSetHeader parts_header = 2 [(gogoproto.nullable)=false];
}
message PartSetHeader {
int32 total = 1;
bytes hash = 2;
}
// Validator
message Validator {
bytes address = 1;
//PubKey pub_key = 2 [(gogoproto.nullable)=false];
int64 power = 3;
}
// ValidatorUpdate
message ValidatorUpdate {
PubKey pub_key = 1 [(gogoproto.nullable)=false];
int64 power = 2;
}
// VoteInfo
message VoteInfo {
Validator validator = 1 [(gogoproto.nullable)=false];
bool signed_last_block = 2;
}
message PubKey {
string type = 1;
bytes data = 2;
}
message Evidence {
string type = 1;
Validator validator = 2 [(gogoproto.nullable)=false];
int64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable)=false, (gogoproto.stdtime)=true];
int64 total_voting_power = 5;
}
//----------------------------------------
// Service Definition
service ABCIApplication {
rpc Echo(RequestEcho) returns (ResponseEcho) ;
rpc Flush(RequestFlush) returns (ResponseFlush);
rpc Info(RequestInfo) returns (ResponseInfo);
rpc SetOption(RequestSetOption) returns (ResponseSetOption);
rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
rpc Query(RequestQuery) returns (ResponseQuery);
rpc Commit(RequestCommit) returns (ResponseCommit);
rpc InitChain(RequestInitChain) returns (ResponseInitChain);
rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
}

4986
abci/types/typespb_test.go Normal file

File diff suppressed because it is too large Load Diff

34
abci/types/util.go Normal file
View File

@ -0,0 +1,34 @@
package types
import (
"bytes"
"sort"
)
//------------------------------------------------------------------------------
// ValidatorUpdates is a list of validators that implements the Sort interface
type ValidatorUpdates []ValidatorUpdate
var _ sort.Interface = (ValidatorUpdates)(nil)
// All these methods for ValidatorUpdates:
// Len, Less and Swap
// are for ValidatorUpdates to implement sort.Interface
// which will be used by the sort package.
// See Issue https://github.com/tendermint/abci/issues/212
func (v ValidatorUpdates) Len() int {
return len(v)
}
// XXX: doesn't distinguish same validator with different power
func (v ValidatorUpdates) Less(i, j int) bool {
return bytes.Compare(v[i].PubKey.Data, v[j].PubKey.Data) <= 0
}
func (v ValidatorUpdates) Swap(i, j int) {
v1 := v[i]
v[i] = v[j]
v[j] = v1
}

9
abci/version/version.go Normal file
View File

@ -0,0 +1,9 @@
package version
import (
"github.com/tendermint/tendermint/version"
)
// TODO: eliminate this after some version refactor
const Version = version.ABCIVersion

12
appveyor.yml Normal file
View File

@ -0,0 +1,12 @@
version: 1.0.{build}
configuration: Release
platform:
- x64
- x86
clone_folder: c:\go\path\src\github.com\tendermint\tendermint
before_build:
- cmd: set GOPATH=%GOROOT%\path
- cmd: set PATH=%GOPATH%\bin;%PATH%
build_script:
- cmd: make test
test: off

View File

@ -0,0 +1,49 @@
package behaviour
import (
"github.com/tendermint/tendermint/p2p"
)
// PeerBehaviour is a struct describing a behaviour a peer performed.
// `peerID` identifies the peer and reason characterizes the specific
// behaviour performed by the peer.
type PeerBehaviour struct {
peerID p2p.ID
reason interface{}
}
type badMessage struct {
explanation string
}
// BadMessage returns a badMessage PeerBehaviour.
func BadMessage(peerID p2p.ID, explanation string) PeerBehaviour {
return PeerBehaviour{peerID: peerID, reason: badMessage{explanation}}
}
type messageOutOfOrder struct {
explanation string
}
// MessageOutOfOrder returns a messagOutOfOrder PeerBehaviour.
func MessageOutOfOrder(peerID p2p.ID, explanation string) PeerBehaviour {
return PeerBehaviour{peerID: peerID, reason: messageOutOfOrder{explanation}}
}
type consensusVote struct {
explanation string
}
// ConsensusVote returns a consensusVote PeerBehaviour.
func ConsensusVote(peerID p2p.ID, explanation string) PeerBehaviour {
return PeerBehaviour{peerID: peerID, reason: consensusVote{explanation}}
}
type blockPart struct {
explanation string
}
// BlockPart returns blockPart PeerBehaviour.
func BlockPart(peerID p2p.ID, explanation string) PeerBehaviour {
return PeerBehaviour{peerID: peerID, reason: blockPart{explanation}}
}

84
behaviour/reporter.go Normal file
View File

@ -0,0 +1,84 @@
package behaviour
import (
"errors"
"sync"
"github.com/tendermint/tendermint/p2p"
)
// Reporter provides an interface for reactors to report the behaviour
// of peers synchronously to other components.
type Reporter interface {
Report(behaviour PeerBehaviour) error
}
// SwitchReporter reports peer behaviour to an internal Switch.
type SwitchReporter struct {
sw *p2p.Switch
}
// NewSwitchReporter return a new SwitchReporter instance which wraps the Switch.
func NewSwitcReporter(sw *p2p.Switch) *SwitchReporter {
return &SwitchReporter{
sw: sw,
}
}
// Report reports the behaviour of a peer to the Switch.
func (spbr *SwitchReporter) Report(behaviour PeerBehaviour) error {
peer := spbr.sw.Peers().Get(behaviour.peerID)
if peer == nil {
return errors.New("peer not found")
}
switch reason := behaviour.reason.(type) {
case consensusVote, blockPart:
spbr.sw.MarkPeerAsGood(peer)
case badMessage:
spbr.sw.StopPeerForError(peer, reason.explanation)
case messageOutOfOrder:
spbr.sw.StopPeerForError(peer, reason.explanation)
default:
return errors.New("unknown reason reported")
}
return nil
}
// MockReporter is a concrete implementation of the Reporter
// interface used in reactor tests to ensure reactors report the correct
// behaviour in manufactured scenarios.
type MockReporter struct {
mtx sync.RWMutex
pb map[p2p.ID][]PeerBehaviour
}
// NewMockReporter returns a Reporter which records all reported
// behaviours in memory.
func NewMockReporter() *MockReporter {
return &MockReporter{
pb: map[p2p.ID][]PeerBehaviour{},
}
}
// Report stores the PeerBehaviour produced by the peer identified by peerID.
func (mpbr *MockReporter) Report(behaviour PeerBehaviour) {
mpbr.mtx.Lock()
defer mpbr.mtx.Unlock()
mpbr.pb[behaviour.peerID] = append(mpbr.pb[behaviour.peerID], behaviour)
}
// GetBehaviours returns all behaviours reported on the peer identified by peerID.
func (mpbr *MockReporter) GetBehaviours(peerID p2p.ID) []PeerBehaviour {
mpbr.mtx.RLock()
defer mpbr.mtx.RUnlock()
if items, ok := mpbr.pb[peerID]; ok {
result := make([]PeerBehaviour, len(items))
copy(result, items)
return result
} else {
return []PeerBehaviour{}
}
}

186
behaviour/reporter_test.go Normal file
View File

@ -0,0 +1,186 @@
package behaviour_test
import (
"sync"
"testing"
bh "github.com/tendermint/tendermint/behaviour"
"github.com/tendermint/tendermint/p2p"
)
// TestMockReporter tests the MockReporter's ability to store reported
// peer behaviour in memory indexed by the peerID.
func TestMockReporter(t *testing.T) {
var peerID p2p.ID = "MockPeer"
pr := bh.NewMockReporter()
behaviours := pr.GetBehaviours(peerID)
if len(behaviours) != 0 {
t.Error("Expected to have no behaviours reported")
}
badMessage := bh.BadMessage(peerID, "bad message")
pr.Report(badMessage)
behaviours = pr.GetBehaviours(peerID)
if len(behaviours) != 1 {
t.Error("Expected the peer have one reported behaviour")
}
if behaviours[0] != badMessage {
t.Error("Expected Bad Message to have been reported")
}
}
type scriptItem struct {
peerID p2p.ID
behaviour bh.PeerBehaviour
}
// equalBehaviours returns true if a and b contain the same PeerBehaviours with
// the same freequencies and otherwise false.
func equalBehaviours(a []bh.PeerBehaviour, b []bh.PeerBehaviour) bool {
aHistogram := map[bh.PeerBehaviour]int{}
bHistogram := map[bh.PeerBehaviour]int{}
for _, behaviour := range a {
aHistogram[behaviour] += 1
}
for _, behaviour := range b {
bHistogram[behaviour] += 1
}
if len(aHistogram) != len(bHistogram) {
return false
}
for _, behaviour := range a {
if aHistogram[behaviour] != bHistogram[behaviour] {
return false
}
}
for _, behaviour := range b {
if bHistogram[behaviour] != aHistogram[behaviour] {
return false
}
}
return true
}
// TestEqualPeerBehaviours tests that equalBehaviours can tell that two slices
// of peer behaviours can be compared for the behaviours they contain and the
// freequencies that those behaviours occur.
func TestEqualPeerBehaviours(t *testing.T) {
var (
peerID p2p.ID = "MockPeer"
consensusVote = bh.ConsensusVote(peerID, "voted")
blockPart = bh.BlockPart(peerID, "blocked")
equals = []struct {
left []bh.PeerBehaviour
right []bh.PeerBehaviour
}{
// Empty sets
{[]bh.PeerBehaviour{}, []bh.PeerBehaviour{}},
// Single behaviours
{[]bh.PeerBehaviour{consensusVote}, []bh.PeerBehaviour{consensusVote}},
// Equal Frequencies
{[]bh.PeerBehaviour{consensusVote, consensusVote},
[]bh.PeerBehaviour{consensusVote, consensusVote}},
// Equal frequencies different orders
{[]bh.PeerBehaviour{consensusVote, blockPart},
[]bh.PeerBehaviour{blockPart, consensusVote}},
}
unequals = []struct {
left []bh.PeerBehaviour
right []bh.PeerBehaviour
}{
// Comparing empty sets to non empty sets
{[]bh.PeerBehaviour{}, []bh.PeerBehaviour{consensusVote}},
// Different behaviours
{[]bh.PeerBehaviour{consensusVote}, []bh.PeerBehaviour{blockPart}},
// Same behaviour with different frequencies
{[]bh.PeerBehaviour{consensusVote},
[]bh.PeerBehaviour{consensusVote, consensusVote}},
}
)
for _, test := range equals {
if !equalBehaviours(test.left, test.right) {
t.Errorf("Expected %#v and %#v to be equal", test.left, test.right)
}
}
for _, test := range unequals {
if equalBehaviours(test.left, test.right) {
t.Errorf("Expected %#v and %#v to be unequal", test.left, test.right)
}
}
}
// TestPeerBehaviourConcurrency constructs a scenario in which
// multiple goroutines are using the same MockReporter instance.
// This test reproduces the conditions in which MockReporter will
// be used within a Reactor `Receive` method tests to ensure thread safety.
func TestMockPeerBehaviourReporterConcurrency(t *testing.T) {
var (
behaviourScript = []struct {
peerID p2p.ID
behaviours []bh.PeerBehaviour
}{
{"1", []bh.PeerBehaviour{bh.ConsensusVote("1", "")}},
{"2", []bh.PeerBehaviour{bh.ConsensusVote("2", ""), bh.ConsensusVote("2", ""), bh.ConsensusVote("2", "")}},
{"3", []bh.PeerBehaviour{bh.BlockPart("3", ""), bh.ConsensusVote("3", ""), bh.BlockPart("3", ""), bh.ConsensusVote("3", "")}},
{"4", []bh.PeerBehaviour{bh.ConsensusVote("4", ""), bh.ConsensusVote("4", ""), bh.ConsensusVote("4", ""), bh.ConsensusVote("4", "")}},
{"5", []bh.PeerBehaviour{bh.BlockPart("5", ""), bh.ConsensusVote("5", ""), bh.BlockPart("5", ""), bh.ConsensusVote("5", "")}},
}
)
var receiveWg sync.WaitGroup
pr := bh.NewMockReporter()
scriptItems := make(chan scriptItem)
done := make(chan int)
numConsumers := 3
for i := 0; i < numConsumers; i++ {
receiveWg.Add(1)
go func() {
defer receiveWg.Done()
for {
select {
case pb := <-scriptItems:
pr.Report(pb.behaviour)
case <-done:
return
}
}
}()
}
var sendingWg sync.WaitGroup
sendingWg.Add(1)
go func() {
defer sendingWg.Done()
for _, item := range behaviourScript {
for _, reason := range item.behaviours {
scriptItems <- scriptItem{item.peerID, reason}
}
}
}()
sendingWg.Wait()
for i := 0; i < numConsumers; i++ {
done <- 1
}
receiveWg.Wait()
for _, items := range behaviourScript {
reported := pr.GetBehaviours(items.peerID)
if !equalBehaviours(reported, items.behaviours) {
t.Errorf("Expected peer %s to have behaved \nExpected: %#v \nGot %#v \n",
items.peerID, items.behaviours, reported)
}
}
}

2
benchmarks/blockchain/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
data

View File

@ -0,0 +1,80 @@
#!/bin/bash
DATA=$GOPATH/src/github.com/tendermint/tendermint/benchmarks/blockchain/data
if [ ! -d $DATA ]; then
echo "no data found, generating a chain... (this only has to happen once)"
tendermint init --home $DATA
cp $DATA/config.toml $DATA/config2.toml
echo "
[consensus]
timeout_commit = 0
" >> $DATA/config.toml
echo "starting node"
tendermint node \
--home $DATA \
--proxy_app kvstore \
--p2p.laddr tcp://127.0.0.1:56656 \
--rpc.laddr tcp://127.0.0.1:56657 \
--log_level error &
echo "making blocks for 60s"
sleep 60
mv $DATA/config2.toml $DATA/config.toml
kill %1
echo "done generating chain."
fi
# validator node
HOME1=$TMPDIR$RANDOM$RANDOM
cp -R $DATA $HOME1
echo "starting validator node"
tendermint node \
--home $HOME1 \
--proxy_app kvstore \
--p2p.laddr tcp://127.0.0.1:56656 \
--rpc.laddr tcp://127.0.0.1:56657 \
--log_level error &
sleep 1
# downloader node
HOME2=$TMPDIR$RANDOM$RANDOM
tendermint init --home $HOME2
cp $HOME1/genesis.json $HOME2
printf "starting downloader node"
tendermint node \
--home $HOME2 \
--proxy_app kvstore \
--p2p.laddr tcp://127.0.0.1:56666 \
--rpc.laddr tcp://127.0.0.1:56667 \
--p2p.persistent_peers 127.0.0.1:56656 \
--log_level error &
# wait for node to start up so we only count time where we are actually syncing
sleep 0.5
while curl localhost:56667/status 2> /dev/null | grep "\"latest_block_height\": 0," > /dev/null
do
printf '.'
sleep 0.2
done
echo
echo "syncing blockchain for 10s"
for i in {1..10}
do
sleep 1
HEIGHT="$(curl localhost:56667/status 2> /dev/null \
| grep 'latest_block_height' \
| grep -o ' [0-9]*' \
| xargs)"
let 'RATE = HEIGHT / i'
echo "height: $HEIGHT, blocks/sec: $RATE"
done
kill %1
kill %2
rm -rf $HOME1 $HOME2

View File

@ -2,37 +2,55 @@ package benchmarks
import (
"testing"
"time"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/go-crypto"
"github.com/tendermint/go-p2p"
"github.com/tendermint/go-wire"
proto "github.com/tendermint/tendermint/benchmarks/proto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/p2p"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
)
func testNodeInfo(id p2p.ID) p2p.DefaultNodeInfo {
return p2p.DefaultNodeInfo{
ProtocolVersion: p2p.ProtocolVersion{P2P: 1, Block: 2, App: 3},
ID_: id,
Moniker: "SOMENAME",
Network: "SOMENAME",
ListenAddr: "SOMEADDR",
Version: "SOMEVER",
Other: p2p.DefaultNodeInfoOther{
TxIndex: "on",
RPCAddress: "0.0.0.0:26657",
},
}
}
func BenchmarkEncodeStatusWire(b *testing.B) {
b.StopTimer()
pubKey := crypto.GenPrivKeyEd25519().PubKey().(crypto.PubKeyEd25519)
cdc := amino.NewCodec()
ctypes.RegisterAmino(cdc)
nodeKey := p2p.NodeKey{PrivKey: ed25519.GenPrivKey()}
status := &ctypes.ResultStatus{
NodeInfo: &p2p.NodeInfo{
PubKey: pubKey,
Moniker: "SOMENAME",
Network: "SOMENAME",
RemoteAddr: "SOMEADDR",
ListenAddr: "SOMEADDR",
Version: "SOMEVER",
Other: []string{"SOMESTRING", "OTHERSTRING"},
NodeInfo: testNodeInfo(nodeKey.ID()),
SyncInfo: ctypes.SyncInfo{
LatestBlockHash: []byte("SOMEBYTES"),
LatestBlockHeight: 123,
LatestBlockTime: time.Unix(0, 1234),
},
ValidatorInfo: ctypes.ValidatorInfo{
PubKey: nodeKey.PubKey(),
},
PubKey: pubKey,
LatestBlockHash: []byte("SOMEBYTES"),
LatestBlockHeight: 123,
LatestBlockTime: 1234,
}
b.StartTimer()
counter := 0
for i := 0; i < b.N; i++ {
jsonBytes := wire.JSONBytes(status)
jsonBytes, err := cdc.MarshalJSON(status)
if err != nil {
panic(err)
}
counter += len(jsonBytes)
}
@ -40,42 +58,33 @@ func BenchmarkEncodeStatusWire(b *testing.B) {
func BenchmarkEncodeNodeInfoWire(b *testing.B) {
b.StopTimer()
pubKey := crypto.GenPrivKeyEd25519().PubKey().(crypto.PubKeyEd25519)
nodeInfo := &p2p.NodeInfo{
PubKey: pubKey,
Moniker: "SOMENAME",
Network: "SOMENAME",
RemoteAddr: "SOMEADDR",
ListenAddr: "SOMEADDR",
Version: "SOMEVER",
Other: []string{"SOMESTRING", "OTHERSTRING"},
}
cdc := amino.NewCodec()
ctypes.RegisterAmino(cdc)
nodeKey := p2p.NodeKey{PrivKey: ed25519.GenPrivKey()}
nodeInfo := testNodeInfo(nodeKey.ID())
b.StartTimer()
counter := 0
for i := 0; i < b.N; i++ {
jsonBytes := wire.JSONBytes(nodeInfo)
jsonBytes, err := cdc.MarshalJSON(nodeInfo)
if err != nil {
panic(err)
}
counter += len(jsonBytes)
}
}
func BenchmarkEncodeNodeInfoBinary(b *testing.B) {
b.StopTimer()
pubKey := crypto.GenPrivKeyEd25519().PubKey().(crypto.PubKeyEd25519)
nodeInfo := &p2p.NodeInfo{
PubKey: pubKey,
Moniker: "SOMENAME",
Network: "SOMENAME",
RemoteAddr: "SOMEADDR",
ListenAddr: "SOMEADDR",
Version: "SOMEVER",
Other: []string{"SOMESTRING", "OTHERSTRING"},
}
cdc := amino.NewCodec()
ctypes.RegisterAmino(cdc)
nodeKey := p2p.NodeKey{PrivKey: ed25519.GenPrivKey()}
nodeInfo := testNodeInfo(nodeKey.ID())
b.StartTimer()
counter := 0
for i := 0; i < b.N; i++ {
jsonBytes := wire.BinaryBytes(nodeInfo)
jsonBytes := cdc.MustMarshalBinaryBare(nodeInfo)
counter += len(jsonBytes)
}
@ -83,16 +92,20 @@ func BenchmarkEncodeNodeInfoBinary(b *testing.B) {
func BenchmarkEncodeNodeInfoProto(b *testing.B) {
b.StopTimer()
pubKey := crypto.GenPrivKeyEd25519().PubKey().(crypto.PubKeyEd25519)
pubKey2 := &proto.PubKey{Ed25519: &proto.PubKeyEd25519{Bytes: pubKey[:]}}
nodeInfo := &proto.NodeInfo{
PubKey: pubKey2,
Moniker: "SOMENAME",
Network: "SOMENAME",
RemoteAddr: "SOMEADDR",
ListenAddr: "SOMEADDR",
Version: "SOMEVER",
Other: []string{"SOMESTRING", "OTHERSTRING"},
nodeKey := p2p.NodeKey{PrivKey: ed25519.GenPrivKey()}
nodeID := string(nodeKey.ID())
someName := "SOMENAME"
someAddr := "SOMEADDR"
someVer := "SOMEVER"
someString := "SOMESTRING"
otherString := "OTHERSTRING"
nodeInfo := proto.NodeInfo{
Id: &proto.ID{Id: &nodeID},
Moniker: &someName,
Network: &someName,
ListenAddr: &someAddr,
Version: &someVer,
Other: []string{someString, otherString},
}
b.StartTimer()

View File

@ -1,8 +1,9 @@
package benchmarks
import (
. "github.com/tendermint/go-common"
"testing"
cmn "github.com/tendermint/tendermint/libs/common"
)
func BenchmarkSomething(b *testing.B) {
@ -11,11 +12,11 @@ func BenchmarkSomething(b *testing.B) {
numChecks := 100000
keys := make([]string, numItems)
for i := 0; i < numItems; i++ {
keys[i] = RandStr(100)
keys[i] = cmn.RandStr(100)
}
txs := make([]string, numChecks)
for i := 0; i < numChecks; i++ {
txs[i] = RandStr(100)
txs[i] = cmn.RandStr(100)
}
b.StartTimer()

View File

@ -4,7 +4,7 @@ import (
"os"
"testing"
. "github.com/tendermint/go-common"
cmn "github.com/tendermint/tendermint/libs/common"
)
func BenchmarkFileWrite(b *testing.B) {
@ -14,16 +14,20 @@ func BenchmarkFileWrite(b *testing.B) {
if err != nil {
b.Error(err)
}
testString := RandStr(200) + "\n"
testString := cmn.RandStr(200) + "\n"
b.StartTimer()
for i := 0; i < b.N; i++ {
file.Write([]byte(testString))
_, err := file.Write([]byte(testString))
if err != nil {
b.Error(err)
}
}
file.Close()
err = os.Remove("benchmark_file_write.out")
if err != nil {
if err := file.Close(); err != nil {
b.Error(err)
}
if err := os.Remove("benchmark_file_write.out"); err != nil {
b.Error(err)
}
}

Some files were not shown because too many files have changed in this diff Show More