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

feat: include EL client info in graffiti #6753

Open
wants to merge 16 commits into
base: unstable
Choose a base branch
from
Open

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented May 9, 2024

This PR shifts the responsibility of setting the default graffiti from validator to beacon-node and also defines engine_getClientVersionV1.

Due to validator package no longer determines default graffiti, graffiti ValidatorStore is now marked as optional (type string | undefined). This implies produce block endpoints in validator api accepts optional graffiti and getGraffiti in key manager api now may throw error if no graffiti is available for the queried pubkey.

When the api module first starts. engine_getClientVersionV1 will be called to determine the default graffiti and store it in memory. Afterwards this endpoint will be called in prepareNextSlot if proposing next slot.

Default graffiti will be used during produceBlock api call when the block graffiti is undefined and private flag is unset.

Closes #6463

@ensi321 ensi321 requested a review from a team as a code owner May 9, 2024 14:56
@ensi321 ensi321 marked this pull request as draft May 9, 2024 14:56
@ensi321 ensi321 added this to the v1.19.0 milestone May 10, 2024
Copy link
Contributor

github-actions bot commented Jun 4, 2024

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 9b5dd9f Previous: 8cb08ff Ratio
getSlashingsAndExits - default max 69.332 us/op 229.04 us/op 0.30
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.7175 ms/op 5.5777 ms/op 0.31
Full benchmark results
Benchmark suite Current: 9b5dd9f Previous: 8cb08ff Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 723.29 us/op 512.16 us/op 1.41
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.439 us/op 52.922 us/op 0.75
BLS verify - blst-native 1.0823 ms/op 1.2685 ms/op 0.85
BLS verifyMultipleSignatures 3 - blst-native 2.3067 ms/op 2.7120 ms/op 0.85
BLS verifyMultipleSignatures 8 - blst-native 5.0929 ms/op 6.2377 ms/op 0.82
BLS verifyMultipleSignatures 32 - blst-native 18.710 ms/op 21.928 ms/op 0.85
BLS verifyMultipleSignatures 64 - blst-native 36.887 ms/op 43.220 ms/op 0.85
BLS verifyMultipleSignatures 128 - blst-native 73.205 ms/op 85.380 ms/op 0.86
BLS deserializing 10000 signatures 800.60 ms/op 880.27 ms/op 0.91
BLS deserializing 100000 signatures 7.9751 s/op 9.1411 s/op 0.87
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.0959 ms/op 1.4734 ms/op 0.74
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2784 ms/op 1.4626 ms/op 0.87
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.0101 ms/op 2.2858 ms/op 0.88
BLS verifyMultipleSignatures - same message - 64 - blst-native 2.9876 ms/op 3.3979 ms/op 0.88
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.9646 ms/op 5.6372 ms/op 1.06
BLS aggregatePubkeys 32 - blst-native 23.731 us/op 27.246 us/op 0.87
BLS aggregatePubkeys 128 - blst-native 90.926 us/op 104.98 us/op 0.87
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 50.825 ms/op 117.82 ms/op 0.43
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 44.370 ms/op 88.175 ms/op 0.50
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 29.811 ms/op 48.857 ms/op 0.61
getSlashingsAndExits - default max 69.332 us/op 229.04 us/op 0.30
getSlashingsAndExits - 2k 282.22 us/op 329.09 us/op 0.86
proposeBlockBody type=full, size=empty 5.1234 ms/op 5.9373 ms/op 0.86
isKnown best case - 1 super set check 501.00 ns/op 358.00 ns/op 1.40
isKnown normal case - 2 super set checks 548.00 ns/op 364.00 ns/op 1.51
isKnown worse case - 16 super set checks 487.00 ns/op 431.00 ns/op 1.13
InMemoryCheckpointStateCache - add get delete 4.5510 us/op 6.2000 us/op 0.73
validate api signedAggregateAndProof - struct 2.3683 ms/op 2.7497 ms/op 0.86
validate gossip signedAggregateAndProof - struct 2.3755 ms/op 2.7804 ms/op 0.85
validate gossip attestation - vc 640000 1.1832 ms/op 1.3453 ms/op 0.88
batch validate gossip attestation - vc 640000 - chunk 32 146.79 us/op 168.19 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 64 133.64 us/op 142.56 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 128 127.92 us/op 129.18 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 256 119.86 us/op 130.02 us/op 0.92
pickEth1Vote - no votes 1.0088 ms/op 1.1812 ms/op 0.85
pickEth1Vote - max votes 10.171 ms/op 9.4035 ms/op 1.08
pickEth1Vote - Eth1Data hashTreeRoot value x2048 20.099 ms/op 14.288 ms/op 1.41
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 26.334 ms/op 19.294 ms/op 1.36
pickEth1Vote - Eth1Data fastSerialize value x2048 545.05 us/op 506.48 us/op 1.08
pickEth1Vote - Eth1Data fastSerialize tree x2048 9.4291 ms/op 3.9629 ms/op 2.38
bytes32 toHexString 917.00 ns/op 482.00 ns/op 1.90
bytes32 Buffer.toString(hex) 527.00 ns/op 256.00 ns/op 2.06
bytes32 Buffer.toString(hex) from Uint8Array 742.00 ns/op 429.00 ns/op 1.73
bytes32 Buffer.toString(hex) + 0x 490.00 ns/op 259.00 ns/op 1.89
Object access 1 prop 0.44300 ns/op 0.15000 ns/op 2.95
Map access 1 prop 0.34500 ns/op 0.14800 ns/op 2.33
Object get x1000 5.4460 ns/op 6.2920 ns/op 0.87
Map get x1000 7.1030 ns/op 6.6470 ns/op 1.07
Object set x1000 55.682 ns/op 40.221 ns/op 1.38
Map set x1000 48.663 ns/op 24.523 ns/op 1.98
Return object 10000 times 0.33430 ns/op 0.31090 ns/op 1.08
Throw Error 10000 times 3.0804 us/op 3.5789 us/op 0.86
fastMsgIdFn sha256 / 200 bytes 2.3480 us/op 2.4260 us/op 0.97
fastMsgIdFn h32 xxhash / 200 bytes 613.00 ns/op 300.00 ns/op 2.04
fastMsgIdFn h64 xxhash / 200 bytes 534.00 ns/op 280.00 ns/op 1.91
fastMsgIdFn sha256 / 1000 bytes 6.7000 us/op 7.7530 us/op 0.86
fastMsgIdFn h32 xxhash / 1000 bytes 823.00 ns/op 430.00 ns/op 1.91
fastMsgIdFn h64 xxhash / 1000 bytes 731.00 ns/op 355.00 ns/op 2.06
fastMsgIdFn sha256 / 10000 bytes 59.694 us/op 67.572 us/op 0.88
fastMsgIdFn h32 xxhash / 10000 bytes 2.2970 us/op 1.9540 us/op 1.18
fastMsgIdFn h64 xxhash / 10000 bytes 1.5030 us/op 1.2440 us/op 1.21
send data - 1000 256B messages 21.986 ms/op 14.346 ms/op 1.53
send data - 1000 512B messages 22.775 ms/op 19.241 ms/op 1.18
send data - 1000 1024B messages 30.756 ms/op 27.767 ms/op 1.11
send data - 1000 1200B messages 38.245 ms/op 29.112 ms/op 1.31
send data - 1000 2048B messages 36.128 ms/op 35.354 ms/op 1.02
send data - 1000 4096B messages 36.626 ms/op 34.994 ms/op 1.05
send data - 1000 16384B messages 87.157 ms/op 77.988 ms/op 1.12
send data - 1000 65536B messages 321.77 ms/op 214.44 ms/op 1.50
enrSubnets - fastDeserialize 64 bits 2.0810 us/op 1.2640 us/op 1.65
enrSubnets - ssz BitVector 64 bits 723.00 ns/op 419.00 ns/op 1.73
enrSubnets - fastDeserialize 4 bits 405.00 ns/op 194.00 ns/op 2.09
enrSubnets - ssz BitVector 4 bits 684.00 ns/op 417.00 ns/op 1.64
prioritizePeers score -10:0 att 32-0.1 sync 2-0 140.86 us/op 159.58 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 142.78 us/op 189.04 us/op 0.76
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 237.36 us/op 279.24 us/op 0.85
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 484.82 us/op 452.19 us/op 1.07
prioritizePeers score 0:0 att 64-1 sync 4-1 755.42 us/op 653.60 us/op 1.16
array of 16000 items push then shift 1.3707 us/op 1.6961 us/op 0.81
LinkedList of 16000 items push then shift 7.3910 ns/op 7.4700 ns/op 0.99
array of 16000 items push then pop 141.95 ns/op 125.73 ns/op 1.13
LinkedList of 16000 items push then pop 6.6840 ns/op 7.4480 ns/op 0.90
array of 24000 items push then shift 2.1019 us/op 2.5110 us/op 0.84
LinkedList of 24000 items push then shift 7.3180 ns/op 7.5860 ns/op 0.96
array of 24000 items push then pop 193.71 ns/op 168.94 ns/op 1.15
LinkedList of 24000 items push then pop 6.4740 ns/op 8.5620 ns/op 0.76
intersect bitArray bitLen 8 5.6700 ns/op 7.1940 ns/op 0.79
intersect array and set length 8 44.301 ns/op 50.250 ns/op 0.88
intersect bitArray bitLen 128 28.246 ns/op 32.219 ns/op 0.88
intersect array and set length 128 618.62 ns/op 804.14 ns/op 0.77
bitArray.getTrueBitIndexes() bitLen 128 2.4890 us/op 1.6680 us/op 1.49
bitArray.getTrueBitIndexes() bitLen 248 4.4520 us/op 2.8610 us/op 1.56
bitArray.getTrueBitIndexes() bitLen 512 6.7660 us/op 5.6520 us/op 1.20
Buffer.concat 32 items 1.1630 us/op 1.0530 us/op 1.10
Uint8Array.set 32 items 1.6400 us/op 1.6480 us/op 1.00
Buffer.copy 1.7080 us/op 2.0870 us/op 0.82
Uint8Array.set - with subarray 2.0820 us/op 3.1450 us/op 0.66
Uint8Array.set - without subarray 1.6280 us/op 2.1470 us/op 0.76
Set add up to 64 items then delete first 2.3647 us/op 2.4040 us/op 0.98
OrderedSet add up to 64 items then delete first 3.0987 us/op 3.8233 us/op 0.81
Set add up to 64 items then delete last 2.2987 us/op 2.8666 us/op 0.80
OrderedSet add up to 64 items then delete last 3.3069 us/op 4.0678 us/op 0.81
Set add up to 64 items then delete middle 2.2900 us/op 2.9891 us/op 0.77
OrderedSet add up to 64 items then delete middle 4.9960 us/op 5.5580 us/op 0.90
Set add up to 128 items then delete first 4.5202 us/op 6.1967 us/op 0.73
OrderedSet add up to 128 items then delete first 6.7072 us/op 9.2171 us/op 0.73
Set add up to 128 items then delete last 4.7069 us/op 5.9352 us/op 0.79
OrderedSet add up to 128 items then delete last 7.3400 us/op 9.9482 us/op 0.74
Set add up to 128 items then delete middle 4.4952 us/op 6.5788 us/op 0.68
OrderedSet add up to 128 items then delete middle 14.377 us/op 16.918 us/op 0.85
Set add up to 256 items then delete first 9.5161 us/op 13.968 us/op 0.68
OrderedSet add up to 256 items then delete first 14.090 us/op 18.672 us/op 0.75
Set add up to 256 items then delete last 9.8875 us/op 12.917 us/op 0.77
OrderedSet add up to 256 items then delete last 13.340 us/op 18.707 us/op 0.71
Set add up to 256 items then delete middle 9.2684 us/op 12.528 us/op 0.74
OrderedSet add up to 256 items then delete middle 42.090 us/op 46.636 us/op 0.90
transfer serialized Status (84 B) 1.6640 us/op 1.6150 us/op 1.03
copy serialized Status (84 B) 1.5910 us/op 1.3580 us/op 1.17
transfer serialized SignedVoluntaryExit (112 B) 1.6550 us/op 1.7250 us/op 0.96
copy serialized SignedVoluntaryExit (112 B) 2.2100 us/op 1.3390 us/op 1.65
transfer serialized ProposerSlashing (416 B) 2.8830 us/op 2.5470 us/op 1.13
copy serialized ProposerSlashing (416 B) 2.6570 us/op 2.7390 us/op 0.97
transfer serialized Attestation (485 B) 2.5270 us/op 2.4160 us/op 1.05
copy serialized Attestation (485 B) 2.6780 us/op 2.5210 us/op 1.06
transfer serialized AttesterSlashing (33232 B) 2.0470 us/op 2.3410 us/op 0.87
copy serialized AttesterSlashing (33232 B) 6.1740 us/op 7.8020 us/op 0.79
transfer serialized Small SignedBeaconBlock (128000 B) 3.3020 us/op 3.0030 us/op 1.10
copy serialized Small SignedBeaconBlock (128000 B) 12.372 us/op 22.073 us/op 0.56
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2500 us/op 3.9160 us/op 0.83
copy serialized Avg SignedBeaconBlock (200000 B) 18.174 us/op 29.607 us/op 0.61
transfer serialized BlobsSidecar (524380 B) 4.2230 us/op 3.7580 us/op 1.12
copy serialized BlobsSidecar (524380 B) 85.651 us/op 140.72 us/op 0.61
transfer serialized Big SignedBeaconBlock (1000000 B) 4.4840 us/op 4.4420 us/op 1.01
copy serialized Big SignedBeaconBlock (1000000 B) 157.45 us/op 210.33 us/op 0.75
pass gossip attestations to forkchoice per slot 2.7014 ms/op 3.2589 ms/op 0.83
forkChoice updateHead vc 100000 bc 64 eq 0 497.34 us/op 521.16 us/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 0 2.6194 ms/op 4.1609 ms/op 0.63
forkChoice updateHead vc 1000000 bc 64 eq 0 4.3233 ms/op 6.1514 ms/op 0.70
forkChoice updateHead vc 600000 bc 320 eq 0 2.5960 ms/op 3.3919 ms/op 0.77
forkChoice updateHead vc 600000 bc 1200 eq 0 2.6492 ms/op 3.5644 ms/op 0.74
forkChoice updateHead vc 600000 bc 7200 eq 0 3.7728 ms/op 4.0178 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 1000 10.072 ms/op 11.662 ms/op 0.86
forkChoice updateHead vc 600000 bc 64 eq 10000 10.120 ms/op 11.331 ms/op 0.89
forkChoice updateHead vc 600000 bc 64 eq 300000 33.094 ms/op 23.090 ms/op 1.43
computeDeltas 500000 validators 300 proto nodes 3.2248 ms/op 4.3691 ms/op 0.74
computeDeltas 500000 validators 1200 proto nodes 3.0375 ms/op 4.7592 ms/op 0.64
computeDeltas 500000 validators 7200 proto nodes 3.0883 ms/op 4.4505 ms/op 0.69
computeDeltas 750000 validators 300 proto nodes 4.6210 ms/op 5.5877 ms/op 0.83
computeDeltas 750000 validators 1200 proto nodes 4.4330 ms/op 5.7548 ms/op 0.77
computeDeltas 750000 validators 7200 proto nodes 4.4421 ms/op 5.8303 ms/op 0.76
computeDeltas 1400000 validators 300 proto nodes 8.5408 ms/op 10.517 ms/op 0.81
computeDeltas 1400000 validators 1200 proto nodes 8.5138 ms/op 10.867 ms/op 0.78
computeDeltas 1400000 validators 7200 proto nodes 8.2592 ms/op 11.474 ms/op 0.72
computeDeltas 2100000 validators 300 proto nodes 12.559 ms/op 18.107 ms/op 0.69
computeDeltas 2100000 validators 1200 proto nodes 12.349 ms/op 20.169 ms/op 0.61
computeDeltas 2100000 validators 7200 proto nodes 12.046 ms/op 18.247 ms/op 0.66
altair processAttestation - 250000 vs - 7PWei normalcase 1.4072 ms/op 2.8655 ms/op 0.49
altair processAttestation - 250000 vs - 7PWei worstcase 2.0372 ms/op 3.4938 ms/op 0.58
altair processAttestation - setStatus - 1/6 committees join 63.604 us/op 142.64 us/op 0.45
altair processAttestation - setStatus - 1/3 committees join 133.73 us/op 259.36 us/op 0.52
altair processAttestation - setStatus - 1/2 committees join 188.57 us/op 378.15 us/op 0.50
altair processAttestation - setStatus - 2/3 committees join 248.54 us/op 460.29 us/op 0.54
altair processAttestation - setStatus - 4/5 committees join 385.44 us/op 657.73 us/op 0.59
altair processAttestation - setStatus - 100% committees join 453.62 us/op 792.31 us/op 0.57
altair processBlock - 250000 vs - 7PWei normalcase 3.4374 ms/op 4.7554 ms/op 0.72
altair processBlock - 250000 vs - 7PWei normalcase hashState 23.921 ms/op 30.897 ms/op 0.77
altair processBlock - 250000 vs - 7PWei worstcase 41.479 ms/op 48.156 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase hashState 63.708 ms/op 88.419 ms/op 0.72
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5211 ms/op 2.8621 ms/op 0.53
phase0 processBlock - 250000 vs - 7PWei worstcase 23.357 ms/op 30.536 ms/op 0.76
altair processEth1Data - 250000 vs - 7PWei normalcase 232.77 us/op 391.14 us/op 0.60
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.9390 us/op 7.7250 us/op 0.64
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 17.694 us/op 27.056 us/op 0.65
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 6.9230 us/op 12.743 us/op 0.54
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.4490 us/op 9.2640 us/op 0.59
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 76.603 us/op 149.26 us/op 0.51
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 794.70 us/op 798.23 us/op 1.00
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 603.97 us/op 1.1867 ms/op 0.51
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0323 ms/op 1.1645 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 1.9441 ms/op 2.5502 ms/op 0.76
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.1303 ms/op 2.0610 ms/op 0.55
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 2.8573 ms/op 4.5036 ms/op 0.63
Tree 40 250000 create 196.81 ms/op 260.90 ms/op 0.75
Tree 40 250000 get(125000) 126.35 ns/op 166.49 ns/op 0.76
Tree 40 250000 set(125000) 531.49 ns/op 768.87 ns/op 0.69
Tree 40 250000 toArray() 10.080 ms/op 21.085 ms/op 0.48
Tree 40 250000 iterate all - toArray() + loop 17.780 ms/op 19.344 ms/op 0.92
Tree 40 250000 iterate all - get(i) 50.974 ms/op 58.681 ms/op 0.87
MutableVector 250000 create 7.9712 ms/op 10.160 ms/op 0.78
MutableVector 250000 get(125000) 6.0380 ns/op 11.924 ns/op 0.51
MutableVector 250000 set(125000) 172.50 ns/op 212.76 ns/op 0.81
MutableVector 250000 toArray() 3.6631 ms/op 3.9661 ms/op 0.92
MutableVector 250000 iterate all - toArray() + loop 3.8487 ms/op 3.9903 ms/op 0.96
MutableVector 250000 iterate all - get(i) 1.5440 ms/op 1.6893 ms/op 0.91
Array 250000 create 3.7145 ms/op 3.1815 ms/op 1.17
Array 250000 clone - spread 1.3588 ms/op 1.3949 ms/op 0.97
Array 250000 get(125000) 0.57400 ns/op 0.42600 ns/op 1.35
Array 250000 set(125000) 0.59700 ns/op 0.44300 ns/op 1.35
Array 250000 iterate all - loop 77.925 us/op 86.300 us/op 0.90
effectiveBalanceIncrements clone Uint8Array 300000 30.926 us/op 36.500 us/op 0.85
effectiveBalanceIncrements clone MutableVector 300000 305.00 ns/op 126.00 ns/op 2.42
effectiveBalanceIncrements rw all Uint8Array 300000 166.00 us/op 204.11 us/op 0.81
effectiveBalanceIncrements rw all MutableVector 300000 61.065 ms/op 80.371 ms/op 0.76
phase0 afterProcessEpoch - 250000 vs - 7PWei 76.637 ms/op 92.844 ms/op 0.83
phase0 beforeProcessEpoch - 250000 vs - 7PWei 44.313 ms/op 42.567 ms/op 1.04
altair processEpoch - mainnet_e81889 397.40 ms/op 453.51 ms/op 0.88
mainnet_e81889 - altair beforeProcessEpoch 62.480 ms/op 71.026 ms/op 0.88
mainnet_e81889 - altair processJustificationAndFinalization 10.543 us/op 19.023 us/op 0.55
mainnet_e81889 - altair processInactivityUpdates 6.8429 ms/op 7.4185 ms/op 0.92
mainnet_e81889 - altair processRewardsAndPenalties 44.433 ms/op 54.610 ms/op 0.81
mainnet_e81889 - altair processRegistryUpdates 1.8590 us/op 2.6370 us/op 0.70
mainnet_e81889 - altair processSlashings 803.00 ns/op 658.00 ns/op 1.22
mainnet_e81889 - altair processEth1DataReset 712.00 ns/op 587.00 ns/op 1.21
mainnet_e81889 - altair processEffectiveBalanceUpdates 853.50 us/op 2.2126 ms/op 0.39
mainnet_e81889 - altair processSlashingsReset 2.4260 us/op 3.9370 us/op 0.62
mainnet_e81889 - altair processRandaoMixesReset 3.3570 us/op 7.2480 us/op 0.46
mainnet_e81889 - altair processHistoricalRootsUpdate 736.00 ns/op 634.00 ns/op 1.16
mainnet_e81889 - altair processParticipationFlagUpdates 1.5070 us/op 3.0200 us/op 0.50
mainnet_e81889 - altair processSyncCommitteeUpdates 644.00 ns/op 422.00 ns/op 1.53
mainnet_e81889 - altair afterProcessEpoch 81.433 ms/op 95.619 ms/op 0.85
capella processEpoch - mainnet_e217614 1.1551 s/op 1.5241 s/op 0.76
mainnet_e217614 - capella beforeProcessEpoch 242.12 ms/op 307.40 ms/op 0.79
mainnet_e217614 - capella processJustificationAndFinalization 12.136 us/op 24.349 us/op 0.50
mainnet_e217614 - capella processInactivityUpdates 17.204 ms/op 20.315 ms/op 0.85
mainnet_e217614 - capella processRewardsAndPenalties 249.27 ms/op 253.57 ms/op 0.98
mainnet_e217614 - capella processRegistryUpdates 13.064 us/op 27.355 us/op 0.48
mainnet_e217614 - capella processSlashings 1.0230 us/op 862.00 ns/op 1.19
mainnet_e217614 - capella processEth1DataReset 878.00 ns/op 1.1810 us/op 0.74
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.2448 ms/op 4.3216 ms/op 0.98
mainnet_e217614 - capella processSlashingsReset 3.5580 us/op 6.7000 us/op 0.53
mainnet_e217614 - capella processRandaoMixesReset 3.7880 us/op 8.4330 us/op 0.45
mainnet_e217614 - capella processHistoricalRootsUpdate 851.00 ns/op 1.2130 us/op 0.70
mainnet_e217614 - capella processParticipationFlagUpdates 2.1290 us/op 5.0960 us/op 0.42
mainnet_e217614 - capella afterProcessEpoch 258.20 ms/op 364.51 ms/op 0.71
phase0 processEpoch - mainnet_e58758 361.01 ms/op 519.46 ms/op 0.69
mainnet_e58758 - phase0 beforeProcessEpoch 117.98 ms/op 180.67 ms/op 0.65
mainnet_e58758 - phase0 processJustificationAndFinalization 19.307 us/op 35.434 us/op 0.54
mainnet_e58758 - phase0 processRewardsAndPenalties 40.924 ms/op 46.268 ms/op 0.88
mainnet_e58758 - phase0 processRegistryUpdates 9.5630 us/op 21.155 us/op 0.45
mainnet_e58758 - phase0 processSlashings 931.00 ns/op 1.1210 us/op 0.83
mainnet_e58758 - phase0 processEth1DataReset 789.00 ns/op 1.1960 us/op 0.66
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 921.34 us/op 1.4624 ms/op 0.63
mainnet_e58758 - phase0 processSlashingsReset 4.9690 us/op 7.5180 us/op 0.66
mainnet_e58758 - phase0 processRandaoMixesReset 5.2080 us/op 17.020 us/op 0.31
mainnet_e58758 - phase0 processHistoricalRootsUpdate 955.00 ns/op 1.8460 us/op 0.52
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.8930 us/op 7.8430 us/op 0.37
mainnet_e58758 - phase0 afterProcessEpoch 69.687 ms/op 97.829 ms/op 0.71
phase0 processEffectiveBalanceUpdates - 250000 normalcase 854.38 us/op 2.1485 ms/op 0.40
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.7175 ms/op 5.5777 ms/op 0.31
altair processInactivityUpdates - 250000 normalcase 20.373 ms/op 44.582 ms/op 0.46
altair processInactivityUpdates - 250000 worstcase 19.931 ms/op 41.648 ms/op 0.48
phase0 processRegistryUpdates - 250000 normalcase 8.7130 us/op 24.392 us/op 0.36
phase0 processRegistryUpdates - 250000 badcase_full_deposits 327.72 us/op 575.85 us/op 0.57
phase0 processRegistryUpdates - 250000 worstcase 0.5 109.85 ms/op 248.18 ms/op 0.44
altair processRewardsAndPenalties - 250000 normalcase 45.476 ms/op 69.419 ms/op 0.66
altair processRewardsAndPenalties - 250000 worstcase 42.902 ms/op 62.825 ms/op 0.68
phase0 getAttestationDeltas - 250000 normalcase 6.8515 ms/op 9.0118 ms/op 0.76
phase0 getAttestationDeltas - 250000 worstcase 5.9990 ms/op 12.416 ms/op 0.48
phase0 processSlashings - 250000 worstcase 97.223 us/op 143.38 us/op 0.68
altair processSyncCommitteeUpdates - 250000 111.69 ms/op 165.87 ms/op 0.67
BeaconState.hashTreeRoot - No change 560.00 ns/op 550.00 ns/op 1.02
BeaconState.hashTreeRoot - 1 full validator 90.286 us/op 171.25 us/op 0.53
BeaconState.hashTreeRoot - 32 full validator 800.87 us/op 1.6724 ms/op 0.48
BeaconState.hashTreeRoot - 512 full validator 8.4143 ms/op 16.993 ms/op 0.50
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 96.798 us/op 197.98 us/op 0.49
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1923 ms/op 3.1747 ms/op 0.38
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.004 ms/op 42.084 ms/op 0.43
BeaconState.hashTreeRoot - 1 balances 70.238 us/op 168.96 us/op 0.42
BeaconState.hashTreeRoot - 32 balances 1.0808 ms/op 1.3825 ms/op 0.78
BeaconState.hashTreeRoot - 512 balances 7.5368 ms/op 13.760 ms/op 0.55
BeaconState.hashTreeRoot - 250000 balances 213.22 ms/op 259.23 ms/op 0.82
aggregationBits - 2048 els - zipIndexesInBitList 36.627 us/op 52.278 us/op 0.70
byteArrayEquals 32 48.759 ns/op 72.331 ns/op 0.67
Buffer.compare 32 15.800 ns/op 20.177 ns/op 0.78
byteArrayEquals 1024 1.2865 us/op 1.8296 us/op 0.70
Buffer.compare 1024 23.183 ns/op 33.251 ns/op 0.70
byteArrayEquals 16384 20.348 us/op 34.748 us/op 0.59
Buffer.compare 16384 176.01 ns/op 238.54 ns/op 0.74
byteArrayEquals 123687377 155.17 ms/op 221.47 ms/op 0.70
Buffer.compare 123687377 5.9227 ms/op 10.757 ms/op 0.55
byteArrayEquals 32 - diff last byte 47.926 ns/op 64.749 ns/op 0.74
Buffer.compare 32 - diff last byte 16.289 ns/op 21.449 ns/op 0.76
byteArrayEquals 1024 - diff last byte 1.2879 us/op 1.8331 us/op 0.70
Buffer.compare 1024 - diff last byte 24.063 ns/op 31.130 ns/op 0.77
byteArrayEquals 16384 - diff last byte 20.305 us/op 28.638 us/op 0.71
Buffer.compare 16384 - diff last byte 201.15 ns/op 251.13 ns/op 0.80
byteArrayEquals 123687377 - diff last byte 154.56 ms/op 222.92 ms/op 0.69
Buffer.compare 123687377 - diff last byte 6.2635 ms/op 10.907 ms/op 0.57
byteArrayEquals 32 - random bytes 4.8680 ns/op 5.8090 ns/op 0.84
Buffer.compare 32 - random bytes 15.286 ns/op 19.579 ns/op 0.78
byteArrayEquals 1024 - random bytes 4.7930 ns/op 5.7900 ns/op 0.83
Buffer.compare 1024 - random bytes 15.084 ns/op 19.606 ns/op 0.77
byteArrayEquals 16384 - random bytes 4.8050 ns/op 6.3260 ns/op 0.76
Buffer.compare 16384 - random bytes 15.135 ns/op 21.721 ns/op 0.70
byteArrayEquals 123687377 - random bytes 7.7800 ns/op 7.6200 ns/op 1.02
Buffer.compare 123687377 - random bytes 19.290 ns/op 23.150 ns/op 0.83
regular array get 100000 times 30.869 us/op 51.564 us/op 0.60
wrappedArray get 100000 times 30.875 us/op 48.475 us/op 0.64
arrayWithProxy get 100000 times 9.9804 ms/op 14.610 ms/op 0.68
ssz.Root.equals 43.710 ns/op 61.906 ns/op 0.71
byteArrayEquals 42.504 ns/op 60.564 ns/op 0.70
Buffer.compare 9.6800 ns/op 11.986 ns/op 0.81
shuffle list - 16384 els 5.6208 ms/op 7.4740 ms/op 0.75
shuffle list - 250000 els 83.219 ms/op 107.55 ms/op 0.77
processSlot - 1 slots 9.8860 us/op 17.694 us/op 0.56
processSlot - 32 slots 1.7552 ms/op 4.2606 ms/op 0.41
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 39.512 ms/op 45.651 ms/op 0.87
getCommitteeAssignments - req 1 vs - 250000 vc 1.7373 ms/op 2.4114 ms/op 0.72
getCommitteeAssignments - req 100 vs - 250000 vc 3.4965 ms/op 4.7120 ms/op 0.74
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7323 ms/op 5.1846 ms/op 0.72
findModifiedValidators - 10000 modified validators 264.47 ms/op 402.36 ms/op 0.66
findModifiedValidators - 1000 modified validators 164.68 ms/op 274.93 ms/op 0.60
findModifiedValidators - 100 modified validators 159.07 ms/op 273.87 ms/op 0.58
findModifiedValidators - 10 modified validators 166.56 ms/op 300.46 ms/op 0.55
findModifiedValidators - 1 modified validators 146.59 ms/op 293.70 ms/op 0.50
findModifiedValidators - no difference 162.87 ms/op 251.25 ms/op 0.65
compare ViewDUs 3.0330 s/op 3.7823 s/op 0.80
compare each validator Uint8Array 1.4648 s/op 1.4968 s/op 0.98
compare ViewDU to Uint8Array 682.83 ms/op 1.3891 s/op 0.49
migrate state 1000000 validators, 24 modified, 0 new 569.73 ms/op 644.09 ms/op 0.88
migrate state 1000000 validators, 1700 modified, 1000 new 766.27 ms/op 940.56 ms/op 0.81
migrate state 1000000 validators, 3400 modified, 2000 new 1.0285 s/op 1.1098 s/op 0.93
migrate state 1500000 validators, 24 modified, 0 new 596.39 ms/op 666.40 ms/op 0.89
migrate state 1500000 validators, 1700 modified, 1000 new 817.54 ms/op 875.14 ms/op 0.93
migrate state 1500000 validators, 3400 modified, 2000 new 1.0095 s/op 1.1537 s/op 0.87
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.8100 ns/op 5.4900 ns/op 1.06
state getBlockRootAtSlot - 250000 vs - 7PWei 747.20 ns/op 925.59 ns/op 0.81
computeProposers - vc 250000 6.2394 ms/op 9.4029 ms/op 0.66
computeEpochShuffling - vc 250000 81.594 ms/op 99.655 ms/op 0.82
getNextSyncCommittee - vc 250000 94.631 ms/op 143.49 ms/op 0.66
computeSigningRoot for AttestationData 27.556 us/op 24.238 us/op 1.14
hash AttestationData serialized data then Buffer.toString(base64) 1.1640 us/op 1.6802 us/op 0.69
toHexString serialized data 714.02 ns/op 1.1644 us/op 0.61
Buffer.toString(base64) 145.74 ns/op 229.40 ns/op 0.64

