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: pass user credentials to events http client #6179

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Dec 11, 2023

Motivation

Eventstream API does not work with rescue node at the moment because user credentials are removed from URL which is passed to events client.

events: events.getClient(config, httpClient.baseUrl),

Description

Pass user credentials to events http client. The EventSource node implementation will parse the credentials, remove them from the URL and set them in Authorization header. The browser implementation does not support credentials via URL and headers are generally not supported (whatwg/html#2177). We don't expect anyone to use the rescue node from browser, but it is possible to pass authentication tokens as part of cookies.

Closes #4521, this was previously already fixed by calling new URL(...).origin on the URL as it removed the extra / but I am now calling urlJoin which we also use in http client to join urls/paths.

@nflaig nflaig requested a review from a team as a code owner December 11, 2023 23:08
@@ -109,8 +109,7 @@ export class HttpClient implements IHttpClient {
private readonly urlsScore: number[];

get baseUrl(): string {
// Don't leak username/password to caller
Copy link
Member Author

@nflaig nflaig Dec 11, 2023

Choose a reason for hiding this comment

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

this.logger.verbose("Subscribing to head event");
this.api.events
.eventstream([EventType.head], signal, this.onHeadUpdate)
.catch((e) => this.logger.error("Failed to subscribe to head event", {}, e));
Copy link
Member Author

@nflaig nflaig Dec 11, 2023

Choose a reason for hiding this comment

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

Unrelated change but noticed that currently errors (400 and 500) result in an uncaught exception.

We are currently not throwing an error if server responds with 401 (or 404), might be something to consider in this PR but I think it's safer to retry in case those errors happen, see #4521 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Caller won't receive the exception anymore, so any code after the call to start will be executed now.
I understand from your comment that it's fine?

Copy link
Member Author

@nflaig nflaig Dec 12, 2023

Choose a reason for hiding this comment

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

The caller never received the error as the promise was not handled (see void in previous implementation).

The eventstream method does not resolve until connection is aborted which effectively happens if you shut down the validator client

// And abort resolve the promise so finally {} eventSource.close()
signal.addEventListener("abort", () => resolve(), {once: true});

But there are cases where it rejects if server responds with 400 or 500 error

// Consider 400 and 500 status errors unrecoverable, close the eventsource

Previously due to void, these errors would cause an uncaught exception while now the errors are caught and properly logged

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Merging #6179 (69c42b0) into unstable (959a8af) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6179      +/-   ##
============================================
- Coverage     90.35%   90.35%   -0.01%     
============================================
  Files            78       78              
  Lines          8089     8087       -2     
  Branches        490      490              
============================================
- Hits           7309     7307       -2     
  Misses          772      772              
  Partials          8        8              

Copy link
Contributor

github-actions bot commented Dec 11, 2023

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 4db4216 Previous: 959a8af Ratio
getSlashingsAndExits - default max 120.68 us/op 443.58 us/op 0.27
Object set x1000 25.155 ns/op 80.456 ns/op 0.31
Map set x1000 17.021 ns/op 60.552 ns/op 0.28
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 3.7560 us/op 19.570 us/op 0.19
Buffer.compare 123687377 3.7659 ms/op 11.968 ms/op 0.31
Buffer.compare 123687377 - diff last byte 3.8225 ms/op 11.755 ms/op 0.33
Full benchmark results
Benchmark suite Current: 4db4216 Previous: 959a8af Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 353.35 us/op 911.68 us/op 0.39
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 61.712 us/op 143.52 us/op 0.43
BLS verify - blst-native 1.0743 ms/op 1.4383 ms/op 0.75
BLS verifyMultipleSignatures 3 - blst-native 2.2759 ms/op 2.9960 ms/op 0.76
BLS verifyMultipleSignatures 8 - blst-native 5.0526 ms/op 6.9110 ms/op 0.73
BLS verifyMultipleSignatures 32 - blst-native 18.626 ms/op 25.059 ms/op 0.74
BLS verifyMultipleSignatures 64 - blst-native 36.545 ms/op 46.851 ms/op 0.78
BLS verifyMultipleSignatures 128 - blst-native 72.544 ms/op 96.479 ms/op 0.75
BLS deserializing 10000 signatures 788.62 ms/op 974.85 ms/op 0.81
BLS deserializing 100000 signatures 8.1756 s/op 9.4597 s/op 0.86
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.0840 ms/op 1.4177 ms/op 0.76
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2315 ms/op 1.6431 ms/op 0.75
BLS verifyMultipleSignatures - same message - 32 - blst-native 1.9307 ms/op 2.4896 ms/op 0.78
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.8334 ms/op 3.8370 ms/op 1.00
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.6182 ms/op 6.5170 ms/op 1.02
BLS aggregatePubkeys 32 - blst-native 22.563 us/op 29.000 us/op 0.78
BLS aggregatePubkeys 128 - blst-native 88.266 us/op 105.46 us/op 0.84
getAttestationsForBlock 38.433 ms/op 70.130 ms/op 0.55
getSlashingsAndExits - default max 120.68 us/op 443.58 us/op 0.27
getSlashingsAndExits - 2k 262.68 us/op 686.14 us/op 0.38
proposeBlockBody type=full, size=empty 3.8628 ms/op 7.0502 ms/op 0.55
isKnown best case - 1 super set check 303.00 ns/op 708.00 ns/op 0.43
isKnown normal case - 2 super set checks 321.00 ns/op 769.00 ns/op 0.42
isKnown worse case - 16 super set checks 322.00 ns/op 768.00 ns/op 0.42
CheckpointStateCache - add get delete 3.5980 us/op 6.9440 us/op 0.52
validate api signedAggregateAndProof - struct 2.4283 ms/op 3.2607 ms/op 0.74
validate gossip signedAggregateAndProof - struct 2.3655 ms/op 3.1945 ms/op 0.74
validate gossip attestation - vc 640000 1.1276 ms/op 1.4856 ms/op 0.76
batch validate gossip attestation - vc 640000 - chunk 32 133.58 us/op 190.39 us/op 0.70
batch validate gossip attestation - vc 640000 - chunk 64 117.69 us/op 169.64 us/op 0.69
batch validate gossip attestation - vc 640000 - chunk 128 113.60 us/op 167.40 us/op 0.68
batch validate gossip attestation - vc 640000 - chunk 256 110.42 us/op 148.47 us/op 0.74
pickEth1Vote - no votes 880.71 us/op 1.4465 ms/op 0.61
pickEth1Vote - max votes 9.3212 ms/op 13.807 ms/op 0.68
pickEth1Vote - Eth1Data hashTreeRoot value x2048 20.380 ms/op 22.297 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.316 ms/op 32.967 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 414.55 us/op 784.87 us/op 0.53
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.4917 ms/op 6.1774 ms/op 0.73
bytes32 toHexString 447.00 ns/op 882.00 ns/op 0.51
bytes32 Buffer.toString(hex) 313.00 ns/op 311.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 416.00 ns/op 615.00 ns/op 0.68
bytes32 Buffer.toString(hex) + 0x 311.00 ns/op 315.00 ns/op 0.99
Object access 1 prop 0.18400 ns/op 0.25800 ns/op 0.71
Map access 1 prop 0.18400 ns/op 0.16400 ns/op 1.12
Object get x1000 5.6340 ns/op 10.074 ns/op 0.56
Map get x1000 0.72000 ns/op 1.0590 ns/op 0.68
Object set x1000 25.155 ns/op 80.456 ns/op 0.31
Map set x1000 17.021 ns/op 60.552 ns/op 0.28
Return object 10000 times 0.22630 ns/op 0.28160 ns/op 0.80
Throw Error 10000 times 2.7578 us/op 4.2248 us/op 0.65
fastMsgIdFn sha256 / 200 bytes 1.9280 us/op 3.5570 us/op 0.54
fastMsgIdFn h32 xxhash / 200 bytes 282.00 ns/op 375.00 ns/op 0.75
fastMsgIdFn h64 xxhash / 200 bytes 336.00 ns/op 408.00 ns/op 0.82
fastMsgIdFn sha256 / 1000 bytes 6.1270 us/op 12.030 us/op 0.51
fastMsgIdFn h32 xxhash / 1000 bytes 396.00 ns/op 520.00 ns/op 0.76
fastMsgIdFn h64 xxhash / 1000 bytes 401.00 ns/op 526.00 ns/op 0.76
fastMsgIdFn sha256 / 10000 bytes 52.647 us/op 113.42 us/op 0.46
fastMsgIdFn h32 xxhash / 10000 bytes 1.7720 us/op 2.3660 us/op 0.75
fastMsgIdFn h64 xxhash / 10000 bytes 1.2150 us/op 1.6670 us/op 0.73
send data - 1000 256B messages 10.763 ms/op 26.837 ms/op 0.40
send data - 1000 512B messages 14.342 ms/op 30.437 ms/op 0.47
send data - 1000 1024B messages 21.794 ms/op 46.990 ms/op 0.46
send data - 1000 1200B messages 26.012 ms/op 57.095 ms/op 0.46
send data - 1000 2048B messages 33.085 ms/op 60.554 ms/op 0.55
send data - 1000 4096B messages 29.250 ms/op 51.938 ms/op 0.56
send data - 1000 16384B messages 89.519 ms/op 120.91 ms/op 0.74
send data - 1000 65536B messages 370.49 ms/op 491.40 ms/op 0.75
enrSubnets - fastDeserialize 64 bits 1.0060 us/op 1.4350 us/op 0.70
enrSubnets - ssz BitVector 64 bits 457.00 ns/op 483.00 ns/op 0.95
enrSubnets - fastDeserialize 4 bits 231.00 ns/op 209.00 ns/op 1.11
enrSubnets - ssz BitVector 4 bits 433.00 ns/op 592.00 ns/op 0.73
prioritizePeers score -10:0 att 32-0.1 sync 2-0 66.785 us/op 112.96 us/op 0.59
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 80.459 us/op 145.84 us/op 0.55
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 122.47 us/op 196.42 us/op 0.62
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 188.77 us/op 333.78 us/op 0.57
prioritizePeers score 0:0 att 64-1 sync 4-1 204.88 us/op 356.96 us/op 0.57
array of 16000 items push then shift 1.2565 us/op 1.7004 us/op 0.74
LinkedList of 16000 items push then shift 6.9780 ns/op 9.1810 ns/op 0.76
array of 16000 items push then pop 87.363 ns/op 105.65 ns/op 0.83
LinkedList of 16000 items push then pop 5.8430 ns/op 9.8020 ns/op 0.60
array of 24000 items push then shift 1.8225 us/op 2.5838 us/op 0.71
LinkedList of 24000 items push then shift 6.7160 ns/op 9.4740 ns/op 0.71
array of 24000 items push then pop 119.10 ns/op 145.46 ns/op 0.82
LinkedList of 24000 items push then pop 5.7310 ns/op 9.1240 ns/op 0.63
intersect bitArray bitLen 8 4.8100 ns/op 6.7060 ns/op 0.72
intersect array and set length 8 48.983 ns/op 70.184 ns/op 0.70
intersect bitArray bitLen 128 27.259 ns/op 35.055 ns/op 0.78
intersect array and set length 128 680.13 ns/op 989.22 ns/op 0.69
bitArray.getTrueBitIndexes() bitLen 128 1.2890 us/op 1.6370 us/op 0.79
bitArray.getTrueBitIndexes() bitLen 248 2.2070 us/op 2.6430 us/op 0.84
bitArray.getTrueBitIndexes() bitLen 512 3.9440 us/op 5.9570 us/op 0.66
Buffer.concat 32 items 884.00 ns/op 1.2460 us/op 0.71
Uint8Array.set 32 items 1.4770 us/op 2.1320 us/op 0.69
Set add up to 64 items then delete first 1.7140 us/op 5.0827 us/op 0.34
OrderedSet add up to 64 items then delete first 2.7039 us/op 5.9899 us/op 0.45
Set add up to 64 items then delete last 2.0372 us/op 5.0841 us/op 0.40
OrderedSet add up to 64 items then delete last 2.8962 us/op 6.0187 us/op 0.48
Set add up to 64 items then delete middle 1.9508 us/op 4.8251 us/op 0.40
OrderedSet add up to 64 items then delete middle 4.3251 us/op 7.1754 us/op 0.60
Set add up to 128 items then delete first 3.8382 us/op 9.4938 us/op 0.40
OrderedSet add up to 128 items then delete first 7.4457 us/op 12.918 us/op 0.58
Set add up to 128 items then delete last 4.5341 us/op 9.4159 us/op 0.48
OrderedSet add up to 128 items then delete last 5.9586 us/op 11.833 us/op 0.50
Set add up to 128 items then delete middle 3.6362 us/op 10.407 us/op 0.35
OrderedSet add up to 128 items then delete middle 10.264 us/op 20.301 us/op 0.51
Set add up to 256 items then delete first 7.3591 us/op 21.594 us/op 0.34
OrderedSet add up to 256 items then delete first 12.073 us/op 30.389 us/op 0.40
Set add up to 256 items then delete last 7.8233 us/op 22.062 us/op 0.35
OrderedSet add up to 256 items then delete last 11.285 us/op 29.063 us/op 0.39
Set add up to 256 items then delete middle 7.3354 us/op 20.098 us/op 0.36
OrderedSet add up to 256 items then delete middle 31.477 us/op 49.767 us/op 0.63
transfer serialized Status (84 B) 1.5410 us/op 1.9810 us/op 0.78
copy serialized Status (84 B) 1.4290 us/op 1.6270 us/op 0.88
transfer serialized SignedVoluntaryExit (112 B) 1.6550 us/op 1.8610 us/op 0.89
copy serialized SignedVoluntaryExit (112 B) 1.5200 us/op 1.6450 us/op 0.92
transfer serialized ProposerSlashing (416 B) 2.7940 us/op 2.2020 us/op 1.27
copy serialized ProposerSlashing (416 B) 2.7460 us/op 2.1100 us/op 1.30
transfer serialized Attestation (485 B) 2.8040 us/op 2.5920 us/op 1.08
copy serialized Attestation (485 B) 2.8060 us/op 2.7260 us/op 1.03
transfer serialized AttesterSlashing (33232 B) 3.0340 us/op 3.0050 us/op 1.01
copy serialized AttesterSlashing (33232 B) 7.7260 us/op 6.4330 us/op 1.20
transfer serialized Small SignedBeaconBlock (128000 B) 3.1010 us/op 2.7790 us/op 1.12
copy serialized Small SignedBeaconBlock (128000 B) 17.662 us/op 16.316 us/op 1.08
transfer serialized Avg SignedBeaconBlock (200000 B) 2.9820 us/op 3.1660 us/op 0.94
copy serialized Avg SignedBeaconBlock (200000 B) 29.520 us/op 21.072 us/op 1.40
transfer serialized BlobsSidecar (524380 B) 3.0890 us/op 3.4510 us/op 0.90
copy serialized BlobsSidecar (524380 B) 140.72 us/op 132.64 us/op 1.06
transfer serialized Big SignedBeaconBlock (1000000 B) 3.2700 us/op 3.9930 us/op 0.82
copy serialized Big SignedBeaconBlock (1000000 B) 161.68 us/op 308.69 us/op 0.52
pass gossip attestations to forkchoice per slot 2.8309 ms/op 4.4865 ms/op 0.63
forkChoice updateHead vc 100000 bc 64 eq 0 489.49 us/op 711.90 us/op 0.69
forkChoice updateHead vc 600000 bc 64 eq 0 3.1826 ms/op 4.3284 ms/op 0.74
forkChoice updateHead vc 1000000 bc 64 eq 0 5.0747 ms/op 7.0640 ms/op 0.72
forkChoice updateHead vc 600000 bc 320 eq 0 3.0530 ms/op 4.2164 ms/op 0.72
forkChoice updateHead vc 600000 bc 1200 eq 0 3.1737 ms/op 4.3704 ms/op 0.73
forkChoice updateHead vc 600000 bc 7200 eq 0 3.7940 ms/op 5.3400 ms/op 0.71
forkChoice updateHead vc 600000 bc 64 eq 1000 10.146 ms/op 11.408 ms/op 0.89
forkChoice updateHead vc 600000 bc 64 eq 10000 10.163 ms/op 12.199 ms/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 300000 13.920 ms/op 20.223 ms/op 0.69
computeDeltas 500000 validators 300 proto nodes 3.5722 ms/op 7.0513 ms/op 0.51
computeDeltas 500000 validators 1200 proto nodes 2.9523 ms/op 6.6754 ms/op 0.44
computeDeltas 500000 validators 7200 proto nodes 2.9870 ms/op 6.5907 ms/op 0.45
computeDeltas 750000 validators 300 proto nodes 4.4427 ms/op 9.7794 ms/op 0.45
computeDeltas 750000 validators 1200 proto nodes 4.4610 ms/op 9.5770 ms/op 0.47
computeDeltas 750000 validators 7200 proto nodes 4.4207 ms/op 9.4889 ms/op 0.47
computeDeltas 1400000 validators 300 proto nodes 8.6054 ms/op 19.036 ms/op 0.45
computeDeltas 1400000 validators 1200 proto nodes 8.8587 ms/op 19.429 ms/op 0.46
computeDeltas 1400000 validators 7200 proto nodes 8.9877 ms/op 19.117 ms/op 0.47
computeDeltas 2100000 validators 300 proto nodes 13.102 ms/op 28.997 ms/op 0.45
computeDeltas 2100000 validators 1200 proto nodes 13.616 ms/op 29.171 ms/op 0.47
computeDeltas 2100000 validators 7200 proto nodes 13.468 ms/op 29.902 ms/op 0.45
computeProposerBoostScoreFromBalances 500000 validators 3.2530 ms/op 3.8310 ms/op 0.85
computeProposerBoostScoreFromBalances 750000 validators 3.2232 ms/op 3.8424 ms/op 0.84
computeProposerBoostScoreFromBalances 1400000 validators 3.2376 ms/op 3.8969 ms/op 0.83
computeProposerBoostScoreFromBalances 2100000 validators 3.2589 ms/op 4.0735 ms/op 0.80
altair processAttestation - 250000 vs - 7PWei normalcase 1.4336 ms/op 2.5444 ms/op 0.56
altair processAttestation - 250000 vs - 7PWei worstcase 2.1379 ms/op 4.2966 ms/op 0.50
altair processAttestation - setStatus - 1/6 committees join 67.979 us/op 203.62 us/op 0.33
altair processAttestation - setStatus - 1/3 committees join 141.41 us/op 378.28 us/op 0.37
altair processAttestation - setStatus - 1/2 committees join 195.64 us/op 510.80 us/op 0.38
altair processAttestation - setStatus - 2/3 committees join 263.26 us/op 646.91 us/op 0.41
altair processAttestation - setStatus - 4/5 committees join 392.57 us/op 853.04 us/op 0.46
altair processAttestation - setStatus - 100% committees join 447.87 us/op 999.95 us/op 0.45
altair processBlock - 250000 vs - 7PWei normalcase 8.8525 ms/op 11.817 ms/op 0.75
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.802 ms/op 41.779 ms/op 0.69
altair processBlock - 250000 vs - 7PWei worstcase 28.172 ms/op 40.790 ms/op 0.69
altair processBlock - 250000 vs - 7PWei worstcase hashState 86.359 ms/op 109.81 ms/op 0.79
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2506 ms/op 3.1684 ms/op 0.71
phase0 processBlock - 250000 vs - 7PWei worstcase 24.512 ms/op 33.832 ms/op 0.72
altair processEth1Data - 250000 vs - 7PWei normalcase 304.00 us/op 791.81 us/op 0.38
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.4990 us/op 11.257 us/op 0.49
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 61.300 us/op 99.270 us/op 0.62
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 19.026 us/op 32.196 us/op 0.59
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 3.7560 us/op 19.570 us/op 0.19
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 153.90 us/op 187.58 us/op 0.82
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 677.31 us/op 1.3045 ms/op 0.52
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.0111 ms/op 2.0607 ms/op 0.49
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4308 ms/op 2.1386 ms/op 0.67
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.3100 ms/op 4.4531 ms/op 0.52
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.4481 ms/op 2.8024 ms/op 0.52
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.3965 ms/op 6.8683 ms/op 0.49
Tree 40 250000 create 251.77 ms/op 420.33 ms/op 0.60
Tree 40 250000 get(125000) 112.19 ns/op 213.91 ns/op 0.52
Tree 40 250000 set(125000) 742.16 ns/op 1.0496 us/op 0.71
Tree 40 250000 toArray() 9.3969 ms/op 23.169 ms/op 0.41
Tree 40 250000 iterate all - toArray() + loop 9.5110 ms/op 24.215 ms/op 0.39
Tree 40 250000 iterate all - get(i) 37.660 ms/op 77.775 ms/op 0.48
MutableVector 250000 create 10.769 ms/op 17.677 ms/op 0.61
MutableVector 250000 get(125000) 5.5720 ns/op 6.7180 ns/op 0.83
MutableVector 250000 set(125000) 204.37 ns/op 308.13 ns/op 0.66
MutableVector 250000 toArray() 2.5824 ms/op 5.6349 ms/op 0.46
MutableVector 250000 iterate all - toArray() + loop 2.6498 ms/op 4.5221 ms/op 0.59
MutableVector 250000 iterate all - get(i) 1.3054 ms/op 1.5794 ms/op 0.83
Array 250000 create 2.4284 ms/op 3.3311 ms/op 0.73
Array 250000 clone - spread 1.0216 ms/op 1.2541 ms/op 0.81
Array 250000 get(125000) 0.97400 ns/op 1.0820 ns/op 0.90
Array 250000 set(125000) 1.1800 ns/op 4.2110 ns/op 0.28
Array 250000 iterate all - loop 152.19 us/op 170.24 us/op 0.89
effectiveBalanceIncrements clone Uint8Array 300000 13.259 us/op 33.802 us/op 0.39
effectiveBalanceIncrements clone MutableVector 300000 362.00 ns/op 375.00 ns/op 0.97
effectiveBalanceIncrements rw all Uint8Array 300000 182.23 us/op 212.86 us/op 0.86
effectiveBalanceIncrements rw all MutableVector 300000 60.967 ms/op 97.650 ms/op 0.62
phase0 afterProcessEpoch - 250000 vs - 7PWei 73.834 ms/op 120.04 ms/op 0.62
phase0 beforeProcessEpoch - 250000 vs - 7PWei 45.257 ms/op 60.270 ms/op 0.75
altair processEpoch - mainnet_e81889 387.51 ms/op 473.92 ms/op 0.82
mainnet_e81889 - altair beforeProcessEpoch 64.340 ms/op 92.684 ms/op 0.69
mainnet_e81889 - altair processJustificationAndFinalization 10.741 us/op 19.786 us/op 0.54
mainnet_e81889 - altair processInactivityUpdates 3.7753 ms/op 7.3070 ms/op 0.52
mainnet_e81889 - altair processRewardsAndPenalties 64.530 ms/op 82.105 ms/op 0.79
mainnet_e81889 - altair processRegistryUpdates 1.1030 us/op 3.0280 us/op 0.36
mainnet_e81889 - altair processSlashings 375.00 ns/op 877.00 ns/op 0.43
mainnet_e81889 - altair processEth1DataReset 344.00 ns/op 1.4020 us/op 0.25
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7491 ms/op 2.5082 ms/op 0.70
mainnet_e81889 - altair processSlashingsReset 2.1780 us/op 7.9100 us/op 0.28
mainnet_e81889 - altair processRandaoMixesReset 2.2800 us/op 12.058 us/op 0.19
mainnet_e81889 - altair processHistoricalRootsUpdate 683.00 ns/op 1.0910 us/op 0.63
mainnet_e81889 - altair processParticipationFlagUpdates 1.3830 us/op 3.6550 us/op 0.38
mainnet_e81889 - altair processSyncCommitteeUpdates 516.00 ns/op 1.0870 us/op 0.47
mainnet_e81889 - altair afterProcessEpoch 74.916 ms/op 128.59 ms/op 0.58
capella processEpoch - mainnet_e217614 1.8065 s/op 2.4033 s/op 0.75
mainnet_e217614 - capella beforeProcessEpoch 464.50 ms/op 522.97 ms/op 0.89
mainnet_e217614 - capella processJustificationAndFinalization 17.009 us/op 19.899 us/op 0.85
mainnet_e217614 - capella processInactivityUpdates 18.510 ms/op 25.090 ms/op 0.74
mainnet_e217614 - capella processRewardsAndPenalties 409.18 ms/op 468.37 ms/op 0.87
mainnet_e217614 - capella processRegistryUpdates 25.376 us/op 30.148 us/op 0.84
mainnet_e217614 - capella processSlashings 660.00 ns/op 1.0210 us/op 0.65
mainnet_e217614 - capella processEth1DataReset 749.00 ns/op 694.00 ns/op 1.08
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.0478 ms/op 7.4805 ms/op 0.67
mainnet_e217614 - capella processSlashingsReset 3.6040 us/op 6.7600 us/op 0.53
mainnet_e217614 - capella processRandaoMixesReset 3.1240 us/op 8.7710 us/op 0.36
mainnet_e217614 - capella processHistoricalRootsUpdate 773.00 ns/op 877.00 ns/op 0.88
mainnet_e217614 - capella processParticipationFlagUpdates 3.7260 us/op 4.3210 us/op 0.86
mainnet_e217614 - capella afterProcessEpoch 220.18 ms/op 333.26 ms/op 0.66
phase0 processEpoch - mainnet_e58758 482.66 ms/op 557.77 ms/op 0.87
mainnet_e58758 - phase0 beforeProcessEpoch 132.88 ms/op 152.40 ms/op 0.87
mainnet_e58758 - phase0 processJustificationAndFinalization 20.827 us/op 20.057 us/op 1.04
mainnet_e58758 - phase0 processRewardsAndPenalties 51.330 ms/op 63.551 ms/op 0.81
mainnet_e58758 - phase0 processRegistryUpdates 11.522 us/op 14.985 us/op 0.77
mainnet_e58758 - phase0 processSlashings 715.00 ns/op 1.1170 us/op 0.64
mainnet_e58758 - phase0 processEth1DataReset 785.00 ns/op 455.00 ns/op 1.73
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4800 ms/op 1.2157 ms/op 1.22
mainnet_e58758 - phase0 processSlashingsReset 3.0210 us/op 3.2290 us/op 0.94
mainnet_e58758 - phase0 processRandaoMixesReset 3.1870 us/op 5.1990 us/op 0.61
mainnet_e58758 - phase0 processHistoricalRootsUpdate 479.00 ns/op 475.00 ns/op 1.01
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.9140 us/op 12.744 us/op 0.31
mainnet_e58758 - phase0 afterProcessEpoch 66.105 ms/op 107.58 ms/op 0.61
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0426 ms/op 1.5921 ms/op 0.65
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1570 ms/op 1.5340 ms/op 0.75
altair processInactivityUpdates - 250000 normalcase 24.908 ms/op 25.137 ms/op 0.99
altair processInactivityUpdates - 250000 worstcase 22.392 ms/op 24.518 ms/op 0.91
phase0 processRegistryUpdates - 250000 normalcase 5.7590 us/op 14.164 us/op 0.41
phase0 processRegistryUpdates - 250000 badcase_full_deposits 423.58 us/op 403.33 us/op 1.05
phase0 processRegistryUpdates - 250000 worstcase 0.5 128.64 ms/op 154.05 ms/op 0.84
altair processRewardsAndPenalties - 250000 normalcase 61.239 ms/op 63.865 ms/op 0.96
altair processRewardsAndPenalties - 250000 worstcase 55.355 ms/op 61.609 ms/op 0.90
phase0 getAttestationDeltas - 250000 normalcase 5.0157 ms/op 12.050 ms/op 0.42
phase0 getAttestationDeltas - 250000 worstcase 5.0937 ms/op 13.109 ms/op 0.39
phase0 processSlashings - 250000 worstcase 81.282 us/op 130.59 us/op 0.62
altair processSyncCommitteeUpdates - 250000 102.42 ms/op 181.12 ms/op 0.57
BeaconState.hashTreeRoot - No change 310.00 ns/op 300.00 ns/op 1.03
BeaconState.hashTreeRoot - 1 full validator 127.68 us/op 161.70 us/op 0.79
BeaconState.hashTreeRoot - 32 full validator 1.7446 ms/op 1.6978 ms/op 1.03
BeaconState.hashTreeRoot - 512 full validator 14.858 ms/op 15.561 ms/op 0.95
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 168.81 us/op 177.36 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0937 ms/op 2.8349 ms/op 0.74
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 30.453 ms/op 33.988 ms/op 0.90
BeaconState.hashTreeRoot - 1 balances 145.10 us/op 156.09 us/op 0.93
BeaconState.hashTreeRoot - 32 balances 1.1225 ms/op 1.4767 ms/op 0.76
BeaconState.hashTreeRoot - 512 balances 12.704 ms/op 14.718 ms/op 0.86
BeaconState.hashTreeRoot - 250000 balances 200.32 ms/op 235.47 ms/op 0.85
aggregationBits - 2048 els - zipIndexesInBitList 10.131 us/op 31.765 us/op 0.32
byteArrayEquals 32 64.151 ns/op 80.944 ns/op 0.79
Buffer.compare 32 38.563 ns/op 58.475 ns/op 0.66
byteArrayEquals 1024 1.7427 us/op 2.1796 us/op 0.80
Buffer.compare 1024 46.348 ns/op 81.957 ns/op 0.57
byteArrayEquals 16384 28.325 us/op 35.250 us/op 0.80
Buffer.compare 16384 214.51 ns/op 296.20 ns/op 0.72
byteArrayEquals 123687377 207.52 ms/op 272.76 ms/op 0.76
Buffer.compare 123687377 3.7659 ms/op 11.968 ms/op 0.31
byteArrayEquals 32 - diff last byte 60.848 ns/op 91.374 ns/op 0.67
Buffer.compare 32 - diff last byte 38.070 ns/op 61.239 ns/op 0.62
byteArrayEquals 1024 - diff last byte 1.7251 us/op 2.1731 us/op 0.79
Buffer.compare 1024 - diff last byte 46.612 ns/op 82.834 ns/op 0.56
byteArrayEquals 16384 - diff last byte 27.573 us/op 33.839 us/op 0.81
Buffer.compare 16384 - diff last byte 213.33 ns/op 316.11 ns/op 0.67
byteArrayEquals 123687377 - diff last byte 196.67 ms/op 269.74 ms/op 0.73
Buffer.compare 123687377 - diff last byte 3.8225 ms/op 11.755 ms/op 0.33
byteArrayEquals 32 - random bytes 4.5060 ns/op 8.7450 ns/op 0.52
Buffer.compare 32 - random bytes 40.300 ns/op 70.871 ns/op 0.57
byteArrayEquals 1024 - random bytes 4.4020 ns/op 7.1690 ns/op 0.61
Buffer.compare 1024 - random bytes 38.100 ns/op 68.386 ns/op 0.56
byteArrayEquals 16384 - random bytes 4.4180 ns/op 7.3550 ns/op 0.60
Buffer.compare 16384 - random bytes 38.573 ns/op 67.346 ns/op 0.57
byteArrayEquals 123687377 - random bytes 7.7400 ns/op 22.840 ns/op 0.34
Buffer.compare 123687377 - random bytes 41.020 ns/op 81.400 ns/op 0.50
regular array get 100000 times 40.811 us/op 55.798 us/op 0.73
wrappedArray get 100000 times 40.888 us/op 47.781 us/op 0.86
arrayWithProxy get 100000 times 10.242 ms/op 15.966 ms/op 0.64
ssz.Root.equals 53.469 ns/op 57.645 ns/op 0.93
byteArrayEquals 52.282 ns/op 57.018 ns/op 0.92
Buffer.compare 9.0180 ns/op 13.342 ns/op 0.68
shuffle list - 16384 els 4.4016 ms/op 7.5900 ms/op 0.58
shuffle list - 250000 els 64.405 ms/op 117.16 ms/op 0.55
processSlot - 1 slots 18.128 us/op 20.849 us/op 0.87
processSlot - 32 slots 3.1780 ms/op 4.3583 ms/op 0.73
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 58.300 ms/op 81.681 ms/op 0.71
getCommitteeAssignments - req 1 vs - 250000 vc 2.0702 ms/op 3.0244 ms/op 0.68
getCommitteeAssignments - req 100 vs - 250000 vc 3.1610 ms/op 4.4168 ms/op 0.72
getCommitteeAssignments - req 1000 vs - 250000 vc 3.3716 ms/op 5.1320 ms/op 0.66
findModifiedValidators - 10000 modified validators 391.69 ms/op 801.55 ms/op 0.49
findModifiedValidators - 1000 modified validators 302.49 ms/op 624.77 ms/op 0.48
findModifiedValidators - 100 modified validators 300.27 ms/op 656.57 ms/op 0.46
findModifiedValidators - 10 modified validators 300.00 ms/op 602.26 ms/op 0.50
findModifiedValidators - 1 modified validators 273.23 ms/op 608.15 ms/op 0.45
findModifiedValidators - no difference 300.70 ms/op 550.35 ms/op 0.55
compare ViewDUs 3.9064 s/op 5.2614 s/op 0.74
compare each validator Uint8Array 1.5416 s/op 2.1780 s/op 0.71
compare ViewDU to Uint8Array 825.68 ms/op 1.4644 s/op 0.56
migrate state 1000000 validators, 24 modified, 0 new 740.45 ms/op 858.28 ms/op 0.86
migrate state 1000000 validators, 1700 modified, 1000 new 979.73 ms/op 1.4165 s/op 0.69
migrate state 1000000 validators, 3400 modified, 2000 new 1.1306 s/op 1.8393 s/op 0.61
migrate state 1500000 validators, 24 modified, 0 new 706.73 ms/op 1.3266 s/op 0.53
migrate state 1500000 validators, 1700 modified, 1000 new 1.0789 s/op 1.5583 s/op 0.69
migrate state 1500000 validators, 3400 modified, 2000 new 1.1529 s/op 1.7538 s/op 0.66
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3300 ns/op 6.2300 ns/op 0.70
state getBlockRootAtSlot - 250000 vs - 7PWei 987.28 ns/op 869.22 ns/op 1.14
computeProposers - vc 250000 7.2253 ms/op 11.451 ms/op 0.63
computeEpochShuffling - vc 250000 66.859 ms/op 122.61 ms/op 0.55
getNextSyncCommittee - vc 250000 120.28 ms/op 200.71 ms/op 0.60
computeSigningRoot for AttestationData 28.676 us/op 40.465 us/op 0.71
hash AttestationData serialized data then Buffer.toString(base64) 1.2378 us/op 2.7089 us/op 0.46
toHexString serialized data 758.90 ns/op 2.0970 us/op 0.36
Buffer.toString(base64) 144.10 ns/op 321.92 ns/op 0.45

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 5b38552 into unstable Dec 12, 2023
15 checks passed
@wemeetagain wemeetagain deleted the nflaig/fix-eventstream-authentication branch December 12, 2023 17:27
@wemeetagain
Copy link
Member

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

API base url parsing does not work for eventstream
4 participants