Skip to content

Notary's state depends on configurable MaxValidUntilBlockIncrement #3841

@AnnaShaleva

Description

@AnnaShaleva

Current Behavior

Notary contract uses MaxValidUntilBlockIncrement value that is not a part of Policy, i.e. not a part of the chain's state and hence, can be changed at any time the node is being reloaded:

maxInc := cfg.MaxValidUntilBlockIncrement
if value > maxInc/2 || value < uint32(cfg.GetNumOfCNs(ic.BlockHeight())) {
panic(fmt.Errorf("MaxNotValidBeforeDelta cannot be more than %d or less than %d", maxInc/2, cfg.GetNumOfCNs(ic.BlockHeight())))
}

It may affect setMaxNotValidBeforeDelta transaction processing whereas we need a well-reproducible state processing results that don't depend on the node's config in that way.

Moreover, it will be affected by #3745:

cfg.MaxValidUntilBlockIncrement = uint32(timePerDay / cfg.TimePerBlock)

Likely, we don't have such cases in our networks, but the possibility exists.

Expected Behavior

No such dependency should exist.

Possible Solution

Set MaxValidUntilBlockIncrement to a constant or move it to Policy.

Metadata

Metadata

Assignees

Labels

I4No visible changesS4RoutineU3RegularbugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions