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: add endpoint for attestations reward #6484

Merged
merged 20 commits into from
Mar 18, 2024
Merged

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Feb 27, 2024

Motivation

introduce a beacon API endpoint to return attestations reward info according to the spec. This is the last reward endpoints mentioned in #5694

Note that the endpoint currently only supports Altair epoch or later. Attempts to query for phase0 epoch will return error.

Description

Closes #5694

Steps to test or reproduce

@jeluard
Copy link
Contributor

jeluard commented Feb 27, 2024

Would it make sense to check if this ignored test now pass?

@jeluard
Copy link
Contributor

jeluard commented Mar 1, 2024

Would it make sense to check if this ignored test now pass?

Never mind, I now see you made necessary changes so that the test is executed.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Merging #6484 (7bf0fac) into unstable (10c1b11) will decrease coverage by 0.20%.
Report is 19 commits behind head on unstable.
The diff coverage is 98.98%.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6484      +/-   ##
============================================
- Coverage     61.72%   61.52%   -0.20%     
============================================
  Files           555      556       +1     
  Lines         58302    58749     +447     
  Branches       1846     1850       +4     
============================================
+ Hits          35985    36147     +162     
- Misses        22277    22561     +284     
- Partials         40       41       +1     

Copy link
Contributor

github-actions bot commented Mar 5, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f38ea89 Previous: 30d347d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 626.04 us/op 613.34 us/op 1.02
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 137.88 us/op 135.55 us/op 1.02
BLS verify - blst-native 1.6190 ms/op 1.4424 ms/op 1.12
BLS verifyMultipleSignatures 3 - blst-native 2.8662 ms/op 3.1719 ms/op 0.90
BLS verifyMultipleSignatures 8 - blst-native 6.3797 ms/op 6.3607 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 23.666 ms/op 23.896 ms/op 0.99
BLS verifyMultipleSignatures 64 - blst-native 46.722 ms/op 48.418 ms/op 0.96
BLS verifyMultipleSignatures 128 - blst-native 92.799 ms/op 104.92 ms/op 0.88
BLS deserializing 10000 signatures 1.0176 s/op 1.0126 s/op 1.00
BLS deserializing 100000 signatures 9.5535 s/op 9.6155 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3840 ms/op 1.3965 ms/op 0.99
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5798 ms/op 1.6346 ms/op 0.97
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4389 ms/op 2.4605 ms/op 0.99
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5833 ms/op 3.6875 ms/op 0.97
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.8924 ms/op 5.9505 ms/op 0.99
BLS aggregatePubkeys 32 - blst-native 27.026 us/op 27.117 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 103.06 us/op 105.74 us/op 0.97
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 66.595 ms/op 79.504 ms/op 0.84
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 73.395 ms/op 65.196 ms/op 1.13
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 47.115 ms/op 53.384 ms/op 0.88
getSlashingsAndExits - default max 195.66 us/op 342.71 us/op 0.57
getSlashingsAndExits - 2k 419.63 us/op 647.92 us/op 0.65
proposeBlockBody type=full, size=empty 5.7205 ms/op 6.7986 ms/op 0.84
isKnown best case - 1 super set check 335.00 ns/op 634.00 ns/op 0.53
isKnown normal case - 2 super set checks 312.00 ns/op 625.00 ns/op 0.50
isKnown worse case - 16 super set checks 309.00 ns/op 748.00 ns/op 0.41
CheckpointStateCache - add get delete 5.7660 us/op 8.8930 us/op 0.65
validate api signedAggregateAndProof - struct 2.7985 ms/op 3.0011 ms/op 0.93
validate gossip signedAggregateAndProof - struct 2.7571 ms/op 2.9346 ms/op 0.94
validate gossip attestation - vc 640000 1.3283 ms/op 1.4825 ms/op 0.90
batch validate gossip attestation - vc 640000 - chunk 32 155.41 us/op 181.28 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 64 139.09 us/op 155.18 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 128 136.22 us/op 156.22 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 256 125.95 us/op 162.55 us/op 0.77
pickEth1Vote - no votes 1.1919 ms/op 1.4471 ms/op 0.82
pickEth1Vote - max votes 10.334 ms/op 12.410 ms/op 0.83
pickEth1Vote - Eth1Data hashTreeRoot value x2048 21.532 ms/op 24.653 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.187 ms/op 35.233 ms/op 0.66
pickEth1Vote - Eth1Data fastSerialize value x2048 606.57 us/op 953.66 us/op 0.64
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.7748 ms/op 6.0002 ms/op 0.96
bytes32 toHexString 473.00 ns/op 929.00 ns/op 0.51
bytes32 Buffer.toString(hex) 294.00 ns/op 339.00 ns/op 0.87
bytes32 Buffer.toString(hex) from Uint8Array 412.00 ns/op 579.00 ns/op 0.71
bytes32 Buffer.toString(hex) + 0x 291.00 ns/op 353.00 ns/op 0.82
Object access 1 prop 0.15400 ns/op 0.24000 ns/op 0.64
Map access 1 prop 0.14200 ns/op 0.18400 ns/op 0.77
Object get x1000 7.6250 ns/op 8.3970 ns/op 0.91
Map get x1000 0.74300 ns/op 0.99800 ns/op 0.74
Object set x1000 49.850 ns/op 84.033 ns/op 0.59
Map set x1000 38.635 ns/op 66.266 ns/op 0.58
Return object 10000 times 0.23550 ns/op 0.28890 ns/op 0.82
Throw Error 10000 times 3.8614 us/op 4.5554 us/op 0.85
fastMsgIdFn sha256 / 200 bytes 3.2480 us/op 4.0910 us/op 0.79
fastMsgIdFn h32 xxhash / 200 bytes 278.00 ns/op 427.00 ns/op 0.65
fastMsgIdFn h64 xxhash / 200 bytes 356.00 ns/op 456.00 ns/op 0.78
fastMsgIdFn sha256 / 1000 bytes 11.489 us/op 13.102 us/op 0.88
fastMsgIdFn h32 xxhash / 1000 bytes 466.00 ns/op 543.00 ns/op 0.86
fastMsgIdFn h64 xxhash / 1000 bytes 425.00 ns/op 598.00 ns/op 0.71
fastMsgIdFn sha256 / 10000 bytes 101.60 us/op 120.35 us/op 0.84
fastMsgIdFn h32 xxhash / 10000 bytes 1.9130 us/op 2.5050 us/op 0.76
fastMsgIdFn h64 xxhash / 10000 bytes 1.3050 us/op 1.6780 us/op 0.78
send data - 1000 256B messages 17.796 ms/op 25.991 ms/op 0.68
send data - 1000 512B messages 25.542 ms/op 33.049 ms/op 0.77
send data - 1000 1024B messages 39.014 ms/op 53.948 ms/op 0.72
send data - 1000 1200B messages 35.444 ms/op 61.253 ms/op 0.58
send data - 1000 2048B messages 47.995 ms/op 62.167 ms/op 0.77
send data - 1000 4096B messages 42.546 ms/op 49.412 ms/op 0.86
send data - 1000 16384B messages 111.55 ms/op 121.59 ms/op 0.92
send data - 1000 65536B messages 463.50 ms/op 520.54 ms/op 0.89
enrSubnets - fastDeserialize 64 bits 1.2170 us/op 1.2280 us/op 0.99
enrSubnets - ssz BitVector 64 bits 420.00 ns/op 417.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 165.00 ns/op 173.00 ns/op 0.95
enrSubnets - ssz BitVector 4 bits 415.00 ns/op 419.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 98.951 us/op 98.789 us/op 1.00
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 119.09 us/op 134.98 us/op 0.88
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 156.20 us/op 173.45 us/op 0.90
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 279.95 us/op 295.58 us/op 0.95
prioritizePeers score 0:0 att 64-1 sync 4-1 328.61 us/op 356.23 us/op 0.92
array of 16000 items push then shift 1.6032 us/op 1.6319 us/op 0.98
LinkedList of 16000 items push then shift 8.7700 ns/op 8.9200 ns/op 0.98
array of 16000 items push then pop 91.501 ns/op 90.828 ns/op 1.01
LinkedList of 16000 items push then pop 8.6070 ns/op 9.2550 ns/op 0.93
array of 24000 items push then shift 2.3646 us/op 2.4847 us/op 0.95
LinkedList of 24000 items push then shift 8.7450 ns/op 9.1470 ns/op 0.96
array of 24000 items push then pop 123.50 ns/op 129.00 ns/op 0.96
LinkedList of 24000 items push then pop 8.7770 ns/op 8.7920 ns/op 1.00
intersect bitArray bitLen 8 5.8580 ns/op 5.8950 ns/op 0.99
intersect array and set length 8 64.155 ns/op 64.757 ns/op 0.99
intersect bitArray bitLen 128 35.824 ns/op 35.996 ns/op 1.00
intersect array and set length 128 889.24 ns/op 863.34 ns/op 1.03
bitArray.getTrueBitIndexes() bitLen 128 1.5090 us/op 1.4130 us/op 1.07
bitArray.getTrueBitIndexes() bitLen 248 2.5800 us/op 2.5060 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 512 5.5940 us/op 4.7650 us/op 1.17
Buffer.concat 32 items 996.00 ns/op 992.00 ns/op 1.00
Uint8Array.set 32 items 1.8860 us/op 1.7360 us/op 1.09
Set add up to 64 items then delete first 5.0167 us/op 4.4206 us/op 1.13
OrderedSet add up to 64 items then delete first 6.0838 us/op 5.6065 us/op 1.09
Set add up to 64 items then delete last 5.3420 us/op 4.9519 us/op 1.08
OrderedSet add up to 64 items then delete last 5.9784 us/op 6.4759 us/op 0.92
Set add up to 64 items then delete middle 4.8291 us/op 5.4119 us/op 0.89
OrderedSet add up to 64 items then delete middle 7.0198 us/op 8.4436 us/op 0.83
Set add up to 128 items then delete first 9.5091 us/op 10.974 us/op 0.87
OrderedSet add up to 128 items then delete first 12.323 us/op 13.468 us/op 0.91
Set add up to 128 items then delete last 9.1522 us/op 10.613 us/op 0.86
OrderedSet add up to 128 items then delete last 11.516 us/op 15.037 us/op 0.77
Set add up to 128 items then delete middle 9.0718 us/op 10.414 us/op 0.87
OrderedSet add up to 128 items then delete middle 16.928 us/op 18.050 us/op 0.94
Set add up to 256 items then delete first 18.946 us/op 19.689 us/op 0.96
OrderedSet add up to 256 items then delete first 25.578 us/op 24.834 us/op 1.03
Set add up to 256 items then delete last 18.152 us/op 19.965 us/op 0.91
OrderedSet add up to 256 items then delete last 23.419 us/op 24.946 us/op 0.94
Set add up to 256 items then delete middle 18.996 us/op 20.911 us/op 0.91
OrderedSet add up to 256 items then delete middle 44.378 us/op 48.036 us/op 0.92
transfer serialized Status (84 B) 1.6430 us/op 1.8120 us/op 0.91
copy serialized Status (84 B) 1.2540 us/op 1.3780 us/op 0.91
transfer serialized SignedVoluntaryExit (112 B) 1.7390 us/op 1.9420 us/op 0.90
copy serialized SignedVoluntaryExit (112 B) 1.2910 us/op 1.5460 us/op 0.84
transfer serialized ProposerSlashing (416 B) 1.8750 us/op 2.4210 us/op 0.77
copy serialized ProposerSlashing (416 B) 1.6240 us/op 2.0530 us/op 0.79
transfer serialized Attestation (485 B) 1.9900 us/op 3.2260 us/op 0.62
copy serialized Attestation (485 B) 1.6570 us/op 2.2870 us/op 0.72
transfer serialized AttesterSlashing (33232 B) 2.1510 us/op 2.6490 us/op 0.81
copy serialized AttesterSlashing (33232 B) 5.0280 us/op 7.1250 us/op 0.71
transfer serialized Small SignedBeaconBlock (128000 B) 2.5260 us/op 3.4820 us/op 0.73
copy serialized Small SignedBeaconBlock (128000 B) 14.248 us/op 19.771 us/op 0.72
transfer serialized Avg SignedBeaconBlock (200000 B) 2.9590 us/op 3.6770 us/op 0.80
copy serialized Avg SignedBeaconBlock (200000 B) 20.320 us/op 30.664 us/op 0.66
transfer serialized BlobsSidecar (524380 B) 3.4190 us/op 3.6960 us/op 0.93
copy serialized BlobsSidecar (524380 B) 85.191 us/op 96.083 us/op 0.89
transfer serialized Big SignedBeaconBlock (1000000 B) 4.0120 us/op 3.5370 us/op 1.13
copy serialized Big SignedBeaconBlock (1000000 B) 161.36 us/op 181.27 us/op 0.89
pass gossip attestations to forkchoice per slot 4.4258 ms/op 4.7464 ms/op 0.93
forkChoice updateHead vc 100000 bc 64 eq 0 728.55 us/op 754.80 us/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 0 4.4973 ms/op 6.8560 ms/op 0.66
forkChoice updateHead vc 1000000 bc 64 eq 0 7.2392 ms/op 8.3082 ms/op 0.87
forkChoice updateHead vc 600000 bc 320 eq 0 4.2157 ms/op 4.6675 ms/op 0.90
forkChoice updateHead vc 600000 bc 1200 eq 0 4.4065 ms/op 4.8891 ms/op 0.90
forkChoice updateHead vc 600000 bc 7200 eq 0 5.3971 ms/op 7.0563 ms/op 0.76
forkChoice updateHead vc 600000 bc 64 eq 1000 11.218 ms/op 12.766 ms/op 0.88
forkChoice updateHead vc 600000 bc 64 eq 10000 11.970 ms/op 13.263 ms/op 0.90
forkChoice updateHead vc 600000 bc 64 eq 300000 16.224 ms/op 21.063 ms/op 0.77
computeDeltas 500000 validators 300 proto nodes 6.6589 ms/op 7.5273 ms/op 0.88
computeDeltas 500000 validators 1200 proto nodes 6.7011 ms/op 7.4067 ms/op 0.90
computeDeltas 500000 validators 7200 proto nodes 6.4669 ms/op 6.8944 ms/op 0.94
computeDeltas 750000 validators 300 proto nodes 9.4188 ms/op 10.672 ms/op 0.88
computeDeltas 750000 validators 1200 proto nodes 9.4987 ms/op 10.378 ms/op 0.92
computeDeltas 750000 validators 7200 proto nodes 9.7657 ms/op 10.189 ms/op 0.96
computeDeltas 1400000 validators 300 proto nodes 17.833 ms/op 21.615 ms/op 0.83
computeDeltas 1400000 validators 1200 proto nodes 17.959 ms/op 21.533 ms/op 0.83
computeDeltas 1400000 validators 7200 proto nodes 18.484 ms/op 22.253 ms/op 0.83
computeDeltas 2100000 validators 300 proto nodes 27.211 ms/op 32.441 ms/op 0.84
computeDeltas 2100000 validators 1200 proto nodes 27.043 ms/op 31.957 ms/op 0.85
computeDeltas 2100000 validators 7200 proto nodes 27.935 ms/op 34.114 ms/op 0.82
altair processAttestation - 250000 vs - 7PWei normalcase 2.2431 ms/op 3.4623 ms/op 0.65
altair processAttestation - 250000 vs - 7PWei worstcase 3.3140 ms/op 5.0574 ms/op 0.66
altair processAttestation - setStatus - 1/6 committees join 185.86 us/op 214.05 us/op 0.87
altair processAttestation - setStatus - 1/3 committees join 360.40 us/op 438.67 us/op 0.82
altair processAttestation - setStatus - 1/2 committees join 482.97 us/op 633.90 us/op 0.76
altair processAttestation - setStatus - 2/3 committees join 604.71 us/op 707.69 us/op 0.85
altair processAttestation - setStatus - 4/5 committees join 788.90 us/op 1.0624 ms/op 0.74
altair processAttestation - setStatus - 100% committees join 936.33 us/op 1.1025 ms/op 0.85
altair processBlock - 250000 vs - 7PWei normalcase 15.374 ms/op 12.780 ms/op 1.20
altair processBlock - 250000 vs - 7PWei normalcase hashState 53.514 ms/op 42.296 ms/op 1.27
altair processBlock - 250000 vs - 7PWei worstcase 58.494 ms/op 51.156 ms/op 1.14
altair processBlock - 250000 vs - 7PWei worstcase hashState 111.84 ms/op 125.16 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei normalcase 3.2701 ms/op 4.4179 ms/op 0.74
phase0 processBlock - 250000 vs - 7PWei worstcase 33.435 ms/op 41.948 ms/op 0.80
altair processEth1Data - 250000 vs - 7PWei normalcase 667.08 us/op 789.68 us/op 0.84
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 22.147 us/op 21.420 us/op 1.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 84.120 us/op 70.533 us/op 1.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 21.083 us/op 30.090 us/op 0.70
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 13.676 us/op 24.640 us/op 0.56
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 185.55 us/op 201.81 us/op 0.92
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.3701 ms/op 1.6953 ms/op 0.81
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.0363 ms/op 2.7625 ms/op 0.74
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4714 ms/op 2.2803 ms/op 0.65
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7412 ms/op 5.5456 ms/op 0.67
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4805 ms/op 3.0996 ms/op 0.80
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9048 ms/op 7.0466 ms/op 0.70
Tree 40 250000 create 367.99 ms/op 598.16 ms/op 0.62
Tree 40 250000 get(125000) 201.53 ns/op 230.75 ns/op 0.87
Tree 40 250000 set(125000) 1.1172 us/op 1.5979 us/op 0.70
Tree 40 250000 toArray() 21.345 ms/op 26.490 ms/op 0.81
Tree 40 250000 iterate all - toArray() + loop 22.921 ms/op 29.353 ms/op 0.78
Tree 40 250000 iterate all - get(i) 71.079 ms/op 83.643 ms/op 0.85
MutableVector 250000 create 14.499 ms/op 17.584 ms/op 0.82
MutableVector 250000 get(125000) 6.5940 ns/op 7.1030 ns/op 0.93
MutableVector 250000 set(125000) 301.45 ns/op 547.36 ns/op 0.55
MutableVector 250000 toArray() 3.8001 ms/op 4.3912 ms/op 0.87
MutableVector 250000 iterate all - toArray() + loop 3.8541 ms/op 4.7697 ms/op 0.81
MutableVector 250000 iterate all - get(i) 1.5244 ms/op 1.6118 ms/op 0.95
Array 250000 create 3.2813 ms/op 3.9774 ms/op 0.82
Array 250000 clone - spread 1.4187 ms/op 1.4693 ms/op 0.97
Array 250000 get(125000) 1.1600 ns/op 1.2850 ns/op 0.90
Array 250000 set(125000) 4.2520 ns/op 4.9820 ns/op 0.85
Array 250000 iterate all - loop 166.25 us/op 180.43 us/op 0.92
effectiveBalanceIncrements clone Uint8Array 300000 35.082 us/op 51.058 us/op 0.69
effectiveBalanceIncrements clone MutableVector 300000 447.00 ns/op 468.00 ns/op 0.96
effectiveBalanceIncrements rw all Uint8Array 300000 200.07 us/op 210.10 us/op 0.95
effectiveBalanceIncrements rw all MutableVector 300000 95.444 ms/op 101.05 ms/op 0.94
phase0 afterProcessEpoch - 250000 vs - 7PWei 114.46 ms/op 124.54 ms/op 0.92
phase0 beforeProcessEpoch - 250000 vs - 7PWei 51.493 ms/op 68.793 ms/op 0.75
altair processEpoch - mainnet_e81889 502.65 ms/op 498.69 ms/op 1.01
mainnet_e81889 - altair beforeProcessEpoch 85.601 ms/op 93.002 ms/op 0.92
mainnet_e81889 - altair processJustificationAndFinalization 14.743 us/op 20.016 us/op 0.74
mainnet_e81889 - altair processInactivityUpdates 6.6688 ms/op 8.1375 ms/op 0.82
mainnet_e81889 - altair processRewardsAndPenalties 62.445 ms/op 67.131 ms/op 0.93
mainnet_e81889 - altair processRegistryUpdates 2.5270 us/op 6.6160 us/op 0.38
mainnet_e81889 - altair processSlashings 552.00 ns/op 920.00 ns/op 0.60
mainnet_e81889 - altair processEth1DataReset 530.00 ns/op 1.1240 us/op 0.47
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4081 ms/op 1.8321 ms/op 0.77
mainnet_e81889 - altair processSlashingsReset 4.6000 us/op 8.6520 us/op 0.53
mainnet_e81889 - altair processRandaoMixesReset 5.0430 us/op 7.9730 us/op 0.63
mainnet_e81889 - altair processHistoricalRootsUpdate 739.00 ns/op 1.1150 us/op 0.66
mainnet_e81889 - altair processParticipationFlagUpdates 1.6070 us/op 4.8380 us/op 0.33
mainnet_e81889 - altair processSyncCommitteeUpdates 915.00 ns/op 1.4610 us/op 0.63
mainnet_e81889 - altair afterProcessEpoch 120.68 ms/op 130.21 ms/op 0.93
capella processEpoch - mainnet_e217614 1.9081 s/op 2.1085 s/op 0.90
mainnet_e217614 - capella beforeProcessEpoch 496.51 ms/op 595.45 ms/op 0.83
mainnet_e217614 - capella processJustificationAndFinalization 14.020 us/op 23.846 us/op 0.59
mainnet_e217614 - capella processInactivityUpdates 17.958 ms/op 32.287 ms/op 0.56
mainnet_e217614 - capella processRewardsAndPenalties 430.97 ms/op 433.80 ms/op 0.99
mainnet_e217614 - capella processRegistryUpdates 30.539 us/op 37.533 us/op 0.81
mainnet_e217614 - capella processSlashings 548.00 ns/op 1.0630 us/op 0.52
mainnet_e217614 - capella processEth1DataReset 532.00 ns/op 1.0240 us/op 0.52
mainnet_e217614 - capella processEffectiveBalanceUpdates 9.1595 ms/op 10.447 ms/op 0.88
mainnet_e217614 - capella processSlashingsReset 2.8630 us/op 4.1340 us/op 0.69
mainnet_e217614 - capella processRandaoMixesReset 5.6670 us/op 8.9350 us/op 0.63
mainnet_e217614 - capella processHistoricalRootsUpdate 475.00 ns/op 1.0490 us/op 0.45
mainnet_e217614 - capella processParticipationFlagUpdates 1.6890 us/op 2.4780 us/op 0.68
mainnet_e217614 - capella afterProcessEpoch 304.66 ms/op 329.74 ms/op 0.92
phase0 processEpoch - mainnet_e58758 485.41 ms/op 599.64 ms/op 0.81
mainnet_e58758 - phase0 beforeProcessEpoch 121.19 ms/op 190.45 ms/op 0.64
mainnet_e58758 - phase0 processJustificationAndFinalization 16.151 us/op 31.475 us/op 0.51
mainnet_e58758 - phase0 processRewardsAndPenalties 37.988 ms/op 67.400 ms/op 0.56
mainnet_e58758 - phase0 processRegistryUpdates 11.750 us/op 18.779 us/op 0.63
mainnet_e58758 - phase0 processSlashings 533.00 ns/op 1.1000 us/op 0.48
mainnet_e58758 - phase0 processEth1DataReset 442.00 ns/op 989.00 ns/op 0.45
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1649 ms/op 1.4040 ms/op 0.83
mainnet_e58758 - phase0 processSlashingsReset 3.2020 us/op 5.7510 us/op 0.56
mainnet_e58758 - phase0 processRandaoMixesReset 3.6780 us/op 7.0910 us/op 0.52
mainnet_e58758 - phase0 processHistoricalRootsUpdate 408.00 ns/op 801.00 ns/op 0.51
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.6620 us/op 9.4400 us/op 0.39
mainnet_e58758 - phase0 afterProcessEpoch 103.47 ms/op 110.67 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4346 ms/op 1.6310 ms/op 0.88
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5949 ms/op 1.8752 ms/op 0.85
altair processInactivityUpdates - 250000 normalcase 29.271 ms/op 41.438 ms/op 0.71
altair processInactivityUpdates - 250000 worstcase 22.198 ms/op 39.676 ms/op 0.56
phase0 processRegistryUpdates - 250000 normalcase 10.041 us/op 12.499 us/op 0.80
phase0 processRegistryUpdates - 250000 badcase_full_deposits 474.61 us/op 428.95 us/op 1.11
phase0 processRegistryUpdates - 250000 worstcase 0.5 159.43 ms/op 150.81 ms/op 1.06
altair processRewardsAndPenalties - 250000 normalcase 57.301 ms/op 67.928 ms/op 0.84
altair processRewardsAndPenalties - 250000 worstcase 54.141 ms/op 63.856 ms/op 0.85
phase0 getAttestationDeltas - 250000 normalcase 10.020 ms/op 12.111 ms/op 0.83
phase0 getAttestationDeltas - 250000 worstcase 9.6318 ms/op 11.825 ms/op 0.81
phase0 processSlashings - 250000 worstcase 102.55 us/op 112.72 us/op 0.91
altair processSyncCommitteeUpdates - 250000 169.16 ms/op 182.77 ms/op 0.93
BeaconState.hashTreeRoot - No change 382.00 ns/op 901.00 ns/op 0.42
BeaconState.hashTreeRoot - 1 full validator 122.03 us/op 178.00 us/op 0.69
BeaconState.hashTreeRoot - 32 full validator 1.2864 ms/op 1.7865 ms/op 0.72
BeaconState.hashTreeRoot - 512 full validator 13.734 ms/op 20.213 ms/op 0.68
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 154.18 us/op 195.21 us/op 0.79
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.6227 ms/op 2.5414 ms/op 1.03
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 33.128 ms/op 31.721 ms/op 1.04
BeaconState.hashTreeRoot - 1 balances 148.00 us/op 145.49 us/op 1.02
BeaconState.hashTreeRoot - 32 balances 1.4404 ms/op 1.2485 ms/op 1.15
BeaconState.hashTreeRoot - 512 balances 14.953 ms/op 13.550 ms/op 1.10
BeaconState.hashTreeRoot - 250000 balances 194.65 ms/op 223.96 ms/op 0.87
aggregationBits - 2048 els - zipIndexesInBitList 29.532 us/op 34.626 us/op 0.85
byteArrayEquals 32 75.535 ns/op 81.127 ns/op 0.93
Buffer.compare 32 56.243 ns/op 60.817 ns/op 0.92
byteArrayEquals 1024 2.0639 us/op 2.1930 us/op 0.94
Buffer.compare 1024 72.271 ns/op 75.575 ns/op 0.96
byteArrayEquals 16384 33.303 us/op 34.530 us/op 0.96
Buffer.compare 16384 279.74 ns/op 283.78 ns/op 0.99
byteArrayEquals 123687377 246.32 ms/op 267.32 ms/op 0.92
Buffer.compare 123687377 6.3786 ms/op 9.5739 ms/op 0.67
byteArrayEquals 32 - diff last byte 76.149 ns/op 93.648 ns/op 0.81
Buffer.compare 32 - diff last byte 56.479 ns/op 64.079 ns/op 0.88
byteArrayEquals 1024 - diff last byte 1.9881 us/op 2.2746 us/op 0.87
Buffer.compare 1024 - diff last byte 69.499 ns/op 82.480 ns/op 0.84
byteArrayEquals 16384 - diff last byte 31.672 us/op 36.225 us/op 0.87
Buffer.compare 16384 - diff last byte 270.38 ns/op 302.64 ns/op 0.89
byteArrayEquals 123687377 - diff last byte 239.60 ms/op 302.20 ms/op 0.79
Buffer.compare 123687377 - diff last byte 6.0990 ms/op 9.3600 ms/op 0.65
byteArrayEquals 32 - random bytes 5.1720 ns/op 7.0160 ns/op 0.74
Buffer.compare 32 - random bytes 59.726 ns/op 67.647 ns/op 0.88
byteArrayEquals 1024 - random bytes 5.0890 ns/op 7.0150 ns/op 0.73
Buffer.compare 1024 - random bytes 57.982 ns/op 75.458 ns/op 0.77
byteArrayEquals 16384 - random bytes 4.9560 ns/op 6.9890 ns/op 0.71
Buffer.compare 16384 - random bytes 57.297 ns/op 74.911 ns/op 0.76
byteArrayEquals 123687377 - random bytes 8.0200 ns/op 16.540 ns/op 0.48
Buffer.compare 123687377 - random bytes 60.320 ns/op 86.900 ns/op 0.69
regular array get 100000 times 42.061 us/op 51.543 us/op 0.82
wrappedArray get 100000 times 42.112 us/op 57.112 us/op 0.74
arrayWithProxy get 100000 times 13.641 ms/op 15.807 ms/op 0.86
ssz.Root.equals 52.470 ns/op 62.478 ns/op 0.84
byteArrayEquals 51.769 ns/op 61.535 ns/op 0.84
Buffer.compare 10.559 ns/op 13.573 ns/op 0.78
shuffle list - 16384 els 8.4556 ms/op 9.7446 ms/op 0.87
shuffle list - 250000 els 124.51 ms/op 139.82 ms/op 0.89
processSlot - 1 slots 15.908 us/op 23.728 us/op 0.67
processSlot - 32 slots 3.2904 ms/op 3.8091 ms/op 0.86
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 55.731 ms/op 61.862 ms/op 0.90
getCommitteeAssignments - req 1 vs - 250000 vc 2.7471 ms/op 2.8629 ms/op 0.96
getCommitteeAssignments - req 100 vs - 250000 vc 3.9614 ms/op 4.2981 ms/op 0.92
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2807 ms/op 4.5547 ms/op 0.94
findModifiedValidators - 10000 modified validators 529.09 ms/op 634.80 ms/op 0.83
findModifiedValidators - 1000 modified validators 432.47 ms/op 465.23 ms/op 0.93
findModifiedValidators - 100 modified validators 404.82 ms/op 440.70 ms/op 0.92
findModifiedValidators - 10 modified validators 387.52 ms/op 456.84 ms/op 0.85
findModifiedValidators - 1 modified validators 394.50 ms/op 441.75 ms/op 0.89
findModifiedValidators - no difference 397.61 ms/op 450.12 ms/op 0.88
compare ViewDUs 4.3308 s/op 6.3048 s/op 0.69
compare each validator Uint8Array 1.5072 s/op 1.8497 s/op 0.81
compare ViewDU to Uint8Array 1.0626 s/op 1.5313 s/op 0.69
migrate state 1000000 validators, 24 modified, 0 new 774.55 ms/op 835.10 ms/op 0.93
migrate state 1000000 validators, 1700 modified, 1000 new 1.0974 s/op 1.1160 s/op 0.98
migrate state 1000000 validators, 3400 modified, 2000 new 1.3169 s/op 1.3660 s/op 0.96
migrate state 1500000 validators, 24 modified, 0 new 794.52 ms/op 848.13 ms/op 0.94
migrate state 1500000 validators, 1700 modified, 1000 new 1.0752 s/op 1.2125 s/op 0.89
migrate state 1500000 validators, 3400 modified, 2000 new 1.3038 s/op 1.4029 s/op 0.93
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1700 ns/op 4.7400 ns/op 0.88
state getBlockRootAtSlot - 250000 vs - 7PWei 703.45 ns/op 993.60 ns/op 0.71
computeProposers - vc 250000 9.2929 ms/op 10.159 ms/op 0.91
computeEpochShuffling - vc 250000 119.71 ms/op 129.98 ms/op 0.92
getNextSyncCommittee - vc 250000 150.69 ms/op 176.26 ms/op 0.85
computeSigningRoot for AttestationData 27.135 us/op 25.973 us/op 1.04
hash AttestationData serialized data then Buffer.toString(base64) 2.1614 us/op 2.3719 us/op 0.91
toHexString serialized data 997.25 ns/op 1.1286 us/op 0.88
Buffer.toString(base64) 209.38 ns/op 259.31 ns/op 0.81

by benchmarkbot/action

@ensi321 ensi321 marked this pull request as ready for review March 5, 2024 13:01
@ensi321 ensi321 requested a review from a team as a code owner March 5, 2024 13:01
packages/api/src/beacon/routes/beacon/rewards.ts Outdated Show resolved Hide resolved
packages/api/src/beacon/routes/beacon/rewards.ts Outdated Show resolved Hide resolved
packages/api/src/beacon/routes/beacon/rewards.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/chain/chain.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/chain/interface.ts Outdated Show resolved Hide resolved
packages/api/src/beacon/routes/beacon/rewards.ts Outdated Show resolved Hide resolved
packages/api/src/beacon/routes/beacon/rewards.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/chain/interface.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/chain/chain.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/api/impl/beacon/rewards/index.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/chain/chain.ts Outdated Show resolved Hide resolved
packages/api/src/beacon/routes/beacon/rewards.ts Outdated Show resolved Hide resolved
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.

LGTM

@wemeetagain wemeetagain merged commit 0a7aa46 into unstable Mar 18, 2024
20 checks passed
@wemeetagain wemeetagain deleted the nc/attest-reward branch March 18, 2024 14:45
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.

Implement beacon rewards APIs
4 participants