Skip to content
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

UpdateCurrentJob leads to invalid shares #8

Open
SimonSuckut opened this issue Jan 5, 2021 · 0 comments
Open

UpdateCurrentJob leads to invalid shares #8

SimonSuckut opened this issue Jan 5, 2021 · 0 comments

Comments

@SimonSuckut
Copy link

First of all: great work you did there!
I discovered a small problem in the block polling process: The call to JobManager.ProcessTemplate -> UpdateCurrentJob modifies the current job which miners might still be working on. This can lead to miners submitting shares which are considered invalid by the pool (as the job changed in between notify and submit). For me it does not make a lot of sense to change the block template as long as the block height does not change (at least with a decent sized mempool). Please rectify this assumption if there is a good reason for updating the template.
An easy fix would be adding an additional condition in SetupBlockPolling:

if gbt != nil {
    if gbt.PreviousBlockHash != p.JobManager.CurrentJob.GetBlockTemplate.PreviousBlockHash {
        p.JobManager.ProcessTemplate(gbt)
    }
}

Another possibility would be to give the job a new id or notify all miners immediately about the new job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant