Documentation

FMMidgard.OperatorDirectory.Props.Invariant

Operators Directory Properties. #

The properties listed in this file are not optimistic. The invariants listed here are invariant/properties of the Operator Directory module.

List Invariants. #

After detecting possible violations on one of the basic building blocks: key-unordered singly linked lists. Here we proposed a new property checking that the list is kept connected

Connected means that there is a path from root to last involving all tokens in existence. In particular, this property prevents operators to be left as dangling nodes. Dangling nodes cannot recover their bonds.

To prove it, we used a trace generation to find counter-examples. See FMMidgard.DataStructures.List.SimProp+160.

In this case, it means that a reachable OperatorsDirectory state, contains reachable states on each of its lists.

Actions Pre/Post condictions and Properties. #

Activate Properties. #

Activate opDir ! .Activate tkn anch ↝ opsDir' conditions are:

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem OperatorDirectory.Properties.Actions.activate_props {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_tkn : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Activate tkn anch ret_non act_tkn, info := i } opDir opDir') :
    activate_prop_def tkn anch act_tkn ret_non opDir opDir'
    theorem OperatorDirectory.Properties.Actions.next_activate_props {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_anchor : Tokens.Elem.TId} (Step : StateMachine.next p { act := State.OperActions.Activate tkn anch ret_non act_anchor, info := i } opDir = ComputationResult.Success opDir') :
    activate_prop_def tkn anch act_anchor ret_non opDir opDir'
    theorem OperatorDirectory.Properties.Actions.activate_insert_activates {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Activate tkn anch ret_non act_anchor, info := i } opDir opDir') :

    After activation we insert a node in the active list with the same key

    theorem OperatorDirectory.Properties.Actions.activate_register_removes {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Activate tkn anch ret_non act_anchor, info := i } opDir opDir') :

    Activating a node removes it from the registered list

    theorem OperatorDirectory.Properties.Actions.activate_register_not_self {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Activate tkn anch ret_non act_anchor, info := i } opDir opDir') :
    ¬tkn = anch

    We cannot activate operators using themselves as anchors.

    theorem OperatorDirectory.Properties.Actions.activate_register_non_retired {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_anchor : Tokens.Elem.TId} {key : MUList.State.Key} (Step : Relation p { act := State.OperActions.Activate tkn anch ret_non act_anchor, info := i } opDir opDir') (Key : MUList.State.ListST.get_key tkn opDir.registered = some key) :

    Activation of no-retired operators.

    theorem OperatorDirectory.Properties.Actions.activate_same_retired {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {toact anchor_reg ret_non act_anch : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Activate toact anchor_reg ret_non act_anch, info := i } opDir opDir') :
    opDir'.retired = opDir.retired

    Activation does not modify retired operators.

    theorem OperatorDirectory.Properties.Actions.activate_register_membership {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch ret_non act_anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Activate tkn anch ret_non act_anchor, info := i } opDir opDir') :

    Activation removes a registered operator, modifies it's anchor properly, and all other registered operators remain the same.

    Retiring Properties. #

    theorem OperatorDirectory.Properties.Actions.retired_active_substep {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anchor ret_anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Retire tkn anchor ret_anchor, info := i } opDir opDir') :

    Retiring removes an operator from the active list.

    Retiring operators adds the retiring operator to the retired ops list.

    theorem OperatorDirectory.Properties.Actions.retired_registered {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anchor ret_anchor : Tokens.Elem.TId} (Step : StateMachine.next p { act := State.OperActions.Retire tkn anchor ret_anchor, info := i } opDir = ComputationResult.Success opDir') :
    opDir.registered = opDir'.registered

    Retiring operators do not modify the registered list.

    Register Operators #

    theorem OperatorDirectory.Properties.Actions.register_same_active {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Register tkn, info := i } opDir opDir') :
    opDir'.active = opDir.active

    Registering operators do not modify the active list.

    theorem OperatorDirectory.Properties.Actions.register_same_retired {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Register tkn, info := i } opDir opDir') :
    opDir'.retired = opDir.retired

    Registering operators do not modify the retired list.

    Registering operators add an operator to the end of the list, all other registered operators remain the same but the last, now leading to the just added operator.

    Registering operators prepend operators into the registered operators list.

    Deregister Operators #

    theorem OperatorDirectory.Properties.Actions.deregister_same_active {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Deregister tkn anch, info := i } opDir opDir') :
    opDir'.active = opDir.active

    Deregistering operators do not modify the active list.

    theorem OperatorDirectory.Properties.Actions.deregister_same_retired {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anch : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.Deregister tkn anch, info := i } opDir opDir') :
    opDir'.retired = opDir.retired

    Deregistering operators do not modify the retired list.

    Deregistering removes an operator from the registered list, all but the anchor remains the same, the anchor node is updated properly.

    Remove Duplicate Propes #

    Removes Duplicate operations do not modify the active list.

    Removes Duplicate operations do not modify the retired list.

    Removes Duplicate operations remove a regiseterd operator.

    Active Remove Bad Operator #

    An active operator is removed.

    Registered list is not modified.

    theorem OperatorDirectory.Properties.Actions.retired_remove_bad_registered {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.ActRemoveOperatorBad tkn anchor, info := i } opDir opDir') :
    opDir'.retired = opDir.retired

    Retired list is not modified.

    Update Bond #

    If we updated the bond of an operator, then transaction infomation i has it's transaction interval upper bound defined and we updated the bond hold variable properly: upper_bond + maturity_duration.

    Update pond does not modify the active members. It does not add nor remove members, just modify the data of one of them.

    Update pond does not modify the registered operators list.

    Update pond does not modify the retired operators list.

    Recover Bond #

    theorem OperatorDirectory.Properties.Actions.recover_bond_same_active {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.RecoverBond tkn anchor, info := i } opDir opDir') :
    opDir'.active = opDir.active

    Active operators list remains the same.

    theorem OperatorDirectory.Properties.Actions.recover_bond_same_registered {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.RecoverBond tkn anchor, info := i } opDir opDir') :
    opDir'.registered = opDir.registered

    Registered operators list remains the same.

    The operator recovering it's bond is removed from the retired operators list.

    Remove Bad Retired Operator Props #

    theorem OperatorDirectory.Properties.Actions.retired_remove_same_active {opDir opDir' : State.OperatorDirectory} {p : MidgardParameters} {i : InputInfo} {tkn anchor : Tokens.Elem.TId} (Step : Relation p { act := State.OperActions.RetRemoveOperatorBad tkn anchor, info := i } opDir opDir') :
    opDir'.active = opDir.active

    The active operators list remains the same.

    The registered operators list remains the same.

    The bad retired operator is removed from the retired operators list.

    Registered Operators Queue #

    Inv Registered Operators time is GT #

    From the spec document, it seems the Midgard designers assume time increases when operators are registered. This is false, since within a certain range, users can set the transaction validity interval bounds of each transaction.

    In particular, this affects the activation criteria. See issue Registered Operators Eligible for Activation Criteria and Scheduler Rewind

    The scheduler only checks the time of the oldest operator registered (by it's position in the registered list.), but there may be operators eligible for activation.

    Operators can register themselves.

    Provided: operator sends bond and sets a valid transaction validity upper bound. Inv: [](Enabled(∀ op, <op>.Register))

    This is part of Register and Activer Operators invariant in the spec.

    Registered node can be activated if its waiting activation time has passed.

    Requires: Operator is not already activated nor retired. Inv [](ActivationTimePassed(t) -> Enabled(.Activation t))

    theorem OperatorDirectory.Properties.Registered.RegisteredBecomeActive (p : MidgardParameters) (opsDir : State.OperatorDirectory) {opId : OperatorId} {nd anchor : Tokens.Elem.TId} {node anchor_node : MUList.State.ListToken PosixTime} (HNode : Tokens.State.Tokens.get nd opsDir.registered = some node) (HAnch : Tokens.State.Tokens.get anchor opsDir.registered = some anchor_node) (HPth : anchor_node.data.link = some opId) (HNoSelf : ¬nd = anchor) (last_in_reg : MUList.State.midgard_is_member opId node = true) (ret_non : Tokens.Elem.TId) (HNoRet : MOList.Operations.is_non_member (some opId) ret_non opsDir.retired = true) (act_non : Tokens.Elem.TId) (HNoAct : MOList.Operations.is_non_member (some opId) act_non opsDir.active = true) (tx : InputInfo) (ll : PosixTime) (HSome : tx.validityInternal.lower = some ll) (HAfter : node.data.data ≤ ll) :

    Registered operators can de-registerd whenever they want.

    Inv: []( p ∈ Registered -> Enabled(Deregister(p)))

    Activated operators list is decr-sorted.

    Active operators can retire whenever they want.

    [](p ∈ active ∧ p ∉ retired -> Enabled(Retire(p)))

    We proved that if we are in a reachable state Active and Retired lists are disjoint lists.

    We detected that there are no restrictions when it comes to retire operators. See issue Anyone can retire active operators.

    Active and Retired ops lists are disjoint.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For