You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the one hand, this may not be an issue on mainnet, as it's mainly originating from all the validators being part everywhere. This is the core problem:
for 60 validators (the test I was seeing the 4 seconds delay) we have to calculate proofs for every subcommitte (4) for every slot (32). The proof calculation cost approximately 0.5 ms. so:
60 * 32 * 4 * 0.5 = 3840ms (aprox. 4 seconds)
On the other hand, we have very obvious optimizations at hand: As the core of the problem is calculating a proof via a BLS signature based on slot + subcommittee index (Validator.Utils.get_sync_committee_selection_proof/4), the calculation is completely independent for each set of validator_index, slot, subcommittee_index. Given that, it's a low hanging fruit to use something like Task.async_stream to:
Parallelize computation per validator.
Inside of a validator, parallelize computation per slot/subcommittee.
As a followup question, is the all of the computation consumed in BLS.sign or is Misc.compute_signing_root a relevant portion of it? If it's BLS.sign, then there's no significant further change we can do. If it's compute_signing_root, however, that doesn't require the privkey, so we could do that once per subcommittee+slot instead of doing it once per {validator, slot subcommittee_index} tuple, although it's a bit of a bothersome refactor, so it's important to see if it's valuable at all.
The text was updated successfully, but these errors were encountered:
This is a tl;dr on Rodrigo's notes on PR #1297.
On the one hand, this may not be an issue on mainnet, as it's mainly originating from all the validators being part everywhere. This is the core problem:
On the other hand, we have very obvious optimizations at hand: As the core of the problem is calculating a proof via a BLS signature based on slot + subcommittee index (
Validator.Utils.get_sync_committee_selection_proof/4
), the calculation is completely independent for each set ofvalidator_index, slot, subcommittee_index
. Given that, it's a low hanging fruit to use something likeTask.async_stream
to:As a followup question, is the all of the computation consumed in
BLS.sign
or isMisc.compute_signing_root
a relevant portion of it? If it'sBLS.sign
, then there's no significant further change we can do. If it'scompute_signing_root
, however, that doesn't require the privkey, so we could do that once per subcommittee+slot instead of doing it once per{validator, slot subcommittee_index}
tuple, although it's a bit of a bothersome refactor, so it's important to see if it's valuable at all.The text was updated successfully, but these errors were encountered: