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): revertBlock #3948

Merged
merged 5 commits into from Aug 13, 2020
Merged

Conversation

sebastijankuzner
Copy link
Contributor

@sebastijankuzner sebastijankuzner commented Aug 10, 2020

Summary

This PR fixes: #3938

  1. Removes ipfs entry from ipfs index on reverting ipfs transaction.

  2. Take blocks for removal from state store if they exist, otherwise load them from database.

  3. Limit enqued blocks chunk to fit stateStore maxLastBlocks lenght. This prevent loosing blocks if they not saved into the database and are removed from stateStore blocks ordered map.

Checklist

  • Ready to be merged

@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #3948 into develop will decrease coverage by 0.26%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3948      +/-   ##
===========================================
- Coverage    97.57%   97.30%   -0.27%     
===========================================
  Files          629      629              
  Lines        14540    14582      +42     
  Branches      1730     1733       +3     
===========================================
+ Hits         14187    14189       +2     
- Misses         165      203      +38     
- Partials       188      190       +2     
Flag Coverage Δ
#functional 6.80% <0.00%> (-0.02%) ⬇️
#integration 9.84% <0.00%> (-0.01%) ⬇️
#unit 95.47% <88.88%> (-0.27%) ⬇️

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

Impacted Files Coverage Δ
packages/core-database/src/database-service.ts 96.90% <80.00%> (-0.32%) ⬇️
packages/core-blockchain/src/blockchain.ts 96.81% <100.00%> (ø)
packages/core-state/src/stores/state.ts 100.00% <100.00%> (ø)
...ackages/core-transactions/src/handlers/two/ipfs.ts 86.04% <100.00%> (+0.33%) ⬆️
packages/core-api/src/schemas.ts 54.34% <0.00%> (-45.66%) ⬇️
packages/core-api/src/server.ts 72.58% <0.00%> (-27.42%) ⬇️
packages/core-p2p/src/network-monitor.ts 99.62% <0.00%> (-0.38%) ⬇️

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 37ac35e...fe3b20a. Read the comment docs.

@air1one air1one merged commit 3565ef5 into develop Aug 13, 2020
@ghost ghost deleted the fix/core-database/revertBlock branch August 13, 2020 10:39
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