add solo mining mode to the pool app#321
Conversation
|
I know it's still in draft, but I just want to recall that we should also support the usual case where the miner simply uses its Bitcoin address in the That case should be identified as SOLO (e.g. |
f2574a1 to
6c526d1
Compare
|
the scope of #325 is slightly different from what we're doing here, but looking at it made me think we should have some integration tests here as well proposed coverage:
for each scenario, we leverage then we deserialize the coinbase output into a I don't think we need to involve Sv1/translation |
c39019d to
d6b4f63
Compare
|
Let's Go! This is ready for review. @GitGab19, added the support for the "legacy" format. @plebhash, removed the new parameter This probably still needs some cleanup from the early iteration that I'll address once I land |
744fee6 to
667ad2c
Compare
pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs
Outdated
Show resolved
Hide resolved
pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs
Outdated
Show resolved
Hide resolved
pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs
Outdated
Show resolved
Hide resolved
pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs
Outdated
Show resolved
Hide resolved
f016deb to
3068cb5
Compare
There was a problem hiding this comment.
@lucasbalieiro I've tested all the possible variants of user_identity, and the behavior is handled properly.
The problem is that the outputs are correctly handled and used for the very first job only, but as soon as a second NewTemplate arrives, the whole reward goes to the Pool's address in the relative job created (e.g. we are not considering the previous request from the user_identity).
3068cb5 to
770cd9f
Compare
commenting from mobile (not looking at the source) but my guess is that we're only using |
Yes! Exactly. I'm currently doing a test on storing the So we do the parsing and computing of the coinbase output only in the channel opening process. Than just re-use it |
The problem is that in the |
|
applied changes to I'm still working on a integration test for it. But, i think you guys can take a look at the approach |
GitGab19
left a comment
There was a problem hiding this comment.
I'm still experiencing the same issue, and it's due to the fact that we're not passing the downstream_coinbase_outputs in the on_new_template().
I tested this fix and now it works perfectly.
pool-apps/pool/src/lib/channel_manager/template_distribution_message_handler.rs
Outdated
Show resolved
Hide resolved
84c5294 to
bca1949
Compare
Shourya742
left a comment
There was a problem hiding this comment.
Some suggestions, rest looks good.
pool-apps/pool/src/lib/channel_manager/template_distribution_message_handler.rs
Outdated
Show resolved
Hide resolved
pool-apps/pool/src/lib/channel_manager/template_distribution_message_handler.rs
Outdated
Show resolved
Hide resolved
bca1949 to
d239b7b
Compare
d239b7b to
e548fe2
Compare
xyephy
left a comment
There was a problem hiding this comment.
tACK
Reviewed and tested locally. Build passes, all 8 solo mining integration tests and 6 unit tests pass. The handle_new_template fix correctly checks data.payout_mode per downstream and passes downstream_coinbase_outputs to both group_channel.on_new_template() and standard_channel.on_new_template().
Some minor nits: -Add an integration test that waits for a second NewExtendedMiningJob after channel open and verifies the coinbase still pays the miner's address -- current tests only verify the first job.
-README line 91: OpenExtendMiningChannel -> OpenExtendedMiningChannel
the tests can be expanded to cover two events:
|
e548fe2 to
76605cb
Compare
|
Expanded the tests scope to validate the the outputs after a new The CI is complaining about something outside of the scope of this PR. Do you guys wnat me to update it here? |
should be fixed via #339 |
@lucasbalieiro it seems we're only covering the second scenario please note that please do a |
…solo mining outputs
76605cb to
58ac312
Compare
closes #135
replaces #269
this PR introduces a new pool configuration parameter:
solo_mining_mode.pool now validates every Open Channel message (standard or extended) to search for a specially formatted
user_identity:sri/donate/reward_percentage/payout_address/worker_namesri/donate/worker_namesri/solo/payout_address/worker_name<valid_bitcoin_address>user_identitydoes not fall in one of the previous category.Added an offset to the computation of
CoinbaseOutputConstraintssee: #288