stratum-mining / stratum

stratum
https://stratumprotocol.org
Other
224 stars 129 forks source link

Rust Docs + refactor: `protocols` crates #845

Open plebhash opened 7 months ago

plebhash commented 7 months ago

We recently published our protocols crates to crates.io. We need to make sure the APIs provided by those crates are properly documented under the Rust Best Practices.

This is also the perfect opportunity to map and address technical debt on those crates. As we go through the code and try to understand it, we take the chance to write down a list of ways the code could be improved. Things such as:


Task list

Rust Docs

Refactor Implementation

Dependencies graph

rrybarczyk commented 4 months ago

We can leverage the work done in #854 in this effort when we start listing the technical debt for each crate.

jbesraa commented 2 months ago

What do you think about merging all the v2/binary-sv2/** into a single v2/binary-sv2 for the following reason https://github.com/stratum-mining/stratum/issues/1134#issuecomment-2333691340 ?

Fi3 commented 2 months ago

I don't think that this is a good idea as we wouldn't be able to opt out serde anymore

jbesraa commented 2 months ago

Oh sorry maybe my comment was not clear. I was just suggesting to merge them in terms of the effort to document and refactor them, not merge the crates into a single one.

plebhash commented 2 months ago

What do you think about merging all the v2/binary-sv2/** into a single v2/binary-sv2 for the following reason #1134 (comment) ?

As discussed in last week's dev call (sep 10th 2024), binary-sv2/serde-sv2 is a candidate for deprecation. This crate is the only reason we maintain the with_serde feature flag, which is known to be causing some trouble on downstream projects. Therefore it is highly desirable that we eliminate the with_serde feature flag by getting rid of this crate.

So spending time documenting this crate would probably be wasted effort.

The only thing preventing us from deprecating it right now is the fact the MG uses it as a dependency.

plebhash commented 2 months ago

we are starting to write many ideas to our Technical Debt issues

we should allow ourselves room to brainstorm and propose ideas, this is the time to get creative

but when we start doing the actual refactoring PRs, it's of strategic importance that we cultivate a disciplined mindset around Goodhart's Law so we can make the right engineering tradeoffs and compromises

Georges760 commented 4 weeks ago

maybe #1233 can fit in this issue ?