7465 Commits

Author SHA1 Message Date
Anton Kaliaev
a4e0a46b73
docs: add a footer to guides (#3835) 2019-07-25 20:39:39 +04:00
folex
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
Anton Kaliaev
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
Marko
4b9e8505cb types: move MakeVote / MakeBlock functions (#3819)
to the types package

Paritally Fixes #3584
2019-07-25 12:13:19 +04:00
Marko
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
Anton Kaliaev
3a1f876802
docs: add guides to docs (#3830) 2019-07-24 23:05:00 +04:00
Marko
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
Anca Zamfir
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
Anton Kaliaev
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
Jun Kimura
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
Anton Kaliaev
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
zjubfd
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
Jun Kimura
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
Marko
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
Marko
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
Anton Kaliaev
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
Marko
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
Roman Useinov
a76c503dc6 abci/server: recover from app panics in socket server (#3809)
fixes #3800
2019-07-17 08:37:27 +04:00
Alex Dupre
fee26405e8 docs: fix consensus spec formatting (#3804) 2019-07-15 23:04:06 +04:00
Ethan Buchman
dbf4062acd
Merge pull request #3807 from tendermint/release/v0.32.1
Release/v0.32.1
v0.32.1
2019-07-15 12:25:35 -04:00
Marko
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
Ethan Buchman
79e924b34f
Merge branch 'master' into release/v0.32.1 2019-07-15 11:42:36 -04:00
Marko
0c9a284f8d Marko/update release1 (#3806)
* pr comments

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

* abci changelog change
2019-07-15 11:31:50 -04:00
Anton Kaliaev
86f7089396 add a changelog entry (#3802)
Refs https://github.com/tendermint/tendermint/pull/3758#issuecomment-510738955
2019-07-15 11:31:35 -04:00
Marko Baricevic
470f1efcc8 merge master 2019-07-15 11:34:01 +02:00
Marko
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
Marko
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
Marko Baricevic
4e3b6bfb26 Merge remote-tracking branch 'origin' into marko/v0.32.1 2019-07-13 13:40:04 +02:00
Marko Baricevic
7a86e49312 moved abci change to features as it doesnt break the abci 2019-07-13 13:39:11 +02:00
Karoly Albert Szabo
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
Karoly Albert Szabo
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
Marko Baricevic
744d65f173 Merge branch 'master' into marko/v0.32.1 2019-07-12 19:30:11 +02:00
Aditya
e7ac73177e upgrade go.mod (#3793)
upgrade levelDB to latest master
2019-07-12 19:29:36 +02:00
Marko Baricevic
1b69c6b56b include doc change for abci/app 2019-07-12 15:59:53 +02:00
Marko Baricevic
e5084a4787 Merge branch 'master' into marko/v0.32.1 2019-07-12 15:51:14 +02:00
Thane Thomson
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
Marko Baricevic
0787b79347 add link bump abci Version 2019-07-12 11:17:20 +02:00
Marko
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
Andy Nogueira
378a0e51bf docs: replace priv_validator.json with priv_validator_key.json (#3786) 2019-07-11 23:31:42 +04:00
Marko Baricevic
e8926867d8 wording change 2019-07-11 21:22:14 +02:00
Marko Baricevic
0f076e5fbe add links to changelog 2019-07-11 18:37:46 +02:00
Marko Baricevic
ac232caef3 Release branch for v0.32.1
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-07-11 18:34:21 +02:00
Marko
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
Anton Kaliaev
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
Ashley Vega
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
Marko
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
Alessio Treglia
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
Marko
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
Sean Braithwaite
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