---
# System prepended metadata

title: 'Week 6 Update: Odinson'
tags: [EPF]

---

# Week 6 Update: [Odinson](https://github.com/PoulavBhowmick03)

My project proposal for epf got merged in the cohort 6 repo this week, and i have been spending better part of this week, getting my hands on, in the store crate of Lighthouse, figuring out the configs, metrics and other types in the consensus crate required for the implementation of the project.

Had some chat with Michael regarding the project, and how to progress with it in general. Opened the [PR](https://github.com/sigp/lighthouse/pull/7803) for the project, will keep working on it, and as well as other issues if I find interesting.

Been updating my [Lighthouse Architecture](https://hackmd.io/@Odinson/r1OazJaHeg) article as I keep diving into the codebase. This week, went through the large `hot_cold_store.rs` file, which spans over 4000 lines of code, and also figured out which parts require change while implementing the memory aware caching.

Lastly, joined ACDC [#161](https://www.youtube.com/live/U_oFzvFrqwY?si=t_x4H9VKD4s9q3vp) and got some great insights into Glamsterdam fork. Gave a read to this thread on [enshrinement](https://x.com/potuz_eth/status/1947985759941607757) by potuz and [BALs](https://x.com/uttam_singhk/status/1929873903435817321) by Uttam

## Resources

1. [Project proposal](https://github.com/eth-protocol-fellows/cohort-six/blob/master/projects/Lighthouse_Better_State_Cache_Heuristics.md)
2. My [PR](https://github.com/sigp/lighthouse/pull/7803) for the project in Lighthouse
3. [ACDC #161](https://www.youtube.com/live/U_oFzvFrqwY?si=t_x4H9VKD4s9q3vp)
4. [Milhouse: add memory tracking](https://github.com/sigp/milhouse/pull/51)
6. [Enshrinement](https://x.com/potuz_eth/status/1947985759941607757) by potuz
7. [BALs](https://x.com/uttam_singhk/status/1929873903435817321)


## Work for the week

1. Created the PR for my project for the EPF in [Lighthouse](https://github.com/sigp/lighthouse/pulls/7803) with some initial introduction of `max_cached_bytes` and `cached_bytes` in the `StateCache`. Created a `memsize.rs` which uses Milhouse's `MemoryTracker` to return the exact size of the different items in the `BeaconState`. Created two helper functions to return the`max_cached_bytes` and `cached_bytes` just to avoid unused variables warning. Modified the constructor to now ask for a maximum size of the cache while initializing the `StateCache`. Updated the `metrics.rs` file to include a `BeaconState cache size` constant.


3. Worked on the MemoryTracker [PR](https://github.com/sigp/milhouse/pull/51) in [Milhouse](https://github.com/sigp/milhouse) and discussed some drawbacks, limitations of the self pointer returning a reference, tried wrapping it in `Arc` but that caused tests to fail. ref- [comment](https://github.com/sigp/milhouse/pull/51#discussion_r2227650413)

## Conclusion

While the Milhouse PR isn't merged yet, as we look for some alternatives or changes possible to the MemoryTracker impl, I will continue working on the project and the memory aware cache implementation. As Barnabes from EthPandaOps will be joining this week's office hours, will be asking him about possible ways to test out this implementation at the end of the project completion.