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

Query Hash is not deterministic! #32

Open
bh2smith opened this issue Nov 4, 2022 · 2 comments
Open

Query Hash is not deterministic! #32

bh2smith opened this issue Nov 4, 2022 · 2 comments

Comments

@bh2smith
Copy link
Collaborator

bh2smith commented Nov 4, 2022

between different runs, the hash function uses different seeds. So just be aware that it is deterministic in a single run, but not between different executions.

https://github.com/cowprotocol/dune-client/blob/55d5f92f5436ad5b4fc18d7c050a01f463fce017/dune_client/query.py#L37-L42

TODO

  1. Document this and
  2. offer a deterministic hash function as well
@eliseygusev
Copy link
Contributor

I think, this can get fixed by setting PYTHONHASHSEED to a particular value (can be moved to config or something)
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED

@bh2smith
Copy link
Collaborator Author

bh2smith commented Nov 4, 2022

That's cool! Although I've also been reading that we should not rely on object hashes to be deterministic and that it's better to use a real hash function from hash lib. I've settled it in the meantime external to this package so this isn't urgent by any means, but feel free to go for it if you like!

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