7 releases (breaking)

0.6.0 Nov 5, 2024
0.5.0 Oct 29, 2024
0.4.0 Sep 30, 2024
0.3.0 Aug 13, 2024
0.0.0-release Jul 8, 2024

#26 in #constraint

Download history 101/week @ 2024-09-11 121/week @ 2024-09-18 300/week @ 2024-09-25 98/week @ 2024-10-02 451/week @ 2024-10-09 558/week @ 2024-10-16 292/week @ 2024-10-23 527/week @ 2024-10-30 166/week @ 2024-11-06 204/week @ 2024-11-13 83/week @ 2024-11-20 154/week @ 2024-11-27 79/week @ 2024-12-04 41/week @ 2024-12-11 8/week @ 2024-12-18

140 downloads per month
Used in 7 crates (3 directly)

Apache-2.0

230KB
5.5K SLoC

essential-constraint-vm

Crates.io Documentation license Build Status

The Essential constraint checking VM.


lib.rs:

The essential constraint checking implementation.

Checking Predicates

The primary entrypoint for this crate is the check_predicate function which allows for checking a contract of constraints associated with a single predicate against some provided solution data and state slot mutations in parallel.

Checking Individual Constraints

Functions are also exposed for checking constraints individually.

  • The exec_bytecode, exec_bytecode_iter and exec_ops functions allow for executing the constraint and returning the resulting Stack.
  • The eval_bytecode, eval_bytecode_iter and eval_ops functions are similar to their exec_* counterparts, but expect the top of the Stack to contain a single boolean value indicating whether the constraint was satisfied (0 for false, 1 for true) and returns this value.

Performing a Single Operation

The step_op function (and related step_op_* functions) are exposed to allow for applying a single operation to the given stack. This can be useful in the case of integrating constraint operations in a downstream VM (e.g. the essential state read VM).

Understanding the Assembly

The essential-constraint-asm crate is re-exported as the [asm] module. See [this module's documentation][asm] for information about the expected behaviour of individual operations.

Dependencies

~12MB
~184K SLoC