-
Notifications
You must be signed in to change notification settings - Fork 178
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
Improve logic for selecting untrusted Os for fast verification #2097
Comments
I may be wrong, but I think that changing the default value to 1 has some implications. @jailuthra @yondonfu PTAL, wdyt? Problem to considerConsider the following scenario. We have 4 orchestrators:
Now, B selects OTR to the trusted orchestrator pool and randomly 2 orchestrators into the untrusted pool. What can happen now?
If we change the size of the untrusted pool to 1, then it's what can happen
Possible solutions
|
Ah good catch, I completely missed that we currently don't remove an orchestrator from the selector if it fails verification.
IIRC this was a stretch goal in the spec but for the initial implementation we decided to not call
Yeah, this should solve the issue of excessive swaps between untrusted Os. For the secondary motivation of cutting down the session load on Os, we'd still want to reduce the pool size to 1. But whenever we want to switch back again to > 1 untrusted Os, reducing unnecessary swaps would be useful - so would be great to fix it now regardless! |
Thanks for the comment @jailuthra. If the motivation is also to cut down the session load for the segments under the fast verification (so that it's always sent to (1 trusted O and 1 untrusted O) and not to (1 trusted O and 2 untrusted O)), then I think there is no need to implement the switch for now. In such a case, I think we should at least remove the failing O from the untrusted selector (blacklist it in selectSessions()). Wdyt? |
I think there are two mechanisms to consider here:
IIUC the current state of things is:
If the above statements are true, then my suggestion would be:
But, now that we're discussing this I think I do see the benefit of selecting more than 1 untrusted O. If we only select 1 untrusted O and then suspend that O for a fast verification failure then we'd expect B to swap to the trusted O at a rate roughly equal to the false negative rate of the phash check. An improvement to this could be to select 2 untrusted Os and only suspend an O for failing fast verification if the other untrusted O passes fast verification. If both Os fail fast verification, then skip the suspension. I'm assuming that the probability of a double false negative for both untrusted Os is less than the probability of a single false negative, but I'm not certain about this. cc @oscar-davids for thoughts on this statement. If we implement the above, then we can also implement the below suggestion from @leszko to minimize swaps in the happy case where the verified O passes fast verification:
@jailuthra @darkdarkdragon @leszko WDYT? |
I was sure we already suspend failed O, but turned out we don't.
We can implement this and see how it will work on practice.
Sure we should do this. |
Thanks for all the comments. I think that the comment from @yondonfu summarizes the current state of the art. So I think we suggest the following changes:
@jailuthra are you ok with such changes? @oscar-davids is it correct that "double false negative for both untrusted Os is less than the probability of a single false negative"? |
Sounds good to me 👍 |
This problem can be formulated as choosing nodes out of n nodes when there is m dishonest nodes. This probability follows hypergeometric distribution.
In other words, when we choose two nodes, we are likely to choose dishonest node at Pr(x=2) probability, which is apparently smaller than Pr(x=1). |
Thanks @oscar-davids for the comment. So, I think it's worth implementing what @yondonfu suggested: btw. I've fired a PR to fix this |
An update from my side:
|
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
During fast verification, B defaults to selecting 2 sessions from the untrusted pool.
Describe the solution you'd like
A clear and concise description of what you want to happen.
There isn't a particularly strong reason to select 2 sessions from the untrusted pool and B can instead default to selecting 1 session from the untrusted pool which is easier to reason about and also decreases the # of Os that a single segment can bounce around to while we're still testing fast verification (sending the same segment to additional Os will be less of a big deal once we ensure that the workflow works well when just using a single untrusted O).
We could consider making this # configurable, but I don't see a strong need to do so right now, so we may just be able to use 1.
The text was updated successfully, but these errors were encountered: