Scorex icon indicating copy to clipboard operation
Scorex copied to clipboard

History reportModifierIsValid

Open i-Alex opened this issue 5 years ago • 0 comments

When we are going to apply some persistent modifier (block) to the Node in NodeViewHolder we are processing modifier step by step:

  1. Append it to History and collect some changes (ProgressInfo)
  2. In case of success, apply changes to State
  3. After each successful applying notify History via reportModifierIsValid method.

From a History point of view History.reportModifierIsValid execution means that we applied a new Tip to our chain. For example, in HybridApp HybridHistrory.reportModifierIsValid updating of best block (tip) is done.

From other side, if we have some Fork, then before applying fork blocks to the State, we should do a rollback to some branch point first. But in this case no notification of History provided.

So, at least for me, "reportModifierIsValid" naming is misleading. Also absence of notification after State rollback seems strange.

Can you explain current logic? Thanks a lot!

i-Alex avatar Jul 26 '19 12:07 i-Alex