We're supposed to do this in 0.3.4. I don't know if there is anything here left to do, but in case there is (like merging to tor, testing more, etc) this is the master ticket.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
I glanced over this with an eye towards the Rust conventions we've been working towards in tor- would it be helpful to do a Rust style/format review now, or wait for some of these other fixes first?
I glanced over this with an eye towards the Rust conventions we've been working towards in tor- would it be helpful to do a Rust style/format review now, or wait for some of these other fixes first?
I don't think there are any major changes left, so I think we would benefit from a rust style review at this point.
To solve i128 miscompilation, we should disable i128 for:
rust stable versions 1.25 and earlier, which don't support i128, and
rust platforms where the unit tests fail because i128 is miscompiled.
(We do the same thing for optimised C code which doesn't work on some platforms.)
I'll look up the rust incantations to define a feature (tor_enable_i128) and submit a patch, hopefully later this week.
I glanced over this with an eye towards the Rust conventions we've been working towards in tor- would it be helpful to do a Rust style/format review now, or wait for some of these other fixes first?
I don't think there are any major changes left, so I think we would benefit from a rust style review at this point.
Sounds good! I will look this over by next Monday, and will use our Rust conventions to compare and also notice where/if we are lacking any guidelines for Rust.
Overall, this is looking good. This review is purely a Rust convention and code quality review, I didn't actually look deeply at how logic is implemented. Doctests and more unit tests would help in being able to do a deeper review for logic though.
As a more meta point, there is a lot of good and very detailed information in our Rust coding standards: tor/docs/HACKING/CodingStandardsRust.md. I would recommend taking a look, particularly for safety if/when this code integrates with tor C code.
Let me know if you want to talk over any of this on irc/etc.
== Types
In several places, it looks like usize is being used interchangeably for integer types (such as test_combination). I would recommend doing a review to ensure if using explicit fixed-size representations would be safer in these cases, as usize is of pointer size, so its size changes depending on the architecture. https://doc.rust-lang.org/std/primitive.usize.html.
== Documentation
Doctests should probably be added to all public functions- this is helpful for both documenting the code and also verifying that the documentation is valid.
Per our Rust coding standards (in tor/docs/HACKING/CodingStandardsRust.md, #[deny(missing_docs)] must be included
== External Dependencies
I see that this crate depends on several external crates. rust-crypto states that it doesn't have strong security guarantees- is there something else that we should be using? https://crates.io/crates/rust-crypto.
Should we have an auditing process for when we choose to import/use new external crates?
How will this code be executed? Will something in core Tor call into these public functions? If so, where is the FFI layer?
Should any logging be added to this module?
Will this code call into Tor's C code at all? It doesn't currently but I was curious if there are plans for this in the case of the code moving into the core tor codebase.
I see a couple modules without unit tests (client, data). Per our coding standards, all code must be unit and integration tests. For extremely basic functions, doctests are likely sufficient (such as to string methods) but this should be in only in extremely simple cases and not the default.