Skip to content

Build realloc-clock SBF in tests and remove bundled artifact#2

Open
jflatow wants to merge 1 commit intocodex/create-native-deno-bindings-for-litesvmfrom
codex/investigate-sys-calls-usage-in-litesvm
Open

Build realloc-clock SBF in tests and remove bundled artifact#2
jflatow wants to merge 1 commit intocodex/create-native-deno-bindings-for-litesvmfrom
codex/investigate-sys-calls-usage-in-litesvm

Conversation

@jflatow
Copy link
Copy Markdown

@jflatow jflatow commented Jan 22, 2026

Motivation

  • Remove the committed SBF shared-object artifact because bundling the .so in the repo is not supported and leads to stale artifacts.
  • Provide a small SBF test program that exercises realloc and the Clock sysvar so the Deno bindings can call real syscalls during tests.
  • Ensure Deno tests build the SBF program at test time to keep the binary and tests synchronized.

Description

  • Removed the bundled realloc_clock.so from crates/deno-litesvm/program_bytes and updated the Deno test to load the locally-built binary at ../litesvm/test_programs/target/deploy/realloc_clock.so in crates/deno-litesvm/syscall_clock.test.ts.
  • Added a new SBF test program realloc-clock under crates/litesvm/test_programs/ with a Cargo.toml and src/lib.rs implementing process_instruction that computes a checksum over a realloc-sized buffer and reads Clock::get() into account data.
  • Added realloc-clock to the crates/litesvm/test_programs workspace and updated the lockfile entries accordingly.
  • Updated crates/deno-litesvm/Makefile to run cargo build-sbf (configurable via SBF_BUILD_FLAGS) in the test target before invoking deno test so the program is built automatically.

Testing

  • Ran cargo build-sbf --skip-tools-install --manifest-path ../litesvm/test_programs/realloc-clock/Cargo.toml, which completed successfully and produced the deployable .so.
  • Ran deno test -A --unsafely-ignore-certificate-errors mod.test.ts client.test.ts syscall_clock.test.ts, which completed successfully.
  • Executed the make test workflow in crates/deno-litesvm, which required installing cargo-build-sbf in the environment and then succeeded when re-run.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant