-
Notifications
You must be signed in to change notification settings - Fork 33
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
Synchronizer.proposeShielding
crashes when there are insufficient funds to shield
#1420
Labels
bug
Something isn't working
Comments
LukasKorba
added a commit
to LukasKorba/ZcashLightClientKit
that referenced
this issue
May 14, 2024
…en there are insufficient funds to shield - Check for the null value of the pointer when constructing propose shielding
LukasKorba
added a commit
to LukasKorba/ZcashLightClientKit
that referenced
this issue
May 14, 2024
…en there are insufficient funds to shield - Check for the null value of the pointer when constructing propose shielding [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield - throw an error instead of returning nil value
LukasKorba
added a commit
to LukasKorba/ZcashLightClientKit
that referenced
this issue
May 14, 2024
…en there are insufficient funds to shield - Check for the null value of the pointer when constructing propose shielding [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield - throw an error instead of returning nil value [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield - Changelog updated - Error message polished a bit
14 tasks
LukasKorba
added a commit
to LukasKorba/ZcashLightClientKit
that referenced
this issue
May 15, 2024
…en there are insufficient funds to shield - Check for the null value of the pointer when constructing propose shielding [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield - throw an error instead of returning nil value [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield - Changelog updated - Error message polished a bit [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficien… …t funds to shield - Check for the null value of the pointer when constructing propose shielding [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield - throw an error instead of returning nil value [Electric-Coin-Company#1420] Synchronizer.proposeShielding crashes when there are insufficient funds to shield (Electric-Coin-Company#1424) - Refactored the error msg a bit
LukasKorba
added a commit
that referenced
this issue
May 15, 2024
…elding-crashes-when-there-are-insufficient-funds-to-shield [#1420] Synchronizer.proposeShielding crashes when there are insuffic…
#1424 incorrectly resolved this issue. It throws an error when a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #1382 (specifically in 84ac625) we adjusted
Synchronizer.proposeShielding
to returnnull
when there are either no funds to shield, or they do not meet the shielding threshold (equivalent to the Rust typeOption<Proposal>
). However this only altered the API, as the FFI still always created a proposal; the backend changes need to be bundled together separately into binary releases of the-ffi
backend.When the
-ffi
backend was updated to enablezcashlc_propose_shielding
to return an optional proposal, the FFI representation was not hooked up toZcashRustBackend.proposeShielding
at all.The problem is in this code:
zcash-swift-wallet-sdk/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift
Lines 735 to 741 in 31a5848
zcash-swift-wallet-sdk/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift
Lines 760 to 764 in 31a5848
This attempts to construct a
Data
from a null pointer, when it should instead check for nullability and then either returnnull
, or construct theData
from the known-non-null pointer.The bug has been observed very infrequently, most likely because wallets generally only try to shield when there are any funds at all, and in that case the funds are most likely non-trivial in value (and thus above the shielding threshold).
The text was updated successfully, but these errors were encountered: