Skip to content

Remove init dep from multisig mods - #610

Merged
0xisk merged 4 commits into
OpenZeppelin:mainfrom
andrew-fleming:remove-init-dep
Jun 18, 2026
Merged

Remove init dep from multisig mods#610
0xisk merged 4 commits into
OpenZeppelin:mainfrom
andrew-fleming:remove-init-dep

Conversation

@andrew-fleming

@andrew-fleming andrew-fleming commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Resolves #611

This PR ignores Forwarder.compact because it will removed. Depends on #566

Summary by CodeRabbit

  • Refactor

    • Multisig contract suite refactored to manage initialization state internally, removing reliance on external helper modules while maintaining initialization enforcement semantics.
  • Tests

    • Updated initialization guard test assertions to reflect new contract-specific error messages.
  • Chores

    • Optimized build pipeline task dependencies for multisig compilation.

@andrew-fleming
andrew-fleming requested review from a team as code owners June 18, 2026 03:04
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Three multisig compact modules (Signer, Forwarder, ForwarderPrivate) drop their dependency on the shared Initializable module. Each gains an exported _isInitialized: Boolean ledger and local assertInitialized/assertNotInitialized guard circuits. All initialization call sites and tests are updated accordingly, and turbo.json removes the compact:security build dependency from compact:multisig.

Changes

Per-module initialization guard refactor

Layer / File(s) Summary
Local _isInitialized ledger and guard circuits
contracts/src/multisig/Signer.compact, contracts/src/multisig/Forwarder.compact, contracts/src/multisig/ForwarderPrivate.compact
Each module exports a new _isInitialized: Boolean ledger and defines internal assertInitialized() and assertNotInitialized() circuits that emit module-prefixed error messages, replacing the shared Initializable dependency.
Circuit call-site updates to use local guards
contracts/src/multisig/Signer.compact, contracts/src/multisig/Forwarder.compact, contracts/src/multisig/ForwarderPrivate.compact
initialize, assertSigner, assertThresholdMet, getSignerCount, getThreshold, _depositShielded, _depositUnshielded, _deposit, and _drain replace Initializable_* calls with the new module-local guards and direct _isInitialized = true assignment.
Test error message updates and build config
contracts/src/multisig/test/Signer.test.ts, contracts/src/multisig/test/Forwarder.test.ts, contracts/src/multisig/test/ForwarderPrivate.test.ts, turbo.json
Expected error strings in tests change from Initializable: ... to Signer:/Forwarder:/ForwarderPrivate: prefixes; turbo.json drops compact:security from compact:multisig's dependsOn.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • 0xisk

Poem

🐇 Hop hop, no more shared init to borrow,
Each module carries its own Boolean flag!
assertInitialized guards each tomorrow,
No Initializable chains left to drag.
The rabbit's done untangling the code —
Each contract now owns its own tidy road! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Remove init dep from multisig mods' directly and clearly describes the main objective of the PR - removing the initializable dependency from multisig modules.
Linked Issues check ✅ Passed The PR successfully removes the Initializable dependency from all three multisig modules (Forwarder, ForwarderPrivate, Signer) by introducing internal initialization tracking via _isInitialized ledger and local guard circuits.
Out of Scope Changes check ✅ Passed All changes are directly related to removing the Initializable dependency. The turbo.json change to remove compact:security dependency appears related to breaking the initialization dependency chain.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@0xisk 0xisk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@0xisk
0xisk merged commit 5b45927 into OpenZeppelin:main Jun 18, 2026
7 checks passed
0xisk added a commit that referenced this pull request Jun 18, 2026
ForwarderPrivate now uses the inline _isInitialized flag (init-dep
removal from #610, merged during rebase), which asserts
"ForwarderPrivate: contract not initialized". Update the two init-guard
assertions that still expected the old Initializable message.
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.

Remove persisting initializable dep from multisig modules

2 participants