Commit Graph

66 Commits

Author SHA1 Message Date
Callum Waters d4d2b66067 light: handle too high errors correctly (#6346) 2021-04-13 14:21:00 +02:00
Callum Waters a818f914ab fix deadlock in light tests (#6332) 2021-04-08 19:30:19 +02:00
Callum Waters b272746444 Merge pull request from GHSA-f3w5-v9xx-rp8p
* add time warping lunatic attack test

* create too high and connecton refused errors and add to the light client provider

* add height check to provider

* introduce block lag

* add detection logic for processing forward lunatic attack

* add node-side verification logic

* clean up tests and formatting

* update adr's

* update testing

* fix fetching the latest block

* format

* update changelog

* implement suggestions

* modify ADR's

* format

* clean up node evidence verification
2021-04-08 08:10:03 -07:00
Aleksandr Bezobchuk 003f394512 rpc: index block events to support block event queries (#6226) 2021-03-22 11:47:35 -04:00
Callum Waters fa781e6bb7 e2e: fix light client generator (#6236) 2021-03-15 13:04:33 +01:00
Callum Waters 418e2c140f e2e: integrate light clients (#6196) 2021-03-05 14:24:45 +01:00
Callum Waters 37d36cd5bc light: improve provider handling (#6053)
Introduces heuristics that track the amount of no responses or unavailable blocks a provider has for more robust provider handling by the light client. Use concurrent calls to all witnesses when a new primary is needed.
2021-03-01 12:04:02 +01:00
Anton Kaliaev e9e5026dac rpc/client/http: drop endpoint arg from New and add WSOptions (#6176)
also

- replace `MaxReconnectAttempts`, `ReadWait`, `WriteWait` and `PingPeriod` options with `WSOptions` in `WSClient` (rpc/jsonrpc/client/ws_client.go).
- set default write wait to 10s for `WSClient`(rpc/jsonrpc/client/ws_client.go)
- unexpose `WSEvents`(rpc/client/http.go)

Closes #6162
2021-02-25 06:57:31 +00:00
Callum Waters 29360f955c light: improve timeout functionality (#6145) 2021-02-18 23:49:24 +01:00
Bipul Prasad 90c290ac52 rpc: standardize error codes (#6019) 2021-02-18 17:54:02 +01:00
Callum Waters 162f67cf26 correct spelling to US english (#6077) 2021-02-11 18:59:18 +01:00
Callum Waters ee3f34f4ab light: create provider options struct (#6064) 2021-02-08 18:23:31 +01:00
Callum Waters 1608484de8 remove witnesses in order of decreasing index (#6058) 2021-02-08 12:34:02 +01:00
Callum Waters b9b55db4e5 light: remove max retry attempts from client and add to provider (#6054) 2021-02-05 18:01:34 +01:00
Callum Waters c7b619188d light: fix panic with RPC calls to commit and validator when height is nil (#6026) 2021-02-02 14:01:39 +01:00
Callum Waters 90d3f56797 store: fix deadlock in pruning (#6007) 2021-02-02 11:36:52 +01:00
Anton Kaliaev 1cd9bdb80b light/provider/http: fix Validators (#6022)
Closes #6010
2021-02-01 11:32:37 +00:00
Marko 70bb8cc8b7 proto: seperate native and proto types (#5994)
## Description

Separate protobuf and domain types. We should avoid using protobuf in our core logic. 

ref #5460
2021-01-27 20:14:27 +00:00
Anton Kaliaev d76add65a6 libs/log: format []byte as hexidecimal string (uppercased) (#5960)
Closes: #5806 

Co-authored-by: Lanie Hei <heixx011@umn.edu>
2021-01-25 16:25:29 +04:00
Callum Waters 5cbb8263b4 patch concurrency issue with pruning in the light store (#5910) 2021-01-17 17:14:14 +01:00
Callum Waters ca285844ea light: fix light store deadlock (#5901) 2021-01-14 17:22:09 +01:00
Callum Waters 385ea1db7d store: use db iterators for pruning and range-based queries (#5848) 2021-01-08 13:12:54 +01:00
Callum Waters 9b9222f461 store: order-preserving varint key encoding (#5771) 2021-01-05 16:53:26 +01:00
Callum Waters f368b91caf light: minor fixes / standardising errors (#5716)
## Description

I'm just doing a self audit of the light client. There's a few things I've changed

- Validate trust level in `VerifyNonAdjacent` function
- Make errNoWitnesses public (it's something people running software on top of a light client should be able to parse)
- Remove `ChainID` check of witnesses on start up. We do this already when we compare the first header with witnesses
- Remove `ChainID()` from provider interface

Closes: #4538
2020-12-01 12:53:53 +00:00
Callum Waters 68dc751a8c light: ensure required header fields are present for verification (#5677) 2020-11-19 12:02:58 +01:00
Callum Waters 909da42789 light: make fraction parts uint64, ensuring that it is always positive (#5655) 2020-11-17 14:23:16 +01:00
Callum Waters 3922dde05d evidence: structs can independently form abci evidence (#5610) 2020-11-04 17:14:48 +01:00
Anton Kaliaev 627f7b5989 light: run detector for sequentially validating light client (#5538)
Closes #5445
2020-11-02 12:42:03 +04:00
Anton Kaliaev 8e6194626e light: model-based tests (#5461)
This is the first iteration of model-based testing in Go Tendermint. The test runner is using the static JSON fixtures located under the ./json directory. In the future, the Rust tensgen binary will be used to generate those (given the static intermediate scenarios and the test seed, which will be published along with each testgen release).

Closes: #5322
2020-11-02 12:07:18 +04:00
Anton Kaliaev 7121f68f25 light/rpc: fix ABCIQuery (#5375)
Closes #5106
2020-10-12 16:36:37 +04:00
Anton Kaliaev 12ebd7735a light: cross-check the very first header (#5429)
Closes #5428
2020-10-09 14:29:22 +04:00
Callum Waters a4b7018732 light: expand on errors and docs (#5443) 2020-10-02 20:05:15 +02:00
Callum Waters f02987e7bc simplify commit and validators rpc calls (#5393) 2020-09-25 11:19:04 +02:00
Callum Waters ca8a404c7c cli: light home dir should default to where the full node default is (#5392) 2020-09-25 08:45:56 +02:00
Anton Kaliaev 4b99502d5b config: set time_iota_ms to timeout_commit in test genesis (#5386)
also, document consensus parameters.
https://forum.cosmos.network/t/consensus-timeouts-explained/1421

Closes #4489
2020-09-23 12:24:45 +04:00
Anton Kaliaev 85a4be87a7 rpc/client: take context as first param (#5347)
Closes #5145

also applies to light/client
2020-09-23 09:21:57 +04:00
Callum Waters ed002cea7e evidence: introduction of LightClientAttackEvidence and refactor of evidence lifecycle (#5361)
evidence: modify evidence types (#5342)

light: detect light client attacks (#5344)

evidence: refactor evidence pool (#5345)

abci: application evidence prepared by evidence pool (#5354)
2020-09-22 10:22:54 +02:00
Marko 6ab2a19088 header: check block protocol (#5340)
## Description

Check block protocol version in header validate basic. 

I tried searching for where we check the P2P protocol version but was unable to find it. When we check compatibility with a node we check we both have the same block protocol and are on the same network, but we do not check if we are on the same P2P protocol. It makes sense if there is a handshake change because we would not be able to establish a secure connection, but a p2p protocol version bump may be because of a p2p message change, which would go unnoticed until that message is sent over the wire.  Is this purposeful?

Closes: #4790
2020-09-09 09:13:18 +00:00
Marko 0ed8dba991 lint: enable errcheck (#5336)
## Description

Enable errcheck linter throughout the codebase

Closes: #5059
2020-09-07 15:03:18 +00:00
Callum Waters e2927d2088 light: move dropout handling and invalid data to the provider (#5308) 2020-09-02 18:28:48 +02:00
Marko e0140e4beb evidence: remove ConflictingHeaders type (#5317)
## Description

Remove ConflictingHeaders & compositeEvidence types


Ref #5288
2020-09-01 16:34:37 +00:00
Callum Waters 2b58a62721 light: implement light block (#5298) 2020-09-01 17:45:55 +02:00
Callum Waters 86707862d4 fix validator set proposer priorities in light client provider (#5307) 2020-08-31 12:47:38 +02:00
Callum Waters b7f6e47a42 evidence: modularise evidence by moving verification function into evidence package (#5234) 2020-08-20 18:11:21 +02:00
Marko 2d167aefcf ci: freeze golangci action version (#5196)
## Description

This PR updates golang-ci to latest and stops looking at master for the action. 

Closes: #XXX
2020-08-03 07:57:06 +00:00
Marko 2ac5a559b4 libs: wrap mutexes for build flag with godeadlock (#5126)
## Description

This PR wraps the stdlib sync.(RW)Mutex & godeadlock.(RW)Mutex. This enables using go-deadlock via a build flag instead of using sed to replace sync with godeadlock in all files

Closes: #3242
2020-07-20 07:55:09 +00:00
Anton Kaliaev 5223cbac27 light: return if target header is invalid (#5124)
Closes #5120
2020-07-17 06:13:00 +00:00
Anton Kaliaev a08316f16a light: use bisection (not VerifyCommitTrusting) when verifying a head… (#5119)
Closes #4934

* light: do not compare trusted header w/ witnesses

we don't have trusted state to bisect from

* check header before checking height

otherwise you can get nil panic
2020-07-15 15:44:30 +04:00
Marko 6ccccb0933 lint: errcheck (#5091)
## Description

add more error checks to tests


gonna do a third PR that tackles the non test cases
2020-07-14 11:04:41 +00:00
Callum Waters de8cb8c16d light: fix rpc calls: /block_results & /validators (#5104) 2020-07-10 14:20:31 +02:00