harmony-one / bounties

Bounty program is to help the community take part in the development of the Harmony blockchain. It covers from core feature to validator tooling, from dApp development to DeFi integration.
MIT License
59 stars 23 forks source link

[Bounty] Integrate VDF Rust implementation in harmony Go client #4

Open rlan35 opened 3 years ago

rlan35 commented 3 years ago

Description

VDF is one of the key component for Harmony's randomness generation. For more details about the use of VDF in randomness, read https://docs.harmony.one/home/general/technology/randomness. Harmony's current client implementation is in Golang and we've implemented a VDF in Golang here: https://github.com/harmony-one/vdf. The Golang VDF is functional but not performance-optimized. We would like to have the fastest VDF implementation so the security of the randomness generation can be high.

Specifically, we've identified this Rust version of VDF to be a lot faster than the Go version: https://docs.rs/vdf/0.1.0/vdf/, and this bounty is on the integration of this VDF implementation in our Go client.

Time Estimation

2-4 weeks

Acceptance Criteria

Bounty

$5000 USD equivalent in ONE tokens.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 25164.7447 ONE (4970.34 USD @ $0.2/ONE) attached to it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 4 days, 7 hours from now. Please review their action plans below:

1) kevinkelley has started work.

I'm comfortable in both Rust and Go, and have done lots of library wrapper integrations over the years. I'm interested and have been involved on crypto projects for years. I really want to do this, and I think it suits my skillset.

I'm reviewing and planning now, will update as progress happens 2) alexiachen has started work.

dev a rust wrapper(https://github.com/poanetwork/vdf) for go

Learn more on the Gitcoin Issue Details page.

KevinKelley commented 3 years ago

Progress update, I now have a working FFI from Go calling the Rust VDF functions execute() and verify().

Will proceed with integrating to the as described.

...I'm not too familiar with the bounty program here. Do I need approval to work? How does the acceptance happen, if several are working on this?

mognify commented 3 years ago

I think you just do and document your work, then mark it complete when you finish, and the author of the bounty will select the winner(s) this is just a guess tho. im also new and still looking into this stuff

KevinKelley commented 3 years ago

thanks @mognify ...I'm proceeding like that, hopefully it's right lol

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 25164.7447 ONE (4498.10 USD @ $0.17/ONE) has been submitted by:


LeoHChen commented 3 years ago

Thanks @KevinKelley for your interest and progress. Since it is a bounty, everyone can work on it. Once you finished, you just submit. The bounty owner will pick the winner(s) then. You may also work in group if you would like to.

A regular progress and ask for feedback would be helpful so that you won't waste time working on some wrong direction though.

mearaj commented 3 years ago

Hi, My name is Mearaj Bhagad and I am interested in working on this task.

I have a question regarding Rust VDF into a Go library. (Just for clarification) My question is that if an equally good implementation of VDF in pure golang is done, will it be acceptable or it's a hard requirement of Rust's VDF implementation to be binded/interfaced to golang's wrapper/library. I hope you got me. Thanks :)

KevinKelley commented 3 years ago

@mearaj hi... I'm not the owner. I'm just working it too...

My understanding is that, the purpose is to get Rust FFI implementation for the speed improvement.

There is already a Go implementation, but owner wants faster, and the Rust seems to win.

I have made progress. I have Rust-FFI working fine, and timings seem to track exactly with those of the Rust version...

For me... I'm working now to integrate the Rust-FFI into the Go project, not just the test app (already done) but the project itself.

KevinKelley commented 3 years ago

I'll say that I don't have much in the way of profiling and timing though. I would think that's important, to document the speedup and decide whether it's worth the trouble...

Gut feeling and based on the results so far,, I think it is.

mearaj commented 3 years ago

Thanks @KevinKelley for the reply :)

KevinKelley commented 3 years ago

@rlan35 I'm expecting to have ready to review, in a few days, likely by early to mid-week.

I'm sure there will be comments or requests or further work, before final acceptance..

harjas27 commented 3 years ago

Hi I have a submission here https://github.com/harjas27/vdf-wrapper. Please review

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 25164.7447 ONE (3692.83 USD @ $0.14/ONE) has been submitted by:

  1. @harjas27

@papiofficial please take a look at the submitted work:


KevinKelley commented 3 years ago

I've submitted as well; I have to admit that mine is not as cleanly finished as I wish. Eye infection kept me offline for a while. @harjas27 submission looks cleanly and well done... ...honestly, I have nothing to add, and he seems to be complete, where I haven't integrated yet.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 25164.7447 ONE (3072.46 USD @ $0.12/ONE) attached to this issue has been approved & issued to @harjas27.