ethereumjs-monorepo
ethereumjs-monorepo copied to clipboard
Client: download header skeleton
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)
This might or might not still be relevant.
@g11tech do you mind having a look here if we still want to keep this issue (please otherwise close)?
@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
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 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! 🙏