Kudaraidee / miningcore-xiaolin1579

Miningcore is a high-performance Mining Pool Software for Linux and Windows.
https://store.miningcore.pro
MIT License
35 stars 47 forks source link

Cache corruption with more than 3 KawPow pools #37

Open deh8551 opened 10 months ago

deh8551 commented 10 months ago

Describe the bug When you configure more than 3 KawPow pools, Miningcore, the cache/epochs between the chains seem to become corrupted. Mining core then evicts the cache in favor of the epoch of another chain. Each of the chains then continue trying to use another chain's epoch cache.

I have compiled the latest version, as of 2023-12-30 and am running in docker.

To Reproduce Steps to reproduce the behavior: Add 4 or more KawPow chains to config

Here are the entries from the core.log [2024-01-02 22:32:30.6215] [I] [neoxa-solo] Evicting cache for epoch 4 in favour of epoch 113 [2024-01-02 22:32:30.6217] [I] [neoxa-solo] No pre-generated cache available, creating new for epoch 113 [2024-01-02 22:32:31.1123] [I] [aipg-solo] Evicting cache for epoch 67 in favour of epoch 4 [2024-01-02 22:32:31.1123] [I] [aipg-solo] No pre-generated cache available, creating new for epoch 4 [2024-01-02 22:32:31.2098] [I] [satoxcoin-solo] Seed hash for epoch 67 is ef69dd35b9fa6069c2d444b07a06752e2cec00db711b063fcb3aff919bb48b11 [2024-01-02 22:32:31.2098] [I] [satoxcoin-solo] Broadcasting jobs [2024-01-02 22:32:31.2310] [I] [clore-solo] Seed hash for epoch 74 is 789121f005cf40651e361085512f0540e36453fb34ca66fbe38e2836348b9f73 [2024-01-02 22:32:31.2310] [I] [clore-solo] Broadcasting jobs [2024-01-02 22:32:31.6180] [I] [neoxa-solo] Seed hash for epoch 113 is 12191bf508ba850b6ccb5ab7bc1c0e5197079166307510dae6781185a8347bea [2024-01-02 22:32:31.6180] [I] [neoxa-solo] Broadcasting jobs [2024-01-02 22:32:31.7321] [I] [aipg-solo] Seed hash for epoch 4 is b903bd7696740696b2b18bd1096a2873bb8ad0c2e7f25b00a0431014edb3f539 [2024-01-02 22:32:31.7321] [I] [aipg-solo] Broadcasting jobs [2024-01-02 22:32:32.2147] [I] [aipg-solo] Pre-generating cache for epoch 5 [2024-01-02 22:32:32.2147] [I] [aipg-solo] Detected new block 35512 [ZMQ] [2024-01-02 22:32:32.2147] [I] [aipg-solo] Broadcasting jobs [2024-01-02 22:32:32.8263] [I] [aipg-solo] Seed hash for epoch 5 is f2e59013a0a379837166b59f871b20a8a0d101d1c355ea85d35329360e69c000 [2024-01-02 22:32:40.3047] [I] [satoxcoin-solo] Evicting cache for epoch 74 in favour of epoch 67 [2024-01-02 22:32:40.3047] [I] [satoxcoin-solo] No pre-generated cache available, creating new for epoch 67 [2024-01-02 22:32:40.3613] [I] [clore-solo] Evicting cache for epoch 113 in favour of epoch 74 [2024-01-02 22:32:40.3613] [I] [clore-solo] No pre-generated cache available, creating new for epoch 74 [2024-01-02 22:32:40.6238] [I] [neoxa-solo] Evicting cache for epoch 4 in favour of epoch 113 [2024-01-02 22:32:40.6238] [I] [neoxa-solo] No pre-generated cache available, creating new for epoch 113 [2024-01-02 22:32:41.1233] [I] [satoxcoin-solo] Seed hash for epoch 67 is ef69dd35b9fa6069c2d444b07a06752e2cec00db711b063fcb3aff919bb48b11 [2024-01-02 22:32:41.1233] [I] [satoxcoin-solo] Broadcasting jobs [2024-01-02 22:32:41.3190] [I] [clore-solo] Seed hash for epoch 74 is 789121f005cf40651e361085512f0540e36453fb34ca66fbe38e2836348b9f73 [2024-01-02 22:32:41.3190] [I] [clore-solo] Broadcasting jobs [2024-01-02 22:33:36.7442] [I] [Core] Version 0.1.0.0-dev [bbb52d10ec9566fea78539a739faf424e582a5f0] [2024-01-02 22:33:36.7614] [I] [Core] Runtime .NET 6.0.25 on Linux 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 [X64] [2024-01-02 22:33:36.7623] [W] [Core] Running as root is discouraged! [2024-01-02 22:33:36.7681] [I] [Core] Prometheus Metrics API listening on http://0.0.0.0:4000/metrics [2024-01-02 22:33:36.7681] [I] [Core] WebSocket Events streaming on ws://0.0.0.0:4000/notifications

xiaolin1579 commented 10 months ago

Not sure if this can be fixed. https://github.com/xiaolin1579/miningcore/commit/72667330e97ce2e1504df9f93cba7c039df6f82d

blackmennewstyle commented 10 months ago

Actually, i think the problem is here https://github.com/xiaolin1579/miningcore/blob/48ac4f3a0797de929f4c91732769d6db7fe96015/src/Miningcore/Configuration/ClusterConfigExtensions.cs#L246

All the coins uses the same dictionary key instead of having their own.

I'm working on a fix on my repo, and i think ethash has the same issue.

1NF1N18Y commented 9 months ago

Actually, i think the problem is here

https://github.com/xiaolin1579/miningcore/blob/48ac4f3a0797de929f4c91732769d6db7fe96015/src/Miningcore/Configuration/ClusterConfigExtensions.cs#L246

All the coins uses the same dictionary key instead of having their own.

I'm working on a fix on my repo, and i think ethash has the same issue.

Did you get it fixed?

blackmennewstyle commented 9 months ago

Actually, i think the problem is here https://github.com/xiaolin1579/miningcore/blob/48ac4f3a0797de929f4c91732769d6db7fe96015/src/Miningcore/Configuration/ClusterConfigExtensions.cs#L246

All the coins uses the same dictionary key instead of having their own. I'm working on a fix on my repo, and i think ethash has the same issue.

Did you get it fixed?

Yes literally since i posted that reply lol I also already shared the solution with the maintainer of that repo, so he will probably push the fix when he has more free time.

1NF1N18Y commented 9 months ago

Actually, i think the problem is here https://github.com/xiaolin1579/miningcore/blob/48ac4f3a0797de929f4c91732769d6db7fe96015/src/Miningcore/Configuration/ClusterConfigExtensions.cs#L246

All the coins uses the same dictionary key instead of having their own. I'm working on a fix on my repo, and i think ethash has the same issue.

Did you get it fixed?

Yes literally since i posted that reply lol I also already shared the solution with the maintainer of that repo, so he will probably push the fix when he has more free time.

Could you maybe share the solution with me? He hasn't updated in a month

Reggerriee commented 5 months ago

Describe the bug When you configure more than 3 KawPow pools, Miningcore, the cache/epochs between the chains seem to become corrupted. Mining core then evicts the cache in favor of the epoch of another chain. Each of the chains then continue trying to use another chain's epoch cache.

I have compiled the latest version, as of 2023-12-30 and am running in docker.

To Reproduce Steps to reproduce the behavior: Add 4 or more KawPow chains to config

Here are the entries from the core.log [2024-01-02 22:32:30.6215] [I] [neoxa-solo] Evicting cache for epoch 4 in favour of epoch 113 [2024-01-02 22:32:30.6217] [I] [neoxa-solo] No pre-generated cache available, creating new for epoch 113 [2024-01-02 22:32:31.1123] [I] [aipg-solo] Evicting cache for epoch 67 in favour of epoch 4 [2024-01-02 22:32:31.1123] [I] [aipg-solo] No pre-generated cache available, creating new for epoch 4 [2024-01-02 22:32:31.2098] [I] [satoxcoin-solo] Seed hash for epoch 67 is ef69dd35b9fa6069c2d444b07a06752e2cec00db711b063fcb3aff919bb48b11 [2024-01-02 22:32:31.2098] [I] [satoxcoin-solo] Broadcasting jobs [2024-01-02 22:32:31.2310] [I] [clore-solo] Seed hash for epoch 74 is 789121f005cf40651e361085512f0540e36453fb34ca66fbe38e2836348b9f73 [2024-01-02 22:32:31.2310] [I] [clore-solo] Broadcasting jobs [2024-01-02 22:32:31.6180] [I] [neoxa-solo] Seed hash for epoch 113 is 12191bf508ba850b6ccb5ab7bc1c0e5197079166307510dae6781185a8347bea [2024-01-02 22:32:31.6180] [I] [neoxa-solo] Broadcasting jobs [2024-01-02 22:32:31.7321] [I] [aipg-solo] Seed hash for epoch 4 is b903bd7696740696b2b18bd1096a2873bb8ad0c2e7f25b00a0431014edb3f539 [2024-01-02 22:32:31.7321] [I] [aipg-solo] Broadcasting jobs [2024-01-02 22:32:32.2147] [I] [aipg-solo] Pre-generating cache for epoch 5 [2024-01-02 22:32:32.2147] [I] [aipg-solo] Detected new block 35512 [ZMQ] [2024-01-02 22:32:32.2147] [I] [aipg-solo] Broadcasting jobs [2024-01-02 22:32:32.8263] [I] [aipg-solo] Seed hash for epoch 5 is f2e59013a0a379837166b59f871b20a8a0d101d1c355ea85d35329360e69c000 [2024-01-02 22:32:40.3047] [I] [satoxcoin-solo] Evicting cache for epoch 74 in favour of epoch 67 [2024-01-02 22:32:40.3047] [I] [satoxcoin-solo] No pre-generated cache available, creating new for epoch 67 [2024-01-02 22:32:40.3613] [I] [clore-solo] Evicting cache for epoch 113 in favour of epoch 74 [2024-01-02 22:32:40.3613] [I] [clore-solo] No pre-generated cache available, creating new for epoch 74 [2024-01-02 22:32:40.6238] [I] [neoxa-solo] Evicting cache for epoch 4 in favour of epoch 113 [2024-01-02 22:32:40.6238] [I] [neoxa-solo] No pre-generated cache available, creating new for epoch 113 [2024-01-02 22:32:41.1233] [I] [satoxcoin-solo] Seed hash for epoch 67 is ef69dd35b9fa6069c2d444b07a06752e2cec00db711b063fcb3aff919bb48b11 [2024-01-02 22:32:41.1233] [I] [satoxcoin-solo] Broadcasting jobs [2024-01-02 22:32:41.3190] [I] [clore-solo] Seed hash for epoch 74 is 789121f005cf40651e361085512f0540e36453fb34ca66fbe38e2836348b9f73 [2024-01-02 22:32:41.3190] [I] [clore-solo] Broadcasting jobs [2024-01-02 22:33:36.7442] [I] [Core] Version 0.1.0.0-dev [bbb52d1] [2024-01-02 22:33:36.7614] [I] [Core] Runtime .NET 6.0.25 on Linux 5.15.0-91-generic oliverw#101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 [X64] [2024-01-02 22:33:36.7623] [W] [Core] Running as root is discouraged! [2024-01-02 22:33:36.7681] [I] [Core] Prometheus Metrics API listening on http://0.0.0.0:4000/metrics [2024-01-02 22:33:36.7681] [I] [Core] WebSocket Events streaming on ws://0.0.0.0:4000/notifications

Success submit NEOXA block?