go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

p2p: replace network id with genesis id

Open dshulyak opened this issue 3 years ago • 5 comments

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

dshulyak avatar Aug 27 '22 05:08 dshulyak

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

WilfredTA avatar Sep 13 '22 14:09 WilfredTA

Why not to use genesis id in the handshake and remove network id as was discussed in the Lane's spec?

dshulyak avatar Sep 14 '22 16:09 dshulyak

Its just naming difference at this point - genesis ID is used as the network id. I think this is compliant with Lane's spec

WilfredTA avatar Sep 14 '22 16:09 WilfredTA

It reduces genesis id to 4 bytes and calls it network id. This is just some strangeness honestly, can we do a straightforward thing

dshulyak avatar Sep 14 '22 17:09 dshulyak

Yeah, we can do that. Thanks for the input

WilfredTA avatar Sep 14 '22 17:09 WilfredTA