Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.x] Backports for 24.0.1 #26616

Merged
merged 9 commits into from
Dec 6, 2022
Merged

[24.x] Backports for 24.0.1 #26616

merged 9 commits into from
Dec 6, 2022

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Dec 1, 2022

If migratewallet fails, we do a cleanup which removes the watchonly and
solvables wallets if they were created. However, if they were not, their
pointers are nullptr and we don't check for that, which causes a
segfault during the cleanup. So check that they aren't nullptr before
cleaning them up.

Github-Pull: bitcoin#26594
Rebased-From: 86ef7b3
Due to an oversight, we cannot currently migrate encrypted wallets,
regardless of whether they are unlocked. Migrating such wallets will
trigger an error, and result in the cleanup being run. This conveniently
allows us to check some parts of the cleanup code.

Github-Pull: bitcoin#26594
Rebased-From: 88afc73
@fanquake fanquake added this to the 24.0.1 milestone Dec 1, 2022
@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 1, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK josibake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@maflcko
Copy link
Member

maflcko commented Dec 1, 2022

In theory this can be merged cleanly without the need to attach metadata: 24.x...achow101:fix-migratewallet-cleanup-segfault

… pre-verack

This commit documents our assumption about
TxRelay::m_tx_inventory_to_send being empty prior to version handshake
completion.

The added Assume acts as testing oracle for our fuzzing tests to
potentially detect if the assumption is violated.

Github-Pull: bitcoin#26569
Rebased-From: ce63fca
…e set

The loop break shouldn't have being there.

Github-Pull: bitcoin#26560
Rebased-From: f930aef
This exercises the bug inside CoinsResult::Erase that
ends up on (1) a wallet crash or (2) a created and
broadcasted tx that contains a reduced recipient's amount.

This is covered by making the wallet selects the preset
inputs twice during the coin selection process.

Making the wallet think that the selection process result covers
the entire tx target when it does not. It's actually creating
a tx that sends more coins than what inputs are covering for.

Which, combined with the SFFO option, makes the wallet
incorrectly reduce the recipient's amount by the difference
between the original target and the wrongly counted inputs.
Which means, a created and relayed tx sending less coins to
the destination than what the user inputted.

Github-Pull: bitcoin#26560
Rebased-From: cf79384
@instagibbs
Copy link
Member

LGTM 8b726bf

Includes the expected fix commits from #26560 and only minor conflicts for the relay piece.

@luke-jr
Copy link
Member

luke-jr commented Dec 6, 2022

Why 24.0.1 instead of 24.1? What was the point of changing the version scheme if we're just going to revert back to the old one?

@maflcko
Copy link
Member

maflcko commented Dec 6, 2022

Why 24.0.1 instead of 24.1?

It is based on the assumption that 24.0 will be nuked from the bin folder, because of the wallet bug. Or is the wallet bug less severe than thought?

@fanquake
Copy link
Member Author

fanquake commented Dec 6, 2022

What was the point of changing the version scheme if we're just going to revert back to the old one?

We aren't.

Why 24.0.1 instead of 24.1?

While 24.0 has been tagged, it hasn't been more widely released (no website post, no mailing list annoucements, a few tweets doesn't count). Rather than tagging a 24.1, which would give the false impression of a more stable point release, containing a number of bug fixes after months of 24.0 running in production, it's more appropritate to incorporate these additional fixes into 24.x, essentially consider 24.0 DOA, and tag a 24.0.1.

Or is the wallet bug less severe than thought?

Everything I've seen, and been told, is that the wallet issue is significant enough to warrant a 24.0.1.

@luke-jr
Copy link
Member

luke-jr commented Dec 6, 2022

I don't see why that would involve going back to X.Y.Z versions. The way things stand, this should be v24.1, while v24.0 gets deleted (or not; irrelevant to the next version number).

@josibake
Copy link
Member

josibake commented Dec 6, 2022

Why 24.0.1 instead of 24.1?

It is based on the assumption that 24.0 will be nuked from the bin folder, because of the wallet bug. Or is the wallet bug less severe than thought?

it's pretty severe in that it affects users doing manual input selection, either in the GUI via coin control or via the RPC, which I think warrants nuking v24.0.

I don't see why that would involve going back to X.Y.Z versions. The way things stand, this should be v24.1, while v24.0 gets deleted (or not; irrelevant to the next version number).

I'm not super familiar with semantic versioning, but v24.0.1 feels more appropriate as this isn't really a major update and more just replacing v24.0 with a bugfix

@luke-jr
Copy link
Member

luke-jr commented Dec 6, 2022

v24.0.1 feels more appropriate as this isn't really a major update and more just replacing v24.0 with a bugfix

With our X.Y, the Y is for minor bugfix-only release, not major ones...

@fanquake
Copy link
Member Author

fanquake commented Dec 6, 2022

With our X.Y, the Y is for minor bugfix-only release, not major ones...

That's why Y is going to remain 0, and we're releasing a 24.0.1.

We've done this this before, with 0.19.0 and 0.19.0.1, under the same circumstances. A last minute issue, where a major release was tagged, but never actually widely released, and we shortly after released a X.0.1.

@josibake
Copy link
Member

josibake commented Dec 6, 2022

ACK 8b726bf

more familiar with commits from #26560 , but did a quick code review of the other commits and they look good.

cherry picked d464b2a, e5d097b, 9d73176, and 8b726bf onto the 24.x branch and verified the newly introduced unit and functional tests failed as expected and then verified they all passed on the backports branch 🎉

@maflcko maflcko merged commit 3afbc7d into bitcoin:24.x Dec 6, 2022
@fanquake fanquake deleted the 24_0_1_backports branch December 6, 2022 11:37
Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

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

ACK 8b726bf, diff matches my local backport. The commits look correct to me though I haven't reviewed #26594.

Noting that this isn't a straight cherry-pick but isn't incorrect.

  • e15b306 is missing the m_next_inv_send_time lock annotation from 845e3a3. That's fine since it has no impact on the binary.
  • 195f0df does not match f930aef, coins_to_remove is changed from a std::unordered_set<COutPoint, SaltedOutpointHasher> to a std::set<COutPoint> since that is the type of preset_coins on 24.x.

@GregTonoski
Copy link

GregTonoski commented Dec 7, 2022

While 24.0 has been tagged, it hasn't been more widely released (no website post, no mailing list annoucements, a few tweets doesn't count). Rather than tagging a 24.1, which would give the false impression of a more stable point release, containing a number of bug fixes after months of 24.0 running in production, it's more appropritate to incorporate these additional fixes into 24.x, essentially consider 24.0 DOA, and tag a 24.0.1.

Appartently, the Bitcoin Core version 24.0 was released widely and similarily to the previous versions - in the Releases section in the Github repository:
image
There is also media covarage.

At least for me, the 24.1 would not give the false impression of a more stable point release (in comparison to 24.0.1).

There are already many instances of 24.0 run by people so I think that it cannot be considered dead on arrival (DOA).

The update to the previous version 24.0 would be clearer to me if its version number is 24.1 instead of 24.0.1. There wouldn't have been many 24.0 versions to confuse them with one another. There isn't the 3rd number expected in the next version of the Bitcoin Core if it is not used in the previous one (24.0).

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.

None yet