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: use bigint to calculate max builder boost factor #6275

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jan 9, 2024

Motivation

Current value of MAX_BUILDER_BOOST_FACTOR is off by one due to usage of number instead of bigint in the calculation.

> BigInt(2 ** 64 - 1)
18446744073709551616n

vs.

> 2n ** 64n - 1n
18446744073709551615n

The correct value should be 18446744073709551615 (2**64 - 1)

Description

Use bigint to calculate max builder boost factor

@nflaig nflaig requested a review from a team as a code owner January 9, 2024 20:19
@nflaig
Copy link
Member Author

nflaig commented Jan 9, 2024

I was also reviewing the validation as mentioned in #6236 (comment) to prevent non integer values and negative numbers but as @g11tech highlighted in the standup we lose precision on the value if we use uint schema instead of string because of the same problem that it will be converted to a number which does not support 64 bit unsigned integers (only up to 2^53−1).

Based on some testing I did and reviewing the usage of builder boost factor the current validation seems to be sufficient

  • non integer values are rejected because they can't be converted to bigint ("Cannot convert abc to a BigInt")
  • negative values do not affect calculation and would result in the same outcome as 0. The spec also uses Uint64 type which means it should be fine if we allow negative numbers.

We could further investigate how to support bigint more broadly at serialization/deserilization and schema validation level if we see the need for it and there are more values that require to support 64 bit unsigned integers.

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 40b24e6 Previous: e51f495 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 569.24 us/op 686.96 us/op 0.83
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 146.04 us/op 84.736 us/op 1.72
BLS verify - blst-native 1.3813 ms/op 1.2891 ms/op 1.07
BLS verifyMultipleSignatures 3 - blst-native 2.9718 ms/op 2.6872 ms/op 1.11
BLS verifyMultipleSignatures 8 - blst-native 6.4961 ms/op 5.8794 ms/op 1.10
BLS verifyMultipleSignatures 32 - blst-native 23.896 ms/op 21.595 ms/op 1.11
BLS verifyMultipleSignatures 64 - blst-native 48.405 ms/op 42.936 ms/op 1.13
BLS verifyMultipleSignatures 128 - blst-native 98.423 ms/op 85.121 ms/op 1.16
BLS deserializing 10000 signatures 991.75 ms/op 912.86 ms/op 1.09
BLS deserializing 100000 signatures 10.014 s/op 9.3905 s/op 1.07
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.6582 ms/op 1.3479 ms/op 1.23
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.7399 ms/op 1.6630 ms/op 1.05
BLS verifyMultipleSignatures - same message - 32 - blst-native 3.1670 ms/op 2.9227 ms/op 1.08
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.2445 ms/op 3.7463 ms/op 1.13
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.9163 ms/op 8.0288 ms/op 0.86
BLS aggregatePubkeys 32 - blst-native 30.073 us/op 25.763 us/op 1.17
BLS aggregatePubkeys 128 - blst-native 111.42 us/op 101.39 us/op 1.10
getAttestationsForBlock 81.787 ms/op 54.682 ms/op 1.50
getSlashingsAndExits - default max 378.82 us/op 207.80 us/op 1.82
getSlashingsAndExits - 2k 1.0268 ms/op 482.81 us/op 2.13
proposeBlockBody type=full, size=empty 10.882 ms/op 5.3028 ms/op 2.05
isKnown best case - 1 super set check 961.00 ns/op 397.00 ns/op 2.42
isKnown normal case - 2 super set checks 970.00 ns/op 552.00 ns/op 1.76
isKnown worse case - 16 super set checks 1.1880 us/op 535.00 ns/op 2.22
CheckpointStateCache - add get delete 9.8070 us/op 6.0630 us/op 1.62
validate api signedAggregateAndProof - struct 4.7618 ms/op 2.7995 ms/op 1.70
validate gossip signedAggregateAndProof - struct 4.4405 ms/op 2.8309 ms/op 1.57
validate gossip attestation - vc 640000 1.8077 ms/op 1.4246 ms/op 1.27
batch validate gossip attestation - vc 640000 - chunk 32 223.14 us/op 181.40 us/op 1.23
batch validate gossip attestation - vc 640000 - chunk 64 198.11 us/op 157.64 us/op 1.26
batch validate gossip attestation - vc 640000 - chunk 128 178.43 us/op 167.97 us/op 1.06
batch validate gossip attestation - vc 640000 - chunk 256 156.40 us/op 148.06 us/op 1.06
pickEth1Vote - no votes 1.4512 ms/op 1.5563 ms/op 0.93
pickEth1Vote - max votes 18.673 ms/op 15.789 ms/op 1.18
pickEth1Vote - Eth1Data hashTreeRoot value x2048 26.395 ms/op 23.305 ms/op 1.13
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 39.425 ms/op 39.298 ms/op 1.00
pickEth1Vote - Eth1Data fastSerialize value x2048 815.80 us/op 720.99 us/op 1.13
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.8825 ms/op 5.9289 ms/op 0.99
bytes32 toHexString 899.00 ns/op 690.00 ns/op 1.30
bytes32 Buffer.toString(hex) 315.00 ns/op 314.00 ns/op 1.00
bytes32 Buffer.toString(hex) from Uint8Array 609.00 ns/op 475.00 ns/op 1.28
bytes32 Buffer.toString(hex) + 0x 337.00 ns/op 306.00 ns/op 1.10
Object access 1 prop 0.25300 ns/op 0.20500 ns/op 1.23
Map access 1 prop 0.16300 ns/op 0.16200 ns/op 1.01
Object get x1000 7.9530 ns/op 7.6270 ns/op 1.04
Map get x1000 0.95100 ns/op 0.87200 ns/op 1.09
Object set x1000 87.492 ns/op 61.818 ns/op 1.42
Map set x1000 62.046 ns/op 47.952 ns/op 1.29
Return object 10000 times 0.27490 ns/op 0.26360 ns/op 1.04
Throw Error 10000 times 4.2385 us/op 4.0842 us/op 1.04
fastMsgIdFn sha256 / 200 bytes 3.7690 us/op 3.4560 us/op 1.09
fastMsgIdFn h32 xxhash / 200 bytes 388.00 ns/op 341.00 ns/op 1.14
fastMsgIdFn h64 xxhash / 200 bytes 419.00 ns/op 390.00 ns/op 1.07
fastMsgIdFn sha256 / 1000 bytes 12.144 us/op 11.782 us/op 1.03
fastMsgIdFn h32 xxhash / 1000 bytes 502.00 ns/op 485.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 1000 bytes 493.00 ns/op 472.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 108.54 us/op 105.26 us/op 1.03
fastMsgIdFn h32 xxhash / 10000 bytes 2.1160 us/op 2.0400 us/op 1.04
fastMsgIdFn h64 xxhash / 10000 bytes 1.5060 us/op 1.4270 us/op 1.06
send data - 1000 256B messages 23.214 ms/op 23.193 ms/op 1.00
send data - 1000 512B messages 30.674 ms/op 28.733 ms/op 1.07
send data - 1000 1024B messages 46.348 ms/op 44.886 ms/op 1.03
send data - 1000 1200B messages 46.668 ms/op 42.806 ms/op 1.09
send data - 1000 2048B messages 45.417 ms/op 50.897 ms/op 0.89
send data - 1000 4096B messages 53.200 ms/op 46.016 ms/op 1.16
send data - 1000 16384B messages 148.91 ms/op 121.51 ms/op 1.23
send data - 1000 65536B messages 519.61 ms/op 532.86 ms/op 0.98
enrSubnets - fastDeserialize 64 bits 1.9200 us/op 1.8260 us/op 1.05
enrSubnets - ssz BitVector 64 bits 616.00 ns/op 545.00 ns/op 1.13
enrSubnets - fastDeserialize 4 bits 263.00 ns/op 242.00 ns/op 1.09
enrSubnets - ssz BitVector 4 bits 593.00 ns/op 553.00 ns/op 1.07
prioritizePeers score -10:0 att 32-0.1 sync 2-0 129.56 us/op 121.95 us/op 1.06
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 161.37 us/op 165.70 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 231.10 us/op 219.58 us/op 1.05
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 381.14 us/op 356.31 us/op 1.07
prioritizePeers score 0:0 att 64-1 sync 4-1 431.92 us/op 429.72 us/op 1.01
array of 16000 items push then shift 1.8551 us/op 1.8223 us/op 1.02
LinkedList of 16000 items push then shift 11.143 ns/op 9.8140 ns/op 1.14
array of 16000 items push then pop 125.64 ns/op 116.46 ns/op 1.08
LinkedList of 16000 items push then pop 9.9780 ns/op 9.5190 ns/op 1.05
array of 24000 items push then shift 2.8644 us/op 2.6906 us/op 1.06
LinkedList of 24000 items push then shift 10.806 ns/op 9.9680 ns/op 1.08
array of 24000 items push then pop 190.23 ns/op 157.73 ns/op 1.21
LinkedList of 24000 items push then pop 9.9820 ns/op 9.0120 ns/op 1.11
intersect bitArray bitLen 8 7.0710 ns/op 7.4600 ns/op 0.95
intersect array and set length 8 114.89 ns/op 95.111 ns/op 1.21
intersect bitArray bitLen 128 40.355 ns/op 35.296 ns/op 1.14
intersect array and set length 128 1.2283 us/op 1.1801 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 128 2.0510 us/op 1.9690 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 248 3.7060 us/op 3.6040 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 512 7.7730 us/op 7.0260 us/op 1.11
Buffer.concat 32 items 1.2310 us/op 1.1060 us/op 1.11
Uint8Array.set 32 items 2.6890 us/op 2.6290 us/op 1.02
Set add up to 64 items then delete first 5.4543 us/op 5.2973 us/op 1.03
OrderedSet add up to 64 items then delete first 7.4633 us/op 7.0476 us/op 1.06
Set add up to 64 items then delete last 5.6888 us/op 5.5339 us/op 1.03
OrderedSet add up to 64 items then delete last 7.8449 us/op 7.8590 us/op 1.00
Set add up to 64 items then delete middle 5.7068 us/op 5.4706 us/op 1.04
OrderedSet add up to 64 items then delete middle 9.3064 us/op 9.4878 us/op 0.98
Set add up to 128 items then delete first 11.145 us/op 11.218 us/op 0.99
OrderedSet add up to 128 items then delete first 15.897 us/op 15.870 us/op 1.00
Set add up to 128 items then delete last 11.526 us/op 11.243 us/op 1.03
OrderedSet add up to 128 items then delete last 16.534 us/op 15.164 us/op 1.09
Set add up to 128 items then delete middle 11.655 us/op 11.167 us/op 1.04
OrderedSet add up to 128 items then delete middle 21.913 us/op 22.584 us/op 0.97
Set add up to 256 items then delete first 23.936 us/op 22.681 us/op 1.06
OrderedSet add up to 256 items then delete first 33.405 us/op 34.115 us/op 0.98
Set add up to 256 items then delete last 24.296 us/op 22.183 us/op 1.10
OrderedSet add up to 256 items then delete last 33.243 us/op 30.358 us/op 1.10
Set add up to 256 items then delete middle 24.248 us/op 23.133 us/op 1.05
OrderedSet add up to 256 items then delete middle 58.273 us/op 58.366 us/op 1.00
transfer serialized Status (84 B) 2.1890 us/op 2.0520 us/op 1.07
copy serialized Status (84 B) 2.2650 us/op 1.7720 us/op 1.28
transfer serialized SignedVoluntaryExit (112 B) 2.1340 us/op 2.1080 us/op 1.01
copy serialized SignedVoluntaryExit (112 B) 1.9090 us/op 1.8930 us/op 1.01
transfer serialized ProposerSlashing (416 B) 2.7560 us/op 2.8260 us/op 0.98
copy serialized ProposerSlashing (416 B) 3.1560 us/op 3.1170 us/op 1.01
transfer serialized Attestation (485 B) 3.2200 us/op 2.8570 us/op 1.13
copy serialized Attestation (485 B) 2.9400 us/op 2.6730 us/op 1.10
transfer serialized AttesterSlashing (33232 B) 3.3680 us/op 2.6580 us/op 1.27
copy serialized AttesterSlashing (33232 B) 11.126 us/op 9.9570 us/op 1.12
transfer serialized Small SignedBeaconBlock (128000 B) 3.1380 us/op 3.4110 us/op 0.92
copy serialized Small SignedBeaconBlock (128000 B) 32.186 us/op 24.130 us/op 1.33
transfer serialized Avg SignedBeaconBlock (200000 B) 3.3080 us/op 4.2600 us/op 0.78
copy serialized Avg SignedBeaconBlock (200000 B) 50.160 us/op 46.821 us/op 1.07
transfer serialized BlobsSidecar (524380 B) 4.8630 us/op 4.4670 us/op 1.09
copy serialized BlobsSidecar (524380 B) 140.90 us/op 146.55 us/op 0.96
transfer serialized Big SignedBeaconBlock (1000000 B) 4.1370 us/op 4.4010 us/op 0.94
copy serialized Big SignedBeaconBlock (1000000 B) 497.87 us/op 493.31 us/op 1.01
pass gossip attestations to forkchoice per slot 4.2492 ms/op 4.3293 ms/op 0.98
forkChoice updateHead vc 100000 bc 64 eq 0 800.02 us/op 709.14 us/op 1.13
forkChoice updateHead vc 600000 bc 64 eq 0 7.5761 ms/op 5.7408 ms/op 1.32
forkChoice updateHead vc 1000000 bc 64 eq 0 8.8776 ms/op 8.0350 ms/op 1.10
forkChoice updateHead vc 600000 bc 320 eq 0 4.8326 ms/op 4.9210 ms/op 0.98
forkChoice updateHead vc 600000 bc 1200 eq 0 5.0749 ms/op 5.6429 ms/op 0.90
forkChoice updateHead vc 600000 bc 7200 eq 0 6.3917 ms/op 6.3009 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 1000 12.196 ms/op 13.019 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 10000 13.546 ms/op 13.825 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 300000 37.510 ms/op 32.650 ms/op 1.15
computeDeltas 500000 validators 300 proto nodes 7.5989 ms/op 7.1847 ms/op 1.06
computeDeltas 500000 validators 1200 proto nodes 7.5966 ms/op 7.2538 ms/op 1.05
computeDeltas 500000 validators 7200 proto nodes 7.1860 ms/op 6.4474 ms/op 1.11
computeDeltas 750000 validators 300 proto nodes 10.263 ms/op 9.8925 ms/op 1.04
computeDeltas 750000 validators 1200 proto nodes 10.141 ms/op 10.334 ms/op 0.98
computeDeltas 750000 validators 7200 proto nodes 10.429 ms/op 10.198 ms/op 1.02
computeDeltas 1400000 validators 300 proto nodes 20.152 ms/op 19.284 ms/op 1.04
computeDeltas 1400000 validators 1200 proto nodes 19.363 ms/op 19.227 ms/op 1.01
computeDeltas 1400000 validators 7200 proto nodes 19.689 ms/op 19.802 ms/op 0.99
computeDeltas 2100000 validators 300 proto nodes 29.563 ms/op 29.545 ms/op 1.00
computeDeltas 2100000 validators 1200 proto nodes 29.484 ms/op 29.178 ms/op 1.01
computeDeltas 2100000 validators 7200 proto nodes 29.260 ms/op 28.735 ms/op 1.02
computeProposerBoostScoreFromBalances 500000 validators 3.9961 ms/op 3.8100 ms/op 1.05
computeProposerBoostScoreFromBalances 750000 validators 3.9963 ms/op 3.8712 ms/op 1.03
computeProposerBoostScoreFromBalances 1400000 validators 3.9927 ms/op 3.8990 ms/op 1.02
computeProposerBoostScoreFromBalances 2100000 validators 3.9444 ms/op 3.7788 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 3.6163 ms/op 2.2457 ms/op 1.61
altair processAttestation - 250000 vs - 7PWei worstcase 3.9064 ms/op 3.7202 ms/op 1.05
altair processAttestation - setStatus - 1/6 committees join 156.32 us/op 144.86 us/op 1.08
altair processAttestation - setStatus - 1/3 committees join 322.06 us/op 284.59 us/op 1.13
altair processAttestation - setStatus - 1/2 committees join 385.82 us/op 366.64 us/op 1.05
altair processAttestation - setStatus - 2/3 committees join 486.64 us/op 468.92 us/op 1.04
altair processAttestation - setStatus - 4/5 committees join 718.45 us/op 660.45 us/op 1.09
altair processAttestation - setStatus - 100% committees join 844.22 us/op 775.18 us/op 1.09
altair processBlock - 250000 vs - 7PWei normalcase 11.634 ms/op 10.252 ms/op 1.13
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.253 ms/op 36.698 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase 44.831 ms/op 41.420 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase hashState 114.04 ms/op 102.18 ms/op 1.12
phase0 processBlock - 250000 vs - 7PWei normalcase 3.2230 ms/op 3.1322 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei worstcase 39.684 ms/op 34.243 ms/op 1.16
altair processEth1Data - 250000 vs - 7PWei normalcase 675.26 us/op 644.90 us/op 1.05
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 18.382 us/op 18.831 us/op 0.98
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 70.426 us/op 77.238 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 42.063 us/op 25.617 us/op 1.64
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 20.025 us/op 20.115 us/op 1.00
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 214.86 us/op 229.04 us/op 0.94
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.2351 ms/op 1.6776 ms/op 1.33
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.4089 ms/op 2.0968 ms/op 1.15
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.4634 ms/op 2.1032 ms/op 1.17
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.8024 ms/op 4.1626 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.4645 ms/op 2.9009 ms/op 1.19
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 7.9003 ms/op 6.0043 ms/op 1.32
Tree 40 250000 create 594.58 ms/op 559.90 ms/op 1.06
Tree 40 250000 get(125000) 219.07 ns/op 216.98 ns/op 1.01
Tree 40 250000 set(125000) 1.3998 us/op 1.3510 us/op 1.04
Tree 40 250000 toArray() 26.947 ms/op 23.956 ms/op 1.12
Tree 40 250000 iterate all - toArray() + loop 23.825 ms/op 23.835 ms/op 1.00
Tree 40 250000 iterate all - get(i) 78.157 ms/op 88.468 ms/op 0.88
MutableVector 250000 create 15.105 ms/op 17.578 ms/op 0.86
MutableVector 250000 get(125000) 6.8750 ns/op 6.7260 ns/op 1.02
MutableVector 250000 set(125000) 410.74 ns/op 514.39 ns/op 0.80
MutableVector 250000 toArray() 4.7958 ms/op 4.5162 ms/op 1.06
MutableVector 250000 iterate all - toArray() + loop 4.9190 ms/op 4.7784 ms/op 1.03
MutableVector 250000 iterate all - get(i) 1.6324 ms/op 1.7208 ms/op 0.95
Array 250000 create 4.3153 ms/op 5.1242 ms/op 0.84
Array 250000 clone - spread 1.9259 ms/op 5.3605 ms/op 0.36
Array 250000 get(125000) 1.4480 ns/op 2.7430 ns/op 0.53
Array 250000 set(125000) 5.7780 ns/op 6.0540 ns/op 0.95
Array 250000 iterate all - loop 196.88 us/op 219.33 us/op 0.90
effectiveBalanceIncrements clone Uint8Array 300000 57.360 us/op 73.824 us/op 0.78
effectiveBalanceIncrements clone MutableVector 300000 603.00 ns/op 993.00 ns/op 0.61
effectiveBalanceIncrements rw all Uint8Array 300000 220.67 us/op 265.86 us/op 0.83
effectiveBalanceIncrements rw all MutableVector 300000 122.85 ms/op 246.70 ms/op 0.50
phase0 afterProcessEpoch - 250000 vs - 7PWei 121.56 ms/op 140.77 ms/op 0.86
phase0 beforeProcessEpoch - 250000 vs - 7PWei 57.095 ms/op 73.884 ms/op 0.77
altair processEpoch - mainnet_e81889 561.20 ms/op 694.51 ms/op 0.81
mainnet_e81889 - altair beforeProcessEpoch 90.530 ms/op 131.81 ms/op 0.69
mainnet_e81889 - altair processJustificationAndFinalization 15.772 us/op 28.240 us/op 0.56
mainnet_e81889 - altair processInactivityUpdates 7.4934 ms/op 12.056 ms/op 0.62
mainnet_e81889 - altair processRewardsAndPenalties 44.271 ms/op 85.254 ms/op 0.52
mainnet_e81889 - altair processRegistryUpdates 2.7040 us/op 6.2960 us/op 0.43
mainnet_e81889 - altair processSlashings 547.00 ns/op 1.1650 us/op 0.47
mainnet_e81889 - altair processEth1DataReset 867.00 ns/op 1.2070 us/op 0.72
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4365 ms/op 2.3689 ms/op 0.61
mainnet_e81889 - altair processSlashingsReset 3.8090 us/op 10.191 us/op 0.37
mainnet_e81889 - altair processRandaoMixesReset 5.1940 us/op 10.703 us/op 0.49
mainnet_e81889 - altair processHistoricalRootsUpdate 753.00 ns/op 1.5530 us/op 0.48
mainnet_e81889 - altair processParticipationFlagUpdates 2.0570 us/op 5.2770 us/op 0.39
mainnet_e81889 - altair processSyncCommitteeUpdates 929.00 ns/op 1.6510 us/op 0.56
mainnet_e81889 - altair afterProcessEpoch 123.50 ms/op 136.96 ms/op 0.90
capella processEpoch - mainnet_e217614 2.4747 s/op 3.5612 s/op 0.69
mainnet_e217614 - capella beforeProcessEpoch 580.78 ms/op 763.86 ms/op 0.76
mainnet_e217614 - capella processJustificationAndFinalization 18.308 us/op 29.119 us/op 0.63
mainnet_e217614 - capella processInactivityUpdates 19.477 ms/op 30.278 ms/op 0.64
mainnet_e217614 - capella processRewardsAndPenalties 427.33 ms/op 555.30 ms/op 0.77
mainnet_e217614 - capella processRegistryUpdates 24.369 us/op 31.011 us/op 0.79
mainnet_e217614 - capella processSlashings 915.00 ns/op 1.0980 us/op 0.83
mainnet_e217614 - capella processEth1DataReset 582.00 ns/op 1.2820 us/op 0.45
mainnet_e217614 - capella processEffectiveBalanceUpdates 14.545 ms/op 7.7378 ms/op 1.88
mainnet_e217614 - capella processSlashingsReset 4.9070 us/op 7.8740 us/op 0.62
mainnet_e217614 - capella processRandaoMixesReset 6.0880 us/op 9.3140 us/op 0.65
mainnet_e217614 - capella processHistoricalRootsUpdate 666.00 ns/op 1.4300 us/op 0.47
mainnet_e217614 - capella processParticipationFlagUpdates 4.2580 us/op 4.2740 us/op 1.00
mainnet_e217614 - capella afterProcessEpoch 331.85 ms/op 341.12 ms/op 0.97
phase0 processEpoch - mainnet_e58758 555.52 ms/op 635.38 ms/op 0.87
mainnet_e58758 - phase0 beforeProcessEpoch 168.18 ms/op 227.13 ms/op 0.74
mainnet_e58758 - phase0 processJustificationAndFinalization 18.541 us/op 33.098 us/op 0.56
mainnet_e58758 - phase0 processRewardsAndPenalties 58.242 ms/op 78.666 ms/op 0.74
mainnet_e58758 - phase0 processRegistryUpdates 16.885 us/op 19.793 us/op 0.85
mainnet_e58758 - phase0 processSlashings 885.00 ns/op 1.1940 us/op 0.74
mainnet_e58758 - phase0 processEth1DataReset 909.00 ns/op 995.00 ns/op 0.91
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.5828 ms/op 2.1741 ms/op 0.73
mainnet_e58758 - phase0 processSlashingsReset 4.4710 us/op 5.9320 us/op 0.75
mainnet_e58758 - phase0 processRandaoMixesReset 10.352 us/op 8.0480 us/op 1.29
mainnet_e58758 - phase0 processHistoricalRootsUpdate 863.00 ns/op 1.0530 us/op 0.82
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.0500 us/op 6.5730 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 107.08 ms/op 105.67 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4663 ms/op 2.0021 ms/op 0.73
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.8618 ms/op 2.2290 ms/op 0.84
altair processInactivityUpdates - 250000 normalcase 34.792 ms/op 35.202 ms/op 0.99
altair processInactivityUpdates - 250000 worstcase 37.876 ms/op 34.575 ms/op 1.10
phase0 processRegistryUpdates - 250000 normalcase 20.656 us/op 18.375 us/op 1.12
phase0 processRegistryUpdates - 250000 badcase_full_deposits 468.52 us/op 500.80 us/op 0.94
phase0 processRegistryUpdates - 250000 worstcase 0.5 170.83 ms/op 168.24 ms/op 1.02
altair processRewardsAndPenalties - 250000 normalcase 68.163 ms/op 71.668 ms/op 0.95
altair processRewardsAndPenalties - 250000 worstcase 58.583 ms/op 70.123 ms/op 0.84
phase0 getAttestationDeltas - 250000 normalcase 13.389 ms/op 13.316 ms/op 1.01
phase0 getAttestationDeltas - 250000 worstcase 13.264 ms/op 13.954 ms/op 0.95
phase0 processSlashings - 250000 worstcase 133.13 us/op 131.16 us/op 1.02
altair processSyncCommitteeUpdates - 250000 177.15 ms/op 182.75 ms/op 0.97
BeaconState.hashTreeRoot - No change 289.00 ns/op 308.00 ns/op 0.94
BeaconState.hashTreeRoot - 1 full validator 168.37 us/op 200.09 us/op 0.84
BeaconState.hashTreeRoot - 32 full validator 2.1564 ms/op 2.0603 ms/op 1.05
BeaconState.hashTreeRoot - 512 full validator 25.004 ms/op 21.906 ms/op 1.14
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 224.58 us/op 225.34 us/op 1.00
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.8603 ms/op 2.8917 ms/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 35.304 ms/op 36.785 ms/op 0.96
BeaconState.hashTreeRoot - 1 balances 158.74 us/op 195.35 us/op 0.81
BeaconState.hashTreeRoot - 32 balances 1.5858 ms/op 1.6284 ms/op 0.97
BeaconState.hashTreeRoot - 512 balances 15.779 ms/op 16.143 ms/op 0.98
BeaconState.hashTreeRoot - 250000 balances 256.78 ms/op 252.89 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 28.559 us/op 32.818 us/op 0.87
byteArrayEquals 32 84.474 ns/op 80.665 ns/op 1.05
Buffer.compare 32 60.899 ns/op 56.666 ns/op 1.07
byteArrayEquals 1024 2.2214 us/op 2.2203 us/op 1.00
Buffer.compare 1024 77.591 ns/op 72.604 ns/op 1.07
byteArrayEquals 16384 41.023 us/op 34.755 us/op 1.18
Buffer.compare 16384 255.98 ns/op 287.85 ns/op 0.89
byteArrayEquals 123687377 260.35 ms/op 300.37 ms/op 0.87
Buffer.compare 123687377 9.6828 ms/op 15.431 ms/op 0.63
byteArrayEquals 32 - diff last byte 74.362 ns/op 113.98 ns/op 0.65
Buffer.compare 32 - diff last byte 59.189 ns/op 79.537 ns/op 0.74
byteArrayEquals 1024 - diff last byte 2.2587 us/op 3.0339 us/op 0.74
Buffer.compare 1024 - diff last byte 75.727 ns/op 94.481 ns/op 0.80
byteArrayEquals 16384 - diff last byte 35.340 us/op 42.602 us/op 0.83
Buffer.compare 16384 - diff last byte 273.70 ns/op 355.09 ns/op 0.77
byteArrayEquals 123687377 - diff last byte 262.99 ms/op 355.13 ms/op 0.74
Buffer.compare 123687377 - diff last byte 11.438 ms/op 16.811 ms/op 0.68
byteArrayEquals 32 - random bytes 6.8640 ns/op 9.2100 ns/op 0.75
Buffer.compare 32 - random bytes 66.011 ns/op 71.274 ns/op 0.93
byteArrayEquals 1024 - random bytes 6.9110 ns/op 7.8460 ns/op 0.88
Buffer.compare 1024 - random bytes 65.287 ns/op 71.020 ns/op 0.92
byteArrayEquals 16384 - random bytes 7.3030 ns/op 7.5460 ns/op 0.97
Buffer.compare 16384 - random bytes 65.462 ns/op 66.947 ns/op 0.98
byteArrayEquals 123687377 - random bytes 13.620 ns/op 24.470 ns/op 0.56
Buffer.compare 123687377 - random bytes 87.150 ns/op 88.800 ns/op 0.98
regular array get 100000 times 49.018 us/op 56.846 us/op 0.86
wrappedArray get 100000 times 49.165 us/op 53.193 us/op 0.92
arrayWithProxy get 100000 times 17.770 ms/op 18.332 ms/op 0.97
ssz.Root.equals 62.165 ns/op 66.318 ns/op 0.94
byteArrayEquals 58.897 ns/op 65.501 ns/op 0.90
Buffer.compare 13.226 ns/op 17.322 ns/op 0.76
shuffle list - 16384 els 7.6560 ms/op 8.3148 ms/op 0.92
shuffle list - 250000 els 110.28 ms/op 116.15 ms/op 0.95
processSlot - 1 slots 24.058 us/op 33.813 us/op 0.71
processSlot - 32 slots 4.8766 ms/op 4.8272 ms/op 1.01
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 78.041 ms/op 90.097 ms/op 0.87
getCommitteeAssignments - req 1 vs - 250000 vc 2.7580 ms/op 3.4582 ms/op 0.80
getCommitteeAssignments - req 100 vs - 250000 vc 4.0216 ms/op 4.4899 ms/op 0.90
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5611 ms/op 4.9187 ms/op 0.93
findModifiedValidators - 10000 modified validators 589.34 ms/op 821.63 ms/op 0.72
findModifiedValidators - 1000 modified validators 454.54 ms/op 635.89 ms/op 0.71
findModifiedValidators - 100 modified validators 469.52 ms/op 592.58 ms/op 0.79
findModifiedValidators - 10 modified validators 466.65 ms/op 581.09 ms/op 0.80
findModifiedValidators - 1 modified validators 432.46 ms/op 590.17 ms/op 0.73
findModifiedValidators - no difference 422.47 ms/op 603.35 ms/op 0.70
compare ViewDUs 4.5918 s/op 7.4138 s/op 0.62
compare each validator Uint8Array 1.8502 s/op 2.8187 s/op 0.66
compare ViewDU to Uint8Array 1.3292 s/op 2.0248 s/op 0.66
migrate state 1000000 validators, 24 modified, 0 new 846.95 ms/op 1.2192 s/op 0.69
migrate state 1000000 validators, 1700 modified, 1000 new 1.1284 s/op 1.5330 s/op 0.74
migrate state 1000000 validators, 3400 modified, 2000 new 1.3680 s/op 1.8038 s/op 0.76
migrate state 1500000 validators, 24 modified, 0 new 932.70 ms/op 1.1917 s/op 0.78
migrate state 1500000 validators, 1700 modified, 1000 new 1.5974 s/op 1.5369 s/op 1.04
migrate state 1500000 validators, 3400 modified, 2000 new 1.6952 s/op 1.8431 s/op 0.92
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.4800 ns/op 4.8500 ns/op 1.13
state getBlockRootAtSlot - 250000 vs - 7PWei 955.40 ns/op 1.1260 us/op 0.85
computeProposers - vc 250000 12.043 ms/op 10.613 ms/op 1.13
computeEpochShuffling - vc 250000 108.75 ms/op 112.93 ms/op 0.96
getNextSyncCommittee - vc 250000 211.12 ms/op 174.25 ms/op 1.21
computeSigningRoot for AttestationData 37.511 us/op 32.992 us/op 1.14
hash AttestationData serialized data then Buffer.toString(base64) 2.5232 us/op 2.4705 us/op 1.02
toHexString serialized data 1.4089 us/op 1.4249 us/op 0.99
Buffer.toString(base64) 299.99 ns/op 245.94 ns/op 1.22

by benchmarkbot/action

@nflaig nflaig enabled auto-merge (squash) January 10, 2024 14:42
@nflaig nflaig merged commit 11fbea5 into unstable Jan 10, 2024
14 of 15 checks passed
@nflaig nflaig deleted the nflaig/fix-max-builder-boost-factor branch January 10, 2024 14:51
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.14.0 🎉

ensi321 pushed a commit to ensi321/lodestar that referenced this pull request Jan 22, 2024
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.

5 participants