-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Hi,
There seems to be a situation where a DAG branch might be left partially unprocessed and never repaired.
- When processing a node, one of the first actions taken by
processNode
right after merging the delta into the set is to mark the node as processed. - In the beginning of
handleBlock
, any node that is already marked as processed is skipped.
Since branches are processed starting from the head and then walking down the branch, It looks like this may lead to the following scenario: if the server crashes after a node is marked as processed, but before its children are processed, then we may end up in a situation where the branch is left unprocessed and wouldn't be repaired by the automatic repair mechanism, because it was not marked as dirty.
Is this assumption correct, or am I missing something? If it's correct, then I imagine a way to fix it could be (1) only mark the branch's head as processed at the end, or (2) save to the store the fact that processing is under way, so that it can verify that there was processing under way upon startup.