Skip to content

qml: Add PeerDetails page - #387

Closed
johnny9 wants to merge 1 commit into
bitcoin-core:mainfrom
johnny9:peer-details
Closed

johnny9 wants to merge 1 commit into
bitcoin-core:mainfrom
johnny9:peer-details

Conversation

@johnny9

@johnny9 johnny9 commented Jan 29, 2024 •

Copy link
Copy Markdown
Collaborator

This commit introduces a new page, PeerDetails, that shows additional information on a Peer after it is selected from the list of Peers. After clicking on the peer, the new page gets pushed onto the settings stack. Two conditions will cause the view to pop, the user clicking the Back at the top left or the peer disconnecting.

For reviewers, I would very much like comments on the conversion of the Stats struct to the QML compatible object that is used.

This commit does not include the disconnect/ban buttons, the top right buttons to cycle through the peers, or the icons that are adjacent to the values.

Link to github actions build artifacts.

Build Artifacts

Comment thread src/qml/controls/SettingsButton.qml Resolved
Comment thread src/qml/controls/PeerRadioButton.qml Resolved
Comment thread src/qml/bitcoin.cpp
qmlRegisterSingletonInstance<AppMode>("org.bitcoincore.qt", 1, 0, "AppMode", &app_mode);
qmlRegisterType<BlockClockDial>("org.bitcoincore.qt", 1, 0, "BlockClockDial");
qmlRegisterType<LineGraph>("org.bitcoincore.qt", 1, 0, "LineGraph");
qmlRegisterUncreatableType<PeerDetailsModel>("org.bitcoincore.qt", 1, 0, "PeerDetailsModel", "");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clip: true
contentWidth: width

