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 a SECP256K1_CONTEXT_ALL flag #559

Open
gwillen opened this issue Oct 1, 2018 · 3 comments
Open

Add a SECP256K1_CONTEXT_ALL flag #559

gwillen opened this issue Oct 1, 2018 · 3 comments

Comments

@gwillen
Copy link

gwillen commented Oct 1, 2018

I recently learned that the typical use of libsecp contexts, in non-hot-path situations like during app startup of a heavyweight app, is just to give all the flags all the time.

I think it would be slightly helpful to document this by creating a SECP256K1_CONTEXT_ALL flag, and commenting it with a note on when it's appropriate to use (i.e. when a few dozen milliseconds aren't a big deal.)

CC: @apoelstra from earlier discussion

@gmaxwell
Copy link
Contributor

gmaxwell commented Jun 7, 2019

How should this work in a future where there are flags that turn on/off other behaviours and not just control what modes the libraries can be used in? e.g. I was considering a SECP256K1_NO_BIST to disable built in self-tests at context creation time.

@apoelstra
Copy link
Contributor

Heh, I guess we could learn from the many other projects that used "all" for a set of flags which later turned out to be incomplete.

What if we created a flag SECP256K1_CONTEXT_DEFAULT which created both precomp tables and did the self-tests. Here "default" means "I have enough CPU and RAM that I don't need to think about it".

@real-or-random
Copy link
Contributor

Yep and "default" should then also mean "I'm aware that this may need more CPU and RAM in the future but I know this will never break my current API calls in the future".

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

4 participants