Be more specific about what certificate format is expected in NodeMetadataPayload #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a relaxed version of #12 (which will be archived). Here we only changed
NodeMetadataPayload.certificate_bytes
tocertificate_der
to provide a hint on what certificate format is expected. Since certificates are not currently used on Rust side, we can live without deserialization for a while.See comments in #12 about the compatibility problems between Python- and Rust-created certificates. Perhaps it will be somehow fixed in the future, or we will actually need certificate objects on Rust side and will have to deal with the differences.
A compromise would be to just deserialize the certificate on the Rust side, but not expose it - it can be added later, since it won't break backward compatibility. It just feels silly to do all the deserialization work and then not use the resulting object. According to my measurements, doing that increases deserialization time from 68us to 80us - quite noticeable on a relative scale (although it still means that a 1000 nodes, a typical size of our network, are deserialized in under 0.1s, which is negligible compared on the learning loop scale).