Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: synchronizer and relayer share BlocksInflight #919

Merged
merged 5 commits into from Jun 1, 2019

Conversation

keroro520
Copy link
Contributor

  • test: Add test for losing BlockTXN messages

  • fix: Remove relayer's compact_block_filter, filter duplicated compact blocks via BlocksInFlight
    Currently, we discard the new arriving compact blocks if we had already received the same one, via RelayState::compact_block_filter. The purpose is avoiding re-processing/re-requesting the same compact blocks. But the problem is, if we failed to reconstruct a compact block, we cannot process this compact block anymore, before receiving the corresponding transactions from peer1. That's terrible if peer1's inventory was lost on the way.

    Here I remove RelayState::compact_block_filter, and insteadly use Peers::blocks_inflight to avoid re-requesting to same peers.

  • fix: Cache pending compact block at peer-level, but not global-level

@keroro520 keroro520 requested a review from a team May 30, 2019 08:21
@nervos-bot
Copy link

nervos-bot bot commented May 30, 2019

@quake is assigned as the chief reviewer

@nervos-bot
Copy link

nervos-bot bot commented May 30, 2019

CI status of the fork branch is Build Status

sync/src/relayer/block_transactions_process.rs Outdated Show resolved Hide resolved
sync/src/relayer/compact_block_process.rs Show resolved Hide resolved
sync/src/relayer/compact_block_process.rs Show resolved Hide resolved
test/src/specs/relay/compact_block.rs Outdated Show resolved Hide resolved
test/src/specs/relay/compact_block.rs Outdated Show resolved Hide resolved
test/src/specs/relay/compact_block.rs Outdated Show resolved Hide resolved
test/src/specs/relay/compact_block.rs Outdated Show resolved Hide resolved
test/src/specs/relay/compact_block.rs Outdated Show resolved Hide resolved
@doitian
Copy link
Member

doitian commented May 31, 2019

@nervos-bot-user try integration

Currently, we discard the new arriving compact blocks if we had already
received a same one, via `RelayState::compact_block_filter`. The purpose
is avoiding re-processing/re-requesting the same compact blocks. But the
problem is, if we failed to reconstruct a compact block, we cannot process
this compact block any more, before receiving the corresponding transactions
from peer1. That's terrible if peer1's inventory was lost on the way.
Here I remove `RelayState::compact_block_filter`, and insteadly use
`Peers::blocks_inflight` to avoid re-requesting to same peers.
@doitian doitian merged commit e985fb0 into nervosnetwork:develop Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants