Skip to content

migrate mainnet health tests from tenderly to foundry - #205

Merged
ivanzhelyazkov merged 1 commit into
devfrom
migrate-health-tests-to-foundry
Oct 16, 2026
Merged

ivanzhelyazkov merged 1 commit into
devfrom
migrate-health-tests-to-foundry

Conversation

@ivanzhelyazkov

Copy link
Copy Markdown
Collaborator

Migrate mainnet health tests from Tenderly to Foundry

Summary

  • Replaces the Tenderly/hardhat health job with a Foundry suite that runs against a mainnet fork (test/forge/fork/MainnetHealth.t.sol). health.yml still runs it every 2h, via pnpm test:health.
  • Covers everything deploy/tests/mainnet/carbon.ts asserted, using the same shared trade test data. Adds deployment-integrity checks:
    • implementations match deployments/mainnet
    • implementations are locked
    • postUpgrade can't be replayed
    • ProxyAdmin owner and ROLE_ADMIN holders are the expected accounts
    • voucher controller is the CarbonController
    • vortex execute collects fees
  • Storage-gap checks move from hardhat shouldHaveGap to deployments/check-storage-gaps.sh (pnpm test:storage), which now also runs in CI.
  • The suite only runs with FORK_TESTS=1; plain forge test skips it. The RPC comes from utils/rpcUrls.json, and the optional MAINNET_RPC_URL secret overrides it. The public fallback passes: one fork per run, ~370 RPC requests.

Notes

  • The scheduled job no longer runs pending deployments first. Before running a new migration on mainnet, rehearse it with pnpm test:deploy:mainnet (Tenderly).
  • After an upgrade runs on mainnet, testImplementationsMatchDeploymentArtifacts fails until the updated deployments/mainnet artifacts are merged. This is by design.
  • Run it locally with forge v1.3.5 (the CI pin).

Testing

  • pnpm test:health on forge 1.3.5: 36/36 pass, both on a dedicated RPC and on public drpc
  • pnpm test:storage: all 6 contracts pass
  • pnpm lint:sol: clean

@ivanzhelyazkov
ivanzhelyazkov merged commit 4a18886 into dev Oct 16, 2026
@ivanzhelyazkov
ivanzhelyazkov deleted the migrate-health-tests-to-foundry branch October 16, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants