Skip to content

MilestonesService.resolveIssue's incremental-release model has no counterpart in the real mergefi-milestones contract #162

Description

@chonilius

MilestonesService.resolveIssue() distributes a milestone's budget by repeatedly calling EscrowService.releasePartial() against one Escrow row that was fund()-ed once for the milestone's full budget and stays LOCKED across many partial releases (one per resolved issue).

The real mergefi-milestones contract (MergeFi/contracts, contracts/milestones/src/lib.rs) models this completely differently: create_milestone() opens a budget pool, allocate(milestone_id, issue_id, amount) reserves a slice of the unallocated remainder for one specific issue_id (admin-only, rejects over-allocation), and release_issue(milestone_id, issue_id, recipients) pays out that specific issue's already-reserved slice. There is no "partially release from a locked escrow" primitive at all — resolveIssue's even-split-of-remainingBudget-across-openIssues logic, and its single ever-LOCKED Escrow row, don't correspond to anything the real contract exposes. Making milestones work against the real contract needs MilestonesService to track per-issue allocations (mirroring allocate/release_issue) rather than one shared escrow drained via repeated partial releases — a data-model change in this service, not just an argument-encoding fix in SorobanClientService.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarchitectureArchitecture/design issuehelp wantedExtra attention is neededsecuritySecurity-related issuevery hardVery difficult task, expert-level effort required

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions