Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more specific about what certificate format is expected in NodeMetadataPayload #13

Merged
merged 2 commits into from
Mar 13, 2022

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Mar 13, 2022

This is a relaxed version of #12 (which will be archived). Here we only changed NodeMetadataPayload.certificate_bytes to certificate_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).

@fjarri fjarri added API Related to public API ABI Changes the format of serialized objects labels Mar 13, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2022

Codecov Report

Merging #13 (2c67ec6) into master (82702fc) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #13   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          12      12           
  Lines         423     423           
======================================
  Misses        423     423           
Impacted Files Coverage Δ
nucypher-core/src/node_metadata.rs 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82702fc...2c67ec6. Read the comment docs.

@fjarri fjarri merged commit 193a3c6 into nucypher:master Mar 13, 2022
@fjarri fjarri deleted the der-certificate branch March 13, 2022 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Changes the format of serialized objects API Related to public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants