Skip to content

Commit

Permalink
📝 Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Sep 9, 2023
1 parent 47d593b commit 56d146c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/fault/src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 56d146c

Please sign in to comment.