# EPF Cohort 6 – Week 16 Update
## Progress this week
This week, I resolved [refactor issue #20](https://github.com/sntntn/grandine/issues/20) – make `tracing_handle` optional and reduce type complexity.
After that I merged PR [Add runtime API endpoint for dynamic tracing log level control](https://github.com/sntntn/grandine/pull/18), which was reviewed and approved by [Tumas](https://github.com/Tumas).
---
A highlight of the week was the **office hour** session with **Eitan from Lighthouse** - [**video**](https://www.youtube.com/watch?v=PI1BFZG_Fvs).
Hearing firsthand how tracing impacts a consensus client and learning from their real-world experiences was extremely valuable for me.
It was great to hear that Lighthouse also plans to instrument the fork choice rule, which confirms that I’m going in the right direction ([issue #22](https://github.com/sntntn/grandine/issues/22)).
At the same time, it was a useful warning - in their case, they discovered that incorrect tracing instrumentation (long-living spans) caused increased memory usage, which they only noticed after running their node for about a month.
I am aware how careful I need to be with instrumentation, and for now, I’m avoiding tracing **highly frequent** functions such as **attestations** until I gain a deeper understanding to make a **good trade-offs**.
Even if in my implementation there’s **another layer of protection** — I can turn off tracing mode at any time through the **API**.
- > So if memory usage starts increasing over time, we don’t need to **shut down** the node.
Instead, we can **lower the tracing level at runtime** to stop creating new spans, identify which module caused the issue, and then **selectively re-enable** tracing for other modules - all **without** interrupting the node’s operation or taking it **offline** from the network.
Simultaneously, I’m expanding my knowledge by studying resources related to the [LMD-GHOST](https://coinmarketcap.com/academy/glossary/lmd-ghost) fork choice rule and the [Beacon Chain design](https://ethos.dev/beacon-chain)
---
I’m glad that metrics tools were also discussed during the office hour.
So, I started exploring [Grafana Tempo](https://grafana.com/oss/tempo/), a distributed tracing backend that allows searching and visualizing traces and even generating metrics from spans.
Grafana is hosting a [**webinar** on November 7th](https://grafana.com/go/webinar/getting-started-with-tracing-and-grafana-tempo/?pg=oss-tempo&plcmt=quick-links): **“How to Get Started with Tracing and Grafana Tempo”**, and I’ve registered to attend.
I plan to use the insights from this webinar to expand Grandine’s tracing documentation before the Fellows project presentations in November — showcasing practical ways to use tracing.
## Next
I’ll be resolving merge conflicts between my fork and the current Grandine main branch.
In parallel, I plan to continue adding instrumentation where it’s needed.
Additionally, I have two university exams coming up, which might take some of my time.
If I manage to find extra time, I may also start exploring the integration of the Grafana Tempo tool — I’ve already discussed it with [Saulius](https://github.com/sauliusgrigaitis), and we both agreed it could be an interesting next step.
## Resources
- [Grandine forked repo](https://github.com/sntntn/grandine/tree/feature/dynamic-tracing-config)
- [struct **Handle** - tracing subscriber](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/reload/struct.Handle.html)
- [**PR**: Add runtime API endpoint for dynamic tracing log level control](https://github.com/sntntn/grandine/pull/18)
- [Rust trait-implementations for Option<T\>](https://doc.rust-lang.org/std/option/enum.Option.html#trait-implementations)
- [Grafana **Tempo**](https://grafana.com/oss/tempo/)
- [**Beacon Chain** design](https://ethos.dev/beacon-chain)
- [LMD-GHOST](https://coinmarketcap.com/academy/glossary/lmd-ghost) + [link](https://publish.obsidian.md/single-slot-finality/LMD-GHOST)
- [Fork choice rule](https://coinmarketcap.com/academy/glossary/fork-choice-rule) -> Longest Chain Rule + GHOST Protocol Improvement,
- [Uncle block](https://coinmarketcap.com/academy/glossary/uncle-block-ommer-block)
- [Office hour with Eitan **video**](https://www.youtube.com/watch?v=PI1BFZG_Fvs)