Skip to content

Commit

Permalink
Add Inv to ValidatorUpdatesArePropagated
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Oct 6, 2023
1 parent 2000272 commit 7cd826b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/difference/core/quint_model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ or all invariants one after another with the help of the script `run_invariants.
Each invariant takes about a minute to run.

Invariants are as follows:
- [X] ValidatorUpdatesArePropagated: When a validator power update is comitted on chain, a packet containing that change in voting power is sent to all running consumers.
- [X] ValidatorUpdatesArePropagatedInv: When a validator power update is comitted on chain, a packet containing that change in voting power is sent to all running consumers.
- [X] ValidatorSetHasExistedInv: Every validator set on consumer chains is/was a validator set on the provider.
- [X] SameVSCPacketsInv: Ensure that consumer chains receive the same VSCPackets in the same order.
Because of nuances with starting/stopping consumers, this invariant is not as simple as it sounds. In detail:
Expand All @@ -52,7 +52,7 @@ that were running at the time the packet was sent (and are still running).

Invariants can also be model-checked by Apalache, using this command:
```
quint verify --invariant ValidatorUpdatesArePropagated,ValidatorSetHasExistedInv,SameVSCPacketsInv,MatureOnTimeInv,EventuallyMatureOnProviderInv \
quint verify --invariant ValidatorUpdatesArePropagatedInv,ValidatorSetHasExistedInv,SameVSCPacketsInv,MatureOnTimeInv,EventuallyMatureOnProviderInv \
--main CCVDefaultStateMachine ccv_statemachine.qnt
```

Expand Down
2 changes: 1 addition & 1 deletion tests/difference/core/quint_model/ccv_statemachine.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ module CCVDefaultStateMachine {
// Any update in the power of a validator on the provider
// MUST be present in a ValidatorSetChangePacket that is sent to all registered consumer chains
val ValUpdatePrecondition = trace[trace.length()-1] == "EndAndBeginBlockForProvider"
val ValidatorUpdatesArePropagated =
val ValidatorUpdatesArePropagatedInv =
// when the provider has just entered a validator set into a block...
if (ValUpdatePrecondition and currentState.providerState.providerValidatorSetChangedInThisBlock) {
val providerValSetInCurBlock = providerValidatorHistory.head()
Expand Down
2 changes: 1 addition & 1 deletion tests/difference/core/quint_model/run_invariants.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
quint run --invariant "all{ValidatorUpdatesArePropagated,ValidatorSetHasExistedInv,SameVSCPacketsInv,MatureOnTimeInv,EventuallyMatureOnProviderInv}" ccv_statemachine.qnt --main CCVDefaultStateMachine --max-steps 500 --max-samples 200 --out out.log
quint run --invariant "all{ValidatorUpdatesArePropagatedInv,ValidatorSetHasExistedInv,SameVSCPacketsInv,MatureOnTimeInv,EventuallyMatureOnProviderInv}" ccv_statemachine.qnt --main CCVDefaultStateMachine --max-steps 500 --max-samples 200 --out out.log

0 comments on commit 7cd826b

Please sign in to comment.