Commit Graph

8001 Commits

Author SHA1 Message Date
Callum Waters
1b50b4e765 lite2: fix pivot height during bisection (#4850) 2020-05-20 06:33:45 +02:00
Marko
1ecc886c44 ci: add paths
## Description

by adding paths the ci job wont run if the files aren't touched. this is a change from before where they would run to see if there were changes

Closes: #XXX
2020-05-19 12:08:10 +00:00
Anton Kaliaev
3fb80e560d p2p: return masked IP (not the actual IP) in addrbook#groupKey
Closes #4846 
Spec https://github.com/tendermint/spec/pull/96
2020-05-19 10:13:00 +00:00
Marko
9149ee7d8b lint: various fixes
## Description

various linitng fixes
2020-05-18 10:20:06 +00:00
dependabot-preview[bot]
d1d33057dc build(deps): Bump github.com/golang/protobuf from 1.4.1 to 1.4.2 (#4849) 2020-05-15 13:19:11 +00:00
Anton Kaliaev
e9897c82e5 rpc/core: do not lock ConsensusState mutex
in /validators, /consensus_params and /status

Closes #3161
2020-05-15 11:30:08 +00:00
Erik Grinaker
476d49c27d docs: move tcp-window.png to imgs/
Possibly fixes #4842. I'm not familiar with the doc generation pipeline, but other images under `imgs/` seem to work so just cargo-culting it.
2020-05-14 15:31:52 +00:00
Callum Waters
c0682a3bed evidence: prevent proposer from proposing duplicate pieces of evidence (#4839)
prevent proposer from proposing duplicate pieces of evidence
2020-05-13 18:46:30 +02:00
Marko
243dfbd585 proto: remove test files
## Description

remove test files for proto stubs

Closes: #XXX
2020-05-13 14:30:33 +00:00
Anton Kaliaev
a14ff5cb30 rpc: refactor lib folder (#4836)
Closes https://github.com/tendermint/tendermint/issues/3857

Moves `lib/` folder to `jsonrpc/`.

Renames:

**packages**

`rpc` package -> `jsonrpc` package
`rpcclient` package -> `client` package
`rpcserver` package -> `server` package

**structs and interfaces**

```
JSONRPCClient to Client
JSONRPCRequestBatch to RequestBatch
JSONRPCCaller to Caller
```

**functions**

```
StartHTTPServer to Serve
StartHTTPAndTLSServer to ServeTLS

rpc/jsonrpc/client: rename NewURIClient to NewURI

NewJSONRPCClient to New
NewJSONRPCClientWithHTTPClient to NewWithHTTPClient
NewWSClient to NewWS
```

**misc**

- unexpose `ResponseWriterWrapper`
- remove unused http_params.go
2020-05-13 16:40:57 +04:00
Anton Kaliaev
e20105e658 mempool: do not launch broadcastTxRoutine if Broadcast is off
Refs #3479
2020-05-13 08:39:28 +00:00
Anton Kaliaev
379b1b85bc rpc: use a struct to wrap all the global objects
Closes #3433
2020-05-13 08:13:17 +00:00
Marko
01e032dc99 libs: remove bech32
## Description

bech32 is only used in the sdk. I moved Bech32 to the sdk and we can remove it here. Don't think this needs to go into a minor release

Closes: #XXX
2020-05-12 18:43:35 +00:00
Anton Kaliaev
84b9bde9cd types: assert specific error in TestValSetUpdateOverflowRelated
Closes #4183
2020-05-12 17:56:02 +00:00
Marko
cf4e056a33 abci: remove python examples
## Description

remove unused and unmaintained python examples of abci

Closes: #XXX
2020-05-12 09:52:04 +00:00
Erik Grinaker
1af80b44fc abci: remove protoreplace script
gogoproto is here to stay.
2020-05-12 09:03:20 +00:00
Anton Kaliaev
b7b721c484 change use of errors.Wrap to fmt.Errorf with %w verb
Closes #4603

Commands used (VIM):

```
:args `rg -l errors.Wrap`
:argdo normal @q | update
```

where q is a macros rewriting the `errors.Wrap` to `fmt.Errorf`.
2020-05-12 03:35:47 +00:00
Marko
8d63d7192f abci: regenerate proto files
## Description

regenerate proto stubs

I do find max_num to be vague. possibly renaming to max_entries or max_evidence_entries may be more descriptive?

Closes: #XXX
2020-05-11 16:54:54 +00:00
Callum Waters
7cb3d90e01 evidence: create proof of lock change and implement it in evidence store (#4746)
creates a proof of lock change which is an array of votes that proves the validator was permitted to change locked block and vote again. This proof is stored in the evidence pool and is used as a part of amnesia evidence
2020-05-11 17:06:01 +02:00
dependabot-preview[bot]
18f178bf3b build(deps): Bump github.com/spf13/viper from 1.6.3 to 1.7.0 (#4814) 2020-05-11 14:23:06 +00:00
Erik Grinaker
d28b47ced7 test: revert Go 1.13→1.14 bump
Since we support 1.13 and above, let's use that as a baseline for tests.
2020-05-11 14:10:31 +00:00
Marko
8dbca7aab3 swagger: remove duplicate blockID
## Description

remove duplicate BlockID in swagger files

Closes: #XXX
2020-05-11 13:59:16 +00:00
Anton Kaliaev
2afae13a48 privval: retry GetPubKey/SignVote/SignProposal N times before
returning an error

Closes #4707
2020-05-11 13:42:19 +00:00
Callum Waters
a620e5fd96 evidence: cap evidence to an absolute number (#4780)
The number of evidence that can be committed in a single block is capped by a new evidence parameter called MaxNum
2020-05-11 15:28:08 +02:00
dependabot-preview[bot]
fed2502618 build(deps): Bump vuepress-theme-cosmos from 1.0.163 to 1.0.164 in /docs (#4815) 2020-05-11 12:55:25 +00:00
Erik Grinaker
960c7402fe test: fix p2p test build breakage caused by Debian testing
Debian testing caused Docker image build failures:

```
The following packages have unmet dependencies:
 
 libc6-dev : Breaks: libgcc-8-dev (< 8.4.0-2~) but 8.3.0-6 is to be installed
 
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
```

It does not appear that we actually need testing, so removing it.
2020-05-11 12:42:11 +00:00
Anton Kaliaev
398000a10d pex: use highwayhash for pex bucket
Closes #2998

Spec PR: https://github.com/tendermint/spec/pull/94
2020-05-08 08:16:29 +00:00
Anton Kaliaev
52784f67d0 mempool: allow ReapX and CheckTx functions to run in parallel
allow ReapX and CheckTx functions to run in parallel, making it not possible to block certain proposers from creating a new block.

Closes: #2972
2020-05-08 04:17:01 +00:00
Erik Grinaker
81c2798df0 abci: fix protobuf lint issues
Fix some linter issues to conform with the Protobuf style guide.

The state sync enum changes are ok to break since it's not released yet. Personally I find the uppercase kind of ugly, but that's what the guide says. Couldn't find a way to generate camel case in Go, short of specifying custom names for each and every enum variant.

Another option would be to simply disable the enum case lint.
2020-05-07 14:40:22 +00:00
Marko
678010c45e fix linters & switch to official linter (#4808) 2020-05-07 16:17:43 +02:00
Callum Waters
9535c47067 consensus: fix and rename TestStateLockPOLRelock (#4796)
correct test in consensus so that node relocks on same block and then changes lock when majority of another block is reached
2020-05-07 12:48:48 +02:00
Erik Grinaker
eb443f4b77 blockchain/v2: integrate with state sync
Integrates the blockchain v2 reactor with state sync, fixes #4765. This mostly involves deferring fast syncing until after state sync completes. I tried a few different approaches, this was the least effort:

* `Reactor.events` is `nil` if no fast sync is in progress, in which case events are not dispatched - most importantly `AddPeer`.

* Accept status messages from unknown peers in the scheduler and register them as ready. On fast sync startup, broadcast status requests to all existing peers.

* When switching from state sync, first send a `bcResetState` message to the processor and scheduler to update their states - most importantly the initial block height.

* When fast sync completes, shut down event loop, scheduler and processor, and set `events` channel to `nil`.
2020-05-07 10:34:01 +00:00
Anton Kaliaev
826a7150b7 types: remove extra validation in VerifyCommit
plus make sure LastCommit is always non-nil
2020-05-07 09:49:51 +00:00
Erik Grinaker
413e554fd0 rpc: handle panics during panic handling
Fixes #4802. The Go HTTP server has a global panic handler for requests, so it was not as severe as first thought.

This fix can still panic, since we try to send a `500` response - if that happens, the Go HTTP server will terminate the connection. Otherwise, the client will get a 200 response, which we should avoid. I'm sort of torn on whether it's even necessary to include this fix, instead of just letting the HTTP server deal with it.
2020-05-07 09:38:50 +00:00
Anton Kaliaev
d202fab478 types: simplify VerifyCommitTrusting
Closes #4783 

It looks like we're validating Commit twice. Also, height and blockID params were coming from the commit, so no need to pass them separately.
2020-05-07 09:24:31 +00:00
Anton Kaliaev
8b2ed8933a consensus: fix TestSimulateValidatorsChange
* consensus: fix TestSimulateValidatorsChange

* fix selfIndex calculation

* exit from goroutine after 1 sec

* reuse the function
2020-05-07 09:14:21 +00:00
Anton Kaliaev
25890a6635 types: sort validators by voting power
thus enabling faster commit verification assuming non uniform distribution of power.

Closes #2478

spec: https://github.com/tendermint/spec/pull/91
2020-05-06 07:37:36 +00:00
Anton Kaliaev
f6435f2c73 consensus: add comment as to why use mocks during replay (#4785)
Closes #4766
2020-05-06 10:32:25 +04:00
Marko
d37b8da013 p2p: return err on signChallenge (#4795)
* remove panic & todo in secret_connection
2020-05-05 17:29:41 +02:00
dependabot-preview[bot]
9f500067d3 build(deps): Bump github.com/golang/protobuf from 1.4.0 to 1.4.1 (#4794) 2020-05-05 12:47:11 +00:00
Callum Waters
47cfadb0aa evidence: refactor evidence mocks throughout packages (#4787)
Predominantly following the discussions regarding the conventions of using mocks, I have decided to revert back to the previous state where mocks were specialized and stored in the separate packages that used them rather then have a generalized mock in the evidence package.

This also was a problem as the state package were running tests too slow and occasionally timing out unnecessarily.

For the replay file I renamed mockEvidencePool to emptyEvidencePool to illustrate that it was intentionally like this and not give the impression that testing software was being used in production

Closes: #4786
2020-05-05 13:11:44 +04:00
Marko
b7c2d7a977 lint: enable nolintlinter, disable on tests
## Description
- enable nolintlint
- disable linting on tests

Closes: #XXX
2020-05-04 07:49:53 +00:00
Anton Kaliaev
336b929eaa types: return an error if voting power overflows
in VerifyCommitTrusting

Closes #4755
2020-05-04 07:35:47 +00:00
Marko
e4427b7292 linting: remove unused variable
## Description

left over variable
2020-04-30 11:39:42 +00:00
Erik Grinaker
663243c446 state: export InitStateVersion
This is useful for custom state sync `StateProvider` implementations that need to build new states for bootstrapping the node. It will also be useful when implementing other mechanisms to bootstrap nodes, e.g. #4642 and #3713.
2020-04-30 11:29:04 +00:00
Marko
ffc73ba03d ci: checkout code before git diff check (#4779) 2020-04-29 21:48:10 +02:00
Callum Waters
d1bd596bce mempool: move mock into mempool directory 2020-04-29 15:55:47 +02:00
Callum
61dbdf4f12 go formatting 2020-04-29 15:26:02 +02:00
Callum
15a9f1760d move mempool mock directory 2020-04-29 15:25:01 +02:00
Marko
1e925acd04 ci: check git diff on each job (#4770) 2020-04-29 14:55:15 +02:00