Skip to content

chore: consume BeaconStateView#8857

Draft
twoeths wants to merge 10 commits intounstablefrom
te/consume_beacon_state_view
Draft

chore: consume BeaconStateView#8857
twoeths wants to merge 10 commits intounstablefrom
te/consume_beacon_state_view

Conversation

@twoeths
Copy link
Contributor

@twoeths twoeths commented Feb 4, 2026

Motivation

  • get the beacon-node ready to integrate lodestar-z

Description

  • use IBeaconStateView in beacon-node and fork-choice instead of the current CachedBeaconState*

Closes #8650

blocked by #8773

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @twoeths, 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 significantly refactors the core state management within the beacon node by introducing a new abstraction layer, IBeaconStateView. This change decouples various components from the concrete CachedBeaconState* implementations, promoting a more modular and maintainable architecture. The new BeaconStateView class acts as a wrapper, providing a consistent interface for accessing state properties and performing state transitions, which is crucial for future development and integration efforts.

Highlights

  • State Abstraction Layer: Introduced a new IBeaconStateView interface and its BeaconStateView implementation to provide a read-only, abstracted access layer for the beacon state, replacing direct usage of CachedBeaconState* objects.
  • Centralized State Logic: Refactored numerous modules (beacon-node, fork-choice, state-transition) to utilize the new IBeaconStateView methods, centralizing state access and manipulation logic within the BeaconStateView class.
  • Light Client Proofs Integration: Integrated light client proof generation functions directly into the BeaconStateView, allowing for consistent access to proofs via the state abstraction.
  • Codebase Modernization: Updated various utility functions and data structures across the codebase to align with the new state abstraction, improving maintainability and preparing for future integrations like lodestar-z.

