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

chore: fix beacon proposer cache unit tests #7335

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jan 7, 2025

Those tests were previously not executed due to file name not ending with .test.ts

@nflaig nflaig requested a review from a team as a code owner January 7, 2025 13:18
@@ -13,7 +13,7 @@ describe("BeaconProposerCache", () => {
});

it("get default", () => {
expect(cache.get(32)).toBe("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
expect(cache.getOrDefault(32)).toBe("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
Copy link
Contributor

Choose a reason for hiding this comment

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

If we you refactoring this code, will suggest to not use such magic numbers. Instead assign these values to some named constants and use in tests. Will make code more readable.

Copy link
Member Author

Choose a reason for hiding this comment

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

did a bit of refactoring

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.75%. Comparing base (690ee6a) to head (abce9d1).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #7335   +/-   ##
=========================================
  Coverage     48.75%   48.75%           
=========================================
  Files           601      601           
  Lines         40222    40222           
  Branches       2061     2061           
=========================================
  Hits          19609    19609           
  Misses        20575    20575           
  Partials         38       38           

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 6bc80f8 Previous: d41fb55 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.6643 ms/op 1.7936 ms/op 0.93
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 48.541 us/op 56.775 us/op 0.85
BLS verify - blst 805.44 us/op 795.50 us/op 1.01
BLS verifyMultipleSignatures 3 - blst 1.3290 ms/op 1.2339 ms/op 1.08
BLS verifyMultipleSignatures 8 - blst 2.0493 ms/op 1.7319 ms/op 1.18
BLS verifyMultipleSignatures 32 - blst 6.3794 ms/op 4.9886 ms/op 1.28
BLS verifyMultipleSignatures 64 - blst 10.007 ms/op 9.4255 ms/op 1.06
BLS verifyMultipleSignatures 128 - blst 17.862 ms/op 17.555 ms/op 1.02
BLS deserializing 10000 signatures 643.35 ms/op 699.82 ms/op 0.92
BLS deserializing 100000 signatures 6.3864 s/op 7.0250 s/op 0.91
BLS verifyMultipleSignatures - same message - 3 - blst 924.77 us/op 961.23 us/op 0.96
BLS verifyMultipleSignatures - same message - 8 - blst 1.0762 ms/op 1.0202 ms/op 1.05
BLS verifyMultipleSignatures - same message - 32 - blst 1.7503 ms/op 1.7821 ms/op 0.98
BLS verifyMultipleSignatures - same message - 64 - blst 2.5152 ms/op 2.6494 ms/op 0.95
BLS verifyMultipleSignatures - same message - 128 - blst 4.0604 ms/op 4.6079 ms/op 0.88
BLS aggregatePubkeys 32 - blst 18.492 us/op 20.978 us/op 0.88
BLS aggregatePubkeys 128 - blst 63.043 us/op 72.072 us/op 0.87
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 72.517 ms/op 91.690 ms/op 0.79
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 46.647 ms/op 58.498 ms/op 0.80
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 41.813 ms/op 48.784 ms/op 0.86
getSlashingsAndExits - default max 145.69 us/op 134.68 us/op 1.08
getSlashingsAndExits - 2k 648.59 us/op 570.20 us/op 1.14
proposeBlockBody type=full, size=empty 7.1783 ms/op 7.3441 ms/op 0.98
isKnown best case - 1 super set check 558.00 ns/op 504.00 ns/op 1.11
isKnown normal case - 2 super set checks 627.00 ns/op 415.00 ns/op 1.51
isKnown worse case - 16 super set checks 626.00 ns/op 476.00 ns/op 1.32
InMemoryCheckpointStateCache - add get delete 3.4750 us/op 3.7160 us/op 0.94
validate api signedAggregateAndProof - struct 1.5129 ms/op 1.4671 ms/op 1.03
validate gossip signedAggregateAndProof - struct 1.5274 ms/op 1.4765 ms/op 1.03
batch validate gossip attestation - vc 640000 - chunk 32 140.20 us/op 139.49 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 127.28 us/op 121.51 us/op 1.05
batch validate gossip attestation - vc 640000 - chunk 128 132.98 us/op 111.39 us/op 1.19
batch validate gossip attestation - vc 640000 - chunk 256 111.04 us/op 114.29 us/op 0.97
pickEth1Vote - no votes 973.39 us/op 1.2393 ms/op 0.79
pickEth1Vote - max votes 7.1185 ms/op 7.5406 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.504 ms/op 15.835 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.524 ms/op 19.977 ms/op 1.18
pickEth1Vote - Eth1Data fastSerialize value x2048 491.94 us/op 609.56 us/op 0.81
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.9847 ms/op 3.1221 ms/op 1.28
bytes32 toHexString 783.00 ns/op 639.00 ns/op 1.23
bytes32 Buffer.toString(hex) 427.00 ns/op 261.00 ns/op 1.64
bytes32 Buffer.toString(hex) from Uint8Array 536.00 ns/op 420.00 ns/op 1.28
bytes32 Buffer.toString(hex) + 0x 426.00 ns/op 256.00 ns/op 1.66
Object access 1 prop 0.35000 ns/op 0.13900 ns/op 2.52
Map access 1 prop 0.35700 ns/op 0.13300 ns/op 2.68
Object get x1000 5.3800 ns/op 6.6560 ns/op 0.81
Map get x1000 5.9550 ns/op 7.6510 ns/op 0.78
Object set x1000 25.315 ns/op 43.733 ns/op 0.58
Map set x1000 19.213 ns/op 30.440 ns/op 0.63
Return object 10000 times 0.30160 ns/op 0.31380 ns/op 0.96
Throw Error 10000 times 2.7613 us/op 3.4116 us/op 0.81
toHex 113.67 ns/op 169.24 ns/op 0.67
Buffer.from 118.57 ns/op 157.82 ns/op 0.75
shared Buffer 76.080 ns/op 94.814 ns/op 0.80
fastMsgIdFn sha256 / 200 bytes 2.2580 us/op 2.3290 us/op 0.97
fastMsgIdFn h32 xxhash / 200 bytes 526.00 ns/op 297.00 ns/op 1.77
fastMsgIdFn h64 xxhash / 200 bytes 539.00 ns/op 284.00 ns/op 1.90
fastMsgIdFn sha256 / 1000 bytes 6.0750 us/op 7.7900 us/op 0.78
fastMsgIdFn h32 xxhash / 1000 bytes 669.00 ns/op 434.00 ns/op 1.54
fastMsgIdFn h64 xxhash / 1000 bytes 581.00 ns/op 362.00 ns/op 1.60
fastMsgIdFn sha256 / 10000 bytes 51.557 us/op 67.847 us/op 0.76
fastMsgIdFn h32 xxhash / 10000 bytes 2.0690 us/op 1.9440 us/op 1.06
fastMsgIdFn h64 xxhash / 10000 bytes 1.5370 us/op 1.3180 us/op 1.17
send data - 1000 256B messages 14.733 ms/op 13.578 ms/op 1.09
send data - 1000 512B messages 22.147 ms/op 22.083 ms/op 1.00
send data - 1000 1024B messages 27.818 ms/op 26.309 ms/op 1.06
send data - 1000 1200B messages 31.110 ms/op 28.414 ms/op 1.09
send data - 1000 2048B messages 33.359 ms/op 35.642 ms/op 0.94
send data - 1000 4096B messages 33.235 ms/op 34.177 ms/op 0.97
send data - 1000 16384B messages 79.582 ms/op 72.771 ms/op 1.09
send data - 1000 65536B messages 311.78 ms/op 220.99 ms/op 1.41
enrSubnets - fastDeserialize 64 bits 1.9960 us/op 1.4670 us/op 1.36
enrSubnets - ssz BitVector 64 bits 714.00 ns/op 497.00 ns/op 1.44
enrSubnets - fastDeserialize 4 bits 399.00 ns/op 218.00 ns/op 1.83
enrSubnets - ssz BitVector 4 bits 691.00 ns/op 489.00 ns/op 1.41
prioritizePeers score -10:0 att 32-0.1 sync 2-0 166.82 us/op 201.50 us/op 0.83
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 181.81 us/op 229.87 us/op 0.79
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 320.77 us/op 332.01 us/op 0.97
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 412.63 us/op 546.21 us/op 0.76
prioritizePeers score 0:0 att 64-1 sync 4-1 594.63 us/op 703.60 us/op 0.85
array of 16000 items push then shift 1.3482 us/op 1.7557 us/op 0.77
LinkedList of 16000 items push then shift 8.5880 ns/op 8.0580 ns/op 1.07
array of 16000 items push then pop 122.16 ns/op 145.72 ns/op 0.84
LinkedList of 16000 items push then pop 8.0380 ns/op 8.6290 ns/op 0.93
array of 24000 items push then shift 1.9729 us/op 2.5386 us/op 0.78
LinkedList of 24000 items push then shift 10.433 ns/op 8.6700 ns/op 1.20
array of 24000 items push then pop 172.84 ns/op 213.43 ns/op 0.81
LinkedList of 24000 items push then pop 8.3720 ns/op 9.5140 ns/op 0.88
intersect bitArray bitLen 8 5.7470 ns/op 7.0010 ns/op 0.82
intersect array and set length 8 48.466 ns/op 57.174 ns/op 0.85
intersect bitArray bitLen 128 27.701 ns/op 31.349 ns/op 0.88
intersect array and set length 128 597.79 ns/op 889.80 ns/op 0.67
bitArray.getTrueBitIndexes() bitLen 128 1.5740 us/op 1.7900 us/op 0.88
bitArray.getTrueBitIndexes() bitLen 248 2.8200 us/op 2.8880 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 512 5.4080 us/op 7.2470 us/op 0.75
Buffer.concat 32 items 998.00 ns/op 1.0550 us/op 0.95
Uint8Array.set 32 items 1.8890 us/op 2.1160 us/op 0.89
Buffer.copy 2.8040 us/op 2.9630 us/op 0.95
Uint8Array.set - with subarray 2.7290 us/op 3.4130 us/op 0.80
Uint8Array.set - without subarray 2.4410 us/op 2.1650 us/op 1.13
getUint32 - dataview 484.00 ns/op 307.00 ns/op 1.58
getUint32 - manual 459.00 ns/op 241.00 ns/op 1.90
Set add up to 64 items then delete first 1.9246 us/op 3.0128 us/op 0.64
OrderedSet add up to 64 items then delete first 3.0077 us/op 4.6003 us/op 0.65
Set add up to 64 items then delete last 2.3787 us/op 3.3418 us/op 0.71
OrderedSet add up to 64 items then delete last 3.5146 us/op 5.4682 us/op 0.64
Set add up to 64 items then delete middle 2.1426 us/op 3.4252 us/op 0.63
OrderedSet add up to 64 items then delete middle 4.5883 us/op 6.5269 us/op 0.70
Set add up to 128 items then delete first 4.1313 us/op 6.5985 us/op 0.63
OrderedSet add up to 128 items then delete first 6.2666 us/op 9.9770 us/op 0.63
Set add up to 128 items then delete last 3.9239 us/op 6.7621 us/op 0.58
OrderedSet add up to 128 items then delete last 6.0212 us/op 9.9544 us/op 0.60
Set add up to 128 items then delete middle 4.0624 us/op 6.3494 us/op 0.64
OrderedSet add up to 128 items then delete middle 12.261 us/op 17.377 us/op 0.71
Set add up to 256 items then delete first 7.8405 us/op 13.177 us/op 0.60
OrderedSet add up to 256 items then delete first 12.377 us/op 19.649 us/op 0.63
Set add up to 256 items then delete last 7.6620 us/op 13.160 us/op 0.58
OrderedSet add up to 256 items then delete last 11.813 us/op 20.356 us/op 0.58
Set add up to 256 items then delete middle 7.9910 us/op 12.908 us/op 0.62
OrderedSet add up to 256 items then delete middle 40.153 us/op 49.909 us/op 0.80
transfer serialized Status (84 B) 2.6180 us/op 3.1260 us/op 0.84
copy serialized Status (84 B) 1.5900 us/op 1.5370 us/op 1.03
transfer serialized SignedVoluntaryExit (112 B) 2.8330 us/op 3.0960 us/op 0.92
copy serialized SignedVoluntaryExit (112 B) 1.8420 us/op 1.5690 us/op 1.17
transfer serialized ProposerSlashing (416 B) 3.9020 us/op 3.2560 us/op 1.20
copy serialized ProposerSlashing (416 B) 2.7120 us/op 1.9780 us/op 1.37
transfer serialized Attestation (485 B) 3.1420 us/op 4.5110 us/op 0.70
copy serialized Attestation (485 B) 1.8950 us/op 2.5120 us/op 0.75
transfer serialized AttesterSlashing (33232 B) 3.0870 us/op 3.7620 us/op 0.82
copy serialized AttesterSlashing (33232 B) 5.7870 us/op 11.142 us/op 0.52
transfer serialized Small SignedBeaconBlock (128000 B) 4.0750 us/op 5.3730 us/op 0.76
copy serialized Small SignedBeaconBlock (128000 B) 19.130 us/op 31.041 us/op 0.62
transfer serialized Avg SignedBeaconBlock (200000 B) 3.9940 us/op 5.2640 us/op 0.76
copy serialized Avg SignedBeaconBlock (200000 B) 15.524 us/op 43.634 us/op 0.36
transfer serialized BlobsSidecar (524380 B) 4.9600 us/op 6.1370 us/op 0.81
copy serialized BlobsSidecar (524380 B) 76.772 us/op 134.47 us/op 0.57
transfer serialized Big SignedBeaconBlock (1000000 B) 4.9720 us/op 7.6700 us/op 0.65
copy serialized Big SignedBeaconBlock (1000000 B) 142.22 us/op 413.97 us/op 0.34
pass gossip attestations to forkchoice per slot 2.8462 ms/op 3.1547 ms/op 0.90
forkChoice updateHead vc 100000 bc 64 eq 0 442.19 us/op 584.78 us/op 0.76
forkChoice updateHead vc 600000 bc 64 eq 0 2.6204 ms/op 4.1647 ms/op 0.63
forkChoice updateHead vc 1000000 bc 64 eq 0 3.5498 ms/op 6.1926 ms/op 0.57
forkChoice updateHead vc 600000 bc 320 eq 0 2.1794 ms/op 4.0460 ms/op 0.54
forkChoice updateHead vc 600000 bc 1200 eq 0 2.1997 ms/op 4.0646 ms/op 0.54
forkChoice updateHead vc 600000 bc 7200 eq 0 2.5281 ms/op 4.4180 ms/op 0.57
forkChoice updateHead vc 600000 bc 64 eq 1000 9.4866 ms/op 12.155 ms/op 0.78
forkChoice updateHead vc 600000 bc 64 eq 10000 9.7289 ms/op 11.897 ms/op 0.82
forkChoice updateHead vc 600000 bc 64 eq 300000 11.733 ms/op 34.006 ms/op 0.35
computeDeltas 500000 validators 300 proto nodes 3.5991 ms/op 4.7812 ms/op 0.75
computeDeltas 500000 validators 1200 proto nodes 3.6032 ms/op 4.4770 ms/op 0.80
computeDeltas 500000 validators 7200 proto nodes 3.6323 ms/op 4.1910 ms/op 0.87
computeDeltas 750000 validators 300 proto nodes 5.3321 ms/op 6.1720 ms/op 0.86
computeDeltas 750000 validators 1200 proto nodes 5.4025 ms/op 6.1564 ms/op 0.88
computeDeltas 750000 validators 7200 proto nodes 5.5212 ms/op 6.2562 ms/op 0.88
computeDeltas 1400000 validators 300 proto nodes 10.445 ms/op 11.480 ms/op 0.91
computeDeltas 1400000 validators 1200 proto nodes 10.200 ms/op 11.471 ms/op 0.89
computeDeltas 1400000 validators 7200 proto nodes 10.260 ms/op 11.926 ms/op 0.86
computeDeltas 2100000 validators 300 proto nodes 14.988 ms/op 18.144 ms/op 0.83
computeDeltas 2100000 validators 1200 proto nodes 14.440 ms/op 18.041 ms/op 0.80
computeDeltas 2100000 validators 7200 proto nodes 14.929 ms/op 17.484 ms/op 0.85
altair processAttestation - 250000 vs - 7PWei normalcase 1.9303 ms/op 2.2826 ms/op 0.85
altair processAttestation - 250000 vs - 7PWei worstcase 2.5738 ms/op 3.0007 ms/op 0.86
altair processAttestation - setStatus - 1/6 committees join 111.99 us/op 143.21 us/op 0.78
altair processAttestation - setStatus - 1/3 committees join 199.35 us/op 250.55 us/op 0.80
altair processAttestation - setStatus - 1/2 committees join 262.25 us/op 357.22 us/op 0.73
altair processAttestation - setStatus - 2/3 committees join 370.87 us/op 457.88 us/op 0.81
altair processAttestation - setStatus - 4/5 committees join 532.36 us/op 620.19 us/op 0.86
altair processAttestation - setStatus - 100% committees join 637.37 us/op 742.53 us/op 0.86
altair processBlock - 250000 vs - 7PWei normalcase 5.3097 ms/op 5.4285 ms/op 0.98
altair processBlock - 250000 vs - 7PWei normalcase hashState 32.299 ms/op 27.695 ms/op 1.17
altair processBlock - 250000 vs - 7PWei worstcase 35.974 ms/op 37.024 ms/op 0.97
altair processBlock - 250000 vs - 7PWei worstcase hashState 67.466 ms/op 75.333 ms/op 0.90
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7150 ms/op 1.8570 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 26.044 ms/op 21.557 ms/op 1.21
altair processEth1Data - 250000 vs - 7PWei normalcase 440.08 us/op 332.45 us/op 1.32
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.7560 us/op 10.045 us/op 0.87
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 61.099 us/op 56.312 us/op 1.09
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 14.166 us/op 15.971 us/op 0.89
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 11.569 us/op 9.8060 us/op 1.18
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 141.13 us/op 184.46 us/op 0.77
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0361 ms/op 1.1944 ms/op 0.87
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1850 ms/op 1.6389 ms/op 0.72
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4766 ms/op 1.6274 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.6963 ms/op 3.9361 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.3003 ms/op 1.9314 ms/op 0.67
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9690 ms/op 3.9958 ms/op 0.99
Tree 40 250000 create 237.18 ms/op 271.69 ms/op 0.87
Tree 40 250000 get(125000) 137.25 ns/op 156.27 ns/op 0.88
Tree 40 250000 set(125000) 524.14 ns/op 756.15 ns/op 0.69
Tree 40 250000 toArray() 17.683 ms/op 18.554 ms/op 0.95
Tree 40 250000 iterate all - toArray() + loop 17.362 ms/op 19.159 ms/op 0.91
Tree 40 250000 iterate all - get(i) 49.429 ms/op 56.087 ms/op 0.88
Array 250000 create 3.5331 ms/op 3.2350 ms/op 1.09
Array 250000 clone - spread 1.3248 ms/op 1.4050 ms/op 0.94
Array 250000 get(125000) 0.60700 ns/op 0.42500 ns/op 1.43
Array 250000 set(125000) 0.62100 ns/op 0.47800 ns/op 1.30
Array 250000 iterate all - loop 78.643 us/op 106.82 us/op 0.74
phase0 afterProcessEpoch - 250000 vs - 7PWei 45.756 ms/op 52.097 ms/op 0.88
Array.fill - length 1000000 3.1814 ms/op 3.5522 ms/op 0.90
Array push - length 1000000 17.802 ms/op 17.654 ms/op 1.01
Array.get 0.27041 ns/op 0.29367 ns/op 0.92
Uint8Array.get 0.34861 ns/op 0.45416 ns/op 0.77
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.658 ms/op 17.549 ms/op 1.06
altair processEpoch - mainnet_e81889 315.44 ms/op 264.57 ms/op 1.19
mainnet_e81889 - altair beforeProcessEpoch 21.215 ms/op 19.404 ms/op 1.09
mainnet_e81889 - altair processJustificationAndFinalization 16.949 us/op 15.957 us/op 1.06
mainnet_e81889 - altair processInactivityUpdates 6.0884 ms/op 8.5300 ms/op 0.71
mainnet_e81889 - altair processRewardsAndPenalties 48.496 ms/op 42.729 ms/op 1.13
mainnet_e81889 - altair processRegistryUpdates 3.2220 us/op 3.3890 us/op 0.95
mainnet_e81889 - altair processSlashings 1.5030 us/op 507.00 ns/op 2.96
mainnet_e81889 - altair processEth1DataReset 1.1300 us/op 617.00 ns/op 1.83
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7659 ms/op 1.4667 ms/op 1.20
mainnet_e81889 - altair processSlashingsReset 3.5730 us/op 4.8080 us/op 0.74
mainnet_e81889 - altair processRandaoMixesReset 6.2180 us/op 5.2680 us/op 1.18
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0630 us/op 1.0070 us/op 1.06
mainnet_e81889 - altair processParticipationFlagUpdates 2.8010 us/op 1.7550 us/op 1.60
mainnet_e81889 - altair processSyncCommitteeUpdates 1.3650 us/op 596.00 ns/op 2.29
mainnet_e81889 - altair afterProcessEpoch 44.127 ms/op 51.941 ms/op 0.85
capella processEpoch - mainnet_e217614 977.83 ms/op 1.0671 s/op 0.92
mainnet_e217614 - capella beforeProcessEpoch 60.638 ms/op 72.689 ms/op 0.83
mainnet_e217614 - capella processJustificationAndFinalization 13.113 us/op 13.458 us/op 0.97
mainnet_e217614 - capella processInactivityUpdates 11.909 ms/op 17.775 ms/op 0.67
mainnet_e217614 - capella processRewardsAndPenalties 244.97 ms/op 223.04 ms/op 1.10
mainnet_e217614 - capella processRegistryUpdates 14.710 us/op 16.420 us/op 0.90
mainnet_e217614 - capella processSlashings 888.00 ns/op 789.00 ns/op 1.13
mainnet_e217614 - capella processEth1DataReset 794.00 ns/op 578.00 ns/op 1.37
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.1163 ms/op 13.528 ms/op 0.30
mainnet_e217614 - capella processSlashingsReset 1.4750 us/op 2.7600 us/op 0.53
mainnet_e217614 - capella processRandaoMixesReset 2.2430 us/op 5.5180 us/op 0.41
mainnet_e217614 - capella processHistoricalRootsUpdate 834.00 ns/op 630.00 ns/op 1.32
mainnet_e217614 - capella processParticipationFlagUpdates 3.9260 us/op 1.9420 us/op 2.02
mainnet_e217614 - capella afterProcessEpoch 104.82 ms/op 127.89 ms/op 0.82
phase0 processEpoch - mainnet_e58758 310.94 ms/op 356.22 ms/op 0.87
mainnet_e58758 - phase0 beforeProcessEpoch 64.743 ms/op 87.212 ms/op 0.74
mainnet_e58758 - phase0 processJustificationAndFinalization 15.404 us/op 19.794 us/op 0.78
mainnet_e58758 - phase0 processRewardsAndPenalties 25.774 ms/op 23.671 ms/op 1.09
mainnet_e58758 - phase0 processRegistryUpdates 10.996 us/op 12.526 us/op 0.88
mainnet_e58758 - phase0 processSlashings 1.2390 us/op 512.00 ns/op 2.42
mainnet_e58758 - phase0 processEth1DataReset 1.0170 us/op 455.00 ns/op 2.24
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 913.57 us/op 1.2097 ms/op 0.76
mainnet_e58758 - phase0 processSlashingsReset 4.9260 us/op 3.1610 us/op 1.56
mainnet_e58758 - phase0 processRandaoMixesReset 8.2600 us/op 5.4300 us/op 1.52
mainnet_e58758 - phase0 processHistoricalRootsUpdate 947.00 ns/op 515.00 ns/op 1.84
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.2070 us/op 4.6070 us/op 1.35
mainnet_e58758 - phase0 afterProcessEpoch 36.373 ms/op 44.977 ms/op 0.81
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1508 ms/op 1.3549 ms/op 0.85
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.6827 ms/op 2.4316 ms/op 1.51
altair processInactivityUpdates - 250000 normalcase 18.881 ms/op 15.994 ms/op 1.18
altair processInactivityUpdates - 250000 worstcase 14.941 ms/op 15.925 ms/op 0.94
phase0 processRegistryUpdates - 250000 normalcase 12.521 us/op 9.0230 us/op 1.39
phase0 processRegistryUpdates - 250000 badcase_full_deposits 297.27 us/op 347.52 us/op 0.86
phase0 processRegistryUpdates - 250000 worstcase 0.5 110.49 ms/op 122.09 ms/op 0.90
altair processRewardsAndPenalties - 250000 normalcase 39.790 ms/op 37.895 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 36.782 ms/op 36.061 ms/op 1.02
phase0 getAttestationDeltas - 250000 normalcase 6.5831 ms/op 10.011 ms/op 0.66
phase0 getAttestationDeltas - 250000 worstcase 6.5481 ms/op 8.2209 ms/op 0.80
phase0 processSlashings - 250000 worstcase 102.01 us/op 101.58 us/op 1.00
altair processSyncCommitteeUpdates - 250000 109.31 ms/op 130.46 ms/op 0.84
BeaconState.hashTreeRoot - No change 486.00 ns/op 254.00 ns/op 1.91
BeaconState.hashTreeRoot - 1 full validator 111.04 us/op 104.10 us/op 1.07
BeaconState.hashTreeRoot - 32 full validator 1.2494 ms/op 1.1865 ms/op 1.05
BeaconState.hashTreeRoot - 512 full validator 11.962 ms/op 13.760 ms/op 0.87
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 153.29 us/op 140.62 us/op 1.09
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7355 ms/op 2.0469 ms/op 0.85
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 24.420 ms/op 29.471 ms/op 0.83
BeaconState.hashTreeRoot - 1 balances 85.991 us/op 142.75 us/op 0.60
BeaconState.hashTreeRoot - 32 balances 1.0655 ms/op 1.4452 ms/op 0.74
BeaconState.hashTreeRoot - 512 balances 7.1515 ms/op 8.6075 ms/op 0.83
BeaconState.hashTreeRoot - 250000 balances 165.11 ms/op 171.09 ms/op 0.97
aggregationBits - 2048 els - zipIndexesInBitList 20.089 us/op 29.627 us/op 0.68
byteArrayEquals 32 48.103 ns/op 57.597 ns/op 0.84
Buffer.compare 32 16.148 ns/op 18.720 ns/op 0.86
byteArrayEquals 1024 1.2565 us/op 1.6746 us/op 0.75
Buffer.compare 1024 26.169 ns/op 27.366 ns/op 0.96
byteArrayEquals 16384 20.427 us/op 27.712 us/op 0.74
Buffer.compare 16384 153.60 ns/op 211.37 ns/op 0.73
byteArrayEquals 123687377 153.43 ms/op 199.33 ms/op 0.77
Buffer.compare 123687377 5.1758 ms/op 8.5899 ms/op 0.60
byteArrayEquals 32 - diff last byte 46.921 ns/op 53.543 ns/op 0.88
Buffer.compare 32 - diff last byte 16.199 ns/op 17.633 ns/op 0.92
byteArrayEquals 1024 - diff last byte 1.2480 us/op 1.6067 us/op 0.78
Buffer.compare 1024 - diff last byte 24.842 ns/op 25.754 ns/op 0.96
byteArrayEquals 16384 - diff last byte 20.819 us/op 25.584 us/op 0.81
Buffer.compare 16384 - diff last byte 181.86 ns/op 207.59 ns/op 0.88
byteArrayEquals 123687377 - diff last byte 150.25 ms/op 192.86 ms/op 0.78
Buffer.compare 123687377 - diff last byte 4.1335 ms/op 6.8308 ms/op 0.61
byteArrayEquals 32 - random bytes 4.7800 ns/op 5.2270 ns/op 0.91
Buffer.compare 32 - random bytes 17.271 ns/op 18.419 ns/op 0.94
byteArrayEquals 1024 - random bytes 4.9020 ns/op 5.2030 ns/op 0.94
Buffer.compare 1024 - random bytes 17.076 ns/op 17.571 ns/op 0.97
byteArrayEquals 16384 - random bytes 4.7950 ns/op 5.1450 ns/op 0.93
Buffer.compare 16384 - random bytes 15.947 ns/op 17.548 ns/op 0.91
byteArrayEquals 123687377 - random bytes 7.7500 ns/op 6.5600 ns/op 1.18
Buffer.compare 123687377 - random bytes 20.120 ns/op 18.610 ns/op 1.08
regular array get 100000 times 30.203 us/op 33.376 us/op 0.90
wrappedArray get 100000 times 30.129 us/op 43.344 us/op 0.70
arrayWithProxy get 100000 times 9.6819 ms/op 12.489 ms/op 0.78
ssz.Root.equals 39.156 ns/op 46.724 ns/op 0.84
byteArrayEquals 42.687 ns/op 46.086 ns/op 0.93
Buffer.compare 9.7790 ns/op 10.731 ns/op 0.91
processSlot - 1 slots 10.658 us/op 13.536 us/op 0.79
processSlot - 32 slots 2.3594 ms/op 2.7079 ms/op 0.87
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.986 ms/op 36.800 ms/op 1.01
getCommitteeAssignments - req 1 vs - 250000 vc 1.8021 ms/op 2.1494 ms/op 0.84
getCommitteeAssignments - req 100 vs - 250000 vc 3.5147 ms/op 4.1315 ms/op 0.85
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8280 ms/op 4.4338 ms/op 0.86
findModifiedValidators - 10000 modified validators 237.80 ms/op 252.55 ms/op 0.94
findModifiedValidators - 1000 modified validators 151.43 ms/op 200.17 ms/op 0.76
findModifiedValidators - 100 modified validators 152.95 ms/op 167.98 ms/op 0.91
findModifiedValidators - 10 modified validators 131.63 ms/op 175.05 ms/op 0.75
findModifiedValidators - 1 modified validators 147.52 ms/op 165.64 ms/op 0.89
findModifiedValidators - no difference 156.66 ms/op 199.45 ms/op 0.79
compare ViewDUs 3.9007 s/op 3.1830 s/op 1.23
compare each validator Uint8Array 1.3682 s/op 1.1907 s/op 1.15
compare ViewDU to Uint8Array 908.24 ms/op 1.0481 s/op 0.87
migrate state 1000000 validators, 24 modified, 0 new 788.39 ms/op 739.99 ms/op 1.07
migrate state 1000000 validators, 1700 modified, 1000 new 1.0057 s/op 1.0100 s/op 1.00
migrate state 1000000 validators, 3400 modified, 2000 new 1.1174 s/op 1.1332 s/op 0.99
migrate state 1500000 validators, 24 modified, 0 new 776.69 ms/op 790.89 ms/op 0.98
migrate state 1500000 validators, 1700 modified, 1000 new 1.1490 s/op 1.0999 s/op 1.04
migrate state 1500000 validators, 3400 modified, 2000 new 1.2732 s/op 1.4012 s/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.8100 ns/op 5.5700 ns/op 1.22
state getBlockRootAtSlot - 250000 vs - 7PWei 893.69 ns/op 669.36 ns/op 1.34
computeProposers - vc 250000 6.9402 ms/op 8.1320 ms/op 0.85
computeEpochShuffling - vc 250000 37.996 ms/op 45.392 ms/op 0.84
getNextSyncCommittee - vc 250000 117.71 ms/op 160.02 ms/op 0.74
computeSigningRoot for AttestationData 28.901 us/op 23.964 us/op 1.21
hash AttestationData serialized data then Buffer.toString(base64) 1.2387 us/op 1.6591 us/op 0.75
toHexString serialized data 938.13 ns/op 1.0826 us/op 0.87
Buffer.toString(base64) 137.06 ns/op 204.05 ns/op 0.67
nodejs block root to RootHex using toHex 119.76 ns/op 153.15 ns/op 0.78
nodejs block root to RootHex using toRootHex 78.776 ns/op 97.897 ns/op 0.80
browser block root to RootHex using the deprecated toHexString 216.44 ns/op 239.05 ns/op 0.91
browser block root to RootHex using toHex 168.47 ns/op 189.34 ns/op 0.89
browser block root to RootHex using toRootHex 145.13 ns/op 175.75 ns/op 0.83

by benchmarkbot/action

@nflaig nflaig requested a review from nazarhussain January 7, 2025 14:30
@nflaig nflaig merged commit c9bb826 into unstable Jan 7, 2025
18 of 20 checks passed
@nflaig nflaig deleted the nflaig/proposer-cache-tests branch January 7, 2025 15:13
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