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): reset wakeup timeout #1946

Merged
merged 5 commits into from Jan 5, 2019

Conversation

Projects
None yet
3 participants
@supaiku0
Copy link
Contributor

supaiku0 commented Jan 5, 2019

Proposed changes

The state machine wakes up once per minute to look for new blocks. This is not necessary when the node periodically receives blocks from peer broadcasts. Thus reset the wake-up timeout after successfully chaining a new block and wait for the full duration again.

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)

@supaiku0 supaiku0 requested a review from faustbrian Jan 5, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 5, 2019

Codecov Report

Merging #1946 into develop will increase coverage by 0.04%.
The diff coverage is 93.75%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1946      +/-   ##
===========================================
+ Coverage    41.22%   41.26%   +0.04%     
===========================================
  Files          351      351              
  Lines         7729     7735       +6     
  Branches      1131     1132       +1     
===========================================
+ Hits          3186     3192       +6     
  Misses        4529     4529              
  Partials        14       14
Impacted Files Coverage Δ
packages/core-blockchain/src/state-storage.ts 86.11% <100%> (+0.19%) ⬆️
packages/core-blockchain/src/state-machine.ts 42.34% <100%> (-0.59%) ⬇️
packages/core-blockchain/src/blockchain.ts 70.12% <88.88%> (+0.89%) ⬆️

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 12a6aa7...8e7d866. Read the comment docs.

/**
* Set wakeup timeout to check the network for new blocks.
*/
public setWakeUp() {

This comment has been minimized.

@faustbrian

faustbrian Jan 5, 2019

Collaborator
Suggested change Beta
public setWakeUp() {
public setWakeUp(): void {
/**
* Reset the wakeup timeout.
*/
public resetWakeUp() {

This comment has been minimized.

@faustbrian

faustbrian Jan 5, 2019

Collaborator
Suggested change Beta
public resetWakeUp() {
public resetWakeUp(): void {

@faustbrian faustbrian merged commit e5d9abd into ArkEcosystem:develop Jan 5, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment