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: slot, round and forgingInfo calculation for dynamic block times #4034

Merged
merged 10 commits into from
Sep 18, 2020

Conversation

sebastijankuzner
Copy link
Contributor

@sebastijankuzner sebastijankuzner commented Sep 15, 2020

Summary

This PR fixes invalid handling of dynamic blockTime in milestones. Affected are Slots from packages/crypto and calculate-forging-info from packages/core-kernel.

Fixes now calculate valid data for static and dynamic blockTime and are supported by valid test.

Because of similar logic logic there is also refactored core-kernel/round-calculator.

Checklist

  • Tests (if necessary)
  • Ready to be merged

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #4034 into develop will decrease coverage by 85.47%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #4034       +/-   ##
============================================
- Coverage    98.79%   13.32%   -85.48%     
============================================
  Files          638      715       +77     
  Lines        14798    17110     +2312     
  Branches      1739     2082      +343     
============================================
- Hits         14620     2280    -12340     
- Misses         104    14722    +14618     
- Partials        74      108       +34     
Flag Coverage Δ
#functional 6.01% <0.00%> (-0.94%) ⬇️
#integration 9.98% <0.00%> (-1.56%) ⬇️
#unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...es/core-kernel/src/utils/calculate-forging-info.ts 0.00% <0.00%> (-93.34%) ⬇️
packages/core-kernel/src/utils/round-calculator.ts 0.00% <0.00%> (-98.00%) ⬇️
packages/crypto/src/crypto/slots.ts 0.00% <0.00%> (ø)
packages/core/src/cli.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/errors.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/schemas.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core/src/commands/top.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-cli/src/contracts.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-forger/src/errors.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/constants.ts 0.00% <0.00%> (-100.00%) ⬇️
... and 635 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 956d629...be38642. Read the comment docs.

@sebastijankuzner sebastijankuzner changed the title fix(core-kernel): fix calculate-forging-info fix: slot and round calculation Sep 17, 2020
@sebastijankuzner sebastijankuzner changed the title fix: slot and round calculation fix: slot, round and forgingInfo calculation for dynamic block times Sep 17, 2020
@air1one air1one merged commit 2d3fe09 into develop Sep 18, 2020
@ghost ghost deleted the chore/core-kernel/round-updates branch September 18, 2020 09:34
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.

2 participants