Lighthouse: Add free attestations to fork choice

Created on 24 Jun 2019  ·  14Comments  ·  Source: sigp/lighthouse

Description

Presently, only attestations that are included in blocks are included in fork choice.

They were not implemented in the fork-choice refactor (#398), instead we deferred them for later implementation.

Steps to resolve

Attestations provided to the process_attestation function should be validated and provided to the ForkChoice struct.

Notes

  • Only valid, signed attestations should be added to the fork choice.
  • It does not suffice to only add attestations to the fork choice if they are accepted into the operations pool. The op-pool is only interested in attestations that can be included in future blocks, whilst fork choice is potentially interested in any attestation.
  • Attestations should not be added to fork choice if they target unknown/unprocessed blocks.
  • It may be optimal to check if the attestation is a latest message for any validator prior to verifying the signature. If the attestation is not a latest message, we don't need it and verifying the signature would be a waste of time.
  • A naive implementation would read the BeaconState from disk for each attestation. A better implementation would attempt to use the present, canonical state prior to loading from disk. I imagine the majority of attestations would be current and could be validated against the present state, it would be good to optimize for this scenario.
work-started

Most helpful comment

Please do! I think this will be a good one for you.

We're in the process of updating to the "frozen" spec (v0.8.0) but I don't think that'll affect you. In the worst case I imagine there will be a small merge conflict at some point -- nothing to worry about.

If you need anything, @michaelsproul and I are happy to help!

All 14 comments

Hey @paulhauner, is it cool if I pick this one up?

Please do! I think this will be a good one for you.

We're in the process of updating to the "frozen" spec (v0.8.0) but I don't think that'll affect you. In the worst case I imagine there will be a small merge conflict at some point -- nothing to worry about.

If you need anything, @michaelsproul and I are happy to help!

@g-r-a-n-t Funded this via our the EF budget and reserved for you. Please 'Start Work' whenever you can 🙂 good luck!

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


__Work has been started__.

These users each claimed they can complete the work by 10 months, 3 weeks from now.
Please review their action plans below:

1) g-r-a-n-t has been approved to start work.

Complete what's been discussed on the ticket and WIP PR.

Learn more on the Gitcoin Issue Details page.

@g-r-a-n-t 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

@gitcoinbot wrapping this up

@g-r-a-n-t 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

@gitcoinbot Waiting on a review.

@g-r-a-n-t 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

@gitcoinbot The commits are making their way in.

@gitcoinbot please feel free to payout this issue :)

Thanks @g-r-a-n-t and @gitcoinbot!

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


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

  1. @g-r-a-n-t

@vs77bb please take a look at the submitted work:

  • PR by @g-r-a-n-t

Craftsman ⚡️ A *Craftsman* Kudos has been sent to @g-r-a-n-t for this issue from @vs77bb. ⚡️ Nice work @g-r-a-n-t! Your Kudos has automatically been sent in the ETH address we have on file.

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


__The funding of 550.0 DAI (550.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @g-r-a-n-t.__

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JustinDrake picture JustinDrake  ·  3Comments

plamarque picture plamarque  ·  4Comments

paulhauner picture paulhauner  ·  5Comments

paulhauner picture paulhauner  ·  4Comments

paulhauner picture paulhauner  ·  4Comments