Skip to content

Commit

Permalink
Discard reconsiderblock failure on full sync CI (DeFiCh#1563)
Browse files Browse the repository at this point in the history
* Fix node stuck on invalidated block

* Show log file

* Discard failure on reconsiderblock

* Resolve shellcheck errors

* Update log file path

Co-authored-by: Prasanna Loganathar <[email protected]>
  • Loading branch information
Jouzo and prasannavl authored Nov 14, 2022
1 parent 6fb9a1e commit f54f0ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/fullsync-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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 debug-tmp-$STOP_BLOCK.log
if: ${{ failure() || success() }}
13 changes: 7 additions & 6 deletions ci/parallel_sync/sync_then_diff.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

# TODO: Resolve shellcheck errors

export LC_ALL=C
set -Eeuo pipefail

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -75,6 +73,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)" || true
else
ATTEMPTS=0
fi
Expand All @@ -89,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 "$@"
Expand Down

0 comments on commit f54f0ec

Please sign in to comment.