Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add monerod detection as an option to the merge mining proxy #6248

Merged

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Apr 4, 2024

Description

  • Fixed an error where the monerod server connection attempt would not timeout if it did not succeed.
  • Added dynamic and robust monerod detection to the merge mining proxy as an optional alternative to the monerod URLs specified in the config. If enabled, dynamically detected monerod servers will be ordered according to the best response times.

Motivation and Context

Merge mining with monero mining recently had issues (stopped) due to a configured public monerod server not stopped being responsive anymore.

How Has This Been Tested?

  • Added new unit tests for dynamic monerod detection
  • Performed system-level testing

Example unit test output:

0: MonerodEntry { address_type: "clear", url: "http://213.227.135.106:18081", height: 3119866, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(429.0735ms) }
1: MonerodEntry { address_type: "clear", url: "http://hatchi-home.ddns.net:18089", height: 3119865, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(492.1296ms) }
2: MonerodEntry { address_type: "clear", url: "http://01.its-a-node.org:18081", height: 3119865, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(526.3674ms) }
3: MonerodEntry { address_type: "clear", url: "http://moneronode.xyz:18089", height: 3119865, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(679.1088ms) }
4: MonerodEntry { address_type: "clear", url: "http://23.137.254.9:18081", height: 3119866, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(704.3092ms) }

Example merge mining proxy startup log:

2024-04-04 15:45:59.087723700 [reqwest::connect] DEBUG starting new connection: https://monero.fail/
2024-04-04 15:46:02.023687700 [reqwest::connect] DEBUG starting new connection: http://213.227.135.106:18081/
2024-04-04 15:46:02.454594200 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(430.95ms)' for Monerod server at: http://213.227.135.106:18081/getheight
2024-04-04 15:46:02.454749300 [reqwest::connect] DEBUG starting new connection: https://monero.homeqloud.com/
2024-04-04 15:46:03.452241100 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(997.53ms)' for Monerod server at: https://monero.homeqloud.com/getheight
2024-04-04 15:46:03.452339500 [reqwest::connect] DEBUG starting new connection: http://23.137.254.9:18081/
2024-04-04 15:46:04.147777700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(695.48ms)' for Monerod server at: http://23.137.254.9:18081/getheight
2024-04-04 15:46:04.147896500 [reqwest::connect] DEBUG starting new connection: http://dudeistnl.duckdns.org:18089/
2024-04-04 15:46:04.836452600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(688.62ms)' for Monerod server at: http://dudeistnl.duckdns.org:18089/getheight
2024-04-04 15:46:04.836536800 [reqwest::connect] DEBUG starting new connection: http://monero1.com:18089/
2024-04-04 15:46:05.681670400 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(845.16ms)' for Monerod server at: http://monero1.com:18089/getheight
2024-04-04 15:46:05.681869000 [reqwest::connect] DEBUG starting new connection: http://xmr-pruned.p2pool.uk:18089/
2024-04-04 15:46:06.257987100 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(576.16ms)' for Monerod server at: http://xmr-pruned.p2pool.uk:18089/getheight
2024-04-04 15:46:06.258112500 [reqwest::connect] DEBUG starting new connection: https://xmr-au-1.cryptovps.io/
2024-04-04 15:46:08.079965500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.82s)' for Monerod server at: https://xmr-au-1.cryptovps.io/getheight
2024-04-04 15:46:08.080055500 [reqwest::connect] DEBUG starting new connection: http://l4nk0r.dev:18089/
2024-04-04 15:46:09.128763700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.05s)' for Monerod server at: http://l4nk0r.dev:18089/getheight
2024-04-04 15:46:09.128873200 [reqwest::connect] DEBUG starting new connection: http://nexper-xmr-node.tplinkdns.com:18081/
2024-04-04 15:46:09.893416200 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(764.58ms)' for Monerod server at: http://nexper-xmr-node.tplinkdns.com:18081/getheight
2024-04-04 15:46:09.893494700 [reqwest::connect] DEBUG starting new connection: http://202.169.99.195:18089/
2024-04-04 15:46:11.131535500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.24s)' for Monerod server at: http://202.169.99.195:18089/getheight
2024-04-04 15:46:11.131644200 [reqwest::connect] DEBUG starting new connection: http://node0-eu.monero.love:18089/
2024-04-04 15:46:11.795190600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(663.59ms)' for Monerod server at: http://node0-eu.monero.love:18089/getheight
2024-04-04 15:46:11.795278100 [reqwest::connect] DEBUG starting new connection: http://01.its-a-node.org:18081/
2024-04-04 15:46:12.524508500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(729.26ms)' for Monerod server at: http://01.its-a-node.org:18081/getheight
2024-04-04 15:46:12.524641700 [reqwest::connect] DEBUG starting new connection: http://rucknium.me:18081/
2024-04-04 15:46:12.971353900 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(446.77ms)' for Monerod server at: http://rucknium.me:18081/getheight
2024-04-04 15:46:12.971458900 [reqwest::connect] DEBUG starting new connection: http://node.sethforprivacy.com:18089/
2024-04-04 15:46:13.770796600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(799.37ms)' for Monerod server at: http://node.sethforprivacy.com:18089/getheight
2024-04-04 15:46:13.770910900 [reqwest::connect] DEBUG starting new connection: http://nihilism.network:18081/
2024-04-04 15:46:14.230763700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(459.89ms)' for Monerod server at: http://nihilism.network:18081/getheight
2024-04-04 15:46:14.230878600 [reqwest::connect] DEBUG starting new connection: http://xmr.godz.co.uk:18081/
2024-04-04 15:46:15.087522500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(856.68ms)' for Monerod server at: http://xmr.godz.co.uk:18081/getheight
2024-04-04 15:46:15.087649000 [reqwest::connect] DEBUG starting new connection: https://datura.network:18081/
2024-04-04 15:46:15.783401900 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(695.80ms)' for Monerod server at: https://datura.network:18081/getheight
2024-04-04 15:46:15.783478600 [reqwest::connect] DEBUG starting new connection: http://nodexmr.rctrusts.com:18089/
2024-04-04 15:46:17.400284700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.62s)' for Monerod server at: http://nodexmr.rctrusts.com:18089/getheight
2024-04-04 15:46:17.400376500 [reqwest::connect] DEBUG starting new connection: https://node-xmr.encryp.ch:18089/
2024-04-04 15:46:18.352391400 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(952.04ms)' for Monerod server at: https://node-xmr.encryp.ch:18089/getheight
2024-04-04 15:46:18.352499100 [reqwest::connect] DEBUG starting new connection: http://moneropay.techthis.online:18089/
2024-04-04 15:46:19.560547300 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.21s)' for Monerod server at: http://moneropay.techthis.online:18089/getheight
2024-04-04 15:46:19.560642800 [reqwest::connect] DEBUG starting new connection: http://node.monero.love:18089/
2024-04-04 15:46:20.226728400 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(666.12ms)' for Monerod server at: http://node.monero.love:18089/getheight
2024-04-04 15:46:20.226892600 [reqwest::connect] DEBUG starting new connection: http://hatchi-home.ddns.net:18089/
2024-04-04 15:46:20.699821700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(472.97ms)' for Monerod server at: http://hatchi-home.ddns.net:18089/getheight
2024-04-04 15:46:20.699945900 [reqwest::connect] DEBUG starting new connection: http://moneronode.xyz:18089/
2024-04-04 15:46:21.382450000 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(682.55ms)' for Monerod server at: http://moneronode.xyz:18089/getheight
2024-04-04 15:46:21.382544100 [reqwest::connect] DEBUG starting new connection: http://node.c3pool.org:18081/
2024-04-04 15:46:22.229697200 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(847.18ms)' for Monerod server at: http://node.c3pool.org:18081/getheight
2024-04-04 15:46:22.229821600 [reqwest::connect] DEBUG starting new connection: https://node.chaoswg.dev/
2024-04-04 15:46:23.233010600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.00s)' for Monerod server at: https://node.chaoswg.dev/getheight

What process can a PR reviewer use to test or verify this change?

  • Review code changes
  • Run system-level tests

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

Added dynamic and robust monerod detection to the merge mining proxy,
in addition to the monerod URLs specified in the config.
@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Apr 4, 2024
Copy link

github-actions bot commented Apr 4, 2024

Test Results (CI)

    3 files    120 suites   36m 16s ⏱️
1 277 tests 1 277 ✅ 0 💤 0 ❌
3 823 runs  3 823 ✅ 0 💤 0 ❌

Results for commit c94ef40.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 4, 2024

Test Results (Integration tests)

33 tests   33 ✅  15m 33s ⏱️
11 suites   0 💤
 2 files     0 ❌

Results for commit c94ef40.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Apr 10, 2024
@SWvheerden SWvheerden merged commit 93e8099 into tari-project:development Apr 10, 2024
14 of 15 checks passed
@AaronFeickert
Copy link
Collaborator

This reintroduces ahash, which was removed in #6238. However, it looks like the included version should be fine. Commenting here in case of future issues.

@hansieodendaal hansieodendaal deleted the ho_proxy_monerod_detection branch April 11, 2024 02:42
sdbondi added a commit to sdbondi/tari that referenced this pull request Apr 15, 2024
* development:
  fix!: avoid `Encryptable` domain collisions (tari-project#6275)
  ci(fix): docker image build fix and ci improvements (tari-project#6270)
  feat: keep smt memory (tari-project#6265)
  feat: show warning when GRPC method is disallowed (tari-project#6246)
  fix(chat): metadata panic (tari-project#6247)
  feat: add monerod detection as an option to the merge mining proxy (tari-project#6248)
  chore(deps): bump h2 from 0.3.24 to 0.3.26 (tari-project#6250)
  feat: improve lmdb dynamic growth (tari-project#6242)
  feat: allow wallet type from db to have preference (tari-project#6245)
  feat: prevent mempool panic (tari-project#6239)
  ci: bump nightly version (tari-project#6241)
  feat: add validation for zero confirmation block sync (tari-project#6237)
  feat: new template with coinbase call (tari-project#6226)
  feat: improve wallet sql queries (tari-project#6232)
  chore: remove ahash as dependancy (tari-project#6238)
  feat: add dynamic growth to lmdb (tari-project#6231)
  chore(deps): bump borsh from 0.10.3 to 1.0.0 in /applications/minotari_ledger_wallet (tari-project#6236)
sdbondi added a commit to sdbondi/tari that referenced this pull request Apr 15, 2024
* development:
  fix!: avoid `Encryptable` domain collisions (tari-project#6275)
  ci(fix): docker image build fix and ci improvements (tari-project#6270)
  feat: keep smt memory (tari-project#6265)
  feat: show warning when GRPC method is disallowed (tari-project#6246)
  fix(chat): metadata panic (tari-project#6247)
  feat: add monerod detection as an option to the merge mining proxy (tari-project#6248)
  chore(deps): bump h2 from 0.3.24 to 0.3.26 (tari-project#6250)
  feat: improve lmdb dynamic growth (tari-project#6242)
  feat: allow wallet type from db to have preference (tari-project#6245)
  feat: prevent mempool panic (tari-project#6239)
  ci: bump nightly version (tari-project#6241)
  feat: add validation for zero confirmation block sync (tari-project#6237)
  feat: new template with coinbase call (tari-project#6226)
  feat: improve wallet sql queries (tari-project#6232)
  chore: remove ahash as dependancy (tari-project#6238)
  feat: add dynamic growth to lmdb (tari-project#6231)
  chore(deps): bump borsh from 0.10.3 to 1.0.0 in /applications/minotari_ledger_wallet (tari-project#6236)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants