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

Will time stamp precision be an issue? #46

Open
coodoo opened this issue Dec 5, 2015 · 4 comments
Open

Will time stamp precision be an issue? #46

coodoo opened this issue Dec 5, 2015 · 4 comments

Comments

@coodoo
Copy link

coodoo commented Dec 5, 2015

Currently the filter function is doing it's comparison based on ts, I was wondering if some of the connected clients has their system clock misconfigured (or intentionally tampered), will those incorrect ts break the comparison hence making the final results inconsistent across all clients?

I see swarm is using lamport timestamp to somehow guarantee the the ts is correct, does that help?

Thanks!

@dominictarr
Copy link
Owner

each timestamp is generally considered only with respect to the node that recorded that timestamp. so the system will still be eventually consistent even if clocks are skewed.

In the case of scuttlebot/model it will take the most recently (by timestamp) value for a key. This would mean that peers with an early timestamp will win against timestamps set by other peers, However, no one has ever posted an issue saying that this is a problem.

If it was, one simple way to fix this would be to replace the timestamp with a value that was always one more than the latest update you knew about. So I make update 1, then you could make update 2. if I see that I'd make update 3 next. if I didn't see it, i'd make update 2, but that would be okay because these would be compared by our node ids and it would be apparent that we updated concurrently.

re: security, this module should really be called insecure-scuttlebutt. It would be okay if it's running behind your firewall (i.e. you control the code on all peers). I am now working a secure replication system, http:https://github.com/ssbc/scuttlebot/ it uses the same basic idea as scuttlebutt but has very different project goals.

@coodoo
Copy link
Author

coodoo commented Dec 7, 2015

Thanks for the detailed information, I will have a good look at secure-scuttlebutt and scuttlebot ASAP.

In the mean time, one quick question, does secure scuttlebot support the use case of letting multiple users working on one document (think google doc)? Which means everyone can edit the document event offline, and the document will eventually converge to the same state across all clients.

Thanks!

@dominictarr
Copy link
Owner

@coodoo yes absolutely. scuttlebutt/model gives you a simple kv store, and https://github.com/dominictarr/r-edit gives you text editing. see the links in the readme for others.

@coodoo
Copy link
Author

coodoo commented Dec 8, 2015

Yup I've been working on r-edit/r-array/scuttlebutt example for a while and finally come to an extent I'm feeling comfortable with the whole combinations, I was just about to start revising r-edit with r-string which is more granular and suits my use case better.

I was just under the impression that r-array won't work with secure-scuttlebutt/bot out of the box but seems I'm wrong :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants