regolith-labs / ore-pool

Infrastructure for operating an ORE mining pool.
https://ore.supply
14 stars 11 forks source link

Async Rewards Distribution #19

Closed mrmizz closed 1 month ago

mrmizz commented 1 month ago

Moves the rewards distribution to a tokio thread spawned from the main thread, listening directly to the rewards channel.

This allows for the server to receive and distribute rewards if/when the submission instruction lands, without having to wait for unreliable signature confirmations.

Additionally, the transaction submission is no longer handled in a retry loop. Instead, the main contributions loop will exit the current loop and move onto the next one. At the beginning of each contribution loop, there's "reset" check. If the proof account did change, the loop will exit again, this time waiting for new contributions, instead of spamming 0x1 errors.