-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugin-keychain-memory-wasm): add WebAssmebly PoC #1463
Conversation
Adding a new keychain in-memory plugin that has it's implementation written in Rust that is then compiled down to WebAssmebly via wasm-pack and used by the wrapper Typescript code. This is NOT meant for production because it stores everything in plain text and also provides zero durability/persistence guarantees given that it's only storing everything in memory. The actual news here is that we have a plugin now written in Rust which is the pre-cursor to us being able to do something similar with the Weaver relay component as the next phase of a bigger PoC. The reason why not the entire plugin is implemented in Rust is because we are unable to hook up ExpressJS request handlers from the Rust code as far as I could determine. See this link for further details on this: https://rustwasm.github.io/book/reference/js-ffi.html#from-the-rust-side Because of the above, the way it works is this: +--------+ API Request +----------+ | HTTP |-------------->| ExpressJS| | Client | +----------+ +--------+ Method| Call | v +---------+ Method Call +----------+ | Calling |------------->|JS Plugin | | Module | |Module | +---------+ +----------+ |get() |set() |has() |delete() +-------------+ | | Wasm Plugin |<---+ | Module | +-------------+ ^ | | v +------------------------+ |Rust Native | |HashMap<String, String> | +------------------------+ Resolves hyperledger-cacti#1281 Signed-off-by: Peter Somogyvari <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1463 +/- ##
==========================================
- Coverage 71.82% 71.20% -0.62%
==========================================
Files 317 331 +14
Lines 11568 12080 +512
Branches 1416 1455 +39
==========================================
+ Hits 8309 8602 +293
- Misses 2477 2675 +198
- Partials 782 803 +21
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petermetz am I correct in assuming that this is a refactoring of existing plugin, not a totally new plugin?
@izuru0 Yup, that's right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adding a new keychain in-memory plugin that has it's implementation
written in Rust that is then compiled down to WebAssmebly via wasm-pack
and used by the wrapper Typescript code.
This is NOT meant for production because it stores everything in plain
text and also provides zero durability/persistence guarantees given that
it's only storing everything in memory.
The actual news here is that we have a plugin now written in Rust which
is the pre-cursor to us being able to do something similar with the
Weaver relay component as the next phase of a bigger PoC.
The reason why not the entire plugin is implemented in Rust is because
we are unable to hook up ExpressJS request handlers from the Rust code
as far as I could determine. See this link for further details on this:
https://rustwasm.github.io/book/reference/js-ffi.html#from-the-rust-side
Because of the above, the way it works is this:
Resolves #1281
Signed-off-by: Peter Somogyvari [email protected]