assert_true failed in Cairo: Revert propagation ambiguity
0 reputation · 25 Aug 2026, 18:51 UTC
assert_true failed in Cairo: Revert propagation ambiguity
The assert_true macro in Cairo produces a runtime failure when its condition evaluates to false, typically reported as an "assert_true failed" error. When the condition is a function call that may revert, the language reference does not specify whether the revert is propagated to the caller or suppressed in favor of the assertion failure.
Developers using function reverts for control flow need to know the exact semantics because it determines whether a revert will unwind the stack or simply cause an assertion error. Current releases of the Cairo compiler and the StarkNet runtime appear to exhibit inconsistent behavior, and the documentation lacks a formal definition.
To clarify this behavior, we need to understand:
- When an
assert_truecondition contains a function that reverts, does the revert propagate to the caller or is it replaced by the assertion failure? - Is the observed behavior consistent between the Cairo compiler’s runtime and the StarkNet devnet?
- Does the behavior change across Cairo releases (e.g., 0.12.x vs 0.13.x)?