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

refactor(core-blockchain): block processing #4155

Merged
merged 54 commits into from
Nov 11, 2020

Conversation

sebastijankuzner
Copy link
Contributor

@sebastijankuzner sebastijankuzner commented Nov 9, 2020

Summary

Fix #4062.
Possibly fix #4106 with corruption detection.

  • increase test coverage to 100 %
  • use queue from core-kernel
  • implement revertBlockHanler
  • exit node when reverting block failed, which result in corrupted state
  • small refactorings

Checklist

  • Tests (if necessary)
  • Ready to be merged

# Conflicts:
#	__tests__/unit/core-api/controllers/locks.test.ts
#	__tests__/unit/core-api/controllers/wallets.test.ts
# Conflicts:
#	__tests__/unit/core-blockchain/state-machine/actions/initialize.test.ts
#	__tests__/unit/core-kernel/services/queue/drivers/memory.test.ts
#	packages/core-blockchain/src/state-machine/actions/initialize.ts
#	packages/core-kernel/src/contracts/kernel/queue.ts
@codecov
Copy link

codecov bot commented Nov 9, 2020

Codecov Report

Merging #4155 (bab4832) into develop (feb1d6b) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4155      +/-   ##
===========================================
+ Coverage    96.19%   96.28%   +0.08%     
===========================================
  Files          722      724       +2     
  Lines        17538    17605      +67     
  Branches      2147     2154       +7     
===========================================
+ Hits         16871    16951      +80     
+ Misses         502      500       -2     
+ Partials       165      154      -11     
Flag Coverage Δ
functional 5.96% <0.00%> (-0.03%) ⬇️
integration 9.85% <0.00%> (-0.03%) ⬇️
unit 94.92% <100.00%> (+0.17%) ⬆️

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

Impacted Files Coverage Δ
packages/core-blockchain/src/blockchain.ts 100.00% <100.00%> (+8.29%) ⬆️
packages/core-blockchain/src/process-blocks-job.ts 100.00% <100.00%> (ø)
...s/core-blockchain/src/processor/block-processor.ts 100.00% <100.00%> (+2.04%) ⬆️
...ain/src/processor/handlers/accept-block-handler.ts 100.00% <100.00%> (+7.14%) ⬆️
...ain/src/processor/handlers/revert-block-handler.ts 100.00% <100.00%> (ø)
...kchain/src/processor/handlers/unchained-handler.ts 100.00% <100.00%> (ø)
...hine/actions/check-last-downloaded-block-synced.ts 100.00% <100.00%> (ø)
...chain/src/state-machine/actions/download-blocks.ts 100.00% <100.00%> (+11.11%) ⬆️
...ain/src/state-machine/actions/download-finished.ts 100.00% <100.00%> (ø)
...blockchain/src/state-machine/actions/initialize.ts 100.00% <100.00%> (ø)
... and 8 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 feb1d6b...bab4832. Read the comment docs.

@faustbrian faustbrian merged commit 9e37040 into develop Nov 11, 2020
@faustbrian faustbrian deleted the test/core-blockchain/increase-coverage branch November 11, 2020 05: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