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: add IPv6 support #5758

Merged
merged 5 commits into from
Jul 17, 2023
Merged

feat: add IPv6 support #5758

merged 5 commits into from
Jul 17, 2023

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Jul 14, 2023

Motivation

Description

  • Update discv5 to v5.0.0 (which includes IPv6 support)
  • Add new CLI args --listenAddress6, --port6, --discoveryPort6
    • port6 and discoveryPort6 follow the same behavior as port and discoveryPort
    • default port6 is 9090
    • If neither listenAddress nor listenAddress6 is set, a default listenAddress will be used
    • Else, if a listenAddress or listenAddress6 is set explicitly, only those that are set will be used
    • Eg: --port 9090 - listen on IPv4 on port 9090 for both libp2p and discv5 connections, no IPv6
    • Eg: --listenAddress6 :: --port6 9000 - listen on IPv6 on port 9000 for both libp2p and discv5 connections, no IPv4
    • Eg: --listenAddress 0.0.0.0 --listenAddress6 :: - listen on IPv4 on port 9000, IPv6 on port 9090 for both libp2p and discv5 connections

@wemeetagain wemeetagain requested a review from a team as a code owner July 14, 2023 15:19
@github-actions
Copy link
Contributor

github-actions bot commented Jul 14, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: ff8272d Previous: 6e01421 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 855.66 us/op 652.22 us/op 1.31
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 72.767 us/op 74.123 us/op 0.98
BLS verify - blst-native 1.1753 ms/op 1.2045 ms/op 0.98
BLS verifyMultipleSignatures 3 - blst-native 2.3859 ms/op 2.4525 ms/op 0.97
BLS verifyMultipleSignatures 8 - blst-native 5.1385 ms/op 5.2652 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst-native 18.549 ms/op 19.002 ms/op 0.98
BLS aggregatePubkeys 32 - blst-native 24.495 us/op 25.125 us/op 0.97
BLS aggregatePubkeys 128 - blst-native 96.578 us/op 98.857 us/op 0.98
getAttestationsForBlock 60.368 ms/op 48.751 ms/op 1.24
isKnown best case - 1 super set check 287.00 ns/op 267.00 ns/op 1.07
isKnown normal case - 2 super set checks 263.00 ns/op 257.00 ns/op 1.02
isKnown worse case - 16 super set checks 266.00 ns/op 263.00 ns/op 1.01
CheckpointStateCache - add get delete 4.9340 us/op 4.8350 us/op 1.02
validate api signedAggregateAndProof - struct 2.7621 ms/op 2.7469 ms/op 1.01
validate gossip signedAggregateAndProof - struct 2.8378 ms/op 2.7428 ms/op 1.03
validate api attestation - struct 1.2697 ms/op 1.3117 ms/op 0.97
validate gossip attestation - struct 1.2919 ms/op 1.3332 ms/op 0.97
pickEth1Vote - no votes 1.1047 ms/op 1.2108 ms/op 0.91
pickEth1Vote - max votes 11.243 ms/op 9.1569 ms/op 1.23
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.4025 ms/op 8.2440 ms/op 1.02
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 16.719 ms/op 14.288 ms/op 1.17
pickEth1Vote - Eth1Data fastSerialize value x2048 567.13 us/op 557.53 us/op 1.02
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.7019 ms/op 6.5285 ms/op 1.03
bytes32 toHexString 459.00 ns/op 467.00 ns/op 0.98
bytes32 Buffer.toString(hex) 286.00 ns/op 280.00 ns/op 1.02
bytes32 Buffer.toString(hex) from Uint8Array 433.00 ns/op 404.00 ns/op 1.07
bytes32 Buffer.toString(hex) + 0x 285.00 ns/op 277.00 ns/op 1.03
Object access 1 prop 0.15500 ns/op 0.14700 ns/op 1.05
Map access 1 prop 0.14600 ns/op 0.14000 ns/op 1.04
Object get x1000 7.5710 ns/op 7.0520 ns/op 1.07
Map get x1000 0.49200 ns/op 0.60500 ns/op 0.81
Object set x1000 47.230 ns/op 48.287 ns/op 0.98
Map set x1000 37.614 ns/op 37.970 ns/op 0.99
Return object 10000 times 0.23350 ns/op 0.23260 ns/op 1.00
Throw Error 10000 times 3.7492 us/op 3.7027 us/op 1.01
fastMsgIdFn sha256 / 200 bytes 3.2170 us/op 3.2180 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 261.00 ns/op 271.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 200 bytes 321.00 ns/op 340.00 ns/op 0.94
fastMsgIdFn sha256 / 1000 bytes 11.298 us/op 11.169 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 387.00 ns/op 396.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 1000 bytes 410.00 ns/op 407.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 102.94 us/op 102.56 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 1.8910 us/op 1.9420 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 1.3100 us/op 1.3450 us/op 0.97
enrSubnets - fastDeserialize 64 bits 1.1770 us/op 1.2200 us/op 0.96
enrSubnets - ssz BitVector 64 bits 403.00 ns/op 415.00 ns/op 0.97
enrSubnets - fastDeserialize 4 bits 167.00 ns/op 164.00 ns/op 1.02
enrSubnets - ssz BitVector 4 bits 408.00 ns/op 421.00 ns/op 0.97
prioritizePeers score -10:0 att 32-0.1 sync 2-0 97.386 us/op 100.61 us/op 0.97
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 117.64 us/op 131.93 us/op 0.89
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 155.62 us/op 159.08 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 278.01 us/op 292.49 us/op 0.95
prioritizePeers score 0:0 att 64-1 sync 4-1 327.99 us/op 337.57 us/op 0.97
array of 16000 items push then shift 1.5648 us/op 1.5696 us/op 1.00
LinkedList of 16000 items push then shift 9.1480 ns/op 8.8210 ns/op 1.04
array of 16000 items push then pop 62.921 ns/op 54.518 ns/op 1.15
LinkedList of 16000 items push then pop 8.9850 ns/op 8.6120 ns/op 1.04
array of 24000 items push then shift 2.4209 us/op 2.3856 us/op 1.01
LinkedList of 24000 items push then shift 8.8140 ns/op 8.8540 ns/op 1.00
array of 24000 items push then pop 96.017 ns/op 106.33 ns/op 0.90
LinkedList of 24000 items push then pop 8.5750 ns/op 8.5800 ns/op 1.00
intersect bitArray bitLen 8 6.7610 ns/op 6.7930 ns/op 1.00
intersect array and set length 8 53.977 ns/op 57.797 ns/op 0.93
intersect bitArray bitLen 128 31.895 ns/op 31.841 ns/op 1.00
intersect array and set length 128 744.91 ns/op 791.07 ns/op 0.94
bitArray.getTrueBitIndexes() bitLen 128 1.3730 us/op 1.5600 us/op 0.88
bitArray.getTrueBitIndexes() bitLen 248 2.3130 us/op 2.4520 us/op 0.94
bitArray.getTrueBitIndexes() bitLen 512 4.5570 us/op 4.7240 us/op 0.96
Buffer.concat 32 items 922.00 ns/op 945.00 ns/op 0.98
Uint8Array.set 32 items 2.3950 us/op 1.4790 us/op 1.62
transfer serialized Status (84 B) 1.7910 us/op 1.7500 us/op 1.02
copy serialized Status (84 B) 1.4550 us/op 1.3970 us/op 1.04
transfer serialized SignedVoluntaryExit (112 B) 1.7950 us/op 1.8750 us/op 0.96
copy serialized SignedVoluntaryExit (112 B) 1.4290 us/op 1.5550 us/op 0.92
transfer serialized ProposerSlashing (416 B) 2.7840 us/op 2.1250 us/op 1.31
copy serialized ProposerSlashing (416 B) 2.8900 us/op 2.2360 us/op 1.29
transfer serialized Attestation (485 B) 2.8380 us/op 2.4290 us/op 1.17
copy serialized Attestation (485 B) 2.9860 us/op 1.9910 us/op 1.50
transfer serialized AttesterSlashing (33232 B) 2.6750 us/op 2.2070 us/op 1.21
copy serialized AttesterSlashing (33232 B) 5.2170 us/op 5.1570 us/op 1.01
transfer serialized Small SignedBeaconBlock (128000 B) 2.9100 us/op 2.4120 us/op 1.21
copy serialized Small SignedBeaconBlock (128000 B) 12.126 us/op 14.344 us/op 0.85
transfer serialized Avg SignedBeaconBlock (200000 B) 3.1550 us/op 2.7900 us/op 1.13
copy serialized Avg SignedBeaconBlock (200000 B) 17.137 us/op 23.344 us/op 0.73
transfer serialized BlobsSidecar (524380 B) 2.6680 us/op 2.8430 us/op 0.94
copy serialized BlobsSidecar (524380 B) 119.04 us/op 102.29 us/op 1.16
transfer serialized Big SignedBeaconBlock (1000000 B) 2.7890 us/op 2.9910 us/op 0.93
copy serialized Big SignedBeaconBlock (1000000 B) 171.22 us/op 232.60 us/op 0.74
pass gossip attestations to forkchoice per slot 2.0847 ms/op 2.2115 ms/op 0.94
forkChoice updateHead vc 100000 bc 64 eq 0 2.0117 ms/op 2.1222 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 0 10.813 ms/op 13.766 ms/op 0.79
forkChoice updateHead vc 1000000 bc 64 eq 0 18.198 ms/op 22.556 ms/op 0.81
forkChoice updateHead vc 600000 bc 320 eq 0 15.979 ms/op 16.417 ms/op 0.97
forkChoice updateHead vc 600000 bc 1200 eq 0 80.086 ms/op 83.260 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 1000 18.216 ms/op 22.124 ms/op 0.82
forkChoice updateHead vc 600000 bc 64 eq 10000 20.203 ms/op 22.166 ms/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 300000 26.325 ms/op 27.868 ms/op 0.94
computeDeltas 2.9561 ms/op 2.8780 ms/op 1.03
computeProposerBoostScoreFromBalances 374.90 us/op 380.56 us/op 0.99
altair processAttestation - 250000 vs - 7PWei normalcase 2.0903 ms/op 2.0618 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei worstcase 3.1990 ms/op 3.0506 ms/op 1.05
altair processAttestation - setStatus - 1/6 committees join 228.45 us/op 142.41 us/op 1.60
altair processAttestation - setStatus - 1/3 committees join 396.26 us/op 273.55 us/op 1.45
altair processAttestation - setStatus - 1/2 committees join 551.73 us/op 379.41 us/op 1.45
altair processAttestation - setStatus - 2/3 committees join 713.35 us/op 465.39 us/op 1.53
altair processAttestation - setStatus - 4/5 committees join 948.47 us/op 644.04 us/op 1.47
altair processAttestation - setStatus - 100% committees join 1.1081 ms/op 758.84 us/op 1.46
altair processBlock - 250000 vs - 7PWei normalcase 9.1049 ms/op 9.3901 ms/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase hashState 16.581 ms/op 16.629 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase 39.202 ms/op 38.766 ms/op 1.01
altair processBlock - 250000 vs - 7PWei worstcase hashState 59.881 ms/op 56.587 ms/op 1.06
phase0 processBlock - 250000 vs - 7PWei normalcase 1.8636 ms/op 2.2972 ms/op 0.81
phase0 processBlock - 250000 vs - 7PWei worstcase 28.486 ms/op 29.358 ms/op 0.97
altair processEth1Data - 250000 vs - 7PWei normalcase 493.83 us/op 468.77 us/op 1.05
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 17.835 us/op 11.169 us/op 1.60
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 82.386 us/op 59.652 us/op 1.38
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 32.112 us/op 14.339 us/op 2.24
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 19.132 us/op 13.115 us/op 1.46
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 288.92 us/op 133.65 us/op 2.16
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.2756 ms/op 1.0737 ms/op 2.12
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.9886 ms/op 1.4620 ms/op 2.04
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.7190 ms/op 1.4388 ms/op 1.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.4236 ms/op 3.1555 ms/op 1.08
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.3863 ms/op 2.3279 ms/op 1.45
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.7698 ms/op 4.9582 ms/op 0.96
Tree 40 250000 create 319.87 ms/op 327.90 ms/op 0.98
Tree 40 250000 get(125000) 181.37 ns/op 188.38 ns/op 0.96
Tree 40 250000 set(125000) 834.64 ns/op 835.14 ns/op 1.00
Tree 40 250000 toArray() 16.386 ms/op 16.408 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 16.482 ms/op 16.446 ms/op 1.00
Tree 40 250000 iterate all - get(i) 64.563 ms/op 62.575 ms/op 1.03
MutableVector 250000 create 13.804 ms/op 11.085 ms/op 1.25
MutableVector 250000 get(125000) 6.5660 ns/op 6.4680 ns/op 1.02
MutableVector 250000 set(125000) 256.68 ns/op 249.45 ns/op 1.03
MutableVector 250000 toArray() 3.4883 ms/op 2.9617 ms/op 1.18
MutableVector 250000 iterate all - toArray() + loop 3.3748 ms/op 3.0459 ms/op 1.11
MutableVector 250000 iterate all - get(i) 1.4966 ms/op 1.5269 ms/op 0.98
Array 250000 create 3.2192 ms/op 2.6680 ms/op 1.21
Array 250000 clone - spread 1.2708 ms/op 1.1489 ms/op 1.11
Array 250000 get(125000) 0.60200 ns/op 0.57500 ns/op 1.05
Array 250000 set(125000) 0.66800 ns/op 0.64500 ns/op 1.04
Array 250000 iterate all - loop 105.49 us/op 83.787 us/op 1.26
effectiveBalanceIncrements clone Uint8Array 300000 29.082 us/op 26.007 us/op 1.12
effectiveBalanceIncrements clone MutableVector 300000 380.00 ns/op 345.00 ns/op 1.10
effectiveBalanceIncrements rw all Uint8Array 300000 172.30 us/op 177.80 us/op 0.97
effectiveBalanceIncrements rw all MutableVector 300000 77.901 ms/op 80.586 ms/op 0.97
phase0 afterProcessEpoch - 250000 vs - 7PWei 108.99 ms/op 110.92 ms/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 39.445 ms/op 31.153 ms/op 1.27
altair processEpoch - mainnet_e81889 358.17 ms/op 295.56 ms/op 1.21
mainnet_e81889 - altair beforeProcessEpoch 61.569 ms/op 59.742 ms/op 1.03
mainnet_e81889 - altair processJustificationAndFinalization 13.337 us/op 13.026 us/op 1.02
mainnet_e81889 - altair processInactivityUpdates 5.5636 ms/op 5.1633 ms/op 1.08
mainnet_e81889 - altair processRewardsAndPenalties 79.591 ms/op 49.518 ms/op 1.61
mainnet_e81889 - altair processRegistryUpdates 3.7410 us/op 2.3600 us/op 1.59
mainnet_e81889 - altair processSlashings 659.00 ns/op 453.00 ns/op 1.45
mainnet_e81889 - altair processEth1DataReset 811.00 ns/op 494.00 ns/op 1.64
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.3786 ms/op 1.1966 ms/op 1.99
mainnet_e81889 - altair processSlashingsReset 4.4850 us/op 2.6520 us/op 1.69
mainnet_e81889 - altair processRandaoMixesReset 8.2110 us/op 3.8570 us/op 2.13
mainnet_e81889 - altair processHistoricalRootsUpdate 1.1090 us/op 681.00 ns/op 1.63
mainnet_e81889 - altair processParticipationFlagUpdates 2.9610 us/op 2.0210 us/op 1.47
mainnet_e81889 - altair processSyncCommitteeUpdates 1.3830 us/op 648.00 ns/op 2.13
mainnet_e81889 - altair afterProcessEpoch 123.58 ms/op 124.92 ms/op 0.99
phase0 processEpoch - mainnet_e58758 390.82 ms/op 362.68 ms/op 1.08
mainnet_e58758 - phase0 beforeProcessEpoch 145.87 ms/op 139.08 ms/op 1.05
mainnet_e58758 - phase0 processJustificationAndFinalization 21.377 us/op 14.776 us/op 1.45
mainnet_e58758 - phase0 processRewardsAndPenalties 80.102 ms/op 66.698 ms/op 1.20
mainnet_e58758 - phase0 processRegistryUpdates 16.501 us/op 8.8800 us/op 1.86
mainnet_e58758 - phase0 processSlashings 769.00 ns/op 505.00 ns/op 1.52
mainnet_e58758 - phase0 processEth1DataReset 729.00 ns/op 402.00 ns/op 1.81
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.9638 ms/op 1.3037 ms/op 1.51
mainnet_e58758 - phase0 processSlashingsReset 3.4020 us/op 1.9940 us/op 1.71
mainnet_e58758 - phase0 processRandaoMixesReset 6.0760 us/op 4.3270 us/op 1.40
mainnet_e58758 - phase0 processHistoricalRootsUpdate 743.00 ns/op 572.00 ns/op 1.30
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.0530 us/op 3.4000 us/op 1.78
mainnet_e58758 - phase0 afterProcessEpoch 93.506 ms/op 96.121 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1221 ms/op 1.2052 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3712 ms/op 1.3912 ms/op 0.99
altair processInactivityUpdates - 250000 normalcase 26.744 ms/op 24.901 ms/op 1.07
altair processInactivityUpdates - 250000 worstcase 27.518 ms/op 23.847 ms/op 1.15
phase0 processRegistryUpdates - 250000 normalcase 12.681 us/op 9.3880 us/op 1.35
phase0 processRegistryUpdates - 250000 badcase_full_deposits 608.94 us/op 316.62 us/op 1.92
phase0 processRegistryUpdates - 250000 worstcase 0.5 137.04 ms/op 123.38 ms/op 1.11
altair processRewardsAndPenalties - 250000 normalcase 84.485 ms/op 72.726 ms/op 1.16
altair processRewardsAndPenalties - 250000 worstcase 82.388 ms/op 71.776 ms/op 1.15
phase0 getAttestationDeltas - 250000 normalcase 7.4435 ms/op 7.7874 ms/op 0.96
phase0 getAttestationDeltas - 250000 worstcase 7.5865 ms/op 7.6466 ms/op 0.99
phase0 processSlashings - 250000 worstcase 2.2988 ms/op 2.0686 ms/op 1.11
altair processSyncCommitteeUpdates - 250000 154.41 ms/op 148.71 ms/op 1.04
BeaconState.hashTreeRoot - No change 267.00 ns/op 246.00 ns/op 1.09
BeaconState.hashTreeRoot - 1 full validator 47.423 us/op 50.136 us/op 0.95
BeaconState.hashTreeRoot - 32 full validator 485.87 us/op 531.64 us/op 0.91
BeaconState.hashTreeRoot - 512 full validator 5.0734 ms/op 5.4817 ms/op 0.93
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 60.135 us/op 61.948 us/op 0.97
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 822.94 us/op 860.58 us/op 0.96
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 10.384 ms/op 11.686 ms/op 0.89
BeaconState.hashTreeRoot - 1 balances 47.195 us/op 47.855 us/op 0.99
BeaconState.hashTreeRoot - 32 balances 420.51 us/op 433.91 us/op 0.97
BeaconState.hashTreeRoot - 512 balances 3.6896 ms/op 4.4507 ms/op 0.83
BeaconState.hashTreeRoot - 250000 balances 76.587 ms/op 75.245 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 14.299 us/op 14.088 us/op 1.01
regular array get 100000 times 40.833 us/op 32.735 us/op 1.25
wrappedArray get 100000 times 31.206 us/op 32.698 us/op 0.95
arrayWithProxy get 100000 times 13.942 ms/op 14.898 ms/op 0.94
ssz.Root.equals 188.00 ns/op 220.00 ns/op 0.85
byteArrayEquals 189.00 ns/op 198.00 ns/op 0.95
shuffle list - 16384 els 6.8984 ms/op 6.7058 ms/op 1.03
shuffle list - 250000 els 101.54 ms/op 98.984 ms/op 1.03
processSlot - 1 slots 7.7130 us/op 8.9580 us/op 0.86
processSlot - 32 slots 1.2767 ms/op 1.2655 ms/op 1.01
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 62.504 ms/op 57.036 ms/op 1.10
getCommitteeAssignments - req 1 vs - 250000 vc 2.5548 ms/op 2.5007 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 3.7071 ms/op 3.6750 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0427 ms/op 3.9822 ms/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.8200 ns/op 4.4600 ns/op 1.08
state getBlockRootAtSlot - 250000 vs - 7PWei 777.64 ns/op 716.50 ns/op 1.09
computeProposers - vc 250000 9.3076 ms/op 8.8590 ms/op 1.05
computeEpochShuffling - vc 250000 105.71 ms/op 100.52 ms/op 1.05
getNextSyncCommittee - vc 250000 157.52 ms/op 144.42 ms/op 1.09
computeSigningRoot for AttestationData 13.826 us/op 12.645 us/op 1.09
hash AttestationData serialized data then Buffer.toString(base64) 2.3391 us/op 2.2222 us/op 1.05
toHexString serialized data 1.0220 us/op 1.0284 us/op 0.99
Buffer.toString(base64) 218.41 ns/op 210.22 ns/op 1.04

by benchmarkbot/action

"port6",
"discoveryPort6",
] as (keyof typeof muArgs)[]) {
validateMultiaddrArg(muArgs, key);
Copy link
Member Author

Choose a reason for hiding this comment

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

this allows us to fail fast if the user sets an incorrect ip address or port
eg: --listenAddress :: and --listenAddress6 0.0.0.0 should error

@@ -63,7 +120,7 @@ export function parseArgs(args: NetworkArgs): IBeaconNodeOptions["network"] {
: null,
maxPeers: maxPeers ?? defaultOptions.network.maxPeers,
targetPeers: targetPeers ?? defaultOptions.network.targetPeers,
localMultiaddrs: [`/ip4/${listenAddress}/tcp/${tcpPort}`],
localMultiaddrs: [localMu, localMu6].filter(Boolean) as string[],
Copy link
Member Author

Choose a reason for hiding this comment

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

libp2p was already configured to listen to an array of multiaddrs.
So nothing further than passing both multiaddrs here needs to be done.

Comment on lines +51 to +54
bindAddrs: {
ip4: (workerData.bindAddrs.ip4 ? multiaddr(workerData.bindAddrs.ip4) : undefined) as Multiaddr,
ip6: workerData.bindAddrs.ip6 ? multiaddr(workerData.bindAddrs.ip6) : undefined,
},
Copy link
Member Author

Choose a reason for hiding this comment

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

discv5 5.0.0 now requires bindAddrs to be passed in like so.
So we thread this through to the cli layer.

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for comments and outlining configuration options, behavior sounds good to me

@wemeetagain wemeetagain merged commit ec81531 into unstable Jul 17, 2023
@wemeetagain wemeetagain deleted the cayman/ip6 branch July 17, 2023 13:31
twoeths pushed a commit that referenced this pull request Jul 18, 2023
* feat: add IPv6 support

* fix: ip -> ip4

* fix: add parens

* fix: update cli flag descriptions
@wemeetagain
Copy link
Member Author

🎉 This PR is included in v1.10.0 🎉

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.

Feature: IPv6 support
3 participants