Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Jan 15, 2022

#18533 (comment):

a message is not a command, but simply a message of some type

Continuation of #18533 and #18937.

-BEGIN VERIFY SCRIPT-
sed -i 's/std::string m_command;/std::string m_type;/g' ./src/net.h
sed -i 's/* command and size./* type and size./g' ./src/net.h
sed -i 's/msg.m_command/msg.m_type/g' ./src/net.cpp ./src/net_processing.cpp ./src/test/fuzz/p2p_transport_serialization.cpp
-END VERIFY SCRIPT-
@DrahtBot DrahtBot added the P2P label Jan 15, 2022
Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Concept and code-review ACK 224d878

There are still quite a few instances of the confusing "command" terminology for message types around, as $ git grep -i command ./src/net* shows. Happy to review further changes in this direction (either in this PR or a follow-up).

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23233 (BIP324: Add encrypted p2p transport {de}serializer by dhruv)
  • #22053 (refactor: Release cs_main before MaybeSendFeefilter by MarcoFalke)
  • #21527 (net_processing: lock clean up by ajtowns)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

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

Code Review ACK 224d878

Going commit wise:

  1. I agree with this statement, and hence with the change:

a message is not a command, but simply a message of some type

  1. Removing these redundant variables makes the code more clean and readable.

Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

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

crACK 224d878

@maflcko maflcko merged commit 973c390 into bitcoin:master Jan 24, 2022
@hebasto hebasto deleted the 220115-message branch January 24, 2022 07:52
// decompose a single CNetMessage from the TransportDeserializer
CNetMessage msg(std::move(vRecv));

// store command string, time, and sizes
Copy link
Member

Choose a reason for hiding this comment

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

I think there are a few comments which could be updated.

git grep --ignore-case command ./src/net*

Copy link
Contributor

Choose a reason for hiding this comment

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

Let me take it up as a follow-up.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 28, 2022
…h CNetMessage::m_type

224d878 net, refactor: Drop tautological local variables (Hennadii Stepanov)
3073a99 scripted-diff: Rename CNetMessage::m_command with CNetMessage::m_type (Hennadii Stepanov)

Pull request description:

  bitcoin#18533 (comment):
  > a message is not a command, but simply a message of some type

  Continuation of bitcoin#18533 and bitcoin#18937.

ACKs for top commit:
  theStack:
    Concept and code-review ACK 224d878
  shaavan:
    Code Review ACK 224d878
  w0xlt:
    crACK 224d878

Tree-SHA512: 898cafb44708dae1413fcc1533d809d75878891354f1b5edaaec1287f4921c31adc9330f4d42d82544a39689886bc17fee71ea587f9199fd5cc849d376f82176
maflcko pushed a commit that referenced this pull request May 5, 2022
…c/net.cpp

e71c51b refactor: rename command -> message type in comments in the src/net* files (Shashwat)
2b09593 scripted-diff: Rename message command to message type (Shashwat)

Pull request description:

  This PR is a follow-up to #24078.

  > a message is not a command, but simply a message of some type

  The first commit covers the message_command variable name and comments not addressed in the original PR in `src/net*` files.
  The second commit goes beyond the original `src/net*` limit of #24078 and does similar changes in the `src/rpc/net.cpp` file.

ACKs for top commit:
  MarcoFalke:
    review ACK e71c51b 💥

Tree-SHA512: 24015d132c00f15239e5d3dc7aedae904ae3103a90920bb09e984ff57723402763f697d886322f78e42a0cb46808cb6bc9d4905561dc6ddee9961168f8324b05
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 5, 2022
… src/rpc/net.cpp

e71c51b refactor: rename command -> message type in comments in the src/net* files (Shashwat)
2b09593 scripted-diff: Rename message command to message type (Shashwat)

Pull request description:

  This PR is a follow-up to bitcoin#24078.

  > a message is not a command, but simply a message of some type

  The first commit covers the message_command variable name and comments not addressed in the original PR in `src/net*` files.
  The second commit goes beyond the original `src/net*` limit of bitcoin#24078 and does similar changes in the `src/rpc/net.cpp` file.

ACKs for top commit:
  MarcoFalke:
    review ACK e71c51b 💥

Tree-SHA512: 24015d132c00f15239e5d3dc7aedae904ae3103a90920bb09e984ff57723402763f697d886322f78e42a0cb46808cb6bc9d4905561dc6ddee9961168f8324b05
@bitcoin bitcoin locked and limited conversation to collaborators Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants