refactor: proxy-types.h API cleanup #135

pull ryanofsky wants to merge 22 commits into bitcoin-core:master from ryanofsky:pr/mvtype changing 28 files +1342 −977
  1. ryanofsky commented at 3:47 pm on January 27, 2025: collaborator

    Goal of this PR is to resolve https://github.com/chaincodelabs/libmultiprocess/issues/50 by cleaning up the sprawling proxy-types.h code and organizing all the CustomReadField / CustomBuildField overloads so they are easier to locate and compare.

    This PR also resolves https://github.com/chaincodelabs/libmultiprocess/issues/122 by pairing the existing CustomBuildField ::capnp::Data overload with a new CustomReadField ::capnp::Data overload, and should make it easier to see when build & read overloads are inconsistent in the future and prevent that type of bug from happening in the future.

    This change is an API change that requires some changes to downstream bitcoin core code. The downstream code is updated in https://github.com/bitcoin/bitcoin/pull/31740.

  2. refactor: Rename ReadDestValue to ReadDestUpdate
    ReadDestUpdate is more consistent with ReadDestEmplace, and should be more
    descriptive. One is wrapping a destination that has an existing value and can
    be updated, the other is wrapping a destination that can only be emplaced into.
    f18a1ccd20
  3. moveonly: add mp/type-context.h b32e2b096c
  4. moveonly: add mp/type-optional.h 3cb9d9fd5b
  5. moveonly: add mp/type-pointer.h 619d2c7405
  6. moveonly: add mp/type-vector.h c6246c9198
  7. moveonly: add mp/type-set.h 6a68472bb3
  8. moveonly: add mp/type-map.h 079277f2ba
  9. moveonly: add mp/type-pair.h c999100289
  10. moveonly: add mp/type-tuple.h 6d831ebb1d
  11. moveonly: add mp/type-number.h df1375bd68
  12. moveonly: add mp/type-string.h 83c444dc9d
  13. moveonly: add mp/type-char.h 5417716ad8
  14. moveonly: add mp/type-interface.h 0d2f939214
  15. moveonly: add mp/type-function.h 5df55a3666
  16. moveonly: add mp/type-struct.h 11b418f438
  17. moveonly: add mp/type-message.h 8969d5a008
  18. moveonly: add mp/type-void.h 394651237b
  19. moveonly: add mp/type-exception.h 5ee6cd4118
  20. moveonly: add mp/type-decay.h e834ebd219
  21. moveonly: add mp/type-threadmap.h a595a0b228
  22. moveonly: add mp/type-chrono.h
    Definitions moved from
    https://github.com/bitcoin/bitcoin/blob/0a931a9787b196d7a620863cc143d9319ffd356d/src/ipc/capnp/common-types.h#L97-L115
    798f4b5e35
  23. move: add mp/type-data.h
    BuildField definition was moved from
    https://github.com/bitcoin/bitcoin/blob/0a931a9787b196d7a620863cc143d9319ffd356d/src/ipc/capnp/common-types.h#L137-L162
    and tweaked to be more restrictive so it only matches `LocalType`'s that are
    convertible to spans and constructible from spans, not just types that are
    convertible to spans. This allows adding a matching CustomReadField function
    below, which is new.
    
    Having the CustomReadField function fixes a serialization bug in the bitcoin
    core mining IPC interface that was reported in
    https://github.com/Sjors/bitcoin/issues/71 and
    https://github.com/chaincodelabs/libmultiprocess/issues/122
    
    The bug was caused by not having CustomBuildField and CustomReadField paired
    together, so a lower priority CustomReadField was chosen that was not
    compatible.
    7d59b8d14c
  24. ryanofsky force-pushed on Jan 27, 2025
  25. ryanofsky commented at 4:03 pm on January 27, 2025: collaborator
    Updated 5fdab5ce89cc79644882ee81b5f177a7fa7c9f23 -> 7d59b8d14c86af25b40ea18810903a5e33f00a80 (pr/mvtype.1 -> pr/mvtype.2, compare) deleting an unused variable in the new capnp::Data CustomReadField function
  26. ryanofsky merged this on Jan 27, 2025
  27. ryanofsky closed this on Jan 27, 2025

  28. ryanofsky referenced this in commit 90b116bd70 on Jan 27, 2025
  29. ryanofsky referenced this in commit 2221c8814d on Jan 27, 2025
  30. Sjors commented at 8:38 am on January 28, 2025: member
    Post-merge concept ACK on splitting proxy-types.h.
  31. Sjors referenced this in commit b66fe2fc03 on Jan 28, 2025
  32. fanquake referenced this in commit ad2f9324c6 on Jan 29, 2025
  33. janus referenced this in commit 311822f35f on Sep 1, 2025


ryanofsky Sjors


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-04 19:30 UTC

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