tari-project / tari

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

Tari merged mined blocks only seldomly being submitted to the Tari blockchain #2418

Closed hansieodendaal closed 3 years ago

hansieodendaal commented 3 years ago

Describe the bug

  1. Tari merged mined blocks are only seldomly being submitted to the Tari blockchain.

    In a merge mining test that lasted for 1 hour and 50 minutes, with the Tari difficulty ranging between 30.3% to 23.9% of the Monero difficulty, 72 blocks were submitted to the Monero stagenet blockchain, while only 17 blocks were submitted to the Tari Ridcully testnet blockchain. The code logic is to solve for the lower difficulty and to submit every solution that is found to both blockchains, with the onus being on the respective base nodes to decide if the block will be accepted or rejected.

  2. It is evident from analysing the log files that whenever submissions to the Tari blockhain happens, that it is not synchronyzed with submissions to the Monero blockchain.

To Reproduce

Steps to reproduce the behavior:

  1. Start a Tari base node, Tari console wallet and Tari merge mining proxy, with configuration settings adequate for merge mining. Ensure the Tari base node is synced to the blockchain.
  2. Start the Monero xmrig miner, with configuration settings adequate for Tari merge mining.

Expected behavior

All solutions that are found should be submitted to both the Monero stagenet and Tari Ridcully testnet blockchains.

Screenshots

n/a

Desktop (please complete the following information):

Linux Ubuntu 18.04 LTS

Smartphone (please complete the following information):

n/a

Additional context

See extract of log files and seleced log entries below.

Log file here: block-submission.log

Extract:

Counts:
72 of "Block submitted to monerod"
17 of "Submitted block #.... to Tari node"

Difficulties:
Test start at 2020-11-03 15:50:03.675702700 [tari_mm_proxy::xmrig] INFO  Difficulties: Tari (142692), Monero(470474)
Test end at   2020-11-03 17:40:17.389815300 [tari_mm_proxy::xmrig] INFO  Difficulties: Tari (111470), Monero(466381)

Block submission time line:
2020-11-03 15:50:34.069054700 [tari_mm_proxy::xmrig] DEBUG Monero height = 700816, Tari base node height = 2207 
2020-11-03 15:50:34.806056400 [tari_mm_proxy::xmrig] DEBUG Block submitted to monerod, response is: {"error":{"code":-7,"message":"Block not accepted"},"id":2,"jsonrpc":"2.0"} 
2020-11-03 15:50:35.050775100 [tari_mm_proxy::xmrig] DEBUG Monero height = 700816, Tari base node height = 2207 

2020-11-03 15:50:50.912369700 [tari_mm_proxy::xmrig] DEBUG Monero height = 700816, Tari base node height = 2207 
2020-11-03 15:50:51.132891600 [tari_mm_proxy::xmrig] DEBUG Block submitted to monerod, response is: {"error":{"code":-7,"message":"Block not accepted"},"id":4,"jsonrpc":"2.0"} 

2020-11-03 15:52:02.344797600 [tari_mm_proxy::xmrig] DEBUG Monero height = 700817, Tari base node height = 2207 
2020-11-03 15:52:03.039018500 [tari_mm_proxy::xmrig] DEBUG Block submitted to monerod, response is: {"id":7,"jsonrpc":"2.0","result":{"status":"OK","untrusted":false}} 

2020-11-03 15:52:07.205752900 [tari_mm_proxy::xmrig] DEBUG Monero height = 700818, Tari base node height = 2208 
2020-11-03 15:52:07.213804100 [tari_mm_proxy::xmrig] DEBUG Submitted block #2208 to Tari node 
2020-11-03 15:52:07.217368400 [tari_mm_proxy::xmrig] DEBUG Monero height = 700818, Tari base node height = 2208 
2020-11-03 15:52:07.218662700 [tari_mm_proxy::xmrig] DEBUG Monero height = 700818, Tari base node height = 2208 

2020-11-03 15:54:24.287716000 [tari_mm_proxy::xmrig] DEBUG Monero height = 700819, Tari base node height = 2208 
2020-11-03 15:54:24.756879000 [tari_mm_proxy::xmrig] DEBUG Block submitted to monerod, response is: {"error":{"code":-7,"message":"Block not accepted"},"id":16,"jsonrpc":"2.0"} 
StriderDM commented 3 years ago

@hansieodendaal Think this issue can be closed.

delta1 commented 3 years ago

nice one! fixed by #2425