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

Fix Drand fetching around null tipsets #7376

Merged
merged 1 commit into from
Sep 30, 2021
Merged

Fix Drand fetching around null tipsets #7376

merged 1 commit into from
Sep 30, 2021

Conversation

arajasek
Copy link
Contributor

Closes #3613

@arajasek arajasek requested a review from a team as a code owner September 22, 2021 18:34
chain/store/rand.go Outdated Show resolved Hide resolved
@@ -1037,81 +1035,6 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) {
require.True(tu.t, p1Head.Equals(b.TipSet()))
}

func TestDrandNull(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was pretty bad...better test in rand_test now that also covers this case

@jennijuju jennijuju added the P0 P0: Critical Blocker label Sep 22, 2021
@jennijuju jennijuju added this to the Network v14 milestone Sep 22, 2021
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #7376 (76da461) into feat/nv14 (d9e711e) will decrease coverage by 0.06%.
The diff coverage is 65.21%.

❗ Current head 76da461 differs from pull request most recent head c3c46e9. Consider uploading reports for the commit c3c46e9 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##           feat/nv14    #7376      +/-   ##
=============================================
- Coverage      39.29%   39.22%   -0.07%     
=============================================
  Files            627      627              
  Lines          66099    66129      +30     
=============================================
- Hits           25971    25940      -31     
- Misses         35643    35706      +63     
+ Partials        4485     4483       -2     
Impacted Files Coverage Δ
chain/gen/genesis/miners.go 55.49% <0.00%> (-0.65%) ⬇️
chain/vm/vm.go 60.59% <ø> (+1.11%) ⬆️
chain/gen/gen.go 65.77% <55.55%> (-1.50%) ⬇️
chain/store/rand.go 60.50% <68.00%> (-3.24%) ⬇️
chain/vm/runtime.go 54.49% <100.00%> (+0.26%) ⬆️
node/impl/full/state.go 35.07% <100.00%> (+0.15%) ⬆️
extern/sector-storage/sched_resources.go 75.00% <0.00%> (-9.38%) ⬇️
chain/sync_manager.go 67.39% <0.00%> (-5.28%) ⬇️
miner/warmup.go 76.19% <0.00%> (-4.77%) ⬇️
chain/stmgr/execute.go 86.95% <0.00%> (-4.35%) ⬇️
... and 21 more

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 d9e711e...c3c46e9. Read the comment docs.

func (cs *ChainStore) ExtractBeaconEntryForRound(ts *types.TipSet, round uint64) (*types.BeaconEntry, error) {
cbe := ts.Blocks()[0].BeaconEntries
for _, v := range cbe {
if v.Round == round {
Copy link
Contributor

Choose a reason for hiding this comment

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

You are passing ChainEpoch as round and comparing it with Drand round.

@jennijuju jennijuju marked this pull request as draft September 27, 2021 18:12
@arajasek arajasek force-pushed the asr/fix-drand branch 2 times, most recently from d3652f0 to 21bb0e7 Compare September 29, 2021 00:56
return cs.LoadTipSet(tsk)
}

func (cs *ChainStore) GetLatestBeaconEntry(ts *types.TipSet) (*types.BeaconEntry, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be in the new stateRand instead, doesn't really make a difference

@arajasek arajasek marked this pull request as ready for review September 29, 2021 01:06
@arajasek arajasek force-pushed the asr/fix-drand branch 2 times, most recently from 95f1fa9 to 6cedfbb Compare September 29, 2021 03:18
@arajasek arajasek merged commit 0fd5dbe into feat/nv14 Sep 30, 2021
@arajasek arajasek deleted the asr/fix-drand branch September 30, 2021 01:28
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Post-merge lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 P0: Critical Blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants