Skip to content

feat(common): add ABI compatibility checks and reorganize CI scripts#2182

Merged
mergify[bot] merged 26 commits intomainfrom
elias/abi-compat-check-refresh
Mar 26, 2026
Merged

feat(common): add ABI compatibility checks and reorganize CI scripts#2182
mergify[bot] merged 26 commits intomainfrom
elias/abi-compat-check-refresh

Conversation

@Eikix
Copy link
Copy Markdown
Contributor

@Eikix Eikix commented Mar 26, 2026

Summary

  • Add a shared ABI compatibility checker plus a CI entrypoint for host and gateway contracts
  • Add a local wrapper command to compare two refs with the same core logic used in CI
  • Reorganize ci/ into subsystem folders: abi-compat/, upgrade-check/, shared/
  • Fix code smells: broken import in exceptions.ts, missing error handling in upgrade-check list.ts, incorrect repoRoot computation
  • Cover deployed HCULimit and CiphertextCommits in ABI compatibility checks while ignoring executor-only HCULimit entrypoints

Structure

ci/
├── abi-compat/     check.ts, config.ts, exceptions.ts, lib.ts, list.ts, README.md
├── upgrade-check/  check.ts, config.ts, hints.ts, lib.ts, list.ts
├── shared/         merge-address-constants.ts
└── README.md

Both subsystems follow the same pattern:

  • check.ts — CI entrypoint (single package, GitHub Actions annotations)
  • lib.ts — core comparison logic
  • list.ts — local multi-package report (creates worktrees, installs deps, runs comparison)
  • config.ts — package names, contract lists, build deps

What ABI compat checks

  • Compares deployed contract ABIs against a baseline tag
  • Matches by full canonical ABI signature (overloads supported)
  • Filters out initializer/reinitializer and gated admin/protocol-only functions by modifier pattern
  • Excludes HCULimit executor-only checkHCUFor* entrypoints from the stable ABI surface
  • Allows additions and fails when a stable signature disappears

Local usage

bun ci/abi-compat/list.ts --from v0.11.1 --to v0.12.0-0
bun ci/abi-compat/list.ts --from v0.11.1 --package host-contracts
bun ci/abi-compat/list.ts --from v0.11.1 --package gateway-contracts
bun ci/upgrade-check/list.ts --from v0.11.1 --to v0.12.0-0

Validation

  • bun ci/abi-compat/list.ts --from v0.11.1 --package host-contracts
  • bun ci/abi-compat/list.ts --from v0.11.1 --package gateway-contracts

Eikix added 24 commits March 26, 2026 12:32
Used by both abi-compat and upgrade-check subsystems.
Mirrors the ci/abi-compat/ structure: check.ts (CI entrypoint),
lib.ts (core logic), list.ts (local multi-package report), hints.ts
(domain config).
Capture exec errors with truncated output instead of swallowing them.
Clean up worktrees explicitly on failure instead of relying on prune.
Matches the pattern established in abi-compat/list.ts.
- Remove --force flag from forge inspect in abi-compat/lib.ts to avoid
  redundant recompilation (4x per side per package).
- Simplify printPackageReport return in abi-compat/list.ts.
- Derive valid package names from PACKAGE_CONFIG in upgrade-check
  parseArgs instead of hardcoding strings.
Without --force, a prior failed compilation (e.g. before address
constants are generated) leaves error artifacts in forge's cache.
Subsequent runs reuse the cached failure even after the source
files are fixed. Reproduced by: forge clean, attempt compilation
without addresses (fails), generate addresses, run check — forge
returns the cached error for Decryption while other contracts work.
Forge may prepend compilation progress text to stdout on the first
invocation in a clean directory. This caused Decryption (the first
contract checked) to fail JSON.parse in CI while subsequent contracts
succeeded from cache. Extract the JSON array from the output instead
of parsing the whole string, matching the approach used by the
upgrade-check bytecode extraction.
@Eikix Eikix requested a review from a team as a code owner March 26, 2026 12:15
@cla-bot cla-bot bot added the cla-signed label Mar 26, 2026
@Eikix
Copy link
Copy Markdown
Contributor Author

Eikix commented Mar 26, 2026

@claude /pr-review

@claude
Copy link
Copy Markdown

claude bot commented Mar 26, 2026

Claude timed out while processing the request. — View run

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AUTOMATED]

Code Review

Overall this is a well-structured PR that adds ABI compatibility checking and cleanly reorganizes the CI scripts. The code is well-architected with good separation of concerns (config, lib, check, list), proper error handling improvements in list.ts, and solid worktree cleanup logic.

Summary

  • Bugs: No runtime bugs found. Two independent opus-model bug hunting passes confirmed the code is correct.
  • Guidelines: No enforced violations found. (CI scripts are not subject to prettier enforcement in this repo.)
  • Error Handling: One validated issue found — see inline comment.

The error handling improvements to upgrade-check/list.ts (adding formatExecError, wrapping execSync in try/catch, individual worktree cleanup) are excellent and address real pain points from the original code.

Positive highlights

  • Clean extraction of shared config into config.ts files for both subsystems
  • Exception-based ABI delta allowlisting (exceptions.ts) is a good pattern for managing known-breaking changes
  • Proper GitHub Actions annotations (::error::, ::group::) for CI visibility
  • Minimal permissions in the workflow file with inline comments explaining each scope
  • Good use of persist-credentials: false and pinned action SHAs

Copy link
Copy Markdown
Contributor

@tawadaa tawadaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, excellent work, thanks 🙏🏼

@Eikix
Copy link
Copy Markdown
Contributor Author

Eikix commented Mar 26, 2026

@Mergifyio queue

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 26, 2026

Merge Queue Status

This pull request spent 1 hour 49 minutes 34 seconds in the queue, including 1 hour 40 minutes 17 seconds running CI.

Required conditions to merge

mergify bot added a commit that referenced this pull request Mar 26, 2026
mergify bot added a commit that referenced this pull request Mar 26, 2026
@mergify mergify bot merged commit 6e65afc into main Mar 26, 2026
67 of 68 checks passed
@mergify mergify bot deleted the elias/abi-compat-check-refresh branch March 26, 2026 16:26
mergify bot added a commit that referenced this pull request Mar 26, 2026
mergify bot added a commit that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants