Skip to content

feat: send validator registrations to builder using ssz#7444

Merged
nflaig merged 7 commits into
unstablefrom
nflaig/register-validators-ssz
May 8, 2025
Merged

feat: send validator registrations to builder using ssz#7444
nflaig merged 7 commits into
unstablefrom
nflaig/register-validators-ssz

Conversation

@nflaig
Copy link
Copy Markdown
Member

@nflaig nflaig commented Feb 10, 2025

Motivation

See ethereum/builder-specs#110

Description

Send validator registrations to builder using SSZ

TODO

  • make sure all mev sidecars support 415 status code to fall back to JSON or add custom retry mechanism
  • forward bytes submitted through registerValidator beacon api to skip extra serialization step cannot be done right now since we are filtering registrations here so forwarding raw SSZ bytes is not an option and extra work is likely not worth it as serialization is cheap anyways when using SSZ

Closes #7369

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 10, 2025

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 672e6a5 Previous: 6dae670 Ratio
altair processAttestation - setStatus - 4/5 committees join 662.25 us/op 2.5790 ms/op 0.26
altair processEth1Data - 250000 vs - 7PWei normalcase 377.24 us/op 1.1699 ms/op 0.32
Array.get 0.28501 ns/op 1.4922 ns/op 0.19
Uint8Array.get 0.46910 ns/op 1.6074 ns/op 0.29
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3468 ms/op 7.2891 ms/op 0.32
Full benchmark results
Benchmark suite Current: 672e6a5 Previous: 6dae670 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 996.38 us/op 1.4351 ms/op 0.69
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 36.995 us/op 52.968 us/op 0.70
BLS verify - blst 949.72 us/op 1.0190 ms/op 0.93
BLS verifyMultipleSignatures 3 - blst 1.3292 ms/op 1.6070 ms/op 0.83
BLS verifyMultipleSignatures 8 - blst 1.9494 ms/op 2.2427 ms/op 0.87
BLS verifyMultipleSignatures 32 - blst 5.8155 ms/op 7.7478 ms/op 0.75
BLS verifyMultipleSignatures 64 - blst 11.032 ms/op 12.973 ms/op 0.85
BLS verifyMultipleSignatures 128 - blst 18.000 ms/op 21.453 ms/op 0.84
BLS deserializing 10000 signatures 714.70 ms/op 796.12 ms/op 0.90
BLS deserializing 100000 signatures 6.9853 s/op 8.3493 s/op 0.84
BLS verifyMultipleSignatures - same message - 3 - blst 879.95 us/op 992.14 us/op 0.89
BLS verifyMultipleSignatures - same message - 8 - blst 1.5475 ms/op 1.1942 ms/op 1.30
BLS verifyMultipleSignatures - same message - 32 - blst 1.6770 ms/op 2.1251 ms/op 0.79
BLS verifyMultipleSignatures - same message - 64 - blst 2.5781 ms/op 2.8976 ms/op 0.89
BLS verifyMultipleSignatures - same message - 128 - blst 4.3799 ms/op 4.9794 ms/op 0.88
BLS aggregatePubkeys 32 - blst 19.814 us/op 22.308 us/op 0.89
BLS aggregatePubkeys 128 - blst 71.351 us/op 78.048 us/op 0.91
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 55.893 ms/op 65.200 ms/op 0.86
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 56.020 ms/op 53.712 ms/op 1.04
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 42.444 ms/op 43.284 ms/op 0.98
getSlashingsAndExits - default max 83.559 us/op 77.887 us/op 1.07
getSlashingsAndExits - 2k 329.48 us/op 332.57 us/op 0.99
proposeBlockBody type=full, size=empty 5.5175 ms/op 7.2522 ms/op 0.76
isKnown best case - 1 super set check 211.00 ns/op 227.00 ns/op 0.93
isKnown normal case - 2 super set checks 207.00 ns/op 207.00 ns/op 1.00
isKnown worse case - 16 super set checks 207.00 ns/op 207.00 ns/op 1.00
InMemoryCheckpointStateCache - add get delete 2.4480 us/op 2.9590 us/op 0.83
validate api signedAggregateAndProof - struct 1.3936 ms/op 1.7636 ms/op 0.79
validate gossip signedAggregateAndProof - struct 2.5833 ms/op 1.7934 ms/op 1.44
batch validate gossip attestation - vc 640000 - chunk 32 116.66 us/op 124.03 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 64 103.79 us/op 116.71 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 128 97.283 us/op 117.20 us/op 0.83
batch validate gossip attestation - vc 640000 - chunk 256 104.29 us/op 114.89 us/op 0.91
pickEth1Vote - no votes 1.0237 ms/op 1.1706 ms/op 0.87
pickEth1Vote - max votes 7.1939 ms/op 7.5488 ms/op 0.95
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.307 ms/op 12.067 ms/op 1.10
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.323 ms/op 21.573 ms/op 0.99
pickEth1Vote - Eth1Data fastSerialize value x2048 486.14 us/op 562.80 us/op 0.86
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.1693 ms/op 3.1867 ms/op 0.68
bytes32 toHexString 429.00 ns/op 428.00 ns/op 1.00
bytes32 Buffer.toString(hex) 253.00 ns/op 334.00 ns/op 0.76
bytes32 Buffer.toString(hex) from Uint8Array 373.00 ns/op 364.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 277.00 ns/op 264.00 ns/op 1.05
Object access 1 prop 0.12300 ns/op 0.18400 ns/op 0.67
Map access 1 prop 0.13200 ns/op 0.16400 ns/op 0.80
Object get x1000 6.2550 ns/op 7.0840 ns/op 0.88
Map get x1000 6.8130 ns/op 7.6230 ns/op 0.89
Object set x1000 30.460 ns/op 31.660 ns/op 0.96
Map set x1000 20.821 ns/op 22.737 ns/op 0.92
Return object 10000 times 0.29390 ns/op 0.31450 ns/op 0.93
Throw Error 10000 times 4.4925 us/op 4.6041 us/op 0.98
toHex 149.04 ns/op 152.29 ns/op 0.98
Buffer.from 132.63 ns/op 141.27 ns/op 0.94
shared Buffer 92.444 ns/op 99.831 ns/op 0.93
fastMsgIdFn sha256 / 200 bytes 2.2440 us/op 2.4950 us/op 0.90
fastMsgIdFn h32 xxhash / 200 bytes 224.00 ns/op 218.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 200 bytes 297.00 ns/op 302.00 ns/op 0.98
fastMsgIdFn sha256 / 1000 bytes 7.4030 us/op 7.9180 us/op 0.93
fastMsgIdFn h32 xxhash / 1000 bytes 348.00 ns/op 463.00 ns/op 0.75
fastMsgIdFn h64 xxhash / 1000 bytes 397.00 ns/op 399.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 65.843 us/op 78.321 us/op 0.84
fastMsgIdFn h32 xxhash / 10000 bytes 1.8840 us/op 2.0420 us/op 0.92
fastMsgIdFn h64 xxhash / 10000 bytes 1.2670 us/op 1.4030 us/op 0.90
send data - 1000 256B messages 15.384 ms/op 11.628 ms/op 1.32
send data - 1000 512B messages 18.012 ms/op 19.111 ms/op 0.94
send data - 1000 1024B messages 26.473 ms/op 30.511 ms/op 0.87
send data - 1000 1200B messages 21.023 ms/op 22.063 ms/op 0.95
send data - 1000 2048B messages 25.575 ms/op 22.159 ms/op 1.15
send data - 1000 4096B messages 27.621 ms/op 27.101 ms/op 1.02
send data - 1000 16384B messages 81.527 ms/op 51.939 ms/op 1.57
send data - 1000 65536B messages 221.59 ms/op 270.46 ms/op 0.82
enrSubnets - fastDeserialize 64 bits 1.7770 us/op 976.00 ns/op 1.82
enrSubnets - ssz BitVector 64 bits 356.00 ns/op 354.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 141.00 ns/op 142.00 ns/op 0.99
enrSubnets - ssz BitVector 4 bits 390.00 ns/op 384.00 ns/op 1.02
prioritizePeers score -10:0 att 32-0.1 sync 2-0 124.03 us/op 137.21 us/op 0.90
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 141.57 us/op 161.89 us/op 0.87
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 208.76 us/op 229.39 us/op 0.91
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 387.47 us/op 489.62 us/op 0.79
prioritizePeers score 0:0 att 64-1 sync 4-1 481.26 us/op 633.32 us/op 0.76
array of 16000 items push then shift 1.6775 us/op 1.7127 us/op 0.98
LinkedList of 16000 items push then shift 8.0790 ns/op 7.2760 ns/op 1.11
array of 16000 items push then pop 82.019 ns/op 81.053 ns/op 1.01
LinkedList of 16000 items push then pop 7.3720 ns/op 7.7110 ns/op 0.96
array of 24000 items push then shift 2.4450 us/op 2.5969 us/op 0.94
LinkedList of 24000 items push then shift 8.0280 ns/op 7.8780 ns/op 1.02
array of 24000 items push then pop 111.09 ns/op 116.32 ns/op 0.96
LinkedList of 24000 items push then pop 8.1710 ns/op 7.7160 ns/op 1.06
intersect bitArray bitLen 8 6.4920 ns/op 7.2390 ns/op 0.90
intersect array and set length 8 38.871 ns/op 42.004 ns/op 0.93
intersect bitArray bitLen 128 30.238 ns/op 31.416 ns/op 0.96
intersect array and set length 128 634.85 ns/op 648.59 ns/op 0.98
bitArray.getTrueBitIndexes() bitLen 128 1.0500 us/op 1.1490 us/op 0.91
bitArray.getTrueBitIndexes() bitLen 248 1.8510 us/op 1.9500 us/op 0.95
bitArray.getTrueBitIndexes() bitLen 512 3.8860 us/op 3.9850 us/op 0.98
Buffer.concat 32 items 706.00 ns/op 699.00 ns/op 1.01
Uint8Array.set 32 items 998.00 ns/op 2.0060 us/op 0.50
Buffer.copy 2.2380 us/op 2.2530 us/op 0.99
Uint8Array.set - with subarray 1.5880 us/op 2.8030 us/op 0.57
Uint8Array.set - without subarray 859.00 ns/op 1.0700 us/op 0.80
getUint32 - dataview 208.00 ns/op 241.00 ns/op 0.86
getUint32 - manual 132.00 ns/op 144.00 ns/op 0.92
Set add up to 64 items then delete first 2.6085 us/op 2.3007 us/op 1.13
OrderedSet add up to 64 items then delete first 4.1795 us/op 3.2622 us/op 1.28
Set add up to 64 items then delete last 3.0977 us/op 2.5399 us/op 1.22
OrderedSet add up to 64 items then delete last 4.7985 us/op 3.6818 us/op 1.30
Set add up to 64 items then delete middle 3.2034 us/op 3.0943 us/op 1.04
OrderedSet add up to 64 items then delete middle 6.3278 us/op 5.7225 us/op 1.11
Set add up to 128 items then delete first 6.1586 us/op 5.3239 us/op 1.16
OrderedSet add up to 128 items then delete first 10.107 us/op 8.4388 us/op 1.20
Set add up to 128 items then delete last 6.1745 us/op 5.1860 us/op 1.19
OrderedSet add up to 128 items then delete last 7.8362 us/op 8.1068 us/op 0.97
Set add up to 128 items then delete middle 5.9251 us/op 4.9819 us/op 1.19
OrderedSet add up to 128 items then delete middle 17.356 us/op 14.361 us/op 1.21
Set add up to 256 items then delete first 12.398 us/op 10.430 us/op 1.19
OrderedSet add up to 256 items then delete first 18.188 us/op 16.905 us/op 1.08
Set add up to 256 items then delete last 10.380 us/op 9.9926 us/op 1.04
OrderedSet add up to 256 items then delete last 17.758 us/op 16.124 us/op 1.10
Set add up to 256 items then delete middle 10.427 us/op 9.9912 us/op 1.04
OrderedSet add up to 256 items then delete middle 45.861 us/op 43.813 us/op 1.05
transfer serialized Status (84 B) 2.4610 us/op 2.5980 us/op 0.95
copy serialized Status (84 B) 1.1650 us/op 1.3680 us/op 0.85
transfer serialized SignedVoluntaryExit (112 B) 2.3110 us/op 2.5850 us/op 0.89
copy serialized SignedVoluntaryExit (112 B) 1.1670 us/op 1.4710 us/op 0.79
transfer serialized ProposerSlashing (416 B) 2.3050 us/op 2.4910 us/op 0.93
copy serialized ProposerSlashing (416 B) 1.2140 us/op 1.7000 us/op 0.71
transfer serialized Attestation (485 B) 2.3400 us/op 2.5400 us/op 0.92
copy serialized Attestation (485 B) 1.2200 us/op 2.0860 us/op 0.58
transfer serialized AttesterSlashing (33232 B) 2.4060 us/op 2.8750 us/op 0.84
copy serialized AttesterSlashing (33232 B) 3.6490 us/op 3.9970 us/op 0.91
transfer serialized Small SignedBeaconBlock (128000 B) 2.9450 us/op 3.4770 us/op 0.85
copy serialized Small SignedBeaconBlock (128000 B) 10.280 us/op 9.8540 us/op 1.04
transfer serialized Avg SignedBeaconBlock (200000 B) 3.4620 us/op 4.2580 us/op 0.81
copy serialized Avg SignedBeaconBlock (200000 B) 14.685 us/op 14.756 us/op 1.00
transfer serialized BlobsSidecar (524380 B) 3.9150 us/op 4.0770 us/op 0.96
copy serialized BlobsSidecar (524380 B) 84.916 us/op 58.957 us/op 1.44
transfer serialized Big SignedBeaconBlock (1000000 B) 4.2330 us/op 4.5430 us/op 0.93
copy serialized Big SignedBeaconBlock (1000000 B) 121.79 us/op 108.85 us/op 1.12
pass gossip attestations to forkchoice per slot 3.2918 ms/op 2.8723 ms/op 1.15
forkChoice updateHead vc 100000 bc 64 eq 0 475.17 us/op 477.74 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 2.9286 ms/op 2.8637 ms/op 1.02
forkChoice updateHead vc 1000000 bc 64 eq 0 4.9720 ms/op 5.0986 ms/op 0.98
forkChoice updateHead vc 600000 bc 320 eq 0 2.9968 ms/op 3.1145 ms/op 0.96
forkChoice updateHead vc 600000 bc 1200 eq 0 3.0690 ms/op 3.2889 ms/op 0.93
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2380 ms/op 3.7299 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 1000 10.621 ms/op 12.240 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 10000 11.110 ms/op 11.106 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 300000 14.116 ms/op 17.339 ms/op 0.81
computeDeltas 500000 validators 300 proto nodes 4.1921 ms/op 4.1382 ms/op 1.01
computeDeltas 500000 validators 1200 proto nodes 4.3334 ms/op 4.2680 ms/op 1.02
computeDeltas 500000 validators 7200 proto nodes 4.5721 ms/op 4.3829 ms/op 1.04
computeDeltas 750000 validators 300 proto nodes 7.6759 ms/op 6.4702 ms/op 1.19
computeDeltas 750000 validators 1200 proto nodes 6.6470 ms/op 6.7817 ms/op 0.98
computeDeltas 750000 validators 7200 proto nodes 6.4487 ms/op 8.4168 ms/op 0.77
computeDeltas 1400000 validators 300 proto nodes 11.936 ms/op 15.405 ms/op 0.77
computeDeltas 1400000 validators 1200 proto nodes 12.009 ms/op 15.292 ms/op 0.79
computeDeltas 1400000 validators 7200 proto nodes 11.991 ms/op 16.726 ms/op 0.72
computeDeltas 2100000 validators 300 proto nodes 17.893 ms/op 28.999 ms/op 0.62
computeDeltas 2100000 validators 1200 proto nodes 18.624 ms/op 35.269 ms/op 0.53
computeDeltas 2100000 validators 7200 proto nodes 18.690 ms/op 37.737 ms/op 0.50
altair processAttestation - 250000 vs - 7PWei normalcase 3.1803 ms/op 5.4821 ms/op 0.58
altair processAttestation - 250000 vs - 7PWei worstcase 3.8951 ms/op 8.3443 ms/op 0.47
altair processAttestation - setStatus - 1/6 committees join 143.74 us/op 309.62 us/op 0.46
altair processAttestation - setStatus - 1/3 committees join 279.55 us/op 499.58 us/op 0.56
altair processAttestation - setStatus - 1/2 committees join 416.87 us/op 1.1823 ms/op 0.35
altair processAttestation - setStatus - 2/3 committees join 576.10 us/op 982.68 us/op 0.59
altair processAttestation - setStatus - 4/5 committees join 662.25 us/op 2.5790 ms/op 0.26
altair processAttestation - setStatus - 100% committees join 894.40 us/op 1.7946 ms/op 0.50
altair processBlock - 250000 vs - 7PWei normalcase 5.6182 ms/op 14.499 ms/op 0.39
altair processBlock - 250000 vs - 7PWei normalcase hashState 32.474 ms/op 75.655 ms/op 0.43
altair processBlock - 250000 vs - 7PWei worstcase 47.512 ms/op 113.89 ms/op 0.42
altair processBlock - 250000 vs - 7PWei worstcase hashState 95.186 ms/op 195.82 ms/op 0.49
phase0 processBlock - 250000 vs - 7PWei normalcase 2.6540 ms/op 5.8703 ms/op 0.45
phase0 processBlock - 250000 vs - 7PWei worstcase 29.670 ms/op 59.625 ms/op 0.50
altair processEth1Data - 250000 vs - 7PWei normalcase 377.24 us/op 1.1699 ms/op 0.32
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 11.916 us/op 27.026 us/op 0.44
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 64.059 us/op 82.363 us/op 0.78
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 20.176 us/op 43.777 us/op 0.46
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 13.782 us/op 10.179 us/op 1.35
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 254.59 us/op 393.05 us/op 0.65
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.8278 ms/op 7.0497 ms/op 0.40
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 3.3780 ms/op 5.0240 ms/op 0.67
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.9028 ms/op 7.8337 ms/op 0.37
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 6.7694 ms/op 18.161 ms/op 0.37
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.9612 ms/op 5.8496 ms/op 0.51
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.3282 ms/op 11.013 ms/op 0.57
Tree 40 250000 create 731.90 ms/op 1.4224 s/op 0.51
Tree 40 250000 get(125000) 153.34 ns/op 324.95 ns/op 0.47
Tree 40 250000 set(125000) 2.9574 us/op 4.4583 us/op 0.66
Tree 40 250000 toArray() 23.925 ms/op 42.444 ms/op 0.56
Tree 40 250000 iterate all - toArray() + loop 26.438 ms/op 38.216 ms/op 0.69
Tree 40 250000 iterate all - get(i) 66.544 ms/op 139.38 ms/op 0.48
Array 250000 create 3.0506 ms/op 8.6688 ms/op 0.35
Array 250000 clone - spread 1.8869 ms/op 8.3040 ms/op 0.23
Array 250000 get(125000) 0.42700 ns/op 1.4330 ns/op 0.30
Array 250000 set(125000) 0.45900 ns/op 1.1250 ns/op 0.41
Array 250000 iterate all - loop 91.195 us/op 341.10 us/op 0.27
phase0 afterProcessEpoch - 250000 vs - 7PWei 46.189 ms/op 118.05 ms/op 0.39
Array.fill - length 1000000 4.7879 ms/op 12.684 ms/op 0.38
Array push - length 1000000 21.342 ms/op 43.125 ms/op 0.49
Array.get 0.28501 ns/op 1.4922 ns/op 0.19
Uint8Array.get 0.46910 ns/op 1.6074 ns/op 0.29
phase0 beforeProcessEpoch - 250000 vs - 7PWei 21.576 ms/op 58.263 ms/op 0.37
altair processEpoch - mainnet_e81889 342.64 ms/op 845.76 ms/op 0.41
mainnet_e81889 - altair beforeProcessEpoch 21.469 ms/op 40.179 ms/op 0.53
mainnet_e81889 - altair processJustificationAndFinalization 8.0700 us/op 17.740 us/op 0.45
mainnet_e81889 - altair processInactivityUpdates 8.1582 ms/op 13.099 ms/op 0.62
mainnet_e81889 - altair processRewardsAndPenalties 49.628 ms/op 103.54 ms/op 0.48
mainnet_e81889 - altair processRegistryUpdates 951.00 ns/op 2.6640 us/op 0.36
mainnet_e81889 - altair processSlashings 237.00 ns/op 560.00 ns/op 0.42
mainnet_e81889 - altair processEth1DataReset 203.00 ns/op 613.00 ns/op 0.33
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3356 ms/op 4.6436 ms/op 0.29
mainnet_e81889 - altair processSlashingsReset 1.0240 us/op 2.1660 us/op 0.47
mainnet_e81889 - altair processRandaoMixesReset 1.6580 us/op 3.8400 us/op 0.43
mainnet_e81889 - altair processHistoricalRootsUpdate 198.00 ns/op 442.00 ns/op 0.45
mainnet_e81889 - altair processParticipationFlagUpdates 625.00 ns/op 1.5440 us/op 0.40
mainnet_e81889 - altair processSyncCommitteeUpdates 182.00 ns/op 584.00 ns/op 0.31
mainnet_e81889 - altair afterProcessEpoch 49.249 ms/op 113.34 ms/op 0.43
capella processEpoch - mainnet_e217614 1.2475 s/op 1.9297 s/op 0.65
mainnet_e217614 - capella beforeProcessEpoch 71.229 ms/op 145.83 ms/op 0.49
mainnet_e217614 - capella processJustificationAndFinalization 6.3900 us/op 15.122 us/op 0.42
mainnet_e217614 - capella processInactivityUpdates 16.122 ms/op 29.726 ms/op 0.54
mainnet_e217614 - capella processRewardsAndPenalties 225.83 ms/op 366.42 ms/op 0.62
mainnet_e217614 - capella processRegistryUpdates 8.2030 us/op 15.671 us/op 0.52
mainnet_e217614 - capella processSlashings 221.00 ns/op 437.00 ns/op 0.51
mainnet_e217614 - capella processEth1DataReset 211.00 ns/op 443.00 ns/op 0.48
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.7680 ms/op 10.288 ms/op 0.46
mainnet_e217614 - capella processSlashingsReset 1.3900 us/op 3.0850 us/op 0.45
mainnet_e217614 - capella processRandaoMixesReset 1.3780 us/op 2.7660 us/op 0.50
mainnet_e217614 - capella processHistoricalRootsUpdate 276.00 ns/op 445.00 ns/op 0.62
mainnet_e217614 - capella processParticipationFlagUpdates 840.00 ns/op 2.0480 us/op 0.41
mainnet_e217614 - capella afterProcessEpoch 123.21 ms/op 307.33 ms/op 0.40
phase0 processEpoch - mainnet_e58758 326.97 ms/op 571.60 ms/op 0.57
mainnet_e58758 - phase0 beforeProcessEpoch 82.741 ms/op 133.36 ms/op 0.62
mainnet_e58758 - phase0 processJustificationAndFinalization 7.2020 us/op 12.938 us/op 0.56
mainnet_e58758 - phase0 processRewardsAndPenalties 45.574 ms/op 71.510 ms/op 0.64
mainnet_e58758 - phase0 processRegistryUpdates 3.4620 us/op 6.2410 us/op 0.55
mainnet_e58758 - phase0 processSlashings 208.00 ns/op 393.00 ns/op 0.53
mainnet_e58758 - phase0 processEth1DataReset 218.00 ns/op 380.00 ns/op 0.57
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4969 ms/op 4.3956 ms/op 0.34
mainnet_e58758 - phase0 processSlashingsReset 1.0500 us/op 1.5650 us/op 0.67
mainnet_e58758 - phase0 processRandaoMixesReset 1.3650 us/op 2.2710 us/op 0.60
mainnet_e58758 - phase0 processHistoricalRootsUpdate 225.00 ns/op 468.00 ns/op 0.48
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0050 us/op 1.7580 us/op 0.57
mainnet_e58758 - phase0 afterProcessEpoch 39.022 ms/op 75.585 ms/op 0.52
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4700 ms/op 3.2205 ms/op 0.46
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3468 ms/op 7.2891 ms/op 0.32
altair processInactivityUpdates - 250000 normalcase 21.304 ms/op 34.403 ms/op 0.62
altair processInactivityUpdates - 250000 worstcase 21.456 ms/op 30.500 ms/op 0.70
phase0 processRegistryUpdates - 250000 normalcase 6.4960 us/op 8.4170 us/op 0.77
phase0 processRegistryUpdates - 250000 badcase_full_deposits 340.61 us/op 518.36 us/op 0.66
phase0 processRegistryUpdates - 250000 worstcase 0.5 114.94 ms/op 158.45 ms/op 0.73
altair processRewardsAndPenalties - 250000 normalcase 29.846 ms/op 42.761 ms/op 0.70
altair processRewardsAndPenalties - 250000 worstcase 29.288 ms/op 44.457 ms/op 0.66
phase0 getAttestationDeltas - 250000 normalcase 6.7599 ms/op 13.893 ms/op 0.49
phase0 getAttestationDeltas - 250000 worstcase 17.908 ms/op 13.667 ms/op 1.31
phase0 processSlashings - 250000 worstcase 121.23 us/op 168.02 us/op 0.72
altair processSyncCommitteeUpdates - 250000 12.751 ms/op 27.320 ms/op 0.47
BeaconState.hashTreeRoot - No change 260.00 ns/op 484.00 ns/op 0.54
BeaconState.hashTreeRoot - 1 full validator 102.11 us/op 181.74 us/op 0.56
BeaconState.hashTreeRoot - 32 full validator 1.3337 ms/op 2.1530 ms/op 0.62
BeaconState.hashTreeRoot - 512 full validator 17.221 ms/op 24.010 ms/op 0.72
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 164.44 us/op 250.96 us/op 0.66
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.4535 ms/op 3.4377 ms/op 0.71
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.649 ms/op 52.250 ms/op 0.62
BeaconState.hashTreeRoot - 1 balances 99.272 us/op 159.90 us/op 0.62
BeaconState.hashTreeRoot - 32 balances 976.10 us/op 1.6462 ms/op 0.59
BeaconState.hashTreeRoot - 512 balances 12.486 ms/op 15.666 ms/op 0.80
BeaconState.hashTreeRoot - 250000 balances 237.81 ms/op 241.94 ms/op 0.98
aggregationBits - 2048 els - zipIndexesInBitList 24.193 us/op 28.992 us/op 0.83
byteArrayEquals 32 56.857 ns/op 96.517 ns/op 0.59
Buffer.compare 32 19.736 ns/op 35.008 ns/op 0.56
byteArrayEquals 1024 1.7118 us/op 3.1397 us/op 0.55
Buffer.compare 1024 27.905 ns/op 51.442 ns/op 0.54
byteArrayEquals 16384 27.172 us/op 57.747 us/op 0.47
Buffer.compare 16384 210.82 ns/op 278.60 ns/op 0.76
byteArrayEquals 123687377 212.14 ms/op 301.18 ms/op 0.70
Buffer.compare 123687377 11.960 ms/op 9.2749 ms/op 1.29
byteArrayEquals 32 - diff last byte 57.676 ns/op 70.266 ns/op 0.82
Buffer.compare 32 - diff last byte 18.713 ns/op 23.790 ns/op 0.79
byteArrayEquals 1024 - diff last byte 1.7806 us/op 2.7121 us/op 0.66
Buffer.compare 1024 - diff last byte 28.129 ns/op 43.791 ns/op 0.64
byteArrayEquals 16384 - diff last byte 28.364 us/op 33.237 us/op 0.85
Buffer.compare 16384 - diff last byte 236.57 ns/op 279.96 ns/op 0.85
byteArrayEquals 123687377 - diff last byte 208.84 ms/op 224.52 ms/op 0.93
Buffer.compare 123687377 - diff last byte 7.8470 ms/op 6.5362 ms/op 1.20
byteArrayEquals 32 - random bytes 5.2530 ns/op 6.3420 ns/op 0.83
Buffer.compare 32 - random bytes 17.480 ns/op 21.034 ns/op 0.83
byteArrayEquals 1024 - random bytes 5.2440 ns/op 6.0790 ns/op 0.86
Buffer.compare 1024 - random bytes 17.508 ns/op 20.388 ns/op 0.86
byteArrayEquals 16384 - random bytes 5.4680 ns/op 5.9880 ns/op 0.91
Buffer.compare 16384 - random bytes 18.720 ns/op 20.724 ns/op 0.90
byteArrayEquals 123687377 - random bytes 7.4000 ns/op 8.0100 ns/op 0.92
Buffer.compare 123687377 - random bytes 21.420 ns/op 23.090 ns/op 0.93
regular array get 100000 times 46.380 us/op 45.403 us/op 1.02
wrappedArray get 100000 times 35.471 us/op 36.670 us/op 0.97
arrayWithProxy get 100000 times 12.640 ms/op 14.355 ms/op 0.88
ssz.Root.equals 48.840 ns/op 54.493 ns/op 0.90
byteArrayEquals 47.821 ns/op 52.674 ns/op 0.91
Buffer.compare 11.337 ns/op 11.838 ns/op 0.96
processSlot - 1 slots 13.479 us/op 12.223 us/op 1.10
processSlot - 32 slots 3.2428 ms/op 2.8694 ms/op 1.13
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 6.2358 ms/op 3.4514 ms/op 1.81
getCommitteeAssignments - req 1 vs - 250000 vc 2.3046 ms/op 2.2558 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 4.4283 ms/op 5.2077 ms/op 0.85
getCommitteeAssignments - req 1000 vs - 250000 vc 4.7121 ms/op 4.9346 ms/op 0.95
findModifiedValidators - 10000 modified validators 933.74 ms/op 834.74 ms/op 1.12
findModifiedValidators - 1000 modified validators 907.69 ms/op 743.12 ms/op 1.22
findModifiedValidators - 100 modified validators 344.66 ms/op 262.55 ms/op 1.31
findModifiedValidators - 10 modified validators 240.75 ms/op 195.30 ms/op 1.23
findModifiedValidators - 1 modified validators 171.07 ms/op 162.77 ms/op 1.05
findModifiedValidators - no difference 182.59 ms/op 168.28 ms/op 1.09
compare ViewDUs 6.7430 s/op 7.0019 s/op 0.96
compare each validator Uint8Array 1.8509 s/op 1.4786 s/op 1.25
compare ViewDU to Uint8Array 1.2937 s/op 1.1555 s/op 1.12
migrate state 1000000 validators, 24 modified, 0 new 954.43 ms/op 987.76 ms/op 0.97
migrate state 1000000 validators, 1700 modified, 1000 new 1.2450 s/op 1.2603 s/op 0.99
migrate state 1000000 validators, 3400 modified, 2000 new 1.3220 s/op 1.3786 s/op 0.96
migrate state 1500000 validators, 24 modified, 0 new 1.0153 s/op 975.20 ms/op 1.04
migrate state 1500000 validators, 1700 modified, 1000 new 1.3548 s/op 1.1072 s/op 1.22
migrate state 1500000 validators, 3400 modified, 2000 new 1.4950 s/op 1.4852 s/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6200 ns/op 6.0900 ns/op 0.76
state getBlockRootAtSlot - 250000 vs - 7PWei 580.23 ns/op 800.58 ns/op 0.72
naive computeProposerIndex 100000 validators 69.628 ms/op 54.842 ms/op 1.27
computeProposerIndex 100000 validators 1.6511 ms/op 1.6229 ms/op 1.02
naiveGetNextSyncCommitteeIndices 1000 validators 8.5966 s/op 8.1063 s/op 1.06
getNextSyncCommitteeIndices 1000 validators 121.51 ms/op 125.60 ms/op 0.97
naiveGetNextSyncCommitteeIndices 10000 validators 8.5770 s/op 7.5943 s/op 1.13
getNextSyncCommitteeIndices 10000 validators 120.91 ms/op 117.03 ms/op 1.03
naiveGetNextSyncCommitteeIndices 100000 validators 7.8157 s/op 7.6854 s/op 1.02
getNextSyncCommitteeIndices 100000 validators 120.35 ms/op 127.37 ms/op 0.94
naive computeShuffledIndex 100000 validators 24.628 s/op 23.698 s/op 1.04
cached computeShuffledIndex 100000 validators 559.88 ms/op 577.09 ms/op 0.97
naive computeShuffledIndex 2000000 validators 763.22 s/op 526.39 s/op 1.45
cached computeShuffledIndex 2000000 validators 78.005 s/op 55.019 s/op 1.42
computeProposers - vc 250000 648.94 us/op 885.07 us/op 0.73
computeEpochShuffling - vc 250000 44.868 ms/op 63.141 ms/op 0.71
getNextSyncCommittee - vc 250000 11.238 ms/op 18.968 ms/op 0.59
computeSigningRoot for AttestationData 30.299 us/op 48.190 us/op 0.63
hash AttestationData serialized data then Buffer.toString(base64) 1.7454 us/op 2.8913 us/op 0.60
toHexString serialized data 1.3871 us/op 2.0299 us/op 0.68
Buffer.toString(base64) 170.23 ns/op 254.61 ns/op 0.67
nodejs block root to RootHex using toHex 165.53 ns/op 267.62 ns/op 0.62
nodejs block root to RootHex using toRootHex 103.58 ns/op 175.37 ns/op 0.59
browser block root to RootHex using the deprecated toHexString 243.09 ns/op 339.51 ns/op 0.72
browser block root to RootHex using toHex 179.01 ns/op 230.43 ns/op 0.78
browser block root to RootHex using toRootHex 171.00 ns/op 255.75 ns/op 0.67