Column {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we need rules and way to wrap these values if for whatever reason they get too long:

Screenshot 2024-01-29 at 9 11 16 AM

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i think a max width with an elipses should cover it. I'll see what that looks like.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

values now elide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

user might want to view all Services
maybe be good to put the missing ones in a tooltip?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also things like onion address should be fully visible imo
#375 (review)

Comment thread src/qml/pages/node/PeerDetails.qml Resolved
@johnny9

johnny9 commented Jan 29, 2024

Copy link
Copy Markdown
Collaborator Author

From 845a878 to a660b9c

  • Removed unused controls (RadioButton and SettingsButton for disconnect/ban)

@johnny9

johnny9 commented Jan 29, 2024

Copy link
Copy Markdown
Collaborator Author

Update from a660b9c to 8c2a918

  • Replaced color white with color neutral9 for Dark mode switching

@johnny9
johnny9 force-pushed the peer-details branch 4 times, most recently from 480c03f to b5e2de7 Compare January 30, 2024 04:27
@johnny9

johnny9 commented Jan 30, 2024

Copy link
Copy Markdown
Collaborator Author

Update from ef6e826 to b5e2de7

  • Fixed lint issues
  • Constrained text values with elide

@MarnixCroes

Copy link
Copy Markdown
Contributor

b5e2de7 weird jumping when clicking on peer, at Direction, User agent_, Type, Ip and Network
cannot repro at ID

jumping.webm

@johnny9

johnny9 commented Jan 30, 2024

Copy link
Copy Markdown
Collaborator Author

b5e2de7 weird jumping when clicking on peer, at Direction, User agent_, Type, Ip and Network cannot repro at ID
jumping.webm

This appears to be due to using the wrong index for the original model. I have updated the branch with a working solution

@johnny9

johnny9 commented Jan 30, 2024

Copy link
Copy Markdown
Collaborator Author

Update from b5e2de7 to b7161c5

  • Don't use the index from the proxy table, instead find the index for the details from the original table model.

@MarnixCroes MarnixCroes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what was the motivation behind current shown details?
some things like Connection Time (Age), Network, Last Block, Last Transaction are missing

Comment thread src/qml/pages/node/PeerDetails.qml Outdated
CoreText { text: "Information"; bold: true; font.pixelSize: 18; horizontalAlignment: Qt.AlignLeft; }
Column {
width: parent.width
PeerKeyValueRow { key: qsTr("IP"); value: details.address }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
PeerKeyValueRow { key: qsTr("IP"); value: details.address }
PeerKeyValueRow { key: qsTr("Address"); value: details.address }

can also be onion service/ other networks

Comment thread src/qml/pages/node/PeerDetails.qml Outdated
PeerKeyValueRow { key: qsTr("Version"); value: details.version }
PeerKeyValueRow { key: qsTr("User agent"); value: details.userAgent }
PeerKeyValueRow { key: qsTr("Services"); value: details.services }
PeerKeyValueRow { key: qsTr("Transport relay"); value: details.transactionRelay }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
PeerKeyValueRow { key: qsTr("Transport relay"); value: details.transactionRelay }
PeerKeyValueRow { key: qsTr("Transaction relay"); value: details.transactionRelay }

CoreText { text: "Block data"; bold: true; font.pixelSize: 18; horizontalAlignment: Qt.AlignLeft; }
Column {
width: parent.width
PeerKeyValueRow { key: qsTr("Starting block"); value: details.startingHeight }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Starting Block doesn't seem to work correctly, for me this always shows 0
(testing with a synced signet node, normal bitcoin qt it works fine)

@johnny9 johnny9 Feb 5, 2024 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I noticed that the Qt gui uses a value from a different struct. I will switch to that and see if that resolves it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes it works now

@GBKS

GBKS commented Feb 2, 2024

Copy link
Copy Markdown
Contributor

Great work. I tested it out on Android. Looks great overall, just see some inconsistencies to the design in terms of vertical spacing and missing formatting.

For text that does not fit in one line, I think it should just go multi-line. If you shorten it, you then need a way to expand it (which could be a simple tap).

In the image below, the Android screenshot is on the right, and the Figma mock-ups are on the left.

image

A few questions:

  • What does a "Synced headers" value of "-1" mean? That the process is not initialized?
  • What are permissions? What does "N/A" mean?
  • What does "Mapped AS" mean?
  • For sent/received, does it maybe make sense to show the percentage that is of the total send/receive? As an indicator of how much your node relies on this peer?

@MarnixCroes

Copy link
Copy Markdown
Contributor

@GBKS

What does a "Synced headers" value of "-1" mean? That the process is not initialized?

yes, it means that that peer didn't announce that info yet

What are permissions? What does "N/A" mean?

any special permissions that have been granted to that peer. N/A means Not Applicable / Not Assessed

What does "Mapped AS" mean?

Mapped Autonomous System, which can be used for diversifying peer selection

For sent/received, does it maybe make sense to show the percentage that is of the total send/receive? As an indicator of how much your node relies on this peer?

As peers are connecting and disconnecting all the time this is quite hard: Do you measure it for all currently connected peers, since the node is up, since first launch... etc.
and these values aren't that meaningful: a higher amount sent/received doesn't necessarily mean that the node relies more on this peer than another peer with a lower amount.

So, I get what you mean, but this shouldn't be added imo

@johnny9

johnny9 commented Feb 4, 2024

Copy link
Copy Markdown
Collaborator Author

Great work. I tested it out on Android. Looks great overall, just see some inconsistencies to the design in terms of vertical spacing and missing formatting.

Ill adjust that spacing. Looks like mine is too tight.

For text that does not fit in one line, I think it should just go multi-line. If you shorten it, you then need a way to expand it (which could be a simple tap).

I'll use word wrap on the next update

A few questions:

* What does a "Synced headers" value of "-1" mean? That the process is not initialized

It means that it hasn't synced any headers with this peer yet. -1 is the default vault. I think this should just probably just be a minus as well until this data updates.

* What are permissions? What does "N/A" mean?

These are all of the permission strings "bloomfilter", "noban", "forcerelay" "relay" "mempool" "download" "addr". N/A just means that none are set. These permissions are assigned by using the "-whitelist" configuration option. Here are the description of these flags.
"bloomfilter (allow requesting BIP37 filtered blocks and transactions)",
"noban (do not ban for misbehavior; implies download)",
"forcerelay (relay transactions that are already in the mempool; implies relay)",
"relay (relay even in -blocksonly mode, and unlimited transaction announcements)",
"mempool (allow requesting BIP35 mempool contents)",
"download (allow getheaders during IBD, no disconnect after maxuploadtarget limit)",
"addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info)"

* What does "Mapped AS" mean?

Mapped AS means Mapped Autonomous System which is a configuration option that lets you map peers to AS numbers. AS numbers are assigned by top level internet registries to organizations with a bunch of network addresses. You specify a mapping file to bitcoin core with a configuration option.

* For sent/received, does it maybe make sense to show the percentage that is of the total send/receive? As an indicator of how much your node relies on this peer?

Yeah I think there is a lot of value in that.

@johnny9

johnny9 commented Feb 5, 2024

Copy link
Copy Markdown
Collaborator Author

Update from b7161c5 to d737ea3

  • Used correct struct for m_starting_height value to fix "Starting Height"
  • Changed IP to Address
  • Adjusted spacing to match figma
  • Allowed Text to WordWrap

@MarnixCroes

Copy link
Copy Markdown
Contributor

running d737ea3, I now had twice that the peer details page closed itself randomly and returned to the peers page.
peer didn't disconnect, not sure what is causing it.

Changed IP to Address

forgot to add the change?

Allowed Text to WordWrap

this looks good 👍

@GBKS

GBKS commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

Thanks for the explainers and tweaking the layout.

These permissions are assigned by using the "-whitelist" configuration option

Does that mean permissions are application-wide and the same for all peers? If so, maybe they can be shown elsewhere...?

I think this should just probably just be a minus as well until this data updates.

Are we using "N/A" and "-" interchangeably? Looks like we need states for

  • Pending: we're still waiting to find out (maybe "..."?)
  • Not available: we're not waiting anymore, and have no idea ("N/A")
  • None: none were set ("-")

Does that seem about right? What's the likelihood of getting "not available"? Is that even possible?

@johnny9

johnny9 commented Feb 5, 2024

Copy link
Copy Markdown
Collaborator Author

running d737ea3, I now had twice that the peer details page closed itself randomly and returned to the peers page. peer didn't disconnect, not sure what is causing it.

Yeah im worried about this. I will dig into that and make sure my signals are being triggered correctly

@GBKS

GBKS commented Feb 6, 2024

Copy link
Copy Markdown
Contributor

I now had twice that the peer details page closed itself randomly and returned to the peers page

I also had this happen.

@yashrajd

yashrajd commented Feb 6, 2024

Copy link
Copy Markdown

Good stuff guys.

In line with external feedback we received in past Bitcoin Core calls, a little tooltip and explainers for these items would be extremely useful.

Even the tip that @johnny9 provided about how peer permissions can be changed would be useful (on this page or somewhere else)

@GBKS

What does a "Synced headers" value of "-1" mean? That the process is not initialized?

yes, it means that that peer didn't announce that info yet

What are permissions? What does "N/A" mean?

any special permissions that have been granted to that peer. N/A means Not Applicable / Not Assessed

What does "Mapped AS" mean?

Mapped Autonomous System, which can be used for diversifying peer selection

For sent/received, does it maybe make sense to show the percentage that is of the total send/receive? As an indicator of how much your node relies on this peer?

As peers are connecting and disconnecting all the time this is quite hard: Do you measure it for all currently connected peers, since the node is up, since first launch... etc. and these values aren't that meaningful: a higher amount sent/received doesn't necessarily mean that the node relies more on this peer than another peer with a lower amount.

So, I get what you mean, but this shouldn't be added imo

@GBKS

GBKS commented Feb 7, 2024

Copy link
Copy Markdown
Contributor

For this PR generally, I'm happy to ACK it whenever the functionality is solid and we can tweak visualization details and tips as we live with it during practical usage.

Comment thread src/qml/pages/node/PeerDetails.qml Outdated
anchors.horizontalCenter: parent.horizontalCenter
spacing: 10

CoreText { text: "Information"; bold: true; font.pixelSize: 18; horizontalAlignment: Qt.AlignLeft; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Every categories CoreText declaration also needs to specify color as Theme.color.neutral9

@MarnixCroes MarnixCroes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Transport version and Connection Time with the peer should be added imo

@johnny9

johnny9 commented Feb 10, 2024

Copy link
Copy Markdown
Collaborator Author

Transport version and Connection Time with the peer should be added imo

I think we need to re-sync with main before we add transport type but I can add Connection Time to the Network traffic section

@johnny9

johnny9 commented Feb 10, 2024

Copy link
Copy Markdown
Collaborator Author

Update from b4f8fc1 to c8344d8

  • Prevented disconnect signal from triggering twice
  • Set color correctly on the section titles
  • Added "Connection time"

@MarnixCroes

Copy link
Copy Markdown
Contributor

Transport version and Connection Time with the peer should be added imo

and the Network (ipv4, onion etc),
sorry forgot about that one

@MarnixCroes MarnixCroes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

apart from some minor things, like the dialog sometimes randomly closing.
I think this is good enough and improvements can be made later on

ACK c8344d8

nice work

@jarolrod jarolrod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Almost there for the basic functionality of this page, some spacing is not adherent to the design file

Comment thread src/qml/pages/node/PeerDetails.qml Outdated
PeerKeyValueRow { key: qsTr("Address"); value: details.address }
PeerKeyValueRow { key: qsTr("VIA"); value: details.addressLocal }
PeerKeyValueRow { key: qsTr("Type"); value: details.type }
PeerKeyValueRow { key: qsTr("Permission"); value: details.permission }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
PeerKeyValueRow { key: qsTr("Permission"); value: details.permission }
PeerKeyValueRow { key: qsTr("Permissions"); value: details.permission }

Comment thread src/qml/pages/node/PeerDetails.qml Outdated
}
Column {
width: parent.width
spacing: 5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The spacing between sections of information is actually 15, so we'd want to add a bottom margin of 5

diff --git a/src/qml/pages/node/PeerDetails.qml b/src/qml/pages/node/PeerDetails.qml
index 224aef8c7..b32c2a0c7 100644
--- a/src/qml/pages/node/PeerDetails.qml
+++ b/src/qml/pages/node/PeerDetails.qml
@@ -79,6 +79,7 @@ Page {
             Column {
                 width: parent.width
                 spacing: 5
+                bottomPadding: 5
                 PeerKeyValueRow { key: qsTr("Address"); value: details.address }
                 PeerKeyValueRow { key: qsTr("VIA"); value: details.addressLocal }
                 PeerKeyValueRow { key: qsTr("Type"); value: details.type }
@@ -101,6 +102,7 @@ Page {
             Column {
                 width: parent.width
                 spacing: 5
+                bottomPadding: 5
                 PeerKeyValueRow { key: qsTr("Starting block"); value: details.startingHeight }
                 PeerKeyValueRow { key: qsTr("Synced headers"); value: details.syncedHeaders }
                 PeerKeyValueRow { key: qsTr("Synced blocks"); value: details.syncedBlocks }
@@ -116,6 +118,7 @@ Page {
             Column {
                 width: parent.width
                 spacing: 5
+                bottomPadding: 5
                 PeerKeyValueRow { key: qsTr("Direction"); value: details.direction }
                 PeerKeyValueRow { key: qsTr("Connection time"); value: details.connectionDuration }
                 PeerKeyValueRow { key: qsTr("Last send"); value: details.lastSend }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See here, this starts to look like the design file

master patch
section-spacing-master section-spacing-patch

Design file screenshot of section spacing:

spacing-between-sections-15

Column {
width: Math.min(parent.width - 40, 450)
anchors.horizontalCenter: parent.horizontalCenter
spacing: 10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we want to add top and bottom padding of 30 to adhere to the design file

Suggested change
spacing: 10
spacing: 10
topPadding: 30
bottomPadding: 30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See here, this starts to look like the design file

master patch
top-bottom-padding-master top-bottom-padding-patch

Design file screenshot of top padding:

Screenshot 2024-02-13 at 10 30 16 PM

component PeerKeyValueRow: Row {
width: parent.width
property string key: ""
property string value: ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also

Suggested change
property string value: ""
property string value: ""
spacing: 10

@johnny9

johnny9 commented Feb 14, 2024 •

Copy link
Copy Markdown
Collaborator Author

Update from c8344d8 to eb5030f

  • incorporated all of @jarolrod suggestions (good eye)
  • set height of PeerKeyValueRow to 21 as specified by the Figma and removed the spacing value for the Columns that hold those Rows.
    Screenshot from 2024-02-14 00-24-30

Screenshot from 2024-02-14 00-22-35

@MarnixCroes MarnixCroes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

eb5030f the new spacing can cause some overlap

image

@johnny9

johnny9 commented Feb 14, 2024 •

Copy link
Copy Markdown
Collaborator Author

eb5030f the new spacing can cause some overlap

image

Thank you, updated with the height attached to the lineCount of the value

component PeerKeyValueRow: Row {
        width: parent.width
        property string key: ""
        property string value: ""
        height: 21 * valueText.lineCount
        spacing: 10
        CoreText {
            color: Theme.color.neutral9;
            text: key;
            width: 125;
            horizontalAlignment: Qt.AlignLeft;
        }
        CoreText {
            id: valueText
            color: Theme.color.neutral9;
            elide: Text.ElideRight;
            wrapMode: Text.WordWrap;
            text: value
            width: parent.width - 125;
            horizontalAlignment: Qt.AlignLeft;
        }
    }

@MarnixCroes MarnixCroes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ack fa4e080

@yashrajd

yashrajd commented Feb 14, 2024 •

Copy link
Copy Markdown

Just ran the latest artefact, and it looks pretty good. Didn't see any spacing issues. ACK.

@GBKS

GBKS commented Feb 15, 2024 •

Copy link
Copy Markdown
Contributor

Thank you, updated with the height attached to the lineCount of the value

Do I see it correctly that the line height is hard-coded? Users can typically adjust text size via accessibility settings, which means the line height will also differ. Is there a way to automatically calculate this value?

In Figma and CSS, I usually define the line height as a percentage (see how that is defined in CSS here). Is that possible? Might be easier to work with.

@jarolrod jarolrod mentioned this pull request Feb 28, 2024
@jarolrod

Copy link
Copy Markdown
Contributor

#388 is proposed as an alternative which handles some of the outstanding issues, implements more functionality

@johnny9

johnny9 commented Mar 1, 2024

Copy link
Copy Markdown
Collaborator Author

Closing this as it is superseded with #388

@johnny9 johnny9 closed this Mar 1, 2024
hebasto added a commit that referenced this pull request Sep 27, 2024
02d3121 qml: Add PeerDetails page (johnny9)
1ed2188 qml: Introduce KeyValueRow control (jarolrod)
052b5be qml: Introduce minus icon (jarolrod)

Pull request description:

  Alternative to #387 which expands to think about a reusable row component, allowing to load any element(s) to the value field, not hardcoding in a height of 21 for a row (but still ensuring it's a minimum of 21), proper icon usage for N/A cases, dummy net indicators in place

  TODO:
  - Ban buttons
  - Hover hints
  - Disconnected state instead of flying back to the peers table
  - Smart text fixups

  <img width="752" alt="Screenshot 2024-02-28 at 3 53 43 AM" src="https://github.com/bitcoin-core/gui-qml/assets/23396902/7b3b8f7f-f490-4233-a540-736e34760116">

  Link to github actions build artifacts.

  [![Build Artifacts](https://img.shields.io/badge/Build%20Artifacts-green
  )]()

ACKs for top commit:
  MarnixCroes:
    tACK 02d3121
  D33r-Gee:
    tACK 02d3121
  pablomartin4btc:
    utACK 02d3121

Tree-SHA512: 26e3782e4cac2629bbeef40815edeaaddf59f91ec8f63017e5b8c223c4060c0a535b2640a7dbf34e4b25a20fa887a6bc109f7d57c5864a6d9896832db7f87b9f
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Nov 22, 2026
…nunix platform support and fix race conditions

d5f7524 doc: Bump minimum required Cap'n Proto version to 0.9.2 (Ryan Ofsky)
4898199 build: suppress -Wc++23-lambda-attributes in warn_interface (Ryan Ofsky)
270f5db Squashed 'src/ipc/libmultiprocess/' changes from e8de5c7b68e..acded1aafae (Ryan Ofsky)

Pull request description:

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh).

  Changes since last subtree update (#35720):

  - Adds support for nonunix platforms, making API changes that are not backwards compatible ([bitcoin-core#274](bitcoin-core/libmultiprocess#274)). Follow-ups add a `CurrentThread()` accessor matching compatibility code in [bitcoin/bitcoin#35084](bitcoin/bitcoin#35084) ([bitcoin-core#323](bitcoin-core/libmultiprocess#323)) and remove code for Cap'n Proto versions before 0.9 ([bitcoin-core#331](bitcoin-core/libmultiprocess#331)).
  - Fixes a data race between IPC calls running on worker threads and disconnects, found by Antithesis ([bitcoin-core#349](bitcoin-core/libmultiprocess#349)).
  - Fixes a use-after-free when a socket disconnects before `ConnectStream` connects, and leaks and hangs when a client `construct()` call throws ([bitcoin-core#298](bitcoin-core/libmultiprocess#298)).
  - Fixes a race where file descriptors from `SpawnProcess` could leak into processes forked at the same time by other threads, by clearing `FD_CLOEXEC` in the child after forking ([bitcoin-core#311](bitcoin-core/libmultiprocess#311)).
  - Makes `SpawnProcess` report `exec` failures back to the parent and throw, reaping the child ([bitcoin-core#312](bitcoin-core/libmultiprocess#312)).
  - Adds support for `std::chrono::time_point` fields ([bitcoin-core#303](bitcoin-core/libmultiprocess#303)) and for serializing lists of interface objects that need to be moved from ([bitcoin-core#304](bitcoin-core/libmultiprocess#304)), both needed by [bitcoin/bitcoin#10102](bitcoin/bitcoin#10102).
  - Accepts container fields and parameters with any comparator, hash, and allocator types, like Bitcoin Core's `GCSFilter::ElementSet`, needed by [bitcoin/bitcoin#29409](bitcoin/bitcoin#29409) ([bitcoin-core#379](bitcoin-core/libmultiprocess#379)).
  - Finds the `capnp` tool in vcpkg and Windows builds, needed by [bitcoin/bitcoin#32387](bitcoin/bitcoin#32387) ([bitcoin-core#317](bitcoin-core/libmultiprocess#317)).
  - Adds a `destroy_connection` option to `ServeStream` and `ConnectStream`, lets `ServeStream` take ownership of the init object and return the new server and its connection, and adds an `EventLoop::incomingConnections()` accessor, simplifying test setup in both repositories and needed by [bitcoin/bitcoin#35932](bitcoin/bitcoin#35932) ([bitcoin-core#365](bitcoin-core/libmultiprocess#365)).
  - Replaces `EventLoop::post()` with `sync()` taking a `kj::FunctionParam`, avoiding a heap allocation per call ([bitcoin-core#347](bitcoin-core/libmultiprocess#347)).
  - Names threads spawned by the event loop so they can be told apart in tools and logs ([bitcoin-core#324](bitcoin-core/libmultiprocess#324)).
  - Fixes warnings that Bitcoin Core enables or plans to enable: adds `[[noreturn]]` attributes for `-Wmissing-noreturn` ([bitcoin-core#339](bitcoin-core/libmultiprocess#339), for [bitcoin/bitcoin#35911](bitcoin/bitcoin#35911)), and fixes `-Wunused` ([bitcoin-core#362](bitcoin-core/libmultiprocess#362), for [bitcoin/bitcoin#36167](bitcoin/bitcoin#36167)), `-Wunused-const-variable` and `-Wundef` ([bitcoin-core#370](bitcoin-core/libmultiprocess#370)), and `-Wmissing-prototypes` ([bitcoin-core#386](bitcoin-core/libmultiprocess#386), for [bitcoin/bitcoin#36743](bitcoin/bitcoin#36743)) warnings.
  - Fails at compile time with a suggested workaround when Cap'n Proto misdetects exception support (`KJ_NO_EXCEPTIONS`), as happens on NetBSD ([bitcoin-core#364](bitcoin-core/libmultiprocess#364)).
  - Build improvements: fixes stale generated code when the `mpgen` binary changes ([bitcoin-core#316](bitcoin-core/libmultiprocess#316)), fixes `mpgen` link order for static Cap'n Proto builds ([bitcoin-core#367](bitcoin-core/libmultiprocess#367)), links `mpgen` against `kj-async` instead of `capnp-rpc` ([bitcoin-core#327](bitcoin-core/libmultiprocess#327)), shows Cap'n Proto `find_package` diagnostics ([bitcoin-core#325](bitcoin-core/libmultiprocess#325)), installs `type-unordered-set.h` and `version.h` ([bitcoin-core#350](bitcoin-core/libmultiprocess#350)), and shows include-what-you-use errors instead of failing silently ([bitcoin-core#371](bitcoin-core/libmultiprocess#371)).
  - Test, CI, documentation, and minor code improvements: fix for a startup race in the example program ([bitcoin-core#315](bitcoin-core/libmultiprocess#315)), new test for immediate client disconnects in `ListenConnections` ([bitcoin-core#310](bitcoin-core/libmultiprocess#310)), `ReadList` return value check ([bitcoin-core#338](bitcoin-core/libmultiprocess#338)), connect test race fix ([bitcoin-core#343](bitcoin-core/libmultiprocess#343)) and cleanups ([bitcoin-core#344](bitcoin-core/libmultiprocess#344)), `std::ranges::copy` follow-ups ([bitcoin-core#307](bitcoin-core/libmultiprocess#307)), trailing whitespace removal ([bitcoin-core#345](bitcoin-core/libmultiprocess#345)), Cap'n Proto version documentation fix ([bitcoin-core#357](bitcoin-core/libmultiprocess#357)), clang-tidy updates ([bitcoin-core#358](bitcoin-core/libmultiprocess#358), [bitcoin-core#360](bitcoin-core/libmultiprocess#360), [bitcoin-core#380](bitcoin-core/libmultiprocess#380), [bitcoin-core#389](bitcoin-core/libmultiprocess#389)), new CI job testing newer cmake and Cap'n Proto versions ([bitcoin-core#212](bitcoin-core/libmultiprocess#212), [bitcoin-core#359](bitcoin-core/libmultiprocess#359)), CI coverage for the minimum supported g++ ([bitcoin-core#330](bitcoin-core/libmultiprocess#330), [bitcoin-core#366](bitcoin-core/libmultiprocess#366)), new CI warnings ([bitcoin-core#332](bitcoin-core/libmultiprocess#332), [bitcoin-core#341](bitcoin-core/libmultiprocess#341)), CI parallelism ([bitcoin-core#334](bitcoin-core/libmultiprocess#334), [bitcoin-core#356](bitcoin-core/libmultiprocess#356)), CI diagnostics ([bitcoin-core#351](bitcoin-core/libmultiprocess#351), [bitcoin-core#352](bitcoin-core/libmultiprocess#352)), Nix and LLVM updates ([bitcoin-core#296](bitcoin-core/libmultiprocess#296), [bitcoin-core#363](bitcoin-core/libmultiprocess#363)), NetBSD and OpenBSD CI fixes ([bitcoin-core#321](bitcoin-core/libmultiprocess#321), [bitcoin-core#340](bitcoin-core/libmultiprocess#340), [bitcoin-core#381](bitcoin-core/libmultiprocess#381)), building Cap'n Proto with GCC in the 32-bit CI job to avoid an ABI mismatch ([bitcoin-core#383](bitcoin-core/libmultiprocess#383)), and GitHub Actions updates ([bitcoin-core#387](bitcoin-core/libmultiprocess#387)).

  The second commit suppresses the clang `-Wc++23-lambda-attributes` warning, which the new `[[noreturn]]` lambda attribute in `mp/proxy-types.h` triggers in C++20 builds. Since #31507 the Windows build uses clang-cl, so the same flag covers it.

  The third commit updates the minimum Cap'n Proto version in `doc/dependencies.md` to 0.9.2 (1.0 with Clang). This update raises libmultiprocess's own minimum from 0.7 to 0.9 (bitcoin-core/libmultiprocess#331), and libmultiprocess rejects 0.9.0 and 0.9.1 for CVE-2022-46149 and, with Clang 16 or newer, every version before 1.0.

ACKs for top commit:
  fanquake:
    ACK d5f7524
  willcl-ark:
    ACK d5f7524

Tree-SHA512: 4064944f4d8bb6c1665ddc7d5fae838492235d7dfdafab88b19b687ff6892460a3f450b90a145b287866330c569b862d748c941a70c65abc7f273ef13e490fd7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants