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

equihash: Fix some Rust API issues #1088

Merged
merged 34 commits into from
Jan 26, 2024

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Jan 5, 2024

This is a fully-functional draft, but it contains some extra lint handling and review comments.

Copy link
Contributor Author

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the major changes I've made to the code. The solution allocation type fix is required, everything else is optional.

(There are also a bunch of lints and comments that can be ignored, I'll clean them up when we get a valid solution from the code.)

components/equihash/src/tromp.rs Show resolved Hide resolved
components/equihash/src/tromp.rs Show resolved Hide resolved
components/equihash/src/tromp.rs Outdated Show resolved Hide resolved
components/equihash/src/tromp.rs Outdated Show resolved Hide resolved
components/equihash/src/tromp.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 7, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f3ea80e) 66.52% compared to head (aff6fac) 66.71%.

Files Patch % Lines
components/equihash/src/tromp.rs 98.61% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           equihash-solver-tromp    #1088      +/-   ##
=========================================================
+ Coverage                  66.52%   66.71%   +0.18%     
=========================================================
  Files                        115      115              
  Lines                      10881    10943      +62     
=========================================================
+ Hits                        7239     7301      +62     
  Misses                      3642     3642              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@teor2345
Copy link
Contributor Author

It looks like Windows and macOS need a portable endian.h, so I added a trivial permissively licensed header.

Also Windows didn't like the thread support, which we're not using anyway, so I deleted it.

@teor2345 teor2345 marked this pull request as ready for review January 11, 2024 22:24
@@ -30,23 +31,30 @@ extern "C" {
fn equi_digiteven(eq: *mut CEqui, r: u32, id: u32);
fn equi_digitK(eq: *mut CEqui, id: u32);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're not using threads, we could remove id from all these functions and replace it with zero in C.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes generally LGTM. I'm going to merge this and then do some refactoring / squashing in #1083, to in particular ensure that this is also usable by zcashd (so we can deduplicate the code therein).

@str4d str4d merged commit 8e66e0d into zcash:equihash-solver-tromp Jan 26, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants