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

fix: handle skip_randao_verification query param as per spec #6576

Merged
merged 10 commits into from
Mar 21, 2024

Conversation

nazarhussain
Copy link
Contributor

@nazarhussain nazarhussain commented Mar 21, 2024

Motivation

Make sure Lodestar VC works with other clients.

Description

  • Make the validator produceBlockV3 more flexible on skip_randao_verification
  • Change the type of skip_randao_verification to string, which is inferred type for query parameters.
  • Make sure empty string is treated as true and not false.
  • Test the lodestar VC with latest version of Lighthouse Beacon Node.

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner March 21, 2024 18:47
@nazarhussain nazarhussain changed the title bug: make validator produceBlockV3 more flexible fix: make validator produceBlockV3 more flexible Mar 21, 2024
@nazarhussain nazarhussain self-assigned this Mar 21, 2024
Comment on lines 564 to 566
if (skipRandaoVerification) {
query["skip_randao_verification"] = "";
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per the current spec

This query parameter is a flag and does not take a value.

So we have to change the type to string and make it only take empty string when the value is actually true.

@@ -486,7 +486,7 @@ export type ReqTypes = {
query: {
randao_reveal: string;
graffiti: string;
skip_randao_verification?: boolean;
skip_randao_verification?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@g11tech
Copy link
Contributor

g11tech commented Mar 21, 2024

I am good with the PR as such leave it to @nflaig and @nazarhussain to hash out some comments

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Merging #6576 (f8f7898) into unstable (b68e78e) will increase coverage by 0.02%.
Report is 4 commits behind head on unstable.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6576      +/-   ##
============================================
+ Coverage     61.46%   61.49%   +0.02%     
============================================
  Files           556      556              
  Lines         58850    58895      +45     
  Branches       1850     1856       +6     
============================================
+ Hits          36171    36216      +45     
  Misses        22638    22638              
  Partials         41       41              

// usage of produce blinded block which should return execution block in blinded format
// but only enable that after testing lighthouse beacon
"builder.selection": "executiononly",
useProduceBlockV3: true,
Copy link
Member

Choose a reason for hiding this comment

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

do we even have to set this explicitly, or do we want to test as it works in production, i.e. pre deneb use v2 and post deneb v3?

Copy link
Member

Choose a reason for hiding this comment

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

I don't believe we need to explicitly state this anymore now that we're post Deneb and use it by default. Everything on our side should've flipped to v3 automatically at Deneb unless explicitly stated false.

Copy link
Member

Choose a reason for hiding this comment

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

yes but sim tests go through all forks from phase0, just wondering if it makes more sense to test this more closely to production behavior were this only switches to v3 post deneb. On the other hand, there is no public network I know of that is pre deneb anymore, so it just matters for private / testnets or maybe emphemery which does not start genesis at deneb right now iirc

@nflaig nflaig changed the title fix: make validator produceBlockV3 more flexible fix: handle skip_randao_verification query param as per spec Mar 21, 2024
Copy link
Contributor

github-actions bot commented Mar 21, 2024

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 5c21df7 Previous: 9b1f0af Ratio
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 48.739 us/op 172.14 us/op 0.28
Set add up to 64 items then delete first 1.7890 us/op 5.6831 us/op 0.31
Set add up to 64 items then delete last 2.0491 us/op 6.3143 us/op 0.32
Set add up to 64 items then delete middle 2.0157 us/op 6.1629 us/op 0.33
Set add up to 128 items then delete first 3.9981 us/op 12.148 us/op 0.33
Set add up to 128 items then delete last 3.9304 us/op 12.003 us/op 0.33
OrderedSet add up to 128 items then delete last 5.8436 us/op 18.052 us/op 0.32
Set add up to 128 items then delete middle 3.9426 us/op 12.193 us/op 0.32
Set add up to 256 items then delete first 7.8080 us/op 25.332 us/op 0.31
Set add up to 256 items then delete last 7.7259 us/op 24.293 us/op 0.32
Set add up to 256 items then delete middle 7.5299 us/op 25.037 us/op 0.30
forkChoice updateHead vc 600000 bc 64 eq 300000 11.858 ms/op 48.339 ms/op 0.25
computeDeltas 500000 validators 300 proto nodes 3.1184 ms/op 9.6186 ms/op 0.32
computeDeltas 500000 validators 1200 proto nodes 2.8830 ms/op 9.3960 ms/op 0.31
computeDeltas 500000 validators 7200 proto nodes 2.8877 ms/op 9.4351 ms/op 0.31
computeDeltas 1400000 validators 300 proto nodes 8.8140 ms/op 27.821 ms/op 0.32
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.1510 us/op 33.325 us/op 0.27
Full benchmark results
Benchmark suite Current: 5c21df7 Previous: 9b1f0af Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 755.13 us/op 936.35 us/op 0.81
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 48.739 us/op 172.14 us/op 0.28
BLS verify - blst-native 1.1170 ms/op 1.6998 ms/op 0.66
BLS verifyMultipleSignatures 3 - blst-native 2.3016 ms/op 3.2765 ms/op 0.70
BLS verifyMultipleSignatures 8 - blst-native 5.3445 ms/op 7.3079 ms/op 0.73
BLS verifyMultipleSignatures 32 - blst-native 19.595 ms/op 26.786 ms/op 0.73
BLS verifyMultipleSignatures 64 - blst-native 38.368 ms/op 52.253 ms/op 0.73
BLS verifyMultipleSignatures 128 - blst-native 75.180 ms/op 102.73 ms/op 0.73
BLS deserializing 10000 signatures 761.59 ms/op 1.1088 s/op 0.69
BLS deserializing 100000 signatures 8.1181 s/op 10.498 s/op 0.77
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.0887 ms/op 1.8048 ms/op 0.60
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2335 ms/op 1.7918 ms/op 0.69
BLS verifyMultipleSignatures - same message - 32 - blst-native 1.9537 ms/op 2.5799 ms/op 0.76
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.7585 ms/op 4.0423 ms/op 0.93
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.7777 ms/op 6.6298 ms/op 1.02
BLS aggregatePubkeys 32 - blst-native 22.571 us/op 29.927 us/op 0.75
BLS aggregatePubkeys 128 - blst-native 88.710 us/op 112.94 us/op 0.79
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 43.000 ms/op 88.563 ms/op 0.49
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 49.965 ms/op 95.359 ms/op 0.52
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 28.627 ms/op 72.634 ms/op 0.39
getSlashingsAndExits - default max 157.47 us/op 349.62 us/op 0.45
getSlashingsAndExits - 2k 390.54 us/op 647.18 us/op 0.60
proposeBlockBody type=full, size=empty 4.5359 ms/op 7.8792 ms/op 0.58
isKnown best case - 1 super set check 239.00 ns/op 595.00 ns/op 0.40
isKnown normal case - 2 super set checks 238.00 ns/op 595.00 ns/op 0.40
isKnown worse case - 16 super set checks 234.00 ns/op 641.00 ns/op 0.37
CheckpointStateCache - add get delete 3.8970 us/op 8.2840 us/op 0.47
validate api signedAggregateAndProof - struct 2.4177 ms/op 3.0963 ms/op 0.78
validate gossip signedAggregateAndProof - struct 2.4177 ms/op 3.2661 ms/op 0.74
validate gossip attestation - vc 640000 1.1544 ms/op 1.5945 ms/op 0.72
batch validate gossip attestation - vc 640000 - chunk 32 139.60 us/op 198.12 us/op 0.70
batch validate gossip attestation - vc 640000 - chunk 64 122.94 us/op 174.19 us/op 0.71
batch validate gossip attestation - vc 640000 - chunk 128 122.26 us/op 188.22 us/op 0.65
batch validate gossip attestation - vc 640000 - chunk 256 119.63 us/op 170.48 us/op 0.70
pickEth1Vote - no votes 1.0087 ms/op 1.6586 ms/op 0.61
pickEth1Vote - max votes 8.3726 ms/op 15.555 ms/op 0.54
pickEth1Vote - Eth1Data hashTreeRoot value x2048 17.435 ms/op 23.288 ms/op 0.75
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.662 ms/op 33.256 ms/op 0.71
pickEth1Vote - Eth1Data fastSerialize value x2048 428.71 us/op 848.11 us/op 0.51
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.9048 ms/op 6.5072 ms/op 0.75
bytes32 toHexString 358.00 ns/op 802.00 ns/op 0.45
bytes32 Buffer.toString(hex) 221.00 ns/op 374.00 ns/op 0.59
bytes32 Buffer.toString(hex) from Uint8Array 437.00 ns/op 636.00 ns/op 0.69
bytes32 Buffer.toString(hex) + 0x 228.00 ns/op 361.00 ns/op 0.63
Object access 1 prop 0.13900 ns/op 0.28700 ns/op 0.48
Map access 1 prop 0.096000 ns/op 0.18200 ns/op 0.53
Object get x1000 4.8910 ns/op 8.6950 ns/op 0.56
Map get x1000 0.74200 ns/op 1.0120 ns/op 0.73
Object set x1000 34.609 ns/op 89.331 ns/op 0.39
Map set x1000 23.064 ns/op 62.343 ns/op 0.37
Return object 10000 times 0.22080 ns/op 0.27890 ns/op 0.79
Throw Error 10000 times 2.7897 us/op 4.8379 us/op 0.58
fastMsgIdFn sha256 / 200 bytes 1.9640 us/op 4.2280 us/op 0.46
fastMsgIdFn h32 xxhash / 200 bytes 235.00 ns/op 439.00 ns/op 0.54
fastMsgIdFn h64 xxhash / 200 bytes 285.00 ns/op 493.00 ns/op 0.58
fastMsgIdFn sha256 / 1000 bytes 6.8740 us/op 13.501 us/op 0.51
fastMsgIdFn h32 xxhash / 1000 bytes 384.00 ns/op 635.00 ns/op 0.60
fastMsgIdFn h64 xxhash / 1000 bytes 344.00 ns/op 582.00 ns/op 0.59
fastMsgIdFn sha256 / 10000 bytes 51.421 us/op 127.55 us/op 0.40
fastMsgIdFn h32 xxhash / 10000 bytes 1.7130 us/op 2.4400 us/op 0.70
fastMsgIdFn h64 xxhash / 10000 bytes 1.1460 us/op 1.7160 us/op 0.67
send data - 1000 256B messages 12.982 ms/op 28.273 ms/op 0.46
send data - 1000 512B messages 18.757 ms/op 37.716 ms/op 0.50
send data - 1000 1024B messages 21.939 ms/op 54.784 ms/op 0.40
send data - 1000 1200B messages 30.448 ms/op 52.614 ms/op 0.58
send data - 1000 2048B messages 40.594 ms/op 61.521 ms/op 0.66
send data - 1000 4096B messages 33.205 ms/op 51.510 ms/op 0.64
send data - 1000 16384B messages 92.055 ms/op 138.31 ms/op 0.67
send data - 1000 65536B messages 408.13 ms/op 617.45 ms/op 0.66
enrSubnets - fastDeserialize 64 bits 885.00 ns/op 2.2750 us/op 0.39
enrSubnets - ssz BitVector 64 bits 310.00 ns/op 648.00 ns/op 0.48
enrSubnets - fastDeserialize 4 bits 113.00 ns/op 287.00 ns/op 0.39
enrSubnets - ssz BitVector 4 bits 326.00 ns/op 667.00 ns/op 0.49
prioritizePeers score -10:0 att 32-0.1 sync 2-0 67.299 us/op 131.10 us/op 0.51
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 91.965 us/op 158.58 us/op 0.58
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 112.13 us/op 217.63 us/op 0.52
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 182.50 us/op 397.37 us/op 0.46
prioritizePeers score 0:0 att 64-1 sync 4-1 207.49 us/op 435.96 us/op 0.48
array of 16000 items push then shift 1.2980 us/op 2.0014 us/op 0.65
LinkedList of 16000 items push then shift 5.9020 ns/op 10.865 ns/op 0.54
array of 16000 items push then pop 71.484 ns/op 131.05 ns/op 0.55
LinkedList of 16000 items push then pop 5.6580 ns/op 10.879 ns/op 0.52
array of 24000 items push then shift 1.9207 us/op 2.9518 us/op 0.65
LinkedList of 24000 items push then shift 5.8540 ns/op 10.974 ns/op 0.53
array of 24000 items push then pop 93.075 ns/op 194.94 ns/op 0.48
LinkedList of 24000 items push then pop 5.6690 ns/op 11.312 ns/op 0.50
intersect bitArray bitLen 8 4.7980 ns/op 7.3790 ns/op 0.65
intersect array and set length 8 49.932 ns/op 104.74 ns/op 0.48
intersect bitArray bitLen 128 29.699 ns/op 44.491 ns/op 0.67
intersect array and set length 128 695.47 ns/op 1.4330 us/op 0.49
bitArray.getTrueBitIndexes() bitLen 128 1.1170 us/op 2.5080 us/op 0.45
bitArray.getTrueBitIndexes() bitLen 248 1.8690 us/op 4.0160 us/op 0.47
bitArray.getTrueBitIndexes() bitLen 512 3.5440 us/op 7.8410 us/op 0.45
Buffer.concat 32 items 735.00 ns/op 1.3510 us/op 0.54
Uint8Array.set 32 items 1.5910 us/op 2.9990 us/op 0.53
Set add up to 64 items then delete first 1.7890 us/op 5.6831 us/op 0.31
OrderedSet add up to 64 items then delete first 2.7347 us/op 7.8240 us/op 0.35
Set add up to 64 items then delete last 2.0491 us/op 6.3143 us/op 0.32
OrderedSet add up to 64 items then delete last 3.0590 us/op 8.1787 us/op 0.37
Set add up to 64 items then delete middle 2.0157 us/op 6.1629 us/op 0.33
OrderedSet add up to 64 items then delete middle 4.3366 us/op 9.8054 us/op 0.44
Set add up to 128 items then delete first 3.9981 us/op 12.148 us/op 0.33
OrderedSet add up to 128 items then delete first 6.2933 us/op 17.078 us/op 0.37
Set add up to 128 items then delete last 3.9304 us/op 12.003 us/op 0.33
OrderedSet add up to 128 items then delete last 5.8436 us/op 18.052 us/op 0.32
Set add up to 128 items then delete middle 3.9426 us/op 12.193 us/op 0.32
OrderedSet add up to 128 items then delete middle 10.821 us/op 22.755 us/op 0.48
Set add up to 256 items then delete first 7.8080 us/op 25.332 us/op 0.31
OrderedSet add up to 256 items then delete first 12.433 us/op 33.336 us/op 0.37
Set add up to 256 items then delete last 7.7259 us/op 24.293 us/op 0.32
OrderedSet add up to 256 items then delete last 11.584 us/op 32.079 us/op 0.36
Set add up to 256 items then delete middle 7.5299 us/op 25.037 us/op 0.30
OrderedSet add up to 256 items then delete middle 31.599 us/op 58.919 us/op 0.54
transfer serialized Status (84 B) 1.1910 us/op 2.4650 us/op 0.48
copy serialized Status (84 B) 931.00 ns/op 1.8910 us/op 0.49
transfer serialized SignedVoluntaryExit (112 B) 1.2470 us/op 2.4060 us/op 0.52
copy serialized SignedVoluntaryExit (112 B) 952.00 ns/op 1.8710 us/op 0.51
transfer serialized ProposerSlashing (416 B) 1.4390 us/op 2.9610 us/op 0.49
copy serialized ProposerSlashing (416 B) 1.2940 us/op 2.6270 us/op 0.49
transfer serialized Attestation (485 B) 1.4770 us/op 2.9940 us/op 0.49
copy serialized Attestation (485 B) 1.2930 us/op 2.6390 us/op 0.49
transfer serialized AttesterSlashing (33232 B) 1.9170 us/op 2.9040 us/op 0.66
copy serialized AttesterSlashing (33232 B) 3.7850 us/op 11.197 us/op 0.34
transfer serialized Small SignedBeaconBlock (128000 B) 2.1380 us/op 4.7700 us/op 0.45
copy serialized Small SignedBeaconBlock (128000 B) 8.8600 us/op 38.144 us/op 0.23
transfer serialized Avg SignedBeaconBlock (200000 B) 2.2550 us/op 5.5120 us/op 0.41
copy serialized Avg SignedBeaconBlock (200000 B) 12.037 us/op 55.221 us/op 0.22
transfer serialized BlobsSidecar (524380 B) 2.8650 us/op 7.1480 us/op 0.40
copy serialized BlobsSidecar (524380 B) 78.371 us/op 175.60 us/op 0.45
transfer serialized Big SignedBeaconBlock (1000000 B) 3.2680 us/op 8.7670 us/op 0.37
copy serialized Big SignedBeaconBlock (1000000 B) 142.63 us/op 423.88 us/op 0.34
pass gossip attestations to forkchoice per slot 2.8799 ms/op 5.1744 ms/op 0.56
forkChoice updateHead vc 100000 bc 64 eq 0 516.15 us/op 932.46 us/op 0.55
forkChoice updateHead vc 600000 bc 64 eq 0 2.7260 ms/op 7.1096 ms/op 0.38
forkChoice updateHead vc 1000000 bc 64 eq 0 4.5606 ms/op 9.7523 ms/op 0.47
forkChoice updateHead vc 600000 bc 320 eq 0 2.6711 ms/op 6.3935 ms/op 0.42
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7566 ms/op 6.8058 ms/op 0.41
forkChoice updateHead vc 600000 bc 7200 eq 0 3.6286 ms/op 7.9715 ms/op 0.46
forkChoice updateHead vc 600000 bc 64 eq 1000 9.4858 ms/op 14.463 ms/op 0.66
forkChoice updateHead vc 600000 bc 64 eq 10000 9.2348 ms/op 18.454 ms/op 0.50
forkChoice updateHead vc 600000 bc 64 eq 300000 11.858 ms/op 48.339 ms/op 0.25
computeDeltas 500000 validators 300 proto nodes 3.1184 ms/op 9.6186 ms/op 0.32
computeDeltas 500000 validators 1200 proto nodes 2.8830 ms/op 9.3960 ms/op 0.31
computeDeltas 500000 validators 7200 proto nodes 2.8877 ms/op 9.4351 ms/op 0.31
computeDeltas 750000 validators 300 proto nodes 4.4328 ms/op 13.060 ms/op 0.34
computeDeltas 750000 validators 1200 proto nodes 4.6213 ms/op 12.545 ms/op 0.37
computeDeltas 750000 validators 7200 proto nodes 4.6252 ms/op 13.396 ms/op 0.35
computeDeltas 1400000 validators 300 proto nodes 8.8140 ms/op 27.821 ms/op 0.32
computeDeltas 1400000 validators 1200 proto nodes 9.6698 ms/op 26.303 ms/op 0.37
computeDeltas 1400000 validators 7200 proto nodes 8.7646 ms/op 24.297 ms/op 0.36
computeDeltas 2100000 validators 300 proto nodes 13.420 ms/op 35.528 ms/op 0.38
computeDeltas 2100000 validators 1200 proto nodes 13.970 ms/op 37.096 ms/op 0.38
computeDeltas 2100000 validators 7200 proto nodes 13.035 ms/op 38.177 ms/op 0.34
altair processAttestation - 250000 vs - 7PWei normalcase 1.5725 ms/op 4.3632 ms/op 0.36
altair processAttestation - 250000 vs - 7PWei worstcase 2.2355 ms/op 5.9659 ms/op 0.37
altair processAttestation - setStatus - 1/6 committees join 101.16 us/op 258.40 us/op 0.39
altair processAttestation - setStatus - 1/3 committees join 214.66 us/op 446.65 us/op 0.48
altair processAttestation - setStatus - 1/2 committees join 294.90 us/op 628.13 us/op 0.47
altair processAttestation - setStatus - 2/3 committees join 371.94 us/op 780.88 us/op 0.48
altair processAttestation - setStatus - 4/5 committees join 482.02 us/op 994.41 us/op 0.48
altair processAttestation - setStatus - 100% committees join 592.34 us/op 1.2477 ms/op 0.47
altair processBlock - 250000 vs - 7PWei normalcase 8.3880 ms/op 15.050 ms/op 0.56
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.264 ms/op 48.047 ms/op 0.59
altair processBlock - 250000 vs - 7PWei worstcase 29.887 ms/op 52.816 ms/op 0.57
altair processBlock - 250000 vs - 7PWei worstcase hashState 75.665 ms/op 125.92 ms/op 0.60
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9737 ms/op 3.8569 ms/op 0.51
phase0 processBlock - 250000 vs - 7PWei worstcase 23.434 ms/op 39.844 ms/op 0.59
altair processEth1Data - 250000 vs - 7PWei normalcase 343.13 us/op 918.90 us/op 0.37
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.569 us/op 20.121 us/op 0.53
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 53.656 us/op 71.606 us/op 0.75
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.1510 us/op 33.325 us/op 0.27
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.339 us/op 19.246 us/op 0.64
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 147.23 us/op 203.47 us/op 0.72
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2166 ms/op 1.8373 ms/op 0.66
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1194 ms/op 2.3749 ms/op 0.47
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.3919 ms/op 2.2065 ms/op 0.63
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 1.9443 ms/op 4.8754 ms/op 0.40
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.4715 ms/op 3.5056 ms/op 0.42
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.8506 ms/op 8.0999 ms/op 0.48
Tree 40 250000 create 248.70 ms/op 788.95 ms/op 0.32
Tree 40 250000 get(125000) 111.43 ns/op 242.69 ns/op 0.46
Tree 40 250000 set(125000) 731.75 ns/op 2.5604 us/op 0.29
Tree 40 250000 toArray() 9.3009 ms/op 28.564 ms/op 0.33
Tree 40 250000 iterate all - toArray() + loop 9.4067 ms/op 29.067 ms/op 0.32
Tree 40 250000 iterate all - get(i) 39.129 ms/op 92.180 ms/op 0.42
MutableVector 250000 create 11.511 ms/op 19.789 ms/op 0.58
MutableVector 250000 get(125000) 5.8710 ns/op 8.3560 ns/op 0.70
MutableVector 250000 set(125000) 218.38 ns/op 602.05 ns/op 0.36
MutableVector 250000 toArray() 2.1964 ms/op 4.9706 ms/op 0.44
MutableVector 250000 iterate all - toArray() + loop 2.3331 ms/op 4.9985 ms/op 0.47
MutableVector 250000 iterate all - get(i) 1.3526 ms/op 1.7547 ms/op 0.77
Array 250000 create 2.0830 ms/op 4.3840 ms/op 0.48
Array 250000 clone - spread 1.2782 ms/op 1.9227 ms/op 0.66
Array 250000 get(125000) 1.0370 ns/op 2.5740 ns/op 0.40
Array 250000 set(125000) 1.2500 ns/op 6.5590 ns/op 0.19
Array 250000 iterate all - loop 156.23 us/op 206.70 us/op 0.76
effectiveBalanceIncrements clone Uint8Array 300000 15.322 us/op 74.612 us/op 0.21
effectiveBalanceIncrements clone MutableVector 300000 396.00 ns/op 652.00 ns/op 0.61
effectiveBalanceIncrements rw all Uint8Array 300000 187.07 us/op 267.61 us/op 0.70
effectiveBalanceIncrements rw all MutableVector 300000 71.018 ms/op 210.41 ms/op 0.34
phase0 afterProcessEpoch - 250000 vs - 7PWei 77.517 ms/op 152.69 ms/op 0.51
phase0 beforeProcessEpoch - 250000 vs - 7PWei 27.520 ms/op 70.326 ms/op 0.39
altair processEpoch - mainnet_e81889 429.72 ms/op 644.15 ms/op 0.67
mainnet_e81889 - altair beforeProcessEpoch 63.690 ms/op 114.68 ms/op 0.56
mainnet_e81889 - altair processJustificationAndFinalization 7.8750 us/op 21.065 us/op 0.37
mainnet_e81889 - altair processInactivityUpdates 4.3179 ms/op 10.393 ms/op 0.42
mainnet_e81889 - altair processRewardsAndPenalties 59.761 ms/op 92.695 ms/op 0.64
mainnet_e81889 - altair processRegistryUpdates 1.6250 us/op 6.1880 us/op 0.26
mainnet_e81889 - altair processSlashings 592.00 ns/op 882.00 ns/op 0.67
mainnet_e81889 - altair processEth1DataReset 448.00 ns/op 1.3980 us/op 0.32
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0276 ms/op 1.7771 ms/op 0.58
mainnet_e81889 - altair processSlashingsReset 2.1230 us/op 7.4780 us/op 0.28
mainnet_e81889 - altair processRandaoMixesReset 2.5170 us/op 12.239 us/op 0.21
mainnet_e81889 - altair processHistoricalRootsUpdate 474.00 ns/op 1.4130 us/op 0.34
mainnet_e81889 - altair processParticipationFlagUpdates 984.00 ns/op 4.0020 us/op 0.25
mainnet_e81889 - altair processSyncCommitteeUpdates 376.00 ns/op 909.00 ns/op 0.41
mainnet_e81889 - altair afterProcessEpoch 79.850 ms/op 130.99 ms/op 0.61
capella processEpoch - mainnet_e217614 1.6005 s/op 2.7365 s/op 0.58
mainnet_e217614 - capella beforeProcessEpoch 435.83 ms/op 580.77 ms/op 0.75
mainnet_e217614 - capella processJustificationAndFinalization 14.370 us/op 22.825 us/op 0.63
mainnet_e217614 - capella processInactivityUpdates 20.724 ms/op 26.047 ms/op 0.80
mainnet_e217614 - capella processRewardsAndPenalties 619.56 ms/op 599.47 ms/op 1.03
mainnet_e217614 - capella processRegistryUpdates 14.948 us/op 50.493 us/op 0.30
mainnet_e217614 - capella processSlashings 489.00 ns/op 1.3200 us/op 0.37
mainnet_e217614 - capella processEth1DataReset 746.00 ns/op 1.8720 us/op 0.40
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.7050 ms/op 5.8142 ms/op 0.64
mainnet_e217614 - capella processSlashingsReset 6.5490 us/op 7.9210 us/op 0.83
mainnet_e217614 - capella processRandaoMixesReset 3.7060 us/op 15.874 us/op 0.23
mainnet_e217614 - capella processHistoricalRootsUpdate 1.8560 us/op 1.6750 us/op 1.11
mainnet_e217614 - capella processParticipationFlagUpdates 5.0550 us/op 4.0680 us/op 1.24
mainnet_e217614 - capella afterProcessEpoch 252.18 ms/op 419.85 ms/op 0.60
phase0 processEpoch - mainnet_e58758 409.87 ms/op 597.71 ms/op 0.69
mainnet_e58758 - phase0 beforeProcessEpoch 191.09 ms/op 204.72 ms/op 0.93
mainnet_e58758 - phase0 processJustificationAndFinalization 19.818 us/op 25.446 us/op 0.78
mainnet_e58758 - phase0 processRewardsAndPenalties 61.536 ms/op 56.731 ms/op 1.08
mainnet_e58758 - phase0 processRegistryUpdates 9.9160 us/op 19.145 us/op 0.52
mainnet_e58758 - phase0 processSlashings 742.00 ns/op 738.00 ns/op 1.01
mainnet_e58758 - phase0 processEth1DataReset 894.00 ns/op 900.00 ns/op 0.99
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0537 ms/op 1.6211 ms/op 0.65
mainnet_e58758 - phase0 processSlashingsReset 3.9780 us/op 6.1300 us/op 0.65
mainnet_e58758 - phase0 processRandaoMixesReset 5.3590 us/op 7.0520 us/op 0.76
mainnet_e58758 - phase0 processHistoricalRootsUpdate 785.00 ns/op 1.0360 us/op 0.76
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4830 us/op 6.3490 us/op 0.55
mainnet_e58758 - phase0 afterProcessEpoch 70.850 ms/op 121.91 ms/op 0.58
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0229 ms/op 1.5796 ms/op 0.65
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1641 ms/op 1.9027 ms/op 0.61
altair processInactivityUpdates - 250000 normalcase 24.805 ms/op 32.334 ms/op 0.77
altair processInactivityUpdates - 250000 worstcase 29.843 ms/op 37.089 ms/op 0.80
phase0 processRegistryUpdates - 250000 normalcase 10.339 us/op 13.653 us/op 0.76
phase0 processRegistryUpdates - 250000 badcase_full_deposits 530.53 us/op 525.45 us/op 1.01
phase0 processRegistryUpdates - 250000 worstcase 0.5 167.03 ms/op 166.42 ms/op 1.00
altair processRewardsAndPenalties - 250000 normalcase 79.807 ms/op 74.295 ms/op 1.07
altair processRewardsAndPenalties - 250000 worstcase 76.333 ms/op 77.178 ms/op 0.99
phase0 getAttestationDeltas - 250000 normalcase 6.3288 ms/op 13.828 ms/op 0.46
phase0 getAttestationDeltas - 250000 worstcase 10.986 ms/op 13.831 ms/op 0.79
phase0 processSlashings - 250000 worstcase 85.315 us/op 95.196 us/op 0.90
altair processSyncCommitteeUpdates - 250000 119.79 ms/op 197.83 ms/op 0.61
BeaconState.hashTreeRoot - No change 296.00 ns/op 654.00 ns/op 0.45
BeaconState.hashTreeRoot - 1 full validator 91.420 us/op 175.41 us/op 0.52
BeaconState.hashTreeRoot - 32 full validator 993.95 us/op 1.8483 ms/op 0.54
BeaconState.hashTreeRoot - 512 full validator 15.880 ms/op 19.666 ms/op 0.81
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 110.53 us/op 191.18 us/op 0.58
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4644 ms/op 2.8100 ms/op 0.52
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 20.863 ms/op 35.910 ms/op 0.58
BeaconState.hashTreeRoot - 1 balances 91.127 us/op 150.13 us/op 0.61
BeaconState.hashTreeRoot - 32 balances 825.72 us/op 1.3853 ms/op 0.60
BeaconState.hashTreeRoot - 512 balances 8.0593 ms/op 13.680 ms/op 0.59
BeaconState.hashTreeRoot - 250000 balances 215.66 ms/op 244.92 ms/op 0.88
aggregationBits - 2048 els - zipIndexesInBitList 25.592 us/op 43.222 us/op 0.59
byteArrayEquals 32 62.769 ns/op 81.876 ns/op 0.77
Buffer.compare 32 36.518 ns/op 58.472 ns/op 0.62
byteArrayEquals 1024 1.8593 us/op 2.4380 us/op 0.76
Buffer.compare 1024 49.790 ns/op 85.663 ns/op 0.58
byteArrayEquals 16384 26.938 us/op 37.685 us/op 0.71
Buffer.compare 16384 225.97 ns/op 293.37 ns/op 0.77
byteArrayEquals 123687377 200.99 ms/op 276.48 ms/op 0.73
Buffer.compare 123687377 6.5077 ms/op 7.1737 ms/op 0.91
byteArrayEquals 32 - diff last byte 64.299 ns/op 79.300 ns/op 0.81
Buffer.compare 32 - diff last byte 38.097 ns/op 60.630 ns/op 0.63
byteArrayEquals 1024 - diff last byte 1.6599 us/op 2.1200 us/op 0.78
Buffer.compare 1024 - diff last byte 43.557 ns/op 76.954 ns/op 0.57
byteArrayEquals 16384 - diff last byte 26.631 us/op 35.118 us/op 0.76
Buffer.compare 16384 - diff last byte 216.55 ns/op 291.59 ns/op 0.74
byteArrayEquals 123687377 - diff last byte 210.41 ms/op 266.58 ms/op 0.79
Buffer.compare 123687377 - diff last byte 6.2510 ms/op 8.4465 ms/op 0.74
byteArrayEquals 32 - random bytes 4.6160 ns/op 6.2020 ns/op 0.74
Buffer.compare 32 - random bytes 39.943 ns/op 67.226 ns/op 0.59
byteArrayEquals 1024 - random bytes 4.5860 ns/op 6.3050 ns/op 0.73
Buffer.compare 1024 - random bytes 38.981 ns/op 65.920 ns/op 0.59
byteArrayEquals 16384 - random bytes 4.6360 ns/op 6.3270 ns/op 0.73
Buffer.compare 16384 - random bytes 40.223 ns/op 66.174 ns/op 0.61
byteArrayEquals 123687377 - random bytes 7.4300 ns/op 9.4200 ns/op 0.79
Buffer.compare 123687377 - random bytes 41.370 ns/op 75.940 ns/op 0.54
regular array get 100000 times 43.136 us/op 49.988 us/op 0.86
wrappedArray get 100000 times 43.316 us/op 49.404 us/op 0.88
arrayWithProxy get 100000 times 10.959 ms/op 16.211 ms/op 0.68
ssz.Root.equals 57.371 ns/op 62.231 ns/op 0.92
byteArrayEquals 57.253 ns/op 58.498 ns/op 0.98
Buffer.compare 9.9640 ns/op 13.204 ns/op 0.75
shuffle list - 16384 els 5.9815 ms/op 9.6058 ms/op 0.62
shuffle list - 250000 els 85.713 ms/op 134.18 ms/op 0.64
processSlot - 1 slots 15.606 us/op 20.387 us/op 0.77
processSlot - 32 slots 2.9500 ms/op 3.6950 ms/op 0.80
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 49.367 ms/op 63.761 ms/op 0.77
getCommitteeAssignments - req 1 vs - 250000 vc 2.3276 ms/op 2.8875 ms/op 0.81
getCommitteeAssignments - req 100 vs - 250000 vc 3.5163 ms/op 4.3294 ms/op 0.81
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8075 ms/op 4.5227 ms/op 0.84
findModifiedValidators - 10000 modified validators 401.41 ms/op 600.42 ms/op 0.67
findModifiedValidators - 1000 modified validators 337.21 ms/op 480.40 ms/op 0.70
findModifiedValidators - 100 modified validators 333.93 ms/op 504.32 ms/op 0.66
findModifiedValidators - 10 modified validators 329.24 ms/op 507.87 ms/op 0.65
findModifiedValidators - 1 modified validators 331.25 ms/op 444.82 ms/op 0.74
findModifiedValidators - no difference 344.75 ms/op 515.63 ms/op 0.67
compare ViewDUs 4.1020 s/op 5.3318 s/op 0.77
compare each validator Uint8Array 1.7737 s/op 2.0426 s/op 0.87
compare ViewDU to Uint8Array 979.59 ms/op 1.4866 s/op 0.66
migrate state 1000000 validators, 24 modified, 0 new 751.76 ms/op 960.91 ms/op 0.78
migrate state 1000000 validators, 1700 modified, 1000 new 894.19 ms/op 1.2832 s/op 0.70
migrate state 1000000 validators, 3400 modified, 2000 new 1.3018 s/op 1.4822 s/op 0.88
migrate state 1500000 validators, 24 modified, 0 new 790.95 ms/op 904.47 ms/op 0.87
migrate state 1500000 validators, 1700 modified, 1000 new 1.0105 s/op 1.0929 s/op 0.92
migrate state 1500000 validators, 3400 modified, 2000 new 1.2182 s/op 1.4097 s/op 0.86
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.6000 ns/op 5.2100 ns/op 0.69
state getBlockRootAtSlot - 250000 vs - 7PWei 539.17 ns/op 1.0337 us/op 0.52
computeProposers - vc 250000 6.4656 ms/op 11.636 ms/op 0.56
computeEpochShuffling - vc 250000 85.337 ms/op 137.26 ms/op 0.62
getNextSyncCommittee - vc 250000 103.92 ms/op 193.70 ms/op 0.54
computeSigningRoot for AttestationData 22.916 us/op 32.795 us/op 0.70
hash AttestationData serialized data then Buffer.toString(base64) 1.2842 us/op 2.5621 us/op 0.50
toHexString serialized data 804.70 ns/op 1.2734 us/op 0.63
Buffer.toString(base64) 143.89 ns/op 266.84 ns/op 0.54

by benchmarkbot/action

@@ -795,3 +795,7 @@ export function getReturnTypes(): ReturnTypes<Api> {
function parseBuilderBoostFactor(builderBoostFactorInput?: string | number | bigint): bigint | undefined {
return builderBoostFactorInput !== undefined ? BigInt(builderBoostFactorInput) : undefined;
}

function parseSkipRandaoVerification(skipRandaoVerification?: string): boolean {
return skipRandaoVerification !== undefined && skipRandaoVerification === "";
Copy link
Member

@nflaig nflaig Mar 21, 2024

Choose a reason for hiding this comment

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

This query parameter is a flag and does not take a value.

I think checking the value doesn't even make sense as the spec states it does not take a value, might be best to just checking if the flag exists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding of does not take a value implies an empty string in terms a query string parameter for a url. So I believe that's correct to check it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

implies an empty string in terms a query string parameter for a url

Hmm yeah might be, or potentially the difference between setting ?skip_randao_verification and ?skip_randao_verification=. If other clients are strictly checking it that way we should be fine as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

?skip_randao_verification is not a right query string parameter format, it query parameters always suffix with =

Copy link
Member

Choose a reason for hiding this comment

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

Was looking through the RFC but didn't find anything on it, but even the openapi docs have this as an example

image

I would expect that ?skip_randao_verification is allowed by fastify but in the end it might be an implementation detail.

nflaig
nflaig previously approved these changes Mar 21, 2024
@philknows philknows merged commit 129f300 into unstable Mar 21, 2024
19 of 20 checks passed
@philknows philknows deleted the nh/fix-vc-produce-block branch March 21, 2024 21:50
@wemeetagain
Copy link
Member

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

5 participants