Skip to content

Conversation

glozow
Copy link
Member

@glozow glozow commented Mar 8, 2022

Default mempool policy doesn't let you have chains longer than 25 transactions. This is locally configurable of course, but it's not really safe to assume that a chain longer than 25 transactions will propagate. Thus, the wallet should probably avoid creating such transactions by default; set DEFAULT_WALLET_REJECT_LONG_CHAINS to true.

Closes #9752
Closes #10004

@fanquake fanquake added the Wallet label Mar 8, 2022
@maflcko
Copy link
Member

maflcko commented Mar 8, 2022

Previous discussion: #10015

@glozow
Copy link
Member Author

glozow commented Mar 8, 2022

Sad that #10015 never landed. fwiw not changing the error message here - I think "insufficient funds" is the right message to return if you're unable to produce a transaction that would be accepted by your mempool.

@maflcko
Copy link
Member

maflcko commented Mar 8, 2022

So the change here will be:

  • Before a user would see their balance deplete, until they run out of funds (as their change is ignored, see Could the wallet count unconfirmed non-mempool change? #11887), then coin selection will fail. Previously created txs will likely broadcast at some point and the balance returns to normal.
  • Now a user would see coin selection fail, but have an accurate balance.

In both cases the user will see coin selection fail, so it seems the underlying user problem still exists. Though, it is probably fine to postpone a fix for that until after #11887, in which case this pull can be reverted again.

@achow101
Copy link
Member

achow101 commented Mar 8, 2022

Concept ACK

I don't think it makes sense for the wallet to by default make transactions that won't be relayed immediately. The current behavior also leads to user confusion about their balance.


I think "insufficient funds" is the right message to return if you're unable to produce a transaction that would be accepted by your mempool.

I think "insufficient funds" is too generic of an error message for coin selection failures as there are a ton of different reasons why coin selection might fail. I would like to have more granular error messages, but changing that is orthogonal to this.

@achow101
Copy link
Member

ACK 9ca1de5

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

lgtm, but I think there are typos?

@glozow glozow force-pushed the 2022-03-rejectlongchains branch from 9ca1de5 to 93b4a81 Compare March 25, 2022 15:13
@maflcko
Copy link
Member

maflcko commented Mar 25, 2022

I've marked the remaining typos with 👀

@glozow glozow force-pushed the 2022-03-rejectlongchains branch from 93b4a81 to da2bc86 Compare March 25, 2022 16:02
@maflcko
Copy link
Member

maflcko commented Mar 25, 2022

re-ACK da2bc86 only change is fixing typos in tests 🎏

Show signature

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

re-ACK da2bc865d644f6be748c305556bdd02f02d1b161 only change is fixing typos in tests 🎏
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgIugv/ddcX8zoLuze/7EuMxEnxlwIMKPYVFfzrFX2cLnCnpf+jIqwArqhmM5h8
yWrv6P877baXdFizgrlGQu5gMEFDPE8ZrXZKmzN1sg0dj+nc4W25zNSrfe9VP4Nw
AyumBUkzjznXrktn2ICNE7d3Ye2BbSLNbfcXVGmCgUq+ilwvmXoSvVU5SqUs6tlP
/yQQUxlR0Nn6aj0ABcbPhJOdZO8JvgVA1o4hPIPzDwEqmzsDDaqnQrHlJfhRHxU9
mTsaR9fX6zJxjdyrUdQfpP9vO2jIv9Fdv791SD3+ECIwAOsXIbSnrj3r3rhQ1DPu
aKk45J6gFDqt9Ls4Q5rCm6lR+9Zt4PzyjW9iQR41NenLZlXJh9NeK496wkioZm0S
+N7+nwrJQR6Z2A09KxsVKOXM95jJHmrsFGNR7K85GDeXWtm1gGjKUnImzmyvGpY/
8/cUPqXq5PSnl0vh+9CbXAF3uszowQWwo4+gXJCkd3KKjezXQWruzOieEJod2yeZ
ADGknmuH
=K1MH
-----END PGP SIGNATURE-----

@maflcko maflcko merged commit f66c827 into bitcoin:master Mar 25, 2022
@glozow glozow deleted the 2022-03-rejectlongchains branch March 25, 2022 16:18
@achow101
Copy link
Member

re-ACK da2bc86

@t-bast
Copy link
Contributor

t-bast commented Mar 25, 2022

Late ACK, thanks for updating this!

We've been running with this parameter set to true ever since we discovered this flag, because one day we got bitten by this in production and realized this problem.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 2, 2022
da2bc86 [wallet] don't create long chains by default (glozow)

Pull request description:

  Default mempool policy doesn't let you have chains longer than 25 transactions. This is locally configurable of course, but it's not really safe to assume that a chain longer than 25 transactions will propagate. Thus, the wallet should probably avoid creating such transactions by default; set `DEFAULT_WALLET_REJECT_LONG_CHAINS` to true.

  Closes bitcoin#9752
  Closes bitcoin#10004

ACKs for top commit:
  MarcoFalke:
    re-ACK da2bc86 only change is fixing typos in tests 🎏

Tree-SHA512: 65d8e4ec437fe928adf554aa7e819a52e0599b403d5310895f4e371e99bbc838219b3097c4d2f775bc870ac617ef6b4227b94291f2b376f824f14e8f2b152f31
@bitcoin bitcoin locked and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After max chain of unconfirmed change transactions, last tx is missing from memory until rescan Max unconfirmed chainlength
5 participants