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

Fix own enr encoding #5054

Merged
merged 1 commit into from
Jan 25, 2023
Merged

Fix own enr encoding #5054

merged 1 commit into from
Jan 25, 2023

Conversation

wemeetagain
Copy link
Member

Motivation

We update our enr as part of startup, we need to include the private key when serialize the enr to send to the worker.

@wemeetagain wemeetagain requested a review from a team as a code owner January 25, 2023 13:23
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: efa5b2a Previous: fa6b4ee Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0303 ms/op 1.0450 ms/op 0.99
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 66.383 us/op 60.696 us/op 1.09
BLS verify - blst-native 1.8617 ms/op 2.1724 ms/op 0.86
BLS verifyMultipleSignatures 3 - blst-native 3.8043 ms/op 4.4922 ms/op 0.85
BLS verifyMultipleSignatures 8 - blst-native 8.1911 ms/op 9.7122 ms/op 0.84
BLS verifyMultipleSignatures 32 - blst-native 29.745 ms/op 35.287 ms/op 0.84
BLS aggregatePubkeys 32 - blst-native 39.573 us/op 46.683 us/op 0.85
BLS aggregatePubkeys 128 - blst-native 153.85 us/op 182.18 us/op 0.84
getAttestationsForBlock 82.131 ms/op 79.064 ms/op 1.04
isKnown best case - 1 super set check 467.00 ns/op 462.00 ns/op 1.01
isKnown normal case - 2 super set checks 459.00 ns/op 446.00 ns/op 1.03
isKnown worse case - 16 super set checks 452.00 ns/op 446.00 ns/op 1.01
CheckpointStateCache - add get delete 8.1190 us/op 8.2310 us/op 0.99
validate gossip signedAggregateAndProof - struct 4.2626 ms/op 5.0189 ms/op 0.85
validate gossip attestation - struct 2.0215 ms/op 2.3590 ms/op 0.86
pickEth1Vote - no votes 2.1404 ms/op 2.2939 ms/op 0.93
pickEth1Vote - max votes 15.259 ms/op 16.114 ms/op 0.95
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.733 ms/op 13.389 ms/op 0.88
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.511 ms/op 20.257 ms/op 0.96
pickEth1Vote - Eth1Data fastSerialize value x2048 1.2060 ms/op 1.0718 ms/op 1.13
pickEth1Vote - Eth1Data fastSerialize tree x2048 8.9418 ms/op 9.3229 ms/op 0.96
bytes32 toHexString 986.00 ns/op 943.00 ns/op 1.05
bytes32 Buffer.toString(hex) 566.00 ns/op 626.00 ns/op 0.90
bytes32 Buffer.toString(hex) from Uint8Array 866.00 ns/op 1.0080 us/op 0.86
bytes32 Buffer.toString(hex) + 0x 566.00 ns/op 647.00 ns/op 0.87
Object access 1 prop 0.27700 ns/op 0.34400 ns/op 0.81
Map access 1 prop 0.25900 ns/op 0.34900 ns/op 0.74
Object get x1000 16.690 ns/op 10.775 ns/op 1.55
Map get x1000 0.98700 ns/op 0.97700 ns/op 1.01
Object set x1000 100.27 ns/op 67.121 ns/op 1.49
Map set x1000 63.067 ns/op 42.648 ns/op 1.48
Return object 10000 times 0.37080 ns/op 0.44280 ns/op 0.84
Throw Error 10000 times 6.9724 us/op 6.5008 us/op 1.07
fastMsgIdFn sha256 / 200 bytes 4.2770 us/op 4.9730 us/op 0.86
fastMsgIdFn h32 xxhash / 200 bytes 478.00 ns/op 522.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 200 bytes 624.00 ns/op 703.00 ns/op 0.89
fastMsgIdFn sha256 / 1000 bytes 13.652 us/op 15.665 us/op 0.87
fastMsgIdFn h32 xxhash / 1000 bytes 620.00 ns/op 699.00 ns/op 0.89
fastMsgIdFn h64 xxhash / 1000 bytes 691.00 ns/op 829.00 ns/op 0.83
fastMsgIdFn sha256 / 10000 bytes 117.70 us/op 137.06 us/op 0.86
fastMsgIdFn h32 xxhash / 10000 bytes 2.3250 us/op 2.6030 us/op 0.89
fastMsgIdFn h64 xxhash / 10000 bytes 1.6470 us/op 1.7770 us/op 0.93
enrSubnets - fastDeserialize 64 bits 2.2370 us/op 2.3100 us/op 0.97
enrSubnets - ssz BitVector 64 bits 794.00 ns/op 917.00 ns/op 0.87
enrSubnets - fastDeserialize 4 bits 284.00 ns/op 339.00 ns/op 0.84
enrSubnets - ssz BitVector 4 bits 789.00 ns/op 923.00 ns/op 0.85
prioritizePeers score -10:0 att 32-0.1 sync 2-0 151.45 us/op 144.16 us/op 1.05
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 207.28 us/op 162.97 us/op 1.27
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 301.86 us/op 250.38 us/op 1.21
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 507.71 us/op 439.12 us/op 1.16
prioritizePeers score 0:0 att 64-1 sync 4-1 579.62 us/op 469.98 us/op 1.23
array of 16000 items push then shift 2.8131 us/op 51.613 us/op 0.05
LinkedList of 16000 items push then shift 17.045 ns/op 12.110 ns/op 1.41
array of 16000 items push then pop 211.29 ns/op 189.52 ns/op 1.11
LinkedList of 16000 items push then pop 16.522 ns/op 12.365 ns/op 1.34
array of 24000 items push then shift 3.9524 us/op 77.385 us/op 0.05
LinkedList of 24000 items push then shift 18.767 ns/op 13.276 ns/op 1.41
array of 24000 items push then pop 210.24 ns/op 194.68 ns/op 1.08
LinkedList of 24000 items push then pop 17.362 ns/op 12.538 ns/op 1.38
intersect bitArray bitLen 8 29.702 ns/op 21.827 ns/op 1.36
intersect array and set length 8 153.47 ns/op 130.55 ns/op 1.18
intersect bitArray bitLen 128 108.69 ns/op 75.351 ns/op 1.44
intersect array and set length 128 2.1555 us/op 1.7982 us/op 1.20
Buffer.concat 32 items 5.8730 us/op 4.6490 us/op 1.26
Uint8Array.set 32 items 4.0070 us/op 3.7860 us/op 1.06
pass gossip attestations to forkchoice per slot 4.2172 ms/op 3.6760 ms/op 1.15
computeDeltas 5.6439 ms/op 4.2788 ms/op 1.32
computeProposerBoostScoreFromBalances 2.8397 ms/op 2.5094 ms/op 1.13
altair processAttestation - 250000 vs - 7PWei normalcase 3.6663 ms/op 3.6717 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 6.5206 ms/op 6.3802 ms/op 1.02
altair processAttestation - setStatus - 1/6 committees join 202.66 us/op 177.87 us/op 1.14
altair processAttestation - setStatus - 1/3 committees join 389.70 us/op 356.21 us/op 1.09
altair processAttestation - setStatus - 1/2 committees join 544.12 us/op 610.81 us/op 0.89
altair processAttestation - setStatus - 2/3 committees join 721.78 us/op 679.24 us/op 1.06
altair processAttestation - setStatus - 4/5 committees join 981.47 us/op 945.44 us/op 1.04
altair processAttestation - setStatus - 100% committees join 1.1631 ms/op 1.1423 ms/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 25.265 ms/op 23.482 ms/op 1.08
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.175 ms/op 37.548 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase 69.939 ms/op 80.416 ms/op 0.87
altair processBlock - 250000 vs - 7PWei worstcase hashState 93.959 ms/op 102.37 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 4.1357 ms/op 3.3967 ms/op 1.22
phase0 processBlock - 250000 vs - 7PWei worstcase 47.679 ms/op 51.340 ms/op 0.93
altair processEth1Data - 250000 vs - 7PWei normalcase 731.57 us/op 600.96 us/op 1.22
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 18.275 us/op 8.5710 us/op 2.13
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 53.018 us/op 23.283 us/op 2.28
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 26.986 us/op 10.968 us/op 2.46
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 17.453 us/op 8.1230 us/op 2.15
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 223.48 us/op 88.755 us/op 2.52
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.1984 ms/op 862.33 us/op 1.39
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.5663 ms/op 1.1312 ms/op 1.38
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 1.5569 ms/op 1.0941 ms/op 1.42
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 4.4303 ms/op 4.0415 ms/op 1.10
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 3.0250 ms/op 2.3591 ms/op 1.28
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 7.4042 ms/op 6.8663 ms/op 1.08
Tree 40 250000 create 611.65 ms/op 549.57 ms/op 1.11
Tree 40 250000 get(125000) 286.68 ns/op 260.59 ns/op 1.10
Tree 40 250000 set(125000) 1.9217 us/op 1.8062 us/op 1.06
Tree 40 250000 toArray() 30.433 ms/op 28.048 ms/op 1.09
Tree 40 250000 iterate all - toArray() + loop 30.598 ms/op 28.780 ms/op 1.06
Tree 40 250000 iterate all - get(i) 102.28 ms/op 103.99 ms/op 0.98
MutableVector 250000 create 14.316 ms/op 12.845 ms/op 1.11
MutableVector 250000 get(125000) 13.233 ns/op 11.210 ns/op 1.18
MutableVector 250000 set(125000) 548.75 ns/op 482.47 ns/op 1.14
MutableVector 250000 toArray() 6.4125 ms/op 5.7723 ms/op 1.11
MutableVector 250000 iterate all - toArray() + loop 6.6033 ms/op 5.9892 ms/op 1.10
MutableVector 250000 iterate all - get(i) 3.4877 ms/op 2.6602 ms/op 1.31
Array 250000 create 5.8514 ms/op 5.8448 ms/op 1.00
Array 250000 clone - spread 2.6945 ms/op 2.4158 ms/op 1.12
Array 250000 get(125000) 1.1220 ns/op 1.1740 ns/op 0.96
Array 250000 set(125000) 1.1550 ns/op 1.1760 ns/op 0.98
Array 250000 iterate all - loop 167.80 us/op 151.25 us/op 1.11
effectiveBalanceIncrements clone Uint8Array 300000 69.141 us/op 45.122 us/op 1.53
effectiveBalanceIncrements clone MutableVector 300000 814.00 ns/op 752.00 ns/op 1.08
effectiveBalanceIncrements rw all Uint8Array 300000 252.62 us/op 243.78 us/op 1.04
effectiveBalanceIncrements rw all MutableVector 300000 181.39 ms/op 155.87 ms/op 1.16
phase0 afterProcessEpoch - 250000 vs - 7PWei 184.70 ms/op 187.14 ms/op 0.99
phase0 beforeProcessEpoch - 250000 vs - 7PWei 69.189 ms/op 57.683 ms/op 1.20
altair processEpoch - mainnet_e81889 563.29 ms/op 527.77 ms/op 1.07
mainnet_e81889 - altair beforeProcessEpoch 146.20 ms/op 108.12 ms/op 1.35
mainnet_e81889 - altair processJustificationAndFinalization 26.794 us/op 18.135 us/op 1.48
mainnet_e81889 - altair processInactivityUpdates 10.734 ms/op 9.1598 ms/op 1.17
mainnet_e81889 - altair processRewardsAndPenalties 87.651 ms/op 75.319 ms/op 1.16
mainnet_e81889 - altair processRegistryUpdates 5.2740 us/op 2.7220 us/op 1.94
mainnet_e81889 - altair processSlashings 1.1070 us/op 727.00 ns/op 1.52
mainnet_e81889 - altair processEth1DataReset 1.1730 us/op 603.00 ns/op 1.95
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.5428 ms/op 1.9784 ms/op 1.29
mainnet_e81889 - altair processSlashingsReset 8.5300 us/op 3.9580 us/op 2.16
mainnet_e81889 - altair processRandaoMixesReset 10.080 us/op 4.7250 us/op 2.13
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3160 us/op 785.00 ns/op 1.68
mainnet_e81889 - altair processParticipationFlagUpdates 5.9860 us/op 2.5070 us/op 2.39
mainnet_e81889 - altair processSyncCommitteeUpdates 1.2720 us/op 702.00 ns/op 1.81
mainnet_e81889 - altair afterProcessEpoch 194.11 ms/op 196.93 ms/op 0.99
phase0 processEpoch - mainnet_e58758 510.97 ms/op 477.19 ms/op 1.07
mainnet_e58758 - phase0 beforeProcessEpoch 234.00 ms/op 173.19 ms/op 1.35
mainnet_e58758 - phase0 processJustificationAndFinalization 35.839 us/op 23.137 us/op 1.55
mainnet_e58758 - phase0 processRewardsAndPenalties 73.923 ms/op 65.580 ms/op 1.13
mainnet_e58758 - phase0 processRegistryUpdates 18.860 us/op 7.7630 us/op 2.43
mainnet_e58758 - phase0 processSlashings 1.0810 us/op 687.00 ns/op 1.57
mainnet_e58758 - phase0 processEth1DataReset 1.2430 us/op 623.00 ns/op 2.00
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.1806 ms/op 1.8621 ms/op 1.17
mainnet_e58758 - phase0 processSlashingsReset 8.6090 us/op 4.8380 us/op 1.78
mainnet_e58758 - phase0 processRandaoMixesReset 8.8950 us/op 7.0780 us/op 1.26
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.3850 us/op 845.00 ns/op 1.64
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.6730 us/op 5.0360 us/op 1.72
mainnet_e58758 - phase0 afterProcessEpoch 160.56 ms/op 162.34 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.9777 ms/op 1.9290 ms/op 1.54
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.6431 ms/op 2.2017 ms/op 1.65
altair processInactivityUpdates - 250000 normalcase 36.645 ms/op 31.729 ms/op 1.15
altair processInactivityUpdates - 250000 worstcase 44.765 ms/op 38.267 ms/op 1.17
phase0 processRegistryUpdates - 250000 normalcase 15.893 us/op 7.2350 us/op 2.20
phase0 processRegistryUpdates - 250000 badcase_full_deposits 695.93 us/op 377.38 us/op 1.84
phase0 processRegistryUpdates - 250000 worstcase 0.5 204.30 ms/op 176.27 ms/op 1.16
altair processRewardsAndPenalties - 250000 normalcase 123.56 ms/op 113.46 ms/op 1.09
altair processRewardsAndPenalties - 250000 worstcase 80.993 ms/op 72.533 ms/op 1.12
phase0 getAttestationDeltas - 250000 normalcase 12.211 ms/op 11.488 ms/op 1.06
phase0 getAttestationDeltas - 250000 worstcase 12.233 ms/op 11.776 ms/op 1.04
phase0 processSlashings - 250000 worstcase 5.5691 ms/op 5.2147 ms/op 1.07
altair processSyncCommitteeUpdates - 250000 258.04 ms/op 296.04 ms/op 0.87
BeaconState.hashTreeRoot - No change 423.00 ns/op 470.00 ns/op 0.90
BeaconState.hashTreeRoot - 1 full validator 64.325 us/op 71.432 us/op 0.90
BeaconState.hashTreeRoot - 32 full validator 552.56 us/op 653.19 us/op 0.85
BeaconState.hashTreeRoot - 512 full validator 5.9413 ms/op 6.9855 ms/op 0.85
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 68.845 us/op 97.874 us/op 0.70
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1308 ms/op 1.2437 ms/op 0.91
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.061 ms/op 16.870 ms/op 0.95
BeaconState.hashTreeRoot - 1 balances 59.834 us/op 68.888 us/op 0.87
BeaconState.hashTreeRoot - 32 balances 578.83 us/op 631.77 us/op 0.92
BeaconState.hashTreeRoot - 512 balances 5.6055 ms/op 6.1781 ms/op 0.91
BeaconState.hashTreeRoot - 250000 balances 81.046 ms/op 98.452 ms/op 0.82
aggregationBits - 2048 els - zipIndexesInBitList 29.189 us/op 24.838 us/op 1.18
regular array get 100000 times 67.323 us/op 60.552 us/op 1.11
wrappedArray get 100000 times 67.388 us/op 60.555 us/op 1.11
arrayWithProxy get 100000 times 27.822 ms/op 26.755 ms/op 1.04
ssz.Root.equals 1.0900 us/op 1.0080 us/op 1.08
byteArrayEquals 1.0840 us/op 1.0090 us/op 1.07
shuffle list - 16384 els 11.226 ms/op 11.323 ms/op 0.99
shuffle list - 250000 els 166.13 ms/op 165.79 ms/op 1.00
processSlot - 1 slots 11.235 us/op 12.474 us/op 0.90
processSlot - 32 slots 1.6581 ms/op 1.8964 ms/op 0.87
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 329.14 us/op 338.69 us/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 5.6633 ms/op 5.4366 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 7.6696 ms/op 7.9847 ms/op 0.96
getCommitteeAssignments - req 1000 vs - 250000 vc 8.1645 ms/op 8.4940 ms/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 9.6700 ns/op 8.0400 ns/op 1.20
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0880 us/op 994.09 ns/op 1.09
computeProposers - vc 250000 15.719 ms/op 17.391 ms/op 0.90
computeEpochShuffling - vc 250000 170.86 ms/op 169.31 ms/op 1.01
getNextSyncCommittee - vc 250000 257.30 ms/op 290.01 ms/op 0.89

by benchmarkbot/action

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lgtm! lodestar is synced on devnet4

@g11tech g11tech merged commit bb87b60 into unstable Jan 25, 2023
@g11tech g11tech deleted the cayman/fix-encode-own-enr branch January 25, 2023 14:31
@wemeetagain
Copy link
Member Author

🎉 This PR is included in v1.6.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.

2 participants