Skip to content

Move extract_fallback_tx to MaybeInputsOwned#801

Merged
spacebear21 merged 1 commit intopayjoin:masterfrom
arminsabouri:move-extract-fallback-to-maybeinputsseen
Jun 24, 2025
Merged

Move extract_fallback_tx to MaybeInputsOwned#801
spacebear21 merged 1 commit intopayjoin:masterfrom
arminsabouri:move-extract-fallback-to-maybeinputsseen

Conversation

@arminsabouri
Copy link
Copy Markdown
Collaborator

Per BIP-77:

At any point, either party may choose to broadcast the fallback
transaction described by the Original PSBT instead of proceeding.

However, the fallback transaction available at the UncheckedProposal typestate may not be "broadcastable". Only after transitioning to MaybeInputsOwned via check_broadcast_suitability can we determine with high confidence that the fallback is valid for broadcast.

Related PR: #799

@arminsabouri arminsabouri requested a review from DanGould June 24, 2025 19:58
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jun 24, 2025

Pull Request Test Coverage Report for Build 15860337778

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 86.011%

Totals Coverage Status
Change from base Build 15856628567: -0.004%
Covered Lines: 7815
Relevant Lines: 9086

💛 - Coveralls

Per BIP-77:

> At any point, either party may choose to broadcast the fallback
> transaction described by the Original PSBT instead of proceeding.

However, the fallback transaction available at the `UncheckedProposal`
typestate may not be "broadcastable". Only after transitioning to
`MaybeInputsOwned` via `check_broadcast_suitability` can we determine
with high confidence that the fallback is valid for broadcast.

Related PR: [payjoin#799](payjoin#799)
@arminsabouri arminsabouri force-pushed the move-extract-fallback-to-maybeinputsseen branch from 65970d8 to e5d1855 Compare June 24, 2025 20:03
Copy link
Copy Markdown
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

utACK e5d1855

Comment on lines +123 to +124
/// If you are implementing an interactive payment processor, you should get extract the original
/// transaction with extract_tx_to_schedule_broadcast() and schedule
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.

This change makes me think the alternative design would be to return the Tx bytes with the state change as a Ok result of assume_... or check_broadcast_suitability... to compel it, but I do think that complicates the situation and is unnecessary after we have the forthcoming change to be able to extract later on thanks to SEL

Copy link
Copy Markdown
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

utACK e5d1855

@spacebear21 spacebear21 merged commit b7491be into payjoin:master Jun 24, 2025
13 checks passed
@arminsabouri arminsabouri deleted the move-extract-fallback-to-maybeinputsseen branch June 25, 2025 10:46
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.

4 participants