• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

LLMQ PoSe check on your Evonode or Masternode setup through Dashmate

qwizzie

Well-known member
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/Masternode 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 : Add following text (last edited 15th of January 2024)

#!/bin/bash
echo
# Function to extract the highest block height
get_highest_value() {
local highest_value=$(tac ~/.dashmate/logs/mainnet/core.log | 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 ~/.dashmate/logs/mainnet/core.log | 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 ~/.dashmate/logs/mainnet/core.log | 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\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[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[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[0m"
fi
echo

# Combined check at the end
if [[ "$result" == *"llmq_60_75 qi[31]"* && "$highest_value" != "$value2" && "$highest_value" != "$value3" && "$highest_value" != "$value4" ]]; 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
echo


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 :

Knipsel.JPG


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 Masternode / Evonode, so you avoid getting hit with PoSe scores when llmq quorums get restarted again and possibly try to select your Masternode/Evonode, while Dashmate or dashd is still down on your server.

* Best viewed on a maximized PUTTY window

Same can be done with a Masternode / 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:
Update history

15th of January 2024

* small edit to show user the current stage of llmq_60_75 [0-30] for when its not yet in final stage [31]

14th of January 2024

* added error handling throughout the script in case script does not find the quorums in the core.log and therefore can not calculate blocks left before quorum restart.
* added a combine check at the end that will check on both llmq_60_75 reaching final stage [31] and check if all found quorums are older then current blockheight.
* added ANSI color codes

13th of January 2024

* users no longer need to manually check llmq blockheight against current blockheight.

11th of January 2024

* adjusted feedback to users about llmq's finished, indicating this is a llmq blockheight check against current blockheight.

7th of January 2024

* llmq quorum intervals (24/288) are now automatically taken into account and script will only show number of blocks to go to users, before next quorum restart.
* added code to show users if llmq quorums have finished or not. Users should get an alert to not interrupt, if current blockheight = blockheight of one of the quorums (it checks all three). Users still need to check this manually, at least untill i am sure this works as intended.
* renamed 'latest blockheight' in echo to 'current blockheight'.

7th of January 2024

* added more info about llmq interval in first post and its relevance for users and added this in echo to users

6th of January 2024

* updated shell script to check for [31] with llmq_60_75 and warn user to not interrupt if it does not find it.
* users also now get echo with each command to manually check against latest blockheight.
* added additional lines between commands to make it more readable.
* added llmq interval info.
 
Last edited:
This is interesting work, but the previous posts are clumsy and inept. I suggest to take the time to investigate some RPC calls, eg this one in particular. quorum memberof
and
quorum dkgstatus 2
 
Last edited:
This is interesting work, but the previous posts are clumsy and inept. I suggest to take the time to investigate some RPC calls, eg this one in particular. quorum memberof
and
quorum dkgstatus 2
Already tried that, memberof just provide mined DKG windows (already passed) and dkgstatus is too broad
(shows info from all quorum members, if i remember correctly). See : https://github.com/dashpay/platform/issues/1648
An Evo RPC call for fetching current (not mined) llmq quorums from a specific protx hash, is simply missing right now.

The shell script works as interim solution. In a time period of three seconds, users will have all relevant information about their quorums and the quorum interval.
 
Last edited:
Reworked most of the script today (see Update history on post 2).
Looks pretty slick now (see Output on post 1).

Working with ChatGPT (AI) to develop this script has been a good experience.
 
Back
Top