7 releases (breaking)

new 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

#957 in Magic Beans

Download history 73/week @ 2024-07-15 238/week @ 2024-07-22 80/week @ 2024-07-29 17/week @ 2024-08-05 261/week @ 2024-08-12 132/week @ 2024-08-19 143/week @ 2024-08-26 128/week @ 2024-09-02 118/week @ 2024-09-09 137/week @ 2024-09-16 102/week @ 2024-09-23 289/week @ 2024-09-30 235/week @ 2024-10-07 796/week @ 2024-10-14 89/week @ 2024-10-21 503/week @ 2024-10-28

1,630 downloads per month
Used in 16 crates (4 directly)

Apache-2.0

260KB
6K 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