Skip to content

feat: add cached PTCs to the state [wip]#9047

Draft
nflaig wants to merge 6 commits intounstablefrom
nflaig/cached-ptcs
Draft

feat: add cached PTCs to the state [wip]#9047
nflaig wants to merge 6 commits intounstablefrom
nflaig/cached-ptcs

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Mar 16, 2026

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request optimizes the handling of Payload Timeliness Committees (PTCs) for the Gloas fork by implementing a direct caching mechanism within the BeaconState. This change aims to enhance performance and simplify the access patterns for PTCs by storing currentPtc and previousPtc directly in the state, rather than relying solely on EpochCache. The state transition logic has been updated to manage the rotation of these cached committees, ensuring their availability and correctness throughout slot processing.

Highlights

  • Payload Timeliness Committee (PTC) Caching: Introduced direct caching of currentPtc and previousPtc within the BeaconState for the Gloas fork, moving away from EpochCache for immediate access.
  • Refactored PTC Logic: Moved PTC computation and retrieval functions from EpochCache into dedicated utility functions (packages/state-transition/src/util/gloas.ts and packages/state-transition/src/util/seed.ts) to centralize and streamline their usage.
  • State Transition Integration: Updated the state transition and upgrade processes to correctly initialize and rotate the cached PTCs at each slot and epoch boundary for the Gloas fork.
  • Specification Alignment: Modified specrefs to reflect the new caching mechanism, function locations, and updated specifications for get_ptc, compute_ptc, and get_indexed_payload_attestation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/beacon-node/src/chain/validation/payloadAttestationMessage.ts
    • Imported getPayloadTimelinessCommittee from @lodestar/state-transition.
    • Updated validatePayloadAttestationMessage to use the new getPayloadTimelinessCommittee utility function.
  • packages/state-transition/src/block/processPayloadAttestation.ts
    • Imported getIndexedPayloadAttestation from ../util/gloas.js.
    • Updated processPayloadAttestation to use the new getIndexedPayloadAttestation utility function.
  • packages/state-transition/src/cache/epochCache.ts
    • Removed the gloas import.
    • Removed previousPayloadTimelinessCommittees property and its associated logic.
    • Simplified the getPayloadTimelinessCommittee method to only return the current epoch's PTC.
    • Removed the getIndexedPayloadAttestation method.
  • packages/state-transition/src/slot/upgradeStateToGloas.ts
    • Imported initializePayloadTimelinessCommittee from ../util/gloas.js.
    • Called initializePayloadTimelinessCommittee during the upgradeStateToGloas function.
  • packages/state-transition/src/stateTransition.ts
    • Imported ForkSeq, CachedBeaconStateGloas, and rotatePayloadTimelinessCommittees.
    • Added calls to rotatePayloadTimelinessCommittees within processSlotsWithTransientCache for Gloas fork slot and epoch transitions.
  • packages/state-transition/src/stateView/beaconStateView.ts
    • Updated the JSDoc comment for validatorPTCCommitteeIndex.
  • packages/state-transition/src/util/genesis.ts
    • Imported CachedBeaconStateGloas and initializePayloadTimelinessCommittee.
    • Called initializePayloadTimelinessCommittee when initializing the BeaconState from Eth1 for the Gloas fork.
  • packages/state-transition/src/util/gloas.ts
    • Imported Slot, ssz, and computePayloadTimelinessCommitteeAtSlot.
    • Added computePayloadTimelinessCommittee to calculate the PTC for the current slot.
    • Added initializePayloadTimelinessCommittee to set the initial currentPtc in the state.
    • Added rotatePayloadTimelinessCommittees to shift currentPtc to previousPtc and compute the new currentPtc.
    • Added getPayloadTimelinessCommittee to retrieve the cached PTC for the current or previous slot.
    • Added getIndexedPayloadAttestation to compute indexed payload attestations using the new getPayloadTimelinessCommittee.
  • packages/state-transition/src/util/seed.ts
    • Imported Slot.
    • Added computePayloadTimelinessCommitteeAtSlot function for single slot PTC computation.
  • packages/state-transition/test/unit/upgradeState.test.ts
    • Added new imports for Gloas types, state transition, and utility functions.
    • Added test cases for upgradeStateToGloas and processSlots related to PTC rotation.
    • Added helper functions getInitializedGloasState, generateFuluState, generateGloasState, and seedPayloadTimelinessInputs for testing.
  • packages/types/package.json
    • Added an export mapping for the new ./gloas path.
  • packages/types/src/gloas/sszTypes.ts
    • Imported VectorBasicType.
    • Defined PayloadTimelinessCommittee as a VectorBasicType of ValidatorIndex.
    • Added previousPtc and currentPtc fields to the BeaconState SSZ container.
  • packages/types/src/gloas/types.ts
    • Exported the new PayloadTimelinessCommittee type.
  • specrefs/.ethspecify.yml
    • Added compute_ptc#gloas to the list of exceptions.
    • Removed get_ptc_assignment#gloas from the list of exceptions.
  • specrefs/functions.yml
    • Updated the sources and spec for get_indexed_payload_attestation#gloas.
    • Updated the sources and spec for get_ptc#gloas.
    • Added a new entry for compute_ptc#gloas.
    • Removed the get_ptc_assignment#gloas entry.
