Skip to content

Name stranded balances that no B2B deposit owns - #1439

Open
ebma wants to merge 2 commits into
stagingfrom
fix/monerium-unattributed-stranded-alert
Open

ebma wants to merge 2 commits into
stagingfrom
fix/monerium-unattributed-stranded-alert

Conversation

@ebma

@ebma ebma commented Oct 21, 2026

Copy link
Copy Markdown
Member

Why

The live unsolicited-funds test on the sandbox showed that a balance no deposit owns (EURe sent straight to a clone from EUR 1 upward, or any USDC that arrived outside a swap) keeps the clone's batch marker armed: each forward() re-times it while that balance remains (_syncBatch(true)), and nothing closes it. Left alone past TRIGGER_DELAY, swap and forwardAll are permissionless, so the client's next payment could be swapped by anyone as soon as it mints, against the Chainlink floor with no fee or subsidy.

The stranded-balance monitor did warn, but as a missed payment window:

stranded funds on forwarder 0x0003… (account 333b04c8…): eure=2000000000000000007, usdc=1000007,
batch open for 0h — past RECOVERY_DELAY, the promised window was missed: forward or recover (runbook §2.7)

No deposit missed a window, the refund procedure does not apply, and "0h" was a 39-minute-old marker.

What changes

  • The stranded line checks whether any provider-attributed minted, converting or recovering deposit owns the balance. When none does, it says so ("no settling deposit owns this balance (unsolicited funds): clear it before the client's next payment") and cites the internal B2B runbook's unattributed-balance procedure (§2.8, added separately), at both severities. Lines for clones with a settling deposit keep their wording.
  • The marker age shows to a tenth of an hour instead of whole hours.
  • The architecture doc and security spec (Monitoring invariant 3) describe the distinction and the clearing order (recover first, while the marker is old; forwardAll re-times it when EURe of EUR 1 or more remains).

Tests

  • An unattributed balance (including its unattr: row, which the owner count must ignore) warns with the new wording and the age as 3.0h, and errors past TRIGGER_DELAY with both the permissionless note and the procedure.
  • A clone with a converting deposit keeps the missed-window wording.

Both fail on the old code. monitoring.test.ts passes (68); lint, verify, api typecheck and wire-contract are clean.

ebma added 2 commits October 21, 2026 13:47
Unsolicited EURe from EUR 1 or any unsolicited USDC keeps a clone's batch
marker armed: every forward re-arms it, and past TRIGGER_DELAY the
client's next payment is open to the permissionless swap. The stranded
warning reported this as a missed payment window and pointed to the
refund procedure, and showed the marker age rounded down to whole hours
("0h" for 39 minutes on the sandbox). It now says when no settling
deposit owns the balance and points to the unattributed-balance
procedure, and shows the age to a tenth of an hour.
@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vrtx-dashboard canceled.

Name Link
🔨 Latest commit 01de14f
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6ad8a6850982b9399bb6bfd8

@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortexfi canceled.

Name Link
🔨 Latest commit 01de14f
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6ad8a685335f0bb18c393d25

@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 01de14f
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6ad8a685293e3a53124dea54
😎 Deploy Preview https://deploy-preview-1439--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant