Skip to content
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

librustzcash fails to sync account with birthday set to sapling activation height #1467

Open
AArnott opened this issue Jul 27, 2024 · 4 comments
Labels

Comments

@AArnott
Copy link
Contributor

AArnott commented Jul 27, 2024

After I create an account with a birthday height set to exactly the sapling activation height (419200) or +1 (419201), sync fails with the following error:

status: Unknown, message: "zcashd did not return treestate", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} }

The viewing key I used in the test was as follows, but I don't think that's relevant:

zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz.

librustzcash version: 5a2a670

@AArnott
Copy link
Contributor Author

AArnott commented Jul 27, 2024

I feel like this was already filed and even fixed in the past, but I cannot find the issue for it. But as my version of librustzcash is relatively new (June 12, 2024), it surely would have the fix if one had been made from an earlier report that I was involved in.

@conradoplg
Copy link

Isn't this https://discord.com/channels/809218587167293450/809251029673312267/1233989754014531644?

Which lightwalletd server are you using? This happens if it's using a Zebra release prior to 1.8.0.

@AArnott
Copy link
Contributor Author

AArnott commented Jul 30, 2024

Ah, thank you. I just couldn't find it anywhere. I guess this is a duplicate of ZcashFoundation/zebra#8471.

I'm using my own lightwallet server, which runs against the latest zebra release:

latest: Pulling from zfnd/zebra
Digest: sha256:67d1b09722023a092b4235b700b3448902e45bb68e12e813f30ebf8c672cc9c4
Status: Image is up to date for zfnd/zebra:latest
docker.io/zfnd/zebra:latest

Could this be an issue with a database that was originally created with an older zebra, such that I need to recreate it completely?

@conradoplg
Copy link

Could this be an issue with a database that was originally created with an older zebra, such that I need to recreate it completely?

It should not be the database, since the change was implemented by serializing the response differently.

I tested with the same image you mentioned (67d1b09722023a092b4235b700b3448902e45bb68e12e813f30ebf8c672cc9c4) and it seems to be working:

curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_gettreestate", "params": ["419200"] }' -H 'Content-Type: application/json' http://127.0.0.1:8232
{"result":{"hash":"00000000025a57200d898ac7f21e26bf29028bbe96ec46e05b2c17cc9db9e4f3","height":419200,"time":1540779337,"sapling":{"commitments":{"finalState":"000000"}}},"id":"curltest"}

I'm not sure what is happening. My only suggestion is double-checking to see if you are really connecting to your own zebra-backed lightwalletd server.

AArnott added a commit to nerdcash/Nerdbank.Cryptocurrencies that referenced this issue Oct 20, 2024
Due to zcash/librustzcash#1467, restoring an account from sapling activation height (+0 or +1) fails. But since the underlying bug is related to the fact that no sapling commitment tree had started until +2, we can safely just raise the minimum restore height by +2 so users can restore their accounts with the default minimum height
AArnott added a commit to nerdcash/Nerdbank.Cryptocurrencies that referenced this issue Oct 20, 2024
Raise default/minimum birthday height for account restore

Due to zcash/librustzcash#1467, restoring an account from sapling activation height (+0 or +1) fails. But since the underlying bug is related to the fact that no sapling commitment tree had started until +2, we can safely just raise the minimum restore height by +2 so users can restore their accounts with the default minimum height
@nuttycom nuttycom added the bug label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants