erigon icon indicating copy to clipboard operation
erigon copied to clipboard

Erigon must self-heal from “Waiting for torrents metadata: 121/122“ state

Open AskAlexSharov opened this issue 3 years ago • 10 comments

  • If add to snapshots folder bad .torrent file (no peers), or if start erigon with one https://github.com/ledgerwatch/erigon-snapshot/blob/main/goerli.toml#L3 , then change some hash there and start erigon with new goerli.toml file
  • Erigon now stuck in this state. But likely Erigon can detect such problem and self-heal. By force verify or by check that all files are available in goerli.toml, or somehow else

AskAlexSharov avatar Aug 13 '22 15:08 AskAlexSharov

Arent we already verifying after we start erigon?

enriavil1 avatar Aug 16 '22 12:08 enriavil1

Arent we already verifying after we start erigon?

yes, but this issue is not about "some snapshot was broken", this issue is about "by some reason we have wrong/old/buggy .torrent file in snapshots dir which nobody in network seed".

There are 2 type of .torrent files:

  • some are hardcoded in https://github.com/ledgerwatch/erigon-snapshot
  • and also erigon producing new snapshots (during normal work) and seed them (and create for them .torrent files in snapshots dir)

it means having .torrent files which are not in whitelist - is generally ok if we produced them. but if user added manually .torrent file there(it's valid use-case - when user restore snapshots dir from backup or copy it to another server), or if old version of erigon created wrong .torrent file - then erigon will try to download them and never complete because nobody seed them.

AskAlexSharov avatar Aug 16 '22 12:08 AskAlexSharov

But!

Now I realized next logic is correct:

  • Erigon must try to download only whitelisted .torrent files
  • Erigon can seed .torrent files if they are not whitelisted

and Waiting for torrents metadata: 121/122 means Erigon trying to download not-whitelisted .torrent file, which is wrong.

AskAlexSharov avatar Aug 16 '22 12:08 AskAlexSharov

Meaning Erigon should never be able to finish downloading since they are not whitelisted torrent files. What if someone wants to use their own snapshots?

enriavil1 avatar Aug 16 '22 12:08 enriavil1

To summarise:

  • Erigon must not try to download files if they are not whitelisted in https://github.com/ledgerwatch/erigon-snapshot
  • even if user manually created .torrent file in snapshots dir

AskAlexSharov avatar Aug 16 '22 12:08 AskAlexSharov

What if someone wants to use their own snapshots? - just place custom snapshots to snapshots dir. 1. use and seed non-whitelisted snapshots is fine 2. download non-whitelisted snapshots not fine.

AskAlexSharov avatar Aug 16 '22 12:08 AskAlexSharov

Well we still have the issue that sometimes downloader gets stuck at "Waiting for torrents metadata: 122/122" so maybe we should change it to that.

enriavil1 avatar Aug 16 '22 12:08 enriavil1

It’s another story. Never seen. But yes, need fix it somehow - if it happening

AskAlexSharov avatar Aug 16 '22 12:08 AskAlexSharov

I believe it still happening because we have not changed anything, but it hasn't happened to me for a while

enriavil1 avatar Aug 16 '22 12:08 enriavil1

@enriavil1 maybe this is the reason: https://github.com/ledgerwatch/erigon/issues/4979

AskAlexSharov avatar Aug 17 '22 02:08 AskAlexSharov

This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.

github-actions[bot] avatar Sep 26 '22 04:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Oct 05 '22 03:10 github-actions[bot]