Skip to content

fix: require transaction spending limits - #432

Open
wolf31o2 wants to merge 3 commits into
masterfrom
codex/apollo-spending-limits
Open

wolf31o2 wants to merge 3 commits into
masterfrom
codex/apollo-spending-limits

Conversation

@wolf31o2

Copy link
Copy Markdown
Collaborator

Summary

  • Require SetMaxFee before building or signing a transaction, and enforce it against the final fee including padding and absorbed change.
  • Require explicit SetMaxPaymentIncrease for minimum-UTxO payment top-ups. Build outputs from payment copies so a failed attempt leaves the caller's amounts intact.
  • Update examples and transaction-building tests for the required limits.

Compatibility

Callers must set a maximum fee before Complete() or signing a loaded transaction. Custom PaymentI implementations must provide an independent copy through PaymentCloner.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@MIxAxIM

MIxAxIM commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Complete and signing a loaded transaction now fail unless SetMaxFee was called, and a minimum-UTxO top-up fails unless SetMaxPaymentIncrease was called. Callers that build today will break.

  1. Is this meant as an Apollo v3 break?
  2. If it stays in v2, can the checks apply only when the caller set a limit, and leave the current behavior when they did not?

Resolve apollo.go: Sign and SignWithSkey run the body integrity check, then
the fee limit check.

Set a maximum fee on tests and doc examples added on main that call
Complete or sign a loaded transaction.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
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.

2 participants