🧠 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/api/impl/beacon/blocks/index.ts
    • Updated state access for block roots to use state.getBlockRootAtSlot(slot).
  • packages/beacon-node/src/api/impl/beacon/pool/index.ts
    • Imported computeEpochAtSlot and updated sync committee access to use state.getIndexedSyncCommitteeAtEpoch().
  • packages/beacon-node/src/api/impl/beacon/state/index.ts
    • Replaced direct CachedBeaconState* imports with IBeaconStateView.
    • Updated state access methods (e.g., getRandaoMix, validator/balance access, shuffling roots) to use IBeaconStateView methods.
    • Changed state loading from loadState to chain.getHeadState().loadOtherState().
  • packages/beacon-node/src/api/impl/beacon/state/utils.ts
    • Replaced BeaconStateAllForks and CachedBeaconStateAllForks with IBeaconStateView.
    • Removed mapToGeneralStatus as it's now handled by IBeaconStateView.
    • Updated validator access to use state.getValidator(), state.getBalance(), state.getValidatorCount(), and state.getValidatorsByStatus().
  • packages/beacon-node/src/api/impl/debug/index.ts
    • Adjusted state serialization logic to use state.serialize() and sszTypesFor(...).BeaconState.deserialize().
  • packages/beacon-node/src/api/impl/lodestar/index.ts
    • Removed direct Tree and loadState imports.
    • Updated getLatestWeakSubjectivityCheckpointEpoch and getHistoricalSummaries to use IBeaconStateView methods.
  • packages/beacon-node/src/api/impl/proof/index.ts
    • Removed loadState import.
    • Updated proof creation to use state.createMultiProof(descriptor).
  • packages/beacon-node/src/api/impl/validator/index.ts
    • Removed PubkeyIndexMap and several state-transition imports.
    • Updated numerous state access methods (e.g., getBlockRootAtSlot, proposer duties, validator details, shuffling roots) to use IBeaconStateView methods.
  • packages/beacon-node/src/api/impl/validator/utils.ts
    • Replaced BeaconStateAllForks with IBeaconStateView.
    • Updated getPubkeysForIndices to use state.getValidatorCount() and state.getValidator(index).
  • packages/beacon-node/src/chain/archiveStore/historicalState/getHistoricalState.ts
    • Removed PubkeyIndexMap and syncPubkeyCache usage.
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated getNearestState to use createBeaconStateViewForHistoricalRegen() and stateTransition to state.stateTransition().
  • packages/beacon-node/src/chain/archiveStore/historicalState/worker.ts
    • Removed PubkeyIndexMap import and usage.
  • packages/beacon-node/src/chain/balancesCache.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated state epoch, block root, and effective balance access to IBeaconStateView methods.
  • packages/beacon-node/src/chain/blocks/importBlock.ts
    • Replaced CachedBeaconStateAltair, EpochCache, isExecutionStateType, isStateValidatorsNodesPopulated with IBeaconStateView and its methods.
    • Updated addAttestation to accept IBeaconStateView.
  • packages/beacon-node/src/chain/blocks/index.ts
    • Changed persistInvalidSszView to persistInvalidSszBytes with state.serialize().
  • packages/beacon-node/src/chain/blocks/types.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/blocks/utils/checkpoint.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/blocks/verifyBlock.ts
    • Replaced CachedBeaconStateAllForks and isStateValidatorsNodesPopulated with IBeaconStateView and its methods.
  • packages/beacon-node/src/chain/blocks/verifyBlocksExecutionPayloads.ts
    • Replaced CachedBeaconStateAllForks, isExecutionStateType, isExecutionEnabled with IBeaconStateView and its methods.
  • packages/beacon-node/src/chain/blocks/verifyBlocksSignatures.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated state.epochCtx.currentSyncCommitteeIndexed to state.currentSyncCommitteeIndexed.
  • packages/beacon-node/src/chain/blocks/verifyBlocksStateTransitionOnly.ts
    • Replaced CachedBeaconStateAllForks and stateTransition with IBeaconStateView and its stateTransition() method.
    • Updated balance access from state.balances.get to state.getBalance().
  • packages/beacon-node/src/chain/chain.ts
    • Replaced various CachedBeaconState* and BeaconStateAllForks types with IBeaconStateView.
    • Updated numerous state-related functions (e.g., computeAnchorCheckpoint, reward computations, processSlots) to use IBeaconStateView methods.
    • Removed persistInvalidSszView and adjusted bufferPool initialization to use anchorState.serializedSize().
  • packages/beacon-node/src/chain/emitter.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/errors/blockError.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/forkChoice/index.ts
    • Replaced various CachedBeaconState* types and direct state access with IBeaconStateView methods.
    • Moved computeAnchorCheckpoint to chain/initState.ts.
  • packages/beacon-node/src/chain/initState.ts
    • Updated initBeaconMetrics to accept IBeaconStateView.
    • Moved and updated computeAnchorCheckpoint to use IBeaconStateView.
  • packages/beacon-node/src/chain/interface.ts
    • Replaced CachedBeaconStateAllForks, BeaconStateAllForks, TreeView<CompositeTypeAny> with IBeaconStateView.
    • Removed persistInvalidSszView.
  • packages/beacon-node/src/chain/lightClient/index.ts
    • Replaced CompositeViewDU, CachedBeaconStateAltair with IBeaconStateView.
    • Removed direct imports for getFinalizedRootProof and getSyncCommitteesWitness (now IBeaconStateView methods).
    • Updated storeSyncCommittee to serialize altair.SyncCommittee directly.
  • packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts
    • Replaced CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStateGloas and getBlockRootAtSlot with IBeaconStateView and its methods.
  • packages/beacon-node/src/chain/opPools/opPool.ts
    • Replaced CachedBeaconStateAllForks and isValidVoluntaryExit with IBeaconStateView and its methods.
  • packages/beacon-node/src/chain/opPools/utils.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/prepareNextSlot.ts
    • Replaced CachedBeaconStateAllForks, CachedBeaconStateExecutions, isExecutionStateType with IBeaconStateView and its methods.
  • packages/beacon-node/src/chain/produceBlock/computeNewStateRoot.ts
    • Replaced CachedBeaconStateAllForks and stateTransition with IBeaconStateView and its stateTransition() method.
  • packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts
    • Replaced various CachedBeaconState* types and direct state access with IBeaconStateView methods (e.g., getExpectedWithdrawals, getRandaoMix).
  • packages/beacon-node/src/chain/regen/interface.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/regen/queued.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/regen/regen.ts
    • Replaced CachedBeaconStateAllForks, processSlots, stateTransition with IBeaconStateView and its methods.
  • packages/beacon-node/src/chain/serializeState.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated state.type.tree_serializedSize(state.node) to state.serializedSize().
  • packages/beacon-node/src/chain/shufflingCache.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated shuffling access from state.epochCtx.* to state.get*Shuffling() and state.*DecisionRoot.
  • packages/beacon-node/src/chain/stateCache/fifoBlockStateCache.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/stateCache/persistentCheckpointsCache.ts
    • Replaced CachedBeaconStateAllForks and loadCachedBeaconState with IBeaconStateView and its methods.
    • Updated state.epochCtx.epoch to state.epoch.
    • Updated state.validators.serialize() to state.serializeValidators().
  • packages/beacon-node/src/chain/stateCache/types.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/validation/attesterSlashing.ts
    • Updated state.validators.length to state.getValidatorCount().
  • packages/beacon-node/src/chain/validation/blobSidecar.ts
    • Updated blockState.epochCtx.getBeaconProposer to blockState.getBeaconProposer().
  • packages/beacon-node/src/chain/validation/block.ts
    • Removed isExecutionEnabled, isExecutionStateType imports.
    • Updated execution state checks to blockState.isExecutionStateType() and blockState.isExecutionEnabled(block).
    • Updated proposer access to blockState.getBeaconProposer().
  • packages/beacon-node/src/chain/validation/blsToExecutionChange.ts
    • Updated validator count and access to state.getValidatorCount() and state.getValidator().
  • packages/beacon-node/src/chain/validation/dataColumnSidecar.ts
    • Updated proposer access to blockState.getBeaconProposer().
  • packages/beacon-node/src/chain/validation/executionPayloadBid.ts
    • Removed CachedBeaconStateGloas, canBuilderCoverBid imports.
    • Updated chain.getHeadStateAtCurrentEpoch to return IBeaconStateView.
    • Updated builder access and bid coverage check to state.getBuilder() and state.canBuilderCoverBid().
  • packages/beacon-node/src/chain/validation/executionPayloadEnvelope.ts
    • Removed CachedBeaconStateGloas import.
    • Updated chain.getHeadState() to return IBeaconStateView.
    • Updated builder access to state.getBuilder().
  • packages/beacon-node/src/chain/validation/payloadAttestationMessage.ts
    • Removed CachedBeaconStateGloas import.
    • Updated chain.getHeadState() to return IBeaconStateView.
    • Updated payload timeliness committee access to state.validatorPTCCommitteeIndex().
  • packages/beacon-node/src/chain/validation/proposerSlashing.ts
    • Updated proposer access to state.getValidator().
  • packages/beacon-node/src/chain/validation/signatureSets/contributionAndProof.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/validation/signatureSets/syncCommittee.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeContribution.ts
    • Replaced CachedBeaconStateAltair with IBeaconStateView.
  • packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/beacon-node/src/chain/validation/syncCommittee.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated sync committee access to state.getIndexedSyncCommitteeAtEpoch(computeEpochAtSlot(data.slot)).
  • packages/beacon-node/src/chain/validation/syncCommitteeContributionAndProof.ts
    • Replaced CachedBeaconStateAltair with IBeaconStateView.
    • Updated sync committee access to state.getIndexedSyncCommitteeAtEpoch(computeEpochAtSlot(contribution.slot)).
  • packages/beacon-node/src/chain/validation/voluntaryExit.ts
    • Removed getVoluntaryExitValidity import.
    • Updated voluntary exit validity check to state.getVoluntaryExitValidity().
  • packages/beacon-node/src/chain/validatorMonitor.ts
    • Replaced CachedBeaconStateAllForks, CachedBeaconStateAltair, getBlockRootAtSlot with IBeaconStateView and its methods.
    • Updated active validator count and proposer access to IBeaconStateView methods.
  • packages/beacon-node/src/network/network.ts
    • Updated active validator count access to chain.getHeadState().getActiveValidatorCount().
  • packages/beacon-node/src/node/nodejs.ts
    • Replaced CachedBeaconStateAllForks, isExecutionCachedStateType with IBeaconStateView and its methods.
  • packages/beacon-node/src/node/notifier.ts
    • Replaced CachedBeaconStateAllForks, isExecutionCachedStateType, isMergeTransitionComplete with IBeaconStateView and its methods.
  • packages/beacon-node/src/sync/backfill/backfill.ts
    • Replaced BeaconStateAllForks and computeAnchorCheckpoint with IBeaconStateView and computeAnchorCheckpoint from chain/initState.ts.
  • packages/beacon-node/test/e2e/api/impl/lightclient/endpoint.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/perf/api/impl/validator/attester.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/perf/chain/opPools/aggregatedAttestationPool.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/perf/chain/opPools/opPool.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/perf/chain/produceBlock/produceBlockBody.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/perf/chain/verifyImportBlocks.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/sim/electra-interop.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/spec/presets/fork_choice.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit-minimal/chain/opPools/aggregatedAttestationPool.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit-minimal/chain/stateCache/persistentCheckpointsCache.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/api/impl/validator/duties/proposer.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/api/impl/validator/produceBlockV3.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/api/impl/validator/utils.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/forkChoice/forkChoice.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/regen/regen.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/stateCache/fifoBlockStateCache.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/validation/attesterSlashing.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/validation/block.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/validation/blsToExecutionChange.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/validation/proposerSlashing.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/unit/chain/validation/voluntaryExit.test.ts
    • Introduced TestBeaconStateView for testing voluntary exits.
  • packages/beacon-node/test/unit/chain/validatorMonitor.test.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/utils/networkWithMockDb.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/utils/node/beacon.ts
    • Updated test states to use BeaconStateView.
  • packages/beacon-node/test/utils/node/simTest.ts
    • Updated logParticipation to accept IBeaconStateView and extract cachedState if it's a BeaconStateView.
  • packages/beacon-node/test/utils/stateView.ts
    • Added new file defining TestBeaconStateView for testing purposes.
  • packages/beacon-node/test/utils/validationData/attestation.ts
    • Updated regen state mocks to return BeaconStateView.
  • packages/cli/src/cmds/beacon/handler.ts
    • Updated anchorState to use BeaconStateView.
  • packages/fork-choice/src/forkChoice/forkChoice.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated state access for unrealized checkpoints and block roots to IBeaconStateView methods.
  • packages/fork-choice/src/forkChoice/interface.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/fork-choice/src/forkChoice/store.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
  • packages/state-transition/src/block/processAttestationsAltair.ts
    • Updated RootCache to accept BeaconStateView.
  • packages/state-transition/src/cache/stateCache.ts
    • Modified loadCachedBeaconState to accept CachedBeaconStateAllForks.
  • packages/state-transition/src/index.ts
    • Exported the new stateView module.
  • packages/state-transition/src/lightClient/proofs.ts
    • Added new file with light client proof generation functions (getSyncCommitteesWitness, getFinalizedRootProof, etc.).
  • packages/state-transition/src/lightClient/types.ts
    • Added new file defining SyncCommitteeWitness type.
  • packages/state-transition/src/slot/upgradeStateToAltair.ts
    • Updated RootCache to accept BeaconStateView.
  • packages/state-transition/src/stateView/beaconStateView.ts
    • Added new file implementing the BeaconStateView class, wrapping CachedBeaconStateAllForks and implementing IBeaconStateView.
  • packages/state-transition/src/stateView/index.ts
    • Added new file exporting beaconStateView.ts and interface.ts.
  • packages/state-transition/src/stateView/interface.ts
    • Added new file defining the IBeaconStateView interface.
  • packages/state-transition/src/util/rootCache.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated getBlockRoot and getBlockRootAtSlot to use state.getBlockRoot() and state.getBlockRootAtSlot().
  • packages/state-transition/src/util/shuffling.ts
    • Replaced CachedBeaconStateAllForks with IBeaconStateView.
    • Updated getBlockRootAtSlot to state.getBlockRootAtSlot() and state.epochCtx.epoch to state.epoch.
  • packages/state-transition/src/util/weakSubjectivity.ts
    • Updated state.config.getForkName(state.slot) to config.getForkName(state.slot).
  • packages/state-transition/test/perf/util/rootCache.test.ts
    • Updated test states to use BeaconStateView.
  • packages/types/src/capella/types.ts
    • Added HistoricalSummaries type.
  • packages/types/src/types.ts
    • Added ForkPostGloas to TypesByFork and ExecutionPayloadBid type.
  • packages/types/src/utils/validatorStatus.ts
    • Added GeneralValidatorStatus type and mapToGeneralStatus function.
