https://github.com/tendermint/tendermint

sort by:
Revision Author Date Message Commit Date
ab08354 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 12 June 2019, 12:03:45 UTC
8b7ca8f 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 09 June 2019, 12:27:48 UTC
ed896f5 Merge pull request #3720 from Yawning/boltdb-fixes Fix fundemental BoltDB backend correctness issues. 07 June 2019, 08:43:32 UTC
319ecb3 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). 07 June 2019, 08:26:58 UTC
f46ed4a 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. 07 June 2019, 08:26:20 UTC
6a7d418 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> 06 June 2019, 20:33:39 UTC
c1f2648 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 05 June 2019, 15:39:28 UTC
a7e8fbf 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 05 June 2019, 09:23:53 UTC
c9ef824 p2p: Per channel metrics (#3666) (#3677) * Add `chID` label to sent/receive byte mtrics * add changelog pending entry 05 June 2019, 09:22:00 UTC
2a23eca docs: update /block_results RPC docs (#3708) Fixes #3616 05 June 2019, 01:36:16 UTC
c69ec87 Merge pull request #3715 from tendermint/v0.31 V0.31 04 June 2019, 03:15:23 UTC
8fb2c2a Merge pull request #3712 from tendermint/release/v0.31.7 Release/v0.31.7 04 June 2019, 03:14:37 UTC
96e132b libs/db: remove deprecated `LevelDBBackend` const (#3632) 04 June 2019, 03:12:43 UTC
99c9a35 docs: update RPC docs for /subscribe & /unsubscribe (#3705) Fixes #3678 Co-Authored-By: Ethan Buchman <ethan@coinculture.info> 04 June 2019, 01:05:22 UTC
65a3dfe changelog and version (#3709) 03 June 2019, 15:34:21 UTC
048ac8d 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 03 June 2019, 12:46:02 UTC
21bfd7f Add check for version/version.go TMCoreSemVer (#3704) 03 June 2019, 12:41:27 UTC
77e711f Merge pull request #3695 from tendermint/release/v0.31.6 Release/v0.31.6 30 May 2019, 23:15:48 UTC
0dd6b92 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. 30 May 2019, 22:40:17 UTC
9dcee69 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 30 May 2019, 22:25:21 UTC
b522ad0 docs: fix minor typo (#3681) 29 May 2019, 08:32:34 UTC
b9508ff [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 27 May 2019, 19:44:56 UTC
a6ac611 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 27 May 2019, 19:33:41 UTC
e7bf258 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 27 May 2019, 18:45:27 UTC
bcf10d5 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 27 May 2019, 18:39:58 UTC
5997e75 fix integration script (#3667) 23 May 2019, 16:56:57 UTC
97ceeed Merge pull request #3670 from yutianwu/fix_proxy [R4R] Fix missing context parameter in proxy 23 May 2019, 08:09:52 UTC
3ef9e45 update change log 23 May 2019, 06:26:11 UTC
c7b324d Merge pull request #3675 from alexanderbez/bez/3672-improve-AddSignatureFromPubKey-error Improve error message returned from AddSignatureFromPubKey 23 May 2019, 05:45:05 UTC
cfd42be Improve error and tests 23 May 2019, 00:02:00 UTC
f1f243d 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> 21 May 2019, 21:05:56 UTC
fcce9ed fix lint 21 May 2019, 06:23:50 UTC
c21b4fc fix bug of proxy 21 May 2019, 06:12:40 UTC
86cf8ee 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 10 May 2019, 17:45:50 UTC
6f1ccb6 [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 10 May 2019, 17:37:21 UTC
a076b48 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 07 May 2019, 10:06:20 UTC
a7358bc 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 07 May 2019, 08:33:47 UTC
27909e5 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 07 May 2019, 08:25:35 UTC
1e07381 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 07 May 2019, 07:09:06 UTC
2bb1a87 Merge pull request #3629 from leoluk/fix-boltdb-batch libs/db: fix boltdb batching 07 May 2019, 07:03:49 UTC
d0d9ef1 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 06 May 2019, 20:10:39 UTC
60b8334 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. 06 May 2019, 17:37:41 UTC
debf8f7 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 06 May 2019, 09:42:21 UTC
4519ef3 adr renames (#3622) 05 May 2019, 16:42:26 UTC
86f2765 Add adr-36 (#3324) 05 May 2019, 16:19:41 UTC
e2f5471 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 05 May 2019, 16:19:19 UTC
4905640 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 05 May 2019, 16:01:35 UTC
4c60ab8 Update apps.md (#3621) 05 May 2019, 14:23:41 UTC
5051a1f 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 04 May 2019, 06:41:31 UTC
8711af6 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. 03 May 2019, 13:21:56 UTC
9926ae7 abci/types: update comment (#3612) Fixes #3607 02 May 2019, 07:53:33 UTC
5df6cf5 p2p: session should terminate on nonce wrapping (#3531) (#3609) Refs #3531 02 May 2019, 06:09:56 UTC
2c26d95 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 d47094550315c094512a242445e0dde24b5a03f5) * 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 01 May 2019, 21:15:53 UTC
a2a68df cli: add option to not clear address book with unsafe reset (#3606) Fixes #3585 01 May 2019, 06:01:41 UTC
4334802 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> 01 May 2019, 05:38:26 UTC
40dbad9 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. 30 April 2019, 06:17:57 UTC
2585187 Merge pull request #3597 from tendermint/bucky/merge-master Bucky/merge master 26 April 2019, 23:14:54 UTC
d76952c Merge branch 'master' into bucky/merge-master 26 April 2019, 21:49:28 UTC
7b162f5 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 26 April 2019, 12:05:39 UTC
70592cc 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 26 April 2019, 10:23:43 UTC
90997ab docs: update contributing.md (#3503) Minor updates to reflect squash merging and how to prepare releases 23 April 2019, 09:34:14 UTC
b738add 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. 23 April 2019, 09:19:16 UTC
968e955 testnet cmd: add config option (#3559) Option to explicitly provide the -config in the testnet command, closing #3160. 23 April 2019, 08:52:46 UTC
ebf815e 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 23 April 2019, 08:22:40 UTC
8db7e74 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. 22 April 2019, 08:04:04 UTC
4253e67 Merge pull request #3571 from tendermint/v0.31 V0.31.5 19 April 2019, 11:46:11 UTC
671c5c9 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 18 April 2019, 15:31:36 UTC
f2aa1bf bandaid for non-deterministic clist test (#3575) * add a deterministic timeout Co-Authored-By: kevlubkcm <36485490+kevlubkcm@users.noreply.github.com> 17 April 2019, 16:14:01 UTC
90465f7 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 17 April 2019, 15:10:12 UTC
621c0e6 docs: fix typo in clist readme (#3574) 17 April 2019, 15:09:17 UTC
c0e8fb5 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 17 April 2019, 12:44:26 UTC
d2eab53 Merge pull request #3568 from tendermint/anton/release-v0.31.5 v0.31.5 changelog and version updates 16 April 2019, 20:51:18 UTC
18bd5b6 Apply suggestions from code review Co-Authored-By: melekes <anton.kalyaev@gmail.com> 16 April 2019, 11:13:30 UTC
4474a5e bump version 16 April 2019, 09:38:54 UTC
3cb7013 update changelog 16 April 2019, 09:38:54 UTC
5b8888b common: CMap: slight optimization in Keys() and Values(). (#3567) 16 April 2019, 08:04:08 UTC
439312b 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. 16 April 2019, 07:54:19 UTC
f1cf101 gitignore: add .vendor-new (#3566) 16 April 2019, 04:49:03 UTC
50b87c3 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 15 April 2019, 14:53:38 UTC
f2119c3 adr: PeerBehaviour updates (#3558) * [adr] Peer behaviour adr updates * [docs] fix Behaved function signature * [adr] typo fix in code example 15 April 2019, 14:38:45 UTC
d35c087 Merge pull request #3563 from tendermint/master Merge master to develop 15 April 2019, 12:16:37 UTC
1c6d9d2 Merge pull request #3553 from tendermint/v0.31 V0.31 15 April 2019, 12:16:00 UTC
4695414 Merge pull request #3548 from tendermint/release/v0.31.4 Release/v0.31.4 12 April 2019, 14:56:03 UTC
def5c8c address review comments: (#3550) - mention ADR in release summary - remove [p2p] api changes - amend v0.31.3 log to contain note about breaking change 12 April 2019, 14:48:34 UTC
b6da888 prepare v0.31.4 release: - prep changelog - add missing changelog entries - fix minor glitch in existing changelog (v0.31.2) - bump versions 12 April 2019, 12:24:51 UTC
a453628 Fix a couple of typos (#3547) Fix some typos in p2p/transport.go 12 April 2019, 11:25:14 UTC
4e42242 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 12 April 2019, 10:32:00 UTC
b5b3b85 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. 12 April 2019, 10:31:02 UTC
18d2c45 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 12 April 2019, 08:46:07 UTC
c3df21f add missing changelog entry (#3544) * add missing changelog entry 11 April 2019, 15:59:14 UTC
bcec8be 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 11 April 2019, 13:32:16 UTC
9a415b0 docs: abci#Commit: better explain the possible deadlock (#3536) 09 April 2019, 16:21:35 UTC
40da355 docs: fix block.Header.Time description (#3529) It's not proposer local time anymore, but a weighted median Fixes #3514 03 April 2019, 12:56:51 UTC
f965a4d 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 03 April 2019, 09:22:52 UTC
75ffa2b Merge pull request #3528 from tendermint/v0.31 Merge v0.31.3 to master 02 April 2019, 23:18:57 UTC
086d6cb Merge pull request #3527 from tendermint/v0.31 Merge V0.31.3 back to develop 02 April 2019, 20:49:44 UTC
6cc3f4d Merge pull request #3525 from tendermint/release/v0.31.3 Release/v0.31.3 02 April 2019, 20:45:04 UTC
3cfd975 changelog and version v0.31.3 02 April 2019, 13:14:33 UTC
882622e 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 01 April 2019, 23:59:57 UTC
1ecf814 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 01 April 2019, 23:45:57 UTC
back to top