Commit Graph

164 Commits

Author SHA1 Message Date
Marko
719e028e00 libs: internalize some packages (#6366)
## Description

Internalize some libs. This reduces the amount ot public API tendermint is supporting. The moved libraries are mainly ones that are used within Tendermint-core.
2021-05-25 16:25:31 +00:00
Callum Waters
72ee5aab26 evidence: separate abci specific validation (#6473) 2021-05-25 16:53:14 +02:00
Sam Kleinman
0781ca3f50 p2p/pex: cleanup to pex internals and peerManager interface (#6476) 2021-05-17 17:05:44 -04:00
Callum Waters
9e2af66a0a types: fix verify commit light / trusting bug (#6414) 2021-05-11 11:06:37 +02:00
Callum Waters
64e7b5efea p2p: add channel descriptors to open channel (#6440) 2021-05-10 22:22:07 +02:00
Callum Waters
a91680efee test: create common functions for easily producing tm data structures (#6435) 2021-05-07 17:00:02 +02:00
Callum Waters
5bafedff17 evidence: fix bug with hashes (#6375) 2021-04-21 18:50:39 +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
Callum Waters
845efdb76e remove event bus from evidence reactor (#6320) 2021-04-06 16:19:30 +02:00
Sam Kleinman
91506bf25d p2p: simple peer scoring (#6277) 2021-03-29 16:12:23 -04:00
Aleksandr Bezobchuk
a554005136 p2p: revised router message scheduling (#6126) 2021-03-25 16:58:46 -04:00
Sam Kleinman
2ceb816721 test infra: make memory network test buffers configurable (#6275) 2021-03-25 16:19:11 -04:00
Sam Kleinman
5c547137f6 fix: make p2p evidence_pending test not timing dependent (#6252) 2021-03-17 16:03:56 -04:00
Sam Kleinman
acbe3f6570 P2P: Evidence Reactor Test Refactor (#6238) 2021-03-17 11:01:04 -04:00
Marko
efd2fde474 privval: add ctx to privval interface (#6240)
## Description

- Add `context.Context` to Privval interface

This pr does not introduce context into our custom privval connection protocol because this will be removed in the next release. When this pr is released.
2021-03-16 14:41:03 +00:00
Erik Grinaker
9b6d6a3ad0 p2p: tighten up Router and add tests (#6044)
This cleans up the `Router` code and adds a bunch of tests. These sorts of systems are a real pain to test, since they have a bunch of asynchronous goroutines living their own lives, so the test coverage is decent but not fantastic. Luckily we've been able to move all of the complex peer management and transport logic outside of the router, as synchronous components that are much easier to test, so the core router logic is fairly small and simple.

This also provides some initial test tooling in `p2p/p2ptest` that automatically sets up in-memory networks and channels for use in integration tests. It also includes channel-oriented test asserters in `p2p/p2ptest/require.go`, but these have primarily been written for router testing and should probably be adapted or extended for reactor testing.
2021-02-03 23:03:02 +00:00
Erik Grinaker
2aad26e2f1 p2p: tighten up and test PeerManager (#6034)
This tightens up the `PeerManager` and related code, adds a ton of tests, and fixes a bunch of inconsistencies and bugs.
2021-02-03 06:15:23 +00:00
Callum Waters
90d3f56797 store: fix deadlock in pruning (#6007) 2021-02-02 11:36:52 +01:00
Marko
1f01e5d726 params: remove blockTimeIota (#5987)
## Description

- removes blocktimeiota 
- merges block params in abci and core state
- spec change: https://github.com/tendermint/spec/pull/248


Closes: #5939
2021-01-28 13:47:24 +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
Aleksandr Bezobchuk
68bd2116f0 mempool: p2p refactor (#5919) 2021-01-22 09:34:12 -05:00
Callum
af723eca8a use correct source of evidence time
Conflicting votes are now sent to the evidence pool to form duplicate vote evidence only once
the height of the evidence is finished and the time of the block finalised.
2021-01-19 16:00:02 +01:00
Callum Waters
956b59af87 evidence: buffer evidence from consensus (#5890) 2021-01-12 12:50:49 +01:00
Aleksandr Bezobchuk
e986602649 evidence: p2p refactor (#5747) 2021-01-06 11:53:18 -05:00
Callum Waters
9b9222f461 store: order-preserving varint key encoding (#5771) 2021-01-05 16:53:26 +01:00
Anton Kaliaev
aef1ac7ba5 modify Reactor priorities (#5826)
blockchain/vX reactor priority was decreased because during the normal operation
(i.e. when the node is not fast syncing) blockchain priority can't be
the same as consensus reactor priority. Otherwise, it's theoretically possible to
slow down consensus by constantly requesting blocks from the node.

NOTE: ideally blockchain/vX reactor priority would be dynamic. e.g. when
the node is fast syncing, the priority is 10 (max), but when it's done
fast syncing - the priority gets decreased to 5 (only to serve blocks
for other nodes). But it's not possible now, therefore I decided to
focus on the normal operation (priority = 5).

evidence and consensus critical messages are more important than
the mempool ones, hence priorities are bumped by 1 (from 5 to 6).

statesync reactor priority was changed from 1 to 5 to be the same as
blockchain/vX priority.

Refs https://github.com/tendermint/tendermint/issues/5816
2020-12-23 12:31:00 +00:00
Anton Kaliaev
2c16ae99ee evidence: omit bytes field (#5745)
Follow-up to https://github.com/tendermint/tendermint/pull/5743
2020-12-04 11:33:36 +01:00
Anton Kaliaev
f2f6a78809 docs: warn developers about calling blocking funcs in Receive (#5679)
Refs #2888
2020-11-17 15:37:35 +00:00
Callum Waters
3922dde05d evidence: structs can independently form abci evidence (#5610) 2020-11-04 17:14:48 +01:00
Callum Waters
651d8f087b evidence: don't send committed evidence and ignore inbound evidence that is already committed (#5574) 2020-10-27 17:11:58 +01:00
Callum Waters
257b34b459 evidence: don't gossip consensus evidence too soon (#5528)
and don't return errors on seeing the same evidence twice
2020-10-20 18:47:40 +02:00
Marko
82e4693cc5 abci: remove setOption (#5447)
Remove Response/Request SetOption from ABCI.

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2020-10-08 19:12:12 +02:00
Callum Waters
302aec6dcc evidence: use bytes instead of quantity to limit size (#5449)
## Description

Closes: #5432
2020-10-07 09:29:52 +00: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
56911ee352 state: define interface for state store (#5348)
## Description

Make an interface for the state store. 

Closes: #5213
2020-09-15 07:45:48 +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
Marko
710a97d850 evidence: remove amnesia & POLC (#5319)
## Description

remove unneeded types 

![](https://media1.giphy.com/media/fSAyceY3BCgtiQGnJs/giphy.gif)

ref #5288
2020-09-02 13:05:15 +00:00
Marko
82011ee7ab evidence: remove lunatic (#5318)
## Description

remove lunaticEvidence
2020-09-01 16:56:26 +00:00
Marko
e0140e4beb evidence: remove ConflictingHeaders type (#5317)
## Description

Remove ConflictingHeaders & compositeEvidence types


Ref #5288
2020-09-01 16:34:37 +00:00
Marko
fbdf8b098e mocks: update with 2.2.1 (#5294)
## Description

When downloading mockery I ran into an issue where we were using the old version. This PR updates to a more recent version.

changelog?

Closes: #XXX
2020-08-26 15:28:46 +00:00
Callum Waters
b7f6e47a42 evidence: modularise evidence by moving verification function into evidence package (#5234) 2020-08-20 18:11:21 +02:00
Erik Grinaker
cc247c091b genesis: add support for arbitrary initial height (#5191)
Adds a genesis parameter `initial_height` which specifies the initial block height, as well as ABCI `RequestInitChain.InitialHeight` to pass it to the ABCI application, and `State.InitialHeight` to keep track of the initial height throughout the code. Fixes #2543, based on [RFC-002](https://github.com/tendermint/spec/pull/119). Spec changes in https://github.com/tendermint/spec/pull/135.
2020-08-11 17:03:28 +00:00
Marko
40bd416d59 test: protobuf vectors for reactors (#5221)
## Description

Add test vectors for all reactors

- [x] state-sync
- [x] privval
- [x] mempool
- [x] p2p
- [x] evidence
- [ ] light?

this PR is primarily oriented at testvectors for things going over the wire. should we expand the testvectors into types as well?

Closes: #XXX
2020-08-11 14:00:11 +00:00
Callum Waters
312c4f8fe1 evidence: change evidence time to block time (#5219)
adds blockstore interface to evidence and adds fix to byzantine test
2020-08-11 14:39:07 +02:00
Callum Waters
185cd5b8e5 evidence: don't stop evidence verification if an evidence fails (#5189) 2020-07-31 15:30:37 +02:00
Callum Waters
3c21c3546c evidence: remove phantom validator evidence (#5181) 2020-07-31 12:23:58 +02:00
Marko
7c8c356f71 ci: version linter fix (#5128)
## Description
linter version fix and run make format to have all ci run

Closes: #XXX
2020-07-16 09:01:02 +00:00
Erik Grinaker
58113e31ae evidence: fix data race in Pool.updateValToLastHeight() (#5100)
Fixes #5098.

Is this out in a public release? If so, I'll add a changelog entry as well, for backporting.
2020-07-08 13:19:18 +00:00
Callum Waters
3ecc0ffe7e evidence: replace mock evidence with mocked duplicate vote evidence (#5036) 2020-06-24 07:24:30 +02:00
Callum Waters
65d7ce9c9c evidence: improve amnesia evidence handling (#5003)
fix bug so that PotentialAmnesiaEvidence is being gossiped

handle inbound amnesia evidence correctly

add method to check if potential amnesia evidence is on trial

fix a bug with the height when we upgrade to amnesia evidence

change evidence to using just pointers.

More logging in the evidence module

Co-authored-by: Marko <marbar3778@yahoo.com>
2020-06-23 17:09:14 +02:00