-
Notifications
You must be signed in to change notification settings - Fork 5
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
What if we replaced nonce with cause(al) links #35
Comments
Hmm that's interesting (and a good point). There are two edge cases:
In all of these, a nonce is still useful. It's worth thinking on more, though! 🤔🤔🤔 |
My point is that in distributed systems you probably should have ? At least framing this as I would also say that tracking each invocation perhaps is bit too granular ? You could instead you could use hash of the vector clock or perhaps drand.
Unless they have exact same task CID it probably does not matter right ? But again having to make you ask those questions upfront is kind of the goal of proposed reframing.
If that is the case than you really want some randomness I suppose and that's cool to just take random value and link to it.
Perhaps calling it |
I think
|
I don't think that's true 🤔 e.g. a non-malicious Byzantine node can definitely find itself in this situation
How so? Don't we need a way to distinguish between calls regardless of user, especially if they're effectful?
I'm all for making this stuff more salient, but that's largely above the protocol (in tooling), right?
The more I think on this, the more I'm sure that I can't make this work for IPVM. The topologies that result break semantic addressing. |
We don't need to reinvent the wheel. |
If it lost a state I would imagine it should either
I think we're loosing connection here. Specifically I think of nonce as a differentiating factor among two identical calls where CIDs would match without a nonce. I think solutions right now is either caller generates nonce randomly (current take) or chooses some deterministic way to differentiate (proposed take). In many cases linking to an invocation you intend to be different from seems like a reasonable choice, effectively saying I'm intentionally invoking same exact task as the one I did before. If you were not aware of the former invocation you'll probably hit the cache and get receipt from the first invocation, if you want to bypass cache and invoke it once more, solution is logical take the CID of the first invocation and link to it (implying this is happening afterwards) Tracking each individual invocation may not be always practical however (even if it ends up acting like local LRU cache), but then again caller can take more coarse approach and use local vector clock (or hash of it to conceal order) which would require less state maintenance just a node id & a local counter. If that state is lost node can regenerate node id and carry on with it's business. In cases where vector clock is too much, node could simply stick to wall clock or random values or synthesis of two. At which point all the determinism is lost but sounds like that was a best choice available given constraints.
I'm not sure what you mean here. Changing from
I'd like to understand why is this a case ? Or isn't the invoker responsible for providing these to IPVM ? I'm also not sure why IPVM could not just treat it as nonce (in worst case scenario) ?
Well I thought I have confused you by implying that there must be a causal relation. I meant to say that causal link is a convenient |
Maybe I'm making too many assumptions here, but let me call them out they are clear:
You are correct that this is no longer linear history, but under defined constraints I don't think node has a better option. But again there are other mechanisms one could use like https://drand.love/ to avoid having to maintain clock yourself.
It is IPLD link to anything. So it could be a link an event like vector clock or it could be a link to the previous invocation of the otherwise identical task. It also could be a link to arbitrary bytes which is effectively a nonce. Which is my primary hypothesis: You really want to acknowledge passage of time which could be by acknowledge some event (kind of spin on merkle clocks) or you you do it by acknowledging some random bytes which in practice is still acknowledge some events in an outside world. Which is why I think it's just reframing of the
The way I'm thinking about it is if I'm sending email with exact same recipients, from same address and same body it is a noop and I would expect to just get a receipt. If my intention is to do it despite having done it prior, I should be explicit about it been different. I could do it either by:
I do not think the
I think my hypothesis is that you do need nonce or cause, when you have later you probably don't need former. Ironically this whole idea was inspired by what you were telling me about how you've considered making
Sure, but I was talking about spec implementers. I fear that most will just reach for putting random values in nonce (in fact I have encountered this happen already), I would very much prefer if people put more deliberation here and I hope reframing would help. |
I've been finding that most times I need to perform repeated task invocation I have two options:
Downside of first option is that it makes things non-deterministic, and leads to non referentially transparent code. Second less obvious option does not have same issues and better yet encourages to capture (partial) order. It is also worth calling out that one could always encode arbitrary nonce as an link with identity hashed to a raw block, which is couple bytes prefix but otherwise same.
Which is why I'd like to propose replacing
nonce
with an optionalcause: &any
field (could be a different name) as I think it would encourage thinking about order and more deterministic approachThe text was updated successfully, but these errors were encountered: