-
Notifications
You must be signed in to change notification settings - Fork 46
Ipfs verification bounty #166
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
Ipfs verification bounty #166
Conversation
enclave/src/ipfs.rs
Outdated
} | ||
} | ||
|
||
pub fn verify(&mut self) { |
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.
I am unsure, if we should use the self.verified
field. Would it be an option to return here Resut<(),IPFS_ERROR>
with the error being IPFS::ERROR::VERIFICATION
? I believe this would be more idiomatic.
This is not a strong opinion though, rather just an input from my side. And if you think differently that is totally fine.
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.
I think it depends on how the verification result is used / shared, if verification process will only be a one-off per content then I agree with you.
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.
From my perspective this looks really good.
I only made a little comment.
I haven't taken a look at your no_std
forks though, although if they compile to no_std
, they are good enough from my point of view.
the CI error currently is
I'll try to build your branch manually. later. |
Hi, @brenzi were you able to build this? |
@whalelephant I'm able to build this without problems. We'll have to check our CI setup on our side. Sorry for the inconvenience. I scanned the code quickly and I think it looks very clean and at first sight aims in the right direction. A unit test seems to crash:
This doesn't happen on master, so I guess it happens somewhere in your unit test? |
Hi, thanks for the message, I am not sure because I can't reproduce the error when running the unit tests. Perhaps we have different env / builds, I will try to detail what I have on my side below and hopefully we can isolate the problem. docker:image: scssubstratee/substratee*dev:18.04-2.9.1-1.1.2 worker + enclave buildscd work/substratee-worker
make SGX_MODE=SW SGX_DEBUG=1
cd bin
./substratee-worker test --unit
# from logs
# root@ce299945027a:~/work/substratee-worker/bin# ./substratee-worker test --unit
# *** Starting Test enclave
# Running unit Tests
# start running tests
# testing state::test_encrypted_state_io_works ... ok!
# testing ipfs::test_creates_ipfs_content_struct_works ... ok!
# testing ipfs::test_verification_ok_for_correct_content ... ok!
# testing ipfs::test_verification_fails_for_incorrect_content ... ok!
# testing test_ocall_read_write_ipfs ... ok!
# testing test_ocall_worker_request ... ok!
# test result ok. 6 tested, 6 passed, 0 failed
# [+] unit_test ended!
# [+] All tests ended! node
ipfs
All the above are executed inside the docker image |
thanks for these details. I'll reproduce. Is this PR ready for acceptance test vs. issue #70 from your perspective? |
@whalelephant I just re-started the build of this PR. Building is fine, but clippy is complaining with one warning:
If you can fix this last issue, CI will be happy. |
WIP