Activity
  • The pull request introduces a significant refactor to abstract beacon state access.
  • The primary goal is to prepare the beacon-node for integration with lodestar-z.
  • The changes involve creating and implementing the IBeaconStateView interface, centralizing state logic.
  • Many files across beacon-node and fork-choice have been updated to consume this new interface.
  • New files for BeaconStateView implementation and light client proofs have been added in state-transition.
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 is a significant and well-executed refactoring to introduce and consume the IBeaconStateView interface throughout the beacon-node and fork-choice packages. This change replaces direct access to CachedBeaconState* properties with getter methods and encapsulates state-related logic within the new BeaconStateView class, leading to cleaner, more maintainable, and safer code by promoting immutability.

The changes are extensive but have been applied consistently across the codebase, including API implementations, chain logic, validation, and tests. The new abstraction is a great improvement. I've reviewed the changes carefully and found no issues. The refactoring appears to be sound and improves the overall architecture.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 0d2e83d Previous: 4e115ed Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0468 ms/op 1.0599 ms/op 0.99
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 41.632 us/op 37.275 us/op 1.12
BLS verify - blst 1.4295 ms/op 1.0959 ms/op 1.30
BLS verifyMultipleSignatures 3 - blst 2.2203 ms/op 1.2095 ms/op 1.84
BLS verifyMultipleSignatures 8 - blst 2.5095 ms/op 1.8487 ms/op 1.36
BLS verifyMultipleSignatures 32 - blst 7.4160 ms/op 5.5028 ms/op 1.35
BLS verifyMultipleSignatures 64 - blst 10.653 ms/op 10.514 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst 17.226 ms/op 17.119 ms/op 1.01
BLS deserializing 10000 signatures 672.87 ms/op 680.29 ms/op 0.99
BLS deserializing 100000 signatures 6.7771 s/op 6.7922 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 861.73 us/op 1.3436 ms/op 0.64
BLS verifyMultipleSignatures - same message - 8 - blst 1.6486 ms/op 1.6022 ms/op 1.03
BLS verifyMultipleSignatures - same message - 32 - blst 1.5652 ms/op 1.6891 ms/op 0.93
BLS verifyMultipleSignatures - same message - 64 - blst 2.5194 ms/op 2.5604 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst 4.2767 ms/op 4.3054 ms/op 0.99
BLS aggregatePubkeys 32 - blst 18.912 us/op 18.959 us/op 1.00
BLS aggregatePubkeys 128 - blst 67.325 us/op 67.731 us/op 0.99
getSlashingsAndExits - default max 59.389 us/op 64.378 us/op 0.92
getSlashingsAndExits - 2k 301.68 us/op 323.84 us/op 0.93
isKnown best case - 1 super set check 203.00 ns/op 206.00 ns/op 0.99
isKnown normal case - 2 super set checks 196.00 ns/op 202.00 ns/op 0.97
isKnown worse case - 16 super set checks 193.00 ns/op 217.00 ns/op 0.89
validate api signedAggregateAndProof - struct 2.5622 ms/op 2.1545 ms/op 1.19
validate gossip signedAggregateAndProof - struct 1.9806 ms/op 2.8872 ms/op 0.69
batch validate gossip attestation - vc 640000 - chunk 32 117.31 us/op 120.33 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 64 102.74 us/op 105.28 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 128 94.361 us/op 98.699 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 256 93.039 us/op 98.257 us/op 0.95
bytes32 toHexString 348.00 ns/op 407.00 ns/op 0.86
bytes32 Buffer.toString(hex) 230.00 ns/op 256.00 ns/op 0.90
bytes32 Buffer.toString(hex) from Uint8Array 492.00 ns/op 338.00 ns/op 1.46
bytes32 Buffer.toString(hex) + 0x 294.00 ns/op 286.00 ns/op 1.03
Return object 10000 times 0.22930 ns/op 0.25380 ns/op 0.90
Throw Error 10000 times 4.1419 us/op 4.2396 us/op 0.98
toHex 121.89 ns/op 140.69 ns/op 0.87
Buffer.from 116.27 ns/op 128.93 ns/op 0.90
shared Buffer 75.094 ns/op 75.957 ns/op 0.99
fastMsgIdFn sha256 / 200 bytes 1.8070 us/op 1.8720 us/op 0.97
fastMsgIdFn h32 xxhash / 200 bytes 240.00 ns/op 205.00 ns/op 1.17
fastMsgIdFn h64 xxhash / 200 bytes 420.00 ns/op 275.00 ns/op 1.53
fastMsgIdFn sha256 / 1000 bytes 5.8180 us/op 5.9350 us/op 0.98
fastMsgIdFn h32 xxhash / 1000 bytes 359.00 ns/op 324.00 ns/op 1.11
fastMsgIdFn h64 xxhash / 1000 bytes 344.00 ns/op 349.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 51.306 us/op 52.802 us/op 0.97
fastMsgIdFn h32 xxhash / 10000 bytes 1.3530 us/op 1.5380 us/op 0.88
fastMsgIdFn h64 xxhash / 10000 bytes 875.00 ns/op 1.0300 us/op 0.85
send data - 1000 256B messages 4.4596 ms/op 4.8010 ms/op 0.93
send data - 1000 512B messages 4.5739 ms/op 4.8134 ms/op 0.95
send data - 1000 1024B messages 5.0564 ms/op 5.5005 ms/op 0.92
send data - 1000 1200B messages 5.2521 ms/op 5.5348 ms/op 0.95
send data - 1000 2048B messages 6.9507 ms/op 5.7689 ms/op 1.20
send data - 1000 4096B messages 6.6717 ms/op 7.2585 ms/op 0.92
send data - 1000 16384B messages 38.729 ms/op 30.074 ms/op 1.29
send data - 1000 65536B messages 109.41 ms/op 147.77 ms/op 0.74
enrSubnets - fastDeserialize 64 bits 898.00 ns/op 970.00 ns/op 0.93
enrSubnets - ssz BitVector 64 bits 442.00 ns/op 391.00 ns/op 1.13
enrSubnets - fastDeserialize 4 bits 128.00 ns/op 150.00 ns/op 0.85
enrSubnets - ssz BitVector 4 bits 498.00 ns/op 394.00 ns/op 1.26
prioritizePeers score -10:0 att 32-0.1 sync 2-0 227.10 us/op 235.12 us/op 0.97
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 452.53 us/op 297.49 us/op 1.52
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 384.92 us/op 403.19 us/op 0.95
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 942.70 us/op 852.21 us/op 1.11
prioritizePeers score 0:0 att 64-1 sync 4-1 831.58 us/op 945.52 us/op 0.88
array of 16000 items push then shift 1.5723 us/op 1.6241 us/op 0.97
LinkedList of 16000 items push then shift 7.0970 ns/op 8.7700 ns/op 0.81
array of 16000 items push then pop 73.142 ns/op 77.673 ns/op 0.94
LinkedList of 16000 items push then pop 6.8750 ns/op 7.1790 ns/op 0.96
array of 24000 items push then shift 2.3319 us/op 2.3905 us/op 0.98
LinkedList of 24000 items push then shift 7.3130 ns/op 8.4610 ns/op 0.86
array of 24000 items push then pop 104.23 ns/op 107.63 ns/op 0.97
LinkedList of 24000 items push then pop 6.9410 ns/op 7.3380 ns/op 0.95
intersect bitArray bitLen 8 5.5860 ns/op 5.7100 ns/op 0.98
intersect array and set length 8 32.665 ns/op 33.490 ns/op 0.98
intersect bitArray bitLen 128 28.000 ns/op 28.681 ns/op 0.98
intersect array and set length 128 537.51 ns/op 547.18 ns/op 0.98
bitArray.getTrueBitIndexes() bitLen 128 1.1830 us/op 1.1670 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 248 1.8500 us/op 1.9230 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 512 4.2080 us/op 3.9860 us/op 1.06
Full columns - reconstruct all 6 blobs 242.52 us/op 222.34 us/op 1.09
Full columns - reconstruct half of the blobs out of 6 111.85 us/op 111.13 us/op 1.01
Full columns - reconstruct single blob out of 6 30.650 us/op 33.948 us/op 0.90
Half columns - reconstruct all 6 blobs 266.43 ms/op 278.99 ms/op 0.95
Half columns - reconstruct half of the blobs out of 6 133.64 ms/op 136.02 ms/op 0.98
Half columns - reconstruct single blob out of 6 48.424 ms/op 51.521 ms/op 0.94
Full columns - reconstruct all 10 blobs 317.27 us/op 379.93 us/op 0.84
Full columns - reconstruct half of the blobs out of 10 165.52 us/op 162.25 us/op 1.02
Full columns - reconstruct single blob out of 10 31.646 us/op 33.212 us/op 0.95
Half columns - reconstruct all 10 blobs 435.14 ms/op 453.81 ms/op 0.96
Half columns - reconstruct half of the blobs out of 10 221.87 ms/op 233.97 ms/op 0.95
Half columns - reconstruct single blob out of 10 48.340 ms/op 51.232 ms/op 0.94
Full columns - reconstruct all 20 blobs 612.31 us/op 839.73 us/op 0.73
Full columns - reconstruct half of the blobs out of 20 314.36 us/op 324.35 us/op 0.97
Full columns - reconstruct single blob out of 20 30.469 us/op 31.532 us/op 0.97
Half columns - reconstruct all 20 blobs 872.82 ms/op 894.96 ms/op 0.98
Half columns - reconstruct half of the blobs out of 20 434.32 ms/op 441.74 ms/op 0.98
Half columns - reconstruct single blob out of 20 49.182 ms/op 49.972 ms/op 0.98
Set add up to 64 items then delete first 1.9597 us/op 2.0982 us/op 0.93
OrderedSet add up to 64 items then delete first 2.9193 us/op 3.1171 us/op 0.94
Set add up to 64 items then delete last 2.1885 us/op 2.3723 us/op 0.92
OrderedSet add up to 64 items then delete last 3.2208 us/op 3.3156 us/op 0.97
Set add up to 64 items then delete middle 2.2176 us/op 2.3046 us/op 0.96
OrderedSet add up to 64 items then delete middle 4.7198 us/op 4.8311 us/op 0.98
Set add up to 128 items then delete first 4.6609 us/op 4.7536 us/op 0.98
OrderedSet add up to 128 items then delete first 7.0615 us/op 7.0783 us/op 1.00
Set add up to 128 items then delete last 4.5290 us/op 4.5687 us/op 0.99
OrderedSet add up to 128 items then delete last 6.3916 us/op 6.6880 us/op 0.96
Set add up to 128 items then delete middle 4.3655 us/op 4.5089 us/op 0.97
OrderedSet add up to 128 items then delete middle 12.502 us/op 13.026 us/op 0.96
Set add up to 256 items then delete first 9.6543 us/op 10.385 us/op 0.93
OrderedSet add up to 256 items then delete first 14.562 us/op 15.476 us/op 0.94
Set add up to 256 items then delete last 9.4040 us/op 9.2669 us/op 1.01
OrderedSet add up to 256 items then delete last 13.467 us/op 14.346 us/op 0.94
Set add up to 256 items then delete middle 8.9206 us/op 9.5011 us/op 0.94
OrderedSet add up to 256 items then delete middle 38.634 us/op 40.563 us/op 0.95
pass gossip attestations to forkchoice per slot 2.4621 ms/op 2.5246 ms/op 0.98
forkChoice updateHead vc 100000 bc 64 eq 0 484.32 us/op 502.01 us/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 0 2.8921 ms/op 2.9921 ms/op 0.97
forkChoice updateHead vc 1000000 bc 64 eq 0 4.8236 ms/op 4.9829 ms/op 0.97
forkChoice updateHead vc 600000 bc 320 eq 0 2.9043 ms/op 3.0005 ms/op 0.97
forkChoice updateHead vc 600000 bc 1200 eq 0 2.9365 ms/op 3.0527 ms/op 0.96
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2655 ms/op 3.4788 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 1000 3.3110 ms/op 3.5224 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 10000 3.4395 ms/op 3.6507 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 300000 8.1630 ms/op 9.1608 ms/op 0.89
computeDeltas 1400000 validators 0% inactive 14.106 ms/op 14.565 ms/op 0.97
computeDeltas 1400000 validators 10% inactive 13.239 ms/op 15.130 ms/op 0.88
computeDeltas 1400000 validators 20% inactive 12.330 ms/op 12.745 ms/op 0.97
computeDeltas 1400000 validators 50% inactive 9.6611 ms/op 10.007 ms/op 0.97
computeDeltas 2100000 validators 0% inactive 21.222 ms/op 21.938 ms/op 0.97
computeDeltas 2100000 validators 10% inactive 19.859 ms/op 20.566 ms/op 0.97
computeDeltas 2100000 validators 20% inactive 18.547 ms/op 19.097 ms/op 0.97
computeDeltas 2100000 validators 50% inactive 14.507 ms/op 15.021 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 1.8024 ms/op 1.9697 ms/op 0.92
altair processAttestation - 250000 vs - 7PWei worstcase 2.6737 ms/op 2.7563 ms/op 0.97
altair processAttestation - setStatus - 1/6 committees join 119.57 us/op 120.82 us/op 0.99
altair processAttestation - setStatus - 1/3 committees join 234.12 us/op 235.57 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 328.99 us/op 328.36 us/op 1.00
altair processAttestation - setStatus - 2/3 committees join 423.93 us/op 428.75 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 585.44 us/op 592.16 us/op 0.99
altair processAttestation - setStatus - 100% committees join 707.12 us/op 694.07 us/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 3.4173 ms/op 3.7448 ms/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase hashState 16.132 ms/op 18.695 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase 26.562 ms/op 26.795 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase hashState 52.694 ms/op 60.156 ms/op 0.88
phase0 processBlock - 250000 vs - 7PWei normalcase 1.6075 ms/op 1.6780 ms/op 0.96
phase0 processBlock - 250000 vs - 7PWei worstcase 21.147 ms/op 21.075 ms/op 1.00
altair processEth1Data - 250000 vs - 7PWei normalcase 362.18 us/op 388.94 us/op 0.93
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 9.9040 us/op 7.1720 us/op 1.38
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 55.709 us/op 56.095 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 12.936 us/op 18.121 us/op 0.71
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 11.977 us/op 10.577 us/op 1.13
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 202.08 us/op 170.90 us/op 1.18
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 3.6702 ms/op 2.8891 ms/op 1.27
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3887 ms/op 2.3663 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.3643 ms/op 2.8588 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.3980 ms/op 4.5633 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.9438 ms/op 2.6466 ms/op 1.11
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9459 ms/op 4.9716 ms/op 0.99
Tree 40 250000 create 355.78 ms/op 377.33 ms/op 0.94
Tree 40 250000 get(125000) 128.84 ns/op 130.55 ns/op 0.99
Tree 40 250000 set(125000) 1.2092 us/op 1.2826 us/op 0.94
Tree 40 250000 toArray() 12.221 ms/op 16.734 ms/op 0.73
Tree 40 250000 iterate all - toArray() + loop 12.399 ms/op 13.716 ms/op 0.90
Tree 40 250000 iterate all - get(i) 41.832 ms/op 44.332 ms/op 0.94
Array 250000 create 2.4092 ms/op 2.4627 ms/op 0.98
Array 250000 clone - spread 788.37 us/op 817.99 us/op 0.96
Array 250000 get(125000) 0.33800 ns/op 0.35200 ns/op 0.96
Array 250000 set(125000) 0.44900 ns/op 0.49200 ns/op 0.91
Array 250000 iterate all - loop 61.454 us/op 61.488 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.520 ms/op 41.789 ms/op 0.99
Array.fill - length 1000000 3.1103 ms/op 2.8843 ms/op 1.08
Array push - length 1000000 10.511 ms/op 13.081 ms/op 0.80
Array.get 0.21316 ns/op 0.21946 ns/op 0.97
Uint8Array.get 0.22083 ns/op 0.22265 ns/op 0.99
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.494 ms/op 14.858 ms/op 0.84
altair processEpoch - mainnet_e81889 266.17 ms/op 270.78 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 18.086 ms/op 22.804 ms/op 0.79
mainnet_e81889 - altair processJustificationAndFinalization 6.7280 us/op 6.3160 us/op 1.07
mainnet_e81889 - altair processInactivityUpdates 3.7324 ms/op 3.7754 ms/op 0.99
mainnet_e81889 - altair processRewardsAndPenalties 18.046 ms/op 19.181 ms/op 0.94
mainnet_e81889 - altair processRegistryUpdates 886.00 ns/op 954.00 ns/op 0.93
mainnet_e81889 - altair processSlashings 209.00 ns/op 183.00 ns/op 1.14
mainnet_e81889 - altair processEth1DataReset 238.00 ns/op 179.00 ns/op 1.33
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6476 ms/op 4.7959 ms/op 0.34
mainnet_e81889 - altair processSlashingsReset 1.0610 us/op 872.00 ns/op 1.22
mainnet_e81889 - altair processRandaoMixesReset 1.6030 us/op 1.5520 us/op 1.03
mainnet_e81889 - altair processHistoricalRootsUpdate 167.00 ns/op 156.00 ns/op 1.07
mainnet_e81889 - altair processParticipationFlagUpdates 509.00 ns/op 530.00 ns/op 0.96
mainnet_e81889 - altair processSyncCommitteeUpdates 141.00 ns/op 150.00 ns/op 0.94
mainnet_e81889 - altair afterProcessEpoch 43.945 ms/op 44.256 ms/op 0.99
capella processEpoch - mainnet_e217614 846.42 ms/op 797.83 ms/op 1.06
mainnet_e217614 - capella beforeProcessEpoch 55.094 ms/op 63.475 ms/op 0.87
mainnet_e217614 - capella processJustificationAndFinalization 7.6450 us/op 5.6840 us/op 1.35
mainnet_e217614 - capella processInactivityUpdates 15.237 ms/op 17.462 ms/op 0.87
mainnet_e217614 - capella processRewardsAndPenalties 112.77 ms/op 104.69 ms/op 1.08
mainnet_e217614 - capella processRegistryUpdates 5.8250 us/op 5.8310 us/op 1.00
mainnet_e217614 - capella processSlashings 198.00 ns/op 171.00 ns/op 1.16
mainnet_e217614 - capella processEth1DataReset 187.00 ns/op 188.00 ns/op 0.99
mainnet_e217614 - capella processEffectiveBalanceUpdates 12.760 ms/op 15.161 ms/op 0.84
mainnet_e217614 - capella processSlashingsReset 853.00 ns/op 850.00 ns/op 1.00
mainnet_e217614 - capella processRandaoMixesReset 1.2920 us/op 1.2150 us/op 1.06
mainnet_e217614 - capella processHistoricalRootsUpdate 205.00 ns/op 182.00 ns/op 1.13
mainnet_e217614 - capella processParticipationFlagUpdates 646.00 ns/op 552.00 ns/op 1.17
mainnet_e217614 - capella afterProcessEpoch 111.87 ms/op 117.67 ms/op 0.95
phase0 processEpoch - mainnet_e58758 252.10 ms/op 244.77 ms/op 1.03
mainnet_e58758 - phase0 beforeProcessEpoch 51.450 ms/op 55.767 ms/op 0.92
mainnet_e58758 - phase0 processJustificationAndFinalization 6.0080 us/op 6.1270 us/op 0.98
mainnet_e58758 - phase0 processRewardsAndPenalties 16.146 ms/op 19.805 ms/op 0.82
mainnet_e58758 - phase0 processRegistryUpdates 2.7990 us/op 3.2110 us/op 0.87
mainnet_e58758 - phase0 processSlashings 189.00 ns/op 187.00 ns/op 1.01
mainnet_e58758 - phase0 processEth1DataReset 215.00 ns/op 190.00 ns/op 1.13
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 933.54 us/op 960.65 us/op 0.97
mainnet_e58758 - phase0 processSlashingsReset 890.00 ns/op 1.0290 us/op 0.86
mainnet_e58758 - phase0 processRandaoMixesReset 1.0690 us/op 1.1220 us/op 0.95
mainnet_e58758 - phase0 processHistoricalRootsUpdate 163.00 ns/op 196.00 ns/op 0.83
mainnet_e58758 - phase0 processParticipationRecordUpdates 815.00 ns/op 950.00 ns/op 0.86
mainnet_e58758 - phase0 afterProcessEpoch 34.824 ms/op 37.115 ms/op 0.94
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2738 ms/op 2.2270 ms/op 0.57
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9386 ms/op 2.0591 ms/op 0.94
altair processInactivityUpdates - 250000 normalcase 11.806 ms/op 17.327 ms/op 0.68
altair processInactivityUpdates - 250000 worstcase 11.792 ms/op 16.585 ms/op 0.71
phase0 processRegistryUpdates - 250000 normalcase 7.4490 us/op 5.1970 us/op 1.43
phase0 processRegistryUpdates - 250000 badcase_full_deposits 363.70 us/op 298.51 us/op 1.22
phase0 processRegistryUpdates - 250000 worstcase 0.5 68.517 ms/op 72.077 ms/op 0.95
altair processRewardsAndPenalties - 250000 normalcase 16.338 ms/op 21.315 ms/op 0.77
altair processRewardsAndPenalties - 250000 worstcase 15.823 ms/op 21.317 ms/op 0.74
phase0 getAttestationDeltas - 250000 normalcase 6.6062 ms/op 7.4706 ms/op 0.88
phase0 getAttestationDeltas - 250000 worstcase 6.6149 ms/op 7.4144 ms/op 0.89
phase0 processSlashings - 250000 worstcase 122.29 us/op 109.15 us/op 1.12
altair processSyncCommitteeUpdates - 250000 10.766 ms/op 12.700 ms/op 0.85
BeaconState.hashTreeRoot - No change 286.00 ns/op 206.00 ns/op 1.39
BeaconState.hashTreeRoot - 1 full validator 79.388 us/op 94.095 us/op 0.84
BeaconState.hashTreeRoot - 32 full validator 919.14 us/op 1.0871 ms/op 0.85
BeaconState.hashTreeRoot - 512 full validator 8.2657 ms/op 10.195 ms/op 0.81
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 101.84 us/op 122.04 us/op 0.83
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3389 ms/op 2.3511 ms/op 0.57
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.005 ms/op 21.851 ms/op 0.78
BeaconState.hashTreeRoot - 1 balances 77.435 us/op 83.792 us/op 0.92
BeaconState.hashTreeRoot - 32 balances 752.98 us/op 1.2783 ms/op 0.59
BeaconState.hashTreeRoot - 512 balances 5.3941 ms/op 7.4413 ms/op 0.72
BeaconState.hashTreeRoot - 250000 balances 160.35 ms/op 173.69 ms/op 0.92
aggregationBits - 2048 els - zipIndexesInBitList 20.516 us/op 22.844 us/op 0.90
regular array get 100000 times 24.216 us/op 25.721 us/op 0.94
wrappedArray get 100000 times 24.212 us/op 25.471 us/op 0.95
arrayWithProxy get 100000 times 14.615 ms/op 15.295 ms/op 0.96
ssz.Root.equals 23.414 ns/op 24.158 ns/op 0.97
byteArrayEquals 22.978 ns/op 24.639 ns/op 0.93
Buffer.compare 9.7590 ns/op 10.144 ns/op 0.96
processSlot - 1 slots 9.3990 us/op 11.875 us/op 0.79
processSlot - 32 slots 2.0790 ms/op 2.4259 ms/op 0.86
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.6015 ms/op 6.1976 ms/op 0.58
getCommitteeAssignments - req 1 vs - 250000 vc 1.8592 ms/op 1.9308 ms/op 0.96
getCommitteeAssignments - req 100 vs - 250000 vc 3.6238 ms/op 3.8945 ms/op 0.93
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8730 ms/op 4.0324 ms/op 0.96
findModifiedValidators - 10000 modified validators 786.51 ms/op 684.75 ms/op 1.15
findModifiedValidators - 1000 modified validators 423.82 ms/op 471.99 ms/op 0.90
findModifiedValidators - 100 modified validators 203.03 ms/op 325.37 ms/op 0.62
findModifiedValidators - 10 modified validators 229.15 ms/op 193.75 ms/op 1.18
findModifiedValidators - 1 modified validators 162.58 ms/op 168.86 ms/op 0.96
findModifiedValidators - no difference 142.30 ms/op 207.71 ms/op 0.69
migrate state 1500000 validators, 3400 modified, 2000 new 1.0531 s/op 1.0587 s/op 0.99
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1800 ns/op 4.8600 ns/op 0.86
state getBlockRootAtSlot - 250000 vs - 7PWei 686.09 ns/op 521.15 ns/op 1.32
computeProposerIndex 100000 validators 1.5689 ms/op 1.5621 ms/op 1.00
getNextSyncCommitteeIndices 1000 validators 115.70 ms/op 131.98 ms/op 0.88
getNextSyncCommitteeIndices 10000 validators 115.57 ms/op 134.35 ms/op 0.86
getNextSyncCommitteeIndices 100000 validators 115.38 ms/op 135.85 ms/op 0.85
computeProposers - vc 250000 611.02 us/op 638.52 us/op 0.96
computeEpochShuffling - vc 250000 40.987 ms/op 43.278 ms/op 0.95
getNextSyncCommittee - vc 250000 10.497 ms/op 11.614 ms/op 0.90
nodejs block root to RootHex using toHex 137.92 ns/op 143.99 ns/op 0.96
nodejs block root to RootHex using toRootHex 87.018 ns/op 91.741 ns/op 0.95
nodejs fromHex(blob) 400.27 us/op 518.73 us/op 0.77
nodejs fromHexInto(blob) 692.26 us/op 739.15 us/op 0.94
nodejs block root to RootHex using the deprecated toHexString 385.77 ns/op 579.70 ns/op 0.67
nodejs byteArrayEquals 32 bytes (block root) 28.229 ns/op 29.866 ns/op 0.95
nodejs byteArrayEquals 48 bytes (pubkey) 40.472 ns/op 42.441 ns/op 0.95
nodejs byteArrayEquals 96 bytes (signature) 42.859 ns/op 42.188 ns/op 1.02
nodejs byteArrayEquals 1024 bytes 49.476 ns/op 48.235 ns/op 1.03
nodejs byteArrayEquals 131072 bytes (blob) 1.8565 us/op 1.9755 us/op 0.94
browser block root to RootHex using toHex 160.91 ns/op 170.25 ns/op 0.95
browser block root to RootHex using toRootHex 152.17 ns/op 161.01 ns/op 0.95
browser fromHex(blob) 1.1791 ms/op 1.2244 ms/op 0.96
browser fromHexInto(blob) 693.62 us/op 726.26 us/op 0.96
browser block root to RootHex using the deprecated toHexString 365.38 ns/op 610.66 ns/op 0.60
browser byteArrayEquals 32 bytes (block root) 30.950 ns/op 32.804 ns/op 0.94
browser byteArrayEquals 48 bytes (pubkey) 43.035 ns/op 45.369 ns/op 0.95
browser byteArrayEquals 96 bytes (signature) 84.118 ns/op 89.411 ns/op 0.94
browser byteArrayEquals 1024 bytes 791.72 ns/op 840.21 ns/op 0.94
browser byteArrayEquals 131072 bytes (blob) 100.25 us/op 105.65 us/op 0.95

