Scorex icon indicating copy to clipboard operation
Scorex copied to clipboard

Persistent modifier validation improvement

Open oskin1 opened this issue 7 years ago • 2 comments

Now we have quite flat validation algorithm for persistent modifiers - it does many checks in one step, this leads to impossiblity of handling all validation-failure cases properly. For example, if we're trying to validate block section (S) for some header (H) and validation fails at the first step then there are few cases which further application handling depends on:

  1. S does not really relates to H - so we should just invalidate S
  2. S relates to H but was malformed - here we should invalidate S and also H Current validation implementation in Scorex does not allow to distinguish case 1 and 2. https://github.com/ScorexFoundation/Scorex/blob/8adeddbaba7a49e0614f7df7de31fcaf73a263de/src/main/scala/scorex/core/NodeViewHolder.scala#L268

oskin1 avatar Oct 17 '18 19:10 oskin1

Possible solution could be to subscribe to SyntacticallyFailedModification(S), check if some S relates to H it refers to, and then invalidate H.

oskin1 avatar Oct 22 '18 13:10 oskin1

@oskin1 what changes to Scorex you are proposing?

kushti avatar Oct 29 '18 12:10 kushti