-
Notifications
You must be signed in to change notification settings - Fork 1
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
Crash resistant create() API #40
Comments
if this crashes on line 89, then we've got a new group feed that won't be used. that doesn't break anything since we'll just create a new one the next time we try to create a group, but it's slightly inefficient. does that need to be fixed? Lines 83 to 95 in 206138e
|
i guess it's a similar problem to, and maybe has the same solution as, when you crash inbetween creating the root msg and inviting yourself to the group. which similarly should mostly just be suboptimal |
i was gonna ask if this was redundant Line 56 in 206138e
since we later add ourselves to the group anyway. but maybe encrypting to ourselves here as well could be a way of saving the group early or wait, when recovering from scratch, will you need the feed announcement encrypted to yourself to be able to find the feed again? hmm maybe not, since we do invite ourselves on our invitations feed, and we know how to find the invitations feed |
I guess it's fine, but it depends on what kind of crash it is. If it's a totally random crash, then the issue of leaving empty groups behind is definitely not a problem because it's very rare. But let's say that this is a deterministic crash, e.g. every time the user creates a group, it always crashes on line 89. Then crash-resistance is important, otherwise we're creating a lot of group feeds in vain. There is also another issue here in that the group/init msg doesn't say anything at all about what the group is in terms of name, purpose, description, etc. It's completely naked. I think we should have some kind of descriptive data there, but it doesn't need to be done in this issue. So here is what I suggest:
|
thanks for the elaborate suggestions
I don't understand what we'd do with the date.now? I think the underlying problem is that we only really save the secret for ourselves in the last step, when we add ourselves. The suggestion on line 56 linked above might be the solution to this problem, then we save the key in a way recoverable by ourselves in the first step (first published message by create() ). Then from that we should be able to go through the rest of the steps based on the secret we store there, even if we crash. |
Now how do I actually test this lmao |
@staltz not done! several more potential crashes i think |
Right now I see two remaining issues:
|
That part of the spec got added in the commit "first pass at all READMEs" v0.0.1 so maybe not that important ssbc/private-group-spec@260a381 The file btw https://github.com/ssbc/private-group-spec/blob/master/group/init/README.md |
@Powersource I think in the
|
oh yeah that sounds smart |
for the purposes of tribes2 code i don't think having the secret in the init will save us lines of code here Lines 230 to 241 in ea5e29a
Lines 260 to 275 in ea5e29a
|
@mixmix made a pr for that ssbc/private-group-spec#25 |
also in tribes2 #62 |
Booya |
We should "restart" any create() that was partially done but interrupted by a crash.
Plus tests.
The text was updated successfully, but these errors were encountered: