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: remove legacy static topology support #206

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions connmanager/connection_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type ConnectionManagerTag uint16
const (
ConnectionManagerTagNone ConnectionManagerTag = iota

ConnectionManagerTagHostProducer
ConnectionManagerTagHostLocalRoot
ConnectionManagerTagHostPublicRoot
ConnectionManagerTagHostBootstrapPeer
Expand All @@ -47,7 +46,6 @@ const (

func (c ConnectionManagerTag) String() string {
tmp := map[ConnectionManagerTag]string{
ConnectionManagerTagHostProducer: "HostProducer",
ConnectionManagerTagHostLocalRoot: "HostLocalRoot",
ConnectionManagerTagHostPublicRoot: "HostPublicRoot",
ConnectionManagerTagHostBootstrapPeer: "HostBootstrapPeer",
Expand Down Expand Up @@ -123,9 +121,6 @@ func (c *ConnectionManager) AddHost(
func (c *ConnectionManager) AddHostsFromTopology(
topologyConfig *topology.TopologyConfig,
) {
for _, host := range topologyConfig.Producers {
c.AddHost(host.Address, host.Port, ConnectionManagerTagHostProducer)
}
for _, bootstrapPeer := range topologyConfig.BootstrapPeers {
c.AddHost(
bootstrapPeer.Address,
Expand Down
15 changes: 0 additions & 15 deletions outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ func (n *Node) startOutboundConnections() {
"role", "client",
)
var tmpHosts []string
for _, host := range n.config.topologyConfig.Producers {
n.config.logger.Debug(
fmt.Sprintf(
"adding legacy topology host: %s:%d",
host.Address,
host.Port,
),
"component", "network",
"role", "client",
)
tmpHosts = append(
tmpHosts,
net.JoinHostPort(host.Address, strconv.Itoa(int(host.Port))),
)
}
for _, host := range n.config.topologyConfig.BootstrapPeers {
n.config.logger.Debug(
fmt.Sprintf(
Expand Down
9 changes: 0 additions & 9 deletions topology/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,12 @@ import (

// TopologyConfig represents a Cardano node topology config
type TopologyConfig struct {
Producers []TopologyConfigLegacyProducer `json:"Producers"`
LocalRoots []TopologyConfigP2PLocalRoot `json:"localRoots"`
PublicRoots []TopologyConfigP2PPublicRoot `json:"publicRoots"`
BootstrapPeers []TopologyConfigP2PBootstrapPeer `json:"bootstrapPeers"`
UseLedgerAfterSlot int64 `json:"useLedgerAfterSlot"`
}

type TopologyConfigLegacyProducer struct {
Address string `json:"addr"`
Port uint `json:"port"`
Valency uint `json:"valency"`
Continent string `json:"continent"`
State string `json:"state"`
}

type TopologyConfigP2PAccessPoint struct {
Address string `json:"address"`
Port uint `json:"port"`
Expand Down
22 changes: 0 additions & 22 deletions topology/topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ type topologyTestDefinition struct {
var topologyTests = []topologyTestDefinition{
{
jsonData: `
{
"Producers": [
{
"addr": "backbone.cardano.iog.io",
"port": 3001,
"valency": 2
}
]
}
`,
expectedObject: &topology.TopologyConfig{
Producers: []topology.TopologyConfigLegacyProducer{
{
Address: "backbone.cardano.iog.io",
Port: 3001,
Valency: 2,
},
},
},
},
{
jsonData: `
{
"localRoots": [
{
Expand Down