by benchmarkbot/action

@twoeths twoeths force-pushed the te/consume_beacon_state_view branch from 0c0f46a to 4b93e37 Compare February 27, 2026 04:22
twoeths and others added 9 commits February 27, 2026 14:09
…rsion

Re-implement two pieces of gloas-specific functionality that were inadvertently
removed during the CachedBeaconStateAllForks → IBeaconStateView refactor:

1. Add `processExecutionPayloadEnvelope()` to `IBeaconStateView` interface and
   `BeaconStateView` implementation, delegating to the existing state-transition
   function with a fork guard.

2. Restore `computeEnvelopeStateRoot()` in `computeNewStateRoot.ts` using
   `IBeaconStateView` (no longer requires `CachedBeaconStateGloas` directly).
   Also restore `postState` in `computeNewStateRoot` return type.

3. Restore gloas block production block in `chain.ts` `produceBlockWrapper`:
   computes `envelopeStateRoot` and populates `ProduceFullGloas.envelopeStateRoot`
   for self-built blocks.

4. Fix `getSerializedDataColumnSidecars` regression: replace hardcoded
   `ssz.fulu.DataColumnSidecar` with fork-aware
   `sszTypesFor(forkName as ForkPostFulu).DataColumnSidecar` to correctly
   serialize gloas DataColumnSidecars which have different SSZ fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace number[] with Uint8Array for currentEpochParticipation and
