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

Don't run hooks on blocks we didn't have #331

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

hannahhoward
Copy link
Collaborator

@hannahhoward hannahhoward commented Jan 13, 2022

Goals

Currently, when the remote peer has a missing block, when we attempt to load that block on the requestor side and discover the remote was missing it, we still run block hooks as if we received it. This is very confusing behavior.

Implementation

Don't run block hooks when loading a block errors on the requestor (the responder already avoids this)

Note: the vast majority of lines of new code in this PR are setting up a test.

Comment on lines 193 to 194
//ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
//defer cancel()
Copy link
Member

Choose a reason for hiding this comment

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

did you intend to leave these commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just kidding! yes, oopsie.

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

ooopsie!

@hannahhoward hannahhoward merged commit 411a568 into main Jan 13, 2022
@mvdan mvdan deleted the feat/consistent-missing-block-behavior branch March 7, 2022 11:57
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.

2 participants