Commit Graph

7735 Commits

Author SHA1 Message Date
Anton Kaliaev
51e1b4e42a rpc: remove BlockStoreRPC in favor of BlockStore (#4510)
* rpc: use BlockStoreRPC instead of BlockStore

BlockStoreRPC is a limited version of BlockStore interface, which does
not include SaveBlock method.

Closes #4159

* remove BlockStoreRPC interface in favor of single BlockStore

interface

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-02 13:55:50 +00:00
Anton Kaliaev
67224fd174 docs: tendermint node --help dumps all supported flags (#4511)
Closes #4211
2020-03-02 13:09:54 +00:00
Anton Kaliaev
9bf8f41ac9 lite2: fix tendermint lite sub command (#4505)
* lite2: fix tendermint lite sub command

- better logging
- chainID as an argument
- more examples

* one more log msg

* lite2: fire update right away after start

* turn off auto update in verification tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-02 06:51:36 +00:00
Erik Grinaker
c33576e72a example/kvstore: return ABCI query height (#4509)
* example/kvstore: return ABCI query height

* CHANGELOG: added PR link

* Updated tests
2020-03-01 20:03:28 +00:00
Michael FIG
3f18e22c96 rpc: keep the original subscription "id" field when new RPCs come in (#4493) 2020-02-29 22:22:19 +01:00
Erik Grinaker
c5fe7334dc test: simplified txsearch cancellation test (#4500)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-02-28 13:29:48 +00:00
Erik Grinaker
72488db676 mergify: use strict merges (#4502) 2020-02-28 14:21:50 +01:00
Erik Grinaker
d1f7ef673c mergify: remove unnecessary conditions (#4501) 2020-02-28 13:56:26 +01:00
Marko
6c9e9b2b93 tool: add Mergify (#4490) 2020-02-28 12:29:36 +01:00
Erik Grinaker
6f6843e37a circleci: fix reproducible builds test (#4497) 2020-02-28 12:21:12 +01:00
Marko
6cebba5fd7 swagger: update swagger port (#4498)
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2020-02-28 12:05:55 +01:00
Anton Kaliaev
a122a555de docs: adr-046 add bisection algorithm details (#4496)
* docs: adr-046 add bisection algorithm details

Closes #4329

* format fig. 1 title

* docs: adr-046 we no longer download headers in TrustedHeader

https://github.com/tendermint/tendermint/pull/4496#issuecomment-592446054
2020-02-28 11:53:06 +01:00
Gregory Terzian
c837a57ddd rpc: stop txSearch result processing if context is done (#4418) 2020-02-28 11:38:28 +01:00
dependabot-preview[bot]
b73c0b75d5 build(deps): bump github.com/golang/protobuf from 1.3.3 to 1.3.4 (#4485)
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.3.3 to 1.3.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](https://github.com/golang/protobuf/compare/v1.3.3...v1.3.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-28 10:24:25 +01:00
Shivani Joshi
78144306dd JSON tests related changes (#4461)
* test functions take time.Now and other minor changes

* updated remaining test files

* Update validation_test.go

* fix typo

* go fmt

* import time

Co-authored-by: Marko <marbar3778@yahoo.com>
2020-02-28 09:57:00 +01:00
Anton Kaliaev
3f883bb80a lite2: actually run example tests + clock drift (#4487)
Closes: #4488

## Commits:

* run example tests

* introduce max clock drift

clockDrift variable from the spec.
10s should cover most of the clients.

References:

- http://vancouver-webpages.com/time/web.html
- https://blog.codinghorror.com/keeping-time-on-the-pc/

* fix ExampleClient_Update

* add test

* increase clock drift

* fix linter warning
v0.33.1-dev2
2020-02-27 17:26:28 +01:00
Anton Kaliaev
b5f6bfa4f9 lite2: return height as 2nd return param in TrustedValidatorSet (#4479)
Closes #4473
2020-02-27 16:10:01 +01:00
Callum Waters
6be0e13823 lite2: prune-headers (#4478)
closes #4469

Improved speed of cleanup by using SignedHeaderAfter instead of TrustedHeader to jump from header to header.

Prune() is now called when a new header and validator set are saved and is a function dealt by the database itself

## Commits:

* prune headers and vals

* modified cleanup and tests

* fixes after my own review

* implement Prune func

* make db ops concurrently safe

* use Iterator in SignedHeaderAfter

we should iterate from height+1, not from the end!

* simplify cleanup

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-27 14:57:17 +01:00
Marko
875b106a17 github: edit templates for use in issues and pull requests (#4483)
* github: edit templates for use in issues and pull requests

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

* fix sdk to tendermint
2020-02-27 11:34:56 +01:00
Sean Braithwaite
c45baa0402 blockchain (v2): async testing notes (#4484)
Add some inline notes for context of why test are commented out and not deleted.

Ref. #4482
2020-02-27 11:25:21 +01:00
Anton Kaliaev
b9535a2cfc blockchain (v2): comment out TestReactorTerminationScenarios (#4480)
Refs #4442
2020-02-26 20:47:16 +01:00
dependabot-preview[bot]
b5ce8f2069 deps: bump github.com/tendermint/tm-db from 0.4.0 to 0.4.1 (#4476)
Bumps [github.com/tendermint/tm-db](https://github.com/tendermint/tm-db) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/tendermint/tm-db/releases)
- [Changelog](https://github.com/tendermint/tm-db/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tendermint/tm-db/compare/v0.4.0...v0.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-26 16:51:05 +01:00
Anton Kaliaev
6daea31f50 lite2: remove expiration checks on functions that don't require them (#4477)
closes: #4455

Verifying backwards checks that the trustedHeader hasn't expired both before and after the loop in case of verifying many headers (a longer operation), but not during the loop itself.

TrustedHeader() no longer checks whether the header saved in the store has expired.

Tests have been updated to reflect the changes

## Commits:

* verify headers backwards out of trust period

* removed expiration check in trusted header func

* modified tests to reflect changes

* wrote new tests for backwards verification

* modified TrustedHeader and TrustedValSet functions

* condensed test functions

* condensed test functions further

* fix build error

* update doc

* add comments

* remove unnecessary declaration

* extract latestHeight check into a separate func

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
2020-02-26 16:15:05 +01:00
Callum Waters
9231b52e0d lite2: cross-check first header and update tests (#4471)
closes #4464
2020-02-26 12:56:20 +01:00
Anton Kaliaev
c4f7256766 lite2: store current validator set (#4472)
Before we were storing trustedHeader (height=1) and trustedNextVals
(height=2).

After this change, we will be storing trustedHeader (height=1) and
trustedVals (height=1). This a) simplifies the code b) fixes #4399
inconsistent pairing issue c) gives a relayer access to the current
validator set #4470.

The only downside is more jumps during bisection. If validator set
changes between trustedHeader and the next header (by 2/3 or more), the
light client will be forced to download the next header and check that
2/3+ signed the transition. But we don't expect validator set change too
much and too often, so it's an acceptable compromise.

Closes #4470 and #4399
v0.33.1-dev1
2020-02-26 10:20:51 +01:00
Alessio Treglia
25d92d05f8 types: VerifyCommitX return when +2/3 sigs are verified (#4445)
Closes #4417
2020-02-25 10:04:24 +01:00
Callum Waters
f934ca82fc lite2: don't save intermediate headers (#4452)
closes #4426

The sequence and bisection methods no longer save the intermediate headers and validator sets that they require to verify a currently untrusted header.

## Commits:

* sequence and bisection don't save intermediate headers and vals

* check the next validator hash matches the header

* check expired header at start of backwards verification

* added tests

* handled cleanup warning

* lint fix

* removed redundant code

* tweaked minor errors

* avoided premature trusting of nextVals

* fix test error

* updated trustedHeader and Vals together

* fixed bisection error

* fixed sequence error for different vals and made test

* fixes after my own review

* reorder vars to be consistent

with the rest of the code

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-24 11:10:41 +01:00
Erik Grinaker
fe11219795 Fix unexported returns (#4450) 2020-02-21 19:21:39 +01:00
Erik Grinaker
c63fd32fc2 circleci: run P2P IPv4 and IPv6 tests in parallel (#4459) 2020-02-21 15:23:48 +01:00
Erik Grinaker
8d1198b39a ADR-053: update with implementation plan after prototype (#4427) 2020-02-21 13:28:05 +01:00
Erik Grinaker
b0683b7fc6 p2p: use curve25519.X25519() instead of ScalarMult() (#4449)
* p2p: use curve25519.X25519() instead of ScalarMult()

* Renamed array to shrKeyArray

* Updated CHANGELOG_PENDING

* Revert "Updated CHANGELOG_PENDING"

This reverts commit dbb72e0bf7.
2020-02-21 12:43:59 +01:00
Callum Waters
2c7af01cb6 lite2: return already verified headers and verify earlier headers (#4428)
closes #4413 and #4419

When VerifyHeaderAtHeight() is called, TrustedHeader is initially run to check if the header has already been verified and returns the Header.

If the new header height is less than the lite clients latestTrustedHeader height, than backwards verification is performed else either sequence or bisection

Refactored a test to reflect the changes

* use trustedHeader func for already verified Headers

* remove fetch missing header from TrustedHeader

* check for already trusted Header in VerifyHeaderAtHeight

* replace updateTrustedHeaderAndVals to updateTrustedHeaderAndNextVals

* rename trustedHeader and trustedNextVals

* refactored backwards and included it in VerifyHeader

* cleaned up test to match changes

* lite2: fixes after my own review

Refs https://github.com/tendermint/tendermint/pull/4428#pullrequestreview-361730169

* fix ineffectual assignment

* lite2: check that header exists in VerifyHeader

* extract function

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-20 15:45:11 +01:00
Erik Grinaker
8f48c49543 Fix some golangci-lint warnings (#4448) 2020-02-20 13:43:40 +01:00
dependabot-preview[bot]
8010f3b4df build(deps): bump github.com/spf13/cobra from 0.0.3 to 0.0.6 (#4440)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.3 to 0.0.6.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v0.0.3...v0.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-20 13:31:59 +01:00
dependabot-preview[bot]
d00384f0f5 build(deps): bump github.com/stretchr/testify from 1.5.0 to 1.5.1 (#4441)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.5.0...v1.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-20 13:02:24 +01:00
Erik Grinaker
24c8b351c6 rpc: fix TxSearch test nits (#4446) 2020-02-20 11:34:18 +01:00
dependabot-preview[bot]
7ab81a7fdd deps: bump github.com/stretchr/testify from 1.4.0 to 1.5.0 (#4435)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-19 17:26:23 +01:00
tau3
b7dab3b8ab consensus: reduce log severity for ErrVoteNonDeterministicSignature (#4431)
from error to debug

Closes #3583
2020-02-19 16:21:27 +01:00
Sean Braithwaite
ee993ba8ff blockchain: add v2 reactor (#4361)
The work includes the reactor which ties together all the seperate routines involved in the design of the blockchain v2 refactor. This PR replaces #4067 which got far too large and messy after a failed attempt to rebase.

## Commits:

* Blockchainv 2 reactor:

	+ I cleaner copy of the work done in #4067 which fell too far behind and was a nightmare to rebase.
	+ The work includes the reactor which ties together all the seperate routines involved in the design of the blockchain v2 refactor.

* fixes after merge

* reorder iIO interface methodset

* change iO -> IO

* panic before send nil block

* rename switchToConsensus -> trySwitchToConsensus

* rename tdState -> tmState

* Update blockchain/v2/reactor.go

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

* remove peer when it sends a block unsolicited

* check for not ready in markReceived

* fix error

* fix the pcFinished event

* typo fix

* add documentation for processor fields

* simplify time.Since

* try and make the linter happy

* some doc updates

* fix channel diagram

* Update adr-043-blockchain-riri-org.md

* panic on nil switch

* liting fixes

* account for nil block in bBlockResponseMessage

* panic on duplicate block enqueued by processor

* linting

* goimport reactor_test.go

Co-authored-by: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-19 16:00:14 +01:00
Erik Grinaker
403f43a477 rpc: fix txsearch tests (#4438) 2020-02-19 15:36:15 +01:00
Callum Waters
1874a97170 lite: modified bisection to loop (#4400)
refs #4329

As opposed to using recursion to implement the bisection method of verifying a header, which could have problems with memory allocation (especially for smaller devices), the bisection algorithm now uses a for loop.

* modified bisection to loop

* made lint changes

* made lint changes

* move note to VerifyHeader

since it applies both for sequence and bisection

* test bisection jumps to header signed by 1/3+

 of old validator set

* update labels in debug log calls

* copy tc

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-19 15:18:52 +01:00
Erik Grinaker
b09cdaf1af rpc: fix tx_search pagination with ordered results (#4437) 2020-02-19 14:01:42 +01:00
Marko
c680507bab dep: maunally bump dep (#4436)
replaces #4434

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
2020-02-19 13:11:17 +01:00
Erik Grinaker
68f37fff65 Use uint64 for consensus.Reactor.SwitchToConsensus() blocksSynced (#4433) 2020-02-19 12:28:34 +01:00
Marko
6c67e246c3 dep: bump gokit dep (#4424)
* dep: bump gokitdep: bump gokitdep: bump gokitdep: bump gokitdep: bump gokitdep: bump gokitdep: bump gokitdep: bump gokitdep: bump gokit-

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

* go mod tidy

* test go version change

* combination of multiple cmds

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-18 16:20:02 +01:00
Callum Waters
f5901ea460 lite2: divide verify functions (#4412)
Closes #4398

* divided verify functions

* extacted method

* renamed functions. Created standard Verify function

* checked non-adjacency. separated VerifyCommit

* lint fixes

* fix godoc documentation for VerifyAdjacent and VerifyNonAdjacent

* add a comment about VerifyCommit being the last check

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-02-18 16:10:04 +01:00
Anthony
5ea1ff94d1 rpc: fix issue with multiple subscriptions (#4406)
Using the WebSocket server, when the same client calls multiple time the subscribe method, only the last subscription receives all the events of the previous ones.

example:

    subscription1 = tm.event = 'NewBlock'
    subscription2 = tm.event = 'Tx'

In this case, subscription2 will receive the new blocks but subscription1 will not.

This came from the WebSocket handler that had the declaration of the rpcrequest moved and so overridden for every request and given in the JSONReq client context (so the id of the subscription was not the right one).

This fixes the issue by simply declaring the rpcrequest inside the loop so every request will create a new object without overwriting the previous one.
2020-02-17 08:00:56 +01:00
Denis Fadeev
da8813071b Docs staging (#4407)
* update theme

* Update version

* Updated Questions section in the footer

* Remove links to Riot chat

* Typo

* Add Discord link

Co-authored-by: Marko <marbar3778@yahoo.com>
2020-02-15 21:07:48 +01:00
Anton Kaliaev
c56fd04ab4 lite2: disconnect from bad nodes (#4388)
Closes #4385

* extract TrustOptions into its own file

* print trusted hash before asking whenever to rollback or not

so the user could reset the light client with the trusted header

* do not return an error if rollback is aborted

reason: we trust the old header presumably, so can continue from it.

* add note about time of initial header

* improve logging and add comments

* cross-check newHeader after LC verified it

* check if header is not nil

so we don't crash on the next line

* remove witness if it sends us incorrect header

* require at least one witness

* fix build and tests

* rename tests and assert for specific error

* wrote a test

* fix linter errors

* only check 1/3 if headers diverge
2020-02-14 17:04:56 +01:00
Callum Waters
58620af5e0 lite2: modified sequence method to match bisection (#4403)
Currently the sequence function always starts from the trustedHeader and trustedNextVals stored in the lite client. Whereas the bisection one allows the method to be started from any combination of header and validator set. I opened up the sequence verification method to do the same
2020-02-14 14:52:50 +01:00