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 the formatting of blockValue in the validator proposer logs #5385

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Apr 19, 2023

Since the blockvalue is most < 1 eth, current display of blockvalue in eth logs as zero because of bigint arithmetic

image

This PR fixes the formatting so that the above would now be displayed as 0.10379 upto 5 decimal places

@g11tech g11tech requested a review from a team as a code owner April 19, 2023 06:59
@github-actions
Copy link
Contributor

github-actions bot commented Apr 19, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 71082e8 Previous: 3ee1d8a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 621.36 us/op 658.68 us/op 0.94
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 73.477 us/op 73.017 us/op 1.01
BLS verify - blst-native 1.3557 ms/op 1.5452 ms/op 0.88
BLS verifyMultipleSignatures 3 - blst-native 2.7201 ms/op 2.8105 ms/op 0.97
BLS verifyMultipleSignatures 8 - blst-native 6.1356 ms/op 6.1640 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 23.432 ms/op 21.703 ms/op 1.08
BLS aggregatePubkeys 32 - blst-native 30.924 us/op 31.925 us/op 0.97
BLS aggregatePubkeys 128 - blst-native 114.92 us/op 123.56 us/op 0.93
getAttestationsForBlock 90.490 ms/op 85.264 ms/op 1.06
isKnown best case - 1 super set check 301.00 ns/op 360.00 ns/op 0.84
isKnown normal case - 2 super set checks 289.00 ns/op 315.00 ns/op 0.92
isKnown worse case - 16 super set checks 300.00 ns/op 287.00 ns/op 1.05
CheckpointStateCache - add get delete 6.8040 us/op 6.6350 us/op 1.03
validate gossip signedAggregateAndProof - struct 3.1312 ms/op 3.0157 ms/op 1.04
validate gossip attestation - struct 1.5467 ms/op 1.4512 ms/op 1.07
pickEth1Vote - no votes 1.5591 ms/op 1.7514 ms/op 0.89
pickEth1Vote - max votes 14.839 ms/op 18.516 ms/op 0.80
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.054 ms/op 11.406 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.893 ms/op 23.227 ms/op 0.94
pickEth1Vote - Eth1Data fastSerialize value x2048 1.1105 ms/op 883.92 us/op 1.26
pickEth1Vote - Eth1Data fastSerialize tree x2048 9.3437 ms/op 7.1139 ms/op 1.31
bytes32 toHexString 898.00 ns/op 1.1280 us/op 0.80
bytes32 Buffer.toString(hex) 484.00 ns/op 802.00 ns/op 0.60
bytes32 Buffer.toString(hex) from Uint8Array 686.00 ns/op 1.0850 us/op 0.63
bytes32 Buffer.toString(hex) + 0x 486.00 ns/op 701.00 ns/op 0.69
Object access 1 prop 0.23700 ns/op 0.33300 ns/op 0.71
Map access 1 prop 0.18400 ns/op 0.20900 ns/op 0.88
Object get x1000 11.140 ns/op 9.8060 ns/op 1.14
Map get x1000 0.86600 ns/op 0.66600 ns/op 1.30
Object set x1000 90.331 ns/op 93.298 ns/op 0.97
Map set x1000 65.626 ns/op 69.989 ns/op 0.94
Return object 10000 times 0.35730 ns/op 0.41070 ns/op 0.87
Throw Error 10000 times 5.3533 us/op 5.7164 us/op 0.94
fastMsgIdFn sha256 / 200 bytes 4.3660 us/op 4.1650 us/op 1.05
fastMsgIdFn h32 xxhash / 200 bytes 383.00 ns/op 343.00 ns/op 1.12
fastMsgIdFn h64 xxhash / 200 bytes 531.00 ns/op 564.00 ns/op 0.94
fastMsgIdFn sha256 / 1000 bytes 12.761 us/op 13.297 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 498.00 ns/op 623.00 ns/op 0.80
fastMsgIdFn h64 xxhash / 1000 bytes 653.00 ns/op 633.00 ns/op 1.03
fastMsgIdFn sha256 / 10000 bytes 112.72 us/op 112.08 us/op 1.01
fastMsgIdFn h32 xxhash / 10000 bytes 2.1180 us/op 2.7800 us/op 0.76
fastMsgIdFn h64 xxhash / 10000 bytes 1.6970 us/op 1.9700 us/op 0.86
enrSubnets - fastDeserialize 64 bits 2.4180 us/op 2.3290 us/op 1.04
enrSubnets - ssz BitVector 64 bits 666.00 ns/op 754.00 ns/op 0.88
enrSubnets - fastDeserialize 4 bits 247.00 ns/op 236.00 ns/op 1.05
enrSubnets - ssz BitVector 4 bits 700.00 ns/op 709.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 162.54 us/op 148.69 us/op 1.09
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 190.46 us/op 166.32 us/op 1.15
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 324.60 us/op 216.13 us/op 1.50
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 451.21 us/op 369.81 us/op 1.22
prioritizePeers score 0:0 att 64-1 sync 4-1 502.58 us/op 436.28 us/op 1.15
array of 16000 items push then shift 2.2789 us/op 1.7603 us/op 1.29
LinkedList of 16000 items push then shift 13.374 ns/op 9.5160 ns/op 1.41
array of 16000 items push then pop 124.87 ns/op 107.72 ns/op 1.16
LinkedList of 16000 items push then pop 11.862 ns/op 10.069 ns/op 1.18
array of 24000 items push then shift 3.4008 us/op 2.5173 us/op 1.35
LinkedList of 24000 items push then shift 12.635 ns/op 9.7060 ns/op 1.30
array of 24000 items push then pop 94.401 ns/op 97.529 ns/op 0.97
LinkedList of 24000 items push then pop 13.928 ns/op 9.4600 ns/op 1.47
intersect bitArray bitLen 8 21.269 ns/op 14.163 ns/op 1.50
intersect array and set length 8 127.25 ns/op 95.880 ns/op 1.33
intersect bitArray bitLen 128 66.068 ns/op 46.131 ns/op 1.43
intersect array and set length 128 1.5988 us/op 1.1444 us/op 1.40
Buffer.concat 32 items 3.7820 us/op 2.8990 us/op 1.30
Uint8Array.set 32 items 3.5260 us/op 2.3900 us/op 1.48
pass gossip attestations to forkchoice per slot 4.1866 ms/op 3.4208 ms/op 1.22
computeDeltas 4.9586 ms/op 3.1559 ms/op 1.57
computeProposerBoostScoreFromBalances 2.3874 ms/op 1.8256 ms/op 1.31
altair processAttestation - 250000 vs - 7PWei normalcase 4.0904 ms/op 2.5118 ms/op 1.63
altair processAttestation - 250000 vs - 7PWei worstcase 6.6378 ms/op 3.3563 ms/op 1.98
altair processAttestation - setStatus - 1/6 committees join 178.31 us/op 143.01 us/op 1.25
altair processAttestation - setStatus - 1/3 committees join 316.50 us/op 290.01 us/op 1.09
altair processAttestation - setStatus - 1/2 committees join 381.23 us/op 387.47 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 524.35 us/op 481.20 us/op 1.09
altair processAttestation - setStatus - 4/5 committees join 687.62 us/op 661.15 us/op 1.04
altair processAttestation - setStatus - 100% committees join 1.0535 ms/op 786.94 us/op 1.34
altair processBlock - 250000 vs - 7PWei normalcase 23.422 ms/op 20.485 ms/op 1.14
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.919 ms/op 27.502 ms/op 1.23
altair processBlock - 250000 vs - 7PWei worstcase 69.200 ms/op 55.693 ms/op 1.24
altair processBlock - 250000 vs - 7PWei worstcase hashState 92.907 ms/op 69.902 ms/op 1.33
phase0 processBlock - 250000 vs - 7PWei normalcase 3.4635 ms/op 2.3265 ms/op 1.49
phase0 processBlock - 250000 vs - 7PWei worstcase 35.957 ms/op 31.828 ms/op 1.13
altair processEth1Data - 250000 vs - 7PWei normalcase 784.32 us/op 643.56 us/op 1.22
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 14.771 us/op 11.807 us/op 1.25
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 39.012 us/op 33.290 us/op 1.17
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 18.472 us/op 16.163 us/op 1.14
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 14.476 us/op 13.454 us/op 1.08
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 128.81 us/op 112.14 us/op 1.15
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.1615 ms/op 686.20 us/op 1.69
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.5687 ms/op 923.55 us/op 1.70
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 1.6425 ms/op 920.37 us/op 1.78
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 4.4713 ms/op 2.4680 ms/op 1.81
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 2.5368 ms/op 1.7702 ms/op 1.43
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 6.0399 ms/op 4.1512 ms/op 1.45
Tree 40 250000 create 721.78 ms/op 350.82 ms/op 2.06
Tree 40 250000 get(125000) 265.00 ns/op 197.48 ns/op 1.34
Tree 40 250000 set(125000) 2.0458 us/op 1.0060 us/op 2.03
Tree 40 250000 toArray() 28.963 ms/op 23.063 ms/op 1.26
Tree 40 250000 iterate all - toArray() + loop 26.538 ms/op 22.446 ms/op 1.18
Tree 40 250000 iterate all - get(i) 85.772 ms/op 77.085 ms/op 1.11
MutableVector 250000 create 14.015 ms/op 13.378 ms/op 1.05
MutableVector 250000 get(125000) 7.6500 ns/op 6.7980 ns/op 1.13
MutableVector 250000 set(125000) 581.63 ns/op 347.93 ns/op 1.67
MutableVector 250000 toArray() 4.6298 ms/op 4.2729 ms/op 1.08
MutableVector 250000 iterate all - toArray() + loop 5.2006 ms/op 4.8280 ms/op 1.08
MutableVector 250000 iterate all - get(i) 1.9886 ms/op 1.5993 ms/op 1.24
Array 250000 create 4.4853 ms/op 4.3121 ms/op 1.04
Array 250000 clone - spread 3.5746 ms/op 1.3026 ms/op 2.74
Array 250000 get(125000) 2.1780 ns/op 0.94600 ns/op 2.30
Array 250000 set(125000) 2.1950 ns/op 0.80300 ns/op 2.73
Array 250000 iterate all - loop 150.82 us/op 92.943 us/op 1.62
effectiveBalanceIncrements clone Uint8Array 300000 70.933 us/op 57.871 us/op 1.23
effectiveBalanceIncrements clone MutableVector 300000 829.00 ns/op 373.00 ns/op 2.22
effectiveBalanceIncrements rw all Uint8Array 300000 214.43 us/op 176.43 us/op 1.22
effectiveBalanceIncrements rw all MutableVector 300000 192.58 ms/op 101.66 ms/op 1.89
phase0 afterProcessEpoch - 250000 vs - 7PWei 139.53 ms/op 123.76 ms/op 1.13
phase0 beforeProcessEpoch - 250000 vs - 7PWei 46.423 ms/op 49.524 ms/op 0.94
altair processEpoch - mainnet_e81889 416.81 ms/op 425.54 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 86.229 ms/op 81.422 ms/op 1.06
mainnet_e81889 - altair processJustificationAndFinalization 32.027 us/op 29.781 us/op 1.08
mainnet_e81889 - altair processInactivityUpdates 8.9378 ms/op 8.2146 ms/op 1.09
mainnet_e81889 - altair processRewardsAndPenalties 84.715 ms/op 71.095 ms/op 1.19
mainnet_e81889 - altair processRegistryUpdates 5.6870 us/op 7.1270 us/op 0.80
mainnet_e81889 - altair processSlashings 1.6410 us/op 1.4090 us/op 1.16
mainnet_e81889 - altair processEth1DataReset 1.6110 us/op 1.3950 us/op 1.15
mainnet_e81889 - altair processEffectiveBalanceUpdates 5.4767 ms/op 1.5164 ms/op 3.61
mainnet_e81889 - altair processSlashingsReset 11.675 us/op 7.1660 us/op 1.63
mainnet_e81889 - altair processRandaoMixesReset 11.716 us/op 6.7130 us/op 1.75
mainnet_e81889 - altair processHistoricalRootsUpdate 1.8360 us/op 1.9990 us/op 0.92
mainnet_e81889 - altair processParticipationFlagUpdates 7.3020 us/op 6.1730 us/op 1.18
mainnet_e81889 - altair processSyncCommitteeUpdates 1.6550 us/op 1.4880 us/op 1.11
mainnet_e81889 - altair afterProcessEpoch 144.05 ms/op 149.70 ms/op 0.96
phase0 processEpoch - mainnet_e58758 446.83 ms/op 444.69 ms/op 1.00
mainnet_e58758 - phase0 beforeProcessEpoch 181.13 ms/op 134.90 ms/op 1.34
mainnet_e58758 - phase0 processJustificationAndFinalization 35.915 us/op 27.476 us/op 1.31
mainnet_e58758 - phase0 processRewardsAndPenalties 67.800 ms/op 70.699 ms/op 0.96
mainnet_e58758 - phase0 processRegistryUpdates 17.431 us/op 14.284 us/op 1.22
mainnet_e58758 - phase0 processSlashings 1.7110 us/op 1.0530 us/op 1.62
mainnet_e58758 - phase0 processEth1DataReset 1.7480 us/op 1.2260 us/op 1.43
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0419 ms/op 1.5000 ms/op 1.36
mainnet_e58758 - phase0 processSlashingsReset 8.4530 us/op 6.2220 us/op 1.36
mainnet_e58758 - phase0 processRandaoMixesReset 11.149 us/op 6.6790 us/op 1.67
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.7640 us/op 1.1160 us/op 1.58
mainnet_e58758 - phase0 processParticipationRecordUpdates 12.991 us/op 7.3340 us/op 1.77
mainnet_e58758 - phase0 afterProcessEpoch 132.70 ms/op 102.16 ms/op 1.30
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.3339 ms/op 1.3140 ms/op 1.78
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.6432 ms/op 1.6430 ms/op 1.61
altair processInactivityUpdates - 250000 normalcase 40.776 ms/op 28.711 ms/op 1.42
altair processInactivityUpdates - 250000 worstcase 33.687 ms/op 30.407 ms/op 1.11
phase0 processRegistryUpdates - 250000 normalcase 18.203 us/op 12.981 us/op 1.40
phase0 processRegistryUpdates - 250000 badcase_full_deposits 427.31 us/op 311.10 us/op 1.37
phase0 processRegistryUpdates - 250000 worstcase 0.5 165.41 ms/op 146.66 ms/op 1.13
altair processRewardsAndPenalties - 250000 normalcase 78.779 ms/op 81.168 ms/op 0.97
altair processRewardsAndPenalties - 250000 worstcase 81.876 ms/op 92.432 ms/op 0.89
phase0 getAttestationDeltas - 250000 normalcase 11.692 ms/op 11.963 ms/op 0.98
phase0 getAttestationDeltas - 250000 worstcase 10.317 ms/op 10.357 ms/op 1.00
phase0 processSlashings - 250000 worstcase 4.9524 ms/op 5.5399 ms/op 0.89
altair processSyncCommitteeUpdates - 250000 197.51 ms/op 225.83 ms/op 0.87
BeaconState.hashTreeRoot - No change 343.00 ns/op 322.00 ns/op 1.07
BeaconState.hashTreeRoot - 1 full validator 62.023 us/op 58.838 us/op 1.05
BeaconState.hashTreeRoot - 32 full validator 688.99 us/op 711.85 us/op 0.97
BeaconState.hashTreeRoot - 512 full validator 8.0684 ms/op 8.2085 ms/op 0.98
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 88.293 us/op 84.581 us/op 1.04
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1406 ms/op 1.0802 ms/op 1.06
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.500 ms/op 13.780 ms/op 1.05
BeaconState.hashTreeRoot - 1 balances 60.578 us/op 62.297 us/op 0.97
BeaconState.hashTreeRoot - 32 balances 529.16 us/op 497.45 us/op 1.06
BeaconState.hashTreeRoot - 512 balances 5.6775 ms/op 5.4217 ms/op 1.05
BeaconState.hashTreeRoot - 250000 balances 86.722 ms/op 77.157 ms/op 1.12
aggregationBits - 2048 els - zipIndexesInBitList 24.926 us/op 23.956 us/op 1.04
regular array get 100000 times 50.385 us/op 35.036 us/op 1.44
wrappedArray get 100000 times 52.212 us/op 35.011 us/op 1.49
arrayWithProxy get 100000 times 21.916 ms/op 17.318 ms/op 1.27
ssz.Root.equals 833.00 ns/op 745.00 ns/op 1.12
byteArrayEquals 774.00 ns/op 780.00 ns/op 0.99
shuffle list - 16384 els 8.6218 ms/op 8.5130 ms/op 1.01
shuffle list - 250000 els 128.48 ms/op 121.32 ms/op 1.06
processSlot - 1 slots 12.282 us/op 10.698 us/op 1.15
processSlot - 32 slots 1.6428 ms/op 1.6695 ms/op 0.98
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 48.508 ms/op 41.303 ms/op 1.17
getCommitteeAssignments - req 1 vs - 250000 vc 3.8597 ms/op 3.2463 ms/op 1.19
getCommitteeAssignments - req 100 vs - 250000 vc 5.4984 ms/op 4.6956 ms/op 1.17
getCommitteeAssignments - req 1000 vs - 250000 vc 6.1800 ms/op 5.0823 ms/op 1.22
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.7100 ns/op 5.7900 ns/op 1.16
state getBlockRootAtSlot - 250000 vs - 7PWei 1.2118 us/op 950.30 ns/op 1.28
computeProposers - vc 250000 14.073 ms/op 12.516 ms/op 1.12
computeEpochShuffling - vc 250000 150.39 ms/op 122.33 ms/op 1.23
getNextSyncCommittee - vc 250000 256.78 ms/op 194.91 ms/op 1.32
computeSigningRoot for AttestationData 20.688 us/op 15.228 us/op 1.36
hash AttestationData serialized data then Buffer.toString(base64) 3.1851 us/op 2.6270 us/op 1.21
toHexString serialized data 1.7028 us/op 1.4739 us/op 1.16
Buffer.toString(base64) 421.81 ns/op 381.41 ns/op 1.11

by benchmarkbot/action

@g11tech g11tech enabled auto-merge (squash) April 19, 2023 07:17
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

@g11tech g11tech merged commit 0488388 into unstable Apr 19, 2023
@g11tech g11tech deleted the g11tech/fix-blockval-log branch April 19, 2023 12:42
@wemeetagain
Copy link
Member

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

3 participants