Skip to content

refactor: clone state in processExecutionPayloadEnvelope#9015

Merged
ensi321 merged 2 commits intounstablefrom
nc/epbs-stf-clone-state
Mar 11, 2026
Merged

refactor: clone state in processExecutionPayloadEnvelope#9015
ensi321 merged 2 commits intounstablefrom
nc/epbs-stf-clone-state

Conversation

@ensi321
Copy link
Contributor

@ensi321 ensi321 commented Mar 10, 2026

Summary

  • Refactor processExecutionPayloadEnvelope to clone the beacon state before mutating it and return the post-state, matching the pattern used by stateTransition()
  • Add dontTransferCache option to control SSZ cache transfer behavior during clone
  • Update computeEnvelopeStateRoot and spec test runner to use the returned post-state

Test plan

  • pnpm build passes
  • pnpm check-types passes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ensi321 ensi321 requested a review from a team as a code owner March 10, 2026 06:57
@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 refactors the processExecutionPayloadEnvelope function to adopt an immutable state processing pattern. Instead of modifying the input state in place, the function now clones the state, applies all necessary changes to the cloned version, and returns the resulting post-state. This change enhances predictability and consistency across state transition functions, making state management more robust and easier to reason about.

Highlights

  • State Immutability Refactor: The processExecutionPayloadEnvelope function was refactored to clone the input beacon state before mutating it, returning the modified post-state. This aligns its behavior with stateTransition() for consistency.
  • Cache Transfer Control: A new dontTransferCache option was added to control the SSZ cache transfer behavior during state cloning, providing more granular control over state management.
  • Integration Updates: The computeEnvelopeStateRoot function and the spec test runner were updated to correctly utilize the new post-state returned by the refactored processExecutionPayloadEnvelope.

🧠 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/produceBlock/computeNewStateRoot.ts
    • Removed a comment indicating in-place state mutation.
    • Updated computeEnvelopeStateRoot to call processExecutionPayloadEnvelope with a new dontTransferCache: true option.
    • Modified computeEnvelopeStateRoot to use the postEnvelopeState returned by processExecutionPayloadEnvelope for hashTreeRoot().
  • packages/beacon-node/test/spec/presets/operations.test.ts
    • Modified the processExecutionPayloadEnvelope call within operationFns.execution_payload_envelope to return the result.
    • Updated the BlockProcessFn type definition to allow returning T | void.
    • Adjusted the operations test runner to handle the returned postState from operationFn.
  • packages/state-transition/src/block/processExecutionPayloadEnvelope.ts
    • Added ProcessExecutionPayloadEnvelopeOpts type with a dontTransferCache option.
    • Changed the signature of processExecutionPayloadEnvelope to accept an opts parameter and return CachedBeaconStateGloas.
    • Implemented state cloning at the beginning of processExecutionPayloadEnvelope using state.clone(opts?.dontTransferCache).
    • Updated all subsequent state mutations within the function to operate on the cloned postState.
    • Added postState.commit() before returning.
    • Modified the state root verification check to use postState.hashTreeRoot().
    • Returned the postState at the end of the function.
Activity
  • The author, ensi321, created this pull request to refactor state handling for improved immutability.
  • The PR description includes a test plan confirming that pnpm build and pnpm check-types pass.
  • The pull request was generated with Claude Code.
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.

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 refactors processExecutionPayloadEnvelope to clone the beacon state before mutation and return the new state, improving consistency with other state transition functions. A security audit found no vulnerabilities, and the refactor enhances state transition robustness. A minor suggestion was made in a test file to remove a redundant call, but overall, the changes are solid.

Comment on lines +146 to +147
postState.commit();
return postState;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The processExecutionPayloadEnvelope function, which is the operationFn in this case, now internally commits the state before returning it. Therefore, this call to postState.commit() is redundant and can be removed.

Suggested change
postState.commit();
return postState;
return postState;

Copy link
Member

Choose a reason for hiding this comment

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

