Closed l0k18 closed 1 year ago
At the very last part of getting this done, the Reverse messages and the size of the headers being now variable has come up. Previously it was fixed, with netip.AddrPort
slice length of 18, being 16 bits IPv6 address and 2 bytes port number, the encoding was fixed, now it is variable.
As such, the entire edifice of the splitting between header and payload has to be rewritten and a new message type needs to be added below the crypt to indicate the payload offset.
This was going to be done afterwards but it now proves to be completely necessary to do now.
Avoids a lot of unnecessary transformations. The binary codec of multiaddr is probably more efficient and obvious for the wire encoding. There is quite a few places where netip.AddrPort is being used so this is a fairly extensive refactor.