You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Guard the shielded-tree rebuild FFI export against Rust panics #6455
TL;DR: The FFI function that rebuilds the shielded commitment tree does not catch a Rust panic, unlike the other shielded FFI exports, so a panic inside it would cross the C boundary instead of returning an error to the app.
User story
As an iOS or Android wallet app developer, I want every wallet FFI call to return an error result when Rust panics, to avoid an abort or undefined behaviour in the app.
Scenario
Base flow
The app calls platform_wallet_manager_shielded_rebuild_tree.
Actual behavior
The export has no panic guard. No ordinary rebuild path is known to panic, but a panic would unwind across extern "C".
Expected behavior
A panic is caught and reported through the usual FFI error result, like the other shielded exports.
Detailed discussion
Code: packages/rs-platform-wallet-ffi/src/shielded_sync.rs (platform_wallet_manager_shielded_rebuild_tree). Follow the existing catch_unwind pattern in shielded_send.rs, shielded_wallet_drain.rs and txo_reconcile.rs of the same crate, with a test that a panic maps to the error code.
Activity