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

Make State Requests only Request for Finalized State #1955

Merged
merged 23 commits into from Mar 12, 2019
Merged

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Mar 10, 2019

Description

Write why you are making the changes in this pull request.

Our sync were requesting the current state when we should have been requesting the
last finalized state.

Write a summary of the changes you are making.

  • Add new methods to db to save finalized state.
  • Save finalized state after fork choice is applied
  • Clean up main method in chain service, so as to remove a bug where we only saved
    validator's indexes if the epoch transition happened when a non nil block was given.
  • Modify requests and responses in sync services only to use last finalized state root instead of
    current state root..

@nisdas nisdas added the Ready For Review A pull request ready for code review label Mar 10, 2019
@nisdas nisdas self-assigned this Mar 10, 2019
@codecov
Copy link

codecov bot commented Mar 10, 2019

Codecov Report

Merging #1955 into master will decrease coverage by 0.39%.
The diff coverage is 58.46%.

@@           Coverage Diff            @@
##           master   #1955     +/-   ##
========================================
- Coverage   71.99%   71.6%   -0.4%     
========================================
  Files         109     108      -1     
  Lines        8353    8099    -254     
========================================
- Hits         6014    5799    -215     
+ Misses       1773    1759     -14     
+ Partials      566     541     -25

}

// Forward processed block to operation pool to remove individual operation from DB.
c.opsPoolService.IncomingProcessedBlockFeed().Send(block)
Copy link
Member

Choose a reason for hiding this comment

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

Please log an error if this returns 0, it means you sent a message to no one

@@ -426,6 +438,14 @@ func (c *ChainService) isBlockReadyForProcessing(block *pb.BeaconBlock, beaconSt
return nil
}

func (c *ChainService) checkLastFinalizedEpoch(beaconState *pb.BeaconState) error {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a better method name? This doesn’t describe the behavior of the method

@rauljordan rauljordan merged commit 000a42d into master Mar 12, 2019
@rauljordan rauljordan deleted the changeStateReq branch March 12, 2019 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants