Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Persistent modifier validation improvement #317

Open
oskin1 opened this issue Oct 17, 2018 · 2 comments
Open

Persistent modifier validation improvement #317

oskin1 opened this issue Oct 17, 2018 · 2 comments

Comments

@oskin1
Copy link
Contributor

oskin1 commented Oct 17, 2018

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
Copy link
Contributor Author

oskin1 commented Oct 22, 2018

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

@kushti
Copy link
Contributor

kushti commented Oct 29, 2018

@oskin1 what changes to Scorex you are proposing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants