zcash / librustzcash

Rust-language assets for Zcash
Other
335 stars 250 forks source link

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

Open AArnott opened 3 months ago

AArnott commented 3 months ago

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: 5a2a670ffca5d8

AArnott commented 3 months ago

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 commented 2 months ago

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 commented 2 months ago

Ah, thank you. I just couldn't find it anywhere. I guess this is a duplicate of https://github.com/ZcashFoundation/zebra/issues/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 commented 2 months ago

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.