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

Round-trip additional fields in public keys.

Open Stebalien opened this issue 7 years ago • 3 comments
trafficstars

We need to make sure we can decode and then re-encode public keys back into the same datastructure. That means preserving unknown fields (which I believe we don't currently do).

Stebalien avatar Nov 14 '18 20:11 Stebalien

Is this the case @marten-seemann? I saw this issue mentioned in this test: https://github.com/ipfs/boxo/blob/dc731cae2345b8f1842e2595aeff9641db5f6ac3/ipns/validate_test.go#L145-L179

But if I remove the Skip, the test works. So I don't think this is an issue anymore.

hacdias avatar May 10 '23 09:05 hacdias

I think it still is, since we're encoding it as a Protobuf, and the parser will ignore unknown fields. So if you want to preserve unknown fields, you'd need to save the serialized version as well.

marten-seemann avatar May 10 '23 10:05 marten-seemann

Intriguing. I guess I would need more information about the original issue in the original test to understand the problem since the test passes. Maybe the problem was related to something else that was fixed in the meanwhile.

hacdias avatar May 10 '23 10:05 hacdias