Skip to main content
Find the error below, then check its cause and solution.

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
In testing:
  • 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.
Production Behavior:
  • 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
Solution (Testing): Move all setup code before cl.assertion(). The cl.assertion() call registers the assertion for the next monitored external call, similar to vm.prank().
Debugging:
  • 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 -vvv to 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:
Solution: Register triggers on the external entry points, not internal functions. Only external calls (including 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 with OutOfGas and the Enforcer returns an invalid result even if there’s no actual violation. The network then applies its inclusion policy. Symptoms:
  • OutOfGas error 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
Common Causes:
  • 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
Solutions:
  1. Fail fast - Check simple conditions first before expensive operations
  2. Optimize loops - Limit iterations, cache values outside loops
  3. Cache storage reads - Read once, reuse the value
  4. Split complex assertions - Break into multiple assertion functions with specific triggers
Debugging: Use 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:
The Phylax helper 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
Solution: Move logic that requires cheatcodes to the assertion function:

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:
How to Verify:
  • Check that the selector matches the function signature
  • Use Protocol.functionName.selector for type safety
  • Ensure the trigger is registered in the triggers() function
  • Each assertion function needs its own trigger registration

Call Input Double-Counting

Problem: Using getAllCallInputs() may include duplicate calls from proxy contracts. Solution: Use specific call type functions:
Available Functions:
  • ph.getCallInputs() - CALL opcode inputs
  • ph.getStaticCallInputs() - STATICCALL inputs
  • ph.getDelegateCallInputs() - DELEGATECALL inputs
  • ph.getCallCodeInputs() - CALLCODE inputs
  • ph.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:
Solution: Store view function results before calling vm.prank():
Why This Happens:
  • 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
Debugging Tip: Run tests with -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 without cl.assertion() to isolate the issue:

pcl Command Issues

Build and Test Failures

Common Causes:
  • Missing FOUNDRY_PROFILE=assertions environment variable (see Foundry Profile Configuration)
  • Incorrect foundry.toml configuration
  • Missing dependencies or remappings
Solution: Select the assertion profile defined in your project’s foundry.toml. For a project with an assertions profile:
Debugging Commands:
Additional Checks:
  • Check foundry.toml has assertions profile configured
  • Verify remappings.txt includes credible-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

Use pcl 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
What to Look For:
  • 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

Add console.log() statements to your assertion functions for debugging. Note that console.log() only accepts a single string argument, so use string concatenation for values:
Console logs only appear when running pcl test, not in production.

Getting Help

If you’ve tried the solutions above and still can’t resolve your issue:
  1. Check the error message - Look for specific error details in verbose output
  2. Isolate the problem - Test protocol function without assertion to identify root cause
  3. Gather information:
    • Error message and stack trace
    • Test code that reproduces the issue
    • Gas usage (if gas-related)
    • Verbose output (-vvv)
Support Channels: Related Documentation: