lambdaclass / lambdaclass/lambda_ethereum_consensus

Load KZG's trusted setup only once

Open
#848 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue perf
Dominant language
Elixir
Stars
109
Forks
41
PR merge metrics
No merged PRs in 30d

Description

#780 introduces the new Kzg module, but the Rust part of the NIF loads a trusted setup on every function call. We should change this so it's loaded only once at module initialization, but preferably at compile-time.

Some ideas:

  • embed the file in the compiled binary (include_bytes!)
  • use static variables to cache the parsed file (std::sync::Once)
  • add some init function to run on module load

Contributor guide

Open the 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.

Research direction

Start by reading the Rust part of the NIF introduced by #780 and the new Kzg module. Trace where the trusted setup is loaded during each function call, then determine how module initialization or compile-time embedding fits the existing design. Done means the trusted setup is loaded only once rather than per call.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, rust
Domain
backend, cryptography
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.