Use xxhash with salt for fastMsgIdFn - #4630
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
|
the benchmark looks great, suggest to test this on a node for 1 day before merge |
|
@dapplion I deployed this branch to feat1 lg1k |
|
this looks promising, initially it takes 200ms - 300ms this correlates to the memory issue with this branch to avoid the String creation, we should try ChainSafe/js-libp2p-gossipsub#355 |
|
This is a low-priority optimization, not worth risking a memory leak for this. @tuyennhv if you want confirm that number causes the leak or not else let's close this PR |
|
closing this PR as it still has a memory issue after I tried numbered FastMsgIdFn version (200ms - 300ms - this branch vs 1.5s - 2s - unstable |
Squashed eip7688 implementation from the eip-7688 branch (lodestar #9390) @ 06b588d: converts Gloas containers to ProgressiveContainer/ProgressiveList (incl. additional containers #9586 and BlockAccessList -> ProgressiveByteList), bumps @chainsafe/ssz, updates light-client gindices and gossip size bounds, and reuses container nodes in upgradeStateToGloas for perf (#9601). Verified against #4630-generated spec vectors.
…nsensus-specs #4630) apply_parent_execution_payload performs no length checks in the spec. With EIP-7688 the ExecutionRequests lists are progressive (no SSZ max length), so the Electra-cap assertion (assertExecutionRequestsWithinLimits) is invalid -- requests exceeding the Electra caps are valid. Removes the assertion and its now-unused imports. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reverts 0395641. consensus-specs master still asserts the 5 execution request length limits in apply_parent_execution_payload (beacon-chain.md L1284-1290, tip a62bc326c) through the #4630 merge and all followups; the "drop the cap" idea was never adopted (#5420 instead tightened MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD 256->64). Keep parity with spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The value shipped in the merged #4630 (and master, tip a62bc326c) is lower than the pre-merge PR snapshot this branch used: - mainnet 4082504 -> 4027336 - minimal 1993180 -> 1938012 (MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD 256->64 and PAYLOAD_DUE_BPS 7500->5000 are handled on nc/alpha.12-constants, not here.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… gossip consensus-specs #4630 (gloas p2p-interface) requires beacon_block gossip to REJECT when parent_execution_requests counts or block body operation counts exceed their per-block limits. EIP-7688 made these lists progressive (no SSZ type-level cap), so the bounds are enforced here at the gossip layer (they are also asserted in the state transition). deposits must be empty (limit 0) post-Fulu. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>


Motivation
fastMsgIdFn() must produce a unique output per message within the message of the last few heartbeats. We can use any hash function so we should go for the cheapest possible with good safety.
sha256 on a node subscribed to all subnets it can take 0.5% of total CPU time.
xxhash is a cryptographically unsafe function that's has really good performance and good distribution of output. This PR also adds salt so an attacker can't pre-compute collisions.
Description
Closes #4603