#387 make IPv6 subnet colocation optional as a peer score parameter

Open vyzo vyzo

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 2 of 2 files from the diff.

@@ -73,6 +73,9 @@
Loading
73 73
	IPColocationFactorThreshold int
74 74
	IPColocationFactorWhitelist map[string]struct{}
75 75
76 +
	// IPv6SubnetColocation controls whether /64 IPv6 subnets should be considered colocated.
77 +
	IPv6SubnetColocation bool
78 +
76 79
	// P7: behavioural pattern penalties.
77 80
	// This parameter has an associated counter which tracks misbehaviour as detected by the
78 81
	// router. The router currently applies penalties for the following behaviors:

@@ -976,12 +976,14 @@
Loading
976 976
			ip4 := ip.String()
977 977
			res = append(res, ip4)
978 978
		} else {
979 -
			// IPv6 address -- we add both the actual address and the /64 subnet
979 +
			// IPv6 address -- we add both the actual address and (optionally) the /64 subnet
980 980
			ip6 := ip.String()
981 981
			res = append(res, ip6)
982 982
983 -
			ip6mask := ip.Mask(net.CIDRMask(64, 128)).String()
984 -
			res = append(res, ip6mask)
983 +
			if ps.params.IPv6SubnetColocation {
984 +
				ip6mask := ip.Mask(net.CIDRMask(64, 128)).String()
985 +
				res = append(res, ip6mask)
986 +
			}
985 987
		}
986 988
	}
987 989

Learn more Showing 4 files with coverage changes found.

Changes in discovery.go
-2
+2
Loading file...
Changes in pubsub.go
-1
-6
+7
Loading file...
Changes in comm.go
-1
-1
+2
Loading file...
Changes in randomsub.go
-3
+3
Loading file...
Files Coverage
blacklist.go 91.30%
comm.go +1.89% 93.40%
discovery.go +1.18% 69.82%
floodsub.go 90.57%
gossip_tracer.go 94.05%
gossipsub.go 88.01%
mcache.go 91.49%
notify.go 80.00%
peer_gater.go 60.49%
pubsub.go +1.25% 81.67%
randomsub.go +3.57% 79.76%
score.go -0.16% 76.99%
score_params.go 97.47%
sign.go 57.89%
subscription.go 81.25%
tag_tracer.go 90.08%
topic.go 77.78%
trace.go 88.30%
tracer.go 81.43%
validation.go 90.12%
Project Totals (20 files) 82.81%
Loading