Skip to content

fix(apollo): charge sub-min-UTxO change as fee - #3

Merged
krakujs merged 1 commit into
feat/script-tx-finalizationfrom
fix/charge-absorbed-change
Nov 16, 2026
Merged

krakujs merged 1 commit into
feat/script-tx-finalizationfrom
fix/charge-absorbed-change

Conversation

@krakujs

@krakujs krakujs commented Nov 13, 2026

Copy link
Copy Markdown

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 with ValueNotConservedUTxO.

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

  • buildOutputsWithChange now returns the absorbed sub-min change.
  • Complete() adds it to the fee written to the body and to the fee used for collateral sizing.
  • Fee convergence still iterates on the size-based estimate, the same approach upstream took in Salvionied/apollo bcdfa47.

Tests

  • New TestCompleteAbsorbedChangeIsChargedAsFee reproduces the bug: it failed before the change (834,411 lovelace unaccounted) and passes now.
  • New TestCompleteChangeAboveMinIsStillReturned guards the normal path.
  • go vet is clean and the full suite passes, except TestCompleteWithReferenceInputs, which fails identically on 6d27a52 without this change (fixed chain context lacks reference-input resolution).

🤖 Generated with Claude Code

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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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.

@krakujs
krakujs merged commit 65b0e86 into feat/script-tx-finalization Nov 16, 2026
1 of 3 checks passed
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