Skip to main content
Bing
Protocol Engineer
View all authors

· 12 min read

Introducing Lodestar 2.0

Author:
Protocol Engineer

It has been about a year since we signaled our move to Zig, and this week we are shipping the biggest milestone on that roadmap yet: Lodestar 2.0, replacing our TypeScript consensus state transition with a native Zig implementation that is turned on by default.

For years, the argument against running Lodestar was predictable: "Great team and it's great for client diversity, but it's JavaScript. Isn't it slower and heavier on RAM than Rust or Go?" With Lodestar 2.0, that argument no longer holds. On live Ethereum mainnet, our Zig-backed state transition cuts per-block state transition time by 7×, epoch transitions by ~14×, and beacon process memory by 45%. More details below.

Ziggifying Lodestar​

State transition wasn't the first module we moved to Zig. In August 2026, we swapped out our Rust-backed @chainsafe/blst integration for lodestar-z's Zig BLS bindings, shipping it to production in Lodestar v1.47.0 in early September.

That first swap was a deliberate trial run to see how Zig would behave in production inside a Node.js beacon node. We have been building our Zig experience over the last year and had a good idea how Zig would behave with Node.js. But there is so much more to bringing code to production that needed fine-tuning, like build processes, packaging, and shipping native Zig N-API modules cleanly across Linux/macOS/ARM64 without disrupting operators, and whether crossing the JS-to-Zig boundary would pay off in real mainnet traffic. This did more than just validate the toolchain - by moving to a true multi-threaded runtime environment, we cut N-API boundary crossings per verification job from six down to one and saw immediate latency and throughput gains.

(For a deep dive on the BLS work, check out our blog here.)

