Add a SECP256K1_CONTEXT_ALL flag #559

issue gwillen openend this issue on October 1, 2018
  1. gwillen commented at 4:48 pm on October 1, 2018: none

    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

  2. gmaxwell commented at 11:51 am on June 7, 2019: contributor
    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.
  3. apoelstra commented at 7:57 am on June 8, 2019: 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”.

  4. real-or-random commented at 9:14 am on June 8, 2019: 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”.
  5. real-or-random cross-referenced this on Aug 3, 2022 from issue API cleanup with respect to contexts by real-or-random

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 10:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me