docs(rebalance): add a runbook and fix the alert's next-step text - #80
Merged
Merged
Conversation
The alert said to withdraw "to the rebalance signer", which the chain cannot do -- withdrawal data is (asset, amount) with no recipient, so it always pays the subaccount owner. It is two moves. Withdrawal route confirmed against the sub 19 precedent, tx 0xffff17a9814e32bedd2bcdeffb214dc1293bac59d634560af73200293a5e0175.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check --alertfires and the procedure to act on it lived only in a sessiontranscript. This venue has twice lost days to an alert that fired correctly while
nobody acted on it, so an alert whose response isn't written down is the same
failure shape.
The bug in the alert text
The message told the operator to:
The chain cannot do that.
action.dataisabi.encode(address asset, uint256 amount)—64 bytes, no recipient field — so a withdrawal always pays
Matching.subAccountToOwner(15), the MM wallet0x3448ac0A…. Never the rebalancesigner
0x1661AA54…. An operator following it literally goes looking for an argumentthat doesn't exist, at exactly the moment they're under pressure.
It is two moves: withdraw (pays the owner), then forward to the signer. Fixed, and
the message now points at the runbook.
Pinned, and the pin is verified
Two tests assert the corrected wording. I reverted the message to the old text and
confirmed both fail, then restored it and confirmed both pass — a test that can't
fail would have been worse than none here. 31/31 green.
The runbook
services/rebalance/RUNBOOK.md— the four steps with addresses, and the trap list.Notable contents:
SubAccounts.ownerOf(15)returns Matching, not the owner. ReadMatching.subAccountToOwner(15).18. Don't copy a ledger figure into the amount.
about sub 15 and that step touches neither the subaccount nor the CLI.
retrying, or pay twice.
0x6B232A21…(~2 USDC held vs ~69 claimed).The escrow in this flow,
0x364058aF…, is a different contract and is solvent(326 held vs 321.0004 claimed, summed across all 19 subaccounts).
Both withdrawal routes verified on chain
Not asserted from the code — checked against history on this escrow (333 USDC in,
6.999575 out across 2 withdrawals, 326 held; the arithmetic closes):
Matching.verifyAndMatch0x74d906c30x0ad58d2fThe precedent for sub 15's route is sub 19's owner withdrawing 1.999575 USDC in
0xffff17a9…5e0175(block 51301502) — same escrow, same structure, owner-signed.No behaviour change beyond the alert string.