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

WIP: retry keystone on failure #15

Closed
wants to merge 6 commits into from

Conversation

ClaytonNorthey92
Copy link
Contributor

Summary
allowing keystone retries with a fifo queue

Changes

  • if a keystone fails to mine, retry

  • check if the keystone has already been mined

  • allow a queue of 10 keystones, dropping the oldest if full and a new one comes in

fixes #7

@@ -50,6 +50,33 @@ func init() {
loggo.ConfigureLoggers(logLevel)
}

type CircularFifo struct {
buf chan hemi.L2Keystone
mtx sync.Mutex
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need this mutex

@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/popm-keystone-retry branch from 0c46eaf to 361f695 Compare February 28, 2024 22:41
* if a keystone fails to mine, retry

* check if the keystone has already been mined

* allow a queue of 10 keystones, dropping the oldest if full and a new one comes in
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/popm-keystone-retry branch from 361f695 to c1719fa Compare February 28, 2024 22:43
@ClaytonNorthey92 ClaytonNorthey92 changed the title retry keystone on failure WIP: retry keystone on failure Feb 29, 2024

func (r *CircularFifo) MineEach(cb func(ks hemi.L2Keystone) error) {
r.mtx.Lock()
copies := slices.Clone(r.buf)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do oldest first

@ClaytonNorthey92
Copy link
Contributor Author

Closing until ready for review

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

Successfully merging this pull request may close these issues.

Implement "retry" when mining L2 Keystones in PoP Miner
1 participant