Skip to content

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

Open
thedavidmeister wants to merge 1 commit intomainfrom
2026-05-04-issue-322-323-initialize-semantics
Open

test initialize semantics: typed-overload reverts and re-init protection#443
thedavidmeister wants to merge 1 commit intomainfrom
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
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@thedavidmeister has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 46 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eea66d53-b1c8-45fc-9ee3-69ab60a675a1

📥 Commits

Reviewing files that changed from the base of the PR and between ceaea3c and 81e996d.

📒 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.

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