-
Notifications
You must be signed in to change notification settings - Fork 456
Prevent crashing the application when a block is received and node is syncing or forging - Closes #3896 #3946
Prevent crashing the application when a block is received and node is syncing or forging - Closes #3896 #3946
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't change the receiveBlockFromNetwork
in block, but it should be rejected in transport layer as it was before
I like this idea if the changes are not massive - due to the possible accessibility issues of the |
@shuse2 you mean |
Also @shuse2 @pablitovicente shouldn't we add the task to the Sequence queue no matter what, and then the task itself could check if |
If the current status is
but this received is unnecessary, and only useful in case where it's pushed exactly when the sync is finishing |
…omNetwork is triggered" This reverts commit 89f918a Reason: this is not the problem. The problem is forging task is not being added to Sequence. Therefore this causes Forging to overlap with Syncing or Receiving blocks.
7f5c438
to
510dc3d
Compare
78951c4
to
e683795
Compare
What was the problem?
When receiving a block from the network in
receiveBlockFromNetwork
function, the application was crashing with a fatal error if the node was syncing or forging at that moment (akablocks.js#_isActive was set to true
)How did I fix it?
By adding back
forger.#forge
call to the Sequence. Somehow it was removed from it in2.2
Added a unit test case to cover this particular scenario.
How to test it?
Run these tests
npm run mocha:unit framework/test/mocha/unit/modules/chain/chain.js
Review checklist