by benchmarkbot/action

@ensi321 ensi321 marked this pull request as ready for review June 4, 2024 13:00
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

General approach of having the default moved from validator client to beacon node looks good to me, just need to make sure to always respect graffiti if explicitly set by user.

I haven't looked at the spec PR, will do more detailed review once the high-level concerns are addressed.

packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/execution/engine/disabled.ts Outdated Show resolved Hide resolved
packages/cli/src/cmds/validator/handler.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
@wemeetagain wemeetagain modified the milestones: v1.19.0, v1.20.0 Jun 6, 2024
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

lgtm

packages/api/src/beacon/routes/validator.ts Show resolved Hide resolved
packages/api/src/utils/serdes.ts Outdated Show resolved Hide resolved
packages/cli/src/util/graffiti.ts Show resolved Hide resolved
packages/cli/src/cmds/validator/keymanager/impl.ts Outdated Show resolved Hide resolved
packages/cli/src/cmds/validator/keymanager/impl.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
@ensi321 ensi321 requested a review from nflaig June 26, 2024 20:43
packages/beacon-node/src/api/impl/validator/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/chain/prepareNextSlot.ts Outdated Show resolved Hide resolved
return this.executionClientVersion;
}

getConsensusClientVersion(): ClientVersion {
Copy link
Member

Choose a reason for hiding this comment

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

it's a bit strange that this is part of execution engine

packages/beacon-node/src/execution/engine/http.ts Outdated Show resolved Hide resolved
return {code, name: cv.name, version: cv.version, commit: cv.commit};
});

