-
Notifications
You must be signed in to change notification settings - Fork 37.7k
RFC: Deprecate libconsensus #29189
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
RFC: Deprecate libconsensus #29189
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. |
Concept ACK |
5545ee2
to
a6745f8
Compare
Concept ACK. |
Might still be used here: https://github.com/rust-bitcoin/rust-bitcoinconsensus Ping @apoelstra @tcharding |
Ping @Davidson-Souza |
Concept ACK |
Thank you, @1thales, for the ping. I'm building a lightweight Bitcoin full node called Floresta, and I'm using Furthermore, I've exchanged some emails with @TheCharlatan about If |
Concept ACK
Sounds pretty achievable in the short-term, and something that should be exposed for cross-implementation testing anyway? |
|
concept ACK. cc @danielabrozzoni @notmandatory (BDK group) This is the list of dependencies that rely on libbitcoinconsensus. I believe most of them use libbitcoinconsensus for testing script execution, with the only exception of We've transitioned our projects to utilize the bitcoind crate, incorporating integration tests akin to BitcoinTestFramework in the core. Though the setup might be a bit clunky, I believe(as of now) there is no substitute to running core node to check if a transaction satisfies core policy rules. |
Thanks for the ping. (a) agreed that rust-bitcoinconsensus can just do a "final" release and this wouldn't be a problem for us, and (b) if there were a blackbox script validator somewhere else, we'd happily use that. Especially if it were a more maintained/supported part of Core rather than something hanging off the side. |
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.
Would something along the lines of https://github.com/ajtowns/bitcoin/commits/202309-evalscript/ be an interesting alternative? $ ./bitcoin-util -script_flags=STANDARD evalscript '515193'
{
"script": {
"asm": "1 1 OP_ADD",
"hex": "515193",
"type": "nonstandard"
},
"sigversion": "witness_v0",
"script_flags": "CHECKLOCKTIMEVERIFY,CHECKSEQUENCEVERIFY,CLEANSTACK,CONST_SCRIPTCODE,DERSIG,DISCOURAGE_OP_SUCCESS,DISCOURAGE_UPGRADABLE_NOPS,DISCOURAGE_UPGRADABLE_PUBKEYTYPE,DISCOURAGE_UPGRADABLE_TAPROOT_VERSION,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,LOW_S,MINIMALDATA,MINIMALIF,NULLDUMMY,NULLFAIL,P2SH,STRICTENC,TAPROOT,WITNESS,WITNESS_PUBKEYTYPE",
"stack-after": [
"02"
],
"sigop-count": 0,
"success": true
} |
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.
Concept ACK
For my part I would rather have a library function than a CLI tool. |
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 a6745f8, the diff is correct.
What is the status of |
I see it's mentioned here: #29180 (comment) - would be useful to also add a note to libraries.md |
Hey, I had a use case: create a chain of transactions in WASM (browser) in a multiparty protocol where the child transaction must be verified before signing their parents. The inputs of the parent are controlled by the verifying user so there's no "you need a full node anyway" argument. Thus There's another similar idea I had a long time ago: when ordering a node-in-a-box one could pre-open the channels during payment in the browser (same transaction) so one doesn't need to wait for channel opens after the node arrives and saves fees. However I'm not familiar with LN inner workings enough to tell whether Also please note that I find the announcement period super short. This wasn't loudly communicated and if I wasn't a co-maintainer of rust-bitcoin I wouldn't have known. And even then I'm already writing this post-merge. I'd really appreciate if there was more time given and louder announcements for breaking changes in the future. |
Removal happens at some unknown time after deprecation, but from what I can tell, not before the 28.0 release (~November 2024). The upcoming v27.* releases will be maintained for a while longer too: https://bitcoincore.org/en/lifecycle/
What exactly do you mean by "verified"? Are you checking proof-of-work from the headers? The signature? I'm not familiar enough with what functions the kernel library exposes, to know if you can already do that. Otherwise perhaps more functions should be exposed, in order to be able to perform a subset of validation. |
No, removal is going to happen pretty immediately after the 27.x branch off. |
That doesn't help people who really needed the library. Yeah, they will get screwed later but still they are getting screwed. I meant period to voice opposition to this change. Unless you're open to un-deprecating of course.
It must be possible to include it in a block at some later time when the parent is confirmed and time locks are satisfied. Basically the same requirement as LN force close transaction just different conditions in scripts.
The information I found is that it performs IO and launches threads - both of those are impossible in WASM, so no functions can help unless it can conditionally not compile syscall-performing stuff. (Though even if it can I expect it will be a hell to integrate into other languages properly.) |
Is there a reason you can't stay on the lib of the 27.x or 26.x release? |
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
27.x obviously won't be supported indefinitely |
Why not? I don't recall the last reported bug in libconsensus, but even if there was one in the future, the 27.x branch could be kept around idle, so that unlikely bugfixes could be applied. |
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
80f8b92 remove libbitcoinconsensus (fanquake) Pull request description: This was deprecated in `v27.0`, for removal in `v28.0`. See discussion in PR #29189. ACKs for top commit: theuni: Concept ACK and light review ACK 80f8b92. My only hesitation here is that (afaics?) there's now nothing keeping undesired features like threading or globals from working their way into the interpreter in future commits. m3dwards: Concept ACK 80f8b92 TheCharlatan: ACK 80f8b92 hebasto: ACK 80f8b92, I have reviewed the code and it looks OK. Tree-SHA512: 17a62118aeb088f2695c892bb32794dfea3061e3cb7d9e8e9f1c06c3ff6f63a7587fa532e37edbb91fbc5a19b12c9a0f8e05fa9e8864aa07f92665375d847e80
This was deprecated in v27.0, for removal in v28.0. See discussion in PR bitcoin#29189.
This reverts commit 25dc87e (bitcoin#29189)
This reverts commit 25dc87e (bitcoin#29189)
This reverts commit 25dc87e (bitcoin#29189)
This reverts commit 25dc87e (bitcoin#29189)
This reverts commit 25dc87e (bitcoin#29189)
This library has existed for nearly 10 years with very little known uptake or impact. It has become a maintenance burden. In several cases it dictates our code/library structure (for example necessitating LIBBITCOIN_CRYPTO_BASE), as well as build-system procedures (building multiple copies of object files especially for the lib).
Several discussions have arisen wrt migrating it to CMake and it has become difficult to justify adding more complexity for a library that is virtually unused anyway.
See for example the discussions:
hebasto#41
#29123
And here: #29180
Where it is pointed out that the libbitcoinconsensus functions are slower than those the internal bitcoind equivalents due to the missing sha2 implementations.
Instead, we (fanquake, hebasto, TheCharlatan, and I) propose simply not migrating it to CMake and letting it end with v27. Any remaining use-cases could be handled in the future by libbitcoinkernel.
If there are any users currently using libbitcoinconsensus, please chime in with your use-case!
Edit: Corrected final release to be v27.