Skip to content

feat: implement focil EIP-7805 #7342

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

Draft
wants to merge 82 commits into
base: unstable
Choose a base branch
from
Draft

feat: implement focil EIP-7805 #7342

wants to merge 82 commits into from

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Jan 9, 2025

Do not merge - PR for reference only

Relevant issue #7340

@nflaig nflaig assigned nflaig and unassigned nflaig Jan 9, 2025
@nflaig nflaig added the status-do-not-merge Merging this issue will break the build. Do not merge! label Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: e758f2e Previous: 1d9f4aa Ratio
Array.fill - length 1000000 2.5407 ms/op 8.1017 ms/op 0.31
Buffer.compare 123687377 - diff last byte 3.7758 ms/op 11.858 ms/op 0.32
Full benchmark results
Benchmark suite Current: e758f2e Previous: 1d9f4aa Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 733.16 us/op 990.45 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 29.742 us/op 36.611 us/op 0.81
BLS verify - blst 875.28 us/op 729.36 us/op 1.20
BLS verifyMultipleSignatures 3 - blst 1.2992 ms/op 1.1921 ms/op 1.09
BLS verifyMultipleSignatures 8 - blst 2.2161 ms/op 1.9025 ms/op 1.16
BLS verifyMultipleSignatures 32 - blst 4.4301 ms/op 4.9447 ms/op 0.90
BLS verifyMultipleSignatures 64 - blst 8.2639 ms/op 9.1550 ms/op 0.90
BLS verifyMultipleSignatures 128 - blst 15.716 ms/op 17.507 ms/op 0.90
BLS deserializing 10000 signatures 592.71 ms/op 697.51 ms/op 0.85
BLS deserializing 100000 signatures 5.8706 s/op 7.1651 s/op 0.82
BLS verifyMultipleSignatures - same message - 3 - blst 931.59 us/op 973.50 us/op 0.96
BLS verifyMultipleSignatures - same message - 8 - blst 1.0796 ms/op 1.0399 ms/op 1.04
BLS verifyMultipleSignatures - same message - 32 - blst 1.7089 ms/op 1.7261 ms/op 0.99
BLS verifyMultipleSignatures - same message - 64 - blst 2.5595 ms/op 2.6891 ms/op 0.95
BLS verifyMultipleSignatures - same message - 128 - blst 4.1813 ms/op 4.5943 ms/op 0.91
BLS aggregatePubkeys 32 - blst 17.560 us/op 20.139 us/op 0.87
BLS aggregatePubkeys 128 - blst 62.200 us/op 71.603 us/op 0.87
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 40.144 ms/op 51.258 ms/op 0.78
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 40.994 ms/op 46.429 ms/op 0.88
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 29.932 ms/op 37.537 ms/op 0.80
getSlashingsAndExits - default max 46.868 us/op 77.215 us/op 0.61
getSlashingsAndExits - 2k 218.22 us/op 346.07 us/op 0.63
proposeBlockBody type=full, size=empty 4.8495 ms/op 7.3689 ms/op 0.66
isKnown best case - 1 super set check 413.00 ns/op 229.00 ns/op 1.80
isKnown normal case - 2 super set checks 409.00 ns/op 221.00 ns/op 1.85
isKnown worse case - 16 super set checks 412.00 ns/op 220.00 ns/op 1.87
InMemoryCheckpointStateCache - add get delete 2.4600 us/op 2.4640 us/op 1.00
validate api signedAggregateAndProof - struct 1.9406 ms/op 1.6408 ms/op 1.18
validate gossip signedAggregateAndProof - struct 1.5069 ms/op 1.4757 ms/op 1.02
batch validate gossip attestation - vc 640000 - chunk 32 106.52 us/op 121.75 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 64 92.004 us/op 106.97 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 128 81.925 us/op 98.660 us/op 0.83
batch validate gossip attestation - vc 640000 - chunk 256 82.305 us/op 101.40 us/op 0.81
pickEth1Vote - no votes 690.21 us/op 970.77 us/op 0.71
pickEth1Vote - max votes 5.9774 ms/op 5.5442 ms/op 1.08
pickEth1Vote - Eth1Data hashTreeRoot value x2048 10.892 ms/op 11.780 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.622 ms/op 18.736 ms/op 0.78
pickEth1Vote - Eth1Data fastSerialize value x2048 371.02 us/op 450.35 us/op 0.82
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.3551 ms/op 4.3275 ms/op 0.78
bytes32 toHexString 531.00 ns/op 375.00 ns/op 1.42
bytes32 Buffer.toString(hex) 412.00 ns/op 252.00 ns/op 1.63
bytes32 Buffer.toString(hex) from Uint8Array 525.00 ns/op 343.00 ns/op 1.53
bytes32 Buffer.toString(hex) + 0x 382.00 ns/op 266.00 ns/op 1.44
Object access 1 prop 0.28100 ns/op 0.12000 ns/op 2.34
Map access 1 prop 0.28000 ns/op 0.12500 ns/op 2.24
Object get x1000 4.6020 ns/op 5.9640 ns/op 0.77
Map get x1000 5.1510 ns/op 6.6120 ns/op 0.78
Object set x1000 17.831 ns/op 31.176 ns/op 0.57
Map set x1000 15.376 ns/op 21.101 ns/op 0.73
Return object 10000 times 0.25680 ns/op 0.29530 ns/op 0.87
Throw Error 10000 times 3.0876 us/op 4.4981 us/op 0.69
toHex 87.116 ns/op 133.32 ns/op 0.65
Buffer.from 82.500 ns/op 124.72 ns/op 0.66
shared Buffer 58.973 ns/op 89.605 ns/op 0.66
fastMsgIdFn sha256 / 200 bytes 1.7890 us/op 2.2600 us/op 0.79
fastMsgIdFn h32 xxhash / 200 bytes 384.00 ns/op 207.00 ns/op 1.86
fastMsgIdFn h64 xxhash / 200 bytes 417.00 ns/op 273.00 ns/op 1.53
fastMsgIdFn sha256 / 1000 bytes 5.7260 us/op 7.5810 us/op 0.76
fastMsgIdFn h32 xxhash / 1000 bytes 497.00 ns/op 335.00 ns/op 1.48
fastMsgIdFn h64 xxhash / 1000 bytes 504.00 ns/op 346.00 ns/op 1.46
fastMsgIdFn sha256 / 10000 bytes 49.500 us/op 66.447 us/op 0.74
fastMsgIdFn h32 xxhash / 10000 bytes 1.8370 us/op 1.8410 us/op 1.00
fastMsgIdFn h64 xxhash / 10000 bytes 1.2960 us/op 1.2240 us/op 1.06
send data - 1000 256B messages 9.3899 ms/op 11.998 ms/op 0.78
send data - 1000 512B messages 12.657 ms/op 17.364 ms/op 0.73
send data - 1000 1024B messages 19.342 ms/op 27.358 ms/op 0.71
send data - 1000 1200B messages 14.008 ms/op 23.883 ms/op 0.59
send data - 1000 2048B messages 15.719 ms/op 25.690 ms/op 0.61
send data - 1000 4096B messages 15.747 ms/op 29.405 ms/op 0.54
send data - 1000 16384B messages 46.213 ms/op 61.718 ms/op 0.75
send data - 1000 65536B messages 254.75 ms/op 263.20 ms/op 0.97
enrSubnets - fastDeserialize 64 bits 966.00 ns/op 900.00 ns/op 1.07
enrSubnets - ssz BitVector 64 bits 498.00 ns/op 343.00 ns/op 1.45
enrSubnets - fastDeserialize 4 bits 320.00 ns/op 124.00 ns/op 2.58
enrSubnets - ssz BitVector 4 bits 487.00 ns/op 338.00 ns/op 1.44
prioritizePeers score -10:0 att 32-0.1 sync 2-0 100.49 us/op 122.01 us/op 0.82
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 112.30 us/op 147.18 us/op 0.76
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 165.28 us/op 218.24 us/op 0.76
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 302.28 us/op 404.81 us/op 0.75
prioritizePeers score 0:0 att 64-1 sync 4-1 358.47 us/op 480.94 us/op 0.75
array of 16000 items push then shift 1.2572 us/op 1.6465 us/op 0.76
LinkedList of 16000 items push then shift 6.4550 ns/op 7.3080 ns/op 0.88
array of 16000 items push then pop 59.641 ns/op 76.324 ns/op 0.78
LinkedList of 16000 items push then pop 6.2410 ns/op 7.0420 ns/op 0.89
array of 24000 items push then shift 1.8544 us/op 2.4466 us/op 0.76
LinkedList of 24000 items push then shift 6.3010 ns/op 7.3080 ns/op 0.86
array of 24000 items push then pop 83.362 ns/op 105.23 ns/op 0.79
LinkedList of 24000 items push then pop 6.0760 ns/op 7.2860 ns/op 0.83
intersect bitArray bitLen 8 5.4210 ns/op 6.6340 ns/op 0.82
intersect array and set length 8 32.383 ns/op 39.459 ns/op 0.82
intersect bitArray bitLen 128 26.013 ns/op 31.052 ns/op 0.84
intersect array and set length 128 537.77 ns/op 648.58 ns/op 0.83
bitArray.getTrueBitIndexes() bitLen 128 1.1030 us/op 1.0240 us/op 1.08
bitArray.getTrueBitIndexes() bitLen 248 1.7520 us/op 1.7870 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 512 3.2220 us/op 3.6790 us/op 0.88
Buffer.concat 32 items 791.00 ns/op 617.00 ns/op 1.28
Uint8Array.set 32 items 1.1090 us/op 987.00 ns/op 1.12
Buffer.copy 2.4040 us/op 2.3640 us/op 1.02
Uint8Array.set - with subarray 1.6920 us/op 1.9150 us/op 0.88
Uint8Array.set - without subarray 1.0300 us/op 1.5630 us/op 0.66
getUint32 - dataview 380.00 ns/op 204.00 ns/op 1.86
getUint32 - manual 295.00 ns/op 120.00 ns/op 2.46
Set add up to 64 items then delete first 1.7453 us/op 2.4568 us/op 0.71
OrderedSet add up to 64 items then delete first 2.7369 us/op 3.8130 us/op 0.72
Set add up to 64 items then delete last 2.0186 us/op 2.4752 us/op 0.82
OrderedSet add up to 64 items then delete last 3.0121 us/op 3.8394 us/op 0.78
Set add up to 64 items then delete middle 2.0219 us/op 2.5617 us/op 0.79
OrderedSet add up to 64 items then delete middle 4.3931 us/op 5.4478 us/op 0.81
Set add up to 128 items then delete first 4.0013 us/op 5.2158 us/op 0.77
OrderedSet add up to 128 items then delete first 6.2279 us/op 8.1701 us/op 0.76
Set add up to 128 items then delete last 3.8396 us/op 5.2935 us/op 0.73
OrderedSet add up to 128 items then delete last 5.8302 us/op 7.9617 us/op 0.73
Set add up to 128 items then delete middle 3.8434 us/op 5.8567 us/op 0.66
OrderedSet add up to 128 items then delete middle 11.335 us/op 16.442 us/op 0.69
Set add up to 256 items then delete first 7.7794 us/op 13.197 us/op 0.59
OrderedSet add up to 256 items then delete first 12.179 us/op 18.587 us/op 0.66
Set add up to 256 items then delete last 7.5351 us/op 10.361 us/op 0.73
OrderedSet add up to 256 items then delete last 11.491 us/op 15.880 us/op 0.72
Set add up to 256 items then delete middle 7.4981 us/op 12.014 us/op 0.62
OrderedSet add up to 256 items then delete middle 33.053 us/op 45.400 us/op 0.73
transfer serialized Status (84 B) 1.9500 us/op 2.3470 us/op 0.83
copy serialized Status (84 B) 1.1790 us/op 1.2760 us/op 0.92
transfer serialized SignedVoluntaryExit (112 B) 1.9920 us/op 2.3360 us/op 0.85
copy serialized SignedVoluntaryExit (112 B) 1.2880 us/op 1.2970 us/op 0.99
transfer serialized ProposerSlashing (416 B) 3.2400 us/op 2.6340 us/op 1.23
copy serialized ProposerSlashing (416 B) 2.5810 us/op 2.1890 us/op 1.18
transfer serialized Attestation (485 B) 3.3260 us/op 3.2410 us/op 1.03
copy serialized Attestation (485 B) 2.2340 us/op 1.9750 us/op 1.13
transfer serialized AttesterSlashing (33232 B) 2.9640 us/op 2.6590 us/op 1.11
copy serialized AttesterSlashing (33232 B) 3.8990 us/op 4.6610 us/op 0.84
transfer serialized Small SignedBeaconBlock (128000 B) 2.3300 us/op 3.0370 us/op 0.77
copy serialized Small SignedBeaconBlock (128000 B) 6.3360 us/op 11.658 us/op 0.54
transfer serialized Avg SignedBeaconBlock (200000 B) 2.4600 us/op 3.5280 us/op 0.70
copy serialized Avg SignedBeaconBlock (200000 B) 8.2040 us/op 16.445 us/op 0.50
transfer serialized BlobsSidecar (524380 B) 3.2000 us/op 3.8160 us/op 0.84
copy serialized BlobsSidecar (524380 B) 56.024 us/op 182.87 us/op 0.31
transfer serialized Big SignedBeaconBlock (1000000 B) 3.6870 us/op 4.2680 us/op 0.86
copy serialized Big SignedBeaconBlock (1000000 B) 106.06 us/op 175.47 us/op 0.60
pass gossip attestations to forkchoice per slot 2.3276 ms/op 2.8392 ms/op 0.82
forkChoice updateHead vc 100000 bc 64 eq 0 385.24 us/op 464.90 us/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 0 2.2970 ms/op 3.0187 ms/op 0.76
forkChoice updateHead vc 1000000 bc 64 eq 0 3.7836 ms/op 5.1128 ms/op 0.74
forkChoice updateHead vc 600000 bc 320 eq 0 2.2637 ms/op 3.0509 ms/op 0.74
forkChoice updateHead vc 600000 bc 1200 eq 0 2.3579 ms/op 3.0291 ms/op 0.78
forkChoice updateHead vc 600000 bc 7200 eq 0 2.4864 ms/op 3.4374 ms/op 0.72
forkChoice updateHead vc 600000 bc 64 eq 1000 9.3736 ms/op 10.758 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 10000 9.2795 ms/op 10.599 ms/op 0.88
forkChoice updateHead vc 600000 bc 64 eq 300000 10.576 ms/op 16.303 ms/op 0.65
computeDeltas 500000 validators 300 proto nodes 2.9473 ms/op 4.2359 ms/op 0.70
computeDeltas 500000 validators 1200 proto nodes 2.9813 ms/op 4.2177 ms/op 0.71
computeDeltas 500000 validators 7200 proto nodes 2.9277 ms/op 5.3819 ms/op 0.54
computeDeltas 750000 validators 300 proto nodes 4.7315 ms/op 6.5378 ms/op 0.72
computeDeltas 750000 validators 1200 proto nodes 4.5136 ms/op 6.6506 ms/op 0.68
computeDeltas 750000 validators 7200 proto nodes 4.5713 ms/op 6.9202 ms/op 0.66
computeDeltas 1400000 validators 300 proto nodes 8.5515 ms/op 13.386 ms/op 0.64
computeDeltas 1400000 validators 1200 proto nodes 8.3859 ms/op 14.697 ms/op 0.57
computeDeltas 1400000 validators 7200 proto nodes 8.7841 ms/op 13.069 ms/op 0.67
computeDeltas 2100000 validators 300 proto nodes 12.527 ms/op 19.298 ms/op 0.65
computeDeltas 2100000 validators 1200 proto nodes 12.805 ms/op 18.569 ms/op 0.69
computeDeltas 2100000 validators 7200 proto nodes 12.943 ms/op 18.547 ms/op 0.70
altair processAttestation - 250000 vs - 7PWei normalcase 1.6420 ms/op 3.2097 ms/op 0.51
altair processAttestation - 250000 vs - 7PWei worstcase 2.3966 ms/op 3.8043 ms/op 0.63
altair processAttestation - setStatus - 1/6 committees join 99.719 us/op 138.46 us/op 0.72
altair processAttestation - setStatus - 1/3 committees join 175.33 us/op 361.28 us/op 0.49
altair processAttestation - setStatus - 1/2 committees join 280.37 us/op 367.49 us/op 0.76
altair processAttestation - setStatus - 2/3 committees join 366.22 us/op 506.40 us/op 0.72
altair processAttestation - setStatus - 4/5 committees join 464.27 us/op 705.60 us/op 0.66
altair processAttestation - setStatus - 100% committees join 609.34 us/op 813.64 us/op 0.75
altair processBlock - 250000 vs - 7PWei normalcase 4.0754 ms/op 5.6942 ms/op 0.72
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.927 ms/op 38.786 ms/op 0.64
altair processBlock - 250000 vs - 7PWei worstcase 38.588 ms/op 50.850 ms/op 0.76
altair processBlock - 250000 vs - 7PWei worstcase hashState 83.661 ms/op 102.02 ms/op 0.82
phase0 processBlock - 250000 vs - 7PWei normalcase 1.8403 ms/op 2.7786 ms/op 0.66
phase0 processBlock - 250000 vs - 7PWei worstcase 20.158 ms/op 32.400 ms/op 0.62
altair processEth1Data - 250000 vs - 7PWei normalcase 280.24 us/op 408.27 us/op 0.69
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.7940 us/op 10.399 us/op 0.75
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 33.071 us/op 60.800 us/op 0.54
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.7510 us/op 17.579 us/op 0.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.5040 us/op 11.933 us/op 0.55
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 135.77 us/op 222.47 us/op 0.61
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.3295 ms/op 2.0407 ms/op 0.65
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.6009 ms/op 2.7490 ms/op 0.58
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5651 ms/op 2.7721 ms/op 0.56
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.2764 ms/op 6.6867 ms/op 0.49
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6209 ms/op 2.9638 ms/op 0.55
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.2278 ms/op 6.3886 ms/op 0.51
Tree 40 250000 create 356.03 ms/op 742.79 ms/op 0.48
Tree 40 250000 get(125000) 97.936 ns/op 161.67 ns/op 0.61
Tree 40 250000 set(125000) 1.0309 us/op 2.7490 us/op 0.37
Tree 40 250000 toArray() 11.688 ms/op 23.359 ms/op 0.50
Tree 40 250000 iterate all - toArray() + loop 11.661 ms/op 23.478 ms/op 0.50
Tree 40 250000 iterate all - get(i) 35.767 ms/op 83.082 ms/op 0.43
Array 250000 create 2.2102 ms/op 4.6291 ms/op 0.48
Array 250000 clone - spread 596.24 us/op 2.3559 ms/op 0.25
Array 250000 get(125000) 0.53500 ns/op 0.45400 ns/op 1.18
Array 250000 set(125000) 0.55300 ns/op 0.58300 ns/op 0.95
Array 250000 iterate all - loop 99.031 us/op 89.284 us/op 1.11
phase0 afterProcessEpoch - 250000 vs - 7PWei 74.795 ms/op 47.223 ms/op 1.58
Array.fill - length 1000000 2.5407 ms/op 8.1017 ms/op 0.31
Array push - length 1000000 9.1001 ms/op 21.762 ms/op 0.42
Array.get 0.24407 ns/op 0.30168 ns/op 0.81
Uint8Array.get 0.39664 ns/op 0.47583 ns/op 0.83
phase0 beforeProcessEpoch - 250000 vs - 7PWei 11.531 ms/op 26.605 ms/op 0.43
altair processEpoch - mainnet_e81889 312.34 ms/op 342.41 ms/op 0.91
mainnet_e81889 - altair beforeProcessEpoch 15.066 ms/op 26.817 ms/op 0.56
mainnet_e81889 - altair processJustificationAndFinalization 5.3350 us/op 8.3790 us/op 0.64
mainnet_e81889 - altair processInactivityUpdates 3.2022 ms/op 7.7452 ms/op 0.41
mainnet_e81889 - altair processRewardsAndPenalties 38.746 ms/op 75.113 ms/op 0.52
mainnet_e81889 - altair processRegistryUpdates 972.00 ns/op 1.3320 us/op 0.73
mainnet_e81889 - altair processSlashings 396.00 ns/op 314.00 ns/op 1.26
mainnet_e81889 - altair processEth1DataReset 390.00 ns/op 226.00 ns/op 1.73
mainnet_e81889 - altair processEffectiveBalanceUpdates 995.41 us/op 1.6168 ms/op 0.62
mainnet_e81889 - altair processSlashingsReset 1.0910 us/op 1.3720 us/op 0.80
mainnet_e81889 - altair processRandaoMixesReset 1.3430 us/op 1.7530 us/op 0.77
mainnet_e81889 - altair processHistoricalRootsUpdate 395.00 ns/op 250.00 ns/op 1.58
mainnet_e81889 - altair processParticipationFlagUpdates 716.00 ns/op 602.00 ns/op 1.19
mainnet_e81889 - altair processSyncCommitteeUpdates 364.00 ns/op 220.00 ns/op 1.65
mainnet_e81889 - altair afterProcessEpoch 74.321 ms/op 50.472 ms/op 1.47
capella processEpoch - mainnet_e217614 1.0193 s/op 1.1534 s/op 0.88
mainnet_e217614 - capella beforeProcessEpoch 69.010 ms/op 72.511 ms/op 0.95
mainnet_e217614 - capella processJustificationAndFinalization 4.2060 us/op 8.2010 us/op 0.51
mainnet_e217614 - capella processInactivityUpdates 11.656 ms/op 17.256 ms/op 0.68
mainnet_e217614 - capella processRewardsAndPenalties 197.23 ms/op 216.23 ms/op 0.91
mainnet_e217614 - capella processRegistryUpdates 5.1330 us/op 7.0970 us/op 0.72
mainnet_e217614 - capella processSlashings 395.00 ns/op 202.00 ns/op 1.96
mainnet_e217614 - capella processEth1DataReset 392.00 ns/op 200.00 ns/op 1.96
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.3277 ms/op 5.2906 ms/op 0.63
mainnet_e217614 - capella processSlashingsReset 1.0960 us/op 1.3040 us/op 0.84
mainnet_e217614 - capella processRandaoMixesReset 1.2890 us/op 1.5010 us/op 0.86
mainnet_e217614 - capella processHistoricalRootsUpdate 417.00 ns/op 198.00 ns/op 2.11
mainnet_e217614 - capella processParticipationFlagUpdates 697.00 ns/op 598.00 ns/op 1.17
mainnet_e217614 - capella afterProcessEpoch 202.03 ms/op 130.47 ms/op 1.55
phase0 processEpoch - mainnet_e58758 326.71 ms/op 381.92 ms/op 0.86
mainnet_e58758 - phase0 beforeProcessEpoch 70.013 ms/op 114.45 ms/op 0.61
mainnet_e58758 - phase0 processJustificationAndFinalization 5.6900 us/op 9.5220 us/op 0.60
mainnet_e58758 - phase0 processRewardsAndPenalties 40.743 ms/op 45.051 ms/op 0.90
mainnet_e58758 - phase0 processRegistryUpdates 3.5050 us/op 5.1850 us/op 0.68
mainnet_e58758 - phase0 processSlashings 405.00 ns/op 199.00 ns/op 2.04
mainnet_e58758 - phase0 processEth1DataReset 397.00 ns/op 244.00 ns/op 1.63
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 874.52 us/op 2.9572 ms/op 0.30
mainnet_e58758 - phase0 processSlashingsReset 1.0840 us/op 1.1940 us/op 0.91
mainnet_e58758 - phase0 processRandaoMixesReset 1.2080 us/op 1.4570 us/op 0.83
mainnet_e58758 - phase0 processHistoricalRootsUpdate 408.00 ns/op 201.00 ns/op 2.03
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.1370 us/op 1.0080 us/op 1.13
mainnet_e58758 - phase0 afterProcessEpoch 63.023 ms/op 41.073 ms/op 1.53
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1782 ms/op 1.4366 ms/op 0.82
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.2901 ms/op 5.5961 ms/op 0.41
altair processInactivityUpdates - 250000 normalcase 17.661 ms/op 23.096 ms/op 0.76
altair processInactivityUpdates - 250000 worstcase 20.123 ms/op 20.143 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 5.5560 us/op 7.1780 us/op 0.77
phase0 processRegistryUpdates - 250000 badcase_full_deposits 277.70 us/op 299.31 us/op 0.93
phase0 processRegistryUpdates - 250000 worstcase 0.5 106.18 ms/op 126.03 ms/op 0.84
altair processRewardsAndPenalties - 250000 normalcase 29.478 ms/op 31.564 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 25.871 ms/op 26.824 ms/op 0.96
phase0 getAttestationDeltas - 250000 normalcase 5.8998 ms/op 10.912 ms/op 0.54
phase0 getAttestationDeltas - 250000 worstcase 5.1844 ms/op 8.6278 ms/op 0.60
phase0 processSlashings - 250000 worstcase 82.315 us/op 114.42 us/op 0.72
altair processSyncCommitteeUpdates - 250000 9.7075 ms/op 13.859 ms/op 0.70
BeaconState.hashTreeRoot - No change 438.00 ns/op 246.00 ns/op 1.78
BeaconState.hashTreeRoot - 1 full validator 69.072 us/op 83.217 us/op 0.83
BeaconState.hashTreeRoot - 32 full validator 818.47 us/op 1.0525 ms/op 0.78
BeaconState.hashTreeRoot - 512 full validator 9.3942 ms/op 14.527 ms/op 0.65
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 91.628 us/op 132.00 us/op 0.69
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2860 ms/op 2.0138 ms/op 0.64
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 22.648 ms/op 31.021 ms/op 0.73
BeaconState.hashTreeRoot - 1 balances 74.654 us/op 89.376 us/op 0.84
BeaconState.hashTreeRoot - 32 balances 677.75 us/op 986.70 us/op 0.69
BeaconState.hashTreeRoot - 512 balances 8.6195 ms/op 9.9691 ms/op 0.86
BeaconState.hashTreeRoot - 250000 balances 153.14 ms/op 200.35 ms/op 0.76
aggregationBits - 2048 els - zipIndexesInBitList 17.029 us/op 27.326 us/op 0.62
byteArrayEquals 32 42.463 ns/op 59.562 ns/op 0.71
Buffer.compare 32 15.754 ns/op 18.572 ns/op 0.85
byteArrayEquals 1024 1.2507 us/op 1.7177 us/op 0.73
Buffer.compare 1024 25.074 ns/op 29.378 ns/op 0.85
byteArrayEquals 16384 18.931 us/op 27.495 us/op 0.69
Buffer.compare 16384 188.12 ns/op 192.40 ns/op 0.98
byteArrayEquals 123687377 149.44 ms/op 211.29 ms/op 0.71
Buffer.compare 123687377 5.3493 ms/op 10.668 ms/op 0.50
byteArrayEquals 32 - diff last byte 39.888 ns/op 57.531 ns/op 0.69
Buffer.compare 32 - diff last byte 14.962 ns/op 18.804 ns/op 0.80
byteArrayEquals 1024 - diff last byte 1.1894 us/op 1.6968 us/op 0.70
Buffer.compare 1024 - diff last byte 23.022 ns/op 29.834 ns/op 0.77
byteArrayEquals 16384 - diff last byte 19.009 us/op 28.777 us/op 0.66
Buffer.compare 16384 - diff last byte 259.61 ns/op 212.43 ns/op 1.22
byteArrayEquals 123687377 - diff last byte 147.57 ms/op 215.08 ms/op 0.69
Buffer.compare 123687377 - diff last byte 3.7758 ms/op 11.858 ms/op 0.32
byteArrayEquals 32 - random bytes 4.8390 ns/op 5.6980 ns/op 0.85
Buffer.compare 32 - random bytes 16.012 ns/op 20.063 ns/op 0.80
byteArrayEquals 1024 - random bytes 4.8240 ns/op 5.7970 ns/op 0.83
Buffer.compare 1024 - random bytes 15.806 ns/op 19.114 ns/op 0.83
byteArrayEquals 16384 - random bytes 4.8150 ns/op 5.7170 ns/op 0.84
Buffer.compare 16384 - random bytes 15.897 ns/op 19.465 ns/op 0.82
byteArrayEquals 123687377 - random bytes 7.5800 ns/op 7.0900 ns/op 1.07
Buffer.compare 123687377 - random bytes 17.210 ns/op 20.860 ns/op 0.83
regular array get 100000 times 37.553 us/op 36.010 us/op 1.04
wrappedArray get 100000 times 37.387 us/op 36.147 us/op 1.03
arrayWithProxy get 100000 times 8.5588 ms/op 14.985 ms/op 0.57
ssz.Root.equals 37.218 ns/op 51.434 ns/op 0.72
byteArrayEquals 36.251 ns/op 50.010 ns/op 0.72
Buffer.compare 8.3860 ns/op 12.000 ns/op 0.70
processSlot - 1 slots 8.6850 us/op 14.281 us/op 0.61
processSlot - 32 slots 2.0784 ms/op 3.8554 ms/op 0.54
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.1016 ms/op 4.3519 ms/op 0.48
getCommitteeAssignments - req 1 vs - 250000 vc 1.6411 ms/op 2.3361 ms/op 0.70
getCommitteeAssignments - req 100 vs - 250000 vc 3.3485 ms/op 4.8460 ms/op 0.69
getCommitteeAssignments - req 1000 vs - 250000 vc 3.4888 ms/op 4.9581 ms/op 0.70
findModifiedValidators - 10000 modified validators 743.95 ms/op 910.21 ms/op 0.82
findModifiedValidators - 1000 modified validators 661.09 ms/op 852.06 ms/op 0.78
findModifiedValidators - 100 modified validators 172.55 ms/op 247.75 ms/op 0.70
findModifiedValidators - 10 modified validators 203.93 ms/op 262.64 ms/op 0.78
findModifiedValidators - 1 modified validators 221.72 ms/op 250.33 ms/op 0.89
findModifiedValidators - no difference 141.58 ms/op 242.04 ms/op 0.58
compare ViewDUs 6.8273 s/op 7.4586 s/op 0.92
compare each validator Uint8Array 1.1300 s/op 1.4588 s/op 0.77
compare ViewDU to Uint8Array 1.1071 s/op 1.5531 s/op 0.71
migrate state 1000000 validators, 24 modified, 0 new 1.1731 s/op 939.69 ms/op 1.25
migrate state 1000000 validators, 1700 modified, 1000 new 1.3782 s/op 1.1431 s/op 1.21
migrate state 1000000 validators, 3400 modified, 2000 new 1.4740 s/op 1.1617 s/op 1.27
migrate state 1500000 validators, 24 modified, 0 new 1.0150 s/op 869.69 ms/op 1.17
migrate state 1500000 validators, 1700 modified, 1000 new 1.2337 s/op 1.0398 s/op 1.19
migrate state 1500000 validators, 3400 modified, 2000 new 1.4303 s/op 1.3599 s/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.7700 ns/op 4.3700 ns/op 1.32
state getBlockRootAtSlot - 250000 vs - 7PWei 509.64 ns/op 789.24 ns/op 0.65
naive computeProposerIndex 100000 validators 41.177 ms/op 56.798 ms/op 0.72
computeProposerIndex 100000 validators 1.2674 ms/op 1.5146 ms/op 0.84
naiveGetNextSyncCommitteeIndices 1000 validators 6.2407 s/op 7.6535 s/op 0.82
getNextSyncCommitteeIndices 1000 validators 85.074 ms/op 120.80 ms/op 0.70
naiveGetNextSyncCommitteeIndices 10000 validators 6.5433 s/op 8.9001 s/op 0.74
getNextSyncCommitteeIndices 10000 validators 94.939 ms/op 127.37 ms/op 0.75
naiveGetNextSyncCommitteeIndices 100000 validators 6.2047 s/op 8.5760 s/op 0.72
getNextSyncCommitteeIndices 100000 validators 94.474 ms/op 117.02 ms/op 0.81
naive computeShuffledIndex 100000 validators 19.776 s/op 26.503 s/op 0.75
cached computeShuffledIndex 100000 validators 405.15 ms/op 578.12 ms/op 0.70
naive computeShuffledIndex 2000000 validators 405.61 s/op 496.71 s/op 0.82
cached computeShuffledIndex 2000000 validators 14.207 s/op 34.553 s/op 0.41
computeProposers - vc 250000 507.69 us/op 619.37 us/op 0.82
computeEpochShuffling - vc 250000 73.487 ms/op 42.817 ms/op 1.72
getNextSyncCommittee - vc 250000 8.9503 ms/op 10.483 ms/op 0.85
computeSigningRoot for AttestationData 18.391 us/op 19.373 us/op 0.95
hash AttestationData serialized data then Buffer.toString(base64) 1.1821 us/op 1.5252 us/op 0.78
toHexString serialized data 972.08 ns/op 1.0881 us/op 0.89
Buffer.toString(base64) 116.19 ns/op 163.35 ns/op 0.71
nodejs block root to RootHex using toHex 114.55 ns/op 143.59 ns/op 0.80
nodejs block root to RootHex using toRootHex 155.36 ns/op 85.005 ns/op 1.83
browser block root to RootHex using the deprecated toHexString 190.03 ns/op 209.34 ns/op 0.91
browser block root to RootHex using toHex 152.36 ns/op 178.54 ns/op 0.85
browser block root to RootHex using toRootHex 138.89 ns/op 159.84 ns/op 0.87

