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: fix regression in getCurrentSlotAround #6407

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain requested a review from a team as a code owner February 7, 2024 15:54
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Merging #6407 (71d871a) into unstable (3bc9673) will not change coverage.
Report is 2 commits behind head on unstable.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6407   +/-   ##
=========================================
  Coverage     60.14%   60.14%           
=========================================
  Files           407      407           
  Lines         46512    46512           
  Branches       1551     1551           
=========================================
  Hits          27975    27975           
  Misses        18505    18505           
  Partials         32       32           

@@ -138,7 +138,7 @@ export class Clock implements IClock {
*/
export function getCurrentSlotAround(config: ChainForkConfig, genesisTime: TimeSeconds): Slot {
const diffInSeconds = Date.now() / 1000 - genesisTime;
const slotsSinceGenesis = Math.floor(diffInSeconds / config.SECONDS_PER_SLOT);
const slotsSinceGenesis = Math.round(diffInSeconds / config.SECONDS_PER_SLOT);
Copy link
Contributor

@nazarhussain nazarhussain Feb 7, 2024

Choose a reason for hiding this comment

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

The tests data we have for this function suggests that for 12s slot window clock at 12.5 would still be zero slot. To align implementation with the tests data we have to use Math.floor here. Or else if that's not the case then we should change the tests data else it will be fail.

{name: "should return next slot after 12.5s", delta: 12.5},

With changing back to round it will return nextSlot + 1 when the clock current time is around the slot boundary.

See this output
https://github.com/ChainSafe/lodestar/actions/runs/7652507863/job/20852823580#step:6:714

Copy link
Member

@nflaig nflaig Feb 7, 2024

Choose a reason for hiding this comment

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

But we are not applying Math.round on the delta, it is applied on the slots since genensis which is based on diff in seconds since genesis.

The goal of getCurrentSlotAround is clearly that it returns the closest slot, see PR that introduced this #2736.

Running those tests locally a few times I can see that those fail sometimes with Math.round and also with Math.floor

yarn vitest --run test/unit/utils/clock.test.ts -t getCurrentSlot
 FAIL  test/unit/utils/clock.test.ts > util / Clock > getCurrentSlot > 'should return next slot after 12.5s'
AssertionError: expected 8155649 to be 8155648 // Object.is equality

- Expected
+ Received

- 8155648
+ 8155649

When I use Math.floor the 12.5s test fails sometimes, and with Math.round the 11.5s test fails.

This is clearly an issue with the tests, and those need to be made more robust. A bit strange is that it only happens with vitest, with mocha those consistenly seem to pass. Weird timing issue I suppose.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes the answer is to fix the test cases, not force the implementation to change for the buggy tests.
Merging this for now to fix the noticeable validator performance regression.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes test cases don't enforce implementation, but fixture data particularly guide what kind of behavior we expect form the implementation.

Copy link
Contributor

github-actions bot commented Feb 7, 2024

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 7089b1e Previous: 924a6cd Ratio
forkChoice updateHead vc 600000 bc 64 eq 300000 143.22 ms/op 22.802 ms/op 6.28
Full benchmark results
Benchmark suite Current: 7089b1e Previous: 924a6cd Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 582.33 us/op 1.0561 ms/op 0.55
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 109.47 us/op 119.51 us/op 0.92
BLS verify - blst-native 1.4097 ms/op 1.5051 ms/op 0.94
BLS verifyMultipleSignatures 3 - blst-native 2.9527 ms/op 3.0608 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 6.4505 ms/op 6.6460 ms/op 0.97
BLS verifyMultipleSignatures 32 - blst-native 24.536 ms/op 23.009 ms/op 1.07
BLS verifyMultipleSignatures 64 - blst-native 48.187 ms/op 47.567 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst-native 93.226 ms/op 96.452 ms/op 0.97
BLS deserializing 10000 signatures 1.0019 s/op 1.0419 s/op 0.96
BLS deserializing 100000 signatures 10.119 s/op 9.9360 s/op 1.02
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.6787 ms/op 1.5632 ms/op 1.07
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.8413 ms/op 1.6853 ms/op 1.09
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.7791 ms/op 2.6342 ms/op 1.06
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.2497 ms/op 3.9887 ms/op 1.07
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.0455 ms/op 6.3216 ms/op 1.11
BLS aggregatePubkeys 32 - blst-native 32.407 us/op 28.569 us/op 1.13
BLS aggregatePubkeys 128 - blst-native 123.62 us/op 110.18 us/op 1.12
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 88.533 ms/op 67.128 ms/op 1.32
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 49.345 ms/op 67.396 ms/op 0.73
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 43.815 ms/op 54.548 ms/op 0.80
getSlashingsAndExits - default max 184.47 us/op 223.21 us/op 0.83
getSlashingsAndExits - 2k 414.93 us/op 521.16 us/op 0.80
proposeBlockBody type=full, size=empty 6.3217 ms/op 6.1408 ms/op 1.03
isKnown best case - 1 super set check 382.00 ns/op 511.00 ns/op 0.75
isKnown normal case - 2 super set checks 421.00 ns/op 460.00 ns/op 0.92
isKnown worse case - 16 super set checks 379.00 ns/op 458.00 ns/op 0.83
CheckpointStateCache - add get delete 6.3090 us/op 5.3500 us/op 1.18
validate api signedAggregateAndProof - struct 3.2793 ms/op 2.9224 ms/op 1.12
validate gossip signedAggregateAndProof - struct 2.9852 ms/op 2.9145 ms/op 1.02
validate gossip attestation - vc 640000 1.4484 ms/op 1.4249 ms/op 1.02
batch validate gossip attestation - vc 640000 - chunk 32 183.48 us/op 169.33 us/op 1.08
batch validate gossip attestation - vc 640000 - chunk 64 164.48 us/op 151.30 us/op 1.09
batch validate gossip attestation - vc 640000 - chunk 128 172.03 us/op 145.91 us/op 1.18
batch validate gossip attestation - vc 640000 - chunk 256 202.40 us/op 138.73 us/op 1.46
pickEth1Vote - no votes 1.5106 ms/op 1.3532 ms/op 1.12
pickEth1Vote - max votes 9.3835 ms/op 12.012 ms/op 0.78
pickEth1Vote - Eth1Data hashTreeRoot value x2048 18.179 ms/op 24.869 ms/op 0.73
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 33.413 ms/op 36.386 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 815.23 us/op 678.03 us/op 1.20
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.2936 ms/op 9.3568 ms/op 0.57
bytes32 toHexString 655.00 ns/op 660.00 ns/op 0.99
bytes32 Buffer.toString(hex) 343.00 ns/op 305.00 ns/op 1.12
bytes32 Buffer.toString(hex) from Uint8Array 490.00 ns/op 467.00 ns/op 1.05
bytes32 Buffer.toString(hex) + 0x 330.00 ns/op 295.00 ns/op 1.12
Object access 1 prop 0.19000 ns/op 0.22700 ns/op 0.84
Map access 1 prop 0.16400 ns/op 0.16000 ns/op 1.02
Object get x1000 7.9610 ns/op 8.1490 ns/op 0.98
Map get x1000 0.85000 ns/op 0.90800 ns/op 0.94
Object set x1000 61.449 ns/op 62.612 ns/op 0.98
Map set x1000 44.568 ns/op 47.612 ns/op 0.94
Return object 10000 times 0.26770 ns/op 0.26200 ns/op 1.02
Throw Error 10000 times 4.3025 us/op 4.1042 us/op 1.05
fastMsgIdFn sha256 / 200 bytes 3.6650 us/op 3.5630 us/op 1.03
fastMsgIdFn h32 xxhash / 200 bytes 350.00 ns/op 377.00 ns/op 0.93
fastMsgIdFn h64 xxhash / 200 bytes 402.00 ns/op 416.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 12.873 us/op 12.659 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 535.00 ns/op 499.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 1000 bytes 484.00 ns/op 478.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 114.56 us/op 106.03 us/op 1.08
fastMsgIdFn h32 xxhash / 10000 bytes 2.1690 us/op 2.0360 us/op 1.07
fastMsgIdFn h64 xxhash / 10000 bytes 1.5270 us/op 1.3940 us/op 1.10
send data - 1000 256B messages 26.063 ms/op 19.858 ms/op 1.31
send data - 1000 512B messages 29.088 ms/op 33.241 ms/op 0.88
send data - 1000 1024B messages 42.848 ms/op 41.310 ms/op 1.04
send data - 1000 1200B messages 49.085 ms/op 44.892 ms/op 1.09
send data - 1000 2048B messages 59.253 ms/op 59.781 ms/op 0.99
send data - 1000 4096B messages 59.204 ms/op 47.524 ms/op 1.25
send data - 1000 16384B messages 153.51 ms/op 124.05 ms/op 1.24
send data - 1000 65536B messages 527.84 ms/op 496.35 ms/op 1.06
enrSubnets - fastDeserialize 64 bits 1.8460 us/op 1.6440 us/op 1.12
enrSubnets - ssz BitVector 64 bits 618.00 ns/op 581.00 ns/op 1.06
enrSubnets - fastDeserialize 4 bits 259.00 ns/op 247.00 ns/op 1.05
enrSubnets - ssz BitVector 4 bits 602.00 ns/op 615.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 138.73 us/op 132.35 us/op 1.05
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 181.59 us/op 160.49 us/op 1.13
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 237.79 us/op 219.28 us/op 1.08
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 391.99 us/op 361.95 us/op 1.08
prioritizePeers score 0:0 att 64-1 sync 4-1 429.94 us/op 410.19 us/op 1.05
array of 16000 items push then shift 2.0224 us/op 1.9194 us/op 1.05
LinkedList of 16000 items push then shift 11.180 ns/op 12.416 ns/op 0.90
array of 16000 items push then pop 132.11 ns/op 122.29 ns/op 1.08
LinkedList of 16000 items push then pop 10.961 ns/op 10.310 ns/op 1.06
array of 24000 items push then shift 2.9176 us/op 2.8315 us/op 1.03
LinkedList of 24000 items push then shift 11.472 ns/op 10.434 ns/op 1.10
array of 24000 items push then pop 175.16 ns/op 162.56 ns/op 1.08
LinkedList of 24000 items push then pop 10.566 ns/op 9.6530 ns/op 1.09
intersect bitArray bitLen 8 6.7710 ns/op 6.5800 ns/op 1.03
intersect array and set length 8 94.227 ns/op 99.676 ns/op 0.95
intersect bitArray bitLen 128 40.311 ns/op 38.425 ns/op 1.05
intersect array and set length 128 1.2531 us/op 1.1619 us/op 1.08
bitArray.getTrueBitIndexes() bitLen 128 1.9800 us/op 1.9110 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 248 3.5050 us/op 3.3800 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 512 7.7070 us/op 7.1240 us/op 1.08
Buffer.concat 32 items 1.2550 us/op 1.2080 us/op 1.04
Uint8Array.set 32 items 2.4200 us/op 2.4470 us/op 0.99
Set add up to 64 items then delete first 5.9668 us/op 5.7937 us/op 1.03
OrderedSet add up to 64 items then delete first 8.2587 us/op 7.5433 us/op 1.09
Set add up to 64 items then delete last 6.9060 us/op 6.0847 us/op 1.13
OrderedSet add up to 64 items then delete last 8.8351 us/op 7.6647 us/op 1.15
Set add up to 64 items then delete middle 6.9916 us/op 5.9335 us/op 1.18
OrderedSet add up to 64 items then delete middle 10.390 us/op 9.7153 us/op 1.07
Set add up to 128 items then delete first 13.735 us/op 12.007 us/op 1.14
OrderedSet add up to 128 items then delete first 18.532 us/op 16.341 us/op 1.13
Set add up to 128 items then delete last 13.434 us/op 12.206 us/op 1.10
OrderedSet add up to 128 items then delete last 15.816 us/op 15.134 us/op 1.05
Set add up to 128 items then delete middle 12.646 us/op 11.636 us/op 1.09
OrderedSet add up to 128 items then delete middle 24.311 us/op 23.476 us/op 1.04
Set add up to 256 items then delete first 24.560 us/op 22.840 us/op 1.08
OrderedSet add up to 256 items then delete first 33.386 us/op 33.166 us/op 1.01
Set add up to 256 items then delete last 23.670 us/op 22.775 us/op 1.04
OrderedSet add up to 256 items then delete last 32.606 us/op 31.298 us/op 1.04
Set add up to 256 items then delete middle 26.063 us/op 23.525 us/op 1.11
OrderedSet add up to 256 items then delete middle 61.144 us/op 56.687 us/op 1.08
transfer serialized Status (84 B) 2.3330 us/op 2.3710 us/op 0.98
copy serialized Status (84 B) 1.7640 us/op 1.6550 us/op 1.07
transfer serialized SignedVoluntaryExit (112 B) 2.4060 us/op 2.3310 us/op 1.03
copy serialized SignedVoluntaryExit (112 B) 1.7790 us/op 1.6910 us/op 1.05
transfer serialized ProposerSlashing (416 B) 2.9050 us/op 3.4020 us/op 0.85
copy serialized ProposerSlashing (416 B) 2.5290 us/op 2.4560 us/op 1.03
transfer serialized Attestation (485 B) 3.0120 us/op 2.6030 us/op 1.16
copy serialized Attestation (485 B) 3.2310 us/op 2.4150 us/op 1.34
transfer serialized AttesterSlashing (33232 B) 3.7150 us/op 2.7860 us/op 1.33
copy serialized AttesterSlashing (33232 B) 10.689 us/op 11.032 us/op 0.97
transfer serialized Small SignedBeaconBlock (128000 B) 2.9070 us/op 3.7670 us/op 0.77
copy serialized Small SignedBeaconBlock (128000 B) 28.496 us/op 29.032 us/op 0.98
transfer serialized Avg SignedBeaconBlock (200000 B) 3.6380 us/op 3.9100 us/op 0.93
copy serialized Avg SignedBeaconBlock (200000 B) 38.474 us/op 38.755 us/op 0.99
transfer serialized BlobsSidecar (524380 B) 3.5500 us/op 4.8740 us/op 0.73
copy serialized BlobsSidecar (524380 B) 112.09 us/op 96.474 us/op 1.16
transfer serialized Big SignedBeaconBlock (1000000 B) 3.8400 us/op 4.2620 us/op 0.90
copy serialized Big SignedBeaconBlock (1000000 B) 203.84 us/op 245.27 us/op 0.83
pass gossip attestations to forkchoice per slot 5.2054 ms/op 5.0099 ms/op 1.04
forkChoice updateHead vc 100000 bc 64 eq 0 889.41 us/op 762.03 us/op 1.17
forkChoice updateHead vc 600000 bc 64 eq 0 7.4107 ms/op 5.4033 ms/op 1.37
forkChoice updateHead vc 1000000 bc 64 eq 0 9.6183 ms/op 8.1219 ms/op 1.18
forkChoice updateHead vc 600000 bc 320 eq 0 7.3547 ms/op 4.7327 ms/op 1.55
forkChoice updateHead vc 600000 bc 1200 eq 0 8.7675 ms/op 4.6589 ms/op 1.88
forkChoice updateHead vc 600000 bc 7200 eq 0 14.675 ms/op 5.8638 ms/op 2.50
forkChoice updateHead vc 600000 bc 64 eq 1000 17.371 ms/op 12.268 ms/op 1.42
forkChoice updateHead vc 600000 bc 64 eq 10000 21.537 ms/op 13.695 ms/op 1.57
forkChoice updateHead vc 600000 bc 64 eq 300000 143.22 ms/op 22.802 ms/op 6.28
computeDeltas 500000 validators 300 proto nodes 8.7299 ms/op 7.2450 ms/op 1.20
computeDeltas 500000 validators 1200 proto nodes 8.1804 ms/op 7.7762 ms/op 1.05
computeDeltas 500000 validators 7200 proto nodes 7.7511 ms/op 7.5032 ms/op 1.03
computeDeltas 750000 validators 300 proto nodes 12.065 ms/op 10.704 ms/op 1.13
computeDeltas 750000 validators 1200 proto nodes 12.167 ms/op 10.821 ms/op 1.12
computeDeltas 750000 validators 7200 proto nodes 11.642 ms/op 10.548 ms/op 1.10
computeDeltas 1400000 validators 300 proto nodes 23.653 ms/op 20.007 ms/op 1.18
computeDeltas 1400000 validators 1200 proto nodes 26.147 ms/op 19.933 ms/op 1.31
computeDeltas 1400000 validators 7200 proto nodes 22.717 ms/op 20.193 ms/op 1.12
computeDeltas 2100000 validators 300 proto nodes 33.828 ms/op 30.937 ms/op 1.09
computeDeltas 2100000 validators 1200 proto nodes 32.471 ms/op 30.968 ms/op 1.05
computeDeltas 2100000 validators 7200 proto nodes 34.558 ms/op 32.563 ms/op 1.06
altair processAttestation - 250000 vs - 7PWei normalcase 3.2055 ms/op 3.0781 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei worstcase 4.3559 ms/op 4.5518 ms/op 0.96
altair processAttestation - setStatus - 1/6 committees join 229.15 us/op 172.12 us/op 1.33
altair processAttestation - setStatus - 1/3 committees join 466.78 us/op 353.34 us/op 1.32
altair processAttestation - setStatus - 1/2 committees join 595.54 us/op 441.97 us/op 1.35
altair processAttestation - setStatus - 2/3 committees join 791.29 us/op 612.03 us/op 1.29
altair processAttestation - setStatus - 4/5 committees join 1.0286 ms/op 828.42 us/op 1.24
altair processAttestation - setStatus - 100% committees join 1.2233 ms/op 983.54 us/op 1.24
altair processBlock - 250000 vs - 7PWei normalcase 12.762 ms/op 11.683 ms/op 1.09
altair processBlock - 250000 vs - 7PWei normalcase hashState 45.281 ms/op 37.317 ms/op 1.21
altair processBlock - 250000 vs - 7PWei worstcase 54.835 ms/op 44.043 ms/op 1.25
altair processBlock - 250000 vs - 7PWei worstcase hashState 127.74 ms/op 95.336 ms/op 1.34
phase0 processBlock - 250000 vs - 7PWei normalcase 3.7048 ms/op 3.8117 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei worstcase 39.764 ms/op 34.123 ms/op 1.17
altair processEth1Data - 250000 vs - 7PWei normalcase 876.86 us/op 638.55 us/op 1.37
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 13.313 us/op 21.774 us/op 0.61
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 48.572 us/op 75.742 us/op 0.64
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 39.250 us/op 31.197 us/op 1.26
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 23.097 us/op 18.798 us/op 1.23
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 274.27 us/op 202.73 us/op 1.35
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.8071 ms/op 1.6498 ms/op 1.10
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 3.0438 ms/op 1.9926 ms/op 1.53
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.9751 ms/op 2.1286 ms/op 1.40
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 6.9312 ms/op 6.9860 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 5.3754 ms/op 3.4571 ms/op 1.55
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 15.051 ms/op 9.2926 ms/op 1.62
Tree 40 250000 create 1.1119 s/op 856.32 ms/op 1.30
Tree 40 250000 get(125000) 528.87 ns/op 249.14 ns/op 2.12
Tree 40 250000 set(125000) 3.9959 us/op 2.8326 us/op 1.41
Tree 40 250000 toArray() 38.473 ms/op 30.746 ms/op 1.25
Tree 40 250000 iterate all - toArray() + loop 35.698 ms/op 30.182 ms/op 1.18
Tree 40 250000 iterate all - get(i) 117.22 ms/op 93.935 ms/op 1.25
MutableVector 250000 create 27.219 ms/op 21.620 ms/op 1.26
MutableVector 250000 get(125000) 10.084 ns/op 7.8000 ns/op 1.29
MutableVector 250000 set(125000) 825.86 ns/op 833.50 ns/op 0.99
MutableVector 250000 toArray() 6.7194 ms/op 4.8090 ms/op 1.40
MutableVector 250000 iterate all - toArray() + loop 7.2295 ms/op 5.0408 ms/op 1.43
MutableVector 250000 iterate all - get(i) 2.4014 ms/op 1.9393 ms/op 1.24
Array 250000 create 6.7117 ms/op 4.7638 ms/op 1.41
Array 250000 clone - spread 7.3054 ms/op 6.8544 ms/op 1.07
Array 250000 get(125000) 4.6150 ns/op 3.1840 ns/op 1.45
Array 250000 set(125000) 8.8510 ns/op 6.2370 ns/op 1.42
Array 250000 iterate all - loop 312.14 us/op 194.32 us/op 1.61
effectiveBalanceIncrements clone Uint8Array 300000 85.495 us/op 67.847 us/op 1.26
effectiveBalanceIncrements clone MutableVector 300000 1.8140 us/op 565.00 ns/op 3.21
effectiveBalanceIncrements rw all Uint8Array 300000 361.24 us/op 274.99 us/op 1.31
effectiveBalanceIncrements rw all MutableVector 300000 273.83 ms/op 216.47 ms/op 1.26
phase0 afterProcessEpoch - 250000 vs - 7PWei 203.55 ms/op 147.93 ms/op 1.38
phase0 beforeProcessEpoch - 250000 vs - 7PWei 97.633 ms/op 65.079 ms/op 1.50
altair processEpoch - mainnet_e81889 942.86 ms/op 792.59 ms/op 1.19
mainnet_e81889 - altair beforeProcessEpoch 187.89 ms/op 133.45 ms/op 1.41
mainnet_e81889 - altair processJustificationAndFinalization 50.084 us/op 28.119 us/op 1.78
mainnet_e81889 - altair processInactivityUpdates 16.896 ms/op 9.4133 ms/op 1.79
mainnet_e81889 - altair processRewardsAndPenalties 123.92 ms/op 83.327 ms/op 1.49
mainnet_e81889 - altair processRegistryUpdates 8.7640 us/op 4.9880 us/op 1.76
mainnet_e81889 - altair processSlashings 1.6850 us/op 888.00 ns/op 1.90
mainnet_e81889 - altair processEth1DataReset 2.4460 us/op 1.1460 us/op 2.13
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.7604 ms/op 1.6654 ms/op 2.26
mainnet_e81889 - altair processSlashingsReset 12.064 us/op 6.4590 us/op 1.87
mainnet_e81889 - altair processRandaoMixesReset 14.143 us/op 7.5810 us/op 1.87
mainnet_e81889 - altair processHistoricalRootsUpdate 2.3090 us/op 1.0410 us/op 2.22
mainnet_e81889 - altair processParticipationFlagUpdates 5.8200 us/op 4.0500 us/op 1.44
mainnet_e81889 - altair processSyncCommitteeUpdates 2.3100 us/op 1.0290 us/op 2.24
mainnet_e81889 - altair afterProcessEpoch 204.27 ms/op 129.20 ms/op 1.58
capella processEpoch - mainnet_e217614 3.5572 s/op 3.5124 s/op 1.01
mainnet_e217614 - capella beforeProcessEpoch 811.53 ms/op 606.77 ms/op 1.34
mainnet_e217614 - capella processJustificationAndFinalization 44.177 us/op 27.583 us/op 1.60
mainnet_e217614 - capella processInactivityUpdates 43.081 ms/op 28.746 ms/op 1.50
mainnet_e217614 - capella processRewardsAndPenalties 626.42 ms/op 427.22 ms/op 1.47
mainnet_e217614 - capella processRegistryUpdates 63.961 us/op 28.607 us/op 2.24
mainnet_e217614 - capella processSlashings 2.1480 us/op 719.00 ns/op 2.99
mainnet_e217614 - capella processEth1DataReset 1.6000 us/op 1.0910 us/op 1.47
mainnet_e217614 - capella processEffectiveBalanceUpdates 8.9519 ms/op 5.7623 ms/op 1.55
mainnet_e217614 - capella processSlashingsReset 14.418 us/op 5.4010 us/op 2.67
mainnet_e217614 - capella processRandaoMixesReset 16.200 us/op 6.9840 us/op 2.32
mainnet_e217614 - capella processHistoricalRootsUpdate 2.4080 us/op 768.00 ns/op 3.14
mainnet_e217614 - capella processParticipationFlagUpdates 6.3810 us/op 2.4710 us/op 2.58
mainnet_e217614 - capella afterProcessEpoch 604.96 ms/op 354.69 ms/op 1.71
phase0 processEpoch - mainnet_e58758 916.15 ms/op 567.49 ms/op 1.61
mainnet_e58758 - phase0 beforeProcessEpoch 327.47 ms/op 165.63 ms/op 1.98
mainnet_e58758 - phase0 processJustificationAndFinalization 42.698 us/op 28.675 us/op 1.49
mainnet_e58758 - phase0 processRewardsAndPenalties 68.876 ms/op 62.730 ms/op 1.10
mainnet_e58758 - phase0 processRegistryUpdates 32.821 us/op 19.163 us/op 1.71
mainnet_e58758 - phase0 processSlashings 1.8420 us/op 1.2010 us/op 1.53
mainnet_e58758 - phase0 processEth1DataReset 1.6330 us/op 1.0180 us/op 1.60
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.5008 ms/op 1.3459 ms/op 1.86
mainnet_e58758 - phase0 processSlashingsReset 9.9380 us/op 4.1350 us/op 2.40
mainnet_e58758 - phase0 processRandaoMixesReset 15.113 us/op 5.3230 us/op 2.84
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.9820 us/op 682.00 ns/op 2.91
mainnet_e58758 - phase0 processParticipationRecordUpdates 14.233 us/op 5.8440 us/op 2.44
mainnet_e58758 - phase0 afterProcessEpoch 172.74 ms/op 98.969 ms/op 1.75
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.8960 ms/op 1.6443 ms/op 1.76
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.9775 ms/op 1.8130 ms/op 1.64
altair processInactivityUpdates - 250000 normalcase 52.876 ms/op 32.125 ms/op 1.65
altair processInactivityUpdates - 250000 worstcase 66.843 ms/op 26.658 ms/op 2.51
phase0 processRegistryUpdates - 250000 normalcase 27.368 us/op 13.815 us/op 1.98
phase0 processRegistryUpdates - 250000 badcase_full_deposits 944.96 us/op 494.94 us/op 1.91
phase0 processRegistryUpdates - 250000 worstcase 0.5 320.80 ms/op 164.15 ms/op 1.95
altair processRewardsAndPenalties - 250000 normalcase 101.04 ms/op 60.100 ms/op 1.68
altair processRewardsAndPenalties - 250000 worstcase 104.22 ms/op 62.648 ms/op 1.66
phase0 getAttestationDeltas - 250000 normalcase 19.570 ms/op 11.430 ms/op 1.71
phase0 getAttestationDeltas - 250000 worstcase 18.217 ms/op 10.442 ms/op 1.74
phase0 processSlashings - 250000 worstcase 164.70 us/op 93.131 us/op 1.77
altair processSyncCommitteeUpdates - 250000 310.26 ms/op 188.27 ms/op 1.65
BeaconState.hashTreeRoot - No change 1.3570 us/op 486.00 ns/op 2.79
BeaconState.hashTreeRoot - 1 full validator 306.67 us/op 141.50 us/op 2.17
BeaconState.hashTreeRoot - 32 full validator 3.6210 ms/op 1.4815 ms/op 2.44
BeaconState.hashTreeRoot - 512 full validator 37.759 ms/op 16.320 ms/op 2.31
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 272.12 us/op 151.97 us/op 1.79
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 5.2878 ms/op 2.0998 ms/op 2.52
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 55.049 ms/op 28.746 ms/op 1.92
BeaconState.hashTreeRoot - 1 balances 227.90 us/op 123.85 us/op 1.84
BeaconState.hashTreeRoot - 32 balances 1.9677 ms/op 1.2798 ms/op 1.54
BeaconState.hashTreeRoot - 512 balances 19.618 ms/op 10.762 ms/op 1.82
BeaconState.hashTreeRoot - 250000 balances 470.75 ms/op 185.47 ms/op 2.54
aggregationBits - 2048 els - zipIndexesInBitList 51.320 us/op 18.569 us/op 2.76
byteArrayEquals 32 171.84 ns/op 77.618 ns/op 2.21
Buffer.compare 32 101.12 ns/op 58.297 ns/op 1.73
byteArrayEquals 1024 4.9186 us/op 2.2232 us/op 2.21
Buffer.compare 1024 130.43 ns/op 77.252 ns/op 1.69
byteArrayEquals 16384 79.208 us/op 35.768 us/op 2.21
Buffer.compare 16384 380.23 ns/op 294.80 ns/op 1.29
byteArrayEquals 123687377 399.68 ms/op 274.16 ms/op 1.46
Buffer.compare 123687377 13.082 ms/op 17.182 ms/op 0.76
byteArrayEquals 32 - diff last byte 125.77 ns/op 127.26 ns/op 0.99
Buffer.compare 32 - diff last byte 91.645 ns/op 97.372 ns/op 0.94
byteArrayEquals 1024 - diff last byte 3.2895 us/op 3.9637 us/op 0.83
Buffer.compare 1024 - diff last byte 116.80 ns/op 115.46 ns/op 1.01
byteArrayEquals 16384 - diff last byte 56.460 us/op 43.206 us/op 1.31
Buffer.compare 16384 - diff last byte 417.20 ns/op 346.03 ns/op 1.21
byteArrayEquals 123687377 - diff last byte 356.28 ms/op 423.81 ms/op 0.84
Buffer.compare 123687377 - diff last byte 11.721 ms/op 10.932 ms/op 1.07
byteArrayEquals 32 - random bytes 8.8420 ns/op 7.7970 ns/op 1.13
Buffer.compare 32 - random bytes 80.481 ns/op 69.408 ns/op 1.16
byteArrayEquals 1024 - random bytes 7.7410 ns/op 7.0120 ns/op 1.10
Buffer.compare 1024 - random bytes 80.162 ns/op 68.336 ns/op 1.17
byteArrayEquals 16384 - random bytes 8.0360 ns/op 7.0080 ns/op 1.15
Buffer.compare 16384 - random bytes 91.789 ns/op 68.296 ns/op 1.34
byteArrayEquals 123687377 - random bytes 22.090 ns/op 10.840 ns/op 2.04
Buffer.compare 123687377 - random bytes 110.43 ns/op 84.380 ns/op 1.31
regular array get 100000 times 61.618 us/op 52.717 us/op 1.17
wrappedArray get 100000 times 58.036 us/op 50.510 us/op 1.15
arrayWithProxy get 100000 times 19.179 ms/op 15.737 ms/op 1.22
ssz.Root.equals 94.112 ns/op 61.057 ns/op 1.54
byteArrayEquals 88.203 ns/op 62.330 ns/op 1.42
Buffer.compare 17.819 ns/op 13.846 ns/op 1.29
shuffle list - 16384 els 11.352 ms/op 7.7352 ms/op 1.47
shuffle list - 250000 els 179.62 ms/op 113.16 ms/op 1.59
processSlot - 1 slots 30.605 us/op 23.281 us/op 1.31
processSlot - 32 slots 4.9238 ms/op 4.1000 ms/op 1.20
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 88.766 ms/op 78.990 ms/op 1.12
getCommitteeAssignments - req 1 vs - 250000 vc 4.6079 ms/op 3.0126 ms/op 1.53
getCommitteeAssignments - req 100 vs - 250000 vc 5.4994 ms/op 4.4387 ms/op 1.24
getCommitteeAssignments - req 1000 vs - 250000 vc 6.6871 ms/op 4.6567 ms/op 1.44
findModifiedValidators - 10000 modified validators 926.28 ms/op 758.25 ms/op 1.22
findModifiedValidators - 1000 modified validators 740.88 ms/op 583.87 ms/op 1.27
findModifiedValidators - 100 modified validators 760.20 ms/op 750.03 ms/op 1.01
findModifiedValidators - 10 modified validators 678.94 ms/op 711.97 ms/op 0.95
findModifiedValidators - 1 modified validators 693.60 ms/op 540.64 ms/op 1.28
findModifiedValidators - no difference 650.13 ms/op 526.27 ms/op 1.24
compare ViewDUs 6.2239 s/op 5.8941 s/op 1.06
compare each validator Uint8Array 2.3024 s/op 1.9937 s/op 1.15
compare ViewDU to Uint8Array 1.7065 s/op 1.5753 s/op 1.08
migrate state 1000000 validators, 24 modified, 0 new 1.1892 s/op 925.22 ms/op 1.29
migrate state 1000000 validators, 1700 modified, 1000 new 1.6040 s/op 1.2126 s/op 1.32
migrate state 1000000 validators, 3400 modified, 2000 new 1.4734 s/op 1.4592 s/op 1.01
migrate state 1500000 validators, 24 modified, 0 new 796.98 ms/op 973.72 ms/op 0.82
migrate state 1500000 validators, 1700 modified, 1000 new 1.2414 s/op 1.3729 s/op 0.90
migrate state 1500000 validators, 3400 modified, 2000 new 1.5746 s/op 1.6323 s/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.2700 ns/op 6.0700 ns/op 1.03
state getBlockRootAtSlot - 250000 vs - 7PWei 800.12 ns/op 1.3090 us/op 0.61
computeProposers - vc 250000 10.924 ms/op 19.719 ms/op 0.55
computeEpochShuffling - vc 250000 123.38 ms/op 134.16 ms/op 0.92
getNextSyncCommittee - vc 250000 204.46 ms/op 245.12 ms/op 0.83
computeSigningRoot for AttestationData 32.638 us/op 35.032 us/op 0.93
hash AttestationData serialized data then Buffer.toString(base64) 2.4815 us/op 2.7263 us/op 0.91
toHexString serialized data 1.3022 us/op 1.5316 us/op 0.85
Buffer.toString(base64) 282.33 ns/op 296.43 ns/op 0.95

by benchmarkbot/action

@wemeetagain wemeetagain merged commit d1caa1f into unstable Feb 7, 2024
11 of 15 checks passed
@wemeetagain wemeetagain deleted the cayman/fix-regression branch February 7, 2024 19:13
@wemeetagain
Copy link
Member Author

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

3 participants