Skip to content

Conversation

@uncomputable
Copy link
Collaborator

Upgrades the FFI to work with WASM.

Remove dependency on libc. Fix definition of UWORD, which is u16 on WASM != u32 = usize. Prepare for wrapped jets.

Bind all C types that are used in libsimplicity. Prefix these types with
c_. Define types like UWORD by these types, like in the C code. Verify
these types in unit tests.
Remove dependency on libc
Disabled because file doesn't exist yet.
@uncomputable
Copy link
Collaborator Author

Rebased onto master. Extended the existing C type definitions and tests. Removed wrapper.h because the file will be vendored.

@apoelstra
Copy link
Collaborator

utACK f7de51e.

Will run my local CI (though this does not include any wasm testing, at least for now). Would you like this to be merged or do we want to wait for wrappers.h to be changed upstream?

/* This file has been automatically generated. */

use std::ffi::c_void;
use crate::ffi::c_void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 8e7f59b:

You are not allowed to change this file directly. It needs to be changed upstream and then pulled in by the vendoring script.

@uncomputable
Copy link
Collaborator Author

uncomputable commented Feb 6, 2024

Let's merge this PR first and then match the changes in BlockstreamResearch/simplicity#218. Feel free to run your test suite

@apoelstra
Copy link
Collaborator

My test suite will not pass if you are modifying files that originate in the upstream library.

@uncomputable uncomputable merged commit 3cb2faf into BlockstreamResearch:master Feb 7, 2024
@uncomputable uncomputable deleted the wasm-ffi branch February 7, 2024 12:52
@apoelstra apoelstra mentioned this pull request Feb 15, 2024
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.

2 participants