HathorNetwork / HathorNetwork/tx-mining-service

Support addresses with different versionBytes

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

While testing running a private network with versionBytes different from the testnet/mainnet, I got an error in tx-mining-service, which was not accepting those addresses.

The error occurred when I tried to run a `cpuminer` configured with the address and pointing to tx-mining-service:

```
txstratum.utils - ERROR - 2021-11-04 21:52.31 [error ] Fatal error: protocol.data_received() call failed. protocol= transport=<_SelectorSocketTransport fd=9 read=polling write=>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 870, in _read_ready__data_received
self._protocol.data_received(data)
File "/txstratum/utils.py", line 114, in data_received
self.line_received(line)
File "/txstratum/utils.py", line 155, in line_received
self.json_received(data)
File "/txstratum/utils.py", line 159, in json_received
if self.try_as_request(data):
File "/txstratum/utils.py", line 175, in try_as_request
self.handle_request(method, params, msgid)
File "/txstratum/utils.py", line 208, in handle_request
fn(params, msgid)
File "/txstratum/protocol.py", line 164, in method_subscribe
self.start_if_ready()
File "/txstratum/protocol.py", line 329, in start_if_ready
self.manager.mark_connection_as_ready(self)
File "/txstratum/manager.py", line 105, in mark_connection_as_ready
self.update_miner_job(protocol)
File "/txstratum/manager.py", line 117, in update_miner_job
protocol.update_job(job, clean=clean)
File "/txstratum/protocol.py", line 350, in update_job
job.set_mining_address(self.miner_address)
File "/txstratum/jobs.py", line 275, in set_mining_address
self._block.outputs[0].script = create_output_script(address)
File "/usr/local/lib/python3.9/site-packages/hathorlib/scripts.py", line 483, in create_output_script
raise ScriptError('The address is not valid')
hathorlib.exceptions.ScriptError: The address is not valid
```

To reproduce it, you should follow the privatenet guide in our RFCs, but using different versionBytes for the network (some adaptations will be needed in the steps)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.