Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SDK does not distinguish "failed to communicate with lightwalletd" from "lightwalletd returned an error" #1516

Open
str4d opened this issue Jul 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@str4d
Copy link
Contributor

str4d commented Jul 3, 2024

See Electric-Coin-Company/zashi-android#1422 as an example:

CompactBlockProcessor.emit(): Syncing process starts for batch: BlockBatch(order=1, range=BlockHeight(value=419201)..BlockHeight(value=419300), blocks=null)
                            main                           CompactBlockProcessor.fetchTreeStateForHeight$zcash_android_sdk_2_1_2_release(): Starting to fetch tree state for height 419200
app_time_stats: avg=3437.46ms min=3437.46ms max=3437.46ms count=1
Networking error: UNKNOWN: zcashd did not return treestate
                            main                           CompactBlockProcessor.fetchTreeStateForHeight$zcash_android_sdk_2_1_2_release(): Tree state fetch failed (Ask Gemini)
java.lang.Throwable: Communication failure with details: 2: zcashd did not return treestate

zcashd did not return treestate is an error that lightwalletd can return from the GetTreeState method: https://github.com/zcash/lightwalletd/blob/6e3816b5834583c492c37ce05b0faaf9fe12c87f/frontend/service.go#L288-L290

If this error is received, it means we successfully communicated with lightwalletd, i.e. there was no networking error.

The SDK should have a separate error type for lightwalletd errors, so that downstream SDK users are not misled into thinking this is an issue with the client phone's networking.

@str4d str4d added the bug Something isn't working label Jul 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant