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-blockchain): node stuck during sync #2220

Merged
merged 2 commits into from Mar 11, 2019

Conversation

Projects
None yet
4 participants
@supaiku0
Copy link
Contributor

supaiku0 commented Mar 11, 2019

Proposed changes

Fixes a regression introduced by #2216.

ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate arkx (03bbfb43ecb5a54a1e227bb37b5812b5321213838d376e2b455b6af78442621dec) allowed to forge block 1,735,171 👍
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate genesis_31 (027b320c5429334ecf846122492d12b898a756bf1347aa61f7bf1dcd706315a9fb) allowed to forge block 1,735,172 👍
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate genesis_2 (0259d9ca7922c277b0e7407a88703bbb98f5da43a335b0eefa6c4642f072acfe79) allowed to forge block 1,735,173 👍
0|ark-core  | [2019-03-10 05:19:57][INFO]: Starting Round 34,024 🕊️
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Updating delegate statistics
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate lol (03b383f3cb3c74d77ce0384412d996f9b617013758b38983f8ffa4115cc952cc62) just missed a block. Total: 71
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate stevenhop (0304d0c477d634cc85d89c1a4afee8f51168d1747fe8fd79cabc26565e49eb8a7a) just missed a block. Total: 2685
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate itsanametoo (0236d5232cdbd1e7ab87fad10ebe689c4557bc9d0c408b6773be964c837231d5f0) just missed a block. Total: 1588
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate xillion (02d2a18dcb0dd7abd0a91ca70cb79d04e1ff7a4e77d1d8beda3d6c0a51b55a5db1) just missed a block. Total: 1483
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate darkdel (03990f3668e883501ad3d583809f3420e2206176ccbb63ff242dd053e9ea5e8e4a) just missed a block. Total: 162
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate dafty (03459978b705ff16949113189ba4306e7edcdeda015f1d7fe3f8864659f703014c) just missed a block. Total: 3300
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate bioly (0284a88da69cc04439633217c6961d2800df0f7dff7f85b9803848ee02d0743f1d) just missed a block. Total: 5461
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Delegate darktoons (03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933) just missed a block. Total: 5475
0|ark-core  | [2019-03-10 05:19:57][INFO]: No new block found on this peer
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: event 'NOBLOCK': {"syncWithNetwork":"downloadBlocks"} -> {"syncWithNetwork":"syncing"} -> actions: [checkLastDownloadedBlockSynced]
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Queued blocks (rebuild: 0 process: 42)
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: event 'NOTSYNCED': {"syncWithNetwork":"syncing"} -> {"syncWithNetwork":"downloadBlocks"} -> actions: [downloadBlocks]
0|ark-core  | [2019-03-10 05:19:57][INFO]: Downloading blocks from height 1,735,172 via 167.114.29.57
0|ark-core  | [2019-03-10 05:19:57][INFO]: 43 modified wallets committed to database
0|ark-core  | [2019-03-10 05:19:57][DEBUG]: Loaded 51 active delegates

What basically happened is that when downloadBlocks returns no blocks, the last downloaded block is reset to the last chained block which in principle is fine, provided the process queue is empty otherwise the relay tries to download an already chained block which makes no sense.

Also fixes another oversight related to #2217.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Mar 11, 2019

Codecov Report

Merging #2220 into 2.2 will decrease coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.2    #2220      +/-   ##
==========================================
- Coverage   79.23%   79.21%   -0.03%     
==========================================
  Files         331      331              
  Lines        7923     7924       +1     
  Branches     1091     1094       +3     
==========================================
- Hits         6278     6277       -1     
- Misses       1613     1615       +2     
  Partials       32       32
Impacted Files Coverage Δ
packages/core-transaction-pool/src/connection.ts 100% <100%> (ø) ⬆️
packages/core-blockchain/src/state-machine.ts 98.46% <33.33%> (-1.03%) ⬇️

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 2a87c02...eb3e345. Read the comment docs.

@faustbrian faustbrian merged commit e2c975c into ArkEcosystem:2.2 Mar 11, 2019

6 checks passed

ci/circleci: test-node10-0 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-1 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-2 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-0 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-1 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-2 Your tests passed on CircleCI!
Details

vasild added a commit that referenced this pull request Mar 11, 2019

Merge remote-tracking branch 'ArkEcosystem/core/develop' into blockid
* ArkEcosystem/core/develop:
  chore: update dependencies and remove unused imports (#2212)
  fix(core-tester-cli): Don't hide errors from HTTP failures (#2223)
  chore: update CircleCI config
  chore: use yarn setup on CircleCI
  fix: resolve core-tester-utils conflicts and various errors
  chore: yarn.lock
  chore: bump versions
  chore: resolve conflicts
  refactor(core): allow to provide yes/no callbacks for confirm
  feat(core): suggest another command if the requested one was not found
  fix(core): only quote string flags that contain whitespace
  fix(core-blockchain): node stuck during sync  (#2220)
  docs: add #2217 to the changelog
  refactor(core): use restart instead of reload
  refactor(core): log the stderr output for pm2 errors
  refactor(core): handle pm2 errors outside of the process manager
  refactor(core): log the pm2 status if it is unknown
  refactor(core-p2p): log concise error message instead of dumping the reply (#2215)
  fix(core-blockchain): return if last downloaded block changed (#2216)
  fix(core-transaction-pool): invalid transactions after rollback (#2217)
  feat(core-p2p): Don't spoil the quorum if the peer has !forgingAllowed (#2214)
  fix(core): escape string flags
  docs: add #2207 to the changelog
  refactor(core-forger): Increase timeout for getting the network state (#2208)
  fix: vote balance update (#2207)
  fix(core): exclude undefined values from string casting
  build(docker): use latest release in production images
  chore: install stable release via setup script
  test(core-p2p): toBeGreaterThanOrEqual instead of toBe
  release: 2.2.0
  chore: bump version
  fix: schema
  fix: max payload size
  fix: quorum issues (#2091)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.