AleoNet / snarkOS

A Decentralized Operating System for ZK Applications
http://snarkos.org
Apache License 2.0
4.1k stars 2.57k forks source link

[Fix] Guard recursive certificate fetching with `is_synced` check. #3256

Closed raychu86 closed 1 month ago

raychu86 commented 1 month ago

Motivation

This PR prevents nodes from recursively fetching missing certificates, despite syncing via blocks. This should not happen, and the node should focus on syncing via the blocks.

We noticed this edge case where a node would be considered synced for a moment and then start fetching certificates from peers. This cycle can go on for a long time since there may be many certificates to request, however this should be cut short when the node realizes that it should be syncing via blocks instead.