near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 619 forks source link

[state sync][bug] Cancel old state sync if node is started in the new epoch. #11650

Open VanBarbascu opened 3 months ago

VanBarbascu commented 3 months ago

Currently, if a node started state sync in epoch A and it cannot finish syncing by the end of that epoch, it will keep trying. If the node is restarted in another epoch B, the node should see that there is an ongoing state sync for epoch A, cancel it and start a state sync for epoch B.

For cloud based state sync, the node will still function but it will take longer to sync all the blocks from epoch A to the current epoch.

For DSS, the node will not be able to finish state sync because no peer will be able to share parts for an old epoch.