Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add ByteVectorShared - optimize validator object memory

Open
#226 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
performance

Research direction

Start by reviewing the byteVectorImmutable branch linked in the issue and the current validator object representation. Trace how pubkey and withdrawal_credentials are stored and accessed, then define completion as preserving their behavior while backing multiple values with shared Uint8Arrays and reducing the validator memory cost.

Written by the indexing model from the issue text.

Description

meta-investigate prio-low scope-memory

NodeJS represents Uint8Arrays inefficiently when they have small sizes. The validators object have pubkey and withdrawal_credentials that can be thought as an append-only list which take ~140MB in a single state.

An optimization to reduce their memory cost is to keep them in bigger Uint8Arrays that are shared for multiple pubkeys. This is possible as quickly tested in https://github.com/ChainSafe/ssz/tree/dapplion/byteVectorImmutable

Since validator objects are already represented as values internally inside a node the validator object could be a custom class instance with getters for pubkey and withdrawal_credentials that slice a Uint8Array of the shared one.

Dominant language
TypeScript
Stars
62
Forks
27
Avg merge
19h 2m
Merged PRs (30d)
6

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ChainSafe/ssz

All issues in ChainSafe/ssz

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.