aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation
Commit message (Collapse)AuthorAgeFilesLines
* store: properties over generated historiestv26 hours3-0/+444
| | | | | | | | | | | | | | | | | | | | Two to four writers, each knowing what it wrote and what was written when it last caught up with the others, write the test fold's events on one or two events they know. Eras and cuts are numbered by their history, each number written once, or, for some properties, as often as it comes. A store offered them is checked against the whole history, read from the root with nothing forgotten: * it holds the same whatever order the events come in: every order putting each after what it builds on, for up to six events; some shuffled beyond; and backwards, where every event waits until the first comes; * it judges every event as the whole history does, the store's own refusals aside; * what builds on a refused event is refused; * what it took is above its checkpoint's heads, the cut naming the checkpoint among it, and it reads as its checkpoint and what it took, and as its whole history; * a node starting from its checkpoint holds what it holds. A failing history is cut down, events taken out with what builds on them for as long as it still fails, and printed.
* store: the test fold judges a cut by the checkpoint current at its historytv26 hours1-23/+83
| | | | | | | | | | | | | | | | A cut names heads above those the latest cut of its history names, and holding that cut, or, where its history holds none after the checkpoint the state starts from, heads after that checkpoint or its own; as federation.md has a version name heads after the checkpoint current at its history, at which that one is current too. It judged them by the checkpoint the store holds, which isn't the one current at the history of a cut taken in the same offer as the cut before it, before the store moves. A cut is above its heads as store.md says, each of its dependencies one of them or above them, so that moving to them refuses none of what named them. Of a checkpoint's heads, whose history a state starting from it doesn't hold, it takes none as built on another, nor on what the checkpoint keeps: starting from a checkpoint at two heads, one of them kept, it took the other as built on it, and refused the cut naming them.
* store: what is above some heads names nothing before themtv26 hours1-0/+9
| | | | | | | | | An event above some heads has each of its dependencies among them or above them, not only them all in its history. The store holds after its checkpoint only events whose dependencies are its heads and the events after them, and so it holds every event above them: one naming an event before them as well is refused by a node that moved, and never taken by one starting from the checkpoint, which never held what it names. Tests show it for an event offered after the move and one taken before it.
* store: forks and mergestv26 hours1-0/+87
| | | | | | | | The fold makes a fork's root from the states at heads of one store, or of several, which merges them, and what makes the fork; the store gives it the states, and the events the root keeps, from the stores holding them. A node holding those heads checks a root by building it. A fork and the stores it came from take nothing of each other: what each writes after builds on what the other doesn't hold.
* store: moving to a checkpoint, and starting from a pinned onetv26 hours2-8/+235
| | | | | | | | | | | | | Once the fold names heads of a later checkpoint (events after the store's, none in another's history), the store builds the checkpoint at them, keeps what the fold keeps, forgets what came before them, and refuses every event not above them, with what waits on such an event. What it forgot is held as accounted for: brought again, it is held, and an event built on it isn't above the heads. A store starts from a checkpoint its operator pins, its events building on the heads the checkpoint was built at. A node starting from a checkpoint must judge the event that named it as every node does; the fold for the tests counts the heads of the checkpoint a state starts from as after the checkpoint current at them, so that it does.
* store: a node's own refusals, and its operator's dropstv26 hours1-0/+126
| | | | | | | | | | Where its history takes an event but the fold has the node refuse it by what it took before (the federation's second version changing one), the store refuses it as its own. An operator may have the node drop events taken after its checkpoint, with everything built on them, and refuse them from then on; what the checkpoint keeps, or holds by ID, isn't dropped, as every event after it builds on that. The operator takes either back by allowing it, and what was refused for being built on it, to be offered again. The fold for the tests shows both with its eras.
* store: a store held in memory, and a fold for its teststv26 hours3-0/+803
| | | | | | | | | | | | | | | A store starts from its root, with the events the root keeps, and holds the events taken after it. An event offered is taken once the store holds its dependencies, where it is above the store's heads (built on an event after them, or on all of them) and the fold takes it at its history: the state its history reads as, folded from the checkpoint. An event waits for what it builds on, and is taken when that comes; one built on a refused event, or whose bytes are none of the fold's, is refused, with what waits for it. The fold made for the tests judges by history (a put refused where its key is locked), reads by what counts (a key's latest put, then the lowest ID), refuses by what a node took before (two eras of one number), and moves to checkpoints (cuts), as the federation does, so that the later stages' tests have something to exercise.
* federation: the feature, and the store's foldtv26 hours2-0/+129
`federation`, a feature of its own, builds what `docs/federation.md` and `docs/store.md` design, stage by stage; without it continuum builds and behaves as it does. The aliases build with it, and `docs/development.md` says so. Its first part is the store's: an event's ID, the SHA-256 of its bytes written as 64 lower-case hex digits and read back only so, and the `Fold` trait as `docs/store.md` gives it. The trait reads a checkpoint's parts too, the heads it was built at and the events it keeps, which a node taking a pinned checkpoint needs; the design names it. Nothing uses either yet, but a test.