Skip to content

Remove PollingForProposal from session event#1128

Merged
spacebear21 merged 1 commit intopayjoin:masterfrom
arminsabouri:rm-polling-proposal-as-non-primary-info
Oct 1, 2025
Merged

Remove PollingForProposal from session event#1128
spacebear21 merged 1 commit intopayjoin:masterfrom
arminsabouri:rm-polling-proposal-as-non-primary-info

Conversation

@arminsabouri
Copy link
Collaborator

PollingForProposal can be re-derived from the previous typestate and is not primary information that is obtained from processing WithReplyKey.

Related to #1119

Pull Request Checklist

Please confirm the following before requesting review:

pub enum SessionEvent {
/// Sender was created with a HPKE key pair
CreatedReplyKey(WithReplyKey),
CreatedReplyKey(Box<WithReplyKey>),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note boxing WithReplyKey was to appeas clippy which was upset that this one variant was larger than the others.

error: large size difference between variants
  --> payjoin/src/core/send/v2/session.rs:90:1
   |
90 | / pub enum SessionEvent {
91 | |     /// Sender was created with a HPKE key pair
92 | |     CreatedReplyKey(WithReplyKey),
   | |     ----------------------------- the largest variant contains at least 584 bytes
93 | |     /// Sender POST'd the original PSBT, and waiting to receive a Proposal PSBT using GET context
...  |
96 | |     ProposalReceived(bitcoin::Psbt),
   | |     ------------------------------- the second-largest variant contains at least 192 bytes
97 | |     /// Invalid session
98 | |     SessionInvalid(String),
99 | | }
   | |_^ the entire enum is at least 584 bytes
   |

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as serialization works I don't have any problem with a box.

Copy link
Contributor

@DanGould DanGould Oct 1, 2025

Choose a reason for hiding this comment

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

The only issue I could see here is if we're intending to support nostd, but then I think we'd have to remove boxes elsewhere anyway. I think it might be OK to leave that to v2, especially since I don't believe the serialization would change. Only the serializER would change.

@coveralls
Copy link
Collaborator

coveralls commented Oct 1, 2025

Pull Request Test Coverage Report for Build 18168341786

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 84.634%

Totals Coverage Status
Change from base Build 18141865776: -0.01%
Covered Lines: 8592
Relevant Lines: 10152

💛 - Coveralls

@spacebear21 spacebear21 mentioned this pull request Oct 1, 2025
2 tasks
`PollingForProposal` can be re-derived from the previous typestate and
is not primary information that is obtained from processing
`WithReplyKey`.
@arminsabouri arminsabouri force-pushed the rm-polling-proposal-as-non-primary-info branch from 70c968e to f541577 Compare October 1, 2025 16:09
Copy link
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.

ACK f541577

Copy link
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.

ACK

@spacebear21 spacebear21 merged commit aee1e44 into payjoin:master Oct 1, 2025
10 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.

4 participants