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

Relax overly strict disconnection rule for known-invalid blocks #3726

Conversation

amesgen
Copy link
Member

@amesgen amesgen commented Apr 28, 2022

Closes CAD-4225

In the context of diffusion pipelining, it is possible honest behavior
for an upstream peer to send us a block that we already know is
invalid by the time we process the RollForward message (e.g. because
we already received it from another peer and finished validating it).
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

Thanks @amesgen -- this is exactly what we discussed earlier today 👍

I would Approve, but I'm not going to because I want @coot to weigh-in, so please Approve if you're OK with these changes, Marcin.

Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

LGTM.

Looks like a reasonable place to define isPipeliningEnabled.

Comment on lines 731 to 735
unless (isPipeliningEnabled version) $ do
-- Reject the block if invalid
isInvalidBlock <- atomically $ forgetFingerprint <$> getIsInvalidBlock
whenJust (isInvalidBlock hdrHash) $ \reason ->
disconnect $ InvalidBlock hdrPoint reason
Copy link
Contributor

Choose a reason for hiding this comment

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

We still check for extending invalid chains though right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes ok, makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I don't think it's reliable to use the Watcher for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Update: While we don't think it is strictly necessary, I will go ahead and add a check that at this place in the code that ensures that the parent hash is not known-invalid.

Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

I think my latest comment (see below) clarifies a confusion in the newest change.

@amesgen amesgen force-pushed the amesgen/CAD-4225-relax-overly-strict-chain-sync-client-disconnection-rule branch from e4eccd7 to d1b4d34 Compare May 2, 2022 10:23
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

Approved! Thanks much!

@amesgen amesgen force-pushed the amesgen/CAD-4225-relax-overly-strict-chain-sync-client-disconnection-rule branch from d1b4d34 to 2c1fcd1 Compare May 2, 2022 15:18
@amesgen
Copy link
Member Author

amesgen commented May 2, 2022

bors r+

iohk-bors bot added a commit that referenced this pull request May 2, 2022
3726: Relax overly strict disconnection rule for known-invalid blocks r=amesgen a=amesgen

Closes [CAD-4225](https://input-output.atlassian.net/browse/CAD-4225)

Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 2, 2022

Build failed:

@amesgen
Copy link
Member Author

amesgen commented May 3, 2022

bors r+

iohk-bors bot added a commit that referenced this pull request May 3, 2022
3726: Relax overly strict disconnection rule for known-invalid blocks r=amesgen a=amesgen

Closes [CAD-4225](https://input-output.atlassian.net/browse/CAD-4225)

Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 3, 2022

Timed out.

@amesgen
Copy link
Member Author

amesgen commented May 3, 2022

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 3, 2022

@iohk-bors iohk-bors bot merged commit 0a3a61a into master May 3, 2022
@iohk-bors iohk-bors bot deleted the amesgen/CAD-4225-relax-overly-strict-chain-sync-client-disconnection-rule branch May 3, 2022 14:18
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.

3 participants