fix(sync-v2): Fix issues caused by concurrent syncing peers #872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Sync-v2 had some issues when syncing with multiple peers. It was causing some tests with three or more peers to be flaky. Notice that peers could still sync but it was taking longer because of the reconnections.
Acceptance Criteria
on_block_complete()
to handle vertices that already exists. It might happen because other peer had added these vertices before the current peer.BlockchainStreamingServer.send_next()
which was sending one block more than the limit.TransactionStreamingClient.process_tx()
which was not correctly handling dependencies that already exists in the storage. This condition might happen because of a resume or because other peer had added these dependencies before the current peer._existing_deps
if it already exists. This is necessary because the streaming server does not know we already have it so it will always send the whole sub-DAG of transactions.