Commit Graph

7760 Commits

Author SHA1 Message Date
Tess Rinearson
864ce4be79 tools/build: delete stale tools (#4558) 2020-03-12 10:08:09 +04:00
Marko
4ef506f7ba deps: bump deps that bot cant (#4555)
* deps: bump deps that bot cant

- bumping deps that dependat bot does not do.

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

* run go mod tidy

* fix go.sum
2020-03-11 18:02:41 +01:00
dependabot-preview[bot]
cd5a987f6e build(deps): bump github.com/tendermint/tm-db from 0.4.1 to 0.5.0 (#4554)
Bumps [github.com/tendermint/tm-db](https://github.com/tendermint/tm-db) from 0.4.1 to 0.5.0.
- [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.1...v0.5.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-11 13:29:40 +00:00
dependabot-preview[bot]
8c749dc518 build(deps): bump google.golang.org/grpc from 1.27.1 to 1.28.0 (#4551)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.27.1 to 1.28.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.27.1...v1.28.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-11 12:25:37 +00:00
Marko
c534291a56 rc1/v0.33.2(#4541)
* rc1/v0.33.2

- release candiadte for 0.33.2

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

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-03-11 11:57:42 +01:00
Tess Rinearson
31bea92d12 libs/kv: remove unused type KI64Pair (#4542) 2020-03-10 21:34:44 +01:00
dependabot-preview[bot]
cb8a2cc67f build(deps): bump github.com/Workiva/go-datastructures (#4545)
Bumps [github.com/Workiva/go-datastructures](https://github.com/Workiva/go-datastructures) from 1.0.51 to 1.0.52.
- [Release notes](https://github.com/Workiva/go-datastructures/releases)
- [Commits](https://github.com/Workiva/go-datastructures/compare/v1.0.51...v1.0.52)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-10 15:29:31 +00:00
Tess Rinearson
73c19bd6ac CONTRIBUTING: include instructions for installing protobuf v0.33.1-dev3 2020-03-09 17:52:08 +00:00
Marko
f17717f3a3 adr: crypto encoding for proto (#4481)
* adr: crypto encoding for proto work

- this adr is meant to help with deciding on how to move forward with keys in tendermint.

* minor change

* fix gomod

* add a third option

* fix spelling

* add first part of descision

* breakdown keys and where they are used

* add some wording

* minor wording fix

* question

* change proto messages

* minor update

* undo go.mod changes

* add a few things based on comemnts

* push, push it real good

* minor explanation on interface type

* touch up
2020-03-09 08:44:37 +00:00
Callum Waters
b6f0aa3a88 lite2: replace primary when providing invalid header (#4523)
Closes: #4420 

Created a new error ErrInvalidHeaderwhich can be formed during the verification process verifier.go and will result in the replacement of the primary provider with a witness by executing: replacePrimaryProvider()

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-03-06 23:05:20 +04:00
Anton Kaliaev
bc89aad162 rpc: create buffered subscriptions on /subscribe (#4521)
Closes #3935
2020-03-06 17:23:44 +04:00
Anton Kaliaev
d3f965ba68 lite2: indicate success/failure of Update (#4536)
error itself is not enough since it only signals if there were any
errors. Either (types.SignedHeader) or (success bool) is needed to
indicate the status of the operation. Returning a header is optimal
since most of the clients will want to get a newly verified header
anyway.
2020-03-06 17:10:28 +04:00
Anton Kaliaev
431618cef6 lite2: remove auto update (#4535)
We first introduced auto-update as a separate struct AutoClient, which
was wrapping Client and calling Update periodically.

// AutoClient can auto update itself by fetching headers every N seconds.
type AutoClient struct {
    base         *Client
    updatePeriod time.Duration
    quit         chan struct{}

    trustedHeaders chan *types.SignedHeader
    errs           chan error
}

// NewAutoClient creates a new client and starts a polling goroutine.
func NewAutoClient(base *Client, updatePeriod time.Duration) *AutoClient {
    c := &AutoClient{
        base:           base,
        updatePeriod:   updatePeriod,
        quit:           make(chan struct{}),
        trustedHeaders: make(chan *types.SignedHeader),
        errs:           make(chan error),
    }
    go c.autoUpdate()
    return c
}

// TrustedHeaders returns a channel onto which new trusted headers are posted.
func (c *AutoClient) TrustedHeaders() <-chan *types.SignedHeader {
    return c.trustedHeaders
}

// Err returns a channel onto which errors are posted.
func (c *AutoClient) Errs() <-chan error {
    return c.errs
}

// Stop stops the client.
func (c *AutoClient) Stop() {
    close(c.quit)
}

func (c *AutoClient) autoUpdate() {
    ticker := time.NewTicker(c.updatePeriod)
    defer ticker.Stop()

    for {
        select {
        case <-ticker.C:
            lastTrustedHeight, err := c.base.LastTrustedHeight()
            if err != nil {
                c.errs <- err
                continue
            }

            if lastTrustedHeight == -1 {
                // no headers yet => wait
                continue
            }

            newTrustedHeader, err := c.base.Update(time.Now())
            if err != nil {
                c.errs <- err
                continue
            }

            if newTrustedHeader != nil {
                 c.trustedHeaders <- newTrustedHeader
            }
        case <-c.quit:
            return
        }
    }
}

Later we merged it into the Client itself with the assumption that most clients will want it.

But now I am not sure. Neither IBC nor cosmos/relayer are using it. It increases complexity (Start/Stop methods).

That said, I think it makes sense to remove it until we see a need for it (until we better understand usage behavior). We can always introduce it later 😅. Maybe in the form of AutoClient.
2020-03-06 13:33:07 +04:00
mergify[bot]
7d001177e3 readme: add discord to readme (#4533)
* readme: add discord to readme

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

* add our id
2020-03-05 13:25:18 +00:00
mergify[bot]
3a695d4b6f docs: fix links (#4531)
* docs: fix links

- fix broken links

closes #4522

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

* fix more links

* add enable and disable

* remvoe deadlink
2020-03-05 10:48:29 +00:00
mergify[bot]
632b53d653 fix addrbook tests (#4526)
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Erik Grinaker <erik@grinaker.org>
2020-03-05 09:29:26 +00:00
mergify[bot]
4c8e3c8145 fix: proto-breakage (#4506)
* fix: fix proto-breakage

- this is amed to fix proto breakage for consumers

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

* fix for importing third_party everywhere

* undo change

* test breakage change

* test ssh

* test https

* change ssh to https

* fix phony
2020-03-05 08:41:36 +00:00
Anton Kaliaev
4936b23dae adr-047: evidence handling (#4429)
Closes #4213 and #4182
2020-03-05 11:28:32 +04:00
Tess Rinearson
9e5b4afbf1 .github: add markdown link checker (#4513)
co-authored-by: Marko <marbar3778@yahoo.com>
2020-03-04 15:48:17 +01:00
dependabot-preview[bot]
61380ffa3f build(deps): bump github.com/prometheus/client_golang (#4525)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.4.1...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-04 11:58:45 +00:00
Anton Kaliaev
891afc2235 cmd: fix debug kill and change debug dump archive filename format (#4517)
* cmd: change archive filename format

before: Mar  3 08:44:43.zip
after: 2020-03-03T08:44:43Z.zip

Refs #4515

* cmd: kill pid, not the debug process itself

Fixes #4515

* update changelog

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-03 12:41:58 +00:00
Callum Waters
ff786515b8 lite: add helper functions for initiating the light client (#4486)
* add new net client

* hijack example test

* lint fixes

* reorganised file structure

* renamed funcs and added documentation

* implemented suggested changes

* restored example tests

* edited comments

* Update lite2/setup.go

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

* Update lite2/client.go

* lite cmds use HTTP client

* better naming

* Delete go.sum

* Delete go.mod

* restore go mod

* restore go.sum

* fix double import

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-03 12:00:06 +00:00
dependabot-preview[bot]
c518a062a7 deps: bump github.com/Workiva/go-datastructures (#4519)
Bumps [github.com/Workiva/go-datastructures](https://github.com/Workiva/go-datastructures) from 1.0.50 to 1.0.51.
- [Release notes](https://github.com/Workiva/go-datastructures/releases)
- [Commits](https://github.com/Workiva/go-datastructures/compare/v1.0.50...v1.0.51)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-03 15:52:36 +04:00
Anton Kaliaev
a60d032b07 docs: write about debug kill and dump (#4516)
* docs: write about debug kill and dump

Closes #4325

* wrap file tree in code blocks
2020-03-03 08:37:29 +00:00
Anton Kaliaev
3b2e1f22e4 cmd: show useful error when tm not initialised (#4512)
Closes #4303

Before:

```
TMHOME="/Users/daniel/go/src/github.com/tendermint/thome" tendermint node --proxy_app=unix:///Users/daniel/go/src/github.com/kvstore/example.sock

ERROR: 1 error(s) decoding:

* error decoding 'consensus.create_empty_blocks_interval': time: invalid duration
```

After:

```
$ TMHOME=/tmp ./build/tendermint node --proxy_app=kvstore
ERROR: failed to create node: Couldn't read GenesisDoc file: open /tmp/config/genesis.json: no such file or directory
```
2020-03-02 15:59:38 +00:00
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