ethereumjs-monorepo icon indicating copy to clipboard operation
ethereumjs-monorepo copied to clipboard

Client: download header skeleton

Open vpulim opened this issue 6 years ago • 1 comments

Currently, we download headers from multiple peers in parallel, but if one or more peers is bad or on a different fork it will break the header chain. Instead, we should download a header skeleton from the origin peer, and use it to ensure chunks of headers we download from other peers are valid before we import them. We also need to handle the case where the origin peer itself is bad or on a fork. In this case, we won't be able to find valid headers from any other peers and need to re-start the sync with another origin peer.

See this go-ethereum PR for a more detailed explanation of the approach: https://github.com/ethereum/go-ethereum/pull/2315

  • [ ] Download skeleton and fill
  • [ ] Detect invalid/malicious peer (ban origin peer & restart sync)
  • [ ] Detect non-canonical fork (ban origin peer & restart sync)

vpulim avatar Nov 13 '18 10:11 vpulim

This might or might not still be relevant.

holgerd77 avatar Jul 04 '22 16:07 holgerd77

@g11tech do you mind having a look here if we still want to keep this issue (please otherwise close)?

holgerd77 avatar Sep 20 '22 08:09 holgerd77

@g11tech do you mind having a look here if we still want to keep this issue (please otherwise close)?

yes @holgerd77 most probably this is taken care of, will check and update

g11tech avatar Sep 20 '22 15:09 g11tech

yes handled in while syncing forward (pre-merge)

  • https://github.com/ethereumjs/ethereumjs-monorepo/pull/2230

else beacon sync's skeleton handled here: https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/sync/fetcher/reverseblockfetcher.ts#L61

Both cases lead to banning of peer and sync tries to sync from other peers

g11tech avatar Sep 20 '22 16:09 g11tech

@g11tech do you mind having a look here if we still want to keep this issue (please otherwise close)?

yes @holgerd77 most probably this is taken care of, will check and update

Thanks! 🙏

holgerd77 avatar Sep 21 '22 12:09 holgerd77