Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: Merge bitcoin#22138, 21939, bitcoin-core/gui#163, 20373, 22144, 22013, 21719, 20786 #5983

Merged
merged 8 commits into from
Apr 23, 2024

Conversation

vijaydasmp
Copy link

bitcoin backports

@vijaydasmp vijaydasmp changed the title Bp22 32 backport: Merge bitcoin#22138, 21939 Apr 11, 2024
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#22138, 21939 backport: Merge bitcoin#22138, 21939, bitcoin-core/gui#163, 20373, 22399, 22144, 22013, 21719 Apr 11, 2024
@vijaydasmp vijaydasmp force-pushed the bp22_32 branch 3 times, most recently from 1b464dd to d85f406 Compare April 12, 2024 04:44
Copy link

This pull request has conflicts, please rebase.

@vijaydasmp vijaydasmp force-pushed the bp22_32 branch 2 times, most recently from f5ef885 to 5bc2015 Compare April 13, 2024 16:54
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#22138, 21939, bitcoin-core/gui#163, 20373, 22399, 22144, 22013, 21719 backport: Merge bitcoin#22138, 21939, bitcoin-core/gui#163, 20373, 22144, 22013, 21719 Apr 13, 2024
@vijaydasmp vijaydasmp marked this pull request as ready for review April 13, 2024 19:18
@knst knst self-requested a review April 14, 2024 05:55
@vijaydasmp
Copy link
Author

Hello @UdjinM6 , requesting review

@UdjinM6 UdjinM6 added the RPC Some notable changes to RPC params/behaviour/descriptions label Apr 15, 2024
@UdjinM6 UdjinM6 added this to the 21 milestone Apr 15, 2024
Copy link

This pull request has conflicts, please rebase.

@@ -40,6 +40,22 @@ const std::vector<std::string> CONNECTION_TYPE_DOC{
"feeler (short-lived automatic connection for testing addresses)"
};

CConnman& EnsureConnman(const NodeContext& node)
Copy link

Choose a reason for hiding this comment

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

21719: should update Dash-specific code too

diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index dfb463eb3a..bbc2e4eec2 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -19,6 +19,7 @@
 #include <net.h>
 #include <node/context.h>
 #include <rpc/blockchain.h>
+#include <rpc/net.h>
 #include <rpc/server.h>
 #include <rpc/util.h>
 #include <scheduler.h>
@@ -213,15 +214,13 @@ static RPCHelpMan sporkupdate()
     }
 
     const NodeContext& node = EnsureAnyNodeContext(request.context);
-    if (!node.connman) {
-        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
-    }
+    CConnman& connman = EnsureConnman(node);
 
     // SPORK VALUE
     int64_t nValue = request.params[1].get_int64();
 
     // broadcast new spork
-    if (node.sporkman->UpdateSpork(nSporkID, nValue, *node.connman)) {
+    if (node.sporkman->UpdateSpork(nSporkID, nValue, connman)) {
         return "success";
     }
 

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#22138, 21939, bitcoin-core/gui#163, 20373, 22144, 22013, 21719 backport: Merge bitcoin#22138, 21939, bitcoin-core/gui#163, 20373, 22144, 22013, 21719, 20786 Apr 17, 2024
Copy link

This pull request has conflicts, please rebase.

@vijaydasmp
Copy link
Author

Hello @UdjinM6 @knst @PastaPastaPasta , requesting review

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

@vijaydasmp
Copy link
Author

Hello @knst @PastaPastaPasta please review

@@ -1659,6 +1659,19 @@ QString NetworkToQString(Network net)
assert(false);
}

