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

feat(internal/client) GossipEngine implementation with dependency Network and Syncing interfaces #4572

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

timwu20
Copy link
Contributor

@timwu20 timwu20 commented Feb 24, 2025

Changes

  • GossipEngine implementation.
  • Introduces service.NetworkPeers, service.NetworkEventStream, sync.SyncEventStream, and service.NetworkBlock interfaces.
  • Introduces gossip.Network and gossip.Syncing interfaces as dependencies for GossipEngine.
  • Unit tests using mock Network and Syncing implementations.

Tests

go test -tags integration github.com/ChainSafe/gossamer

Issues

closes #3629

@timwu20 timwu20 changed the title GossipEngine implementation, and dependency interfaces feat(internal/client) GossipEngine implementation with dependency Network and Syncing interfaces Feb 24, 2025
@timwu20 timwu20 marked this pull request as ready for review February 24, 2025 22:55
@timwu20 timwu20 requested review from dimartiro and P1sar February 25, 2025 03:40
)

// Multiaddr type used in Gossamer
type Multiaddr struct {
Copy link
Member

Choose a reason for hiding this comment

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

why Multiaddr wrapped in Multiaddr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will eventually need to implement some public methods on this type in future work (see substrate impl). Just laying the groundwork for now.

ge.stateMachine.BroadcastTopic(ge.notificationService, topic, force)
}

// Get data of valid, incoming messages for a topic (but might have expired meanwhile).
Copy link
Member

Choose a reason for hiding this comment

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

Why we are not using go semantc comments that start with the name of upcoming identifier declaration? In future it can be used for godoc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They actually stopped enforcing this in the linter, but I'll update this one since I still try to adhere to the practice.

Copy link
Contributor Author

@timwu20 timwu20 Feb 27, 2025

Choose a reason for hiding this comment

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

Ended up updating a lot of comments based on this practice in bedf0f8.


// MultiaddrPeerId is the address of a node, including its identity.
// This struct represents a decoded version of a multiaddress that ends with "/p2p/<peerid>".
type MultiaddrPeerId struct {
Copy link
Member

Choose a reason for hiding this comment

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

why have separate package config for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's where it's found in substrate (link). There will be more config associated types added to this package in future work.

@timwu20 timwu20 requested a review from P1sar February 27, 2025 22:08
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.

Implement processing of overseer messages by availability store subsystem
2 participants