Skip to content

feat: add WASM host functions (Wasmi version)#6075

Open
mvadari wants to merge 121 commits intoripple/wasmifrom
ripple/wasmi-host-functions
Open

feat: add WASM host functions (Wasmi version)#6075
mvadari wants to merge 121 commits intoripple/wasmifrom
ripple/wasmi-host-functions

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Nov 24, 2025

High Level Overview of Change

This PR adds all the Wasmi integration code and the host functions specified in XLS-102. It also adds tests for all of this.

Note for reviewers: 10k lines of this PR are just WASM-compiled test fixtures, and another 4k lines are WASM test fixture source code. So while this PR is still quite large, it's not as large as it seems on the surface.

Context of Change

This PR depends on #5999 and replaces #5791

It is part of an effort to split up the Smart Escrow work into smaller, more managable-to-review PRs.

XLS-102: XRPLF/XRPL-Standards#303

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

N/A

Test Plan

Several tests are added to this PR.

mvadari and others added 30 commits January 15, 2026 20:14
* add Vector256 nesting/length support

* [WIP] add tests

* fix tests

* simplify with helper function

* oops typo

* remove static variable

* respond to comments

* STBaseOrUInt256->FieldValue

* oops

* add more tests for coverage

* respond to comments
* adjust trace statements

* add helper function

* use lambda instead

* use same paradigm in TestHostFunctions

* oops
* Check wasm return type

* Add more tests
* Switch to series expansion method for ln()
Add float lg() tests to Number tests;
* Rename lg -> log10
* Add check for 0 to log10()
* Ensure request size less than int limit

* Move size check to wasmParams function
* Reject non-canonical binaries

* Review fixes

* Cleanup Number2 class

* Use enum instead of 0
* add readme to src/xrpl/app/wasm

* important block

* respond to copilot
* Add functions with many parameters

* Add 10k locals function

* Module with  5k functions

* fix typo

Co-authored-by: Mayukha Vadari <mvadari@gmail.com>

---------

Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
* clean up some hf code

* fix comments

* fix ubsan

* Revert "fix ubsan"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments