Lighthouse: Implement tree hashing function

Created on 5 Nov 2018  Â·  25Comments  Â·  Source: sigp/lighthouse

Description

Implement the function described here: https://github.com/ethereum/eth2.0-specs/issues/54

Present Behaviour

Function doesn't exist.

Expected Behaviour

Function should exist.

Steps to resolve

AFAIK, the function is still experimental so be on the lookout for bugs and optimisations.

At this stage, I think we should implement it as a separate crate.

work-started

All 25 comments

@mjkeating has started working on this issue, so please drop a comment in here if you wish to start working on it

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


__Work has been started__.

These users each claimed they can complete the work by 1 week, 3 days ago.
Please review their action plans below:

1) kevinkelley has applied to start work _(Funders only: approve worker | reject worker)_.

Hi, I'd like to work on this, if it's open.

I've got a couple years experience in Rust (wrote and maintain nanovg bindings crate); some experience and lots of interest in blockchain.

This sounds like a straightforward implementation/translation, of the python code...I'll implement the function, in a new crate, with plenty of tests.

Learn more on the Gitcoin Issue Details page.

2) mjkeating has been approved to start work.

Implement a solution as per the ETH2.0 SSZ spec and the official sample implementation at https://github.com/ethereum/beacon_chain/blob/master/hash_ssz.py.

Learn more on the Gitcoin Issue Details page.

Hey @mjkeating you're approved, glad to hear from Paul that you're already making progress :)

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@mjkeating has implemented a fairly complex function here so we'll probably need a few days to review it. Might be worth throwing a solid snooze on this one :)

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

I updated https://github.com/sigp/lighthouse/pull/88 to, hopefully, reflect @paulhauner's helpful review comments.

I also added TreeHash implementations for Vec and HashMap. Testing those against officially known tests/results should verify basic functionality is correct and consistent with other clients. I'm pretty sure that tweaks will be needed (there are disparities/confusion between the spec and sample code) , but hopefully, the basic structure is currently in place.

There are a couple of TODO's. I noticed an issue by @paulhauner this week which mentions an issue much be created to track every TODO. I'm not sure if that should be done before or after a merge - and if it should be done my me in this case :)

Also, custom implementations for non-generic objects in the python sample code (ValidatorRecord and ShardAndCommittee) are not mentioned in the spec and no code comments discuss why they were added to the sample code. I added those to this PR, but I'm not clear what the plan is for these and other custom objects.

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Hey @gitcoinbot, please snooze for 10 days. We're waiting on some test vectors from the EF :)

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


@mjkeating due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Hmm. I guess that snooze button never got hit after @paulhauner request? Anyway, we're waiting, at this point, for something to test against from EF.

Oh no! The mods are coming!

The EF don't have any vectors and apparently there are still some open questions about how this should work.

I think I'll jump onto this and together we can get something that works for now.

It's Friday here and the last working day before "holidays" so I'll jump onto it next week :)

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Please snooze this for 10 days :)

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Gratuitous snooze comment :)

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@mjkeating 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!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

In the Eth 2 call (happening now) Hsaio-Wei stated there will be work starting on SSZ test vectors next week. I think the best course here is to wait for these vectors before I do a review on #88.

@gitcoinbot could you please snooze for another 10 days.

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


@mjkeating due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

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


@mjkeating due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Hi @gitcoinbot, can you please see the above comment :)

Hey @gitcoinbot, this issue has been fixed!

@mjkeating did a great job. Please feel free to pay out his bounty.

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


__Work for 350.0 DAI (350.0 USD @ $1.0/DAI) has been submitted by__:

  1. @mjkeating

@ceresstation please take a look at the submitted work:

  • (Link Not Provided) by @mjkeating

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


__The funding of 350.0 DAI (350.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @mjkeating.__

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulhauner picture paulhauner  Â·  3Comments

q9f picture q9f  Â·  4Comments

michaelsproul picture michaelsproul  Â·  4Comments

paulhauner picture paulhauner  Â·  5Comments

paulhauner picture paulhauner  Â·  4Comments