feat: enhance messaging unwire scripts#569
Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates the messaging “unwire” graph builder so that disabling an edge can be applied directionally (one-way vs two-way), avoiding unnecessary DeadDVN changes when only one direction is being unwired.
Changes:
- Replace the disallowed-edge
Setwith aMapthat tracks theUnwireDirectionper directed edge. - Apply
disableMessagingEdgeconditionally per edge and omitreceiveConfigfor one-way unwires. - Update
disableMessagingEdgeto accept anUnwireDirectionand only setreceiveConfigwhen direction is'both'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5cb2f47 to
4705bc3
Compare
cefb7e7 to
9f26924
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fc8dc83 to
0832ff8
Compare
|
|
||
| Order: | ||
|
|
||
| 1. Drain or account for all pool funds and credits. |
There was a problem hiding this comment.
This flow assumes no inflight messages between steps, which may be ok for most unwired chains, but I believe we should be more strict.
We don't want to be put in a position where we need to re-wire to deliver inflight messages.
Should we do the following?
- Disallow sending funds to and from the chain. Only send-side to keep inflights deliverable.
- After inflights have landed, unwire all token messaging.
- Synchronize credits with local LP and local token balance so that users can withdraw?
- We control credit messaging, so no need to worry about credit messaging inflights, we can unwire all at once.
There was a problem hiding this comment.
After inflights have landed, unwire all token messaging.
Does this mean unwiring receive on the chains being deprecated?
If so, I avoided doing that in step 1 to prevent inflight messages from getting stuck. My thinking was that this could be handled in step 2 as part of the full wind down. In the meantime, no new messages should be received anyway, so it seems safe to keep the receive libs until the final step.
I'd prefer not to add a separate step just for this, since that would make the Hydra unwind a 3-step process. I'd like to keep it as simple as possible while still keeping it functional and safe.
The question is: Is there any vulnerability or edge case with keeping the receive libs until the final step?
If not, I'd prefer to keep this as a 2-step process rather than adding a third one.
There was a problem hiding this comment.
Synchronize credits with local LP and local token balance so that users can withdraw?
I'm not sure I get what you mean here.
It is Hydra, there will be no local pool or balance. And as mentioned, users will get the funds out via ofts paths, will remove all credits before starting this part
There was a problem hiding this comment.
Updated the pool-chain unwire flow in the runbook.
The key change is that pool deprecation should not full-unwire TokenMessaging in one step by default. Even after pool funds and credits are drained, there can still be in-flight outbound messages from the deprecated chain. If we remove destination peers immediately, those messages may get stuck and would require rewiring to deliver.
Recommended pool flow is now:
- First run TokenMessaging with
direction: fromto stop new outbound messages from the deprecated chain. - In the same step, run CreditMessaging with
direction: both, since credits should already be drained. - After confirming there are no in-flight messages, run TokenMessaging with
direction: bothto fully disconnect the mesh.
For very low-activity chains, a single full direction: both unwire may still be acceptable, but the two-step TokenMessaging flow is the safer default.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
from,to, andboth.from/toonly set the relevant send-side DVN to the local DeadDVN, whilebothperforms the full unwind with send/receive DeadDVN, executor zeroing, and peer removal.chainsConfig/<chain>.ymlunderunwire.token_messagingandunwire.credit_messaging, selected withUNWIRE_CHAIN=<chain>/--unwire-chain.status: DEPRECATEDchains from normal wire/configure graphs while still allowing unwire to resolve them.messaging.unwire.ymlflow and updates chain templates.Operator Flow
Use the combined messaging target when TokenMessaging and CreditMessaging should be processed together:
Use the split targets only when reviewing or proposing TokenMessaging and CreditMessaging separately:
Pool chain deprecations use
direction: bothfor both OApps after pool funds and credits are fully drained.Hydra chain deprecations use two phases:
token_messaging.direction: to, while CreditMessaging can usedirection: bothafter credits are drained.direction: bothonce the remaining exit path is no longer needed.Validation
git diff --checkmake -n unwire-chain-mainnet UNWIRE_CHAIN=glue-mainnet CONFIGURE_ARGS_COMMON=--dry-runmake -n unwire-chain-mainnet UNWIRE_CHAIN=glue-mainnet CONFIGURE_ARGS_COMMON=--onesig