Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions bin/stateless-guest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions bin/stateless-guest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ openvm-stateless-executor = { path = "../../crates/stateless-executor", default-
openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "develop-v2.1.0", default-features = false, features = ["getrandom-unsupported"] }
openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "develop-v2.1.0", optional = true }
openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "develop-v2.1.0", optional = true }
# Defines the 256-bit instruction shims that the patched `ruint` below calls. Nothing here
# references it directly; it is linked in to provide those symbols.
openvm-bigint-guest = { git = "https://github.com/openvm-org/openvm.git", branch = "develop-v2.1.0", features = ["export-intrinsics"] }

# Enable std feature for host builds (provides critical-section implementation)
[target.'cfg(not(any(target_os = "none", target_os = "openvm")))'.dependencies]
Expand All @@ -21,6 +24,12 @@ openvm-stateless-executor = { path = "../../crates/stateless-executor", default-
[package.metadata.cargo-machete]
ignored = ["openvm-algebra-guest", "openvm-ecc-guest"]

# `ruint`'s 256-bit multiply, shifts and comparison each become a single OpenVM instruction
# instead of a limb loop. Only this workspace is patched, because only the guest has the
# instructions; host builds keep the released crate.
[patch.crates-io]
ruint = { git = "https://github.com/Qumeric/uint", rev = "cf03e356e38133ad27ee72644e0c4ef7c8e6433e" }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(openvm_intrinsics)',
Expand Down
3 changes: 3 additions & 0 deletions bin/stateless-guest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#![cfg_attr(not(feature = "std"), no_std)]

use openvm::io::{read, reveal_bytes32};
// Linked for the 256-bit instruction shims it exports, which `ruint` calls. Without a reference
// the rlib is dropped before those symbols reach the link.
use openvm_bigint_guest as _;
use openvm_stateless_executor::{io::StatelessExecutorInput, ChainVariant, StatelessExecutor};

openvm::entry!(main);
Expand Down
Loading