Once that pipeline was proven, momentum picked up fast:

  • August–September 2026: Zig BLS bindings merged (PR #8900) and shipped in v1.47.0.
  • September 2026: Committee shuffling swapped to Zig (PR #9829).
  • October 2026: Full Zig state transition wired in behind a feature flag (PR #9632), followed by merging lodestar-z directly into the main lodestar to form a monorepo (PR #10513).
  • November 2026: Native Zig state transition enabled by default (PR #10624) and shipped in Lodestar 2.0.

Mainnet Benchmark: Lodestar 2.0 vs. Old Lodestar, Prysm & Lighthouse​

We could run a replay of mainnet blocks with a script to show our point, but it makes more sense to measure real data on live mainnet. We ran four nodes side-by-side on live Ethereum mainnet, following the methodology below, running the following clients:

  • Lodestar 2.0 (Zig): v2.0.0-rc.1 (new default native Zig state transition)
  • Lodestar 2.0 (JS): v2.0.0-rc.1 (old JS state transition)
  • Prysm: v7.3.2
  • Lighthouse: v8.3.3

Methodology​

  • same hardware (Hetzner AX41: AMD Ryzen 5 3600, 64 GB RAM, NVMe SSD)
  • same execution client (Geth v1.17.10 with pre-Fusaka history pruned)
  • no attached validators
  • same window of mainnet uptime (52-hour window)
  • nodes were fully synced at the beginning of the window, with 100% uptime

Results​

We processed 15,570 mainnet blocks following the above methodology, and here are the averages over the 52h window:

MetricLodestar 2.0 (Zig)Lodestar 2.0 (JS)Prysm v7.3.2Lighthouse v8.3.3
Per-Block State Transition9.91 ms70.4 ms63.1 ms94.6 ms
Epoch Transition49.8 ms681 ms(not exposed)745 ms
End-to-End Block Import*154 ms225 ms187 ms350 ms
Missed 4s Attestation Deadline0.071% (11/15,570)0.315% (49/15,570)0.116% (18/15,570)†0.148% (23/15,570)
Beacon Process RAM (RSS)5.7 GB10.3 GB5.23 GiB6.02 GiB
Host Total Memory Used (incl. Geth)14.43 GiB17.26 GiB14.29 GiB15.86 GiB

* Full block import from receipt through execution, fork choice, and database persistence (Lodestar's verification-only time before fork choice and DB writes is 127 ms Zig vs. 198 ms JS).
† Computed from Prysm's Synced new block logs (sinceSlotStartTime > 4s) over the exact same 15,570 blocks.

State Transition & Epoch Transition​

Moving state transition to Zig fundamentally changes the client's latency profile:

  • Per-block state transition drops from 70.4 ms in JS to 9.91 ms in Zig (7.1× faster), compared to 63.1 ms in Prysm (6.4× faster) and 94.6 ms in Lighthouse (block processing + state root, 9.5× faster). (Note: each client's STF timer wraps slightly different sub-steps. For Lodestar, we time block BLS signature verification separately.)

Per-Block State Transition Mean Latency across Lodestar 2.0 (Zig), Lodestar 2.0 (JS), Prysm, and Lighthouse

  • Epoch transition drops from 681 ms in JS to 49.8 ms in Zig (13.7× faster), compared to 745 ms in Lighthouse (15.0× faster).

Epoch Transition Mean Latency across Lodestar 2.0 (Zig), Lodestar 2.0 (JS), and Lighthouse

Why does epoch transition speed matter so much in practice?

Every 32 slots (6.4 minutes), every client has to run an epoch transition, scanning the entire ~1M-validator registry to compute rewards, penalties, effective balances, inactivity scores, justification/finalization, and the new state root. Clients hide this on the happy path by precomputing it near the end of slot 31. However, if the next proposer builds on a different head than we predicted, this process runs on the critical path when slot 0 arrives.

At ~700 ms+ (plus block gossip arrival and EL execution payload verification), you risk blowing past the 4-second attestation deadline and missing slot-0 head votes and/or block proposals. At 49.8 ms with Lodestar 2.0, an epoch-boundary cache miss is practically free, and even more importantly, during non-finality or multi-fork stress, the node has far more headroom to regenerate states without falling behind.

End-to-End Block Processing​

Fast consensus math only counts if it gets blocks imported and set as head before the 4-second attestation deadline.

Switching from JS to Zig cuts end-to-end block verification from 198 ms down to 127 ms - and since Geth itself takes ~100 ms to run the block's transactions, Lodestar's own overhead drops from ~97 ms to ~27 ms (~73% less). (Note: 27ms includes not only state transition, but also gossip handling, bls verification and engine api overhead.) For reference, Lighthouse's full block-import timer (which also includes fork choice) averages 350 ms, while Prysm averages 187 ms.

Most importantly for stakers, Lodestar 2.0's missed 4s attestation deadline rate drops 4.5× compared to JS STF - from 0.315% (49/15,570) down to 0.071% (11/15,570), which is also half of Lighthouse's 0.148% (23/15,570) over the exact same blocks. Among finalized canonical blocks over those 52 hours, only 2 missed the 4s deadline due to slow local processing on Zig (99.987% on-time) versus 34 on JS (17× fewer).

Memory & Disk​

  • Memory: Lodestar 2.0 cuts mean beacon-node RAM by 45%, from 10.3 GB to 5.7 GB. V8's heap shrinks 14.5× from 3.38 GiB to 232 MiB. Total host memory alongside Geth drops from 17.26 GiB to 14.43 GiB - in line with Prysm (14.29 GiB) and below Lighthouse (15.86 GiB).

  • Disk: One of our goals for 2.0 was to keep consensus storage negligible. History pruning is enabled by default in 2.0.

In the Wild: Mainnet Validation from Serenita​

Special thanks to Luca from Serenita for providing the data in this section!

Internal benchmarks are only half the story - what really counts is how Lodestar 2.0 performs in external production staking fleets.

Serenita is an institutional Ethereum staking operator and the team behind Vero, an open-source multi-node validator client that connects validators to multiple independent consensus and execution clients simultaneously (requiring M-of-N agreement before signing attestations). Because Vero subscribes to every connected beacon node's SSE stream on every slot, it naturally benchmarks which client verifies, imports, and emits the canonical head event fastest on live mainnet.

Luca from Serenita shared two months of production mainnet telemetry across multiple consensus clients (10/02 -> 11/29), marking the exact dates they enabled native Zig state transition (10/27, v1.51.0-rc.0 + native STF) and upgraded to v2.0.0-rc.1 (11/25):

"They clearly show Lodestar has been emitting head SSE events much quicker than before and currently dominates our mainnet infra. First red annotation line is v1.51.0-rc.0 + native stf enabled, second line is v2.0.0-rc.1." - Luca, Serenita in our Discord

Lodestar is consistently first to emit the canonical head event​

Before 10/27, Lodestar sat mid-pack at ~2.15-2.20 s, trailing the two fastest anonymized clients by ~70-100 ms and holding 0% head-event timing dominance. The day native Zig STF was turned on, Lodestar dropped ~80-100 ms to ~2.06-2.10 s, overtaking every other client in the fleet, and tightened further to ~2.04-2.06 s after upgrading to v2.0.0-rc.1 on 11/25:

Min Head Event Time across 5 mainnet consensus clients on Serenita's infrastructure, showing Lodestar dropping ~80-100 ms to #1 after enabling native Zig STF on 10/27 and v2.0.0-rc.1 on 11/25

Metrics source: Luca (Serenita)

Lodestar dominates emitting head events first​

The timeline below shows which client led the fleet (fastest head event time) at each point over those two months. Before 10/27, Client B and Client C traded the lead. The moment native Zig STF was enabled, Lodestar immediately took over and held the #1 spot almost continuously through v2.0.0-rc.1:

Head event timing dominance timeline across Serenita's mainnet fleet, showing Lodestar taking over dominance immediately on 10/27 and holding uninterrupted dominance after v2.0.0-rc.1 on 11/25

Metrics source: Luca (Serenita)

For operators running multi-client setups like Vero (or any latency-sensitive staking and MEV infrastructure), adding Lodestar 2.0 is no longer a "diversity tax". It is currently the fastest beacon node to deliver a verified head on virtually every slot.

Again, credits to Luca from Serenita for not only this data, but for always supporting our work and running Lodestar!

How We Built, Hotswapped, and Hardened It​

Rewriting consensus-critical code in a new language without breaking mainnet reliability requires discipline and, more importantly, manpower. We cannot disappear for two years on a rewrite and shirk our responsibility to participate in research or build the next Ethereum fork. We replaced hot-path modules incrementally in production:

  1. From-scratch Zig consensus libraries: We built the core building blocks such as ssz directly in Zig, starting in a separate lodestar-z repo. We used explicit allocator ownership and zero-allocation hot paths (for a deep dive into how our comptime SSZ representation works, see SSZ in lodestar-z: Schema, Values, Bytes).
  2. Thin N-API bindings with zapi: Instead of shuttling huge JS objects back and forth across FFI, we expose the Zig modules to Node.js via N-API bindings built on ChainSafe's Zig N-API wrapper zapi, keeping heavy structures like the beacon state, validator pubkey cache, and shuffling tables in native memory.
  3. Feature-flagged hotswap & monorepo merge: We wired the Zig state transition behind --chain.nativeStateTransition (PR #9632) so we could run Zig and TypeScript side-by-side on live mainnet - using our battle-tested TypeScript implementation as a live differential oracle. Once the Zig path proved to be safe and free of regressions, we merged lodestar-z directly into the lodestar monorepo (PR #10513) so TypeScript and Zig share a single CI, release pipeline, and review standard.
  4. Security & verification first: Performance means nothing if a consensus client isn't safe to stake on. Alongside our supply-chain security controls, the Zig consensus core is:
    • Tested on every PR against Ethereum's official consensus-spec-tests and covered by our nightly interop runs.
    • Continuously fuzzed with AFL++ (our fuzzing setup) with fuzz harnesses compiled in Zig's ReleaseSafe mode.
    • We are big fans of TigerBeetle and TIGER_STYLE.md. While their practices don't entirely map one-to-one to an Ethereum consensus client implementation (we can't statically allocate all memory at startup for example), we take great inspiration from their practices to uphold runtime safety while not sacrificing performance.

What's Next?​

Seeing Lodestar 2.0 hit sub-10 ms state transitions, ~50 ms epoch transitions, and ~5.7 GB RSS on mainnet has only reinforced our conviction in Zig. The team loves working in it, the performance and memory wins are undeniable, and we remain fully committed to incrementally moving the rest of Lodestar into Zig module by module, battle-tested in production at every step.

Next up, we'll continue porting the remaining hot-path modules (networking/QUIC, fork choice, and storage) into Zig. We have the ambitious goal of having our client be mostly, if not entirely, Zig by the end of 2027.

If you haven't looked at Lodestar recently, now is the time to give Lodestar 2.0 a spin. Let us know your experience on our Discord and follow along through 2027.

· 6 min read

Ziggifying Lodestar - Part 1

Author:
Protocol Engineer

Lodestar v1.47 replaced its @chainsafe/blst Rust bindings with lodestar-z/bls Zig bindings that use supranational's blst for the underlying cryptography. This is an exciting change for us in the team since its our first Zig integration since our official blog post signalling our intention to use Zig.

BLS - A Primer​

For a complete picture on BLS and its role in Ethereum, see the eth2book.

In a distributed system like Ethereum, authenticity of messages is a core property that the system must verify.

BLS (Boneh-Lynn-Shacham) is a cryptographic signature scheme to do that. Consensus clients verify BLS signatures for attestations, blocks, sync committees, deposits, execution payload bids, and other consensus messages.

Let's zoom in on just attestations and do a bit of napkin math on them. At the time of writing this, the network has about 900,000 validators, which means we have about 900,000 / 32 = ~28000 attestations per slot. An optimization the network does is to aggregate multiple attestations into a single object. This ends up being one of the costlier workloads of a consensus client.

BLS Aggregation​

By far the most expensive cryptographic operation is the pairing check. This post will not go into detail of how pairing checks work, but simply put, BLS12-381 uses finite fields (approximately 381-bits wide as indicated in its name) and many multiplications, additions (with carry) and modular reductions are done on these fields. It would therefore be ideal to perform as few pairing checks as possible.

This is why BLS is such a great scheme for Ethereum's use case. BLS is aggregation-friendly due to its properties, which means we can combine N signatures from many attestations into a single one, and verifying that single signature is equivalent to verifying those same N signatures.

In practice, most attestations have the same signing root because validators (usually) vote for the same block, source and target checkpoint in the same signing domain.

We can optimize attestation verification by noticing the above. Then, instead of verifying each signature one by one, costing us a total of N pairing checks, we aggregate keys and signatures with random weights before verifying a single aggregated signature, we only have to do a single pairing check.

Random weights are necessary here since an attacker can create invalid signatures based on valid ones that cancel each other out, since signatures and public keys are essentially just points on a curve.

Flow​

For the rest of this post, let's focus on the happy path of same-message attestations.

Original​

The rewrite had more to do with a re-structuring of our workloads rather than just a simple one-to-one port from the Rust bindings to Zig.

Here's what's wrong with our previous implementation: we were doing too much work across Node environments rather than delegating the heavy work to the more performant native layer. Here are two images roughly going through the flow of how a same-message verification job is completed through our main and worker threads, respectively:

main-thread-before

Our main thread is in charge of orchestration. It first resolves the public keys before sending a work request to our worker threads. Our worker threads spawn native threads to handle compute-heavy operations.

worker-before

Our worker thread is in charge of the actual verification work.

We can quickly see some bad things from this flow:

  • We cross NAPI boundaries a total of SIX times - every incoming arrow into the bindings across the dotted line is one NAPI call
  • We were also doing a bunch of wasteful work (round-trip serialization/deserializations)

The root of the problem was our pubkey cache, which lived on our main environment only. Node cannot send PublicKey wrappers to a worker, since they contained native Rust objects owned by the main environment. We had to convert between representations (adding to our napi call count) to be portable between main and worker threads.

The rewrite​

Our rewrite changed this into a native, process-wide, concurrency-safe cache. In simple words, it is now in Zig and shared globally (behind a read/write lock) among all Node environments to allow reads/writes from all threads.

Here's the revised flow:

main-thread-after

All the main thread has to do is to send a verification request to the worker.

worker-after

The worker now does all the work, but even then, most of it is dispatched to the native layer.

Improvements:

  • Main thread BLS workload is very lean now! Most work is delegated to the worker thread.
  • Worker thread only crosses the napi boundary one time. All heavy work is done natively before returning the final result.

Arguably the biggest benefit is moving the cache to the native layer. The cache being native now also means we no longer have to do an awkward serialization/deserialization dance in the Node runtime, and can instead send verification requests to workers using validator indices instead of serializing the cached public keys, since the cache has a mapping of indices to public keys! This saves a whole lot of busy, unnecessary work that we were doing previously.

Results​

We saw some big wins in our BLS verification metrics. The following screenshots show our metrics from a week before v1.47 went live on our nodes, and a week after. The node has a solo staker setup.

Throughput drastically increased:

bls-processed-sigs

It is much faster now to verify a signature set:

bls-sig-set-verification

The latency from worker drastically reduced because of the new streamlined flow:

bls-worker-latency

What's next​

We're in the process of moving the following modules into Zig as well:

Stay tuned for more!