This commit is contained in:
Matthew LeVan 2023-06-15 14:24:05 -04:00
parent fdb2d860f8
commit 52f76bc933

View File

@ -2096,6 +2096,28 @@ _cw_play(c3_i argc, c3_c* argv[])
u3C.wag_w |= u3o_hashless;
// replaying events with the epoch system
//
// there should be one process that accounts for what is actually available
// in the pier and replays the least events possible to produce a valid,
// up-to-date snapshot.
//
// this replay process also uses the chk/ folder as a place to
// "accumulate" snapshots over the course of a replay if it needs to,
// overwriting the existing .bin files as it goes.
//
// 0. try loading the snapshot in chk/
// a. if it is valid and up-to-date with the log
// i. if we executed via `urbit play`, exit 0
// ii. if we executed via `urbit`, boot into live mode
// b. if it is invalid, try loading a snapshot from
// i. the snapshot in the latest epoch
// 1. if it is valid, replay the events and save the resulting
// snapshot into chk/, exit 0 or boot into live mode as before
// 2. if it is invalid, return an error that informs the user of
// his need for a serious surgical operation
//
// XX this should restore the epoch snapshot and replay that
//
if ( c3y == ful_o ) {