go-spacemesh
go-spacemesh copied to clipboard
p2p: replace network id with genesis id
part of: https://github.com/spacemeshos/pm/issues/135 depends on: https://github.com/spacemeshos/go-spacemesh/issues/3505
- remove NetworkID from configuration
- initialize p2p.Host with genesis id (pass it to handshake.New)
- replace field in handshake message https://github.com/spacemeshos/go-spacemesh/blob/develop/p2p/handshake/handshake.go#L45 and relevant test
Not sure if handshake field needs to be replaced here? Currently, just setting p2p NetworkId with a uint32(GenesisId) https://github.com/spacemeshos/go-spacemesh/blob/569a1ae8e36451013f9b451fb1c6e318e62f25c9/config/config.go#L217
Why not to use genesis id in the handshake and remove network id as was discussed in the Lane's spec?
Its just naming difference at this point - genesis ID is used as the network id. I think this is compliant with Lane's spec
It reduces genesis id to 4 bytes and calls it network id. This is just some strangeness honestly, can we do a straightforward thing
Yeah, we can do that. Thanks for the input