From 2107480b3fa62b88f641de6159ed7716a4932f80 Mon Sep 17 00:00:00 2001 From: jouzo Date: Sun, 13 Nov 2022 10:37:31 +0100 Subject: [PATCH 1/5] Fix node stuck on invalidated block --- ci/parallel_sync/sync_then_diff.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/parallel_sync/sync_then_diff.sh b/ci/parallel_sync/sync_then_diff.sh index 5ad14909bdd..961e5a8d077 100755 --- a/ci/parallel_sync/sync_then_diff.sh +++ b/ci/parallel_sync/sync_then_diff.sh @@ -75,6 +75,9 @@ main() { CUR_BLOCK=$($DEFI_CLI_CMD getblockcount || echo $BLOCK) if [ "$CUR_BLOCK" -eq "$BLOCK" ]; then ATTEMPTS=$((ATTEMPTS + 1)) + + # Handle odd case where node get stuck on previously invalidated block + $DEFI_CLI_CMD reconsiderblock $($DEFI_CLI_CMD getbestblockhash) else ATTEMPTS=0 fi From 7114516b6af0aa01816215ad3396a672bc2050f8 Mon Sep 17 00:00:00 2001 From: jouzo Date: Sun, 13 Nov 2022 10:45:33 +0100 Subject: [PATCH 2/5] Show log file --- .github/workflows/fullsync-tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fullsync-tests.yml b/.github/workflows/fullsync-tests.yml index 5512b757c3b..85e4f76f927 100644 --- a/.github/workflows/fullsync-tests.yml +++ b/.github/workflows/fullsync-tests.yml @@ -126,6 +126,10 @@ jobs: - name: Sync and Diff run: ./sync_then_diff.sh - - name: Show Debug Log + - name: Show debug.log run: cat $DATADIR/debug.log if: ${{ failure() || success() }} + + - name: Show log file + run: cat $DATADIR/debug-tmp-$STOP_BLOCK.log + if: ${{ failure() || success() }} From 03ba00529eff2cf86fb15e4b6fd06a8494b6a489 Mon Sep 17 00:00:00 2001 From: jouzo Date: Sun, 13 Nov 2022 16:24:39 +0100 Subject: [PATCH 3/5] Discard failure on reconsiderblock --- ci/parallel_sync/sync_then_diff.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/parallel_sync/sync_then_diff.sh b/ci/parallel_sync/sync_then_diff.sh index 961e5a8d077..7ab33f7d4f3 100755 --- a/ci/parallel_sync/sync_then_diff.sh +++ b/ci/parallel_sync/sync_then_diff.sh @@ -77,7 +77,7 @@ main() { ATTEMPTS=$((ATTEMPTS + 1)) # Handle odd case where node get stuck on previously invalidated block - $DEFI_CLI_CMD reconsiderblock $($DEFI_CLI_CMD getbestblockhash) + $DEFI_CLI_CMD reconsiderblock "$($DEFI_CLI_CMD getbestblockhash)" || true else ATTEMPTS=0 fi From e894c7418330d1349430b8ede87f1a183ac39811 Mon Sep 17 00:00:00 2001 From: jouzo Date: Sun, 13 Nov 2022 16:28:29 +0100 Subject: [PATCH 4/5] Resolve shellcheck errors --- ci/parallel_sync/sync_then_diff.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ci/parallel_sync/sync_then_diff.sh b/ci/parallel_sync/sync_then_diff.sh index 7ab33f7d4f3..def22ed3711 100755 --- a/ci/parallel_sync/sync_then_diff.sh +++ b/ci/parallel_sync/sync_then_diff.sh @@ -1,7 +1,5 @@ #!/bin/bash -# TODO: Resolve shellcheck errors - export LC_ALL=C set -Eeuo pipefail @@ -35,14 +33,14 @@ setup_vars() { create_log_file () { echo "Output log to $TMP_LOG file" { - $GREP "AccountChange:" $DEBUG_FILE | cut -d" " -f2- + $GREP "AccountChange:" "$DEBUG_FILE" | cut -d" " -f2- $DEFI_CLI_CMD logaccountbalances $DEFI_CLI_CMD spv_listanchors $DEFI_CLI_CMD logstoredinterests $DEFI_CLI_CMD listvaults '{"verbose": true}' '{"limit":1000000}' $DEFI_CLI_CMD listtokens '{"limit":1000000}' $DEFI_CLI_CMD getburninfo - } >> $TMP_LOG + } >> "$TMP_LOG" } # Start defid @@ -92,10 +90,10 @@ main() { $DEFI_CLI_CMD stop # Download reference log file echo "Downloading reference log file : $REF_LOG_PATH" - $FETCH $REF_LOG_PATH + $FETCH "$REF_LOG_PATH" echo "diff $TMP_LOG $REF_LOG" - diff $TMP_LOG $REF_LOG + diff "$TMP_LOG" "$REF_LOG" } main "$@" From 6e80dc300d2fef55ade3d42c1cb9bdcf2f437eff Mon Sep 17 00:00:00 2001 From: jouzo Date: Mon, 14 Nov 2022 09:49:01 +0100 Subject: [PATCH 5/5] Update log file path --- .github/workflows/fullsync-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fullsync-tests.yml b/.github/workflows/fullsync-tests.yml index 06cff80bca8..8703423f6e5 100644 --- a/.github/workflows/fullsync-tests.yml +++ b/.github/workflows/fullsync-tests.yml @@ -127,5 +127,5 @@ jobs: if: ${{ failure() || success() }} - name: Show log file - run: cat $DATADIR/debug-tmp-$STOP_BLOCK.log + run: cat debug-tmp-$STOP_BLOCK.log if: ${{ failure() || success() }}