Skip to content

chore: consume BeaconStateView#8857

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

chore: consume BeaconStateView#8857
twoeths wants to merge 5 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 Alert ⚠️

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

Benchmark suite Current: c1d28d9 Previous: 6cfc0a8 Ratio
send data - 1000 1200B messages 48.030 ms/op 15.947 ms/op 3.01
send data - 1000 16384B messages 292.47 ms/op 90.512 ms/op 3.23
send data - 1000 65536B messages 749.28 ms/op 202.13 ms/op 3.71
enrSubnets - fastDeserialize 64 bits 3.8220 us/op 957.00 ns/op 3.99
prioritizePeers score 0:0 att 64-1 sync 4-1 2.3408 ms/op 661.21 us/op 3.54
Full benchmark results
Benchmark suite Current: c1d28d9 Previous: 6cfc0a8 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.5411 ms/op 877.72 us/op 1.76
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 58.881 us/op 35.363 us/op 1.67
BLS verify - blst 1.0750 ms/op 877.36 us/op 1.23
BLS verifyMultipleSignatures 3 - blst 1.6575 ms/op 1.2944 ms/op 1.28
BLS verifyMultipleSignatures 8 - blst 2.2801 ms/op 2.0603 ms/op 1.11
BLS verifyMultipleSignatures 32 - blst 6.7262 ms/op 4.3667 ms/op 1.54
BLS verifyMultipleSignatures 64 - blst 13.035 ms/op 8.1114 ms/op 1.61
BLS verifyMultipleSignatures 128 - blst 21.742 ms/op 15.600 ms/op 1.39
BLS deserializing 10000 signatures 946.62 ms/op 615.37 ms/op 1.54
BLS deserializing 100000 signatures 9.8094 s/op 6.0617 s/op 1.62
BLS verifyMultipleSignatures - same message - 3 - blst 1.2057 ms/op 889.31 us/op 1.36
BLS verifyMultipleSignatures - same message - 8 - blst 1.4639 ms/op 1.0684 ms/op 1.37
BLS verifyMultipleSignatures - same message - 32 - blst 2.3570 ms/op 1.6246 ms/op 1.45
BLS verifyMultipleSignatures - same message - 64 - blst 3.6997 ms/op 2.3993 ms/op 1.54
BLS verifyMultipleSignatures - same message - 128 - blst 6.0645 ms/op 3.9232 ms/op 1.55
BLS aggregatePubkeys 32 - blst 32.648 us/op 16.620 us/op 1.96
BLS aggregatePubkeys 128 - blst 109.07 us/op 58.519 us/op 1.86
getSlashingsAndExits - default max 95.714 us/op 36.870 us/op 2.60
getSlashingsAndExits - 2k 375.84 us/op 344.74 us/op 1.09
isKnown best case - 1 super set check 255.00 ns/op 388.00 ns/op 0.66
isKnown normal case - 2 super set checks 258.00 ns/op 379.00 ns/op 0.68
isKnown worse case - 16 super set checks 269.00 ns/op 378.00 ns/op 0.71
validate api signedAggregateAndProof - struct 2.6277 ms/op 1.4130 ms/op 1.86
validate gossip signedAggregateAndProof - struct 2.2236 ms/op 1.8907 ms/op 1.18
batch validate gossip attestation - vc 640000 - chunk 32 182.75 us/op 105.75 us/op 1.73
batch validate gossip attestation - vc 640000 - chunk 64 149.02 us/op 90.050 us/op 1.65
batch validate gossip attestation - vc 640000 - chunk 128 175.57 us/op 82.662 us/op 2.12
batch validate gossip attestation - vc 640000 - chunk 256 141.82 us/op 79.346 us/op 1.79
bytes32 toHexString 899.00 ns/op 484.00 ns/op 1.86
bytes32 Buffer.toString(hex) 422.00 ns/op 396.00 ns/op 1.07
bytes32 Buffer.toString(hex) from Uint8Array 872.00 ns/op 464.00 ns/op 1.88
bytes32 Buffer.toString(hex) + 0x 561.00 ns/op 391.00 ns/op 1.43
Return object 10000 times 0.42450 ns/op 0.22290 ns/op 1.90
Throw Error 10000 times 6.8291 us/op 3.0910 us/op 2.21
toHex 164.20 ns/op 90.671 ns/op 1.81
Buffer.from 173.96 ns/op 84.457 ns/op 2.06
shared Buffer 106.48 ns/op 58.070 ns/op 1.83
fastMsgIdFn sha256 / 200 bytes 2.8970 us/op 1.6310 us/op 1.78
fastMsgIdFn h32 xxhash / 200 bytes 263.00 ns/op 369.00 ns/op 0.71
fastMsgIdFn h64 xxhash / 200 bytes 518.00 ns/op 415.00 ns/op 1.25
fastMsgIdFn sha256 / 1000 bytes 9.8510 us/op 4.7780 us/op 2.06
fastMsgIdFn h32 xxhash / 1000 bytes 465.00 ns/op 452.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 1000 bytes 626.00 ns/op 462.00 ns/op 1.35
fastMsgIdFn sha256 / 10000 bytes 65.189 us/op 40.147 us/op 1.62
fastMsgIdFn h32 xxhash / 10000 bytes 2.0010 us/op 1.4700 us/op 1.36
fastMsgIdFn h64 xxhash / 10000 bytes 1.2330 us/op 1.0340 us/op 1.19
send data - 1000 256B messages 18.944 ms/op 10.313 ms/op 1.84
send data - 1000 512B messages 24.908 ms/op 12.030 ms/op 2.07
send data - 1000 1024B messages 34.119 ms/op 17.293 ms/op 1.97
send data - 1000 1200B messages 48.030 ms/op 15.947 ms/op 3.01
send data - 1000 2048B messages 42.933 ms/op 16.341 ms/op 2.63
send data - 1000 4096B messages 46.791 ms/op 16.626 ms/op 2.81
send data - 1000 16384B messages 292.47 ms/op 90.512 ms/op 3.23
send data - 1000 65536B messages 749.28 ms/op 202.13 ms/op 3.71
enrSubnets - fastDeserialize 64 bits 3.8220 us/op 957.00 ns/op 3.99
enrSubnets - ssz BitVector 64 bits 468.00 ns/op 490.00 ns/op 0.96
enrSubnets - fastDeserialize 4 bits 179.00 ns/op 308.00 ns/op 0.58
enrSubnets - ssz BitVector 4 bits 417.00 ns/op 496.00 ns/op 0.84
prioritizePeers score -10:0 att 32-0.1 sync 2-0 339.10 us/op 245.66 us/op 1.38
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 399.20 us/op 224.72 us/op 1.78
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 502.44 us/op 396.67 us/op 1.27
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 1.1600 ms/op 566.70 us/op 2.05
prioritizePeers score 0:0 att 64-1 sync 4-1 2.3408 ms/op 661.21 us/op 3.54
array of 16000 items push then shift 2.7792 us/op 1.1724 us/op 2.37
LinkedList of 16000 items push then shift 12.664 ns/op 7.3710 ns/op 1.72
array of 16000 items push then pop 143.46 ns/op 62.101 ns/op 2.31
LinkedList of 16000 items push then pop 19.896 ns/op 6.2930 ns/op 3.16
array of 24000 items push then shift 3.4975 us/op 1.8681 us/op 1.87
LinkedList of 24000 items push then shift 12.451 ns/op 6.5380 ns/op 1.90
array of 24000 items push then pop 135.15 ns/op 87.867 ns/op 1.54
LinkedList of 24000 items push then pop 12.177 ns/op 6.0660 ns/op 2.01
intersect bitArray bitLen 8 9.1910 ns/op 4.7580 ns/op 1.93
intersect array and set length 8 44.597 ns/op 30.460 ns/op 1.46
intersect bitArray bitLen 128 38.118 ns/op 25.561 ns/op 1.49
intersect array and set length 128 775.45 ns/op 495.40 ns/op 1.57
bitArray.getTrueBitIndexes() bitLen 128 1.4770 us/op 1.1720 us/op 1.26
bitArray.getTrueBitIndexes() bitLen 248 3.1350 us/op 1.9070 us/op 1.64
bitArray.getTrueBitIndexes() bitLen 512 7.2860 us/op 3.7460 us/op 1.95
Full columns - reconstruct all 6 blobs 367.10 us/op 316.77 us/op 1.16
Full columns - reconstruct half of the blobs out of 6 156.21 us/op 101.46 us/op 1.54
Full columns - reconstruct single blob out of 6 77.539 us/op 30.103 us/op 2.58
Half columns - reconstruct all 6 blobs 429.35 ms/op 228.60 ms/op 1.88
Half columns - reconstruct half of the blobs out of 6 234.45 ms/op 116.89 ms/op 2.01
Half columns - reconstruct single blob out of 6 83.717 ms/op 45.407 ms/op 1.84
Full columns - reconstruct all 10 blobs 681.68 us/op 266.80 us/op 2.56
Full columns - reconstruct half of the blobs out of 10 321.44 us/op 135.32 us/op 2.38
Full columns - reconstruct single blob out of 10 59.060 us/op 38.731 us/op 1.52
Half columns - reconstruct all 10 blobs 767.39 ms/op 381.93 ms/op 2.01
Half columns - reconstruct half of the blobs out of 10 381.71 ms/op 191.76 ms/op 1.99
Half columns - reconstruct single blob out of 10 90.739 ms/op 43.417 ms/op 2.09
Full columns - reconstruct all 20 blobs 1.0260 ms/op 672.81 us/op 1.53
Full columns - reconstruct half of the blobs out of 20 560.60 us/op 342.79 us/op 1.64
Full columns - reconstruct single blob out of 20 58.507 us/op 28.135 us/op 2.08
Half columns - reconstruct all 20 blobs 1.3934 s/op 754.49 ms/op 1.85
Half columns - reconstruct half of the blobs out of 20 706.74 ms/op 380.81 ms/op 1.86
Half columns - reconstruct single blob out of 20 80.085 ms/op 43.077 ms/op 1.86
Set add up to 64 items then delete first 3.1345 us/op 1.6431 us/op 1.91
OrderedSet add up to 64 items then delete first 5.7510 us/op 2.4840 us/op 2.32
Set add up to 64 items then delete last 3.5596 us/op 1.6784 us/op 2.12
OrderedSet add up to 64 items then delete last 5.2132 us/op 2.7755 us/op 1.88
Set add up to 64 items then delete middle 3.4770 us/op 1.8872 us/op 1.84
OrderedSet add up to 64 items then delete middle 7.4160 us/op 4.2380 us/op 1.75
Set add up to 128 items then delete first 7.9895 us/op 3.7254 us/op 2.14
OrderedSet add up to 128 items then delete first 11.270 us/op 5.6461 us/op 2.00
Set add up to 128 items then delete last 7.9888 us/op 3.6053 us/op 2.22
OrderedSet add up to 128 items then delete last 10.011 us/op 5.3681 us/op 1.86
Set add up to 128 items then delete middle 6.8037 us/op 3.5891 us/op 1.90
OrderedSet add up to 128 items then delete middle 19.675 us/op 11.012 us/op 1.79
Set add up to 256 items then delete first 16.234 us/op 7.5173 us/op 2.16
OrderedSet add up to 256 items then delete first 22.199 us/op 11.455 us/op 1.94
Set add up to 256 items then delete last 15.074 us/op 7.2596 us/op 2.08
OrderedSet add up to 256 items then delete last 25.453 us/op 10.909 us/op 2.33
Set add up to 256 items then delete middle 16.583 us/op 7.2008 us/op 2.30
OrderedSet add up to 256 items then delete middle 71.958 us/op 34.332 us/op 2.10
pass gossip attestations to forkchoice per slot 3.7314 ms/op 1.9062 ms/op 1.96
forkChoice updateHead vc 100000 bc 64 eq 0 949.14 us/op 346.28 us/op 2.74
forkChoice updateHead vc 600000 bc 64 eq 0 5.3374 ms/op 2.0889 ms/op 2.56
forkChoice updateHead vc 1000000 bc 64 eq 0 11.251 ms/op 4.6073 ms/op 2.44
forkChoice updateHead vc 600000 bc 320 eq 0 5.4741 ms/op 2.0843 ms/op 2.63
forkChoice updateHead vc 600000 bc 1200 eq 0 5.3490 ms/op 2.1103 ms/op 2.53
forkChoice updateHead vc 600000 bc 7200 eq 0 5.6900 ms/op 2.2943 ms/op 2.48
forkChoice updateHead vc 600000 bc 64 eq 1000 4.4313 ms/op 2.5950 ms/op 1.71
forkChoice updateHead vc 600000 bc 64 eq 10000 4.6483 ms/op 2.6850 ms/op 1.73
forkChoice updateHead vc 600000 bc 64 eq 300000 11.885 ms/op 6.6290 ms/op 1.79
computeDeltas 1400000 validators 0% inactive 19.571 ms/op 11.215 ms/op 1.75
computeDeltas 1400000 validators 10% inactive 17.124 ms/op 10.460 ms/op 1.64
computeDeltas 1400000 validators 20% inactive 17.677 ms/op 9.8564 ms/op 1.79
computeDeltas 1400000 validators 50% inactive 15.234 ms/op 7.3564 ms/op 2.07
computeDeltas 2100000 validators 0% inactive 28.257 ms/op 16.813 ms/op 1.68
computeDeltas 2100000 validators 10% inactive 34.890 ms/op 15.709 ms/op 2.22
computeDeltas 2100000 validators 20% inactive 27.418 ms/op 14.304 ms/op 1.92
computeDeltas 2100000 validators 50% inactive 23.602 ms/op 11.203 ms/op 2.11
altair processAttestation - 250000 vs - 7PWei normalcase 3.4138 ms/op 1.5775 ms/op 2.16
altair processAttestation - 250000 vs - 7PWei worstcase 4.7692 ms/op 2.1072 ms/op 2.26
altair processAttestation - setStatus - 1/6 committees join 161.35 us/op 85.452 us/op 1.89
altair processAttestation - setStatus - 1/3 committees join 374.49 us/op 167.59 us/op 2.23
altair processAttestation - setStatus - 1/2 committees join 482.94 us/op 224.27 us/op 2.15
altair processAttestation - setStatus - 2/3 committees join 515.42 us/op 330.75 us/op 1.56
altair processAttestation - setStatus - 4/5 committees join 821.96 us/op 464.97 us/op 1.77
altair processAttestation - setStatus - 100% committees join 849.24 us/op 558.68 us/op 1.52
altair processBlock - 250000 vs - 7PWei normalcase 5.0723 ms/op 2.7432 ms/op 1.85
altair processBlock - 250000 vs - 7PWei normalcase hashState 23.494 ms/op 18.644 ms/op 1.26
altair processBlock - 250000 vs - 7PWei worstcase 31.569 ms/op 22.573 ms/op 1.40
altair processBlock - 250000 vs - 7PWei worstcase hashState 72.557 ms/op 56.223 ms/op 1.29
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7712 ms/op 1.4992 ms/op 1.18
phase0 processBlock - 250000 vs - 7PWei worstcase 27.056 ms/op 21.910 ms/op 1.23
altair processEth1Data - 250000 vs - 7PWei normalcase 437.29 us/op 299.38 us/op 1.46
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 7.3540 us/op 3.3350 us/op 2.21
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 42.396 us/op 33.683 us/op 1.26
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 13.713 us/op 5.8150 us/op 2.36
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 9.7110 us/op 8.6290 us/op 1.13
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 178.29 us/op 155.60 us/op 1.15
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 2.0816 ms/op 1.3867 ms/op 1.50
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8706 ms/op 1.6194 ms/op 1.77
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.8287 ms/op 1.7951 ms/op 1.58
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.4299 ms/op 3.4775 ms/op 1.56
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.3955 ms/op 1.7975 ms/op 1.89
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.2440 ms/op 4.0609 ms/op 1.54
Tree 40 250000 create 510.75 ms/op 332.84 ms/op 1.53
Tree 40 250000 get(125000) 150.79 ns/op 102.77 ns/op 1.47
Tree 40 250000 set(125000) 1.6481 us/op 1.0564 us/op 1.56
Tree 40 250000 toArray() 18.299 ms/op 9.1787 ms/op 1.99
Tree 40 250000 iterate all - toArray() + loop 19.883 ms/op 9.3090 ms/op 2.14
Tree 40 250000 iterate all - get(i) 60.865 ms/op 32.931 ms/op 1.85
Array 250000 create 3.2434 ms/op 2.0096 ms/op 1.61
Array 250000 clone - spread 1.0880 ms/op 605.01 us/op 1.80
Array 250000 get(125000) 0.44600 ns/op 0.48600 ns/op 0.92
Array 250000 set(125000) 0.50700 ns/op 0.51500 ns/op 0.98
Array 250000 iterate all - loop 75.172 us/op 55.573 us/op 1.35
phase0 afterProcessEpoch - 250000 vs - 7PWei 48.961 ms/op 37.375 ms/op 1.31
Array.fill - length 1000000 3.3018 ms/op 2.0018 ms/op 1.65
Array push - length 1000000 11.947 ms/op 6.7417 ms/op 1.77
Array.get 0.25703 ns/op 0.18201 ns/op 1.41
Uint8Array.get 0.28092 ns/op 0.19250 ns/op 1.46
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.600 ms/op 13.096 ms/op 1.42
altair processEpoch - mainnet_e81889 324.79 ms/op 242.32 ms/op 1.34
mainnet_e81889 - altair beforeProcessEpoch 24.567 ms/op 13.208 ms/op 1.86
mainnet_e81889 - altair processJustificationAndFinalization 6.8810 us/op 5.9960 us/op 1.15
mainnet_e81889 - altair processInactivityUpdates 4.6329 ms/op 2.9809 ms/op 1.55
mainnet_e81889 - altair processRewardsAndPenalties 25.722 ms/op 17.168 ms/op 1.50
mainnet_e81889 - altair processRegistryUpdates 837.00 ns/op 782.00 ns/op 1.07
mainnet_e81889 - altair processSlashings 239.00 ns/op 394.00 ns/op 0.61
mainnet_e81889 - altair processEth1DataReset 224.00 ns/op 445.00 ns/op 0.50
mainnet_e81889 - altair processEffectiveBalanceUpdates 4.7883 ms/op 1.2365 ms/op 3.87
mainnet_e81889 - altair processSlashingsReset 1.0380 us/op 948.00 ns/op 1.09
mainnet_e81889 - altair processRandaoMixesReset 1.2300 us/op 1.1870 us/op 1.04
mainnet_e81889 - altair processHistoricalRootsUpdate 261.00 ns/op 374.00 ns/op 0.70
mainnet_e81889 - altair processParticipationFlagUpdates 874.00 ns/op 683.00 ns/op 1.28
mainnet_e81889 - altair processSyncCommitteeUpdates 161.00 ns/op 334.00 ns/op 0.48
mainnet_e81889 - altair afterProcessEpoch 56.193 ms/op 36.589 ms/op 1.54
capella processEpoch - mainnet_e217614 883.98 ms/op 758.32 ms/op 1.17
mainnet_e217614 - capella beforeProcessEpoch 75.456 ms/op 59.486 ms/op 1.27
mainnet_e217614 - capella processJustificationAndFinalization 6.1660 us/op 4.8450 us/op 1.27
mainnet_e217614 - capella processInactivityUpdates 21.361 ms/op 11.101 ms/op 1.92
mainnet_e217614 - capella processRewardsAndPenalties 115.12 ms/op 99.136 ms/op 1.16
mainnet_e217614 - capella processRegistryUpdates 6.0730 us/op 4.7980 us/op 1.27
mainnet_e217614 - capella processSlashings 218.00 ns/op 365.00 ns/op 0.60
mainnet_e217614 - capella processEth1DataReset 225.00 ns/op 372.00 ns/op 0.60
mainnet_e217614 - capella processEffectiveBalanceUpdates 21.996 ms/op 5.9421 ms/op 3.70
mainnet_e217614 - capella processSlashingsReset 894.00 ns/op 1.1340 us/op 0.79
mainnet_e217614 - capella processRandaoMixesReset 1.1170 us/op 1.1910 us/op 0.94
mainnet_e217614 - capella processHistoricalRootsUpdate 177.00 ns/op 354.00 ns/op 0.50
mainnet_e217614 - capella processParticipationFlagUpdates 503.00 ns/op 678.00 ns/op 0.74
mainnet_e217614 - capella afterProcessEpoch 117.35 ms/op 100.84 ms/op 1.16
phase0 processEpoch - mainnet_e58758 260.24 ms/op 229.97 ms/op 1.13
mainnet_e58758 - phase0 beforeProcessEpoch 61.147 ms/op 44.423 ms/op 1.38
mainnet_e58758 - phase0 processJustificationAndFinalization 7.8170 us/op 4.4100 us/op 1.77
mainnet_e58758 - phase0 processRewardsAndPenalties 20.946 ms/op 16.326 ms/op 1.28
mainnet_e58758 - phase0 processRegistryUpdates 2.9790 us/op 2.3890 us/op 1.25
mainnet_e58758 - phase0 processSlashings 208.00 ns/op 372.00 ns/op 0.56
mainnet_e58758 - phase0 processEth1DataReset 189.00 ns/op 367.00 ns/op 0.51
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1819 ms/op 1.1642 ms/op 1.02
mainnet_e58758 - phase0 processSlashingsReset 845.00 ns/op 1.0940 us/op 0.77
mainnet_e58758 - phase0 processRandaoMixesReset 1.2210 us/op 1.2620 us/op 0.97
mainnet_e58758 - phase0 processHistoricalRootsUpdate 198.00 ns/op 371.00 ns/op 0.53
mainnet_e58758 - phase0 processParticipationRecordUpdates 904.00 ns/op 1.2680 us/op 0.71
mainnet_e58758 - phase0 afterProcessEpoch 36.533 ms/op 30.236 ms/op 1.21
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.5770 ms/op 985.77 us/op 1.60
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.6021 ms/op 1.8852 ms/op 1.38
altair processInactivityUpdates - 250000 normalcase 13.930 ms/op 9.1459 ms/op 1.52
altair processInactivityUpdates - 250000 worstcase 13.893 ms/op 9.9853 ms/op 1.39
phase0 processRegistryUpdates - 250000 normalcase 4.8340 us/op 2.4250 us/op 1.99
phase0 processRegistryUpdates - 250000 badcase_full_deposits 274.50 us/op 254.54 us/op 1.08
phase0 processRegistryUpdates - 250000 worstcase 0.5 80.058 ms/op 46.843 ms/op 1.71
altair processRewardsAndPenalties - 250000 normalcase 19.241 ms/op 13.443 ms/op 1.43
altair processRewardsAndPenalties - 250000 worstcase 17.970 ms/op 15.348 ms/op 1.17
phase0 getAttestationDeltas - 250000 normalcase 7.4345 ms/op 4.8352 ms/op 1.54
phase0 getAttestationDeltas - 250000 worstcase 7.6316 ms/op 4.8711 ms/op 1.57
phase0 processSlashings - 250000 worstcase 89.289 us/op 93.794 us/op 0.95
altair processSyncCommitteeUpdates - 250000 11.826 ms/op 8.8383 ms/op 1.34
BeaconState.hashTreeRoot - No change 270.00 ns/op 385.00 ns/op 0.70
BeaconState.hashTreeRoot - 1 full validator 93.438 us/op 88.388 us/op 1.06
BeaconState.hashTreeRoot - 32 full validator 1.0905 ms/op 950.24 us/op 1.15
BeaconState.hashTreeRoot - 512 full validator 8.9937 ms/op 6.2028 ms/op 1.45
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 122.91 us/op 75.834 us/op 1.62
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8086 ms/op 1.4439 ms/op 1.25
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.501 ms/op 14.756 ms/op 1.46
BeaconState.hashTreeRoot - 1 balances 87.961 us/op 78.172 us/op 1.13
BeaconState.hashTreeRoot - 32 balances 927.55 us/op 822.82 us/op 1.13
BeaconState.hashTreeRoot - 512 balances 7.4352 ms/op 4.8859 ms/op 1.52
BeaconState.hashTreeRoot - 250000 balances 147.89 ms/op 150.54 ms/op 0.98
aggregationBits - 2048 els - zipIndexesInBitList 24.707 us/op 18.361 us/op 1.35
bigIntToBytes LE 0 321.00 ns/op 408.00 ns/op 0.79
bigIntToBytesInto LE 0 273.00 ns/op 374.00 ns/op 0.73
bigIntToBytes LE 255 405.00 ns/op 403.00 ns/op 1.00
bigIntToBytesInto LE 255 271.00 ns/op 389.00 ns/op 0.70
bigIntToBytes LE 2^15 333.00 ns/op 523.00 ns/op 0.64
bigIntToBytesInto LE 2^15 243.00 ns/op 381.00 ns/op 0.64
bigIntToBytes LE 2^23 314.00 ns/op 413.00 ns/op 0.76
bigIntToBytesInto LE 2^23 274.00 ns/op 391.00 ns/op 0.70
bigIntToBytes LE 2^31 306.00 ns/op 439.00 ns/op 0.70
bigIntToBytesInto LE 2^31 263.00 ns/op 394.00 ns/op 0.67
bigIntToBytes LE 2^63 319.00 ns/op 467.00 ns/op 0.68
bigIntToBytesInto LE 2^63 283.00 ns/op 385.00 ns/op 0.74
bigIntToBytes LE 2^127 363.00 ns/op 449.00 ns/op 0.81
bigIntToBytesInto LE 2^127 272.00 ns/op 445.00 ns/op 0.61
bigIntToBytes BE 32 bytes (allocating) 604.00 ns/op 470.00 ns/op 1.29
bigIntToBytesInto BE 32 bytes (pre-allocated) 279.00 ns/op 387.00 ns/op 0.72
batch 100x bigIntToBytes (allocating) 11.094 us/op 8.5030 us/op 1.30
batch 100x bigIntToBytesInto (reusing buffer) 7.0910 us/op 5.3680 us/op 1.32
regular array get 100000 times 26.232 us/op 22.509 us/op 1.17
wrappedArray get 100000 times 27.014 us/op 22.502 us/op 1.20
arrayWithProxy get 100000 times 16.701 ms/op 14.170 ms/op 1.18
ssz.Root.equals 24.128 ns/op 21.472 ns/op 1.12
byteArrayEquals 23.543 ns/op 20.945 ns/op 1.12
Buffer.compare 10.203 ns/op 9.5080 ns/op 1.07
processSlot - 1 slots 12.871 us/op 10.034 us/op 1.28
processSlot - 32 slots 2.6127 ms/op 2.3111 ms/op 1.13
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.2456 ms/op 4.2267 ms/op 1.00
getCommitteeAssignments - req 1 vs - 250000 vc 2.2454 ms/op 1.5488 ms/op 1.45
getCommitteeAssignments - req 100 vs - 250000 vc 4.3481 ms/op 3.0996 ms/op 1.40
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6658 ms/op 3.3306 ms/op 1.40
findModifiedValidators - 10000 modified validators 809.49 ms/op 397.86 ms/op 2.03
findModifiedValidators - 1000 modified validators 612.82 ms/op 331.60 ms/op 1.85
findModifiedValidators - 100 modified validators 296.93 ms/op 268.54 ms/op 1.11
findModifiedValidators - 10 modified validators 157.18 ms/op 138.21 ms/op 1.14
findModifiedValidators - 1 modified validators 175.69 ms/op 124.30 ms/op 1.41
findModifiedValidators - no difference 142.83 ms/op 143.03 ms/op 1.00
migrate state 1500000 validators, 3400 modified, 2000 new 1.0667 s/op 939.32 ms/op 1.14
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.5800 ns/op 5.8200 ns/op 0.96
state getBlockRootAtSlot - 250000 vs - 7PWei 596.41 ns/op 536.92 ns/op 1.11
computeProposerIndex 100000 validators 1.7697 ms/op 1.2121 ms/op 1.46
getNextSyncCommitteeIndices 1000 validators 133.29 ms/op 91.034 ms/op 1.46
getNextSyncCommitteeIndices 10000 validators 136.02 ms/op 89.858 ms/op 1.51
getNextSyncCommitteeIndices 100000 validators 136.30 ms/op 90.198 ms/op 1.51
computeProposers - vc 250000 738.88 us/op 568.54 us/op 1.30
computeEpochShuffling - vc 250000 46.103 ms/op 37.256 ms/op 1.24
getNextSyncCommittee - vc 250000 11.528 ms/op 9.1867 ms/op 1.25
nodejs block root to RootHex using toHex 185.06 ns/op 115.18 ns/op 1.61
nodejs block root to RootHex using toRootHex 98.535 ns/op 75.732 ns/op 1.30
nodejs fromHex(blob) 578.60 us/op 319.71 us/op 1.81
nodejs fromHexInto(blob) 757.34 us/op 650.82 us/op 1.16
nodejs block root to RootHex using the deprecated toHexString 547.16 ns/op 367.71 ns/op 1.49
browser block root to RootHex using toHex 274.33 ns/op 244.33 ns/op 1.12
browser block root to RootHex using toRootHex 159.68 ns/op 127.92 ns/op 1.25
browser fromHex(blob) 1.2817 ms/op 1.0856 ms/op 1.18
browser fromHexInto(blob) 765.43 us/op 566.63 us/op 1.35
browser block root to RootHex using the deprecated toHexString 428.71 ns/op 448.20 ns/op 0.96

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.

Decouple beacon-node and state-transition

1 participant