Skip to content

Commit b2be4b7

Browse files
mpaulucciOppen
andauthored
perf(l1): make trusted setup warmup non blocking (#5124)
**Motivation** Warmup takes ~3 seconds and makes the node start up slower unnecessarily **Description** - Makes the warmup behind a thread so it's not blocking --------- Co-authored-by: Mario Rugiero <[email protected]>
1 parent 4d2fa0b commit b2be4b7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Perf
44

5+
### 2025-10-30
6+
7+
- Make trusted setup warmup non blocking [#5124](https://github.com/lambdaclass/ethrex/pull/5124)
8+
59
### 2025-10-28
610

711
- Batch BlobsBundle::validate [#4993](https://github.com/lambdaclass/ethrex/pull/4993)

crates/common/crypto/kzg.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ type Blob = [u8; BYTES_PER_BLOB];
2424
type Commitment = Bytes48;
2525
type Proof = Bytes48;
2626

27-
/// Ensures the Ethereum trusted setup is loaded so later KZG operations avoid the first-call cost.
27+
/// Schedules the Ethereum trusted setup to load on a background thread so later KZG operations avoid the first-call cost.
2828
pub fn warm_up_trusted_setup() {
2929
#[cfg(feature = "c-kzg")]
3030
{
31-
std::hint::black_box(c_kzg::ethereum_kzg_settings(KZG_PRECOMPUTE));
31+
let _ = std::thread::Builder::new()
32+
.name("kzg-warmup".into())
33+
.spawn(|| {
34+
std::hint::black_box(c_kzg::ethereum_kzg_settings(KZG_PRECOMPUTE));
35+
});
3236
}
3337
}
3438

0 commit comments

Comments
 (0)