-
Notifications
You must be signed in to change notification settings - Fork 244
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
Some refactorings to sc-consensus-subspace #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules separation makes a lot of sense, but I'm not so sure about splitting verification into multiple functions that just convert boolean to Result<>
, it seems to me that it only makes it harder to read as a whole when things are split so far.
@@ -26,7 +26,7 @@ use sp_core::Public; | |||
use sp_runtime::{traits::DigestItemFor, traits::Header, RuntimeAppPublic}; | |||
use subspace_archiving::archiver; | |||
use subspace_core_primitives::{crypto, Piece, Randomness, Salt, Sha256Hash}; | |||
use subspace_solving::SubspaceCodec; | |||
use subspace_solving::{derive_global_challenge, derive_local_challenge, SubspaceCodec}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an intentional decision to not import functions in the codebase anywhere. They often have generic names and thus it makes sense to instead import a module they are contained in (think channel()
vs mpsc::channel()
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair for some common topics, but not sure it's wise to apply it globally default.
|
7f6150e
to
b8d3c5f
Compare
Also make SubspaceSlotWorker `pub(super)`.
8881323
to
6427acf
Compare
Part of #80.
This PR refactors
verify_solution
and separates outauthorship.rs
andarchiver.rs
(no code changes in these new modules) in sc-consensus-subspace, for better maintainability and future refactorings. Should be reviewed per commit.