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

Rename Message struct to IbftMessage #97

Merged
merged 2 commits into from
Jun 21, 2024
Merged

Conversation

goran-ethernal
Copy link
Collaborator

@goran-ethernal goran-ethernal commented Jun 20, 2024

Description

In order to update libp2p dependencies in Edge, we need to rename the Message struct in messages.proto (which carries the ibft messages like RoundChange, Prepare, etc.), because, libp2p and its pubsub implementation introduced a message.proto which has the struct with the same name in it, so we get a panic over a same name panic:

20
panic: proto: file "messages/proto/messages.proto" has a name conflict over Message
	previously from: "github.com/libp2p/go-libp2p/p2p/transport/webrtc/pb"
	currently from:  "github.com/0xPolygon/go-ibft/messages/proto"

This PR renames the Message struct to IbftMessage, so that we avoid this panic when updating the libp2p dependency.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have added sufficient documentation in code

@goran-ethernal goran-ethernal self-assigned this Jun 20, 2024
@goran-ethernal goran-ethernal force-pushed the rename-message-struct branch 2 times, most recently from c685fee to 0c03fff Compare June 20, 2024 10:03
@goran-ethernal goran-ethernal force-pushed the rename-message-struct branch from 0c03fff to 81c6e03 Compare June 20, 2024 10:08
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
11.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal left a comment

Choose a reason for hiding this comment

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

As a nitpick, I'd rather call it ConsensusMessage, but it is alright this way as well.

Btw, do we need to rename messages.proto file as well?

P.s. not sure why SonarCloud is complaining, I reviewed the PR from a phone...

@goran-ethernal
Copy link
Collaborator Author

As a nitpick, I'd rather call it ConsensusMessage, but it is alright this way as well.

Btw, do we need to rename messages.proto file as well?

P.s. not sure why SonarCloud is complaining, I reviewed the PR from a phone...

No need to rename messages.proto file. And for the SonarCloud, not sure why it is failing. Even lint got activated for the non affected code.

@goran-ethernal goran-ethernal merged commit e81a63f into main Jun 21, 2024
4 of 5 checks passed
@goran-ethernal goran-ethernal deleted the rename-message-struct branch June 21, 2024 09:05
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.

3 participants