Activity
  • No specific activity (comments, reviews, progress) was provided in the context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

/** TODO: Indexed SyncCommitteeCache */
nextSyncCommitteeIndexed: SyncCommitteeCache;

// TODO GLOAS: See if we need to cache PTC for next epoch
Copy link
Member Author

Choose a reason for hiding this comment

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

removed since PTC assignments are not stable for the next epoch, see ethereum/beacon-APIs#586


// TODO GLOAS: See if we need to cache PTC for next epoch
// PTC for previous epoch, required for slot N block validating slot N-1 attestations
previousPayloadTimelinessCommittees: Uint32Array[];
Copy link
Member Author

Choose a reason for hiding this comment

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

we now longer need to cache this since we only need to access the last slot of previous epoch which is now cached in the state via state.previous_ptc

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces cached Payload Timeliness Committees (PTCs) to the state, enhancing the efficiency of payload attestation validation. It involves modifications across several files, including adding a new function for computing PTCs, initializing and rotating PTCs within the state, and updating relevant data structures and processes. The changes aim to optimize performance by caching PTC data for faster access during validation.

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f43dd27 Previous: 6a85a50 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.1637 ms/op 1.0089 ms/op 1.15
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.960 us/op 35.866 us/op 1.25
BLS verify - blst 1.0907 ms/op 1.4399 ms/op 0.76
BLS verifyMultipleSignatures 3 - blst 1.7517 ms/op 2.2313 ms/op 0.79
BLS verifyMultipleSignatures 8 - blst 2.1884 ms/op 2.2803 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst 5.8271 ms/op 7.4538 ms/op 0.78
BLS verifyMultipleSignatures 64 - blst 11.251 ms/op 11.272 ms/op 1.00
BLS verifyMultipleSignatures 128 - blst 20.185 ms/op 17.211 ms/op 1.17
BLS deserializing 10000 signatures 746.53 ms/op 684.59 ms/op 1.09
BLS deserializing 100000 signatures 7.6243 s/op 6.8307 s/op 1.12
BLS verifyMultipleSignatures - same message - 3 - blst 980.40 us/op 1.3711 ms/op 0.72
BLS verifyMultipleSignatures - same message - 8 - blst 1.2715 ms/op 1.0552 ms/op 1.20
BLS verifyMultipleSignatures - same message - 32 - blst 1.9644 ms/op 1.8220 ms/op 1.08
BLS verifyMultipleSignatures - same message - 64 - blst 3.2317 ms/op 2.5287 ms/op 1.28
BLS verifyMultipleSignatures - same message - 128 - blst 4.8578 ms/op 4.3366 ms/op 1.12
BLS aggregatePubkeys 32 - blst 20.672 us/op 18.835 us/op 1.10
BLS aggregatePubkeys 128 - blst 73.514 us/op 67.566 us/op 1.09
getSlashingsAndExits - default max 92.511 us/op 71.606 us/op 1.29
getSlashingsAndExits - 2k 500.09 us/op 334.58 us/op 1.49
isKnown best case - 1 super set check 212.00 ns/op 194.00 ns/op 1.09
isKnown normal case - 2 super set checks 211.00 ns/op 192.00 ns/op 1.10
isKnown worse case - 16 super set checks 210.00 ns/op 185.00 ns/op 1.14
validate api signedAggregateAndProof - struct 1.5032 ms/op 1.5248 ms/op 0.99
validate gossip signedAggregateAndProof - struct 1.4845 ms/op 2.5873 ms/op 0.57
batch validate gossip attestation - vc 640000 - chunk 32 137.40 us/op 117.67 us/op 1.17
batch validate gossip attestation - vc 640000 - chunk 64 123.77 us/op 103.11 us/op 1.20
batch validate gossip attestation - vc 640000 - chunk 128 113.89 us/op 96.505 us/op 1.18
batch validate gossip attestation - vc 640000 - chunk 256 120.03 us/op 91.229 us/op 1.32
bytes32 toHexString 433.00 ns/op 340.00 ns/op 1.27
bytes32 Buffer.toString(hex) 265.00 ns/op 246.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 351.00 ns/op 331.00 ns/op 1.06
bytes32 Buffer.toString(hex) + 0x 265.00 ns/op 246.00 ns/op 1.08
Return object 10000 times 0.24930 ns/op 0.22530 ns/op 1.11
Throw Error 10000 times 4.4435 us/op 4.1243 us/op 1.08
toHex 142.79 ns/op 133.63 ns/op 1.07
Buffer.from 138.70 ns/op 116.44 ns/op 1.19
shared Buffer 84.116 ns/op 72.984 ns/op 1.15
fastMsgIdFn sha256 / 200 bytes 1.9980 us/op 1.8550 us/op 1.08
fastMsgIdFn h32 xxhash / 200 bytes 267.00 ns/op 222.00 ns/op 1.20
fastMsgIdFn h64 xxhash / 200 bytes 278.00 ns/op 266.00 ns/op 1.05
fastMsgIdFn sha256 / 1000 bytes 6.9670 us/op 5.9160 us/op 1.18
fastMsgIdFn h32 xxhash / 1000 bytes 305.00 ns/op 280.00 ns/op 1.09
fastMsgIdFn h64 xxhash / 1000 bytes 334.00 ns/op 464.00 ns/op 0.72
fastMsgIdFn sha256 / 10000 bytes 56.815 us/op 51.164 us/op 1.11
fastMsgIdFn h32 xxhash / 10000 bytes 1.5040 us/op 1.3310 us/op 1.13
fastMsgIdFn h64 xxhash / 10000 bytes 982.00 ns/op 959.00 ns/op 1.02
send data - 1000 256B messages 6.7882 ms/op 4.4874 ms/op 1.51
send data - 1000 512B messages 6.2037 ms/op 5.2799 ms/op 1.17
send data - 1000 1024B messages 7.1619 ms/op 5.6792 ms/op 1.26
send data - 1000 1200B messages 6.6281 ms/op 5.8510 ms/op 1.13
send data - 1000 2048B messages 7.7168 ms/op 6.1998 ms/op 1.24
send data - 1000 4096B messages 8.7290 ms/op 6.2668 ms/op 1.39
send data - 1000 16384B messages 20.020 ms/op 55.772 ms/op 0.36
send data - 1000 65536B messages 102.15 ms/op 104.91 ms/op 0.97
enrSubnets - fastDeserialize 64 bits 994.00 ns/op 875.00 ns/op 1.14
enrSubnets - ssz BitVector 64 bits 358.00 ns/op 327.00 ns/op 1.09
enrSubnets - fastDeserialize 4 bits 143.00 ns/op 124.00 ns/op 1.15
enrSubnets - ssz BitVector 4 bits 356.00 ns/op 320.00 ns/op 1.11
prioritizePeers score -10:0 att 32-0.1 sync 2-0 267.71 us/op 220.23 us/op 1.22
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 324.53 us/op 358.36 us/op 0.91
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 445.69 us/op 659.74 us/op 0.68
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 787.28 us/op 690.42 us/op 1.14
prioritizePeers score 0:0 att 64-1 sync 4-1 943.56 us/op 1.0729 ms/op 0.88
array of 16000 items push then shift 1.7492 us/op 1.5240 us/op 1.15
LinkedList of 16000 items push then shift 9.0810 ns/op 6.9850 ns/op 1.30
array of 16000 items push then pop 92.766 ns/op 72.810 ns/op 1.27
LinkedList of 16000 items push then pop 8.7540 ns/op 6.7910 ns/op 1.29
array of 24000 items push then shift 2.6506 us/op 2.2461 us/op 1.18
LinkedList of 24000 items push then shift 9.7520 ns/op 7.0840 ns/op 1.38
array of 24000 items push then pop 124.15 ns/op 99.945 ns/op 1.24
LinkedList of 24000 items push then pop 8.6080 ns/op 6.8060 ns/op 1.26
intersect bitArray bitLen 8 6.4330 ns/op 5.3800 ns/op 1.20
intersect array and set length 8 37.817 ns/op 31.752 ns/op 1.19
intersect bitArray bitLen 128 31.576 ns/op 26.969 ns/op 1.17
intersect array and set length 128 611.22 ns/op 519.86 ns/op 1.18
bitArray.getTrueBitIndexes() bitLen 128 1.3350 us/op 1.0040 us/op 1.33
bitArray.getTrueBitIndexes() bitLen 248 2.1510 us/op 1.7680 us/op 1.22
bitArray.getTrueBitIndexes() bitLen 512 4.3480 us/op 3.6690 us/op 1.19
Full columns - reconstruct all 6 blobs 297.56 us/op 343.69 us/op 0.87
Full columns - reconstruct half of the blobs out of 6 161.03 us/op 138.30 us/op 1.16
Full columns - reconstruct single blob out of 6 51.349 us/op 37.440 us/op 1.37
Half columns - reconstruct all 6 blobs 300.97 ms/op 259.54 ms/op 1.16
Half columns - reconstruct half of the blobs out of 6 151.71 ms/op 129.78 ms/op 1.17
Half columns - reconstruct single blob out of 6 59.057 ms/op 47.720 ms/op 1.24
Full columns - reconstruct all 10 blobs 338.00 us/op 613.64 us/op 0.55
Full columns - reconstruct half of the blobs out of 10 233.68 us/op 177.69 us/op 1.32
Full columns - reconstruct single blob out of 10 45.382 us/op 29.543 us/op 1.54
Half columns - reconstruct all 10 blobs 508.98 ms/op 426.86 ms/op 1.19
Half columns - reconstruct half of the blobs out of 10 254.50 ms/op 218.44 ms/op 1.17
Half columns - reconstruct single blob out of 10 56.790 ms/op 47.145 ms/op 1.20
Full columns - reconstruct all 20 blobs 712.84 us/op 852.57 us/op 0.84
Full columns - reconstruct half of the blobs out of 20 389.60 us/op 370.59 us/op 1.05
Full columns - reconstruct single blob out of 20 40.161 us/op 30.759 us/op 1.31
Half columns - reconstruct all 20 blobs 1.0035 s/op 854.75 ms/op 1.17
Half columns - reconstruct half of the blobs out of 20 502.83 ms/op 430.68 ms/op 1.17
Half columns - reconstruct single blob out of 20 55.976 ms/op 48.444 ms/op 1.16
Set add up to 64 items then delete first 2.5461 us/op 2.0171 us/op 1.26
OrderedSet add up to 64 items then delete first 3.8160 us/op 2.9643 us/op 1.29
Set add up to 64 items then delete last 3.1169 us/op 2.3024 us/op 1.35
OrderedSet add up to 64 items then delete last 4.6460 us/op 3.4315 us/op 1.35
Set add up to 64 items then delete middle 3.1412 us/op 2.3075 us/op 1.36
OrderedSet add up to 64 items then delete middle 6.7496 us/op 4.9414 us/op 1.37
Set add up to 128 items then delete first 5.7070 us/op 4.7153 us/op 1.21
OrderedSet add up to 128 items then delete first 9.1955 us/op 6.7488 us/op 1.36
Set add up to 128 items then delete last 6.2135 us/op 4.6410 us/op 1.34
OrderedSet add up to 128 items then delete last 9.7513 us/op 6.7891 us/op 1.44
Set add up to 128 items then delete middle 6.1923 us/op 4.4832 us/op 1.38
OrderedSet add up to 128 items then delete middle 17.180 us/op 13.118 us/op 1.31
Set add up to 256 items then delete first 12.534 us/op 9.7547 us/op 1.28
OrderedSet add up to 256 items then delete first 17.726 us/op 14.009 us/op 1.27
Set add up to 256 items then delete last 17.795 us/op 9.2936 us/op 1.91
OrderedSet add up to 256 items then delete last 20.094 us/op 13.975 us/op 1.44
Set add up to 256 items then delete middle 12.750 us/op 9.0717 us/op 1.41
OrderedSet add up to 256 items then delete middle 48.680 us/op 39.605 us/op 1.23
pass gossip attestations to forkchoice per slot 539.16 us/op 474.36 us/op 1.14
computeDeltas 1400000 validators 0% inactive 14.739 ms/op 13.997 ms/op 1.05
computeDeltas 1400000 validators 10% inactive 13.648 ms/op 13.272 ms/op 1.03
computeDeltas 1400000 validators 20% inactive 12.661 ms/op 12.077 ms/op 1.05
computeDeltas 1400000 validators 50% inactive 9.8297 ms/op 9.3741 ms/op 1.05
computeDeltas 2100000 validators 0% inactive 22.235 ms/op 20.887 ms/op 1.06
computeDeltas 2100000 validators 10% inactive 20.870 ms/op 21.842 ms/op 0.96
computeDeltas 2100000 validators 20% inactive 19.903 ms/op 18.237 ms/op 1.09
computeDeltas 2100000 validators 50% inactive 15.191 ms/op 14.079 ms/op 1.08
altair processAttestation - setStatus - 1/6 committees join 572.00 ns/op 546.00 ns/op 1.05
altair processAttestation - setStatus - 1/3 committees join 917.00 ns/op 888.00 ns/op 1.03
altair processAttestation - setStatus - 1/2 committees join 1.3150 us/op 1.2580 us/op 1.05
altair processAttestation - setStatus - 2/3 committees join 1.5340 us/op 1.5190 us/op 1.01
altair processAttestation - setStatus - 4/5 committees join 1.7220 us/op 1.7460 us/op 0.99
altair processAttestation - setStatus - 100% committees join 2.0480 us/op 2.0670 us/op 0.99
phase0 processBlock - 250000 vs - 7PWei normalcase 1.6113 ms/op 1.8830 ms/op 0.86
phase0 processBlock - 250000 vs - 7PWei worstcase 19.496 ms/op 26.831 ms/op 0.73
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 6.1220 us/op 5.7160 us/op 1.07
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 39.545 us/op 54.112 us/op 0.73
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 15.268 us/op 16.256 us/op 0.94
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 7.5430 us/op 10.578 us/op 0.71
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 159.63 us/op 128.87 us/op 1.24
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.8405 ms/op 1.6863 ms/op 1.09
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3492 ms/op 2.1113 ms/op 1.11
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.3664 ms/op 2.0185 ms/op 1.17
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.6006 ms/op 4.3398 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.7221 ms/op 2.4151 ms/op 1.13
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9117 ms/op 4.7468 ms/op 1.03
Tree 40 250000 create 380.78 ms/op 368.77 ms/op 1.03
Tree 40 250000 get(125000) 132.26 ns/op 125.38 ns/op 1.05
Tree 40 250000 set(125000) 1.2208 us/op 1.1914 us/op 1.02
Tree 40 250000 toArray() 17.498 ms/op 15.296 ms/op 1.14
Tree 40 250000 iterate all - toArray() + loop 17.019 ms/op 13.378 ms/op 1.27
Tree 40 250000 iterate all - get(i) 44.810 ms/op 44.457 ms/op 1.01
Array 250000 create 2.6330 ms/op 2.4064 ms/op 1.09
Array 250000 clone - spread 811.96 us/op 793.39 us/op 1.02
Array 250000 get(125000) 0.34500 ns/op 0.34800 ns/op 0.99
Array 250000 set(125000) 0.34800 ns/op 0.49800 ns/op 0.70
Array 250000 iterate all - loop 61.760 us/op 60.057 us/op 1.03
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.823 ms/op 40.862 ms/op 1.02
Array.fill - length 1000000 2.8932 ms/op 2.9796 ms/op 0.97
Array push - length 1000000 9.6151 ms/op 10.566 ms/op 0.91
Array.get 0.21731 ns/op 0.21429 ns/op 1.01
Uint8Array.get 0.22220 ns/op 0.21976 ns/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 15.243 ms/op 13.963 ms/op 1.09
altair processEpoch - mainnet_e81889 274.53 ms/op 328.52 ms/op 0.84
mainnet_e81889 - altair beforeProcessEpoch 22.616 ms/op 21.623 ms/op 1.05
mainnet_e81889 - altair processJustificationAndFinalization 7.2790 us/op 9.2050 us/op 0.79
mainnet_e81889 - altair processInactivityUpdates 3.9381 ms/op 3.8275 ms/op 1.03
mainnet_e81889 - altair processRewardsAndPenalties 22.341 ms/op 20.258 ms/op 1.10
mainnet_e81889 - altair processRegistryUpdates 644.00 ns/op 620.00 ns/op 1.04
mainnet_e81889 - altair processSlashings 168.00 ns/op 161.00 ns/op 1.04
mainnet_e81889 - altair processEth1DataReset 158.00 ns/op 172.00 ns/op 0.92
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.8377 ms/op 1.6314 ms/op 1.74
mainnet_e81889 - altair processSlashingsReset 866.00 ns/op 1.0200 us/op 0.85
mainnet_e81889 - altair processRandaoMixesReset 1.5280 us/op 1.5270 us/op 1.00
mainnet_e81889 - altair processHistoricalRootsUpdate 164.00 ns/op 291.00 ns/op 0.56
mainnet_e81889 - altair processParticipationFlagUpdates 513.00 ns/op 490.00 ns/op 1.05
mainnet_e81889 - altair processSyncCommitteeUpdates 133.00 ns/op 133.00 ns/op 1.00
mainnet_e81889 - altair afterProcessEpoch 45.457 ms/op 41.996 ms/op 1.08
capella processEpoch - mainnet_e217614 845.33 ms/op 847.26 ms/op 1.00
mainnet_e217614 - capella beforeProcessEpoch 65.290 ms/op 55.610 ms/op 1.17
mainnet_e217614 - capella processJustificationAndFinalization 5.6070 us/op 5.7660 us/op 0.97
mainnet_e217614 - capella processInactivityUpdates 16.927 ms/op 14.771 ms/op 1.15
mainnet_e217614 - capella processRewardsAndPenalties 103.65 ms/op 103.86 ms/op 1.00
mainnet_e217614 - capella processRegistryUpdates 5.9210 us/op 5.6480 us/op 1.05
mainnet_e217614 - capella processSlashings 163.00 ns/op 274.00 ns/op 0.59
mainnet_e217614 - capella processEth1DataReset 158.00 ns/op 164.00 ns/op 0.96
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.963 ms/op 12.158 ms/op 1.15
mainnet_e217614 - capella processSlashingsReset 848.00 ns/op 810.00 ns/op 1.05
mainnet_e217614 - capella processRandaoMixesReset 1.1110 us/op 1.0540 us/op 1.05
mainnet_e217614 - capella processHistoricalRootsUpdate 158.00 ns/op 207.00 ns/op 0.76
mainnet_e217614 - capella processParticipationFlagUpdates 500.00 ns/op 513.00 ns/op 0.97
mainnet_e217614 - capella afterProcessEpoch 115.35 ms/op 112.26 ms/op 1.03
phase0 processEpoch - mainnet_e58758 245.86 ms/op 250.38 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 49.873 ms/op 53.952 ms/op 0.92
mainnet_e58758 - phase0 processJustificationAndFinalization 5.8830 us/op 5.3310 us/op 1.10
mainnet_e58758 - phase0 processRewardsAndPenalties 18.126 ms/op 18.351 ms/op 0.99
mainnet_e58758 - phase0 processRegistryUpdates 2.7660 us/op 2.7530 us/op 1.00
mainnet_e58758 - phase0 processSlashings 164.00 ns/op 214.00 ns/op 0.77
mainnet_e58758 - phase0 processEth1DataReset 195.00 ns/op 241.00 ns/op 0.81
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0866 ms/op 1.0527 ms/op 1.03
mainnet_e58758 - phase0 processSlashingsReset 789.00 ns/op 773.00 ns/op 1.02
mainnet_e58758 - phase0 processRandaoMixesReset 1.0960 us/op 1.0690 us/op 1.03
mainnet_e58758 - phase0 processHistoricalRootsUpdate 165.00 ns/op 167.00 ns/op 0.99
mainnet_e58758 - phase0 processParticipationRecordUpdates 836.00 ns/op 1.2670 us/op 0.66
mainnet_e58758 - phase0 afterProcessEpoch 35.155 ms/op 34.570 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6822 ms/op 2.3103 ms/op 0.73
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9649 ms/op 1.9241 ms/op 1.02
altair processInactivityUpdates - 250000 normalcase 54.838 us/op 106.20 us/op 0.52
altair processInactivityUpdates - 250000 worstcase 59.965 us/op 87.850 us/op 0.68
phase0 processRegistryUpdates - 250000 normalcase 7.9520 us/op 10.684 us/op 0.74
phase0 processRegistryUpdates - 250000 badcase_full_deposits 229.75 us/op 358.60 us/op 0.64
phase0 processRegistryUpdates - 250000 worstcase 0.5 70.051 ms/op 75.939 ms/op 0.92
altair processRewardsAndPenalties - 250000 normalcase 88.771 us/op 96.551 us/op 0.92
altair processRewardsAndPenalties - 250000 worstcase 97.096 us/op 74.216 us/op 1.31
phase0 getAttestationDeltas - 250000 normalcase 6.7816 ms/op 5.5633 ms/op 1.22
phase0 getAttestationDeltas - 250000 worstcase 5.8636 ms/op 5.6766 ms/op 1.03
phase0 processSlashings - 250000 worstcase 84.733 us/op 120.09 us/op 0.71
altair processSyncCommitteeUpdates - 250000 8.1123 ms/op 8.4070 ms/op 0.96
BeaconState.hashTreeRoot - No change 187.00 ns/op 274.00 ns/op 0.68
BeaconState.hashTreeRoot - 1 full validator 88.303 us/op 89.258 us/op 0.99
BeaconState.hashTreeRoot - 32 full validator 966.48 us/op 1.0138 ms/op 0.95
BeaconState.hashTreeRoot - 512 full validator 7.7790 ms/op 8.4144 ms/op 0.92
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 113.80 us/op 112.30 us/op 1.01
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6583 ms/op 1.4488 ms/op 1.14
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.325 ms/op 18.257 ms/op 1.00
BeaconState.hashTreeRoot - 1 balances 82.111 us/op 86.540 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 975.03 us/op 953.98 us/op 1.02
BeaconState.hashTreeRoot - 512 balances 5.8188 ms/op 7.5942 ms/op 0.77
BeaconState.hashTreeRoot - 250000 balances 151.66 ms/op 169.00 ms/op 0.90
aggregationBits - 2048 els - zipIndexesInBitList 21.006 us/op 20.329 us/op 1.03
regular array get 100000 times 24.792 us/op 24.213 us/op 1.02
wrappedArray get 100000 times 24.744 us/op 24.216 us/op 1.02
arrayWithProxy get 100000 times 14.511 ms/op 14.669 ms/op 0.99
ssz.Root.equals 23.345 ns/op 23.340 ns/op 1.00
byteArrayEquals 23.017 ns/op 22.913 ns/op 1.00
Buffer.compare 9.9110 ns/op 9.7440 ns/op 1.02
processSlot - 1 slots 10.855 us/op 9.5160 us/op 1.14
processSlot - 32 slots 2.5728 ms/op 2.1629 ms/op 1.19
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 5.1188 ms/op 4.4047 ms/op 1.16
getCommitteeAssignments - req 1 vs - 250000 vc 1.9391 ms/op 1.8544 ms/op 1.05
getCommitteeAssignments - req 100 vs - 250000 vc 3.9145 ms/op 3.5878 ms/op 1.09
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2801 ms/op 3.8244 ms/op 1.12
findModifiedValidators - 10000 modified validators 534.36 ms/op 467.51 ms/op 1.14
findModifiedValidators - 1000 modified validators 534.07 ms/op 419.49 ms/op 1.27
findModifiedValidators - 100 modified validators 366.28 ms/op 269.90 ms/op 1.36
findModifiedValidators - 10 modified validators 312.31 ms/op 159.31 ms/op 1.96
findModifiedValidators - 1 modified validators 178.80 ms/op 148.29 ms/op 1.21
findModifiedValidators - no difference 222.37 ms/op 158.69 ms/op 1.40
migrate state 1500000 validators, 3400 modified, 2000 new 408.30 ms/op 359.17 ms/op 1.14
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6500 ns/op 4.0000 ns/op 1.16
state getBlockRootAtSlot - 250000 vs - 7PWei 531.06 ns/op 560.09 ns/op 0.95
computeProposerIndex 100000 validators 1.6233 ms/op 1.5078 ms/op 1.08
getNextSyncCommitteeIndices 1000 validators 3.5262 ms/op 3.3404 ms/op 1.06
getNextSyncCommitteeIndices 10000 validators 3.5368 ms/op 3.3126 ms/op 1.07
getNextSyncCommitteeIndices 100000 validators 3.5525 ms/op 3.3094 ms/op 1.07
computeProposers - vc 250000 655.33 us/op 604.29 us/op 1.08
computeEpochShuffling - vc 250000 44.844 ms/op 40.927 ms/op 1.10
getNextSyncCommittee - vc 250000 12.679 ms/op 10.443 ms/op 1.21
nodejs block root to RootHex using toHex 146.64 ns/op 136.85 ns/op 1.07
nodejs block root to RootHex using toRootHex 90.259 ns/op 81.716 ns/op 1.10
nodejs fromHex(blob) 391.83 us/op 281.23 us/op 1.39
nodejs fromHexInto(blob) 730.60 us/op 678.07 us/op 1.08
nodejs block root to RootHex using the deprecated toHexString 629.35 ns/op 565.02 ns/op 1.11
nodejs byteArrayEquals 32 bytes (block root) 29.268 ns/op 28.086 ns/op 1.04
nodejs byteArrayEquals 48 bytes (pubkey) 43.351 ns/op 40.120 ns/op 1.08
nodejs byteArrayEquals 96 bytes (signature) 41.531 ns/op 39.510 ns/op 1.05
nodejs byteArrayEquals 1024 bytes 47.213 ns/op 45.071 ns/op 1.05
nodejs byteArrayEquals 131072 bytes (blob) 1.9453 us/op 1.8558 us/op 1.05
browser block root to RootHex using toHex 302.69 ns/op 160.45 ns/op 1.89
browser block root to RootHex using toRootHex 159.75 ns/op 151.12 ns/op 1.06
browser fromHex(blob) 1.0050 ms/op 952.94 us/op 1.05
browser fromHexInto(blob) 708.23 us/op 694.69 us/op 1.02
browser block root to RootHex using the deprecated toHexString 600.79 ns/op 418.03 ns/op 1.44
browser byteArrayEquals 32 bytes (block root) 31.630 ns/op 30.847 ns/op 1.03
browser byteArrayEquals 48 bytes (pubkey) 43.888 ns/op 43.040 ns/op 1.02
browser byteArrayEquals 96 bytes (signature) 85.330 ns/op 83.949 ns/op 1.02
browser byteArrayEquals 1024 bytes 806.29 ns/op 791.15 ns/op 1.02
browser byteArrayEquals 131072 bytes (blob) 103.36 us/op 100.33 us/op 1.03

by benchmarkbot/action

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.

1 participant