Skip to content
New issue

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

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

Already on GitHub? # to your account

Add distributed PoSt API #135

Merged
merged 19 commits into from
Oct 6, 2020
Merged

Add distributed PoSt API #135

merged 19 commits into from
Oct 6, 2020

Conversation

cryptonemo
Copy link
Contributor

@cryptonemo cryptonemo commented Sep 17, 2020

Relies on filecoin-project/rust-fil-proofs#1283 and filecoin-project/rust-filecoin-proofs-api#41

This work does NOT yet include the proofs.go updates required. I will look at that next unless @magik6k or @Kubuxu can get to it quicker.

@dignifiedquire This may have issues, but I fixed the specific nastiness I was fighting earlier.

@cryptonemo
Copy link
Contributor Author

cryptonemo commented Sep 17, 2020

Hrm, I don't understand the CI darwin error and didn't locally get the clippy warning, but can look at tomorrow. Fixed

@vmx
Copy link
Contributor

vmx commented Sep 18, 2020

@nemo You need to run clippy with the -all-targets flag. The CI runs clippy --all-targets --all-features -- -D warnings

@cryptonemo
Copy link
Contributor Author

Wow, this CI took forever but passed! Still missing is the glue in proofs.go that wrap the new calls. Anyone want to help there?

@cryptonemo
Copy link
Contributor Author

@magik6k or @Kubuxu Would either of you guys be able to provide the proofs.go glue to do the final wiring to the newly generated methods? I honestly think it should be painless, but it's taking me too long struggling with the go side (just don't know it, and banging around isn't working).

@cryptonemo
Copy link
Contributor Author

Nice work, thanks @Kubuxu!

@Kubuxu
Copy link

Kubuxu commented Oct 1, 2020

@cryptonemo this is done as far as go side goes.

@cryptonemo
Copy link
Contributor Author

@Kubuxu This tests well here. I think we are good to go on both sides now! @porcuquine or @dignifiedquire for final approval?

Jakub Sztandera added 3 commits October 5, 2020 12:17
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
clone.proof_ptr as *mut core::ffi::c_void,
self.proof_ptr as *const core::ffi::c_void,
self.proof_len,
);
Copy link
Contributor

@dignifiedquire dignifiedquire Oct 6, 2020

Choose a reason for hiding this comment

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

while the above works, it should be safer and less error prone to do

let slice: &[u8] = unsafe { std::slice::from_raw_parts(self.proof_ptr, self.proof_len) };
let cloned: Vec<u8> = slice.to_vec();
debug_assert_eq!(self.proof_len, cloned.len());

let proof_ptr = cloned.as_ptr();
mem::forget(cloned);

fil_VanillaProof {
  proof_len: self.proof_len,
  proof_ptr,
}

this way it is guranteed that reconstructing this will actually work as expected

Copy link
Contributor

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

one comment, other than that looks good to me

@cryptonemo cryptonemo merged commit a62d00d into master Oct 6, 2020
@cryptonemo cryptonemo deleted the expose-dpost branch October 6, 2020 12:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants