Skip to content

Commit

Permalink
Merge pull request onflow#5154 from onflow/yahya/fixes-p2p-package-names
Browse files Browse the repository at this point in the history
[Networking] Chore: fixes package names
  • Loading branch information
yhassanzadeh13 authored Dec 19, 2023
2 parents d0b0ef2 + dceee13 commit 3d8d907
Show file tree
Hide file tree
Showing 116 changed files with 401 additions and 377 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
cache: true
- name: Set Test Matrix
id: set-test-matrix
run: go run utils/test_matrix/test_matrix.go admin cmd consensus engine/access engine/collection engine/common engine/consensus engine/execution/ingestion:buildjet-8vcpu-ubuntu-2204 engine/execution/computation engine/execution engine/verification engine:buildjet-4vcpu-ubuntu-2204 fvm ledger module/dkg module:buildjet-4vcpu-ubuntu-2204 network/alsp network/test/cohort1:buildjet-16vcpu-ubuntu-2204 network/test/cohort2:buildjet-4vcpu-ubuntu-2204 network/p2p/connection network/p2p/p2pnode:buildjet-4vcpu-ubuntu-2204 network/p2p/scoring network/p2p network state storage utils
run: go run utils/test_matrix/test_matrix.go admin cmd consensus engine/access engine/collection engine/common engine/consensus engine/execution/ingestion:buildjet-8vcpu-ubuntu-2204 engine/execution/computation engine/execution engine/verification engine:buildjet-4vcpu-ubuntu-2204 fvm ledger module/dkg module:buildjet-4vcpu-ubuntu-2204 network/alsp network/test/cohort1:buildjet-16vcpu-ubuntu-2204 network/test/cohort2:buildjet-4vcpu-ubuntu-2204 network/p2p/connection network/p2p/node:buildjet-4vcpu-ubuntu-2204 network/p2p/scoring network/p2p network state storage utils

