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

Syncing to and from a single head hash #774

Closed
vaultec81 opened this issue Mar 29, 2020 · 4 comments
Closed

Syncing to and from a single head hash #774

vaultec81 opened this issue Mar 29, 2020 · 4 comments

Comments

@vaultec81
Copy link
Member

Context: Currently orbit-db has no mechanism to represent the current state in a single hash. The closest thing to this is comparing a list of head hashes, and trans-versing the dag of each head in the head list. This can be seen in orbit-db-store sync(), which is the current logic used for syncing the database across nodes. There is no way for application developers wanting to export their current state hash and publish that same state hash to other nodes. Then verify that all nodes across the database are synced to exactly the same point. There is no easily verifiable certainty that every node hosting a database is viewing the same state.

A possible solution would be adding two new methods. toHeadHash() would export a single hash representing the current head hashes in a dag cbor object. SyncFromHeadHash() would iterate through the represented dag cbor object. Syncing each head in the process and guaranteeing the database is properly synced. The method will queue all read write operations until the syncing has been completed.

This is an on going discussion. Feedback is welcomed.

@aphelionz
Copy link
Member

Note that this can almost be done in ipfs-log#fromEntryHash, but for only one hash

@vaultec81
Copy link
Member Author

Check out this commit which adds support for syncing to from a single head hash. I suppose something similar can be added to orbit-db-store.

@aphelionz
Copy link
Member

Looks pretty cool!

@haydenyoung
Copy link
Member

Closing as commit is probably out-of-date. Feel free to submit a new PR if still applicable to version 1.

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

3 participants