Skip to content

Commit 9b15640

Browse files
committed
Templates: take PR Club content from YAML header
1 parent 2f7d9f1 commit 9b15640

File tree

2 files changed

+79
-59
lines changed

2 files changed

+79
-59
lines changed

_includes/functions/review-club.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{page.review-club.summary}}
2+
3+
<div class="{{include.class | default: 'qa_details'}} {{jekyll.environment}}" markdown="1">
4+
{% for qa in page.review-club.qa %}
5+
{% capture alink %}{% if qa.link != nil %}<a href="{{ qa.link }}" class="external">➚</a>{% endif %}{% endcapture %}
6+
{% if jekyll.environment == "email" %}
7+
- <i markdown="1">{{qa.question}}</i><br>{{qa.answer}}&nbsp;{{alink}}
8+
{% else %}
9+
- <details id="{{qslug}}" markdown="1"><summary><span markdown="1">{{qa.question}}</span></summary>
10+
{{qa.answer}}&nbsp;{{alink}}
11+
</details>
12+
{% endif %}
13+
{% endfor %}
14+
</div>

_posts/en/newsletters/2024-06-14-newsletter.md

+65-59
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,70 @@ slug: 2024-06-14-newsletter
66
type: newsletter
77
layout: newsletter
88
lang: en
9+
10+
review-club:
11+
summary: |
12+
[Don't wipe indexes again when continuing a prior reindex][review club
13+
30132] is a PR by [TheCharlatan][gh thecharlatan] that can improve
14+
startup time when a user restarts their node before an ongoing reindex
15+
has completed.
16+
17+
Bitcoin Core implements five indexes. The UTXO set and the block index
18+
are required, whereas the transaction index, [compact block
19+
filter][topic compact block filters] index, and coinstats index are
20+
optional. When running with `-reindex`, all indexes are wiped and
21+
rebuilt. This process can take quite a while, and it is not guaranteed
22+
to finish before the node is stopped for any reason.
23+
24+
Because the node needs an up-to-date UTXO set and block index,
25+
the reindexing status is persisted on disk. When a reindex is started, a
26+
flag is [set][reindex flag set], and it will only be unset when the
27+
reindex is finished. This way, when the node starts, it can detect that
28+
it should continue reindexing, even if the user didn’t provide the flag
29+
as a startup option.
30+
31+
When restarting (without `-reindex`) after an unfinished reindex, the
32+
required indexes are preserved and will continue to be rebuilt.
33+
Before [Bitcoin Core #30132][], the optional indexes would be wiped a
34+
second time. [Bitcoin Core #30132][] can make node startup more
35+
efficient by avoiding the wiping of the optional indexes when not
36+
necessary.
37+
38+
qa:
39+
- question: What is the behavior change introduced by this PR?
40+
answer: |
41+
Behaviour is changed in three ways. First, as per the goal of this
42+
PR, optional indexes are no longer wiped again when the node is
43+
restarted before reindexing is completed. This aligns the wiping
44+
behavior of optional indexes with that of required indexes. Second,
45+
when a user requests a reindex through the GUI, this request is no
46+
longer ignored, reversing a subtle bug introduced in [b47bd95][gh
47+
b47bd95]. Third, the log line "Initializing databases...\\n" is
48+
removed.
49+
link: https://bitcoincore.reviews/30132#l-19
50+
51+
- question: What are the two ways an optional index can process new blocks?
52+
answer: |
53+
When an optional index is initialized, it checks if its highest
54+
block is the same as the current chaintip. If it is not, it will first
55+
process all missing blocks with a background sync, through
56+
`BaseIndex::StartBackgroundSync()`. When the index catches up
57+
with the chaintip, it will process all further blocks through the
58+
validation interface using `ValidationSignals::BlockConnected`.
59+
link: https://bitcoincore.reviews/30132#l-52
60+
61+
- question: How does this PR affect the logic of optional indexes processing new blocks?
62+
answer: |
63+
Before this PR, wiping the optional indexes without wiping the
64+
chainstate means these indexes will be considered out-of-sync. As per
65+
the previous question, that means they will first perform a background
66+
sync before switching to the validation interface. With this PR, the
67+
optional indexes remain in sync with the chainstate, and as such no
68+
background sync is required. Note: background sync only starts after
69+
reindex has completed, whereas processing validation events happens in
70+
parallel.
71+
link: https://bitcoincore.reviews/30132#l-70
72+
973
---
1074
This week's newsletter announces a draft BIP for a quantum-safe Bitcoin
1175
address format and includes our regular sections with the summary of a
@@ -32,68 +96,10 @@ Club][] meeting, highlighting some of the important questions and
3296
answers. Click on a question below to see a summary of the answer from
3397
the meeting.*
3498

35-
[Don't wipe indexes again when continuing a prior reindex][review club
36-
30132] is a PR by [TheCharlatan][gh thecharlatan] that can improve
37-
startup time when a user restarts their node before an ongoing reindex
38-
has completed.
39-
40-
Bitcoin Core implements five indexes. The UTXO set and the block index
41-
are required, whereas the transaction index, [compact block
42-
filter][topic compact block filters] index, and coinstats index are
43-
optional. When running with `-reindex`, all indexes are wiped and
44-
rebuilt. This process can take quite a while, and it is not guaranteed
45-
to finish before the node is stopped for any reason.
46-
47-
Because the node needs an up-to-date UTXO set and block index,
48-
the reindexing status is persisted on disk. When a reindex is started, a
49-
flag is [set][reindex flag set], and it will only be unset when the
50-
reindex is finished. This way, when the node starts, it can detect that
51-
it should continue reindexing, even if the user didn’t provide the flag
52-
as a startup option.
53-
54-
When restarting (without `-reindex`) after an unfinished reindex, the
55-
required indexes are preserved and will continue to be rebuilt.
56-
Before [Bitcoin Core #30132][], the optional indexes would be wiped a
57-
second time. [Bitcoin Core #30132][] can make node startup more
58-
efficient by avoiding the wiping of the optional indexes when not
59-
necessary.
99+
{% include functions/review-club.md %}
60100

61101
{% assign timestamp="23:28" %}
62102

63-
{% include functions/details-list.md
64-
q0="What is the behavior change introduced by this PR?"
65-
a0="Behaviour is changed in three ways. First, as per the goal of this
66-
PR, optional indexes are no longer wiped again when the node is
67-
restarted before reindexing is completed. This aligns the wiping
68-
behavior of optional indexes with that of required indexes. Second,
69-
when a user requests a reindex through the GUI, this request is no
70-
longer ignored, reversing a subtle bug introduced in [b47bd95][gh
71-
b47bd95]. Third, the log line \"Initializing databases...\\n\" is
72-
removed."
73-
a0link="https://bitcoincore.reviews/30132#l-19"
74-
75-
q1="What are the two ways an optional index can process new blocks?"
76-
a1="When an optional index is initialized, it checks if its highest
77-
block is the same as the current chaintip. If it is not, it will first
78-
process all missing blocks with a background sync, through
79-
`BaseIndex::StartBackgroundSync()`. When the index catches up
80-
with the chaintip, it will process all further blocks through the
81-
validation interface using `ValidationSignals::BlockConnected`."
82-
a1link="https://bitcoincore.reviews/30132#l-52"
83-
84-
q2="How does this PR affect the logic of optional indexes processing
85-
new blocks?"
86-
a2="Before this PR, wiping the optional indexes without wiping the
87-
chainstate means these indexes will be considered out-of-sync. As per
88-
the previous question, that means they will first perform a background
89-
sync before switching to the validation interface. With this PR, the
90-
optional indexes remain in sync with the chainstate, and as such no
91-
background sync is required. Note: background sync only starts after
92-
reindex has completed, whereas processing validation events happens in
93-
parallel."
94-
a2link="https://bitcoincore.reviews/30132#l-70"
95-
%}
96-
97103
## Releases and release candidates
98104

99105
*New releases and release candidates for popular Bitcoin infrastructure

0 commit comments

Comments
 (0)