Improve block_sim speed with 50k+ validators #1294
Merged
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.
More progress towards running 50k or 100k validators smoothly on
block_sim
.get_beacon_committee()
was pointlessly calling the full version ofget_committee_count_at_slot()
, when it's just a simple arithmetic function of the number of active validators, whichget_beacon_committee()
already has.get_inclusion_delay_deltas()
is part of the epoch processing, which had a quadratically growing part.the
get_committee_assignment()
/installValidatorApiHandlers()
changes prepare for dynamically subscribing and unsubscribing to attestation subnets.Before:
After:
Non-epoch slot times only go down slightly -- that was worth fixing, but was coming up when reloading an
epochRef
intoStateCache
, where the latter was being incompletely repopulated due toEpochRef
not containing all the same information. In particular, it was coming up inonAttestation
, which doesn't have any other source for its cache.Epoch slot times are reduced by 2 to 3 times.
The combination creates a ~40% increase in block sim speed overall at 100k validators. It doesn't seem to matter nearly as much up to, say, 20k validators.