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

wait for zebrad or zcashd to reach sapling activation height #490

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

LarryRuane
Copy link
Collaborator

This has been broken for a long time. If, when starting up, lightwalletd discovers that the backend node (zebrad or zcashd) has not yet synced to the Sapling activation height (419200 for mainnet, 280000 for testnet), it should wait until that happens, then sync along with the backend node. But instead, lightwalletd gets stuck indefinitely. The only way to escape the hang is to stop and restart lightwalletd (after the backend has passed Sapling activation).

This commit fixes the problem; the block ingestor retries every 2 minutes (which was always the intention), rather than trying once and then giving up.

This bug isn't activated often; usually when lightwalletd starts, the backend node has already synced beyond the Sapling activation height. (That's why this bug wasn't noticed until now; I noticed it while testing lightwalletd with zebrad for a different PR.)

I tested this PR on both mainnet and testnet.

This has been broken for a long time. If, when starting up, lightwalletd
discovers that the backend node (zebrad or zcashd) has not yet synced to
the Sapling activation height (419200 for mainnet, 280000 for testnet),
it should wait until that happens, then sync along with the backend
node. But instead, lightwalletd gets stuck indefinitely. The only way
to escape the hang is to stop and restart lightwalletd.

This commit fixes the problem; the block ingestor retries every 2
minutes (which was always the intention), rather than trying once and
then giving up.
@LarryRuane LarryRuane added the bug Something isn't working label Jul 9, 2024
@LarryRuane LarryRuane self-assigned this Jul 9, 2024
@@ -464,8 +464,8 @@ func BlockIngestor(c *BlockCache, rep int) {
c.Sync()
Log.Info("Waiting for zcashd height to reach Sapling activation height ",
"(", c.GetFirstHeight(), ")...")
Time.Sleep(20 * time.Second)
return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual bug is that here we're exiting the block ingestor thread, which is supposed to run forever. Nothing ever starts it up again.

Copy link
Collaborator

@str4d str4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@LarryRuane LarryRuane merged commit f24e029 into zcash:master Jul 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants