Electric-Coin-Company / zcash-swift-wallet-sdk

iOS light client Framework proof-of-concept
MIT License
37 stars 33 forks source link

Check continuation of UpdateChainTip repeated call #1227

Closed LukasKorba closed 8 months ago

LukasKorba commented 9 months ago

UpdateChainTip action is now called after enhance instead of download. This action decides if 10min threshold passed so chain tip must be updated and afterwards the sync "restarted". So far this continuation is done and seems to work but there might be hidden thing - ClearCache is not called and I wonder if sync can get into some inconsistent or even broken state. Why?

Scenario: There's a chainTip scan range, let's say 200k blocks. If 10mins is hit during this range sync, it will probably be somewhere inside it, some blocks are downloaded, blockDownloader is working in parallel, some blocks are scanned.. The State Machine is done in a way that heavily depends on ClearCache being called with every range run. Right now it's not doing the ClearCache with these (and every) 10mins "restarts".

This needs to be double-checked.

LukasKorba commented 9 months ago

When tested the mainnet sync, I got to 70% with no issues. When I tried the same with testnet, sync failed with following error. May be connected to this issue.

Screenshot 2023-09-04 at 9 43 43
zookozcash commented 9 months ago

Good catch, Lukas!

LukasKorba commented 8 months ago

Resolved