Quick Reference
Ethereum Submission and Enforcement
Use Ethereum Integration Planning and Guard Testing to isolate coverage from assertion-logic issues.
Assertion Not Executing
”Expected 1 assertion to be executed, but 0 were executed”
In the local harness, this error means the expected assertion function did not run on the monitored call. Missing coverage in Alerting, Production, or a release backtest is a separate observation; do not assume those environments emit this test-harness message. Common Causes: In alerting, production, or a platform release backtest:- The transaction that triggers the assertion fails or reverts before the assertion runs
- The function selector in the trigger doesn’t match the function being called
- Wrong function called - A call to a function other than the target function exists between
cl.assertion()and the target function call - Assertion (
cl.assertion()) placed incorrectly - Not immediately before the target function call - Trigger function call fails or reverts - The transaction may fail for various reasons. Write a test without
cl.assertion()to isolate the issue.
- If an active assertion reverts, the enforcer reports the failure to the participating builder for exclusion
- If its trigger does not match, that assertion provides no check for the candidate; other assertions, the guard, and ordinary protocol validity still apply
cl.assertion(). The cl.assertion() call registers the assertion for the next monitored external call, similar to vm.prank().
- Verify the function selector in the trigger matches the function being called
- In testing, write a test without
cl.assertion()to check if the protocol function reverts - Use
pcl test -vvvto see detailed execution traces
Internal Calls Not Triggering Assertions
Problem: Assertion doesn’t trigger when a protocol uses internal function calls. Cause: Internal calls are a Solidity language feature, not actual EVM calls. They are not traced and won’t trigger call-based assertions. Example:this.functionName()) generate CallInputs and can trigger assertions.
Assertion Code Issues
These errors occur when the assertion executes but fails due to issues in the assertion code.Gas Limit Exceeded
Assertion execution has a runtime-configured gas budget. Confirm the active value with the deployment operator. If an assertion exceeds the active limit, it reverts withOutOfGas and the Enforcer returns an invalid result even if there’s no actual violation. The network then applies its inclusion policy.
Symptoms:
OutOfGaserror when running tests- “Unknown Revert Reason” with gas cost near the active assertion limit in a platform release backtesting result
- Assertion fails consistently on complex transactions
- Expensive operations in loops
- Parsing too many events
- Multiple storage reads without caching
- Complex calculations without early returns
- Happy path runs the most code - When no violation occurs, the assertion runs all checks and iterations without early exit
- Fail fast - Check simple conditions first before expensive operations
- Optimize loops - Limit iterations, cache values outside loops
- Cache storage reads - Read once, reuse the value
- Split complex assertions - Break into multiple assertion functions with specific triggers
pcl test -vvv to see detailed gas usage per operation.
Storage Access Errors
Error:vm.load() is not available in assertions
Solution: Use ph.loadStateAt() with an explicit ForkId instead:
ph provides storage access, not the standard Forge vm cheatcode. New assertions should prefer Reshiram snapshot reads instead of legacy global fork switching.
Constructor Limitations
Problem: Cheatcodes fail or return unexpected values in assertion constructors. Causes:- Cheatcodes (
ph.*) are not available in constructors - Constructor runs against empty state and cannot read from other contracts
ph.getAssertionAdopter()is only available in assertion functions
Function Selector Errors
Problem: Wrong function selector in trigger registration causes the assertion to not trigger or trigger on the wrong function. Solution: Use the actual function selector from the interface:- Check that the selector matches the function signature
- Use
Protocol.functionName.selectorfor type safety - Ensure the trigger is registered in the
triggers()function - Each assertion function needs its own trigger registration
Call Input Double-Counting
Problem: UsinggetAllCallInputs() may include duplicate calls from proxy contracts.
Solution: Use specific call type functions:
ph.getCallInputs()- CALL opcode inputsph.getStaticCallInputs()- STATICCALL inputsph.getDelegateCallInputs()- DELEGATECALL inputsph.getCallCodeInputs()- CALLCODE inputsph.getAllCallInputs()- All call types (may include duplicates from proxy contracts)
Test-Specific Issues
These issues only occur during testing, not in production.Inline Function Calls Consuming vm.prank()
When you pass a function call as a parameter, that inner call executes first and consumes the vm.prank().
Problem:
vm.prank():
- Solidity evaluates function parameters before executing the outer function
vm.prank()only affects the next external call- The inner function call is that “next call”
- By the time the outer function executes, the prank is already consumed
-vvv to see call traces. Look for unexpected addresses in error messages (test contract address where user expected).
Can’t Distinguish Protocol vs Assertion Revert
Problem: When a test reverts, it’s not clear whether the protocol function or the assertion caused it. Solution: Write a test withoutcl.assertion() to isolate the issue:
pcl Command Issues
Build and Test Failures
Common Causes:- Missing
FOUNDRY_PROFILE=assertionsenvironment variable (see Foundry Profile Configuration) - Incorrect
foundry.tomlconfiguration - Missing dependencies or remappings
foundry.toml. For a project with an assertions profile:
- Check
foundry.tomlhas assertions profile configured - Verify
remappings.txtincludescredible-std/=lib/credible-std/src/
Release backtesting findings
The platform runs backtesting automatically when you create a release. An Issue found result means at least one historical transaction in the run’s reported block range would have been invalidated by the release. Open Backtesting in the release and review the matched transaction hash, assertion ID, adopter, incident payload, previous transactions, and block environment. If the finding is benign, tune the assertion and create a new release. If the evidence does not explain the finding, do not deploy the release. See How to Review Backtesting Results for the complete workflow.Debugging
Using Verbose Output
Usepcl test -vvv to get detailed information:
- Call traces - See which functions executed and in what order
- Gas usage - Identify expensive operations causing gas limit issues
- Error messages - Get detailed revert reasons and stack traces
- State changes - Track storage modifications
- Unexpected function calls between
cl.assertion()and target function - Gas consumption hitting the active assertion limit
- Wrong addresses in call traces (indicates
vm.prank()issues) - Revert locations to identify assertion vs protocol failures
Console Logging
Addconsole.log() statements to your assertion functions for debugging. Note that console.log() only accepts a single string argument, so use string concatenation for values:
pcl test, not in production.
Getting Help
If you’ve tried the solutions above and still can’t resolve your issue:- Check the error message - Look for specific error details in verbose output
- Isolate the problem - Test protocol function without assertion to identify root cause
- Gather information:
- Error message and stack trace
- Test code that reproduces the issue
- Gas usage (if gas-related)
- Verbose output (
-vvv)
- GitHub Issues - Report bugs or ask questions
- Telegram - Community support
- Writing Your Own Policies - Learn assertion patterns
- Testing Assertions - Testing best practices
- pcl Reference - Command-line tool documentation
- Cheatcodes Reference - Available Phylax cheatcodes

