-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Over the past few days, I've been working on implementing a Native Android light client for CKB,
and I have everything setup, till I hit a wall with the SharedArrayBuffer Limitation.
The official CKB light client WASM implementation requires SharedArrayBuffer for its storage layer (IndexedDB operations and multi-threaded execution).
The problem: Android WebView does not support SharedArrayBuffer, even with proper COOP/COEP headers set. This is a fundamental WebView limitation that cannot be worked around.
What happened:
✅ WASM module loads successfully
✅ All functions detected and callable
✅ Correct API parameters discovered
❌ Runtime panic: "called Option::unwrap() on a None value" in browser.rs:108
→ Storage initialization fails due to missing SharedArrayBuffer
The WASM client requires cross-origin isolation to enable SharedArrayBuffer, which is impossible(I don't know if there's a way around this) in Android WebView's security model.
TL;DR: Tried WASM approach, hit WebView limitations. Two paths forward: (1) Native Rust with JNI (proper, 4 weeks), or (2) Simple RPC client (quick demo, works now already tested this). Need your input on priorities.