Improve BLS performance: cache parsed keys, add batch verification, add benchmarks
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- rust
- Lĩnh vực
- cryptography, distributed-systems, performance
Hướng nghiên cứu
Bắt đầu với crates/crypto/src/blst_impl.rs và lần theo các đường dẫn xác minh qua crates/eth2util/src/signing.rs, dkg/src/aggregate.rs và cluster/src/lock.rs. Sử dụng crates/k1util/benches làm mẫu benchmark và xem xét crates/frost/src/curve.rs để tìm các wrapper hiện có. Công việc được coi là hoàn tất khi caching được đề xuất, xác minh theo lô, tổng hợp an toàn, scalar-hoisting và các benchmark của criterion đã được triển khai và có thể đo lường.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
All BLS operations take raw byte arrays (types.rs#L17-L21), so every call re-deserializes (verify does a G1 decompression per call) and re-runs subgroup checks — verify passes pk_validate = true and sig_groupcheck = true on every invocation. For a DV node the public shares are cluster-constant; nothing is memoized.
There is also no batch verification: blst's verify_multiple_aggregate_signatures is unused, and the hot paths verify one signature at a time — every incoming peer partial signature (parsigex → verify_eth2_signed_data → signing.rs#L148), a nested validators×partials loop in dkg/src/aggregate.rs#L146, and one builder registration per validator in cluster/src/lock.rs#L427.
Additionally, aggregate_public_keys hand-rolls point addition through unsafe FFI and skips per-key subgroup validation — blst's safe AggregatePublicKey::aggregate(..., validate) covers it. A second independent blst wrapper with safe constructors already exists in pluto-frost (crates/frost/src/curve.rs); the ad-hoc scalar helpers in blst_impl.rs duplicate it.
There are no benchmarks: the only criterion setup in the workspace is crates/k1util/benches, while Charon benchmarks its BLS backend (tbls_test.go BenchmarkHerumiImplementation).
Proposed change
- Introduce parsed key/signature types (wrapping
blsttypes) validated once at construction; keep raw bytes only at serialization boundaries. - Add a batch-verification entry point and use it on the partial-signature paths.
- Replace the unsafe aggregation with the blst safe API; consolidate scalar helpers with
pluto-frost's wrappers. - Hoist the O(n²)
scalar_from_u64recomputation out of the interpolation loops —evaluate_polynomialrebuilds the same scalar every iteration andcompute_lagrange_coefficientsreconstructs per-index scalars inside the inner loop; build them once per index. - Add criterion benches (sign/verify/aggregate/threshold_aggregate) using the k1util bench as a template, so wins are measurable.
- Ngôn ngữ chính
- Rust
- Star
- 8
- Fork
- 5
- Merge trung bình
- 4 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NethermindEth/pluto
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
NethermindEth/pluto#719 ·
-
enhancement rust
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
NethermindEth/pluto#640 ·
-
rust
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
NethermindEth/pluto#638 · 1 bình luận ·
-
Improve `alpha test peers`: match Charon's probes; reduce timeoutsCó thể đã có người làm @varex83agent đã nhận 24 ngày trước. Đang mởbug track:orchestration-cli
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
NethermindEth/pluto#632 ·
-
enhancement rust
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NethermindEth/pluto#631 ·
Tất cả issue của NethermindEth/pluto
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
manuscript-lang/manuscript#1364 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`printf "%o"` prints decimalĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fable-compiler/Fable#5157 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
C-bug needs-triage O-UEFI T-libs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày