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

Part 1 of Aligning Core Blockchain Package with Latest 2.1 Spec #371

Merged
merged 29 commits into from
Aug 14, 2018
Merged

Part 1 of Aligning Core Blockchain Package with Latest 2.1 Spec #371

merged 29 commits into from
Aug 14, 2018

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Aug 3, 2018

First part of aligning beacon chain node code base with latest 2.1 spec. Following items got changed in this PR with respect to 2.1:

  • Updates to state and crystallized state fields
  • Minor tweaks on shuffling and cutoff algorithms
  • How we apply casper FFG rewards and penalties

I don't want to put all the 2.1 changes in a single giant PR. Will be opening multiple small in regards to more 2.1 updates. Per blocking processing, cycle length recalculating, test coverage improvements will be coming next.

https://notes.ethereum.org/SCIg8AH5SA-O4C1G1LYZHQ?view

@terencechain terencechain added this to the Ruby milestone Aug 3, 2018
@terencechain terencechain self-assigned this Aug 3, 2018
@terencechain terencechain added this to In progress in Beacon Chain via automation Aug 3, 2018
@rauljordan rauljordan changed the title Alight Core Blockchain Package with Latest 2.1 spec Align Core Blockchain Package with Latest 2.1 Spec Aug 3, 2018
@codecov
Copy link

codecov bot commented Aug 11, 2018

Codecov Report

Merging #371 into master will decrease coverage by 0.73%.
The diff coverage is 61.87%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #371      +/-   ##
=========================================
- Coverage   54.24%   53.5%   -0.74%     
=========================================
  Files          30      31       +1     
  Lines        2459    2493      +34     
=========================================
  Hits         1334    1334              
- Misses        960     998      +38     
+ Partials      165     161       -4
Impacted Files Coverage Δ
beacon-chain/blockchain/service.go 27.18% <0%> (-0.82%) ⬇️
beacon-chain/sync/service.go 61.2% <100%> (ø) ⬆️
client/beacon/service.go 100% <100%> (ø) ⬆️
beacon-chain/simulator/service.go 77.06% <100%> (ø) ⬆️
beacon-chain/utils/shuffle.go 100% <100%> (ø) ⬆️
beacon-chain/utils/checkbit.go 23.52% <23.52%> (ø)
beacon-chain/blockchain/core.go 58.36% <62.22%> (-4.25%) ⬇️
beacon-chain/rpc/service.go 100% <0%> (+8.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 846c1fe...21bf3ed. Read the comment docs.

@terencechain terencechain changed the title Align Core Blockchain Package with Latest 2.1 Spec Part 1 of Aligning Core Blockchain Package with Latest 2.1 Spec Aug 11, 2018
Copy link
Contributor

@rauljordan rauljordan left a comment

Choose a reason for hiding this comment

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

Great job on this - this has so many important updates and everything was pretty comprehensive. Comments are mostly small things!

@@ -36,6 +36,11 @@ type beaconState struct {
CrystallizedState *types.CrystallizedState
}

Copy link
Contributor

Choose a reason for hiding this comment

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

comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

@rauljordan thanks for the review! it's ready again!

if err != nil {
return nil, -1, err
}
return indices[:int(attesterCount)], indices[len(indices)-1], nil
}

// getAttestersTotalDeposit returns the total deposit combined by attesters.
// TODO: Consider slashing condition
Copy link
Contributor

Choose a reason for hiding this comment

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

punctuation

}
}

// split the shuffled list for heights
Copy link
Contributor

Choose a reason for hiding this comment

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

punctuation

@@ -211,11 +211,17 @@ func (c *ChainService) run(done <-chan struct{}) {
log.Errorf("Write active state to disk failed: %v", err)
}

currentSlot := block.SlotNumber()
// TODO: Apply 2.1 fork choice logic using the following
Copy link
Contributor

Choose a reason for hiding this comment

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

.

@rauljordan
Copy link
Contributor

I approve but it looks like we'll have to get coverage up by a lot in the blockchain package as it seems it has a lot of stuff untested. Maybe we can revisit that after the spec is a little bit more solid.

@terencechain terencechain merged commit 1f56c43 into prysmaticlabs:master Aug 14, 2018
Beacon Chain automation moved this from In progress to Done Aug 14, 2018
@terencechain
Copy link
Member Author

I'll open a PR to improve the coverage tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Beacon Chain
  
Done
Beacon Chain Design
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants