Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jan 15, 2026

Currently the core_io module is split across two translation units. This will confuse code readers and tooling about the real state of the module.

Fix that by merging the module and removing the mapping workarounds.

Also, remove the module from the kernel lib, because it is not used there: The kernel does not use any json or string parsing or formatting.

@DrahtBot DrahtBot changed the title refactor: [move-only] Merge core_io module, remove from libkernel refactor: [move-only] Merge core_io module, remove from libkernel Jan 15, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 15, 2026

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

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34296.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK sedited
Stale ACK hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #34319 (Drop some IWYU pragma: export and document IWYU usage by hebasto)
  • #34308 (doc: Document IWYU workaround by hebasto)
  • #33779 (ci, iwyu: Fix warnings in src/kernel and treat them as errors by hebasto)
  • #32729 (test,refactor: extract script template helpers & widen sigop count coverage by l0rinc)
  • #31650 (refactor: Avoid copies by using const references or by move-construction by maflcko)
  • #28690 (build: Introduce internal kernel library by sedited)

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.

@hebasto
Copy link
Member

hebasto commented Jan 15, 2026

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa93e01, I have reviewed the code and it looks OK.

@sedited
Copy link
Contributor

sedited commented Jan 16, 2026

Concept ACK

This became possible after introducing a bespoke small hex parser in bitcoin-chainstate.cpp in #30595. We should eventually re-use our own internal utilities for things like hex parsing in our small tool binaries. The strencodings module can be used for that, so removing core_read from the kernel doesn't make this more complicated.

@maflcko
Copy link
Member Author

maflcko commented Jan 16, 2026

I agree, and we may even go further: Make core_io use the kernel, instead of re-implementing the logic? I think in combination with #30595 (comment) this would even lead to a speedup for free? Happy to work on this in a follow-up, if there is no obvious issue I am missing.

@sedited
Copy link
Contributor

sedited commented Jan 16, 2026

The strencodings module can be used for that, so removing core_read from the kernel doesn't make this more complicated.

Although looks like the strencodings and string modules could be removed from the kernel lib now too?

MarcoFalke added 3 commits January 16, 2026 17:33
Also, util/string and util/strencodings
This can be reviewed with the git option
--color-moved=dimmed-zebra
Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa994e4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants