backtesting-assertions

backtesting-assertions

Phylax Credible Layer assertions backtesting. Runs assertion backtests against historical transactions. Use when validating phylax/credible layer assertions on real chain data or known exploits.

0星標
0分支
更新於 1/21/2026
SKILL.md
readonlyread-only
name
backtesting-assertions
description

"Phylax Credible Layer assertions backtesting. Runs assertion backtests against historical transactions. Use when validating phylax/credible layer assertions on real chain data or known exploits."

Backtesting Assertions

Use Credible Layer backtesting to replay historical transactions with assertions enabled.

Meta-Cognitive Protocol

Adopt the role of a Meta-Cognitive Reasoning Expert.

For every complex problem:
1.DECOMPOSE: Break into sub-problems
2.SOLVE: Address each with explicit confidence (0.0-1.0)
3.VERIFY: Check logic, facts, completeness, bias
4.SYNTHESIZE: Combine using weighted confidence
5.REFLECT: If confidence <0.8, identify weakness and retry
For simple questions, skip to direct answer.

Always output:
∙Clear answer
∙Confidence level
∙Key caveats

When to Use

  • You want to validate assertions against real mainnet transactions.
  • You are testing a known exploit block or incident transaction.
  • You need to confirm triggers match real protocol entrypoints.

When NOT to Use

  • You only need unit or fuzz tests. Use testing-assertions.
  • You are designing invariants or triggers. Use designing-assertions.
  • You only need Solidity implementation details. Use implementing-assertions.

Quick Start

  1. Place backtest files in assertions/test/backtest/ (e.g., VaultAssertion.backtest.t.sol).
  2. Create a test that inherits CredibleTestWithBacktesting.
  3. Configure BacktestingConfig with target contract, block range, and assertion selector.
  4. Call executeBacktest and assert failures are zero.
  5. Run with the backtest profile: FOUNDRY_PROFILE=assertions-backtest pcl test (or use --ffi flag).

See pcl-assertion-workflow for the full profile configuration with ffi = true.

Workflow

  • Pick a target contract (the assertion adopter address).
  • Choose endBlock and blockRange.
  • Verify RPC env vars; skip or fallback when missing.
  • Prefer useTraceFilter = true to detect internal calls; fall back to block scanning if your RPC lacks trace_filter.
  • For large ranges, use a paid RPC to avoid rate limits; useTraceFilter reduces calls.
  • Use forkByTxHash = true only when debugging state-dependent failures.
  • Use blockRange = 1 for a specific known exploit tx.
  • If your invariant is keyed by msg.data (timelocks), rebuild calldata from selector + args; call inputs exclude the selector.
  • Interpret results: PASS, NEEDS_REVIEW (selector mismatch or replay failure), ASSERTION_FAIL (often false positives or gas), UNKNOWN_ERROR (RPC or unexpected).
  • If many NEEDS_REVIEW, the selector/target does not match or you need forkByTxHash.

Rationalizations to Reject

  • "We only need unit tests." Backtesting catches real-world call patterns.
  • "Trace filter is optional." Without it you miss internal calls.
  • "forkByTxHash everywhere." It is slow and RPC-heavy; use it for debugging only.
  • "RPC isn't needed." Backtesting requires a working RPC and FFI.

References

You Might Also Like

Related Skills

fix

fix

243Kdev-testing

Use when you have lint errors, formatting issues, or before committing code to ensure it passes CI.

facebook avatarfacebook
獲取
peekaboo

peekaboo

179Kdev-testing

Capture and automate macOS UI with the Peekaboo CLI.

openclaw avataropenclaw
獲取
frontend-testing

frontend-testing

128Kdev-testing

Generate Vitest + React Testing Library tests for Dify frontend components, hooks, and utilities. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests, or write/review test requests.

langgenius avatarlanggenius
獲取
frontend-code-review

frontend-code-review

127Kdev-testing

Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules.

langgenius avatarlanggenius
獲取
code-reviewer

code-reviewer

92Kdev-testing

Use this skill to review code. It supports both local changes (staged or working tree) and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability, and adherence to project standards.

google-gemini avatargoogle-gemini
獲取
session-logs

session-logs

90Kdev-testing

Search and analyze your own session logs (older/parent conversations) using jq.

moltbot avatarmoltbot
獲取