Skip to content
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

Filter out non-viable branches when call to get_head #637

Closed
ColinSchwarz opened this issue Feb 3, 2020 · 3 comments · Fixed by #678
Closed

Filter out non-viable branches when call to get_head #637

ColinSchwarz opened this issue Feb 3, 2020 · 3 comments · Fixed by #678
Assignees

Comments

@ColinSchwarz
Copy link
Contributor

ColinSchwarz commented Feb 3, 2020

v0.9.3: filter out non-viable branches when call to get_head (ethereum/consensus-specs#1495)

@twoeths twoeths self-assigned this Feb 24, 2020
@twoeths
Copy link
Contributor

twoeths commented Feb 25, 2020

I suppose we have nothing to do with this because we use different algorithm.

  • According to the spec, we want to filter blocks before traverse them to getHead.
  • For our algorithm, we maintain bestTarget so we only get it in head (getHead). We don't traverse blocks so we don't need to filter.

can you confirm @wemeetagain ?

@twoeths
Copy link
Contributor

twoeths commented Feb 26, 2020

I took some more time on this. The main point is to make sure the head has the same finalized & justified checkpoint to the store, so I propose:

  • Maintain justified/finalized checkpoint in all nodes
  • Whenever there is justified/finalized checkpoint change, we have to traverse from the justified checkpoint to decide new best target of every node (if needed)
  • On weight change, make sure the best target has same justified/finalized checkpoint to the store.

@twoeths
Copy link
Contributor

twoeths commented Feb 26, 2020

On the other hand, if we do like that it may not be worth to follow our own specific algorithm compared to the spec because we have to do the traversal anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants