From 56d146c565de126e4428f3144ea924de53b864e7 Mon Sep 17 00:00:00 2001 From: clabby Date: Sat, 9 Sep 2023 12:12:16 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fault/src/solver.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/fault/src/solver.rs b/crates/fault/src/solver.rs index 9b298f4..5fe2d97 100644 --- a/crates/fault/src/solver.rs +++ b/crates/fault/src/solver.rs @@ -64,7 +64,15 @@ where } } - #[inline] + /// Finds the best move against a [crate::ClaimData] in a given [FaultDisputeState]. + /// + /// ### Takes + /// - `world`: The [FaultDisputeState] to solve against. + /// - `claim_index`: The index of the claim within the state DAG. + /// - `attacking_root`: A boolean indicating whether or not the solver is attacking the root. + /// + /// ### Returns + /// - [FaultSolverResponse] or [Err]: The best move against the claim. fn solve_claim( &self, world: &mut FaultDisputeState, @@ -103,6 +111,10 @@ where e })?; + // TODO(clabby): Consider that because we'll have to search for the pre/post state for the + // step instruction, we may also need to know if all claims at agreed levels are correct in + // the path up to the root claim. + let move_direction = if self_state_hash == claim.value { // If the local opinion of the state hash at the claim's position is the same as the // claim's opinion about the state, then the proper move is to defend the claim.