Skip to content

test initialize semantics: typed-overload reverts and re-init protection#443

Merged
thedavidmeister merged 2 commits into
mainfrom
2026-05-04-issue-322-323-initialize-semantics
Jun 13, 2026
Merged

test initialize semantics: typed-overload reverts and re-init protection#443
thedavidmeister merged 2 commits into
mainfrom
2026-05-04-issue-322-323-initialize-semantics

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Summary

Pins four initialize invariants on Flow:

  1. Flow.initialize(EvaluableConfigV3[]) (the typed overload mandated by ICloneableV2) reverts with ICloneableV2.InitializeSignatureFn on the implementation.
  2. Same overload reverts on a successfully initialized clone.
  3. _disableInitializers() in the implementation constructor blocks any direct initialize(bytes) call on the implementation.
  4. A successfully initialized clone rejects a second initialize(bytes).

OZ Initializable v4 reverts with "Initializable: contract is already initialized".

Mutation verified: removing the initializer modifier from initialize(bytes) makes both re-init tests fail; reverting passes.

Closes #322 #323.

Test plan

  • 4 fuzz tests, all 100 runs each
  • mutation: drop initializer modifier → re-init tests fail

🤖 Generated with Claude Code

Four invariants pinned:

1. `Flow.initialize(EvaluableConfigV3[])` (the typed overload) reverts with
   `ICloneableV2.InitializeSignatureFn` on the implementation.
2. Same overload reverts on a successfully initialized clone.
3. `_disableInitializers()` in the implementation constructor blocks any
   direct `initialize(bytes)` on the implementation.
4. A successfully initialized clone rejects a second `initialize(bytes)`.

OZ Initializable v4 reverts with the string
`"Initializable: contract is already initialized"`.

Mutation verified: removing the `initializer` modifier from
`initialize(bytes)` makes both re-init tests fail; reverting passes.

Closes #322 #323.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 35 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c06bf260-e23c-40db-9a6b-80c043bb6c7e

📥 Commits

Reviewing files that changed from the base of the PR and between ec7a7f7 and a1268c7.

📒 Files selected for processing (1)
  • test/src/concrete/Flow.construction.t.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-04-issue-322-323-initialize-semantics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thedavidmeister thedavidmeister self-assigned this May 9, 2026
Resolve the Flow.construction.t.sol conflict as the union: both branches
only appended new test functions to FlowConstructionTest with no overlap.
Keeps PR #443's four initialize-semantics tests and main's three
flowOutputs/flowInputs guard tests, merges the imports, and adopts main's
LibLogHelper.findEvent in the shared testFlowConstructionInitialize. forge
fmt applied. Build clean; all 9 tests in the file pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Reviewed a1268c7: test initialize semantics: typed-overload reverts and re-init protection — rebased onto main (test-only union conflict resolution + forge fmt), all checks green. LGTM.

@thedavidmeister thedavidmeister merged commit 30c3f2f into main Jun 13, 2026
4 checks passed
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.

[A01-3] [MEDIUM] initialize(EvaluableConfigV3[]) overload InitializeSignatureFn revert untested

1 participant