Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
"lint": "pnpm run prettier && pnpm run forge-lint && pnpm run markdownlint",
"lint:check": "pnpm run prettier:check && pnpm run forge-lint:check && pnpm run markdownlint:check",
"test": "./shell/test_all.sh",
"test:unit": "forge test --no-match-contract '(Fork|Script)' --no-match-path 'src/test/proposals/*.t.sol' -vvv && npx prettier --write 'snapshots/**/*.json'",
"test:fork": "forge test --match-contract 'Fork' --no-match-contract 'CrossChainBridgeFork|TokenPoolFork' --fork-url mainnet -vvv",
"test:unit": "forge test --no-match-contract '(Fork|Script)' --no-match-path '{src/test/proposals/*.t.sol,src/test/deprecated/**}' -vvv && npx prettier --write 'snapshots/**/*.json'",
"test:fork": "forge test --match-contract 'Fork' --no-match-contract 'TokenPoolFork' --no-match-path 'src/test/deprecated/**' --fork-url mainnet -vvv",
"test:fork:loan-consolidator": "forge test --match-contract 'LoanConsolidatorFork' --fork-url mainnet -vvv",
"test:fork:boosted-liquidity": "forge test --match-contract 'BLVault.*Fork|BLVaultManager.*Fork' --fork-url mainnet -vvv",
"test:fork:proposal-helpers": "forge test --match-contract 'ConvertibleDepositActivatorFork|MigrationProposalHelperFork' --fork-url mainnet -vvv",
"test:fork:misc": "forge test --match-contract 'Fork' --no-match-contract 'CrossChainBridgeFork|TokenPoolFork|LoanConsolidatorFork|BLVault.*Fork|BLVaultManager.*Fork|ConvertibleDepositActivatorFork|MigrationProposalHelperFork' --fork-url mainnet -vvv",
"test:fork:misc": "forge test --match-contract 'Fork' --no-match-contract 'TokenPoolFork|LoanConsolidatorFork|BLVault.*Fork|BLVaultManager.*Fork|ConvertibleDepositActivatorFork|MigrationProposalHelperFork' --no-match-path 'src/test/deprecated/**' --fork-url mainnet -vvv",
"test:proposal": "forge test --match-path 'src/test/proposals/*.t.sol' --no-match-contract 'Fork' --fork-url mainnet -vvv",
"test:crosschainfork": "forge test --match-contract 'CrossChainBridgeFork|TokenPoolFork' -vvv",
"test:crosschainfork": "forge test --match-contract 'TokenPoolFork' -vvv",
"test:deprecated": "forge test --match-path 'src/test/deprecated/**' -vvv",
"test:coverage": "./shell/test_coverage.sh",
"size": "forge clean && forge build --sizes --optimizer-runs 10 --contracts src/policies/Operator.sol && forge build --sizes --optimizer-runs 5000 --contracts src/policies/cooler/MonoCooler.sol && forge build --sizes --skip 'src/test/*' --skip 'Operator.sol' --skip 'MonoCooler.sol'",
"metrics": "node shell/metrics.js",
Expand Down
40 changes: 20 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
minimumReleaseAge: 10080
minimumReleaseAgeExclude:
- "brace-expansion@2.1.3"
- "brace-expansion@5.0.8"
- "fast-uri@3.1.4"
auditConfig:
ignoreGhsas:
# 2.1.3 backports this fix, but the registry advisory still marks all versions <=5.0.7.
- "GHSA-mh99-v99m-4gvg"
- "js-yaml@4.3.1"
preferFrozenLockfile: true
engineStrict: true
strictDepBuilds: true
blockExoticSubdeps: true
allowBuilds: {}
overrides:
"brace-expansion@>=2.0.0 <2.1.3": "^2.1.3"
"brace-expansion@>=5.0.0 <5.0.8": "^5.0.8"
"fast-uri@>=3.0.0 <=3.1.3": "^3.1.4"
"brace-expansion@>=2.0.0 <2.1.4": "^2.1.4"
"brace-expansion@>=4.0.0 <5.0.9": "^5.0.9"
"fast-uri@>=3.0.0 <3.1.5": "^3.1.5"
"cross-spawn@>=7.0.0 <7.0.5": "^7.0.5"
"glob@>=11.0.0 <11.1.0": "^11.1.0"
"js-yaml@>=4.0.0 <4.3.0": "^4.3.0"
"js-yaml@>=4.0.0 <4.3.1": "^4.3.1"
"linkify-it@<=5.0.1": "^5.0.2"
"lodash@<=4.17.23": "^4.18.0"
"markdown-it@>=13.0.0 <14.2.0": "^14.2.0"
Expand Down
1 change: 1 addition & 0 deletions shell/test_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
echo "Running code coverage"
forge coverage --ir-minimum --report lcov --report summary \
--no-match-contract 'Script' \
--no-match-path 'src/test/deprecated/**' \
--skip 'src/scripts/deploy' \
--skip 'src/scripts/ops/batches' \
--skip 'src/scripts/ops/CalculateCoolerLtvUpdate.s.sol'
Expand Down
46 changes: 46 additions & 0 deletions src/test/deprecated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Deprecated Tests

Tests in this directory cover contracts that are no longer maintained or deployed as part of the
active protocol. They are kept for historical reference and so that refactors are still checked
against them at compile time.

## CI behaviour

These tests are **excluded from every CI workflow**. The exclusion is path-based, applied in
`package.json` and `shell/test_coverage.sh`:

| Script | Exclusion |
| ---------------------------------------- | --------------------------------------------------------------- |
| `test:unit` | `--no-match-path '{src/test/proposals/*.t.sol,src/test/deprecated/**}'` |
| `test:fork` | `--no-match-path 'src/test/deprecated/**'` |
| `test:fork:misc` | `--no-match-path 'src/test/deprecated/**'` |
| `test:coverage` (`shell/test_coverage.sh`) | `--no-match-path 'src/test/deprecated/**'` |

They are still compiled by `forge build`, so a change that breaks them fails CI at the build step.
This is deliberate: it flags the breakage without gating on assertions that depend on long-dead
on-chain state.

## Running them

```bash
pnpm run test:deprecated
```

This script is intentionally not wired into any workflow in `.github/workflows/`.

Some of these tests are expected to fail. See the notes at the top of each file.

## Adding to this directory

Move the test file (preserving its subpath under `src/test/`) into `src/test/deprecated/`. No
script or workflow changes are needed — the path-based exclusions above already cover it. Add a
note at the top of the file explaining why the contract is deprecated and, if the test fails,
why.

## Contents

- `policies/CrossChainBridge.t.sol` — LayerZero V1 bridge policy unit tests. Passing.
- `policies/CrossChainBridgeFork.t.sol` — LayerZero V1 bridge mainnet fork test. **Failing**:
the V1 endpoint now routes through the V2 ULN, which rejects the empty adapter params the V1
interface sends (`LZ_ULN_InvalidWorkerOptions`). Superseded by the LayerZero V2 gateway
(`src/test/policies/bridge/LZBridgeGateway/`) and the CCIP token pool.
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.0;

// DEPRECATED: LayerZero V1 bridge. Superseded by the LayerZero V2 gateway
// (src/test/policies/bridge/LZBridgeGateway/) and the CCIP token pool.
//
// `testCorrectness_SendOhm` is EXPECTED TO FAIL: the V1 endpoint at 0x66A7...d675 now routes
// through the V2 ULN, which reverts with `LZ_ULN_InvalidWorkerOptions(0)` on the empty adapter
// params the V1 interface sends. The test is retained for reference only.
//
// This file is excluded from CI by the path-based filters described in
// src/test/deprecated/README.md. Run it with `pnpm run test:deprecated`.

import {Test, Vm} from "forge-std/Test.sol";
import {console2} from "forge-std/console2.sol";
import {Bytes32AddressLib} from "solmate/utils/Bytes32AddressLib.sol";
Expand Down
13 changes: 10 additions & 3 deletions src/test/policies/bridge/CCIPBurnMintTokenPoolFork.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,23 @@ contract CCIPBurnMintTokenPoolForkTest is Test {
uint256 public mainnetForkId;
uint256 public polygonForkId;

// Pin the blocks so that RPC responses are cached
// Pin the block so that RPC responses are cached.
// Sepolia serves archive state, so this pin is stable.
uint256 public constant MAINNET_BLOCK = 8360176;
uint256 public constant POLYGON_BLOCK = 21855529;

// The Polygon Amoy fork is deliberately NOT pinned.
// The `polygon-amoy` alias in foundry.toml points at Alchemy, which serves Amoy from a full
// node rather than an archive node: state reads more than ~128 blocks (~4 minutes) behind the
// chain head fail with `-32001 Unable to complete request`. Any pinned block therefore breaks
// within minutes of being committed. Do not re-add a POLYGON_BLOCK constant unless the
// `polygon-amoy` RPC alias is first moved to a provider that serves Amoy archive state.

function setUp() public {
// Set up forks
// Mainnet is active
// These use Sepolia RPCs, as CCIPLocalSimulatorFork only supports sepolia testnets
mainnetForkId = vm.createFork("sepolia", MAINNET_BLOCK);
polygonForkId = vm.createFork("polygon-amoy", POLYGON_BLOCK);
polygonForkId = vm.createFork("polygon-amoy");
vm.selectFork(mainnetForkId);

// Addresses
Expand Down
Loading