unit-test:
name: Unit Tests (${{ matrix.targets.name }})
Expand Down
5 changes: 3 additions & 2 deletions admin/admin/admin.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions admin/admin/admin_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions cmd/access/node_builder/access_node_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ import (
cborcodec "github.com/onflow/flow-go/network/codec/cbor"
"github.com/onflow/flow-go/network/p2p"
"github.com/onflow/flow-go/network/p2p/blob"
p2pbuilder "github.com/onflow/flow-go/network/p2p/builder"
p2pbuilderconfig "github.com/onflow/flow-go/network/p2p/builder/config"
"github.com/onflow/flow-go/network/p2p/cache"
"github.com/onflow/flow-go/network/p2p/conduit"
"github.com/onflow/flow-go/network/p2p/connection"
"github.com/onflow/flow-go/network/p2p/dht"
"github.com/onflow/flow-go/network/p2p/p2pbuilder"
p2pconfig "github.com/onflow/flow-go/network/p2p/p2pbuilder/config"
"github.com/onflow/flow-go/network/p2p/p2pnet"
"github.com/onflow/flow-go/network/p2p/subscription"
"github.com/onflow/flow-go/network/p2p/translator"
"github.com/onflow/flow-go/network/p2p/unicast/protocols"
relaynet "github.com/onflow/flow-go/network/relay"
"github.com/onflow/flow-go/network/slashing"
"github.com/onflow/flow-go/network/topology"
"github.com/onflow/flow-go/network/underlay"
"github.com/onflow/flow-go/network/validator"
"github.com/onflow/flow-go/state/protocol"
badgerState "github.com/onflow/flow-go/state/protocol/badger"
Expand Down Expand Up @@ -1197,7 +1197,7 @@ func (builder *FlowAccessNodeBuilder) InitIDProviders() {
filter.And(
filter.HasRole(flow.RoleConsensus),
filter.Not(filter.HasNodeID(node.Me.NodeID())),
p2pnet.NotEjectedFilter,
underlay.NotEjectedFilter,
),
builder.IdentityProvider,
)
Expand Down Expand Up @@ -1634,7 +1634,7 @@ func (builder *FlowAccessNodeBuilder) enqueuePublicNetworkInit() {
return nil, fmt.Errorf("could not register networking receive cache metric: %w", err)
}

net, err := p2pnet.NewNetwork(&p2pnet.NetworkConfig{
net, err := underlay.NewNetwork(&underlay.NetworkConfig{
Logger: builder.Logger.With().Str("module", "public-network").Logger(),
Libp2pNode: publicLibp2pNode,
Codec: cborcodec.NewCodec(),
Expand All @@ -1646,7 +1646,7 @@ func (builder *FlowAccessNodeBuilder) enqueuePublicNetworkInit() {
ReceiveCache: receiveCache,
ConduitFactory: conduit.NewDefaultConduitFactory(),
SporkId: builder.SporkID,
UnicastMessageTimeout: p2pnet.DefaultUnicastTimeout,
UnicastMessageTimeout: underlay.DefaultUnicastTimeout,
IdentityTranslator: builder.IDTranslator,
AlspCfg: &alspmgr.MisbehaviorReportManagerConfig{
Logger: builder.Logger,
Expand All @@ -1661,7 +1661,7 @@ func (builder *FlowAccessNodeBuilder) enqueuePublicNetworkInit() {
SlashingViolationConsumerFactory: func(adapter network.ConduitAdapter) network.ViolationsConsumer {
return slashing.NewSlashingViolationsConsumer(builder.Logger, builder.Metrics.Network, adapter)
},
}, p2pnet.WithMessageValidators(msgValidators...))
}, underlay.WithMessageValidators(msgValidators...))
if err != nil {
return nil, fmt.Errorf("could not initialize network: %w", err)
}
Expand Down Expand Up @@ -1700,7 +1700,7 @@ func (builder *FlowAccessNodeBuilder) initPublicLibp2pNode(networkKey crypto.Pri
return nil, fmt.Errorf("could not create connection manager: %w", err)
}

libp2pNode, err := p2pbuilder.NewNodeBuilder(builder.Logger, &builder.FlowConfig.NetworkConfig.GossipSub, &p2pconfig.MetricsConfig{
libp2pNode, err := p2pbuilder.NewNodeBuilder(builder.Logger, &builder.FlowConfig.NetworkConfig.GossipSub, &p2pbuilderconfig.MetricsConfig{
HeroCacheFactory: builder.HeroCacheMetricsFactory(),
Metrics: networkMetrics,
},
Expand All @@ -1710,7 +1710,7 @@ func (builder *FlowAccessNodeBuilder) initPublicLibp2pNode(networkKey crypto.Pri
builder.SporkID,
builder.IdentityProvider,
&builder.FlowConfig.NetworkConfig.ResourceManager,
&p2pconfig.PeerManagerConfig{
&p2pbuilderconfig.PeerManagerConfig{
// TODO: eventually, we need pruning enabled even on public network. However, it needs a modified version of
// the peer manager that also operate on the public identities.
ConnectionPruning: connection.PruningDisabled,
Expand All @@ -1721,7 +1721,7 @@ func (builder *FlowAccessNodeBuilder) initPublicLibp2pNode(networkKey crypto.Pri
MaxSize: builder.FlowConfig.NetworkConfig.DisallowListNotificationCacheSize,
Metrics: metrics.DisallowListCacheMetricsFactory(builder.HeroCacheMetricsFactory(), network.PublicNetwork),
},
&p2pconfig.UnicastConfig{
&p2pbuilderconfig.UnicastConfig{
Unicast: builder.FlowConfig.NetworkConfig.Unicast,
}).
SetBasicResolver(builder.Resolver).
Expand Down
20 changes: 10 additions & 10 deletions cmd/observer/node_builder/observer_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ import (
"github.com/onflow/flow-go/network/channels"
"github.com/onflow/flow-go/network/converter"
"github.com/onflow/flow-go/network/p2p"
p2pbuilder "github.com/onflow/flow-go/network/p2p/builder"
p2pbuilderconfig "github.com/onflow/flow-go/network/p2p/builder/config"
"github.com/onflow/flow-go/network/p2p/cache"
"github.com/onflow/flow-go/network/p2p/conduit"
p2pdht "github.com/onflow/flow-go/network/p2p/dht"
"github.com/onflow/flow-go/network/p2p/keyutils"
"github.com/onflow/flow-go/network/p2p/p2pbuilder"
p2pconfig "github.com/onflow/flow-go/network/p2p/p2pbuilder/config"
"github.com/onflow/flow-go/network/p2p/p2plogging"
"github.com/onflow/flow-go/network/p2p/p2pnet"
p2plogging "github.com/onflow/flow-go/network/p2p/logging"
"github.com/onflow/flow-go/network/p2p/subscription"
"github.com/onflow/flow-go/network/p2p/translator"
"github.com/onflow/flow-go/network/p2p/unicast/protocols"
"github.com/onflow/flow-go/network/p2p/utils"
"github.com/onflow/flow-go/network/slashing"
"github.com/onflow/flow-go/network/underlay"
"github.com/onflow/flow-go/network/validator"
stateprotocol "github.com/onflow/flow-go/state/protocol"
badgerState "github.com/onflow/flow-go/state/protocol/badger"
Expand Down Expand Up @@ -745,7 +745,7 @@ func (builder *ObserverServiceBuilder) initPublicLibp2pNode(networkKey crypto.Pr
node, err := p2pbuilder.NewNodeBuilder(
builder.Logger,
&builder.FlowConfig.NetworkConfig.GossipSub,
&p2pconfig.MetricsConfig{
&p2pbuilderconfig.MetricsConfig{
HeroCacheFactory: builder.HeroCacheMetricsFactory(),
Metrics: builder.Metrics.Network,
},
Expand All @@ -755,12 +755,12 @@ func (builder *ObserverServiceBuilder) initPublicLibp2pNode(networkKey crypto.Pr
builder.SporkID,
builder.IdentityProvider,
&builder.FlowConfig.NetworkConfig.ResourceManager,
p2pconfig.PeerManagerDisableConfig(), // disable peer manager for observer node.
p2pbuilderconfig.PeerManagerDisableConfig(), // disable peer manager for observer node.
&p2p.DisallowListCacheConfig{
MaxSize: builder.FlowConfig.NetworkConfig.DisallowListNotificationCacheSize,
Metrics: metrics.DisallowListCacheMetricsFactory(builder.HeroCacheMetricsFactory(), network.PublicNetwork),
},
&p2pconfig.UnicastConfig{
&p2pbuilderconfig.UnicastConfig{
Unicast: builder.FlowConfig.NetworkConfig.Unicast,
}).
SetSubscriptionFilter(
Expand Down Expand Up @@ -840,7 +840,7 @@ func (builder *ObserverServiceBuilder) enqueuePublicNetworkInit() {
return nil, fmt.Errorf("could not register networking receive cache metric: %w", err)
}

net, err := p2pnet.NewNetwork(&p2pnet.NetworkConfig{
net, err := underlay.NewNetwork(&underlay.NetworkConfig{
Logger: builder.Logger.With().Str("component", "public-network").Logger(),
Codec: builder.CodecFactory(),
Me: builder.Me,
Expand All @@ -852,7 +852,7 @@ func (builder *ObserverServiceBuilder) enqueuePublicNetworkInit() {
ReceiveCache: receiveCache,
ConduitFactory: conduit.NewDefaultConduitFactory(),
SporkId: builder.SporkID,
UnicastMessageTimeout: p2pnet.DefaultUnicastTimeout,
UnicastMessageTimeout: underlay.DefaultUnicastTimeout,
IdentityTranslator: builder.IDTranslator,
AlspCfg: &alspmgr.MisbehaviorReportManagerConfig{
Logger: builder.Logger,
Expand All @@ -867,7 +867,7 @@ func (builder *ObserverServiceBuilder) enqueuePublicNetworkInit() {
SlashingViolationConsumerFactory: func(adapter network.ConduitAdapter) network.ViolationsConsumer {
return slashing.NewSlashingViolationsConsumer(builder.Logger, builder.Metrics.Network, adapter)
},
}, p2pnet.WithMessageValidators(publicNetworkMsgValidators(node.Logger, node.IdentityProvider, node.NodeID)...))
}, underlay.WithMessageValidators(publicNetworkMsgValidators(node.Logger, node.IdentityProvider, node.NodeID)...))
if err != nil {
return nil, fmt.Errorf("could not initialize network: %w", err)
}
Expand Down
28 changes: 14 additions & 14 deletions cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ import (
alspmgr "github.com/onflow/flow-go/network/alsp/manager"
netcache "github.com/onflow/flow-go/network/cache"
"github.com/onflow/flow-go/network/p2p"
p2pbuilder "github.com/onflow/flow-go/network/p2p/builder"
p2pbuilderconfig "github.com/onflow/flow-go/network/p2p/builder/config"
"github.com/onflow/flow-go/network/p2p/cache"
"github.com/onflow/flow-go/network/p2p/conduit"
"github.com/onflow/flow-go/network/p2p/connection"
"github.com/onflow/flow-go/network/p2p/dns"
"github.com/onflow/flow-go/network/p2p/p2pbuilder"
p2pconfig "github.com/onflow/flow-go/network/p2p/p2pbuilder/config"
"github.com/onflow/flow-go/network/p2p/p2pnet"
"github.com/onflow/flow-go/network/p2p/ping"
"github.com/onflow/flow-go/network/p2p/unicast/protocols"
"github.com/onflow/flow-go/network/p2p/unicast/ratelimit"
"github.com/onflow/flow-go/network/p2p/utils/ratelimiter"
"github.com/onflow/flow-go/network/slashing"
"github.com/onflow/flow-go/network/topology"
"github.com/onflow/flow-go/network/underlay"
"github.com/onflow/flow-go/state/protocol"
badgerState "github.com/onflow/flow-go/state/protocol/badger"
"github.com/onflow/flow-go/state/protocol/events"
Expand Down Expand Up @@ -354,17 +354,17 @@ func (fnb *FlowNodeBuilder) EnqueueNetworkInit() {
// setup unicast rate limiters
unicastRateLimiters := ratelimit.NewRateLimiters(unicastRateLimiterOpts...)

uniCfg := &p2pconfig.UnicastConfig{
uniCfg := &p2pbuilderconfig.UnicastConfig{
Unicast: fnb.BaseConfig.FlowConfig.NetworkConfig.Unicast,
RateLimiterDistributor: fnb.UnicastRateLimiterDistributor,
}

connGaterCfg := &p2pconfig.ConnectionGaterConfig{
connGaterCfg := &p2pbuilderconfig.ConnectionGaterConfig{
InterceptPeerDialFilters: connGaterPeerDialFilters,
InterceptSecuredFilters: connGaterInterceptSecureFilters,
}

peerManagerCfg := &p2pconfig.PeerManagerConfig{
peerManagerCfg := &p2pbuilderconfig.PeerManagerConfig{
ConnectionPruning: fnb.FlowConfig.NetworkConfig.NetworkConnectionPruning,
UpdateInterval: fnb.FlowConfig.NetworkConfig.PeerUpdateInterval,
ConnectorFactory: connection.DefaultLibp2pBackoffConnectorFactory(),
Expand All @@ -386,7 +386,7 @@ func (fnb *FlowNodeBuilder) EnqueueNetworkInit() {
fnb.NetworkKey,
fnb.SporkID,
fnb.IdentityProvider,
&p2pconfig.MetricsConfig{
&p2pbuilderconfig.MetricsConfig{
Metrics: fnb.Metrics.Network,
HeroCacheFactory: fnb.HeroCacheMetricsFactory(),
},
Expand Down Expand Up @@ -452,22 +452,22 @@ func (fnb *FlowNodeBuilder) InitFlowNetworkWithConduitFactory(
unicastRateLimiters *ratelimit.RateLimiters,
peerManagerFilters []p2p.PeerFilter) (network.EngineRegistry, error) {

var networkOptions []p2pnet.NetworkOption
var networkOptions []underlay.NetworkOption
if len(fnb.MsgValidators) > 0 {
networkOptions = append(networkOptions, p2pnet.WithMessageValidators(fnb.MsgValidators...))
networkOptions = append(networkOptions, underlay.WithMessageValidators(fnb.MsgValidators...))
}

// by default if no rate limiter configuration was provided in the CLI args the default
// noop rate limiter will be used.
networkOptions = append(networkOptions, p2pnet.WithUnicastRateLimiters(unicastRateLimiters))
networkOptions = append(networkOptions, underlay.WithUnicastRateLimiters(unicastRateLimiters))

networkOptions = append(networkOptions,
p2pnet.WithPreferredUnicastProtocols(protocols.ToProtocolNames(fnb.FlowConfig.NetworkConfig.PreferredUnicastProtocols)...),
underlay.WithPreferredUnicastProtocols(protocols.ToProtocolNames(fnb.FlowConfig.NetworkConfig.PreferredUnicastProtocols)...),
)

// peerManagerFilters are used by the peerManager via the network to filter peers from the topology.
if len(peerManagerFilters) > 0 {
networkOptions = append(networkOptions, p2pnet.WithPeerManagerFilters(peerManagerFilters...))
networkOptions = append(networkOptions, underlay.WithPeerManagerFilters(peerManagerFilters...))
}

receiveCache := netcache.NewHeroReceiveCache(fnb.FlowConfig.NetworkConfig.NetworkReceivedMessageCacheSize,
Expand All @@ -480,7 +480,7 @@ func (fnb *FlowNodeBuilder) InitFlowNetworkWithConduitFactory(
}

// creates network instance
net, err := p2pnet.NewNetwork(&p2pnet.NetworkConfig{
net, err := underlay.NewNetwork(&underlay.NetworkConfig{
Logger: fnb.Logger,
Libp2pNode: fnb.LibP2PNode,
Codec: fnb.CodecFactory(),
Expand Down Expand Up @@ -1061,7 +1061,7 @@ func (fnb *FlowNodeBuilder) InitIDProviders() {
filter.And(
filter.HasRole(flow.RoleConsensus),
filter.Not(filter.HasNodeID(node.Me.NodeID())),
p2pnet.NotEjectedFilter,
underlay.NotEjectedFilter,
),
node.IdentityProvider,
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/onflow/flow-go/module/component"
"github.com/onflow/flow-go/module/irrecoverable"
"github.com/onflow/flow-go/module/profiler"
"github.com/onflow/flow-go/network/p2p/p2pbuilder"
p2pbuilder "github.com/onflow/flow-go/network/p2p/builder"
"github.com/onflow/flow-go/utils/unittest"
)

Expand Down
3 changes: 2 additions & 1 deletion engine/consensus/mock/proposal_provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion engine/execution/ingestion/uploader/mock/uploader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions follower/follower_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ import (
cborcodec "github.com/onflow/flow-go/network/codec/cbor"
"github.com/onflow/flow-go/network/converter"
"github.com/onflow/flow-go/network/p2p"
p2pbuilder "github.com/onflow/flow-go/network/p2p/builder"
p2pbuilderconfig "github.com/onflow/flow-go/network/p2p/builder/config"
"github.com/onflow/flow-go/network/p2p/cache"
"github.com/onflow/flow-go/network/p2p/conduit"
p2pdht "github.com/onflow/flow-go/network/p2p/dht"
"github.com/onflow/flow-go/network/p2p/keyutils"
"github.com/onflow/flow-go/network/p2p/p2pbuilder"
p2pconfig "github.com/onflow/flow-go/network/p2p/p2pbuilder/config"
"github.com/onflow/flow-go/network/p2p/p2plogging"
"github.com/onflow/flow-go/network/p2p/p2pnet"
p2plogging "github.com/onflow/flow-go/network/p2p/logging"
"github.com/onflow/flow-go/network/p2p/subscription"
"github.com/onflow/flow-go/network/p2p/translator"
"github.com/onflow/flow-go/network/p2p/unicast/protocols"
"github.com/onflow/flow-go/network/p2p/utils"
"github.com/onflow/flow-go/network/slashing"
"github.com/onflow/flow-go/network/underlay"
"github.com/onflow/flow-go/network/validator"
"github.com/onflow/flow-go/state/protocol"
badgerState "github.com/onflow/flow-go/state/protocol/badger"
Expand Down Expand Up @@ -575,7 +575,7 @@ func (builder *FollowerServiceBuilder) initPublicLibp2pNode(networkKey crypto.Pr
node, err := p2pbuilder.NewNodeBuilder(
builder.Logger,
&builder.FlowConfig.NetworkConfig.GossipSub,
&p2pconfig.MetricsConfig{
&p2pbuilderconfig.MetricsConfig{
HeroCacheFactory: builder.HeroCacheMetricsFactory(),
Metrics: builder.Metrics.Network,
},
Expand All @@ -585,12 +585,12 @@ func (builder *FollowerServiceBuilder) initPublicLibp2pNode(networkKey crypto.Pr
builder.SporkID,
builder.IdentityProvider,
&builder.FlowConfig.NetworkConfig.ResourceManager,
p2pconfig.PeerManagerDisableConfig(), // disable peer manager for follower
p2pbuilderconfig.PeerManagerDisableConfig(), // disable peer manager for follower
&p2p.DisallowListCacheConfig{
MaxSize: builder.FlowConfig.NetworkConfig.DisallowListNotificationCacheSize,
Metrics: metrics.DisallowListCacheMetricsFactory(builder.HeroCacheMetricsFactory(), network.PublicNetwork),
},
&p2pconfig.UnicastConfig{
&p2pbuilderconfig.UnicastConfig{
Unicast: builder.FlowConfig.NetworkConfig.Unicast,
}).
SetSubscriptionFilter(
Expand Down Expand Up @@ -668,7 +668,7 @@ func (builder *FollowerServiceBuilder) enqueuePublicNetworkInit() {
return nil, fmt.Errorf("could not register networking receive cache metric: %w", err)
}

net, err := p2pnet.NewNetwork(&p2pnet.NetworkConfig{
net, err := underlay.NewNetwork(&underlay.NetworkConfig{
Logger: builder.Logger.With().Str("component", "public-network").Logger(),
Codec: cborcodec.NewCodec(),
Me: builder.Me,
Expand All @@ -680,7 +680,7 @@ func (builder *FollowerServiceBuilder) enqueuePublicNetworkInit() {
ReceiveCache: receiveCache,
ConduitFactory: conduit.NewDefaultConduitFactory(),
SporkId: builder.SporkID,
UnicastMessageTimeout: p2pnet.DefaultUnicastTimeout,
UnicastMessageTimeout: underlay.DefaultUnicastTimeout,
IdentityTranslator: builder.IDTranslator,
AlspCfg: &alspmgr.MisbehaviorReportManagerConfig{
Logger: builder.Logger,
Expand All @@ -695,7 +695,7 @@ func (builder *FollowerServiceBuilder) enqueuePublicNetworkInit() {
SlashingViolationConsumerFactory: func(adapter network.ConduitAdapter) network.ViolationsConsumer {
return slashing.NewSlashingViolationsConsumer(builder.Logger, builder.Metrics.Network, adapter)
},
}, p2pnet.WithMessageValidators(publicNetworkMsgValidators(node.Logger, node.IdentityProvider, node.NodeID)...))
}, underlay.WithMessageValidators(publicNetworkMsgValidators(node.Logger, node.IdentityProvider, node.NodeID)...))
if err != nil {
return nil, fmt.Errorf("could not initialize network: %w", err)
}
Expand Down
Loading

0 comments on commit 3d8d907

Please sign in to comment.