Skip to content

As/locked funds per app#126

Open
alsala wants to merge 7 commits intodevfrom
as/locked_funds_per_app
Open

As/locked funds per app#126
alsala wants to merge 7 commits intodevfrom
as/locked_funds_per_app

Conversation

@alsala
Copy link
Copy Markdown
Contributor

@alsala alsala commented Mar 27, 2026

See Jira task: https://horizenlabs.atlassian.net/browse/HZN-2834

Per-app fund isolation for ProcessorEndpoint. A new appLockedFunds mapping tracks how much currency each application has deposited (credited on submitRequest/submitDeployRequest, debited on stateUpdate).
The per-app solvency check fires before the existing global balance check, preventing one app from draining another app's funds during withdrawals or refunds.

Note: The global check is retained as defense-in-depth.

Includes comprehensive Hardhat and Go integration tests covering cross-app isolation, accumulation, boundary conditions, and mixed error/success paths.

@alsala alsala requested review from andreanistico and saratnt March 27, 2026 11:13
@alsala alsala marked this pull request as ready for review March 27, 2026 11:13
requestType: requestType
});
_requestIdByOrder[_tail] = requestId;
appLockedFunds[applicationId] += msg.value;
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.

It is actually appLockedFunds[applicationId] += depositAmount; msg.value contains also the fee, that are not locked inside any app, but they are just kept in the contract balance

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.

3 participants