Skip to content

Potential issue where DAG branch might be left partly processed #279

@pcsegal

Description

@pcsegal

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.

Metadata

Metadata

Assignees

Labels

P2Medium: Good to have, but can wait until someone steps upeffort/hoursEstimated to take one or several hoursexp/beginnerCan be confidently tackled by newcomersgood first issueGood issue for new contributorshelp wantedSeeking public contribution on this issuekind/enhancementA net-new feature or improvement to an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions