kernel: remove script/solver.{h,cpp} from kernel headers #28434

pull darosior wants to merge 3 commits into bitcoin:master from darosior:2309_kernel_drop_solver_headers changing 9 files +62 −37
  1. darosior commented at 9:59 pm on September 8, 2023: member

    This removes the non consensus-critical solver.h header from the kernel headers by stripping out the TxoutType enum (needed by policy.h) into its own header.

    It’s only a small gain but it’s also pretty straightforward. Figured i’d PR it directly to gather whether people think that’s worth it.

  2. Add missing script/solver.h includes where used
    They were indirectly relying on policy/policy.h including solver.h.
    ec5df31d22
  3. script: introduce a new txouttype.h
    solver.h is included by policy.h only to get access to the TxoutType
    enum. Separate it in its own module to let us strip solver.h from
    the kernel headers.
    4a565a8350
  4. Drop script/solver.h from kernel headers
    It was indirectly included by policy.h, which only needs access to
    TxoutType.
    84024b44e2
  5. DrahtBot commented at 9:59 pm on September 8, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK TheCharlatan

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #28051 (Get rid of shutdown.cpp/shutdown.h, use SignalInterrupt directly by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. DrahtBot added the label Validation on Sep 8, 2023
  7. fanquake commented at 10:43 pm on September 8, 2023: member
  8. TheCharlatan approved
  9. TheCharlatan commented at 8:52 am on September 12, 2023: contributor

    ACK 84024b44e25507f5ef10e03057510383c47af332

    Thank for your contribution!

    I don’t think we have to hunt down all the non-consensus code in the kernel headers at this time though. As long as it is still unclear what the API is supposed to be in the end, the focus should be on removing platform-specific or external dependency headers. For easy wins such as here, the benefit is clear though: Less unrelated code in the kernel lib means one fewer thing to handle in the future of the kernel library.

  10. darosior commented at 9:14 am on September 12, 2023: member
    Yeah, something else i considered is how they may be re-introduced in the future. It may be reasonable to expect reintroduction of external headers back into kernel to be caught during review, but these small things may slip through more easily.
  11. in src/script/solver.h:13 in 84024b44e2
     9@@ -10,32 +10,15 @@
    10 
    11 #include <attributes.h>
    12 #include <script/script.h>
    13+#include <script/txouttype.h>
    


    maflcko commented at 5:06 pm on September 14, 2023:
    missing iwyu export comment?
  12. maflcko changes_requested
  13. maflcko commented at 5:07 pm on September 14, 2023: member
    I don’t understand this change. solver.o is still linked into libbitcoinkernel_la
  14. TheCharlatan commented at 5:37 pm on September 14, 2023: contributor

    Re #28434#pullrequestreview-1627392653

    I don’t understand this change. solver.o is still linked into libbitcoinkernel_la

    Yeah, completely read over the part that this should also be removing the solver object from the kernel, which this PR is not doing. The description should be updated.

  15. maflcko commented at 5:42 pm on September 14, 2023: member
    As for removing solver.h from the public headers: I think that’s a bit too early with no linter in place to check it, no?
  16. TheCharlatan commented at 7:46 pm on September 14, 2023: contributor

    As for removing solver.h from the public headers: I think that’s a bit too early with no linter in place to check it, no?

    We don’t have a linter in place for the other headers that were recently removed either though. @cfields has a commit for manually defining the list of includes for bitcoin-chainstate. But like I said, I don’t think we should be looking for more of these right now, but it doesn’t hurt to split this up either.

  17. maflcko commented at 8:24 pm on September 14, 2023: member

    We don’t have a linter in place for the other headers that were recently removed either though.

    At least for those it was pretty clear that they shouldn’t be part of the public headers. However, here I don’t see it. What if a user wants to use the solver and it has to be re-added to libbitcoinkernel later? Seems odd to rule that out now, no?

  18. TheCharlatan commented at 8:29 pm on September 14, 2023: contributor

    What if a user wants to use the solver and it has to be re-added to libbitcoinkernel later? Seems odd to rule that out now, no?

    There is nothing here that precludes the solver not becoming part of the API later on.

  19. maflcko commented at 8:54 pm on September 14, 2023: member
    Ok, I guess I am misunderstanding the goal of this pull. I’ll wait until the title and description have been corrected.
  20. darosior commented at 10:06 am on September 15, 2023: member
    My bad for the PR description, it was from an earlier (attempted) version of this branch.
  21. darosior commented at 10:07 am on September 15, 2023: member
    I’m going to close this. I was not sure about opening it in the first place, looks like review time is better spent elsewhere.
  22. darosior closed this on Sep 15, 2023

  23. darosior renamed this:
    kernel: remove `script/solver.{h,cpp}` from kernel headers and sources
    kernel: remove `script/solver.{h,cpp}` from kernel headers
    on Sep 22, 2023
  24. DrahtBot renamed this:
    kernel: remove `script/solver.{h,cpp}` from kernel headers
    kernel: remove `script/solver.{h,cpp}` from kernel headers
    on Sep 22, 2023
  25. bitcoin locked this on Sep 21, 2024

github-metadata-mirror

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

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