• 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 setup through Dashmate

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"

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 :

Knipsel.JPG


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 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:
Update history

3rd of November 2024

Adjusted script to use docker logs instead of no longer in use core.log and will use it to see at what position Core quorum 100_67 is. We need its position to predict if it will interfere with withdrawals at quorum 22 or not. You will now need to provide the Core containerID at top of script. You can find it by issuing command dashmate status services.

30th of June 2024

* added llmq__400_85 with interval (576) to the script to monitor, added phase blocks info per quorum (this possibly needs to be taken into account by users as well, not sure at the moment), restricted this script to just Evonodes and refreshed the screenshot of the output of this script on post 1.

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