Closed hleb-albau closed 5 years ago
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
This issue now has a funding of 140.0 DAI (140.0 USD @ $1.0/DAI) attached to it as part of the https://github.com/cybercongress fund.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Workers have applied to start work.
These users each claimed they can complete the work by 4 weeks, 1 day from now. Please review their action plans below:
1) zyfrank has applied to start work _(Funders only: approve worker | reject worker)_.
will add corresponding stuff in cyberd/daemon/rpc/
Learn more on the Gitcoin Issue Details page.
@hleb-albau still actual?
@hleb-albau @litvintech Is this issue still open? Can one jump in?
@agutsal @janus Yes, this issue is open at gitcoin
@agutsal Go for it unless you are busy
@litvintech Approve my expression of interest.
@janus please, ask any questions on this task
@litvintech
I have gone through some of the files in the code base.. .I am searching for a method/function that would answer this Should return rank for given CID's Id
. The closest I found is Search method inside the below
https://github.com/cybercongress/cyberd/blob/master/x/rank/index.
I need direction here..
@janus First, you need to get inner CID's nubmer by CID https://github.com/cybercongress/cyberd/blob/master/app/rpc.go#L25 Then you need to get rank value https://github.com/cybercongress/cyberd/blob/master/x/rank/index.go#L117 After that, if proof=true you need to get proof from merkle tree by CID number https://github.com/cybercongress/cyberd/blob/master/merkle/tree.go#L139 Importance notice: you need to access merkle tree from RankState for currently calculated rank -networkCidRank (there will be only proofs for CID which rank are calculated during last window)
@litvintech Thanks
@janus Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Still working on it .. thanks for the reminder
@litvintech , Pleae go through my code .. https://github.com/janus/cyberd/commit/12e05d299e4711dcccb31ef49a1b26582a92041c
merkleTree := app.rankState.GetMerkelTree();
proofs := merkleTree.GetIndexProofs(cidNumber)
return rankValue, proofs, nil
}
Please pay attention to GetMerkleTree method , I added the method definition to rankState but my ide is flagging it. And calling GetIdexProofs with cidNumber is that correct? And wanted to use lastIndex as the max and run through the whole tree but I was a bit confuse if it is the right thing,
@janus thanks! Need couple of hours to check this. Please bring PR on this
Please review my PR, https://github.com/cybercongress/cyberd/pull/349
@janus Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
@janus Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Submitting within next 20 hours
@janus Thank you! Merged in https://github.com/cybercongress/cyberd/pull/355
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Work for 140.0 DAI (140.0 USD @ $1.0/DAI) has been submitted by:
@litvintech please take a look at the submitted work:
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
The funding of 140.0 DAI (140.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @janus.
User Story
The crucial goal of all blockchains is to provide proofs for each entity which impact consensus. In cyber - a CID rank is an essential element of the whole system. A user should have the ability to verify CID ranks that he gets.
Definition of Done
Add
rank
RPC router function withcid,proof
args. Should return rank for given CID's Id and also ifproof=true
router should also return proofs from #133 .Proof consists from part of the Merkle tree which ends with root hash, current app hash. With returned data user will allow verifying the rank of given CID.
Addition Info
Use the same conventions as https://github.com/tendermint/tendermint/blob/master/rpc/core/tx.go#L175 default tendermint does.
A useful test of the inner Merkle tree implementation with proofs: https://github.com/cybercongress/cyberd/blob/master/merkle/tree_test.go#L30
Cosmos SDK documentation: https://cosmos.network/docs/tutorial/rest.html
Please, provide your PR request with branch 309-rank-proof. PR will be processed in 2-3 days, payment will be released after merging.
Our docs: https://github.com/cybercongress/cyberd/blob/master/docs/rpc.md https://github.com/cybercongress/cyberd/blob/master/docs/help/setup_dev_env.md