feat: implement PubkeyIndexMap - #1
Merged
Merged
Conversation
Contributor
Performance Report✔️ no performance regression detected Full benchmark results
|
Member
Author
|
I run this branch on my laptop, got which is faster than napi-rs (blst-ts) (note that the |
twoeths
marked this pull request as ready for review
April 22, 2025 10:17
twoeths
commented
Apr 22, 2025
|
|
||
| pub fn set(self: *PubkeyIndexMap, key: []const u8, value: Val) !void { | ||
| var fixed_key: Key = undefined; | ||
| @memcpy(&fixed_key, key); |
Member
Author
There was a problem hiding this comment.
note that I tried to build a HashMap with []u8 as key to avoid redundant @memcpy but it's even slower
persisted the work in te/pubkey_index_map_no_copy branch for later reference
// the same to std.AutoHashMap except for the hash() and eql() functions
const U8SliceHashMap = std.HashMap(Key, u32, U8SliceContext, default_max_load_percentage);
const hash_fn = std.hash_map.getAutoHashFn(Key, U8SliceContext);
const U8SliceContext = struct {
pub fn hash(_: U8SliceContext, key: Key) u64 {
return std.hash.Wyhash.hash(0, key);
}
pub fn eql(_: U8SliceContext, a: Key, b: Key) bool {
return std.mem.eql(u8, a, b);
}
};
wemeetagain
pushed a commit
that referenced
this pull request
Mar 12, 2026
lodekeeper-z
referenced
this pull request
in lodekeeper-z/lodestar-z
Mar 28, 2026
…mport pipeline Replace the test-only onBlockFromProto shim with a new onBlockFromState function that properly handles: - Checkpoint extraction from CachedBeaconState - Unrealized checkpoint computation via state_transition - Proposer boost assignment for timely blocks - Target root computation from state block_roots - Store checkpoint tracking updates This is the #1 critical fix: without proper checkpoint extraction, fork choice never updates justified/finalized checkpoints from blocks. Also fixes: - isBlockTimely: use hardcoded 4s attestation due (was referencing non-existent BeaconConfig.getAttestationDueMs) - getCheckpointPayloadStatus: stub Gloas-specific code until ForkSeq gets gloas variant - getFieldRoot: fix getElement -> getFieldRoot API mismatch 🤖 Generated with AI assistance
lodekeeper-z
referenced
this pull request
in lodekeeper-z/lodestar-z
Mar 28, 2026
Defer BLS signature verification from inline gossip handler to the
processor's batch handler:
1. GossipHandler.onAttestation: when processor is available, allocate
heap-owned QueuedAttestation with decoded data + SSZ bytes, enqueue
to processor without doing inline BLS. Skip BLS only for the batched
path; inline fallback still does BLS before import.
2. processorHandlerCallback: attestation_batch handler now does:
- Batch BLS verification (currently per-item; TODO: true BatchVerifier
multi-pairing when signature set extraction is implemented)
- On batch failure, falls back to individual verification
- Imports valid attestations to fork choice via onSingleVote
3. Single attestation handler added for the non-batched case.
This eliminates the #1 gossip performance bottleneck: 6400 individual
BLS pairings/slot → batched verification with ~10-50x speedup potential.
🤖 Generated with AI assistance
lodekeeper-z
referenced
this pull request
in lodekeeper-z/lodestar-z
Mar 28, 2026
Per the Engine API spec, blockNumber, gasLimit, gasUsed, timestamp, baseFeePerGas, blob_gas_used, excess_blob_gas, and withdrawal fields (index, validatorIndex, amount) must be QUANTITY (variable-length hex, no leading zeros), not fixed-width DATA encoding. Replace hexEncodeU64/hexEncodeU256 with hexEncodeQuantity/hexEncodeQuantityU256 in all encode functions: encodeExecutionPayloadV1/V2/V3/V4, encodeWithdrawal, encodeDepositRequest, encodeWithdrawalRequest, and encodePayloadAttributesV1/V2/V3. Fixes critical issue #1 and medium issue ChainSafe#5 from REVIEW.md. 🤖 Generated with AI assistance
lodekeeper-z
referenced
this pull request
in lodekeeper-z/lodestar-z
Mar 28, 2026
- attestation_service: use signing_ctx.slots_per_epoch instead of hardcoded /32 in reorg handler (fix #1) - sync_committee_service: add TODO comments noting SYNC_COMMITTEE_SIZE=512 and SUBNET_COUNT=4 are mainnet-only; minimal preset differs (fix #2) - validator: add TODO comment on hardcoded 256 EPOCHS_PER_SYNC_COMMITTEE_PERIOD (fix ChainSafe#3) - attestation_service: rename getDutiesAtSlot(slot) -> allDuties() since the slot param was unused; update call site (fix ChainSafe#4) - signing: add current_epoch param to voluntaryExitSigningRoot() instead of calling std.time.timestamp() internally; keeps function pure/testable (fix ChainSafe#5) - validator: replace inline @import("doppelganger.zig") with dopple_mod alias already imported at top of file (fix ChainSafe#6) - validator_store: change isRemote from *const to *ValidatorStore since it calls mutex.lock() which requires mutability (fix ChainSafe#7) 🤖 Generated with AI assistance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PubkeyIndexMapin zig