Skip to content

Commit

Permalink
Improve massa db reset doc (for dev) (#4796)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydhds authored Dec 19, 2024
1 parent 368e7b5 commit 39361b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion massa-db-worker/src/massa_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,14 @@ impl MassaDBController for RawMassaDB<Slot, SlotSerializer, SlotDeserializer> {
}

/// Reset the database, and attach it to the given slot.
///
/// This function is used in the FinalStateController::reset method which is used in the Bootstrap
/// process when the bootstrap fails (Bootstrap slot too old). A bootstrap to another node will likely occur
/// after this reset.
fn reset(&mut self, slot: Slot) {
self.set_initial_change_id(slot);
// For dev: please take care of correctly reset the db to avoid any issue when the bootstrap
// process is restarted
self.set_initial_change_id(slot); // Note: this also reset the field: current_batch
self.change_history.clear();
self.change_history_versioning.clear();
}
Expand Down

0 comments on commit 39361b4

Please sign in to comment.