Skip to content

refactor(p2p)!: merge #4307 back into main#4643

Merged
melekes merged 21 commits intomainfrom
4553-merge-p2p-refactor-into-main-2
Dec 13, 2024
Merged

refactor(p2p)!: merge #4307 back into main#4643
melekes merged 21 commits intomainfrom
4553-merge-p2p-refactor-into-main-2

Conversation

@melekes
Copy link
Collaborator

@melekes melekes commented Dec 10, 2024

Closes #4553

Refs #4307

@melekes melekes requested a review from a team as a code owner December 10, 2024 12:36
@melekes melekes requested a review from a team December 10, 2024 12:36
@melekes melekes self-assigned this Dec 10, 2024
@melekes melekes added p2p breaking A breaking change labels Dec 10, 2024
Copy link
Collaborator

@jmalicevic jmalicevic left a comment

Choose a reason for hiding this comment

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

Changelog, especially if there are breaking changes (API or otherwise).

@melekes
Copy link
Collaborator Author

melekes commented Dec 11, 2024

Changelog, especially if there are breaking changes (API or otherwise).

done ✅

Comment on lines +385 to +388
// c.Logger.Debug("Send",
// "streamID", chID,
// "msgBytes", log.NewLazySprintf("%X", msgBytes),
// "timeout", timeout)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// c.Logger.Debug("Send",
// "streamID", chID,
// "msgBytes", log.NewLazySprintf("%X", msgBytes),
// "timeout", timeout)
// c.Logger.Debug("Send",
// "streamID", chID,
// "msgBytes", log.NewLazySprintf("%X", msgBytes),
// "timeout", timeout)

Do we want to keep this debug message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's only useful if you're a CometBFT dev debugging the P2P stack. Otherwise, the message we've received is logged in peer.go.

c.Logger.Debug("Received bytes", "chID", channelID, "msgBytes", msgBytes)
// NOTE: This means the reactor.Receive runs in the same thread as the p2p recv routine
c.onReceive(channelID, msgBytes)
// c.Logger.Debug("Received", "streamID", channelID, "msgBytes", log.NewLazySprintf("%X", msgBytes))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// c.Logger.Debug("Received", "streamID", channelID, "msgBytes", log.NewLazySprintf("%X", msgBytes))
c.Logger.Debug("Received", "streamID", channelID, "msgBytes", log.NewLazySprintf("%X", msgBytes))

Restrore msg ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as #4643 (comment)

if err := p.mconn.Stop(); err != nil { // stop everything and close the conn
p.Logger.Debug("Error while stopping peer", "err", err)
if err := p.Close("stopping peer"); err != nil {
p.Logger.Error("Close", "err", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are increasing log level here. Afraid it might create too much noise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But it's only executed if closing underlying MConnection fails

@melekes melekes added this pull request to the merge queue Dec 13, 2024
@melekes melekes removed this pull request from the merge queue due to a manual request Dec 13, 2024
@melekes melekes added this pull request to the merge queue Dec 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 13, 2024
@melekes melekes added this pull request to the merge queue Dec 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 13, 2024
@melekes melekes added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit 9dc0052 Dec 13, 2024
@melekes melekes deleted the 4553-merge-p2p-refactor-into-main-2 branch December 13, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change p2p

Projects

None yet

Development

Successfully merging this pull request may close these issues.

p2p: merge #4307 into main

3 participants