RFC: Generated headers with “"_hex user-defined literal #31861

pull fjahr wants to merge 2 commits into bitcoin:master from fjahr:2025-02-data-header-literal changing 3 files +22 −16
  1. fjahr commented at 8:58 pm on February 13, 2025: contributor

    This is based on a suggestion by sipa in #28792.

    The generated header could be a lot smaller when using the “"_hex user-defined literal defined in util/strencodings.h. Primarily this would be nice for an embedded asmap file but since we already generate these headers it’s a conversation that doesn’t have to be tied to the asmap PR.

    I am looking for feedback on:

    • Do people take issue with including util/strencodings.h in the generated headers
    • I found that this doesn’t compile in my clang this doesn’t compile without bumping template depth and constexpr steps (I set -DAPPEND_CXXFLAGS='-ftemplate-depth=100000 -fconstexpr-steps=100000000' and didn’t try to find the cut-off point). We are dealing with data of up to 2MB, primarily the asmap file and the block we have in our test data. Would that be a dealbreaker for people?
  2. WIP: raw data header with _hex 5fc3b82ab7
  3. WIP: json header using _hex 91f9f95dcd
  4. DrahtBot commented at 8:59 pm on February 13, 2025: contributor

    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/31861.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. sipa commented at 9:59 pm on February 13, 2025: member
    Eh, needing -ftemplate-depth and -fconstexpr-steps sounds pretty terrible. Thank you for investigating, though.
  6. fjahr commented at 10:11 pm on February 13, 2025: contributor
    Alright, closing ✅
  7. fjahr closed this on Feb 13, 2025


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: 2025-02-22 06:12 UTC

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