Skip to content

ci(security): scope EIP-170 size gate to deployable contracts#230

Merged
jhfnetboy merged 2 commits into
mainfrom
fix/ci-eip170-scope
Jun 2, 2026
Merged

ci(security): scope EIP-170 size gate to deployable contracts#230
jhfnetboy merged 2 commits into
mainfrom
fix/ci-eip170-scope

Conversation

@jhfnetboy
Copy link
Copy Markdown
Member

Stage 1's forge build --sizes fails if any built contract exceeds EIP-170 — including test-only helpers. SuperPaymasterV2Reinit (a thin SuperPaymaster subclass in SupplementaryLifecycle.t.sol, used only for UUPS reinitializer testing, never deployed) is ~25.6 KB and tripped the gate. The real deployable SuperPaymaster is 24,159 B (under limit). Fix: --skip "*.t.sol" --skip "*.s.sol" so the gate checks only deployable src. No code change.

…cript)

Stage 1's `forge build --sizes` exits non-zero if ANY built contract exceeds 24576 bytes,
including test-only helpers. SuperPaymasterV2Reinit (a thin SuperPaymaster subclass in
SupplementaryLifecycle.t.sol, used purely for UUPS reinitializer testing and never
deployed) is ~25.6 KB and was tripping the gate, even though the real deployable
SuperPaymaster is 24,159 B (under the limit). Add --skip "*.t.sol" --skip "*.s.sol" so
the gate enforces EIP-170 on exactly the contracts we deploy.
@jhfnetboy jhfnetboy requested a review from fanhousanbu as a code owner June 1, 2026 16:00
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed8b236cc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/security.yml Outdated
# gate enforces the limit on contracts we actually deploy — and is not tripped by
# test-only helpers (e.g. SuperPaymasterV2Reinit, a thin SuperPaymaster subclass
# used purely for UUPS reinitializer testing) that are never deployed.
run: forge build --sizes --skip "*.t.sol" --skip "*.s.sol"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use Foundry skip aliases instead of glob filters

In the security workflow this still builds the oversized test helper because Foundry's current forge build --skip docs define the argument as a substring filter, with test and script as aliases for .t.sol and .s.sol (not shell-style globs): https://getfoundry.sh/forge/reference/build/. On GitHub Actions, "*.t.sol" is passed literally when no root-level file matches, so files like contracts/test/.../SupplementaryLifecycle.t.sol are not skipped and the Stage 1 EIP-170 gate remains blocked in the same scenario this commit is trying to fix.

Useful? React with 👍 / 👎.

Codex flagged the previous `--skip "*.t.sol" --skip "*.s.sol"` as undocumented glob
strings. Switch to forge's documented aliases: `forge build --help` states 'test and
script are aliases for .t.sol and .s.sol'. Same effect (skip test/script so the EIP-170
gate only checks deployable contracts), but on the officially-supported flag form.
Copy link
Copy Markdown
Contributor

@fanhousanbu fanhousanbu left a comment

Choose a reason for hiding this comment

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

✅ APPROVE — CI-only, no contract changes

Change verified: .github/workflows/security.yml only.

Before: forge build --sizes (includes ALL contracts incl. .t.sol) + a fragile awk filter trying to isolate SuperPaymaster lines.

After: forge build --sizes --skip test --skip script — forge's documented aliases for excluding .t.sol / .s.sol files. The EIP-170 gate now checks only deployable contracts, so SuperPaymasterV2Reinit (test-only UUPS reinit helper, ~25.6KB, never deployed) no longer trips it.

SuperPaymaster itself is 24,159B — well within the 24,576B limit. ✅

Also removes the duplicate forge build call (the old script built twice). Clean.

@jhfnetboy jhfnetboy merged commit 4aa00b4 into main Jun 2, 2026
5 of 6 checks passed
@jhfnetboy jhfnetboy deleted the fix/ci-eip170-scope branch June 2, 2026 02:04
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants