dominant-strategies / go-quai

Official Go Implementation of the Quai Network
GNU General Public License v3.0
2.36k stars 457 forks source link

[Bug] - We are dropping and not recieving a subset of ETXs #1787

Closed kiltsonfire closed 1 month ago

kiltsonfire commented 1 month ago

System information

Go-quai version: go-quai 449166b519ba104e867353dd847b2ee676307791

Expected behaviour

We should have inbound and outbound ETXs be approximately equal.

Actual behaviour

They are not anywhere close to equivalent.

Zone Inbound ETXs Outbound ETXs Inbound/Outbound
zone-0-0 345992 786389 0.44
zone-0-1 279483 880805 0.32
zone-0-2 485436 804399 0.60
zone-1-0 333641 0 N/A
zone-1-1 369971 782030 0.47
zone-1-2 310094 805492 0.38
zone-2-0 241825 816936 0.30
zone-2-1 585074 826435 0.71
zone-2-2 287626 830063 0.35
Total 3237142 6536549 0.50

Note that 1-0 has a known issue with genallocs/transactor. Also note that in aggregate we appear to be off by a factor of two. This could be very simply

Steps to reproduce the behaviour

1) 30 node environment 2) 27 slices 3) all mining 4) running quai transactors on all nodes

kiltsonfire commented 1 month ago

Script to do counting on log files

#!/bin/bash

# Function to display usage
usage() {
    echo "Usage: $0 -f <log_file>"
    exit 1
}

# Parse the command line arguments
while getopts ":f:" opt; do
    case ${opt} in
        f )
            log_file=$OPTARG
            ;;
        \? )
            usage
            ;;
    esac
done

# Check if log_file is set
if [ -z "$log_file" ]; then
    usage
fi

# Initialize variables
inbound_total=0
outbound_total=0

# Process only the lines containing "Appended"
grep "Appended" "$log_file" | sed 's/\x1b\[[0-9;]*m//g' | while IFS= read -r line; do
    # Extract and sum up the inbound etxs
    inbound=$(echo "$line" | grep -oP 'etxs inbound=\K\d+')
    if [ -n "$inbound" ]; then
        inbound_total=$((inbound_total + inbound))
    fi

    # Extract and sum up the outbound etxs
    outbound=$(echo "$line" | grep -oP 'etxs emitted=\K\d+')
    if [ -n "$outbound" ]; then
        outbound_total=$((outbound_total + outbound))
    fi

    echo "Total Inbound ETXs: $inbound_total"
    echo "Total Outbound ETXs: $outbound_total"
done