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
Rolling back stake pools take ages #1281
Comments
Looks good in terms of stake pools. Question: is this expected? 👇 I've repeated steps above slightly modified:
For version For current
and then:
|
That the wallet worker exits, is normal and the expected behavior. The problem is the following: If the genesis hashes are different, it means that we are so-to-speak on a different blockchain. So we have two choices:
I've chosen to go for the second (also seconded by @jonathanknowles on this decision). The rationale is that, if it's a different chain, it's also a different wallet even if the mnemonic is the same. It's also best to be explicit because, you may be surprise that nothing was reported on the server but it seems that transactions are missing from your wallet or whatever... Not realizing you are on the wrong chain can take some debugging time, whereas here, the worker explictely exits telling you that the genesis hashes were different. Having said that.... the "Something went wrong" when listing wallets afterwards is not cool and not really expected. Seems like the workers being terminated has some effect on the API result which really shouldn't be the case. We should look into this, although pretty minor. |
OK. Issue created -> #1292. |
Context
Steps to Reproduce
Expected behavior
Actual behavior
Resolution
Why is this happening? Because:
a) The stake pool monitoring doesn't clean up old checkpoints.
b) In case where the chain follower is unable to find a suitable intersection, it'll instrument the client to enter in a "recovery" mode, by first, asking it to rollback to the oldest known checkpoint in the current window. If there's no older checkpoint, it recover from genesis.
Because the stake pool monitoring doesn't clean up old checkpoints and because a new window is used after every rollback, the monitoring algorithm will make small hops of 10 blocks by 10 blocks until it finds an intersection point, which could possibly be many many blocks in the past.
In theory, this shouldn't be an issue if the chain follower is at least of length
k = epoch stability
, but since Jörmungandr doesn't abide by thek
parameter, an intersection point can be arbitrarily far in the past.Possible resolutions:
a.
Clean up old checkpoints in the stake pool monitoring to allow rolling back to genesis when relevant==> hard to do correctly without deeper changes in the database schemas (we need the block height for this).b.
Tweak the chain follower such that the recovery doesn't first attempt to rollback to the latest known checkpoint, but instead, directly try to rollback to genesis (the rationale is that, this first attempt to rollback to the latest known checkpoint is more of a desperate move to avoid rolling back from genesis...)==> not 100% sure about the consequences and UX for wallets.c. Increase the size of the window for Jörmungandr to be arbitrarily bigger (haskell nodes uses k=2160). ==> #1285
QA
The text was updated successfully, but these errors were encountered: