DJDNS / go-deje

Golang library for DEJE Next, a protocol/technology for decentralized document hosting and concurrent editing.
GNU Lesser General Public License v2.1
8 stars 0 forks source link

TimestampTracker #5

Closed MaddieM4 closed 10 years ago

MaddieM4 commented 10 years ago

Object takes a Document and a TimestampService, and traverses the Document to the latest event in the valid, timestamped chain when you run .GoToLatest().

Tracks the set of known-valid timestamps, such that all newly-validating timestamps must be on, or compatible with, that set. Can come to weird conclusions if the TimestampService returns inconsistent results between runs (new elements on the end are expected, new elements interspersed throughout would theoretically be fine, complete reorders are wackadoo).

MaddieM4 commented 10 years ago

First of all, need to implement a "bandaid" TimestampService that holds a *Document, and returns doc.Timestamps. At that point, we can implement the tracker logic.

MaddieM4 commented 10 years ago

This implementation will actually completely recalculate everything during GoToLatest(). So there's no need to worry about the timestamp order changing between runs.

MaddieM4 commented 10 years ago

Still got a few functions that need testing, still going from dependencies to dependents. Which means we have this much left to go before merge: