What does this block mean?
preserved with (env e) {
require false;
}
What does this block mean?
preserved with (env e) {
require false;
}
require false
effectively disables the check where it appears, as no real execution trace can satisfy it.
A preserved block is appended to the assumptions on functions being checked for the invariant where the preserved blocks appear, so this could disable most of the invariant’s checks.
does it mean the invariant is not in effect? Why is it needed then?
Yes, for methods that do not have their own preserved
blocks.
Usually it’s not recommended to apply this globally like in the snippet you shared, but one may do that if they wish to check the invariant only on a subset of the methods (having their own dedicated preserved
blocks).
Maybe if you can share the full context it could be discussed further whether the require false
is indeed necessary.