#mavryk #smart #rollup #no-alloc #api-bindings #error-code

no-std mavryk-smart-rollup-core

Low-level host function definitions & constants for Mavryk Smart Rollups

1 unstable release

0.2.2 Jul 30, 2024

#7 in #mavryk

Download history 117/week @ 2024-07-28 3/week @ 2024-08-04 26/week @ 2024-08-11 12/week @ 2024-08-18 19/week @ 2024-08-25 13/week @ 2024-09-01 17/week @ 2024-09-08 44/week @ 2024-09-15 30/week @ 2024-09-22 28/week @ 2024-09-29

119 downloads per month
Used in 10 crates (9 directly)

MIT license

29KB
408 lines

Core API for the virtual smart_rollup_core WASM module, exposed by Mavryk Smart Rollups.

About

In order for a kernel to do useful work, it must be able to read input from users, respond with output, and update its internal state. To do so, rollups make a set of C-style host functions available to kernels, which enable:

  • reading from the inbox.
  • writing to the outbox.
  • manipulating durable storage.

This crate provides the definitions of these host functions, including linking to the smart_rollup_core WASM module. In addition, various constants (such as error codes) used when interacting with these host functions, are defined here.

Safety

This crate exposes the host functions through the SmartRollupCore trait, which is unsafe to use - as it makes no effort to provide a safe rust API. A safe API is defined in the mavryk-smart-rollup-host crate, as the Runtime trait.

It's therefore recommended to use the Runtime trait directly from the mavryk-smart-rollup-host crate, or alternatively directly through the mavryk-smart-rollup top-level SDK crate.

Dependencies

~0–0.8MB
~16K SLoC