Function check_predicate

Source
pub fn check_predicate<S>(
    state: &S,
    solution_set: Arc<SolutionSet>,
    predicate: Arc<Predicate>,
    get_program: impl GetProgram + Send + Sync + 'static,
    solution_index: SolutionIndex,
    config: &CheckPredicateConfig,
    ctx: Ctx<'_>,
) -> Result<(Gas, Vec<DataOutput>), PredicateError<S::Error>>
where S: Clone + StateReads + Send + Sync + 'static, S::Error: Send,
Expand description

Checks the predicate of the solution within the given set at the given solution_index.

Spawns a rayon task for each of the predicate’s nodes to execute in parallel once their inputs are ready.

NOTE: This assumes that the given SolutionSet and Predicate have been independently validated using solution::check_set and predicate::check respectively.

§Arguments

  • pre_state must provide access to state prior to mutations being applied.
  • post_state must provide access to state post mutations being applied.
  • solution_index represents the solution within solution_set.solutions that claims to solve this predicate.

Returns the total gas spent.