Repository navigation
fix(apollo): charge sub-min-UTxO change as fee - #3
Merged
Merged
Conversation
When ADA-only change is below min-UTxO, Complete dropped the change output but never added the dropped lovelace to the fee, so the body did not conserve value and the ledger rejected it with ValueNotConservedUTxO. This stalled the mainnet emissions executor from 2026-11-09 (822,701 lovelace unaccounted). buildOutputsWithChange now returns the absorbed change; Complete adds it to the fee for the body and for collateral sizing. Fee convergence still runs on the size-based estimate, matching upstream's approach (Salvionied/apollo bcdfa47). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
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.
Problem
When ADA-only change falls below min-UTxO,
Complete()drops the change output but never adds the dropped lovelace to the fee. The body then fails value conservation and the node rejects it withValueNotConservedUTxO.This has stalled the mainnet emissions executor (pinned to
6d27a52) since 2026-11-09 12:00 UTC: inputs 5,670,014 vs outputs + fee 4,847,313 lovelace, a gap of 822,701 = the dropped change.Fix
buildOutputsWithChangenow returns the absorbed sub-min change.Complete()adds it to the fee written to the body and to the fee used for collateral sizing.Tests
TestCompleteAbsorbedChangeIsChargedAsFeereproduces the bug: it failed before the change (834,411 lovelace unaccounted) and passes now.TestCompleteChangeAboveMinIsStillReturnedguards the normal path.go vetis clean and the full suite passes, exceptTestCompleteWithReferenceInputs, which fails identically on6d27a52without this change (fixed chain context lacks reference-input resolution).🤖 Generated with Claude Code