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

quick check for block_exists in adapters #3068

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

antiochp
Copy link
Member

We currently check for is_known() when processing blocks but we do this only after we obtain the write lock on the txhashset in chain processing pipeline. This is expensive and causes unnecessary contention around our various write locks where peers can only check this sequentially and are blocked from processing any other p2p messages while waiting for this.

We can do a quick (and far less expensive) check in adapters when processing a -

  • full block
  • compact block
  • header (header first)

In adapters, quickly check if the full block exists in the db. If it exists we have previously processed and accepted this block and we do not need to process it again.

@antiochp antiochp added this to the 3.0.0 milestone Sep 30, 2019
@antiochp antiochp changed the title [DNM] quick check for block_exists in adapters quick check for block_exists in adapters Oct 4, 2019
@antiochp antiochp requested a review from hashmap October 4, 2019 11:23
@antiochp antiochp merged commit 95e74c7 into mimblewimble:master Oct 7, 2019
@antiochp antiochp deleted the adapter_is_known branch October 7, 2019 08:09
@antiochp antiochp mentioned this pull request Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants