near / nearcore

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

[state sync] Update sync actor to use p2p state part transfer #12002

Open saketh-are opened 2 months ago

saketh-are commented 2 months ago

The previously implemented peer selection mechanism in SnapshotHostsCache will be used to select the peers from which parts should be requested.

For each state part, the sync actor will first make a fixed number of attempts to obtain the part from different peers in the network. If that fails, it will fall back to obtaining the part from the centralized cloud hosting location.

We will add some metrics to monitor the number of requests served from the two sources with the ultimate goal of deprecating the centralized option.