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 12 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 #4522

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

// Local implementation of [ValidatorContext].
type newtorkContext[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type newtorkContext[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
type networkContext[H runtime.Hash, Hasher runtime.Hasher[H]] struct {

// Requested broadcast to all peers.
MessageIntentForcedBroadcast
// Periodic rebroadcast of all messages to all peers.
MessageIntentPeriodicReboradcast
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
MessageIntentPeriodicReboradcast
MessageIntentPeriodicRebroadcast

propagate(notificationService, cg.protocol, messages, intent, cg.peers, cg.validator)
}

// Prune old or no longer relevant consensus messages. Provide a predicate for pruning, which returns false when the
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the the comment about providing a predicate is outdated, since the method takes no parameters?

return r.intersects(RolesFull | RolesAuthority)
}

// Does this role represents a client that does not participates in the consensus?
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be:

Suggested change
// Does this role represents a client that does not participates in the consensus?
// Does this role represents a client that participates in the consensus?
```?

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 GossipEngine
4 participants