-
Notifications
You must be signed in to change notification settings - Fork 176
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
server: Add suspending sessions that did not pass the pHash verification #2103
server: Add suspending sessions that did not pass the pHash verification #2103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Made an unrelated sidecomment
return untrustedResult.Session, untrustedResult.TranscodeResult, untrustedResult.Err | ||
} else if monitor.Enabled { | ||
monitor.FastVerificationFailed() | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this exact issue or very high priority, so maybe we should open a new issue/PR for this:
Maybe we should reset our verifiedSession
to nil
if the hash it sends doesn't match?
} else { | |
} else { | |
if (bsm.verifiedSession == untrustedResult.Session) { | |
bsm.verifiedSession = nil | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see one issue with adding this condition. If we add it, then a false-negative will cause bsm.verifiedSession = nil
and in a result, we'll start looking for a new session. That can in turn cause bouncing between sessions if we encounter many false-negative scenarios.
We decided that we'll suspend sessions only if it failed p-hash verification but at the same time the other untrusted sessions passed the verification. We could do the same and maybe set verifiedSession
to nil
when we suspend the session, but technically it does not matter, because this condition takes into consideration both bsm.verifiedSession = nil
and excluding suspended sessions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about false negatives causing swaps, and yeah we'd anyway suspend a verified session and look for a new one if the other untrusted session passes. LGTM feel free to merge 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits, but looks good!
Co-authored-by: Yondon Fu <yondon.fu@gmail.com>
…eszko/go-livepeer into 2097-suspend-untrusted-session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments @yondonfu . I addressed them. PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Let's just cleanup the last few commits either via squashing and/or a rebase + push prior to merging.
Yeah, sure I'll clean it up |
… 2097-suspend-untrusted-session
What does this pull request do? Explain your changes. (required)
Suspend untrusted session when the following conditions are correct:
It would be nice to add some automated tests for this change, however, it's hard to do it with the current design. I think we should tackle it separately while refactoring
broadcast.go
.Specific updates (required)
Suspend the untrusted session that returned incorrect p-hash
How did you test each of these updates (required)
Does this pull request close any open issues?
Checklist:
make
runs successfully./test.sh
pass