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

Handle block forks #584

Merged
merged 6 commits into from
Dec 19, 2019
Merged

Handle block forks #584

merged 6 commits into from
Dec 19, 2019

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Dec 13, 2019

@twoeths twoeths changed the base branch from tuyen/fork-choice-0.9.1-pr-1465 to 0.9.x December 13, 2019 09:32
@twoeths twoeths changed the title [WIP] Handle block forks Handle block forks Dec 13, 2019
@codecov
Copy link

codecov bot commented Dec 13, 2019

Codecov Report

Merging #584 into 0.9.x will increase coverage by 0.01%.
The diff coverage is 18.18%.

@@            Coverage Diff            @@
##            0.9.x    #584      +/-   ##
=========================================
+ Coverage   65.49%   65.5%   +0.01%     
=========================================
  Files         198     198              
  Lines        3599    3601       +2     
  Branches      338     337       -1     
=========================================
+ Hits         2357    2359       +2     
  Misses       1138    1138              
  Partials      104     104

Copy link
Member

@mpetrunic mpetrunic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we change head state if "applyForkChoice" changes head?

@wemeetagain
Copy link
Member

@mpetrunic I think thats what applyForkChoice is doing

@mpetrunic
Copy link
Member

@mpetrunic I think thats what applyForkChoice is doing

Yeah but we won't have state for that?

Shouldn't we run state transition from last common state?

@wemeetagain
Copy link
Member

applyForkChoice is getting called right after the state transition has been run, and the post state stored in the db.
I think it has everything it needs?

@mpetrunic
Copy link
Member

applyForkChoice is getting called right after the state transition has been run, and the post state stored in the db.
I think it has everything it needs?

Thsi works for:

block A -----> block B
         \
          \
           \
            \
             > block C

but what if we have:

block A-----> B -----> block C
         \
          \
            > B1-------->C1

I guess we don't have to support that scenario yet?

packages/lodestar/src/chain/chain.ts Outdated Show resolved Hide resolved
@wemeetagain wemeetagain merged commit fdb264f into 0.9.x Dec 19, 2019
@wemeetagain wemeetagain deleted the tuyen/handle-block-forks branch December 19, 2019 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants