7414 Commits

Author SHA1 Message Date
Phil Salant
04d13d9945 fix linter errors thrown by unconvert, goconst, and nakedret (#3960)
* Remove unnecessary type conversions

* Consolidate repeated strings into consts

* Clothe return statements

* Update blockchain/v1/reactor_fsm_test.go

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

This PR repairs linter errors seen when running the following commands:
golangci-lint run --no-config --disable-all=true --enable=unconvert
golangci-lint run --no-config --disable-all=true --enable=goconst
golangci-lint run --no-config --disable-all=true --enable=nakedret

Contributes to #3262
2019-09-10 11:31:44 +04:00
Mircea Colonescu
7f0c55f249 ran go mod tidy (#3967) 2019-09-10 08:56:16 +02:00
Michael Booth
22000c6a09 Zm fork accountability (#3840)
* Add fork scenarios

* Add more details about varios attack cases

* added more structure to the attack scenarios

* Update docs/spec/consensus/fork-accountability.md

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

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/fork-accountability.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* consensus properties explained

* added question on conflicting proposals

* misbehavior

* misbehave

* more misbehavior

* table discussion

* Add few clarifications
2019-09-06 19:45:49 +02:00
gracenoah
aa721b972f rpc: allow using a custom http client in rpc client (#3779)
fixes #2010

* allow using a custom http client in rpc client

* add tests and fix bug

* fix confusion between remote and address

* parse remote inside NewJSONRPCClientWithHTTPClient

* cleanups

* add warnings

* add changelog entry

* Update CHANGELOG_PENDING.md

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
2019-09-05 17:13:22 +04:00
dependabot-preview[bot]
72285115ec deps: bump github.com/go-kit/kit from 0.6.0 to 0.9.0 (#3952)
Bumps [github.com/go-kit/kit](https://github.com/go-kit/kit) from 0.6.0 to 0.9.0.
- [Release notes](https://github.com/go-kit/kit/releases)
- [Commits](https://github.com/go-kit/kit/compare/v0.6.0...v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 12:34:28 +04:00
dependabot-preview[bot]
c8ae619f1b deps: bump github.com/stretchr/testify from 1.3.0 to 1.4.0 (#3951)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.3.0...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 12:25:17 +04:00
Marko
4ba49a4236 deps: bump viper to 1.4.0 and logfmt to 0.4.0 (#3950)
- depndabot couldnt update a few deps as they needed to beupdated together.
- PRs: #3946, 3938 can be closed with this PR

Signedoff-by: Marko Baricevic <marbar3778@yahoo.com>
2019-09-05 11:56:32 +04:00
dependabot-preview[bot]
af66d8c9d8 deps: bump github.com/gorilla/websocket from 1.2.0 to 1.4.1 (#3945)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.2.0 to 1.4.1.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.2.0...v1.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 10:42:19 +04:00
dependabot-preview[bot]
e1e4ef4abf deps: bump google.golang.org/grpc from 1.22.0 to 1.23.0 (#3942)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.22.0...v1.23.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 10:32:00 +04:00
dependabot-preview[bot]
39ff9b8ee9 deps: bump github.com/libp2p/go-buffer-pool from 0.0.1 to 0.0.2 (#3948)
Bumps [github.com/libp2p/go-buffer-pool](https://github.com/libp2p/go-buffer-pool) from 0.0.1 to 0.0.2.
- [Release notes](https://github.com/libp2p/go-buffer-pool/releases)
- [Commits](https://github.com/libp2p/go-buffer-pool/compare/v0.0.1...v0.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 10:13:02 +04:00
dependabot-preview[bot]
a12eeeff62 deps: bump github.com/fortytw2/leaktest from 1.2.0 to 1.3.0 (#3943)
Bumps [github.com/fortytw2/leaktest](https://github.com/fortytw2/leaktest) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/fortytw2/leaktest/releases)
- [Commits](https://github.com/fortytw2/leaktest/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-04 21:06:48 +04:00
dependabot-preview[bot]
5a1e326577 deps: bump github.com/rs/cors from 1.6.0 to 1.7.0 (#3939)
Bumps [github.com/rs/cors](https://github.com/rs/cors) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/rs/cors/releases)
- [Commits](https://github.com/rs/cors/compare/v1.6.0...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-04 20:33:29 +04:00
dependabot-preview[bot]
482cb62cf5 deps: bump github.com/magiconair/properties from 1.8.0 to 1.8.1 (#3937)
Bumps [github.com/magiconair/properties](https://github.com/magiconair/properties) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/magiconair/properties/releases)
- [Changelog](https://github.com/magiconair/properties/blob/master/CHANGELOG.md)
- [Commits](https://github.com/magiconair/properties/compare/v1.8.0...v1.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-04 20:12:26 +04:00
Anton Kaliaev
fe2dddd3fe
deps: update gogo/protobuf version from v1.2.1 to v1.3.0 (#3947)
* update gogo/protobuf version from v1.2.1 to v1.3.0

Also errcheck from v1.1.0 to v1.2.0

See full diff in
- https://github.com/gogo/protobuf/compare/v1.2.1...v1.3.0
- https://github.com/kisielk/errcheck/compare/v1.1.0...v1.2.0

Changelog:

Tested versions:

go 1.12.9
protoc 3.7.1
Improvements:

    plugin/stringer - Handle repeated and/or nullable types a bit better now.
    plugin/size - Remove the loop in sovXXX by using bit twiddling.
        Thanks: https://github.com/apelisse
    plugin/marshalto - Implemented a reverse marshal strategy which allows for faster marshalling. This now avoids a recursive (and repeated) call to Size().
        Thanks: https://github.com/apelisse
    plugin/compare - Added support for for oneof types.

Bug fixes:

    protoc-gen-gogo/generator - Fix assignment to entry in nil map.
        Thanks: https://github.com/tgulacsi
    protoc-gen-gogo/generator - Allows plugins to call RecordTypeUse without panicking.
        Thanks: https://github.com/fedenusy
    proto/extensions - Fixed set extension regression. We did not clear the extensions before setting.
    io/uint32 - fix uint32reader bug that causes ReadMsg to recreate buffer when lengths are the same.
        Thanks: https://github.com/SebiSujar
    proto/table_merge: Fix merge of non-nullable slices.
        Thanks: https://github.com/euroelessar

Upstream commits:

    merged in golang/protobuf commit 318d17de72747ed1c16502681db4b2bb709a92d0 - Add UnimplementedServer for server interface
    merged in golang/protobuf commit b85cd75de734650db18a99a943fe351d41387800 - protoc-gen-go/grpc: inline errUnimplemented function
    merged in golang/protobuf commit d3c38a4eb4970272b87a425ae00ccc4548e2f9bb - protoc-gen-go/grpc: use status and code packages only if needed
    merged in golang/protobuf commit e91709a02e0e8ff8b86b7aa913fdc9ae9498e825 - fix indentation in jsonpb with Any messages
    merged in golang/protobuf commit 8d0c54c1246661d9a51ca0ba455d22116d485eaa - protoc-gen-go: generate XXX_OneofWrappers instead of XXX_OneofFuncs

Misc:

    extensions.md - Markdown update.
        Thanks: https://github.com/TennyZhuang
    Readme.md - Added user.
    go/protoc update - Updated to go1.12.x and protoc 3.7.1
    Makefile update - fix go vet shadow tool reference
    test/mixbench - Update mixbench tool. Expose runnable benchmarks via flags.

* update certstrap

* update golangci-lint from v1.13.2 to v1.17.1

* update gox as well

* test

* comment out golangci temporary

* comment out go-deadlock deps
2019-09-04 19:58:43 +04:00
Anton Kaliaev
acb874eaf6
docs: move dev sessions into docs (#3934)
* docs: move dev sessions into docs

and transform the list into a table

* fix formatting
2019-09-03 11:59:13 +04:00
Michelle-L
1802b60833 docs: add dev sessions from YouTube (#3929)
* Create development_sessions

* Rename development_sessions to videos_development_sessions

* Update videos_development_sessions

* Rename videos_development_sessions to videos_development_sessions_md

* Delete videos_development_sessions_md

* Add files via upload
2019-09-03 11:38:32 +04:00
Marko
72785a2e86 docs: switch the data in /unconfirmed_txs and num_unconfirmed_txs (#3933)
- switch the data that was represented in `/unconfirmed_txs` and `num_unconfirmed_txs`

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-09-02 22:23:02 +04:00
Anton Kaliaev
5346d8b9a2
v0.32.3 changelog and version bump (#3924) 2019-08-28 12:00:55 +04:00
josef-widder
f46e43eb38 Updated lite client spec (#3841)
* updates lite cline spec based on Zarko's and my previous specs

* updates spec incorporating comments from Aug 8 meeting

* added check of validators

* Update docs/spec/consensus/light-client.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/light-client.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/light-client.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/light-client.md

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* fix typos & improve formatting

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update docs/spec/consensus/light-client.md

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

* incorporated some of Anca's and Anton's comments

* addressed all current comments

* highlight assumptions/verification conditions

* added remark on checks

* Update docs/spec/consensus/light-client.md

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

* Update docs/spec/consensus/light-client.md

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

* Update docs/spec/consensus/light-client.md

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

* fixes

* addressed Ethan's comments from Aug 18

* trustlevel

* description of 3 docs fixed

* added comment on justification asked for by Anca

* bla

* removed trustlevel for adjacent headers. Added bisection order.

* added comment in bisection

* fixed comment in checksupport

* added comment on bisection timeout
2019-08-27 15:18:01 +02:00
Marko
e3a97b0981
Test nodejs image (#3921)
* Test nodejs image

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

* minor changes

* v in version

* version in swagger.yaml
2019-08-26 14:27:33 +02:00
Ethan Buchman
c475f25786 docs: fix some typos and changelog entries (#3915)
Fixes some typos in the docs.

Fixes the classification of some changelog items re Features vs. Improvements
2019-08-23 12:11:26 +04:00
Gustavo Chaín
7b2d018f84 rpc: protect subscription access from race condition (#3910)
When using the RPC client in my test suite (with -race enabled), I do a lot of Subscribe/Unsubscribe operations, at some point (randomly) the race detector returns the following warning:

WARNING: DATA RACE
Read at 0x00c0009dbe30 by goroutine 31:
runtime.mapiterinit()
/usr/local/go/src/runtime/map.go:804 +0x0
github.com/tendermint/tendermint/rpc/client.(*WSEvents).redoSubscriptionsAfter()
/go/pkg/mod/github.com/tendermint/tendermint@v0.31.5/rpc/client/httpclient.go:364 +0xc0
github.com/tendermint/tendermint/rpc/client.(*WSEvents).eventListener()
/go/pkg/mod/github.com/tendermint/tendermint@v0.31.5/rpc/client/httpclient.go:393 +0x3c6 

Turns out that the redoSubscriptionAfter is not protecting the access to subscriptions.

The following change protects the read access to the subscription map behind the mutex
2019-08-22 13:23:07 +04:00
Marko
eec6d33e14 remove mentions of go-wire (#3904)
*    Cleanup go-wire mentions
*    remove Roadmap.md
*    build_race in makefile was failing

ref #2790
2019-08-16 17:45:19 +04:00
Karoly Albert Szabo
ead3eefe5b [RPC] Static swagger (#3880)
* manually swagging

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

* three definitions with polymorphism

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

* added blockchain and block

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

* low quality generation, commit, block_response and validators

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

* genesis and consensus states endpoints

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

* fix indentation

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

* consensus parameters

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

* fix indentation

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

* add height to consensus parameters endpoint

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

* unconfirmed_txs and num_unconfirmed_txs

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

* add missing query parameter

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

* add ABCI queries

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

* added index document for swagger documentation

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

* add missing routes

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

* contract tests added on CCI

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

* contract tests job should be in the test suite

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

* simplify requirements to test

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

* typo

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

* build is a prerequisite to start localnet

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

* reduce nodejs size, move goodman to get_tools, add docs, fix comments

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

* Update scripts/get_tools.sh

That's cleaner, thanks!

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

* xz not supported by cci image, let's keep it simple

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

* REMOVE-indirect debug of CCI paths

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

* dirty experiment, volume is empty but binary has been produced

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

* dirty experiment, volume is empty but binary has been produced

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

* dirty experiment going on

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

* locally works, CCI have difficulties with second layaer containers volumes

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

* restore experiment, use machine instead of docker for contract tests

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

* simplify a bit

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

* rollback on machine golang

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

* Document the changes

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

* Changelog

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

* comments

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
2019-08-16 11:29:01 +02:00
Alessio Treglia
5670a7cf7b gitian: update reproducible builds to build with Go 1.12.8 (#3902) 2019-08-16 13:01:47 +04:00
Zaki Manian
7b101ab912 [ADR -44] Lite Client with Weak Subjectivity (#3795)
* Initiat commit of lite client with
with weak subjectivity ADR

* Apply suggestions from code review

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

* Update docs/architecture/adr-044-lite-client-with-weak-subjectivity.md

Co-Authored-By: Christopher Goes <cwgoes@pluranimity.org>

* Apply suggestions from code review

Co-Authored-By: Christopher Goes <cwgoes@pluranimity.org>

* Apply suggestions from code review

Co-Authored-By: Anca Zamfir <ancazamfir@users.noreply.github.com>

* fix typo and format the code block

* address cwgoes comments

* add Positive/Negative points

* change status to accepted

* Apply suggestions from code review

Co-Authored-By: Christopher Goes <cwgoes@pluranimity.org>

* link the spec and explain headers caching
2019-08-15 11:50:51 +02:00
Anton Kaliaev
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
Ivan Kushmantsev
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
Phil Salant
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
Marko
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
Marko
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
Marko
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
Jun Kimura
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
Sean Braithwaite
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
Juan Leni
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
Anton Kaliaev
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
Anton Kaliaev
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
Anton Kaliaev
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
Jack Zampolin
8ba8497ac8
Merge branch 'master' into release/v0.32.2 2019-08-02 08:52:21 -07:00
Marko
f9cce282da gocritic (2/2) (#3864)
Refs #3262
2019-08-02 10:53:52 +04:00
Marko
23fa2e1f1b Merge PR #3860: Update log v0.32.2
* changelog updates

* pr comments
2019-08-01 09:33:27 -07:00
Ethan Buchman
ba9cdeaed9
Merge branch 'v0.32' into release/v0.32.2 2019-07-31 17:26:40 -04:00
Marko Baricevic
8ed1400949 release for v0.32.2 2019-07-31 17:30:11 +02:00
Alexander Bezobchuk
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
Marko
f3ab967a46
version tmdb (#3854) 2019-07-31 16:17:09 +02:00
Marko
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
Marko
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
Anton Kaliaev
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
Ivan Kushmantsev
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
Anton Kaliaev
a4e0a46b73
docs: add a footer to guides (#3835) 2019-07-25 20:39:39 +04:00