[kernel 3d/n] Misc `ChainstateManager::Options` fixups #25607

pull dongcarl wants to merge 2 commits into bitcoin:master from dongcarl:2022-07-kernel-fix-csmopts changing 6 files +13 −9
  1. dongcarl commented at 6:20 PM on July 13, 2022: contributor

    This is part of the libbitcoinkernel project: #24303, https://github.com/bitcoin/bitcoin/projects/18

    This PR is NOT dependent on any other PRs.


    Places ChainstateManager::Options into the kernel:: namespace and use designated initializers for construction.

  2. dongcarl commented at 8:17 PM on July 13, 2022: contributor

    @MarcoFalke wondering if you know why the Desig usages are not working here? https://cirrus-ci.com/task/6347551300386816?logs=ci#L2321

    init.cpp does #include <util/designator.h>

  3. MarcoFalke commented at 6:34 AM on July 14, 2022: member

    You'll need to rebase :sweat_smile:

  4. Move ChainstateManagerOpts into kernel:: namespace
    It should have been there in the first place.
    3837700267
  5. Use designated initializers for ChainstateManager::Options
    This wasn't available at the time when ChainstateManager::Options was
    introduced but is helpful to be explicit and ensure correctness.
    ce8b0f971b
  6. dongcarl force-pushed on Jul 14, 2022
  7. dongcarl commented at 1:56 PM on July 14, 2022: contributor

    Intermittent rpc_net issue strikes again! https://cirrus-ci.com/task/6461219992240128?logs=ci#L4516

    (restarting CI job)

  8. ryanofsky approved
  9. ryanofsky commented at 3:17 PM on July 14, 2022: contributor

    Code review ACK ce8b0f971b94e68db1e902dbd20dd99dcf9bcb0a

    I didn't realize Desig(field_name) compiled to nothing on certain platforms. That seems like it was dangerous because code might appear to be initializing one field, but actually be initializing another if fields were not in order. Unless maybe field order was enforced through CI. Anyway glad that is gone now.

  10. MarcoFalke commented at 3:19 PM on July 14, 2022: member

    Yes, it was enforced on every platform except msvc.

  11. MarcoFalke merged this on Jul 14, 2022
  12. MarcoFalke closed this on Jul 14, 2022

  13. ryanofsky commented at 3:30 PM on July 14, 2022: contributor

    Yes, it was enforced on every platform except msvc.

    Thanks, I didn't realize out of order designated initializers were actually forbidden by the language.

  14. ryanofsky commented at 3:32 PM on July 14, 2022: contributor

    Thanks, I didn't realize out of order designated initializers were actually forbidden by the language.

    Though if skipping a field was allowed this still could have been bad.

  15. MarcoFalke commented at 3:35 PM on July 14, 2022: member

    Skipping is allowed, and seems no worse than omission of "trailing" fields

  16. ryanofsky commented at 3:40 PM on July 14, 2022: contributor

    Wouldn't this assign (1, 2, 0) on msvc and (1, 0, 2) on other platforms?

    struct S {
       int a;
       int b;
       int c;
    };
    
    S s{
      Desig(a) 1,
      Desig(c) 2,
    };
    
  17. MarcoFalke commented at 3:48 PM on July 14, 2022: member

    Yes (oops)

  18. sidhujag referenced this in commit a651a0a8fe on Jul 14, 2022
  19. dongcarl added this to the "Done or Closed or Rethinking" column in a project

  20. bitcoin locked this on Jul 16, 2023

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: 2026-04-22 09:13 UTC

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