dominant-strategies / go-quai

Official Go Implementation of the Quai Network
GNU General Public License v3.0
2.36k stars 456 forks source link

[LibP2P] Mismatch in genesis hash between Libp2p and Core #1842

Closed Djadih closed 2 weeks ago

Djadih commented 1 month ago

The way we generate the genesis hash in core using headerchain and lookup by number is different than the way we do it in libp2p which reads from the config and constructs a block (lib2pp does not have access to the database on startup).

This leads to different hashes in the topic names vs the actual genesis.

Djadih commented 2 weeks ago

Ran into a separate issue related to this, which is that the genesis hash also doesn't take into account nonce, extraData, or gaslimit and the networks will have the same genesis hash which could lead to sharing peers. The root cause seems to be that on startup we only get the genesis header (which doesn't contain those fields), instead of the full block. This is despite requesting the block view.