Commit Graph

7542 Commits

Author SHA1 Message Date
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
Phil Salant
bc572217c0 Fix linter errors thrown by lll (#3970)
* Fix long line errors in abci, crypto, and libs packages

* Fix long lines in p2p and rpc packages

* Fix long lines in abci, state, and tools packages

* Fix long lines in behaviour and blockchain packages

* Fix long lines in cmd and config packages

* Begin fixing long lines in consensus package

* Finish fixing long lines in consensus package

* Add lll exclusion for lines containing URLs

* Fix long lines in crypto package

* Fix long lines in evidence package

* Fix long lines in mempool and node packages

* Fix long lines in libs package

* Fix long lines in lite package

* Fix new long line in node package

* Fix long lines in p2p package

* Ignore gocritic warning

* Fix long lines in privval package

* Fix long lines in rpc package

* Fix long lines in scripts package

* Fix long lines in state package

* Fix long lines in tools package

* Fix long lines in types package

* Enable lll linter
2019-10-17 10:42:28 +02:00
Erik Grinaker
8ba159834f Added test case for Header.Hash() (#4052)
* Added static Header.Hash() test case

* Added reflect test for Header.Hash()

* Check for zero values in test struct
2019-10-16 19:15:07 +02:00
Marko
32bafcb38c Add unsafe routes to swagger (#4062)
* Add unsafe routes to swagger

- added `/dial_peers` & `dial_seeds` to swagger docs under unsafe tag

closes #4047

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

* address comments

* Apply suggestions from code review

* fix swagger
2019-10-16 17:47:25 +02:00
Denis Fadeev
b1a920c8c2 animated sidebar and nested directories (#4063) 2019-10-16 17:26:06 +02:00
Erik Grinaker
ea3dc6d742 Include peer ID when logging rejected txns (#4057)
* Include sender when logging rejected txns

* Log as peerID to be consistent with other log messages

* Updated CHANGELOG_PENDING

* Handle nil source

* Updated PR link in CHANGELOG_PENDING

* Renamed TxInfo.SenderAddress and peerAddress til PeerFullID

* Renamed PeerFullID to PeerP2PID

* Forgot to rename a couple of references
2019-10-16 10:40:45 +02:00
Marko
f58741be62 testing ci (#4061)
* testing ci

* remove version
2019-10-15 12:18:39 +02:00
dependabot-preview[bot]
892bc4281d build(deps): bump github.com/gogo/protobuf from 1.3.0 to 1.3.1 (#4055)
Bumps [github.com/gogo/protobuf](https://github.com/gogo/protobuf) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/gogo/protobuf/releases)
- [Commits](https://github.com/gogo/protobuf/compare/v1.3.0...v1.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 22:59:54 +02:00
Sean Braithwaite
67cdd008cd Blockchain v2 processor (#4012)
* Add processor prototype

* Change processor API

    + expose a simple `handle` function which mutates internal state

* processor tests

* fix gofmt and ohter golangci issues

* scopelint var on range scope

* add check for short block received

* fix formatting

* small test reorg

* ignore unused for now

* ci fix changes

* go.mod revert
2019-10-14 19:06:11 +02:00
Marko
7edc0601d5 New lint version upgrade (#4056)
* New lint version upgrade

- linter was upgraded

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

* enable-a;; is deprecated

* minor change

* another try

* some more changes

* some more changes

* reenable prealloc

* add version till bot is fixed
2019-10-14 17:40:15 +02:00
Denis Fadeev
aaa060fda4 Docs theme (#4042)
* docs theme

* vuepress-theme-cosmos

* version bump

* changes to docs

* more code changes

* sidebar order fix

* moar changes

* fixed dev sessions title

* fixed dev sessions title, again

* specs should show up in sidebar

* contents cards

* version bump

* sidebar, rpc

* version bump

* custom footer and super naive search

* version

* minor change to vuepress

* move swagger file

* pre and post scripts

* build

* changed docs build process

* added deployment config

* updated versions file and added deployment filters
2019-10-11 18:07:58 +02:00
Marko
3e5fa20f4c docs: add ABCI Overview (2/2) dev session (#4044)
*  add upcoming dev session

* add link
2019-10-10 14:40:44 -05:00
Anton Kaliaev
f2b7cecb79 Merge pull request #4050 from tendermint/anton/v0326-and-v03110
merge v0.32.6 and v0.31.10 back to master
2019-10-10 12:31:41 -05:00