QString ConnectionTypeToQString(ConnectionType conn_type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest to backport bitcoin-core/gui#180 also

But that's not a blocker to get this one merged, because there's no critical fixes, just documentation updates.

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK 703c0ca

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK 703c0ca

MarcoFalke and others added 8 commits April 23, 2024 09:53
…n "invokable"

8050eb4 script: fix spelling linter raising spuriously on "invokable" (Jon Atack)

Pull request description:

  "invokable" is a valid word that means to be callable, but the linter is raising on it:
  ```
  $ test/lint/lint-spelling.sh
  contrib/guix/guix-attest:18: invokable ==> invocable
  contrib/guix/guix-clean:18: invokable ==> invocable
  contrib/guix/guix-verify:18: invokable ==> invocable
  ^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
  ```

ACKs for top commit:
  MarcoFalke:
    cr ACK 8050eb4

Tree-SHA512: 43f8dc7b7adb00ae563ccfe04a64a7ceb50237f24ff87209062bf57b2564b4d38a409df80e0183aa4f40ab306b5e07d7a5fad1600d41705bd3c443ed66a6d1c1
…lization

1c9255c refactor: Replace memset calls with array initialization (João Barbosa)

Pull request description:

  Follow up to bitcoin#21905 (review).

ACKs for top commit:
  laanwj:
    re-ACK 1c9255c
  Crypt-iQ:
    Code review ACK 1c9255c

Tree-SHA512: 4b61dec2094f4781ef1c0427ee3bda3cfea12111274eebc7bc40a84f261d9c1681dd0860c57200bea2456588e44e8e0aecd18545c25f1f1250dd331ab7d05f28
…ection Type

06ba9b3 rpc: move getpeerinfo connection_type help to correct place (Jon Atack)
c95fe6e gui: improve connection type tooltip (Hennadii Stepanov)
2c19ba2 gui: replace Direction with Connection Type in peer details (Jon Atack)
7e2beab gui: create GUIUtil::ConnectionTypeToQString utility function (Jon Atack)

Pull request description:

  ![Screenshot from 2021-01-09 11-23-17](https://user-images.githubusercontent.com/2415484/104089297-c5e18d80-5265-11eb-9251-49afcfdb562b.png)

  Closes dashpay#159.

ACKs for top commit:
  hebasto:
    re-ACK 06ba9b3, the tooltip content is organized as unordered list.
  jarolrod:
    re-ACK 06ba9b3

Tree-SHA512: 24f46494ceb42ed308e4a4f2a543dbc4f4e6409a6f738c145a9f16e175bf69d411cbc944a4fd969f1829d57644dfbc194182fa8d4e9e6bce82acbeca8c673748
…ulation

3642b2e refactor, net: Increase CNode data member encapsulation (Hennadii Stepanov)
acebb79 refactor, move-only: Relocate CNode private members (Hennadii Stepanov)

Pull request description:

  All protected `CNode` data members could be private.

ACKs for top commit:
  jnewbery:
    utACK 3642b2e
  MarcoFalke:
    review ACK 3642b2e 🏛

Tree-SHA512: 8435e3c43c3b7a3107d58cb809b8b5e1a1c0068677e249bdf0fc6ed24140ac4fc4efe2a280a1ee86df180d738c0c9e10772308690607954db6713000cf6e728d
79c02c8 Randomize message processing peer order (Pieter Wuille)

Pull request description:

  Right now, the message handling loop iterates the list of nodes always in the same order: the order they were connected in (see the `vNodes` vector). For some parts of the net processing logic, this order matters. Transaction requests are assigned explicitly to peers since bitcoin#19988, but many other parts of processing work on a "first-served-by-loop-first" basis, such as block downloading. If peers can predict this ordering, it may be exploited to cause delays.

  As there isn't anything particularly optimal about the current ordering, just make it unpredictable by randomizing.

  Reported by Crypt-iQ.

ACKs for top commit:
  jnewbery:
    ACK 79c02c8
  Crypt-iQ:
    ACK 79c02c8
  sdaftuar:
    utACK 79c02c8
  achow101:
    Code Review ACK 79c02c8
  jamesob:
    crACK bitcoin@79c02c8
  jonatack:
    ACK 79c02c8
  vasild:
    ACK 79c02c8
  theStack:
    ACK 79c02c8

Tree-SHA512: 9a87c4dcad47c2d61b76c4f37f59674876b78f33f45943089bf159902a23e12de7a5feae1a73b17cbc3f2e37c980ecf0f7fd86af9e6fa3a68099537a3c82c106
… DNS seed

fe3d17d net: ignore block-relay-only peers when skipping DNS seed (Anthony Towns)

Pull request description:

  Since bitcoin#17428 bitcoind will attempt to reconnect to two block-relay-only anchors before doing any other outbound connections. When determining whether to use DNS seeds, it will currently see these two peers and decide "we're connected to the p2p network, so no need to lookup DNS" -- but block-relay-only peers don't do address relay, so if your address book is full of invalid addresses (apart from your anchors) this behaviour will prevent you from recovering from that situation.

  This patch changes it so that it only skips use of DNS seeds when there are two full-outbound peers, not just block-relay-only peers.

ACKs for top commit:
  Sjors:
    utACK fe3d17d
  amitiuttarwar:
    ACK fe3d17d, this impacts the very common case where we stop/start a node, persisting anchors & have a non-empty addrman (although, to be clear, wouldn't be particularly problematic in the common cases where the addrman has valid addresses)
  mzumsande:
    ACK fe3d17d
  jonatack:
    ACK fe3d17d
  prayank23:
    tACK bitcoin@fe3d17d

Tree-SHA512: 9814b0d84321d7f45b5013eb40c420a0dd93bf9430f5ef12dce50d1912a18d5de2070d890a8c6fe737a3329b31059b823bc660b432d5ba21f02881dc1d951e94
fafb68a refactor: Add and use EnsureConnman in rpc code (MarcoFalke)
faabeb8 refactor: Mark member functions const (MarcoFalke)

Pull request description:

  This removes the 10 occurrences of `throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");` and replaces them with `EnsureConnman`.

ACKs for top commit:
  jarolrod:
    re-ACK fafb68a
  theStack:
    ACK fafb68a
  ryanofsky:
    Code review ACK fafb68a

Tree-SHA512: 84c63cfe31e548645d906f7191a3526c7bea99ed0d54c2a75c2041452a44fe149ede343d8e1943b0e7770816c828bb047dfec8bc541a1f2b89920a126ee54d68
faecb74 Expose integral m_conn_type in CNodeStats, remove m_conn_type_string (Jon Atack)

Pull request description:

  Currently, strings are stored for what are actually integral (strong) enum types. This is fine, because the strings are only used as-is for the debug log and RPC. However, it complicates using them in the GUI. User facing strings in the GUI should be translated and only string literals can be picked up for translation, not runtime `std::string`s.

  Fix that by removing the `std::string` members and replace them by strong enum integral types.

ACKs for top commit:
  jonatack:
    Code review ACK faecb74
  theStack:
    Code review ACK faecb74 🌲

Tree-SHA512: 24df2bd0645432060e393eb44b8abaf20fe296457d07a867b0e735c3e2e75af7b03fc6bfeca734ec33ab816a7c8e1f8591a5ec342f3afe3098a4e41f5c2cfebb
@PastaPastaPasta PastaPastaPasta merged commit 6194e45 into dashpay:develop Apr 23, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants