Skip to content

feat(deploy): proposeContractToNetworks for deferred Safe cuts (EXSC-725) - #2158

Open
0xDEnYO wants to merge 2 commits into
mainfrom
feat/exsc-725-propose-contract-to-networks
Open

feat(deploy): proposeContractToNetworks for deferred Safe cuts (EXSC-725)#2158
0xDEnYO wants to merge 2 commits into
mainfrom
feat/exsc-725-propose-contract-to-networks

Conversation

@0xDEnYO

@0xDEnYO 0xDEnYO commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Which Linear task belongs to this PR?

Fixes EXSC-725

Why did I implement it this way?

Deferred diamond cuts (e.g. MayanFacet v2.0.0) and recreate-after-delete needed a first-class path: deploy already has deployContractToNetworks.sh, whitelist has syncWhitelistToNetworks.sh, but cut-only was a one-off. Added proposeContractToNetworks.sh as a thin wrapper over existing diamondUpdateFacet / diamondUpdatePeriphery (+ allowlist sync for diamond-called periphery), with OK/SKIP/FAIL outcomes and Mongo intentHash duplicate skipping. Wired multisig-rollout --propose-only so the signing/Slack tail stays the same.

Checklist before requesting a review

  • I have performed a self-review of my code
  • This pull request is as small as possible and only tackles one problem
  • I have added tests that cover the functionality / test the bug — N/A (bash orchestration; bash -n + --help / missing-args smoke)
  • For new facets: I have checked all points from this list: https://www.notion.so/lifi/New-Facet-Contract-Checklist-157f0ff14ac78095a2b8f999d655622e — N/A
  • I have updated any required documentation

Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)

  • I have checked that any arbitrary calls to external contracts are validated and or restricted
  • I have checked that any privileged calls (i.e. storage modifications) are validated and or restricted
  • I have ensured that any new contracts have had AT A MINIMUM 1 preliminary audit conducted on by <company/auditor>

…XSC-725)

Provide a cut-only / re-propose path when bytecode is already logged, plus
multisig-rollout --propose-only, so deferred deployments and recreate-after-delete
no longer need one-off scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lifi-action-bot
lifi-action-bot marked this pull request as draft July 30, 2026 05:55
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62c8452c-8ce0-4be3-8029-20f6e1e6bf0f

📥 Commits

Reviewing files that changed from the base of the PR and between efa94e3 and 33563bf.

📒 Files selected for processing (1)
  • script/tasks/proposeContractToNetworks.sh

Walkthrough

Propose-only registration is added for already-deployed contracts, with per-network proposal outcomes, environment-specific routing, duplicate skipping, optional whitelist synchronization, and updated rollout and deployment documentation.

Changes

Propose-only registration workflow

Layer / File(s) Summary
Workflow contract and rollout behavior
docs/superpowers/specs/...
Defines propose-only targeting, production gating, per-network outcomes, duplicate handling, and rollout phases.
Network classification and proposal workers
script/tasks/proposeContractToNetworks.sh
Classifies facet and periphery contracts, validates deployed addresses, routes proposals by environment, skips ineligible or duplicate cases, and records results.
Execution waves and result aggregation
script/tasks/proposeContractToNetworks.sh
Runs grouped network waves with concurrency controls, aggregates outcomes, restores configuration, and synchronizes allowlists when required.
Multisig rollout and deployment documentation
.agents/..., docs/Deploy.md
Documents propose-only invocation, mode-specific rollout behavior, expected outcomes, and related deployment commands.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: QA AI Reviewing

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately names the new proposeContractToNetworks workflow and related PR scope.
Description check ✅ Passed The description follows the template and includes the Linear task, rationale, checklist, and documentation notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/exsc-725-propose-contract-to-networks

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.

@0xDEnYO
0xDEnYO marked this pull request as ready for review July 30, 2026 06:01
@0xDEnYO
0xDEnYO enabled auto-merge (squash) July 30, 2026 06:01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
script/tasks/proposeContractToNetworks.sh (1)

1-13: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Align this strict-mode opt-out with the **/*.sh rule.

script/tasks/proposeContractToNetworks.sh is the only task script documenting that strict mode is intentionally omitted; script/deploy/deployContractToNetworks.sh does the same only because it’s part of the deploy framework. Remove this non-compliance from the task script or add the framework exclusion to the bash rule so the strict-mode requirement remains consistent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@script/tasks/proposeContractToNetworks.sh` around lines 1 - 13, Align
proposeContractToNetworks.sh with the repository’s strict-mode policy: either
add the required strict-mode setup and preserve its behavior, or update the
shared *.sh rule to explicitly exclude deploy framework scripts including this
task only if that exception is intended. Keep the policy consistent with
deployContractToNetworks.sh and remove the task script’s standalone opt-out
documentation.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@script/tasks/proposeContractToNetworks.sh`:
- Around line 52-78: Update isAddressRegisteredOnDiamond to reuse
getPeripheryAddressFromDiamond for the periphery lookup, passing NETWORK,
DIAMOND_ADDRESS, and CONTRACT_NAME, and compare its normalized result with
LOG_ADDRESS. Also check the existing helper scripts for a facet-membership
helper and reuse it in the isFacetContractName branch if available, preserving
the current registration result and error behavior.
- Around line 297-300: Scope the SEND_PROPOSALS_DIRECTLY_TO_DIAMOND hard-abort
in the propose-only guard to production only by including TARGET_ENVIRONMENT in
the condition. Preserve the existing error and exit behavior for production,
while allowing staging runs—including bootstrap scenarios—to continue without
aborting.
- Around line 81-179: The proposeToNetworkWorker flow currently detects Safe
no-op outcomes by grepping free-form output, allowing helper behavior to drift
and be recorded as OK. Update diamondUpdateFacet and diamondUpdatePeriphery
no-op handling to return or emit a stable reserved signal, then consume that
signal in proposeToNetworkWorker instead of matching “Proposal already exists”
or “FacetCut is empty” text; preserve recording these cases as SKIP with their
existing reasons while treating genuine failures as FAIL.

---

Nitpick comments:
In `@script/tasks/proposeContractToNetworks.sh`:
- Around line 1-13: Align proposeContractToNetworks.sh with the repository’s
strict-mode policy: either add the required strict-mode setup and preserve its
behavior, or update the shared *.sh rule to explicitly exclude deploy framework
scripts including this task only if that exception is intended. Keep the policy
consistent with deployContractToNetworks.sh and remove the task script’s
standalone opt-out documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 03b685a9-3905-439a-afc9-6072df487342

📥 Commits

Reviewing files that changed from the base of the PR and between fb5edec and efa94e3.

📒 Files selected for processing (5)
  • .agents/README.md
  • .agents/commands/multisig-rollout.md
  • docs/Deploy.md
  • docs/superpowers/specs/2026-07-30-propose-contract-to-networks-design.md
  • script/tasks/proposeContractToNetworks.sh

Comment thread script/tasks/proposeContractToNetworks.sh
Comment thread script/tasks/proposeContractToNetworks.sh
Comment thread script/tasks/proposeContractToNetworks.sh Outdated
…SC-725)

- scope the SEND_PROPOSALS_DIRECTLY_TO_DIAMOND abort to production, per the
  design doc — staging never routes through the Safe and the flag is a
  legitimate staging bootstrap setting
- reuse getPeripheryAddressFromDiamond for the periphery registration check
  instead of re-implementing the lookup via universalCast
- --all-where-deployed: skip Tron networks with a warning instead of aborting
  the whole run (25 shared contracts live in deployments/tron.json; explicit
  Tron arguments still hard-error), and fail cleanly when no eligible
  networks remain
- document the production-Safe vs staging-direct behavior in the usage text

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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