Skip to content

Make the deploy-constant check pointer-driven (drop the hardcoded prefix list + FFI/soldeer fetch) #2799

Description

@thedavidmeister

What

Rework raindex's deploy-constant completeness check to be pointer-driven — enumerate the generated src/generated/*.pointers.sol and verify each DEPLOYED_ADDRESS is pinned in LibRaindexDeploy.sol — instead of the current script/check-published-deploy-constants.sh (which fetches published soldeer versions via FFI and greps a hardcoded list of six contract prefixes).

Why

Two brittleness sources the pointer-driven form removes:

  1. Hardcoded contract list. The six *_DEPLOYED prefixes are maintained by hand. Add a seventh deployed contract and the check keeps passing — it never knew to look for it. That's the exact "forgot to pin a constant" gap the check exists to close, reintroduced one level up in the check itself.

  2. Network + FFI dependency. The check needs FFI and a live registry call, so it SKIPs on network flakiness — a guard that can silently not-run. The generated pointer files are already the local, authoritative record of what the current build deploys; comparing them to the lib needs neither.

A pointer-driven check enumerates src/generated/*.pointers.sol, extracts each DEPLOYED_ADDRESS, and asserts the lib pins that address (case-insensitive on the checksummed hex). It auto-covers every new deployed contract, catches a forgotten or drifted address, and runs offline with just grep — no FFI, no SKIP, and it can drop from a vm.ffi test to a plain CI step.

Scope note (version history)

The current check verifies every published soldeer version has its constant suite; pointer-driven verifies the current build's pointers are pinned. These converge going forward — bumping the version regenerates the pointers, and the new (unpinned) addresses fail the check until pinned, so "published a new version without constants" is still caught. Frozen historical-version constants are immutable references already verified when they were added, so they need no live re-check. If an explicit per-published-version assertion is still wanted it can sit alongside as a separate concern; the completeness/anti-drift guard is better pointer-driven.

Context

This is the form being implemented for st0x.deploy (which has no FFI). Unifying raindex onto it drops raindex's FFI dependency for this check.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions