-
Notifications
You must be signed in to change notification settings - Fork 140
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
Low difficulty mining via translator with S9 with BraiinsOS 22.08.1-plus #856
Comments
I have been trying to set up mining for my faucet for several days but without success. But I only compiled "fjahr:2024-04-testnet-4-fix". I also tried CPU mining "bitcoin-cli generatetoaddress 1 tb1q3fplfy4g........095q 2000000000" If it's not a secret, what pool, stratum... did you use? |
I ran my own "pool" with SRI (this code). I'm not sure if generatetoaddress actually works outside of regtest these days. I CPU mined the first 20 blocks (due to #849) by slightly modifying the signet miner python script. The current difficulty is 4 so CPU mining should work fine, it's just a matter of figuring out how. |
I used a little stratum proxy script by @Fi3 to monitor communication between the S9 and the translator role. This itself seems to make the process more stable, typically mining 10+ blocks before it fails. But with a few seconds it does fail:
Could the problem be receiving a |
If I set the hashrate to 10 THs the following exchange happens:
Notably the difficulty |
@Sjors Hello, I run Stratum together with some rented S9 without any problems, though I've applied a fix for odd-sized extranonces. I suggest using
|
I tweaked the hash rate so that it neatly set the difficulty to 4. The pattern seems to be that the miner hangs up at the first
What do you mean by this? |
#851 this one
did you try to mine on other/public pools to check the miner? |
So in E.g. in the last message this argument is
Yes, it works fine with Ocean pool, Braiins and my most recent DMND pool stratum v1 endpoint. Solo mining against my own sv2 mainnet "pool" also works. Well, at least it submits shares and doesn't crash. Your |
IIRC I've previously also mined on testnet3. I don't have time now, but one thing I could try is adding a slight delay to (whatever causes) the On mainnet it takes longer to validate newly submitted blocks as to generate block templates. On testnet4 blocks are currently empty. Testnet3 is somewhere in the middle. So that might explain why a race condition only shows up on my fake testnet. |
Is the race condition in the miner's code/pool's code or somewhere else? |
No idea. |
For any one wondering here you can find the above mentioned script: #! /usr/bin/python
import socket
import threading
def forward_data(source, destination,direction):
while True:
data = source.recv(1024)
if not data:
print("No more data to forward.")
break
print(f"Forwarding {direction}: {data}")
destination.sendall(data)
def handle_client(client_socket, target_host, target_port):
target_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
target_socket.connect((target_host, target_port))
client_to_target = threading.Thread(target=forward_data, args=(client_socket, target_socket,"<"))
client_to_target.start()
forward_data(target_socket, client_socket,">")
client_socket.close()
target_socket.close()
def start_proxy(target_host, target_port):
listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listen_socket.bind(('', 0))
assigned_port = listen_socket.getsockname()[1]
listen_socket.listen(5)
print(f"Listening on port {assigned_port}...")
client_socket, addr = listen_socket.accept()
print(f"Received connection from {addr}")
handle_client(client_socket, target_host, target_port)
if __name__ == "__main__":
#target_host = 'stratum.braiins.com'
#target_port = 3333
#target_host = 'localhost'
#target_port = 34255
target_host = 'mining.dmnd.work'
target_port = 1000
start_proxy(target_host, target_port) |
So what's a conclusion on this issue @Sjors ? |
Nothing, it's still unsolved. |
I'm having a hard time mining on the newly proposed testnet4 with my S9.
I run the pool and translator roles. For the latter I've been trying different values for
min_individual_miner_hashrate
andchannel_nominal_hashrate
(keeping them the same).My S9 normally runs at about 10 TH/s (for noise and efficiency reasons). So correct value should be
10_000_000_000_000.0
, but when I use that it doesn't mine anything, the BOS miner firmware keeps restarting and the translator log is full of errors:Note that the serde error is apparently innocent, see #770.
In the Braiins dashboard I get "BOS miner is not running" popups frequently, with the usual pattern of fans going to 100%. All the stats stay 0:
Using
1_000_000_000.0
(1 GH/s) improves the situation, but many shares seem to get lost, resulting in effectively only hashing a few blocks per minute. Sometimes a bunch in a short burst.Here's just the first 30 seconds: https://zerobin.org/?bc33618e9559776c#BecMMsL4Np9uzEn55QxkpwdwAbeZkqL4bJ3S5FwPBkxb
The miner thinks it found 500 blocks, but the blockchain only grew by 8.
If I set it 10x higher the BOS miner starts crashing again, not producing blocks.
I'm guessing part of the problem is in how fast blocks are found, perhaps the S9 ends up working on outdated templates.
At the time of testing the difficulty on testnet4 is 4, I'll keep pointing hash power at it to increase that. IIRC difficulty 1 million is about the equivalent of a single S9 on the network.
The text was updated successfully, but these errors were encountered: