tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
339 stars 210 forks source link

Merge mining proxy exits after a while [igor] #5293

Open hansieodendaal opened 1 year ago

hansieodendaal commented 1 year ago

This happens with self-select on monerod mainnet without any error messages in the log file or in the console.

tari_merge_mining_proxy console ouptut:

Initializing logging according to "config\\log4rs_merge_mining_proxy.yml"
Connecting to base node at 127.0.0.1:18152
Listening on 127.0.0.1:18181...
Initial base node sync achieved. Ready to mine at height #3521
Listening on /ip4/127.0.0.1/tcp/18181...

Press any key to continue . . .

tari_merge_mining_proxy config:

[merge_mining_proxy]

monerod_url = [ # mainnet
    # Tari Labs
    # more reliable
    "http://xmr.nthrow.nyc:18081",
    "http://node1.xmr-tw.org:18081",
    # not so reliable
    "http://node.xmrig.com:18081",
    "http://monero.exan.tech:18081",
    "http://18.132.124.81:18081",
    # Potential issue
    "http://xmr.support:18081",
]

submit_to_origin = false

xmrig config:

{
    "autosave": true,
    "cpu": true,
    "opencl": false,
    "cuda": false,
    "pools": [
        {
            "coin": "monero",
            "algo": "rx/0",
            "url": "cryptonote.social:5556",
            "user": "489r43gR8bDMJNBf4Q6sL9CNERvZQrTqjRCSESqgWQEWWq2UGAfj2voaw3zBtD7U8CQ391Nc1PDHUHiN85yhbZnCDasqzyX.taritest",
            "pass": "start_diff=60000;payment_scheme=pprop;donate=0.5",
            "tls": true,
            "keepalive": true,
            "nicehash": false,
            "self-select": "127.0.0.1:18181",
            "submit-to-origin": true
        }
    ]
}
WildWeasel35 commented 1 year ago

Confirmed to be a long-standing issue for me as well on multiple OS and hardware platforms. Would be happy to test on another XMR pool if anyone knows of an alternative to cryptonote.social that works with merge mining

hansieodendaal commented 1 year ago

For a really long time, using the configuration above, I have been running XMrig from a Powershell script (as administrator) on Windows 10 that would restart XMRig every 45 minutes or so. My original issue was that it seems XMRig stops communicating with cryptonote.social. Since I discovered the issue above, I added a check that would execute every minute to see if the merge mining proxy is still running. I have some results to share.

The Powershell script:


param ($merge_mining_proxy_path)
if ($Null -eq $merge_mining_proxy_path) {
    Write-Information -MessageData "'merge_mining_proxy_exe' not set" -InformationAction Continue
    Exit
}
$current_path = Get-Location

$xmrig_exe = "xmrig"
$merge_mining_proxy_exe = "tari_merge_mining_proxy"

function Start-Proxy-If-Not-Running($count) {
    if ($Null -eq (get-process $merge_mining_proxy_exe -ErrorAction SilentlyContinue)) { 
        Write-Information -MessageData "$merge_mining_proxy_exe is not running, starting ($count)" -InformationAction Continue
        Set-Location $merge_mining_proxy_path
        Start-Process -FilePath "start_tari_merge_mining_proxy.bat"
        Set-Location $current_path
        return $true
    }
    return $false
}

function Stop-Start-Xmrig($count) {
    if ($Null -ne (get-process $xmrig_exe -ErrorAction SilentlyContinue)) { 
        Stop-Process -Name ($xmrig_exe) 
    }
    Write-Information -MessageData "stop-start $xmrig_exe ($count)" -InformationAction Continue
    Start-Process -FilePath ./$xmrig_exe -ArgumentList "--log-file=.\xmrig.exe.log --verbose"
}

$loop_count = 0
$proxy_restart_count = 1
$xmrig_restart_count = 1
do {
    $restarted = Start-Proxy-If-Not-Running($proxy_restart_count)
    if ($true -eq $restarted) {
        $proxy_restart_count += 1
    }
    if ($loop_count % 45 -eq 0) {
        Stop-Start-Xmrig($xmrig_restart_count)
        $xmrig_restart_count += 1
    }
    Start-Sleep -Seconds (1 * 60)
    $loop_count += 1
} while ($true)

The console output - the merge mining proxy exited by itself 4 times in ~44.5 hours (the 1st entries are normal startup):

tari_merge_mining_proxy is not running, starting (1)
stop-start xmrig (1)
stop-start xmrig (2)
stop-start xmrig (3)
stop-start xmrig (4)
stop-start xmrig (5)
stop-start xmrig (6)
stop-start xmrig (7)
stop-start xmrig (8)
stop-start xmrig (9)
stop-start xmrig (10)
stop-start xmrig (11)
stop-start xmrig (12)
stop-start xmrig (13)
stop-start xmrig (14)
stop-start xmrig (15)
stop-start xmrig (16)
stop-start xmrig (17)
stop-start xmrig (18)
stop-start xmrig (19)
stop-start xmrig (20)
stop-start xmrig (21)
stop-start xmrig (22)
stop-start xmrig (23)
stop-start xmrig (24)
stop-start xmrig (25)
stop-start xmrig (26)
stop-start xmrig (27)
stop-start xmrig (28)
stop-start xmrig (29)
stop-start xmrig (30)
stop-start xmrig (31)
stop-start xmrig (32)
stop-start xmrig (33)
stop-start xmrig (34)
stop-start xmrig (35)
stop-start xmrig (36)
stop-start xmrig (37)
stop-start xmrig (38)
stop-start xmrig (39)
tari_merge_mining_proxy is not running, starting (2)
stop-start xmrig (40)
stop-start xmrig (41)
stop-start xmrig (42)
stop-start xmrig (43)
stop-start xmrig (44)
stop-start xmrig (45)
stop-start xmrig (46)
stop-start xmrig (47)
tari_merge_mining_proxy is not running, starting (3)
tari_merge_mining_proxy is not running, starting (4)
stop-start xmrig (48)
stop-start xmrig (49)
stop-start xmrig (50)
stop-start xmrig (51)
stop-start xmrig (52)
stop-start xmrig (53)
stop-start xmrig (54)
stop-start xmrig (55)
tari_merge_mining_proxy is not running, starting (5)
stop-start xmrig (56)
stop-start xmrig (57)
stop-start xmrig (58)
stop-start xmrig (59)

For the console output above, the last entries in the trace log file before the proxy exited:

SWvheerden commented 1 year ago

lets reconfirm or close

hansieodendaal commented 1 year ago

Confirmed, still an issue Please keep this issue open

WildWeasel35 commented 1 year ago

Confirmed still an issue on Ubuntu and Mac as well, connecting to a private pool with self-select. Tari stagenet, Monero mainnet.

@hansieodendaal, have you found it necessary to restart xmrig if the proxy is restarted before xmrig flatlines?

stringhandler commented 1 year ago

Thanks! image

hansieodendaal commented 1 year ago

@WildWeasel35, I made a PowerShell script that restarts XMRig every 45 minutes irrespective if it is working or not and checks every minute if the merge mining proxy is still running. The reason for this is that sometimes XMRig goes stale and the merge mining proxy exits.

run_xmrig.zip

WildWeasel35 commented 1 year ago

Great, thank you. I find that my xmrig only goes stale when merge mining. It doesn't exit but continues to run, just with no hash rate. This will help