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

Refactor tree view model - built-in fast caches

Open
#196 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
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
performance

Research direction

No repository implementation file, test, or entry point is named in the issue. Begin by locating the Lodestar CachedBeaconState and tree view model code, then read the linked Teku cache and commit references; done would require an agreed cache and mutate-then-commit design with corresponding tests and measured memory or speed improvements.

Written by the indexing model from the issue text.

Description

We have built many additional caches in Lodestar CachedBeaconState to make the beacon state transition as fast as it needs to be. However those structures are very verbose, repetitive in code and have huge memory cost.

Cache to skip traversals

Teku ssz has a nice approach where tree views have a cache attached to prevent having to traverse the tree unless when strictly necessary. The idea is to add a regular fast array that shortcuts to leaf data, either nodes or actual data.

Mutate then commit

Also the Tree views can leverage that cache to make many mutations more cheaply.

  1. Mark view as mutable
  2. Mutate nodes without updating the tree
  3. Commit and propagate change up the tree at once in batch (see https://github.com/ChainSafe/persistent-merkle-tree/pull/53)

This is similar to the persistent-ts architecture but without having to duplicate data.

References:
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.