Commit Graph

7604 Commits

Author SHA1 Message Date
b-harvest
acac525e49 adr#50: improve trusted peering (#4072)
Refs #4053

## Commits:

* Create adr-050-improved-trusted-peering.md

* Modify `maximum_dial_period`

Modify `maximum_dial_period` to `persistent_peers_maximum_dial_period`

* Update adr-050-improved-trusted-peering.md

* Update docs/architecture/adr-050-improved-trusted-peering.md

Co-Authored-By: Tess Rinearson <tess.rinearson@gmail.com>

* Update docs/architecture/adr-050-improved-trusted-peering.md

Co-Authored-By: Tess Rinearson <tess.rinearson@gmail.com>

* Update docs/architecture/adr-050-improved-trusted-peering.md

Co-Authored-By: Tess Rinearson <tess.rinearson@gmail.com>

* Update docs/architecture/adr-050-improved-trusted-peering.md

Co-Authored-By: Tess Rinearson <tess.rinearson@gmail.com>

* wildcard -> unconditional

wildcard -> unconditional

* Remove blank lines

* fix spelling

* add quotes
2019-11-20 13:12:10 +04:00
Marko
97222eb90f CHANGELOG: update release/v0.32.8 details (#4162)
- update master with changelog from v0.32.8
- bump `tm-version` in `version.go`

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-11-19 16:28:19 +01:00
Marko
aca94fd9a0 Remvoe errors package from libs (#4157)
*libs/common/errors: remove package

- remove errors file from cmn pkg

- use errorf instead of wrap in async function

- add changelog entry

- closes #3862
2019-11-19 12:47:22 +01:00
Aditya
8a878c1cad evidence: enforce ordering in DuplicateVoteEvidence (#4151)
Fixes #4143
2019-11-19 10:54:54 +04:00
Eric Mugo
45c24ff8ea docs: replace dead original whitepaper link (#4155)
Co-Authored-By: Marko <marbar3778@yahoo.com>
2019-11-18 14:13:32 +01:00
Anton Kaliaev
3e1516b624 linters: enable stylecheck (#4153)
Refs #3262
2019-11-16 19:35:39 +04:00
Cyrus Goh
36ba1a8494 docs: add GA for docs.tendermint.com (#4149) 2019-11-16 17:04:10 +04:00
Marko
e71a2b161b Docs theme latest (#4145)
* fix logo in footer

* readme and version

* fix logo in footer

* rpc link
2019-11-15 12:14:36 +01:00
Anton Kaliaev
44a3fbf109 rpc/lib/client & server: try to conform to JSON-RPC 2.0 spec (#4141)
https://www.jsonrpc.org/specification

What is done in this PR:

    JSONRPCClient: validate that Response.ID matches Request.ID I wanted
    to do the same for the WSClient, but since we're sending events as
    responses, not notifications, checking IDs would require storing
    them in memory indefinitely (and we won't be able to remove them
    upon client unsubscribing because ID is different then).

    Request.ID is now optional. Notification is a Request without an ID.
    Previously "" or 0 were considered as notifications

    Remove #event suffix from ID from an event response (partially fixes
    #2949) ID must be either string, int or null AND must be equal to
    request's ID. Now, because we've implemented events as responses, WS
    clients are tripping when they see Response.ID("0#event") !=
    Request.ID("0"). Implementing events as requests would require a lot
    of time (~ 2 days to completely rewrite WS client and server)

    generate unique ID for each request

    switch to integer IDs instead of "json-client-XYZ"
    id=0 method=/subscribe
    id=0 result=...
    id=1 method=/abci_query
    id=1 result=...

> send events (resulting from /subscribe) as requests+notifications (not
responses)

this will require a lot of work. probably not worth it

* rpc: generate an unique ID for each request
in conformance with JSON-RPC spec

* WSClient: check for unsolicited responses

* fix golangci warnings

* save commit

* fix errors

* remove ID from responses from subscribe
Refs #2949

* clients are safe for concurrent access

* tm-bench: switch to int ID

* fixes after my own review

* comment out sentIDs in WSClient
see commit body for the reason

* remove body.Close
it will be closed automatically

* stop ws connection outside of write/read routines
also, use t.Rate in tm-bench indexer when calculating ID

fix gocritic issues

* update swagger.yaml

* Apply suggestions from code review

* fix stylecheck and golint linter warnings

* update changelog

* update changelog2
2019-11-15 14:16:04 +04:00
Marko
1ddc43d029 rpc: add pagination to /validators (#3993)
* Add pagination to /validators

- closes #3472

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

* add swagger params, default returns all

* address pr comments

* golint fix

* swagger default change, change to default in comment

* swagger.yaml: replace x-example with example

https://swagger.io/docs/specification/adding-examples/

* Revert "swagger.yaml: replace x-example with example"

This reverts commit 9df1b006de.

* update changelog and remove extra body close
2019-11-15 09:38:43 +04:00
Marko
b43da17958 rpc/swagger: add numtxs to blockmeta (#4139)
Closes #4138

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-11-14 19:52:53 +04:00
Marko
41403d5261 rpc: remove duplication of data in ResultBlock (#3856)
## Issue:

    Removed BlockMeta in ResultBlock in favor of BlockId for /block
    Added block_size to BlockMeta this is reflected in /blockchain

fixes #3188

added breaking as some clients may be using header from blockmeta instead of block in /block

## Commits:

* cleanup block path

Remove duplication of data in `/block`

fixes #3188

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

* Remove duplication of data in `/block`

- Created a secondary type to be used for /block

fixes #3188

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

* remove commented out code

* fix ci

* add changelog_pending entry

* remove extra variable

* update swagger

* change int to uint for blocksize

* fix swagger

* remove extensive comments

* update changelog

* fix conflicts after merge

* use int for BlockSize and NumTxs in BlockMeta

- with 99.9% guarantee, the size of either will never reach int32
- most of the Go "Size" stdlib functions return int
2019-11-14 14:46:44 +04:00
Marko
1604047c39 abci: remove TotalTxs and NumTxs from Header (#3783)
* Removal of TotalTx & NumTx

- Removed totalTx and numTx

closes #2521

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

* abci proto changes

* proto number fix

* txfilter_test fix

* comments on PR

* further changes

* bring back metrics

* fix indexer

* fix TestBlockMaxDataBytes and TestBlockMaxDataBytesUnknownEvidence

* indexer service back to header

* statistics.go fix

* fix ci

* listen for blocks, not headers

to be able to record txs throughput

* fix TestNetworkNewBlock

* fix tests

* fix tests in types package

* fixes after Anton's review

* fix tests

* bring back `consensus_total_txs` metric

I mistakenly thought it was removed.

* improve changelog

* remove LastBlockTotalTx from state

* docs: remove getNumTxs from BeginBlock Java example
2019-11-14 13:56:12 +04:00
Zaki Manian
9174fb7892 p2p: make SecretConnection non-malleable (#3668)
## Issue:

This is an approach to fixing secret connection that is more noise-ish than actually noise.

but it essentially fixes the problem that #3315 is trying to solve by making the secret connection handshake non-malleable. It's easy to understand and I think will be acceptable to @jaekwon

.. the formal reasoning is basically, if the "view" of the transcript between diverges between the sender and the receiver at any point in the protocol, the handshake would terminate.

The base protocol of Station to Station mistakenly assumes that if the sender and receiver arrive at shared secret they have the same view. This is only true for a DH on prime order groups.

This robustly solves the problem by having each cryptographic operation commit to operators view of the protocol.

Another nice thing about a transcript is it provides the basis for "secure" (barring cryptographic breakages, horrible design flaws, or implementation bugs) downgrades, where a backwards compatible handshake can be used to offer newer protocol features/extensions, peers agree to the common subset of what they support, and both sides have to agree on what the other offered for the transcript MAC to verify.

With something like Protos/Amino you already get "extensions" for free (TLS uses a simple TLV format https://tools.ietf.org/html/rfc8446#section-4.2 for extensions not too far off from Protos/Amino), so as long as you cryptographically commit to what they contain in the transcript, it should be possible to extend the protocol in a backwards-compatible manner.

## Commits:

* Minimal changes to remove malleability of secret connection removes the need to check for lower order points.

Breaks compatibility. Secret connections that have no been updated will fail

* Remove the redundant blacklist

* remove remainders of blacklist in tests to make the code compile again

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

* Apply suggestions from code review

Apply Ismail's error handling

Co-Authored-By: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* fix error check for io.ReadFull

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

* Update p2p/conn/secret_connection.go

Co-Authored-By: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* Update p2p/conn/secret_connection.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* update changelog and format the code

* move hkdfInit closer to where it's used
2019-11-14 13:45:17 +04:00
Anton Kaliaev
59da313bc0 rpc: /block_results fix docs + write test + restructure response (#3615)
BREAKING

Example response:

```json
{
  "jsonrpc": "2.0",
  "id": "",
  "result": {
    "height": "2109",
    "txs_results": null,
    "begin_block_events": null,
    "end_block_events": null,
    "validator_updates": null,
    "consensus_param_updates": null
  }
}
```

Old result consisted of ABCIResponses struct and height. Exposing
internal ABCI structures (which we store in state package) in RPC seems
bad to me for the following reasons:

1) high risk of breaking the API when somebody changes internal structs
(HAPPENED HERE!)
2) RPC is aware of ABCI, which I'm not sure we want
2019-11-14 13:34:35 +04:00
Marko
7bc5e1aa00 state/store: remove extra if statement (#3774)
closes #3543

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-11-14 08:58:43 +04:00
yk
2be4b0fe05 rpc/lib: fix RPC client, which was previously resolving https protocol to http (#4131)
Fixes #4051 

Function `parseRemoteAddr` is forcing protocol HTTP and protocol HTTPs to tcp. This causes the bug in the issue #4051.

I find that the tcp is only needed where `net.Dial`. So I moved the switch to makeHTTPDialer.
2019-11-13 18:26:29 +04:00
Austin Abell
7cd55a7733 crypto/amino: add function to modify key codec (#4112)
## Issue:

Hey, not sure if this is disallowed for any reason specifically, but it would be very beneficial to define additional types to decode tendermint key implementations from bytes, since it uses a static codec. If this is okay, let me know and I will add documentation.

Context: For Ethermint to switch to using Cosmos' keybase, decoding the keys requires this codec to be updated

Just to document, I did experiment with creating a mapping from string to objects to be able to keep track of the key types added to be able to be used in the RegisterAmino(..) call, but because of how go is compiled, cosmos would just use the base types. This may be a useful feature for someone just building on top of Tendermint and not going through Cosmos, but to not add confusion or unnecessary complexity, I left it out.

## Commits:

* Exposes amino codec to be able to decode pk bytes in application

* Change how codec is modified

* Remove unneeded comment

* Fix comment

* Fix comment

* Add registered type to nametable

* Add pending changelog entry

* Reorder change

* Added check if type is registered and added test

* Make test type private

* Remove unnecessary duplicate exists check
2019-11-13 08:55:22 +04:00
Denis Fadeev
79500277ae Docs theme latest (#4132)
* fix logo in footer

* readme and version

* fix logo in footer
2019-11-12 23:07:00 +01:00
Mircea Colonescu
0c6ad4f714 added staging build step to docs deployment (#4129) 2019-11-11 15:43:11 +01:00
Anton Kaliaev
1fc4ab7234 rpc: remove godoc comments in favor of swagger docs (#4126)
No need to duplicate information in this case. It a) requires extra
efforts to keep both in sync b) nobody reads godoc documentation
anyways.
2019-11-11 17:33:02 +04:00
dependabot-preview[bot]
2c81f68bb1 deps: bump google.golang.org/grpc from 1.25.0 to 1.25.1 (#4127)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.25.0 to 1.25.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.25.0...v1.25.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-11 17:13:36 +04:00
Albert
6a4608230c docs: fix build instructions (#4123) 2019-11-10 08:41:28 +04:00
Marko
cf4360c673 Bump grpc dep (#4121)
- bump grpc dep as listed here: https://github.com/tendermint/tendermint/pull/4114

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-11-08 13:58:30 +00:00
Mircea Colonescu
263b2d28bd added newline to versions file and removed index.html (#4120) 2019-11-07 17:04:15 +00:00
Mircea Colonescu
40f702a70d remove source code cache restore (#4119) 2019-11-07 16:46:17 +00:00
Mircea Colonescu
8b784929d1 remove source code cache restore (#4118) 2019-11-07 15:52:49 +00:00
cosmostuba
4b15b96588 privval: add SignerDialerEndpointRetryWaitInterval option (#4115)
Added a small function to be able to change the default retry interval for the privval. The default is 100ms, this function allows to change to any time.Duration.

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
2019-11-07 17:40:00 +04:00
Henrik Aasted Sørensen
98c595312a libs/pubsub/query: add EXISTS operator (#4077)
## Issue:

This PR adds an "EXISTS" condition to the event query grammar. It enables querying for the occurrence of an event without having to provide a condition for one of its attributes.

As an example, someone interested in all slashing events might currently catch them with a query such as slash.power > 0.

With this PR the event can be captured with slash.power EXISTS or just slash EXISTS to catch by event type.

## Examples:

`slash EXISTS`

## Commits:

* Add EXISTS condition to query grammar

* Gofmt files

* Move PEG instructions out of auto-generated file to prevent overwrite

* Update libs/pubsub/query/query.go

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

* Update changelog and add test case

* Merge with other changes in PR #4070

* Add EXISTS to Conditions() func

* Apply gofmt

* Addressing PR comments
2019-11-07 11:30:50 +04:00
Marko
3495a915cc Doc link fixes (#4116)
- closes #4090
- closes #4091

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2019-11-06 15:32:06 +00:00
seungyeon-hwang
274447e2b0 state: txindex/kv: return an error if there's one (#4095)
when the user searches for a tx (hash=X)

This PR fixes error handling for performing a txindex search.

TxIndex.Get returns

    (txresult, nil) if the transaction is found.
    (nil, nil) if the transaction is not found.
    (nil, error) if error is occurred.

Therefore, if res is not nil, I think TxIndex.Search should return (txresult, nil).

Previously, however, this was not a problem because errors.Wrap returns nil if its first argument err is nil.
2019-11-05 12:33:29 +04:00
Albert
0a014e37b7 changelog: fix typo (#4106) 2019-11-05 09:29:15 +04:00
Denis Fadeev
5532e3a862 Latest version of the theme (#4108)
* update version

* remove version from versions file
2019-11-04 19:14:45 -08:00
Dev Ojha
4227556405 typo fix: full nude -> full node (#4107) 2019-11-04 15:05:44 -08:00
Erik Grinaker
745846bd96 mempool: moved TxInfo parameter into Mempool.CheckTx() (#4083)
* mempool: moved TxInfo parameter into Mempool.CheckTx().

* Updated CHANGELOG_PENDING.md

* Added PR issue to CHANGELOG_PENDING

Fixes #3590
2019-11-04 13:50:22 +04:00
zjubfd
76deaa986e state: txindex/kv: fsync data to disk immediately after receiving it (#4104)
## Issue

Why this pr:
When restarting chain node, sometimes we lost tx index about recent(around 80)blocks, and some client complains that they can't find the tx by RPC call(tx_search) when the tx do exist in the block.

I try to partially fix this issue in a simple way by writing the index data in a sync way.
There is no performance difference under 1K TPS according to our test.

It is still possible that lost index data after restarting the node, but only 2 block data will lost at most.
I try to totally fix this in https://github.com/tendermint/tendermint/pull/3847/files, but this one is simple and can solve most part of the issue. Please review first, thks.

## Comments

Anton:

BEFORE:

BenchmarkTxIndex1-2               100000             12434 ns/op
BenchmarkTxIndex500-2                300           5151564 ns/op
BenchmarkTxIndex1000-2               100          15053910 ns/op
BenchmarkTxIndex2000-2               100          18238892 ns/op
BenchmarkTxIndex10000-2               20         124287930 ns/op

AFTER:

BenchmarkTxIndex1-2                 2000            795431 ns/op
BenchmarkTxIndex500-2                200           6385124 ns/op
BenchmarkTxIndex1000-2               100          11388219 ns/op
BenchmarkTxIndex2000-2               100          20514873 ns/op
BenchmarkTxIndex10000-2               20         107456004 ns/op

Performance drop is pretty steep, but I think it's the right thing to do UNTIL we have a WAL.
2019-11-04 12:37:18 +04:00
Vaibhav Sinha
735736e3a6 docs: add assumption to getting started with abci-cli (#4098) 2019-11-03 19:58:18 +04:00
cosmostuba
0335d07ff6 privval: remove misplaced debug statement (#4103)
Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

There's no debug statement in Read func, so should be OK remove this one too.
2019-11-03 19:48:45 +04:00
dependabot-preview[bot]
2df4ca0f39 build(deps): bump github.com/spf13/viper from 1.4.0 to 1.5.0 (#4102)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.4.0...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-01 15:50:11 -07:00
Ethan Buchman
cbd5e031d6 Add more comments about the hard-coded limits (#4100)
* crypto: expose MaxAunts for documentation purposes

* types: update godoc for new maxes

* docs: make hard-coded limits more explicit

* wal: add todo to clarify max size

* shorten lines in test
2019-11-01 15:16:53 -07:00
Mircea Colonescu
b2475227a5 added new version to docs (#4097) 2019-10-31 13:33:15 -07:00
Black3HDF
ad897a8f00 Update README.md (#4094)
db is moved to https://github.com/tendermint/tm-db
2019-10-30 21:54:30 -07:00
Marko
5206ce32a0 Update master (#4087)
* cs: panic only when WAL#WriteSync fails

- modify WAL#Write and WAL#WriteSync to return an error

* fix test

* types: validate Part#Proof

add ValidateBasic to crypto/merkle/SimpleProof

* cs: limit max bit array size and block parts count

* cs: test new limits

* cs: only assert important stuff

* update changelog and bump version to 0.32.7

* fixes after Ethan's review

* align max wal msg and max consensus msg sizes

* fix tests

* fix test

* add change log for 31.11
2019-10-30 12:25:58 -07:00
k1sh0rek0ld
51a83f0826 Update README.md (#4085) 2019-10-28 06:28:18 -07:00
Alexander Bezobchuk
c5bcdd3a22 libs/pubsub: relax tx querying (#4070)
Some linting/cleanup missed from the initial events refactor
Don't panic; instead, return false, error when matching breaks unexpectedly
Strip non-numeric chars from values when attempting to match against query values
Have the server log during send upon error

* cleanup/lint Query#Conditions and do not panic

* cleanup/lint Query#Matches and do not panic

* cleanup/lint matchValue and do not panic

* rever to panic in Query#Conditions

* linting

* strip alpha chars when attempting to match

* add pending log entries

* Update libs/pubsub/query/query.go

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

* build: update variable names

* update matchValue to return an error

* update Query#Matches to return an error

* update TestMatches

* log error in send

* Fix tests

* Fix TestEmptyQueryMatchesAnything

* fix linting

* Update libs/pubsub/query/query.go

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

* Update libs/pubsub/query/query.go

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

* Update libs/pubsub/query/query.go

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

* Update libs/pubsub/query/query.go

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

* Update libs/pubsub/query/query.go

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

* Update libs/pubsub/pubsub.go

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

* add missing errors pkg import

* update Query#Conditions to return an error

* update query pkg unit tests

* update TxIndex#Search

* update pending changelog
2019-10-28 09:37:58 +03:00
Hongmin
2f8ba80689 p2p: log as debug msg when address dialing is already connected (#4082)
Fixes #3991
2019-10-27 08:41:56 -07:00
Sean Braithwaite
6dd1718311 Fix mock reporter interface (#4081)
+ MockReporeter.Report should return an error to adhere to the
    `behaviour.Reporter` interface
2019-10-25 11:08:08 -07:00
Alessio Treglia
65e08a7afd Fix reproducible builds (#4080)
Build with g1.13.3 too.
2019-10-25 07:05:05 -07:00
Albert
f323c80cb3 Fix typo (#4071) 2019-10-21 23:42:22 +02:00
Jazzy
288f1a0bc6 docs: update fork-accountability.md (#4068) 2019-10-19 11:35:53 -05:00