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

Prevent Reprocessing of a Block From Our Pending Queue #9904

Merged
merged 6 commits into from
Nov 17, 2021

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Nov 15, 2021

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

  • In the event we have a block in our pending queue and while waiting for the queue to be processed we receive a block from gossip. The block will again be processed from our pending queue, this is an unnecessary burden for the node.
  • Fixes tests.

Which issues(s) does this PR fix?

N.A

Other notes for review

@prestonvanloon
Copy link
Member

Tests fail

@jmozah
Copy link
Contributor

jmozah commented Nov 15, 2021

Good catch on the deleteBlockFromPendingQueue()
LGTM.

if err := s.deleteBlockFromPendingQueue(slot, b, blkRoot); err != nil {
return err
}
s.pendingQueueLock.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to release the lock if there's an error in the line above as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah , very nice catch. We use the same pattern in a few places, will fix them.

@rauljordan rauljordan merged commit 1c4ea75 into develop Nov 17, 2021
@delete-merged-branch delete-merged-branch bot deleted the fixPendingBlockBug branch November 17, 2021 15:05
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.

4 participants