by benchmarkbot/action

Copy link
Collaborator

@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.

reviewed to keep track and backup if required 👍

Comment on lines 260 to 263
const secToNextSlot = this.config.SECONDS_PER_SLOT - this.chain.clock.secFromSlot(clockSlot);
const secToCutOff = this.config.PROPOSER_INCLUSION_LIST_CUT_OFF - this.chain.clock.secFromSlot(clockSlot);
const sleepTime = Math.min(secToNextSlot, secToCutOff) * 1000;
await sleep(sleepTime, this.signal);
Copy link
Member

@nflaig nflaig Apr 19, 2025

Choose a reason for hiding this comment

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

why can't we just do what I did previously? We either wait until we reach the cutoff or otherwise we just don't sleep at all if for some reason we are past the cut off already (which shouldn't happen)

Suggested change
const secToNextSlot = this.config.SECONDS_PER_SLOT - this.chain.clock.secFromSlot(clockSlot);
const secToCutOff = this.config.PROPOSER_INCLUSION_LIST_CUT_OFF - this.chain.clock.secFromSlot(clockSlot);
const sleepTime = Math.min(secToNextSlot, secToCutOff) * 1000;
await sleep(sleepTime, this.signal);
await sleep(
Math.max(0, (this.config.PROPOSER_INCLUSION_LIST_CUT_OFF - this.chain.clock.secFromSlot(clockSlot)) * 1000),
this.signal
);

Copy link
Contributor Author

@ensi321 ensi321 Apr 19, 2025

Choose a reason for hiding this comment

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

why can't we just do what I did previously? We either wait until we reach the cutoff or otherwise we just don't sleep at all if for some reason we are past the cut off already (which shouldn't happen)

Because the kurtosis config we use when interopping/testing use mainnet preset with seconds_per_slot = 6.

So prepareNextSlot usually happens at 4s, and this.config.PROPOSER_INCLUSION_LIST_CUT_OFF - this.chain.clock.secFromSlot(clockSlot) usually yield 11 - 2 = 9 seconds of wait time. This would delay this EL call to 2 slots after.

When we are done interopping, we can remove secToNextSlot and do max(0, secToCutOff) as you suggest

Copy link
Member

Choose a reason for hiding this comment

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

we should probably change this already on the spec, PROPOSER_INCLUSION_LIST_CUT_OFF and other timing parameters should not be part of config and always derived from SECONDS_PER_SLOT similar to proposer boost reorg cutoff

const proposerReorgCutoff = this.config.SECONDS_PER_SLOT / INTERVALS_PER_SLOT / 2;

ensi321 and others added 3 commits July 16, 2025 18:38
**Motivation**

FOCIL image failed in Kurtosis after switching to eip-7805 fork (slot
32):
```
[cl-1-lodestar-geth] Error: getBlobParameters is not available pre-fulu epoch=1
```
The error was triggered by `getBlobParameters()` and
`getMaxBlobsPerBlock()` functions.
 
**Description**

Added `ForkName.eip7805` into `getMaxBlobsPerBlock()`. Now switching the
forks works well in kurtosis.

**Steps to test or reproduce**

Kurtosis config file:
```
participants:
  - el_type: geth
    el_image: jihoonsg/geth-focil:4a583f4
    cl_type: lodestar
    cl_image: sibkatya/lodestar:focil-fork-fix
    count: 2
network_params:
  genesis_delay: 20
  electra_fork_epoch: 0
  eip7805_fork_epoch: 1
  seconds_per_slot: 6
  num_validator_keys_per_node: 256
snooper_enabled: true
additional_services:
  - dora
  - tx_fuzz
  - spamoor
  - prometheus_grafana
port_publisher:
  additional_services:
    enabled: true
    public_port_start: 65500
spamoor_params:
  spammers:
    - scenario: eoatx
      config:
        throughput: 100
    - scenario: uniswap-swaps
      config:
        throughput: 100
    - scenario: blob-combined
      config:
        throughput: 5
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-do-not-merge Merging this issue will break the build. Do not merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants