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(core-database): decouple database and state packages #3936

Merged
merged 13 commits into from
Aug 20, 2020

Conversation

bertiespell
Copy link
Contributor

@bertiespell bertiespell commented Aug 7, 2020

This proposal looks to decouple core-database and core-state.

It is useful for us to be able to include core-database without introducing a bunch of dependencies. Currently core-database relies on core-state, which in turn relies on lots of other packages. This is especially a problem since dynamic block times, because things like stand-alone forger process now need to look up block timestamps for specific heights (without needing core-state at all).

Summary

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #3936 into develop will decrease coverage by 0.08%.
The diff coverage is 90.87%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3936      +/-   ##
===========================================
- Coverage    97.53%   97.45%   -0.09%     
===========================================
  Files          629      630       +1     
  Lines        14540    14566      +26     
  Branches      1729     1730       +1     
===========================================
+ Hits         14182    14195      +13     
- Misses         167      181      +14     
+ Partials       191      190       -1     
Flag Coverage Δ
#functional 6.81% <0.00%> (-0.02%) ⬇️
#integration 9.83% <0.00%> (?)
#unit 95.61% <90.87%> (-0.12%) ⬇️

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

Impacted Files Coverage Δ
...s/core-blockchain/src/processor/block-processor.ts 97.93% <ø> (ø)
packages/core-kernel/src/ioc/identifiers.ts 100.00% <ø> (ø)
packages/core-database/src/database-service.ts 90.62% <50.00%> (-6.29%) ⬇️
packages/core-state/src/database-interactions.ts 92.12% <92.12%> (ø)
packages/core-blockchain/src/blockchain.ts 96.84% <100.00%> (+0.02%) ⬆️
...ain/src/processor/handlers/accept-block-handler.ts 92.85% <100.00%> (ø)
...blockchain/src/state-machine/actions/initialize.ts 100.00% <100.00%> (ø)
packages/core-database/src/service-provider.ts 91.89% <100.00%> (-0.61%) ⬇️
...ages/core-kernel/src/utils/get-blocktime-lookup.ts 100.00% <100.00%> (ø)
packages/core-p2p/src/peer-verifier.ts 100.00% <100.00%> (ø)
... and 9 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 3565ef5...88e0a0f. Read the comment docs.

@bertiespell bertiespell changed the title WIP: fix(core-database): decouple database and state packages fix(core-database): decouple database and state packages Aug 17, 2020
@bertiespell bertiespell marked this pull request as ready for review August 17, 2020 11:34
@air1one air1one merged commit af5e542 into develop Aug 20, 2020
@ghost ghost deleted the fix/forger-process-database-access branch August 20, 2020 14:27
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.

None yet

2 participants