Commit Graph
403 Commits
Author SHA1 Message Date
Aleksandr Bezobchuk 67c5516810 blockchain v0: bump test timeout 2021-01-11 10:59:30 -05:00
Aleksandr Bezobchuk 4b09bf9695 blockchain v0: bump test timeout 2021-01-11 10:19:25 -05:00
Aleksandr Bezobchuk 728c1366cc blockchain v0: remove select clause 2021-01-11 09:36:22 -05:00
Aleksandr Bezobchuk 95b08bb775 blockchain v0: add poolWG and refactor pool routines 2021-01-08 14:20:34 -05:00
Aleksandr Bezobchuk 3ac6a6921e blockchain v0: add TestReactor_AbruptDisconnect 2021-01-08 10:26:23 -05:00
Aleksandr Bezobchuk 1fcc3973a0 blockchain v0: update tests 2021-01-08 09:32:17 -05:00
Aleksandr Bezobchuk 31fac447a4 blockchain v0: rename tests 2021-01-08 08:38:37 -05:00
Aleksandr Bezobchuk 88fa8fe348 blockchain v0: update TestBadBlockStopsPeer 2021-01-08 08:38:12 -05:00
Aleksandr Bezobchuk 9039b6cd05 blockchain v0: fix faux router 2021-01-06 19:14:03 -05:00
Aleksandr Bezobchuk bd42353ee5 blockchain v0: refactor TestNoBlockResponse 2021-01-06 13:33:13 -05:00
Aleksandr Bezobchuk 1463bc0be6 blockchain v0: reactor updates 2021-01-06 13:28:05 -05:00
Aleksandr Bezobchuk f021c7df4d Merge branch 'master' into bez/p2p-refactor-blockchain-v0-reactor 2021-01-06 11:55:34 -05:00
Aleksandr Bezobchuk 85569ebb60 blockchain v0: remove BroadcastStatusRequest 2021-01-06 10:25:35 -05:00
Aleksandr Bezobchuk 952cfaa174 blockchain v0: cleanup 2021-01-06 10:15:35 -05:00
Aleksandr Bezobchuk 537464d26a blockchain v2: update message usage 2021-01-05 12:05:13 -05:00
Aleksandr Bezobchuk faa0e09f17 blockchain v0: update poolRoutine 2021-01-05 11:13:14 -05:00
Erik GrinakerandGitHub 0555772d3a blockchain/v0: stop tickers on poolRoutine exit (#5860)
Fixes #5841.
2021-01-05 14:45:24 +00:00
Erik GrinakerandGitHub 1e1d087494 blockchain/v2: fix missing mutex unlock (#5862)
Fixes #5843.
2021-01-05 14:35:20 +00:00
Aleksandr Bezobchuk 7a639e5297 blockchain v0: refactor SwitchToFastSync 2021-01-04 16:38:09 -05:00
Aleksandr Bezobchuk c978c8f4ee blockchain v0: refactor BroadcastStatusRequest 2021-01-04 16:36:34 -05:00
Aleksandr Bezobchuk bbf126a79d blockchain v0: refactor Receive 2021-01-04 16:33:17 -05:00
Aleksandr Bezobchuk c111125b9f blockchain v0: refactor message logic 2021-01-04 16:32:40 -05:00
Aleksandr Bezobchuk b48a7f4d7e blockchain v0: initial commit 2021-01-04 14:41:01 -05:00
Erik GrinakerandErik Grinaker b4ce1de44a p2p: rename NodeInfo.DefaultNodeID to NodeID 2021-01-04 11:25:20 +01:00
Erik GrinakerandErik Grinaker 8e7d431f6f p2p: rename ID to NodeID 2021-01-04 11:25:20 +01:00
Anton KaliaevandGitHub 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
Erik GrinakerandGitHub e198edf20e p2p: remove NodeInfo interface and rename DefaultNodeInfo struct (#5799)
The `NodeInfo` interface does not appear to serve any purpose at all, so I removed it and renamed the `DefaultNodeInfo` struct to `NodeInfo` (including the Protobuf representations). Let me know if this is actually needed for anything.

Only the Protobuf rename is listed in the changelog, since we do not officially support API stability of the `p2p` package (according to `README.md`). The on-wire protocol remains compatible.
2020-12-15 18:54:25 +00:00
Anton KaliaevandGitHub 5aa859c370 blockchain/v2: send status request when new peer joins (#5774)
Closes #5766

* memoize the scSchedulerFail error to avoid printing it every scheduleFreq
* blockchain/v2: modify switchIO funcs to accept peer instead of peerID
2020-12-14 11:25:28 +04:00
Anton KaliaevandGitHub 89e908e340 blockchain/v0: relax termination conditions and increase sync timeout (#5741)
Closes: #5718
2020-12-08 11:33:03 +04:00
Tess RinearsonandGitHub 79890d8393 reactors: omit incoming message bytes from reactor logs (#5743)
After a reactor has failed to parse an incoming message, it shouldn't output the "bad" data into the logs, as that data is unfiltered and could have anything in it. (We also don't think this information is helpful to have in the logs anyways.)
2020-12-03 22:12:08 +00:00
Anton KaliaevandGitHub 243ff4b43d blockchain/v1: remove in favor of v2 (#5728) 2020-12-03 09:35:47 +04:00
Anton KaliaevandGitHub 33dbff61d3 blockchain/v1: fix deadlock (#5711)
I introduced a new variable - syncEnded, which is now used to prevent
sending new events to channels (which would block otherwise) if reactor
is finished syncing

Closes #4591
2020-12-01 13:08:33 +00:00
Anton KaliaevandGitHub 3ad1157451 blockchain/v1: handle peers without blocks (#5701)
Closes #5444

Now we record the fact that a peer does not have a requested block and later use this information to make a new request for the same block from another peer.
2020-11-23 11:59:34 +00:00
Anton KaliaevandGitHub f2f6a78809 docs: warn developers about calling blocking funcs in Receive (#5679)
Refs #2888
2020-11-17 15:37:35 +00:00
Anton KaliaevandGitHub 335e97433c blockchain/v2: remove peers from the processor (#5607)
after they were pruned by the scheduler

Closes #5513
2020-11-05 12:24:48 +00:00
Anton KaliaevandGitHub bcf9b0aa39 blockchain/v2: make the removal of an already removed peer a noop (#5553)
also, since multiple StopPeerForError calls may be executed in parallel,
only execute StopPeerForError once

Closes #5541
2020-10-30 10:31:22 +00:00
Anton KaliaevandGitHub b4adeab8b9 blockchain/v2: fix panic: processed height X+1 but expected height X (#5530)
Before: scheduler receives psBlockProcessed event, but does not mark block as processed because peer timed out (or was removed for other reasons) and all associated blocks were rescheduled.

After: scheduler receives psBlockProcessed event and marks block as processed in any case (even if peer who provided this block errors).

Closes #5387
2020-10-20 14:29:36 +04:00
Anton KaliaevandGitHub d785036e0b blockchain/v2: fix "panic: duplicate block enqueued by processor" (#5499)
When a peer is stopped due to some network issue, the Reactor calls scheduler#handleRemovePeer, which removes the peer from the scheduler. BUT the peer stays in the processor, which sometimes could lead to "duplicate block enqueued by processor" panic WHEN the same block is requested by the scheduler again from a different peer. The solution is to return scPeerError, which will be propagated to the processor. The processor will clean up the blocks associated with the peer in purgePeer.

Closes #5513, #5517
2020-10-20 14:19:00 +04:00
MarkoandGitHub e1644d00c5 mempool: length prefix txs when getting them from mempool (#5483)
## Description

In protobuf `[]byte` is varint encoded. When adding txs to the block we were not taking this into account. 


Closes: #XXX
2020-10-13 10:33:21 +00:00
MarkoandGitHub 346aa14db5 fix lint failures with 1.31 (#5489) 2020-10-13 10:22:53 +02:00
Callum WatersandGitHub 6a2a71be07 correctly calculate evidence data size (#5482) 2020-10-12 11:28:41 +02:00
Callum WatersandGitHub 4f79930c12 blockchain: remove duplication of validate basic (#5418) 2020-09-28 17:02:46 +02:00
MarkoandGitHub 95367eaf51 blockchain/v1: add noBlockResponse handling (#5401)
## Description

Add simple `NoBlockResponse` handling to blockchain reactor v1. I tested before and after with erik's e2e testing and was not able to reproduce the inability to sync after the changes were applied

Closes: #5394
2020-09-28 07:20:54 +00:00
Callum WatersandGitHub 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
MarkoandGitHub 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
MarkoandGitHub 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
MarkoandGitHub 0ed8dba991 lint: enable errcheck (#5336)
## Description

Enable errcheck linter throughout the codebase

Closes: #5059
2020-09-07 15:03:18 +00:00
MarkoandGitHub 135ac0400e blockchain: verify +2/3 (#5278)
## Description

Verify only +2/3 of the commit. 

Closes: #5259
2020-08-25 07:07:19 +00:00
Erik GrinakerandGitHub edf5cff80f blockchain: fix fast sync halt with initial height > 1 (#5249)
Blockchain reactors were not updated to handle arbitrary initial height after #5191.
2020-08-14 13:04:51 +00:00
MarkoandGitHub 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