previousEpochParticipation in BeaconStateView. Each ParticipationFlags
element is a uint8 (1 byte), so serialize() gives identical values at
1/8th the memory cost vs JS number[]. All consumers use indexed access
which is fully compatible with Uint8Array.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add getPreviousEpochParticipation/getCurrentEpochParticipation methods
that do direct SSZ tree lookups (O(log n)) instead of materializing the
full array. Use these in validatorMonitor which only accesses a sparse
set of monitored validators, avoiding a full serialize() on each epoch
boundary. The cached Uint8Array getters are kept for aggregatedAttestationPool
which scans full committees and benefits from amortized bulk access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Return early in onceEveryEndOfEpoch before creating RootHexCache and
iterating per-validator attestation/proposal data when the monitored
validator set is empty. Avoids all state access on nodes that don't
have any validators registered for monitoring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restore byteArrayEquals (over Buffer.compare), await on monitoring.close(),
abort-signal comment, and full computeEnvelopeStateRoot JSDoc — all accidentally
dropped alongside the IBeaconStateView migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… in RootCache

Add `isCachedBeaconStateAllForks()` type guard and update RootCache constructor
to accept a union type, branching block root lookups accordingly. Reverts callers
in state-transition from wrapping state in BeaconStateView back to passing directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ve beacon-node duplicate

Add `computeAnchorCheckpoint()` to the `IBeaconStateView` interface (already implemented in
`BeaconStateView`) and remove the duplicate standalone function from `beacon-node/initState.ts`.
Callers in chain, forkChoice, and backfill now use `state.computeAnchorCheckpoint()` directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Decouple beacon-node and state-transition

1 participant