this.logger.debug(`executionClientVersion is set to ${JSON.stringify(this.executionClientVersion)}`);
Copy link
Member

@nflaig nflaig Jun 26, 2024

Choose a reason for hiding this comment

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

just dumping the data like this doesn't seem too useful, maybe we could include the version info in a nicely formatted way in the state logs (likely just the online one)

* Not to be confused with `getClientVersion`. This method returns cached client version
* from `getClientVersion` which is a rpc call to EL client
*/
getExecutionClientVersion(): ClientVersion[];
Copy link
Member

Choose a reason for hiding this comment

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

instead of using a function for this, could have a public property and use a getter in the implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

instead of using a function for this, could have a public property and use a getter in the implementation

It was to conform with the getState() function. But I agree using a getter. We don't need property to be public though.

Copy link
Member

Choose a reason for hiding this comment

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

We don't need property to be public though.

I mean on the interface, like

readonly clientVersion?: ClientVersion;

and the implementation would use a getter

I don't like that getState() is a method if it just returns a property

@@ -429,6 +474,9 @@ export class ExecutionEngineHttp implements IExecutionEngine {
switch (newState) {
case ExecutionEngineState.ONLINE:
this.logger.info("Execution client became online", {oldState, newState});
this.getClientVersion().catch((e) => {
Copy link
Member

Choose a reason for hiding this comment

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

The online state is good place to trigger this as the online time this will be the newState if el was offline but there is a small issue on startup with this as initial state is online, see

private state: ExecutionEngineState = ExecutionEngineState.ONLINE;

I would assume it's currently not fetched on startup, other than handling inital fetch this looks good to me

@@ -335,6 +332,26 @@ export function getValidatorApi({
);
}

function getDefaultGraffiti(): string {
Copy link
Member

@nflaig nflaig Jun 27, 2024

Choose a reason for hiding this comment

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

Looking at code in this PR, it seems a bit scattered around, we should consider moving this into utils file and having graffiti related code there. Would also allow to add unit tests for this which would document the expected format as well.

The execution engine is responsible for providing the version of the connected EL client and shouldn't have to know more than that. I guess the execution engine needs to lodestar version, maybe we can just import that statically, similar to the previous graffiti util

* Client code as defined in https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/identification.md#clientcode
* ClientCode.XX is dedicated to other clients which do not have their own code
*/
export enum ClientCode {
Copy link
Member

@nflaig nflaig Jun 27, 2024

Choose a reason for hiding this comment

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

this is not really related to execution engine as it's specific to format in graffiti ah nvm this is relevant to the engine api format

const response = await this.rpc.fetchWithRetries<
EngineApiRpcReturnTypes[typeof method],
EngineApiRpcParamTypes[typeof method]
>({method, params: [clientVersion ?? this.getConsensusClientVersion()]});
Copy link
Member

Choose a reason for hiding this comment

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

Need to confirm that we sent 8 bytes as the commit hash, I think we currently use 7 to match github hashes

Depending how strict the ELs validate this request it might cause issues, see related

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.

Include EL client info in graffiti
3 participants