Commit Graph

410 Commits

Author SHA1 Message Date
Aleksandr Bezobchuk c5a126fe9b Update blockchain/v0/reactor_test.go
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2021-01-13 10:30:12 -05:00
Aleksandr Bezobchuk 143fa93d76 blockchain v0: lint++ 2021-01-12 08:57:49 -05:00
Aleksandr Bezobchuk 2201204418 blockchain v0: no-op on empty peer IDs 2021-01-12 08:56:08 -05:00
Aleksandr Bezobchuk 7aff59cd86 blockchain v0: fix test assertion 2021-01-11 16:23:19 -05:00
Aleksandr Bezobchuk a7c624eb2d blockchain v0: lint++ 2021-01-11 14:59:03 -05:00
Aleksandr Bezobchuk 22536ba3cf blockchain v0: decrease max block height 2021-01-11 14:37:04 -05:00
Aleksandr Bezobchuk 1f88c2a31c blockchain v0: attempt test fix 2021-01-11 13:42:03 -05:00
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 Grinaker 0555772d3a blockchain/v0: stop tickers on poolRoutine exit (#5860)
Fixes #5841.
2021-01-05 14:45:24 +00:00
Erik Grinaker 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 Grinaker b4ce1de44a p2p: rename NodeInfo.DefaultNodeID to NodeID 2021-01-04 11:25:20 +01:00
Erik Grinaker 8e7d431f6f p2p: rename ID to NodeID 2021-01-04 11:25:20 +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
Erik Grinaker 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 Kaliaev 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 Kaliaev 89e908e340 blockchain/v0: relax termination conditions and increase sync timeout (#5741)
Closes: #5718
2020-12-08 11:33:03 +04:00
Tess Rinearson 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 Kaliaev 243ff4b43d blockchain/v1: remove in favor of v2 (#5728) 2020-12-03 09:35:47 +04:00
Anton Kaliaev 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 Kaliaev 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 Kaliaev f2f6a78809 docs: warn developers about calling blocking funcs in Receive (#5679)
Refs #2888
2020-11-17 15:37:35 +00:00
Anton Kaliaev 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 Kaliaev 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 Kaliaev 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 Kaliaev 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
Marko 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
Marko 346aa14db5 fix lint failures with 1.31 (#5489) 2020-10-13 10:22:53 +02:00
Callum Waters 6a2a71be07 correctly calculate evidence data size (#5482) 2020-10-12 11:28:41 +02:00
Callum Waters 4f79930c12 blockchain: remove duplication of validate basic (#5418) 2020-09-28 17:02:46 +02:00
Marko 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