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

[Merged by Bors] - Fix starting-epoch check in doppelganger #2491

Closed
wants to merge 3 commits into from

Conversation

paulhauner
Copy link
Member

@paulhauner paulhauner commented Aug 3, 2021

Issue Addressed

NA

Proposed Changes

Fixes a bug in Doppelganger Protection which would cause false-positives when a VC is restarted in the same epoch where it has already produced a signed message.

It could also cause a false-negative in the scenario where time skips forward (perhaps due to host suspend/wake). The new time_skips_forward_with_doppelgangers test covers this case.

This was a simple (and embarrassing, on my behalf) >= instead of <= bug that was missed by my tests but detected during manual testing by @michaelsproul (:pray:). Regression tests have been added.

Additional Info

NA

TODO

  • Add test for doppelganger in epoch > next_check_epoch

@paulhauner paulhauner added bug Something isn't working ready-for-review The code is ready for review work-in-progress PR is a work-in-progress and removed ready-for-review The code is ready for review labels Aug 3, 2021
@paulhauner paulhauner added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Aug 3, 2021
@michaelsproul michaelsproul added the v1.5.0 For inclusion in v1.5.0 release label Aug 3, 2021
@@ -540,7 +540,7 @@ impl DoppelgangerService {
continue;
};

if response.is_live && next_check_epoch >= response.epoch {
Copy link
Member

Choose a reason for hiding this comment

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

Dang bummed we missed this one :/

But thanks for the save @michaelsproul !

Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

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

LGTM

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Aug 4, 2021
@paulhauner
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Aug 4, 2021
## Issue Addressed

NA

## Proposed Changes

Fixes a bug in Doppelganger Protection which would cause false-positives when a VC is restarted in the same epoch where it has already produced a signed message.

It could also cause a false-negative in the scenario where time skips forward (perhaps due to host suspend/wake). The new `time_skips_forward_with_doppelgangers` test covers this case.

This was a simple (and embarrassing, on my behalf) `>=` instead of `<=` bug that was missed by my tests but detected during manual testing by @michaelsproul (:pray:). Regression tests have been added.

## Additional Info

NA

## TODO

- [x] Add test for doppelganger in epoch > next_check_epoch
@bors bors bot changed the title Fix starting-epoch check in doppelganger [Merged by Bors] - Fix starting-epoch check in doppelganger Aug 4, 2021
@bors bors bot closed this Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge This PR is ready to merge. v1.5.0 For inclusion in v1.5.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants