-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
kernel: Remove key module from kernel library #29252
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
An alternative would be to call |
67058d4
to
2cb38d9
Compare
Updated 67058d4 -> 2cb38d9 (kernelRmKey_0 -> kernelRmKey_1, compare)
|
lgtm ACK 2cb38d9 🍂 Show signatureSignature:
|
2cb38d9
to
a885a16
Compare
Updated 2cb38d9 -> a885a16 (kernelRmKey_1 -> kernelRmKey_2, compare) |
lgtm ACK a885a16 🔀 Show signatureSignature:
|
Concept ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK a885a16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice change. ACK a885a16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review a885a16. This is a good change, but I think it has a few issues pointed out in comments below. At a high level I think it makes sense to decouple ECC initialization from the kernel context struct, but I don't think it makes sense to couple it so tightly with the node context struct.
Would suggest an approach more like this branch: pr/ecc with commits:
- c6b4b7c common: Add ECC_Context RAII wrapper for ECC_Start/ECC_Stop
- 7184d36 test: Use ECC_Context helper in bench and fuzz tests
- 668e2f8 tools: Use ECC_Context helper in bitcoin-tx and bitcoin-wallet tools
- 7719001 kernel: Remove key module from kernel library
Feel free to take any of this or do something different.
@TheCharlatan Mind adding a commit to fixup the includes as per this conversation? |
Thank you for the review @ryanofsky! a885a16 -> 7dc7938 (kernelRmKey_2 -> kernelRmKey_3, compare)
|
Rebased 7dc7938 -> 65a2051 (kernelRmKey_3 -> kernelRmKey_4, compare) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 65a2051
The key module's functionality is not used by the kernel library, but currently kernel users are still required to initialize the key module's `secp256k1_context_sign` global as part of the `kernel::Context` through `ECC_Start`.
They are unused outside of the key module now.
Updated 65a2051 -> 96378fe (kernelRmKey_4 -> kernelRmKey_5, compare)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 96378fe. Just suggested comment changes since last review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice improvements since my last review. The RAII context is an obvious improvement, thanks @ryanofsky.
I looked for a way to add a virtual lifetime class with on_startup/on_shutdown to replace the .init in fuzz.h, but didn't have any luck because of a (afacs?) missing teardown callback. It seems the static context approach used here is actually what's recommended.
utACK 96378fe
ACK 96378fe |
Ported to the CMake-based build system in hebasto#202. |
The key module's functionality is not used by the kernel library, but currently kernel users are still required to initialize the key module's
secp256k1_context_sign
global as part of thekernel::Context
throughECC_Start
. So move theECC_Start
call to theNodeContext
ctor instead to completely remove the key module from the kernel library.The gui tests currently keep multiple
NodeContext
objects in memory, so callECC_Stop
manually to avoid triggering an assertion onECC_Start
.This PR is part of the libbitcoinkernel project. It removes a module from the kernel library.