by benchmarkbot/action

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.09%. Comparing base (4a9c1b1) to head (9339f23).
Report is 10 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7444      +/-   ##
============================================
+ Coverage     56.08%   56.09%   +0.01%     
============================================
  Files           823      823              
  Lines         58031    58044      +13     
  Branches       4463     4463              
============================================
+ Hits          32545    32561      +16     
+ Misses        25419    25416       -3     
  Partials         67       67              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

},
resp: EmptyResponseCodec,
init: {
requestWireFormat: WireFormat.ssz,
Copy link
Copy Markdown
Member Author

@nflaig nflaig Apr 26, 2025

Choose a reason for hiding this comment

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

part of spec now ethereum/beacon-APIs#508, we can enable SSZ by default, worst case we get a 415 response from beacon node and fall back to JSON

@nflaig nflaig marked this pull request as ready for review April 26, 2025 16:28
@nflaig nflaig requested a review from a team as a code owner April 26, 2025 16:28
@wemeetagain
Copy link
Copy Markdown
Member

(TODO) make sure all mev sidecars support 415 status code to fall back to JSON or add custom retry mechanism

I guess we're assuming that all mev sidecars support the latest beacon API as of electra release?

@nflaig
Copy link
Copy Markdown
Member Author

nflaig commented Apr 28, 2025

(TODO) make sure all mev sidecars support 415 status code to fall back to JSON or add custom retry mechanism

I guess we're assuming that all mev sidecars support the latest beacon API as of electra release?

still cautions with merging this one, the builder spec has ssz support for the api but the problem is that mev-boost just passes those requests through to relay, so it's actually the relay that needs to support ssz or respond with 415, I haven't validated this yet on any public network, and there was also a bug in some relays.. imo should hold off merging this for a bit, marked it as ready for review as PR itself is ready

@nflaig nflaig added the status-do-not-merge Merging this issue will break the build. Do not merge! label Apr 28, 2025
@nflaig nflaig marked this pull request as draft April 29, 2025 09:38
@nflaig nflaig marked this pull request as ready for review May 2, 2025 23:34
@nflaig nflaig removed the status-do-not-merge Merging this issue will break the build. Do not merge! label May 2, 2025
@nflaig
Copy link
Copy Markdown
Member Author

nflaig commented May 2, 2025

no issues running this branch on hoodi, relays support ssz validator registrations there

@nflaig nflaig added this to the v1.30.0 milestone May 7, 2025
@nflaig nflaig enabled auto-merge (squash) May 8, 2025 12:33
@nflaig nflaig merged commit d42d620 into unstable May 8, 2025
20 checks passed
@nflaig nflaig deleted the nflaig/register-validators-ssz branch May 8, 2025 19:34
@wemeetagain
Copy link
Copy Markdown
Member

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

Send validator registrations as SSZ instead of JSON

2 participants