@ensi321 is the double commit intentional?

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a34168b Previous: b847afb Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.1531 ms/op 1.1209 ms/op 1.03
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.712 us/op 38.428 us/op 1.03
BLS verify - blst 874.66 us/op 859.25 us/op 1.02
BLS verifyMultipleSignatures 3 - blst 1.2572 ms/op 1.2484 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst 1.6924 ms/op 1.6773 ms/op 1.01
BLS verifyMultipleSignatures 32 - blst 5.0408 ms/op 4.9893 ms/op 1.01
BLS verifyMultipleSignatures 64 - blst 9.4356 ms/op 9.1650 ms/op 1.03
BLS verifyMultipleSignatures 128 - blst 18.256 ms/op 17.732 ms/op 1.03
BLS deserializing 10000 signatures 704.97 ms/op 703.31 ms/op 1.00
BLS deserializing 100000 signatures 7.0980 s/op 7.0707 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 1.1313 ms/op 916.56 us/op 1.23
BLS verifyMultipleSignatures - same message - 8 - blst 1.1604 ms/op 1.0529 ms/op 1.10
BLS verifyMultipleSignatures - same message - 32 - blst 1.9923 ms/op 1.7299 ms/op 1.15
BLS verifyMultipleSignatures - same message - 64 - blst 3.1299 ms/op 2.6447 ms/op 1.18
BLS verifyMultipleSignatures - same message - 128 - blst 4.5976 ms/op 4.4548 ms/op 1.03
BLS aggregatePubkeys 32 - blst 19.697 us/op 19.738 us/op 1.00
BLS aggregatePubkeys 128 - blst 70.570 us/op 70.533 us/op 1.00
getSlashingsAndExits - default max 68.808 us/op 69.038 us/op 1.00
getSlashingsAndExits - 2k 324.22 us/op 336.47 us/op 0.96
isKnown best case - 1 super set check 225.00 ns/op 215.00 ns/op 1.05
isKnown normal case - 2 super set checks 219.00 ns/op 203.00 ns/op 1.08
isKnown worse case - 16 super set checks 220.00 ns/op 204.00 ns/op 1.08
validate api signedAggregateAndProof - struct 1.4066 ms/op 1.4109 ms/op 1.00
validate gossip signedAggregateAndProof - struct 1.4019 ms/op 1.6685 ms/op 0.84
batch validate gossip attestation - vc 640000 - chunk 32 119.44 us/op 124.38 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 64 104.80 us/op 110.62 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 128 100.67 us/op 106.74 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 256 141.08 us/op 101.88 us/op 1.38
bytes32 toHexString 360.00 ns/op 365.00 ns/op 0.99
bytes32 Buffer.toString(hex) 250.00 ns/op 231.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 341.00 ns/op 317.00 ns/op 1.08
bytes32 Buffer.toString(hex) + 0x 251.00 ns/op 240.00 ns/op 1.05
Return object 10000 times 0.23350 ns/op 0.23850 ns/op 0.98
Throw Error 10000 times 4.2124 us/op 4.4809 us/op 0.94
toHex 129.84 ns/op 149.14 ns/op 0.87
Buffer.from 124.48 ns/op 141.08 ns/op 0.88
shared Buffer 75.620 ns/op 77.240 ns/op 0.98
fastMsgIdFn sha256 / 200 bytes 1.8650 us/op 1.8970 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 199.00 ns/op 200.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 275.00 ns/op 259.00 ns/op 1.06
fastMsgIdFn sha256 / 1000 bytes 5.9750 us/op 7.3920 us/op 0.81
fastMsgIdFn h32 xxhash / 1000 bytes 296.00 ns/op 295.00 ns/op 1.00
fastMsgIdFn h64 xxhash / 1000 bytes 325.00 ns/op 313.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 53.416 us/op 55.998 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.3870 us/op 1.4180 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 915.00 ns/op 927.00 ns/op 0.99
send data - 1000 256B messages 5.0900 ms/op 5.2030 ms/op 0.98
send data - 1000 512B messages 4.5177 ms/op 4.8301 ms/op 0.94
send data - 1000 1024B messages 5.4901 ms/op 4.7750 ms/op 1.15
send data - 1000 1200B messages 5.4565 ms/op 5.0567 ms/op 1.08
send data - 1000 2048B messages 5.2721 ms/op 5.7498 ms/op 0.92
send data - 1000 4096B messages 6.9826 ms/op 6.8675 ms/op 1.02
send data - 1000 16384B messages 38.972 ms/op 41.508 ms/op 0.94
send data - 1000 65536B messages 94.407 ms/op 92.303 ms/op 1.02
enrSubnets - fastDeserialize 64 bits 896.00 ns/op 900.00 ns/op 1.00
enrSubnets - ssz BitVector 64 bits 345.00 ns/op 340.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 131.00 ns/op 133.00 ns/op 0.98
enrSubnets - ssz BitVector 4 bits 345.00 ns/op 335.00 ns/op 1.03
prioritizePeers score -10:0 att 32-0.1 sync 2-0 235.92 us/op 242.10 us/op 0.97
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 263.05 us/op 270.25 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 378.35 us/op 394.01 us/op 0.96
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 704.09 us/op 768.52 us/op 0.92
prioritizePeers score 0:0 att 64-1 sync 4-1 849.81 us/op 910.19 us/op 0.93
array of 16000 items push then shift 1.6526 us/op 1.6772 us/op 0.99
LinkedList of 16000 items push then shift 8.3130 ns/op 7.9350 ns/op 1.05
array of 16000 items push then pop 79.016 ns/op 81.402 ns/op 0.97
LinkedList of 16000 items push then pop 7.3510 ns/op 7.4830 ns/op 0.98
array of 24000 items push then shift 2.4376 us/op 2.4432 us/op 1.00
LinkedList of 24000 items push then shift 8.0440 ns/op 7.9060 ns/op 1.02
array of 24000 items push then pop 107.54 ns/op 109.68 ns/op 0.98
LinkedList of 24000 items push then pop 7.3660 ns/op 7.3670 ns/op 1.00
intersect bitArray bitLen 8 5.8090 ns/op 5.8220 ns/op 1.00
intersect array and set length 8 34.021 ns/op 34.214 ns/op 0.99
intersect bitArray bitLen 128 29.162 ns/op 29.271 ns/op 1.00
intersect array and set length 128 557.09 ns/op 564.93 ns/op 0.99
bitArray.getTrueBitIndexes() bitLen 128 1.0420 us/op 1.3010 us/op 0.80
bitArray.getTrueBitIndexes() bitLen 248 1.8210 us/op 2.0670 us/op 0.88
bitArray.getTrueBitIndexes() bitLen 512 3.7140 us/op 4.1650 us/op 0.89
Full columns - reconstruct all 6 blobs 200.46 us/op 248.65 us/op 0.81
Full columns - reconstruct half of the blobs out of 6 112.22 us/op 115.47 us/op 0.97
Full columns - reconstruct single blob out of 6 32.622 us/op 32.951 us/op 0.99
Half columns - reconstruct all 6 blobs 274.39 ms/op 283.77 ms/op 0.97
Half columns - reconstruct half of the blobs out of 6 137.82 ms/op 139.93 ms/op 0.98
Half columns - reconstruct single blob out of 6 51.552 ms/op 53.538 ms/op 0.96
Full columns - reconstruct all 10 blobs 446.53 us/op 372.02 us/op 1.20
Full columns - reconstruct half of the blobs out of 10 175.23 us/op 159.09 us/op 1.10
Full columns - reconstruct single blob out of 10 44.315 us/op 31.633 us/op 1.40
Half columns - reconstruct all 10 blobs 460.80 ms/op 461.36 ms/op 1.00
Half columns - reconstruct half of the blobs out of 10 231.40 ms/op 238.57 ms/op 0.97
Half columns - reconstruct single blob out of 10 50.968 ms/op 51.619 ms/op 0.99
Full columns - reconstruct all 20 blobs 792.44 us/op 677.45 us/op 1.17
Full columns - reconstruct half of the blobs out of 20 321.83 us/op 307.10 us/op 1.05
Full columns - reconstruct single blob out of 20 33.094 us/op 32.866 us/op 1.01
Half columns - reconstruct all 20 blobs 914.00 ms/op 922.97 ms/op 0.99
Half columns - reconstruct half of the blobs out of 20 456.83 ms/op 467.86 ms/op 0.98
Half columns - reconstruct single blob out of 20 51.943 ms/op 51.053 ms/op 1.02
Set add up to 64 items then delete first 2.0968 us/op 2.0947 us/op 1.00
OrderedSet add up to 64 items then delete first 3.1099 us/op 3.1163 us/op 1.00
Set add up to 64 items then delete last 2.3510 us/op 2.3925 us/op 0.98
OrderedSet add up to 64 items then delete last 3.3770 us/op 3.5829 us/op 0.94
Set add up to 64 items then delete middle 2.3932 us/op 2.4274 us/op 0.99
OrderedSet add up to 64 items then delete middle 5.0369 us/op 5.3151 us/op 0.95
Set add up to 128 items then delete first 4.9878 us/op 4.9875 us/op 1.00
OrderedSet add up to 128 items then delete first 7.5493 us/op 7.0611 us/op 1.07
Set add up to 128 items then delete last 4.7591 us/op 4.9313 us/op 0.97
OrderedSet add up to 128 items then delete last 7.6552 us/op 7.2042 us/op 1.06
Set add up to 128 items then delete middle 4.6506 us/op 4.7145 us/op 0.99
OrderedSet add up to 128 items then delete middle 13.838 us/op 14.004 us/op 0.99
Set add up to 256 items then delete first 9.8861 us/op 10.671 us/op 0.93
OrderedSet add up to 256 items then delete first 15.774 us/op 15.315 us/op 1.03
Set add up to 256 items then delete last 9.7916 us/op 10.032 us/op 0.98
OrderedSet add up to 256 items then delete last 14.454 us/op 15.305 us/op 0.94
Set add up to 256 items then delete middle 9.5723 us/op 9.6201 us/op 1.00
OrderedSet add up to 256 items then delete middle 41.859 us/op 42.435 us/op 0.99
pass gossip attestations to forkchoice per slot 493.12 us/op 591.02 us/op 0.83
computeDeltas 1400000 validators 0% inactive 14.451 ms/op 17.989 ms/op 0.80
computeDeltas 1400000 validators 10% inactive 13.516 ms/op 16.536 ms/op 0.82
computeDeltas 1400000 validators 20% inactive 12.715 ms/op 15.294 ms/op 0.83
computeDeltas 1400000 validators 50% inactive 10.073 ms/op 12.306 ms/op 0.82
computeDeltas 2100000 validators 0% inactive 22.119 ms/op 26.558 ms/op 0.83
computeDeltas 2100000 validators 10% inactive 20.964 ms/op 24.876 ms/op 0.84
computeDeltas 2100000 validators 20% inactive 19.130 ms/op 24.429 ms/op 0.78
computeDeltas 2100000 validators 50% inactive 14.712 ms/op 18.520 ms/op 0.79
altair processAttestation - 250000 vs - 7PWei normalcase 2.1429 ms/op 3.6407 ms/op 0.59
altair processAttestation - 250000 vs - 7PWei worstcase 2.8907 ms/op 4.0773 ms/op 0.71
altair processAttestation - setStatus - 1/6 committees join 121.34 us/op 136.79 us/op 0.89
altair processAttestation - setStatus - 1/3 committees join 234.78 us/op 257.46 us/op 0.91
altair processAttestation - setStatus - 1/2 committees join 324.41 us/op 378.86 us/op 0.86
altair processAttestation - setStatus - 2/3 committees join 419.13 us/op 479.41 us/op 0.87
altair processAttestation - setStatus - 4/5 committees join 584.59 us/op 641.47 us/op 0.91
altair processAttestation - setStatus - 100% committees join 681.34 us/op 734.39 us/op 0.93
altair processBlock - 250000 vs - 7PWei normalcase 3.3950 ms/op 4.4282 ms/op 0.77
altair processBlock - 250000 vs - 7PWei normalcase hashState 17.080 ms/op 18.958 ms/op 0.90
altair processBlock - 250000 vs - 7PWei worstcase 23.391 ms/op 26.256 ms/op 0.89
altair processBlock - 250000 vs - 7PWei worstcase hashState 52.171 ms/op 56.406 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5000 ms/op 1.5826 ms/op 0.95
phase0 processBlock - 250000 vs - 7PWei worstcase 19.391 ms/op 19.038 ms/op 1.02
altair processEth1Data - 250000 vs - 7PWei normalcase 363.67 us/op 398.49 us/op 0.91
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 9.0140 us/op 6.1470 us/op 1.47
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 41.684 us/op 38.782 us/op 1.07
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 11.777 us/op 11.017 us/op 1.07
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 6.9430 us/op 7.2700 us/op 0.96
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 142.41 us/op 154.35 us/op 0.92
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.7878 ms/op 1.7932 ms/op 1.00
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3011 ms/op 2.3278 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.2311 ms/op 2.2908 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.5071 ms/op 4.7081 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.6474 ms/op 2.6512 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9325 ms/op 5.0350 ms/op 0.98
Tree 40 250000 create 357.84 ms/op 361.07 ms/op 0.99
Tree 40 250000 get(125000) 128.21 ns/op 128.15 ns/op 1.00
Tree 40 250000 set(125000) 1.2035 us/op 1.2727 us/op 0.95
Tree 40 250000 toArray() 12.546 ms/op 13.429 ms/op 0.93
Tree 40 250000 iterate all - toArray() + loop 17.382 ms/op 13.230 ms/op 1.31
Tree 40 250000 iterate all - get(i) 43.019 ms/op 43.673 ms/op 0.99
Array 250000 create 2.4345 ms/op 2.4914 ms/op 0.98
Array 250000 clone - spread 805.24 us/op 807.20 us/op 1.00
Array 250000 get(125000) 0.35500 ns/op 0.35800 ns/op 0.99
Array 250000 set(125000) 0.35700 ns/op 0.36600 ns/op 0.98
Array 250000 iterate all - loop 61.571 us/op 62.481 us/op 0.99
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.786 ms/op 41.873 ms/op 1.00
Array.fill - length 1000000 3.0470 ms/op 3.0510 ms/op 1.00
Array push - length 1000000 10.508 ms/op 11.186 ms/op 0.94
Array.get 0.21981 ns/op 0.22702 ns/op 0.97
Uint8Array.get 0.22344 ns/op 0.22748 ns/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.394 ms/op 13.661 ms/op 1.05
altair processEpoch - mainnet_e81889 245.19 ms/op 287.29 ms/op 0.85
mainnet_e81889 - altair beforeProcessEpoch 16.529 ms/op 18.919 ms/op 0.87
mainnet_e81889 - altair processJustificationAndFinalization 6.3590 us/op 6.1530 us/op 1.03
mainnet_e81889 - altair processInactivityUpdates 3.7776 ms/op 3.9038 ms/op 0.97
mainnet_e81889 - altair processRewardsAndPenalties 19.274 ms/op 18.206 ms/op 1.06
mainnet_e81889 - altair processRegistryUpdates 631.00 ns/op 658.00 ns/op 0.96
mainnet_e81889 - altair processSlashings 171.00 ns/op 175.00 ns/op 0.98
mainnet_e81889 - altair processEth1DataReset 213.00 ns/op 172.00 ns/op 1.24
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.0195 ms/op 2.2982 ms/op 1.31
mainnet_e81889 - altair processSlashingsReset 813.00 ns/op 813.00 ns/op 1.00
mainnet_e81889 - altair processRandaoMixesReset 1.2150 us/op 1.2160 us/op 1.00
mainnet_e81889 - altair processHistoricalRootsUpdate 168.00 ns/op 172.00 ns/op 0.98
mainnet_e81889 - altair processParticipationFlagUpdates 516.00 ns/op 522.00 ns/op 0.99
mainnet_e81889 - altair processSyncCommitteeUpdates 140.00 ns/op 143.00 ns/op 0.98
mainnet_e81889 - altair afterProcessEpoch 43.737 ms/op 47.865 ms/op 0.91
capella processEpoch - mainnet_e217614 741.33 ms/op 716.08 ms/op 1.04
mainnet_e217614 - capella beforeProcessEpoch 62.859 ms/op 73.488 ms/op 0.86
mainnet_e217614 - capella processJustificationAndFinalization 5.9810 us/op 5.4530 us/op 1.10
mainnet_e217614 - capella processInactivityUpdates 15.158 ms/op 13.822 ms/op 1.10
mainnet_e217614 - capella processRewardsAndPenalties 98.635 ms/op 95.347 ms/op 1.03
mainnet_e217614 - capella processRegistryUpdates 5.8760 us/op 5.9810 us/op 0.98
mainnet_e217614 - capella processSlashings 174.00 ns/op 174.00 ns/op 1.00
mainnet_e217614 - capella processEth1DataReset 172.00 ns/op 175.00 ns/op 0.98
mainnet_e217614 - capella processEffectiveBalanceUpdates 11.511 ms/op 11.681 ms/op 0.99
mainnet_e217614 - capella processSlashingsReset 806.00 ns/op 831.00 ns/op 0.97
mainnet_e217614 - capella processRandaoMixesReset 1.1160 us/op 1.1220 us/op 0.99
mainnet_e217614 - capella processHistoricalRootsUpdate 169.00 ns/op 180.00 ns/op 0.94
mainnet_e217614 - capella processParticipationFlagUpdates 516.00 ns/op 534.00 ns/op 0.97
mainnet_e217614 - capella afterProcessEpoch 115.00 ms/op 119.41 ms/op 0.96
phase0 processEpoch - mainnet_e58758 236.58 ms/op 223.80 ms/op 1.06
mainnet_e58758 - phase0 beforeProcessEpoch 48.109 ms/op 46.823 ms/op 1.03
mainnet_e58758 - phase0 processJustificationAndFinalization 5.7960 us/op 5.5240 us/op 1.05
mainnet_e58758 - phase0 processRewardsAndPenalties 19.890 ms/op 17.534 ms/op 1.13
mainnet_e58758 - phase0 processRegistryUpdates 2.8020 us/op 2.8870 us/op 0.97
mainnet_e58758 - phase0 processSlashings 172.00 ns/op 256.00 ns/op 0.67
mainnet_e58758 - phase0 processEth1DataReset 172.00 ns/op 180.00 ns/op 0.96
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 934.22 us/op 959.28 us/op 0.97
mainnet_e58758 - phase0 processSlashingsReset 900.00 ns/op 908.00 ns/op 0.99
mainnet_e58758 - phase0 processRandaoMixesReset 1.9090 us/op 1.1530 us/op 1.66
mainnet_e58758 - phase0 processHistoricalRootsUpdate 167.00 ns/op 182.00 ns/op 0.92
mainnet_e58758 - phase0 processParticipationRecordUpdates 840.00 ns/op 867.00 ns/op 0.97
mainnet_e58758 - phase0 afterProcessEpoch 35.216 ms/op 36.825 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.7849 ms/op 1.8369 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.0699 ms/op 2.0749 ms/op 1.00
altair processInactivityUpdates - 250000 normalcase 11.971 ms/op 13.026 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 11.767 ms/op 12.863 ms/op 0.91
phase0 processRegistryUpdates - 250000 normalcase 4.5840 us/op 4.4220 us/op 1.04
phase0 processRegistryUpdates - 250000 badcase_full_deposits 196.77 us/op 196.37 us/op 1.00
phase0 processRegistryUpdates - 250000 worstcase 0.5 68.207 ms/op 74.554 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 16.197 ms/op 18.984 ms/op 0.85
altair processRewardsAndPenalties - 250000 worstcase 16.175 ms/op 18.665 ms/op 0.87
phase0 getAttestationDeltas - 250000 normalcase 6.6820 ms/op 6.9044 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 6.7602 ms/op 6.9513 ms/op 0.97
phase0 processSlashings - 250000 worstcase 82.067 us/op 84.220 us/op 0.97
altair processSyncCommitteeUpdates - 250000 10.923 ms/op 11.196 ms/op 0.98
BeaconState.hashTreeRoot - No change 196.00 ns/op 201.00 ns/op 0.98
BeaconState.hashTreeRoot - 1 full validator 82.776 us/op 81.772 us/op 1.01
BeaconState.hashTreeRoot - 32 full validator 1.0629 ms/op 1.0327 ms/op 1.03
BeaconState.hashTreeRoot - 512 full validator 7.2706 ms/op 7.4460 ms/op 0.98
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 100.13 us/op 106.39 us/op 0.94
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8544 ms/op 1.8258 ms/op 1.02
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.925 ms/op 21.658 ms/op 0.69
BeaconState.hashTreeRoot - 1 balances 84.155 us/op 76.694 us/op 1.10
BeaconState.hashTreeRoot - 32 balances 867.73 us/op 829.93 us/op 1.05
BeaconState.hashTreeRoot - 512 balances 6.4621 ms/op 6.0459 ms/op 1.07
BeaconState.hashTreeRoot - 250000 balances 157.35 ms/op 156.88 ms/op 1.00
aggregationBits - 2048 els - zipIndexesInBitList 20.987 us/op 21.046 us/op 1.00
regular array get 100000 times 24.545 us/op 24.933 us/op 0.98
wrappedArray get 100000 times 24.626 us/op 24.905 us/op 0.99
arrayWithProxy get 100000 times 25.894 ms/op 14.031 ms/op 1.85
ssz.Root.equals 23.734 ns/op 23.785 ns/op 1.00
byteArrayEquals 23.365 ns/op 23.295 ns/op 1.00
Buffer.compare 10.398 ns/op 9.9850 ns/op 1.04
processSlot - 1 slots 10.797 us/op 9.7340 us/op 1.11
processSlot - 32 slots 2.4495 ms/op 2.1845 ms/op 1.12
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.6905 ms/op 4.9005 ms/op 0.96
getCommitteeAssignments - req 1 vs - 250000 vc 1.8772 ms/op 1.8968 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 3.6778 ms/op 3.7100 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 3.9223 ms/op 3.9536 ms/op 0.99
findModifiedValidators - 10000 modified validators 444.58 ms/op 656.81 ms/op 0.68
findModifiedValidators - 1000 modified validators 345.03 ms/op 494.58 ms/op 0.70
findModifiedValidators - 100 modified validators 303.50 ms/op 328.88 ms/op 0.92
findModifiedValidators - 10 modified validators 135.85 ms/op 206.61 ms/op 0.66
findModifiedValidators - 1 modified validators 149.08 ms/op 185.18 ms/op 0.81
findModifiedValidators - no difference 159.21 ms/op 193.62 ms/op 0.82
migrate state 1500000 validators, 3400 modified, 2000 new 970.18 ms/op 989.90 ms/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.2800 ns/op 4.3700 ns/op 0.98
state getBlockRootAtSlot - 250000 vs - 7PWei 358.89 ns/op 476.05 ns/op 0.75
computeProposerIndex 100000 validators 1.5591 ms/op 1.6419 ms/op 0.95
getNextSyncCommitteeIndices 1000 validators 119.47 ms/op 119.68 ms/op 1.00
getNextSyncCommitteeIndices 10000 validators 119.45 ms/op 119.66 ms/op 1.00
getNextSyncCommitteeIndices 100000 validators 119.54 ms/op 119.35 ms/op 1.00
computeProposers - vc 250000 628.90 us/op 607.57 us/op 1.04
computeEpochShuffling - vc 250000 42.219 ms/op 42.129 ms/op 1.00
getNextSyncCommittee - vc 250000 10.752 ms/op 10.682 ms/op 1.01
nodejs block root to RootHex using toHex 145.50 ns/op 144.36 ns/op 1.01
nodejs block root to RootHex using toRootHex 84.968 ns/op 94.482 ns/op 0.90
nodejs fromHex(blob) 235.40 us/op 371.21 us/op 0.63
nodejs fromHexInto(blob) 718.69 us/op 713.39 us/op 1.01
nodejs block root to RootHex using the deprecated toHexString 573.15 ns/op 549.60 ns/op 1.04
nodejs byteArrayEquals 32 bytes (block root) 29.166 ns/op 28.865 ns/op 1.01
nodejs byteArrayEquals 48 bytes (pubkey) 41.773 ns/op 41.398 ns/op 1.01
nodejs byteArrayEquals 96 bytes (signature) 41.336 ns/op 41.117 ns/op 1.01
nodejs byteArrayEquals 1024 bytes 47.616 ns/op 48.185 ns/op 0.99
nodejs byteArrayEquals 131072 bytes (blob) 1.9163 us/op 1.9040 us/op 1.01
browser block root to RootHex using toHex 276.97 ns/op 166.34 ns/op 1.67
browser block root to RootHex using toRootHex 158.28 ns/op 158.19 ns/op 1.00
browser fromHex(blob) 1.2897 ms/op 1.0662 ms/op 1.21
browser fromHexInto(blob) 722.48 us/op 710.93 us/op 1.02
browser block root to RootHex using the deprecated toHexString 559.51 ns/op 391.87 ns/op 1.43
browser byteArrayEquals 32 bytes (block root) 31.835 ns/op 31.527 ns/op 1.01
browser byteArrayEquals 48 bytes (pubkey) 44.318 ns/op 43.815 ns/op 1.01
browser byteArrayEquals 96 bytes (signature) 86.305 ns/op 85.779 ns/op 1.01
browser byteArrayEquals 1024 bytes 815.79 ns/op 807.37 ns/op 1.01
browser byteArrayEquals 131072 bytes (blob) 103.11 us/op 102.02 us/op 1.01

by benchmarkbot/action

@ensi321 ensi321 merged commit 165a02f into unstable Mar 11, 2026
19 checks passed
@ensi321 ensi321 deleted the nc/epbs-stf-clone-state branch March 11, 2026 02:44
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.36%. Comparing base (b847afb) to head (decb485).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #9015   +/-   ##
=========================================
  Coverage     52.36%   52.36%           
=========================================
  Files           848      848           
  Lines         62564    62564           
  Branches       4609     4609           
=========================================
  Hits          32761    32761           
  Misses        29737    29737           
  Partials         66       66           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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