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

Add deterministic option #10

Open
dskvr opened this issue Sep 22, 2024 · 3 comments
Open

Add deterministic option #10

dskvr opened this issue Sep 22, 2024 · 3 comments

Comments

@dskvr
Copy link
Contributor

dskvr commented Sep 22, 2024

Right now the miner is deterministic. You can take the note, start from zero and get the same work at the same nonce.

This should be optional. When not deterministic, created_at is refreshed on each nonce as suggested by NIP-13.

@dskvr dskvr changed the title Add deterministic optioin Add deterministic option Sep 24, 2024
@plebhash
Copy link

does it still make sense to report best nonce, best PoW and best hash when running in non-deterministic mode?

@dskvr
Copy link
Contributor Author

dskvr commented Sep 29, 2024

Maybe not, can add an option to turn that off as well.

In response to your original comment:

I don't disagree, but if nonce is reset on each created_at then nonce will always be somewhere between 1-10. I prefer deterministic hashing myself, but for long hashing operations it does make sense to refresh created_at

@plebhash
Copy link

plebhash commented Sep 29, 2024

I deleted my previous comment because I realized it doesn't make sense, sorry for the confusion

there's no need to reset the nonce, the probabilities remain the same, even if there's multiple workers

the created_at field can be regularly updated without resetting the nonce and there's no penalties to the search space

dskvr added a commit that referenced this issue Oct 28, 2024
# This is the 1st commit message:

monorepo

# The commit message #2 will be skipped:

# rearrange and break everything

# The commit message #3 will be skipped:

# stuff

# The commit message #4 will be skipped:

# add svelte package/demo

# The commit message #5 will be skipped:

# add svelte package/demo

# The commit message #6 will be skipped:

# remove yarn lock

# The commit message #7 will be skipped:

# update README add reactjs package

# The commit message #8 will be skipped:

# update wrapper

# The commit message #9 will be skipped:

# update svelte demo

# The commit message #10 will be skipped:

# remove accidental node_modules and add build scripts

# The commit message #11 will be skipped:

# move core to rust and update scripts so whenever rust is built is copies to packages/core

# The commit message #12 will be skipped:

# remove demo from @notemine/wrapper
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

2 participants