qwizzie
Well-known member
**** Obsolete, due to Dashmate now having build-in Pose penalty scoring detection during dashmate stop ****
Dashmate users that want to stop their Dashmate in order to update their Core version, or update their Dashmate version or do server Maintenance or want to do a server reboot, first need to check if their Evonode is currently not involved in any LLMQ quorum, that give high PoSe Penalty scores when interrupted. To avoid these high PoSe Penalty scores or PoSe bans (interrupting two llmq quorums = Instant PoSe ban), the following shell script can be created and used to fetch this directly from Dashmate core.log
From Windows :
Step 1 : Create a new text file
Step 2 : Perform command 'dashmate status services' : copy Core containerID.
Step 2 : Add following text (last edited 3rd of November 2024) : add Core containerID to container_id="XXXXXXXXXXXXXXXXXXXX"
Step 3 : Save as posecheck.txt
Step 4 : Rename to posecheck.sh
Step 5 : Transfer this file to your Ubuntu home directory (i use WinSCP for this)
Step 6 : chmod +x posecheck.sh
Step 7 : dos2unix posecheck.sh
(if dos2unix not installed, then install through sudo apt-get install dos2unix but on my Ubuntu system it was already installed)
Step 8 : ./posecheck.sh
'./posecheck.sh' command can now be used to have above commands in shell script executed automatically, with 1 second between each command.
Output :
Output handling for user :
* Be informed that llmq_60_75 needs to end with [31], if there is a lower number then wait and check from time to time untill it reached [31].
You should get a warning if the script does not find [31], urging you to not interrupt it.
* Use 'blocks to go before quorum restart' to see when is an opportune moment to stop your Evonode, so you avoid getting hit with PoSe scores when llmq quorums get restarted again and possibly try to select your Evonode, while Dashmate or dashd is still down on your server. Phase blocks may also need to be considered. If a quorum shows a very low number of blocks to go, i would just wait untill that quorum has restarted and is 5 blocks into it. Same with a quorum just starting (see llmq_100_67 interval 24, blocks to go 24 in above screenshot), after script removed the red alert (next block) i would just wait 5 blocks, to stay on the safe side.
* Best viewed on a maximized PUTTY window
Same can be done with an Evonode that has not been setup through Dashmate, but you will need to adjust both the path and the filename (~/.dashcore/debug.log ??) in above mentioned shell script, as logs from Dashmate differ in name and path.
Dashmate users that want to stop their Dashmate in order to update their Core version, or update their Dashmate version or do server Maintenance or want to do a server reboot, first need to check if their Evonode is currently not involved in any LLMQ quorum, that give high PoSe Penalty scores when interrupted. To avoid these high PoSe Penalty scores or PoSe bans (interrupting two llmq quorums = Instant PoSe ban), the following shell script can be created and used to fetch this directly from Dashmate core.log
From Windows :
Step 1 : Create a new text file
Step 2 : Perform command 'dashmate status services' : copy Core containerID.
Step 2 : Add following text (last edited 3rd of November 2024) : add Core containerID to container_id="XXXXXXXXXXXXXXXXXXXX"
Bash:
#!/bin/bash
echo
# Change the Docker container ID here
container_id="XXXXXXXXXXXXXXXXXXXX"
# Fetch logs from the Docker container and save to a readable log file
docker logs "$container_id" > readable_log.txt
# Function to extract the highest block height
get_highest_value() {
local highest_value=$(tac readable_log.txt | grep -o 'height=[0-9]*' | head -n 1 | cut -d '=' -f2)
echo "$highest_value"
}
# Function to get the height value for a specific quorum type
get_height_value() {
local quorum_type=$1
local result=$(tac readable_log.txt | grep "quorum initialization OK for $quorum_type" | head -n 1)
if [[ -z "$result" ]]; then
echo -e "\e[31mError: Quorum initialization not found for $quorum_type\e[0m"
exit 1
fi
local height_value=$(echo "$result" | grep -o 'height\[[0-9]*\]' | head -n 1 | cut -d '[' -f2 | cut -d ']' -f1)
if [[ -z "$height_value" ]]; then
echo -e "\e[31mError: Failed to extract height value for $quorum_type\e[0m"
exit 1
fi
echo "$height_value"
}
# Main script
highest_value=$(get_highest_value)
echo -e "\e[36mCurrent Block Height : \e[36m$highest_value\e[0m"
sleep 1
echo
# Check llmq_60_75
result=$(tac readable_log.txt | grep "quorum initialization OK for llmq_60_75" | head -n 1)
if [[ "$result" == *"llmq_60_75 qi[31]"* ]]; then
echo -e "\e[36mllmq quorum_60_75 reached final stage \e[32m[31]\e[36m\e[0m"
echo -e "\e[33mplease take quorum restarts into account and possibly the phase blocks as well\e[0m"
value2=$(get_height_value "llmq_60_75")
result2=$(echo "$value2+288-$highest_value" | bc 2>/dev/null)
if [[ "$result2" == "" ]]; then
echo -e "\e[31mError: Failed to calculate llmq_60_75 blocks to go before quorum restart\e[0m"
else
echo
echo -e "\e[36mllmq_60_75 blocks to go before quorum restart (interval 288) : $result2 \e[38;5;214m(phase blocks +2)\e[0m"
fi
else
echo -e "\e[31m***** $result *****\e[0m"
echo -e "\e[31m***** llmq_60_75 is still in progress (not [31]), do not interrupt !! *****\e[0m"
echo
fi
sleep 1
# Check llmq_100_67
value3=$(get_height_value "llmq_100_67")
result3=$(echo "$value3+24-$highest_value" | bc 2>/dev/null)
if [[ "$result3" == "" ]]; then
echo -e "\e[31mError: Failed to calculate llmq_100_67 blocks to go before quorum restart\e[0m"
else
echo -e "\e[36mllmq_100_67 blocks to go before quorum restart (interval 24) : $result3 \e[38;5;214m(phase blocks +2)\e[0m"
fi
# Check llmq_400_60
value4=$(get_height_value "llmq_400_60")
result4=$(echo "$value4+288-$highest_value" | bc 2>/dev/null)
if [[ "$result4" == "" ]]; then
echo -e "\e[31mError: Failed to calculate llmq_400_60 blocks to go before quorum restart\e[0m"
else
echo -e "\e[36mllmq_400_60 blocks to go before quorum restart (interval 288) : $result4 \e[38;5;214m(phase blocks +4)\e[0m"
fi
# Check llmq_400_85
value5=$(get_height_value "llmq_400_85")
result5=$(echo "$value5+576-$highest_value" | bc 2>/dev/null)
if [[ "$result5" == "" ]]; then
echo -e "\e[31mError: Failed to calculate llmq_400_85 blocks to go before quorum restart\e[0m"
else
echo -e "\e[36mllmq_400_85 blocks to go before quorum restart (interval 576) : $result5 \e[38;5;214m(phase blocks +4)\e[0m"
fi
echo
# Combined check at the end
if [[ "$result" == *"llmq_60_75 qi[31]"* && "$highest_value" != "$value2" && "$highest_value" != "$value3" && "$highest_value" != "$value4" && "$highest_value" != "$value5" ]]; then
echo -e "\e[32m***** All llmq quorums blockheights older than current blockheight & llmq_60_75 reached final stage [31] --> all quorums finished *****\e[0m"
else
echo -e "\e[31m***** Do not interrupt for now, 1 or more quorums not finished !! *****\e[0m"
fi
sleep 1
Step 3 : Save as posecheck.txt
Step 4 : Rename to posecheck.sh
Step 5 : Transfer this file to your Ubuntu home directory (i use WinSCP for this)
Step 6 : chmod +x posecheck.sh
Step 7 : dos2unix posecheck.sh
(if dos2unix not installed, then install through sudo apt-get install dos2unix but on my Ubuntu system it was already installed)
Step 8 : ./posecheck.sh
'./posecheck.sh' command can now be used to have above commands in shell script executed automatically, with 1 second between each command.
Output :
Output handling for user :
* Be informed that llmq_60_75 needs to end with [31], if there is a lower number then wait and check from time to time untill it reached [31].
You should get a warning if the script does not find [31], urging you to not interrupt it.
* Use 'blocks to go before quorum restart' to see when is an opportune moment to stop your Evonode, so you avoid getting hit with PoSe scores when llmq quorums get restarted again and possibly try to select your Evonode, while Dashmate or dashd is still down on your server. Phase blocks may also need to be considered. If a quorum shows a very low number of blocks to go, i would just wait untill that quorum has restarted and is 5 blocks into it. Same with a quorum just starting (see llmq_100_67 interval 24, blocks to go 24 in above screenshot), after script removed the red alert (next block) i would just wait 5 blocks, to stay on the safe side.
* Best viewed on a maximized PUTTY window
Same can be done with an Evonode that has not been setup through Dashmate, but you will need to adjust both the path and the filename (~/.dashcore/debug.log ??) in above mentioned shell script, as logs from Dashmate differ in name and path.
Last edited: