-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: Merge bitcoin#28618, 28639, 28320, 27829 #7073
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
Changes from all commits
752c8b2
c4ae99f
a55c3c1
fea4e99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,8 +3,44 @@ | |||||
| Assumeutxo is a feature that allows fast bootstrapping of a validating dashd | ||||||
| instance with a very similar security model to assumevalid. | ||||||
|
|
||||||
| The RPC commands `dumptxoutset` and `loadtxoutset` are used to respectively generate | ||||||
| and load UTXO snapshots. The utility script `./contrib/devtools/utxo_snapshot.sh` may | ||||||
| ## Loading a snapshot | ||||||
|
|
||||||
| There is currently no canonical source for snapshots, but any downloaded snapshot | ||||||
| will be checked against a hash that's been hardcoded in source code. | ||||||
|
|
||||||
| Once you've obtained the snapshot, you can use the RPC command `loadtxoutset` to | ||||||
| load it. | ||||||
|
|
||||||
| ### Pruning | ||||||
|
|
||||||
| A pruned node can load a snapshot. To save space, it's possible to delete the | ||||||
| snapshot file as soon as `loadtxoutset` finishes. | ||||||
|
|
||||||
| The minimum `-dbcache` setting is 550 MiB, but this functionality ignores that | ||||||
| minimum and uses at least 1100 MiB. | ||||||
|
|
||||||
| As the background sync continues there will be temporarily two chainstate | ||||||
| directories, each multiple gigabytes in size (likely growing larger than the | ||||||
| the downloaded snapshot). | ||||||
|
|
||||||
| ### Indexes | ||||||
|
|
||||||
| Indexes work but don't take advantage of this feature. They always start building | ||||||
| from the genesis block. Once the background validation reaches the snapshot block, | ||||||
| indexes will continue to build all the way to the tip. | ||||||
|
|
||||||
| For indexes that support pruning, note that no pruning will take place between | ||||||
| the snapshot and the tip, until the background sync has completed - after which | ||||||
| everything is pruned. Depending on how old the snapshot is, this may temporarily | ||||||
| use a significant amount of disk space. | ||||||
|
|
||||||
| ## Generating a snapshot | ||||||
|
|
||||||
| The RPC command `dumptxoutset` can be used to generate a snapshot. This can be used | ||||||
| to create a snapshot on one node that you wish to load on another node. | ||||||
| It can also be used to verify the hardcoded snapshot hash in the source code. | ||||||
|
|
||||||
| The utility scriptt `./contrib/devtools/utxo_snapshot.sh` may | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in "scriptt". The word "scriptt" should be "script". However, if this typo exists in the upstream Bitcoin Core PR being backported, it should be preserved to reduce merge conflicts in future backports. 🔎 Proposed fix if not from upstream-The utility scriptt `./contrib/devtools/utxo_snapshot.sh` may
+The utility script `./contrib/devtools/utxo_snapshot.sh` mayBased on learnings, typos in backported code should be kept as-is to maintain consistency with upstream Bitcoin Core. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[grammar] ~43-~43: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🤖 Prompt for AI Agents |
||||||
| be of use. | ||||||
|
|
||||||
| ## General background | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2772,7 +2772,7 @@ UniValue CreateUTXOSnapshot( | |
| tip->nHeight, tip->GetBlockHash().ToString(), | ||
| fs::PathToString(path), fs::PathToString(temppath))); | ||
|
|
||
| SnapshotMetadata metadata{tip->GetBlockHash(), maybe_stats->coins_count, tip->nChainTx}; | ||
| SnapshotMetadata metadata{tip->GetBlockHash(), maybe_stats->coins_count}; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 28639 is partial because we have no test/functional/feature_assumeutxo.py test (no assume utxo feature is backported yet, same as other backport) |
||
|
|
||
| afile << metadata; | ||
|
|
||
|
|
@@ -2799,9 +2799,7 @@ UniValue CreateUTXOSnapshot( | |
| result.pushKV("base_height", tip->nHeight); | ||
| result.pushKV("path", path.utf8string()); | ||
| result.pushKV("txoutset_hash", maybe_stats->hashSerialized.ToString()); | ||
| // Cast required because univalue doesn't have serialization specified for | ||
| // `unsigned int`, nChainTx's type. | ||
| result.pushKV("nchaintx", uint64_t{tip->nChainTx}); | ||
| result.pushKV("nchaintx", tip->nChainTx); | ||
| return result; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,8 +198,9 @@ static std::vector<RPCArg> CreateTxDoc() | |
| }, | ||
| }, | ||
| }, | ||
| {"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n" | ||
| "That is, each address can only appear once and there can only be one 'data' object.\n" | ||
| {"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs specified as key-value pairs.\n" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 27829 seems ok in this PR |
||
| "Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n" | ||
| "At least one output of either type must be specified.\n" | ||
| "For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n" | ||
| " accepted as second parameter.", | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #!/usr/bin/env python3 | ||
| # | ||
| # Copyright (c) 2018-2020 The Bitcoin Core developers | ||
| # Copyright (c) 2018-present The Bitcoin Core developers | ||
| # Distributed under the MIT software license, see the accompanying | ||
| # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
| # | ||
|
|
@@ -272,6 +272,7 @@ def check_host(args) -> int: | |
| if args.download_binary: | ||
| platforms = { | ||
| 'aarch64-*-linux*': 'aarch64-linux-gnu', | ||
| 'riscv64-*-linux*': 'riscv64-linux-gnu', | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 28320: there are not Probably 28320 is DNM or maybe could be done later if binaries for risc will be shipped in next releases. @PastaPastaPasta ? |
||
| 'x86_64-*-linux*': 'x86_64-linux-gnu', | ||
| 'x86_64-apple-darwin*': 'x86_64-apple-darwin', | ||
| 'aarch64-apple-darwin*': 'arm64-apple-darwin', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
28618 is too early to be backported, because we have not RPC
loadtxoutsetyet