Skip to content
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

Mirror Select for FastSync #958

Open
petzsch opened this issue Nov 22, 2024 · 0 comments
Open

Mirror Select for FastSync #958

petzsch opened this issue Nov 22, 2024 · 0 comments

Comments

@petzsch
Copy link
Contributor

petzsch commented Nov 22, 2024

(follow up to the discussion on #957)

I would like to propose that we distribute the mainnet and perhaps testnet snapshots used for FastSync globally. (used to be: slow download rates from contabo s3 bucket, sea cable between Germany and Finland cut, slow downloads between USA and Finland potentially)

Since the load-utxo script should validate the sha256 file hashes, it shouldn't pose any risk to distribute these files.

In a first p.o.c. I've build a server based GeoIP logic to calculate the distance between the remote_ip and the download servers and redirect to the nearest download server. This approach is still not ideal. (it doesn't know the actual download speeds which would be more relevant)

As an alternative, I would like to explore a client based approach:

Downloading the first 100 Bytes (potentially we need a bit more) from each mirror and measuring the execution time:

root@server:~/mirrorselect# /usr/bin/time --format '%E' --output=btcpay.tech.time curl -s --output /dev/null -r 0-99 https://snapshots.btcpay.tech/utxo-snapshot-bitcoin-mainnet-867690.tar
root@server:~/mirrorselect# /usr/bin/time --format '%E' --output=vienna.btcpay.host.time curl -s --output /dev/null -r 0-99 https://vienna.btcpay.host/utxo-snapshot-bitcoin-mainnet-867690.tar
root@server:~/mirrorselect# cat btcpay.tech.time
0:00.25
root@server:~/mirrorselect# cat vienna.btcpay.host.time
0:00.14

Before starting to build something for this issue, I would like to have the following questions cleared/discussed:

  • Is it safe to give mirroring of the snapshot files in the hands of 3rd partys (like myself) | Are we safe against manipulation thanks to the trusted sha256 hashes?
  • Are there any established scripts/best practises for this problem?
  • Do we want to move forward with the server based approach?
  • Do we want to implement the mirror select logic (see example above) client based?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant