4 releases (breaking)

0.3.0 Aug 13, 2024
0.2.0 Jul 24, 2024
0.1.0 Jul 8, 2024
0.0.0-release Jul 8, 2024

#24 in #constraint

Download history 348/week @ 2024-07-07 86/week @ 2024-07-14 234/week @ 2024-07-21 81/week @ 2024-07-28 21/week @ 2024-08-04 251/week @ 2024-08-11 139/week @ 2024-08-18 128/week @ 2024-08-25 138/week @ 2024-09-01 127/week @ 2024-09-08

542 downloads per month
Used in 9 crates (4 directly)

Apache-2.0

170KB
4K 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
~182K SLoC