-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
rpc: Do not wait for headers inside loadtxoutset #29345
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
Concept ACK I tend to agree that it's best to remove the waiting loop and have instant feedback about missing headers instead, as I think that avoids frustration and/or confusion for users. Curious about reasonable arguments to keep it though (maybe I'm missing something). |
fa461a1
to
faa30a4
Compare
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.
Concept ACK
I agree with this change and @theStack's comment; one case I can think of would be a "ready to go" installation package or something like that? But as @maflcko said in the description, the procedure/ RPC call would need to be re-executed again, so not too sure about it really.
edit: I found here in the original PR #27596 a discussion about the waiting/ timeout.
The only reason I can see to keep it, is when it is made infinite, and the RPC is made async. |
You might consider this coming then #28620 (make |
Looks fine to me. |
ACK faa30a4 Thanks, as @pablomartin4btc found, I had a slight preference for this simpler solution when reviewing the original PR already. I wrote a test for this (and also removed a |
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.
Code-review ACK faa30a4
I have opened a separate PR since this already has multiple ACKs and I might forget to open it later: #29478 |
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.
tACK faa30a4
Testing the script on both master
and this PR, it seems the execution gets stuck (at least for me) at the last validation - snapshot chain reloads -, independently from this change, and the following line would need to be removed, so the client node can be started:
client_sleep_til_boot |
I think when the watch
command sub-process gets stopped with CTRL+C
(as instructed to the user when validation gets completed), both bitcoind
server and client get shutdown (I can see in their debug logs on the other 2 terminals I open following the script instructions during its execution).
I tested the script removing the above line #L199 and validated that works fine. Also, the finish()
function would not kill the server node which got shutdown during the CTRL+C
, unless we still need to provide blocks to the client node, we need to start it up again as well.
diff --git a/contrib/devtools/test_utxo_snapshots.sh b/contrib/devtools/test_utxo_snapshots.sh
index 93a4cd1683..cd34197cf5 100755
--- a/contrib/devtools/test_utxo_snapshots.sh
+++ b/contrib/devtools/test_utxo_snapshots.sh
@@ -196,7 +196,12 @@ echo " Press CTRL+C after you're satisfied to exit the demo"
echo
read -p "Press [enter] to continue"
-client_sleep_til_boot
+# shellcheck disable=SC2086
+./src/bitcoind $SERVER_PORTS -logthreadnames=1 -debug=net -datadir="$SERVER_DATADIR" \
+ $EARLY_IBD_FLAGS -connect=0 -listen=1 >/dev/null &
+SERVER_PID="$!"
+server_sleep_til_boot
+
# shellcheck disable=SC2086
./src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" -connect=0 \
-addnode=127.0.0.1:$SERVER_PORT "$EARLY_IBD_FLAGS" >/dev/null &
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.
ACK faa30a4
I wonder if there is a need to have a bash script to serve as documentation on how to create and load snapshots. Maybe the existing python tests are enough, or a shorter markdown document can be written, with the important key settings and steps highlighted? |
Well, IMPO since it's already there I would keep it updated, it's a different exercise, you need to touch de code and re-compile in order the snapshot to work, you could hit different issues perhaps.
I think, and looking at the current state of the doc, it could be improved adding some command output references and perhaps to some parts of this bash script. |
1ec6684 test: Add test for loadtxoutset when headers are not synced (Fabian Jahr) 2bc1ecf test: Remove unnecessary sync_blocks in assumeutxo tests (Fabian Jahr) Pull request description: It adds a test for the change to `loadtxoutset` made in #29345. Before that change the test doesn't fail right away but times out after 10 minutes. Also removes a `sync_blocks` call that didn't seem to do anything valuable. ACKs for top commit: achow101: ACK 1ec6684 pablomartin4btc: tACK 1ec6684 BrandonOdiwuor: ACK 1ec6684 theStack: ACK 1ec6684 Tree-SHA512: 1337decdf91e4a4f7213fcf8ace1d705e5c1422e0ac3872a59b5be9c33e743850cb8f5f7474750a534952eefd5cfe43fe85a54efb9bc0e47515136a2903676e5
While the
loadtxoutset
default 10 minute timeout is convenient when it is sufficient, it may cause hassle where it is not. For example: