use FeeRate for max_fee_rate arg, and default it to BROADCAST_MIN#491
use FeeRate for max_fee_rate arg, and default it to BROADCAST_MIN#491nothingmuch merged 3 commits intopayjoin:masterfrom
Conversation
Pull Request Test Coverage Report for Build 12957169876Details
💛 - Coveralls |
|
I believe a smoke test is preventing this from requesting review |
|
I don't believe we actually have the tooling to smoke test this, since the receiver max_fee_rate only comes into effect if the sender were unwilling to pay for an additional receiver input (our receiver adds one input paid for by the sender by custom), OR the receiver is batching, and payjoin CLI has no way to do either of those configurations of of the box at the moment. For this reason I believe I'd be OK merging this as-is and following up with the default fix for #489 in the |
There was a problem hiding this comment.
I think the latter part of this PR addressing #489 to default to BROADCAST_MIN really ought to apply to payjoin dev kit itself in ProvisionalProposal::apply_fee's max_feerate passed from finalize_proposal's max_feerate_sat_per_vb, the name being a separate problem.
I planned to just modify the sender to modify the sender to remove that contribution in order to manually test this, just haven't gotten to it yet (partly because I ignored your advice to test against the public directory, partly because i got sidetracked with other things yesterday), so please don't merge yet
So
|
|
I've manually tested it and appears to work, but there's one thing I'm confused about which is that with the max effective feerate set back to 0, if i chain two transactions without mining a block to confirm, the 2nd one does not get rejected. I have to go again, so I will update the PR with the bikeshedding changes later, and I will try to figure out what's going on, i suspect the effective feerate is potentially calculated incorrectly if the sender is doing CPFP |
Ah, I forgot it was mandatory, but it would make more sense to provide a sane default of BROADCAST_MIN for max_feerate if you agree it is indeed sane. CPFP is almost definitely miscalculated. not sure how we'd even deal with that or other ancestor payments without bringing in all the mempool policy stuff from core. Must that be the responsibility of the payjoin crate? Should that be the responsibility of the payjoin crate? Or can it be dealt with via a dependency somehow? |
👍, I will move BROADCAST_MIN defaulting to the payjoin crate and modify cli crate to pass None
IMO definitely not, I was just surprised that it seemed to produce the opposite of what I would have expected, namely that the receiver accepted the payjoin, so just something to investigate |
13bf515 to
9a55e8e
Compare
|
rebased, implemented |
DanGould
left a comment
There was a problem hiding this comment.
Some questions, but otherwise lgtm. I don't see a real need to squash, imo the bigger "churn" to control for is the number of times we need to go back and forth to get something merged.
payjoin/src/receive/v1/mod.rs
Outdated
| .commit_inputs(); | ||
|
|
||
| let payjoin = payjoin.apply_fee(None, FeeRate::ZERO); | ||
| let payjoin = payjoin.apply_fee(None, Some(FeeRate::ZERO)); |
There was a problem hiding this comment.
Should this not now take advantage of the default by passing None?
I feel like our reference should take advantage of our sane defaults if we believe them to be sane.
There was a problem hiding this comment.
Hmm, I suppose but I also didn't want to change this test since it explicitly covers an edge case.
I guess the sensible thing is to check that both None and Some(ZERO) work
There was a problem hiding this comment.
That's reasonable. In haste I thought this was in the main payjoin-cli implementation for some reason, which is why I mentioned "reference."
i believe the reference is actually using finalize_psbt with our configured value, which is appropriate, so this comment may be disregarded.
Above and beyond would be like you said to check None in the unit test as well.
payjoin/src/receive/v1/mod.rs
Outdated
| min_feerate_sat_per_vb: Option<FeeRate>, | ||
| max_feerate_sat_per_vb: FeeRate, | ||
| min_feerate: Option<FeeRate>, | ||
| max_effective_feerate: FeeRate, |
There was a problem hiding this comment.
Should the apply_fee argument also be renamed to max_effective_feerate?
There are other places we're using fee_rate as an argument name instead of feerate and those should be made consistent.
Fair, but since you posted some feedback if you don't mind i'm going to squash and apply that feedback |
|
agreed squash makes sense in this conversation |
|
after wasting some time doing the opposite, going with |
|
... with the exception of |
FeeRate's serde support is used for serialization, whereas on the command line it's parsed as a number
Also renames to max_effective_fee_rate
9a55e8e to
5d410bf
Compare
|
breaking pub v1 stuff is completely fine The actual params value is |
5d410bf to
95aaabd
Compare
Tested manually by modifying the sender to zero out the additional fee contribution, sending a payment with a feerate of 1 sat/vb, with the caveat that if unconfirmed txs were in the mempool the receiver still accepted (both with and without the changes of this PR)
Closes #452
See also #489