mana-ethereum / mana

Ethereum full node implementation written in Elixir.
Other
274 stars 47 forks source link

Connect Warp Sync to Proper Packets #692

Open hayesgm opened 5 years ago

hayesgm commented 5 years ago

This patch connects Warp Sync to the correct packets that come back from Parity when warp syncing. There were a few issues with the algorithm for determining packet ids. It appears that each capability has a size (to allow for protocol upgrades) and we skip that many before the next protocol. These aren't documented from come by Parity's source code. Additionally, it appears that once you negotiate a protocol, you still use the offests from Pv62 but from the higher negotiated ids. It's all a bit weird, but this seems to get everything working. Finally, we had an issue with default map getting called a lot, so we instead opt to hard-code the value and try to pass nil around instead of default map.

hayesgm commented 5 years ago

@willmeister Was this otherwise addressed in a different PR that you made?