refactor(bls): allocations around VMAS - #395
Merged
Merged
Conversation
This is based on 2 things: 1) On lodestar (the consumer) we [batch by a minimum of 16](https://github.com/ChainSafe/lodestar/blob/8d5a6a4fc1d2c362902db875758df19c7970cf93/packages/beacon-node/src/chain/bls/multithread/worker.ts#L8-L15) 2) Metrics suggest that the sas fleet sees about ~30 signature sets as the average size. So we use stack allocations for any sets of size 32 and below, and use heap allocations otherwise.
GrapeBaBa
approved these changes
Jun 10, 2026
markolazic01
pushed a commit
to markolazic01/lodestar-z
that referenced
this pull request
Jun 17, 2026
rework allocations around `verifyMultipleAggregateSignatures`. - we're batching on average about ~30 signature sets per batch on our highest load fleet (according to metrics), so a cap of about 32 makes sense for stack allocations. Anything beyond that, use heap allocations. - avoid copies for `msgs` which was unnecessary
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.
rework allocations around
verifyMultipleAggregateSignatures.msgswhich was unnecessary