add signature collector cleanup#107
Conversation
|
Code wise all looks good to me, good job! Question on cleanup, What is the point of keeping any old requests around? If enough signatures are collected or slot N+1 begins making sigs for slot N invalid, shouldn't the collector be removed right away in both of these cases? |
Let's say our local node is a bit under stress for some reason. All the other operators sign something, but we never locally try to get this signature as the processor is a bit clogged up or the beacon node responds slowly or whatever. In this scenario, we need a timeout: at which point can we be sure that it won't be locally needed anymore? Furthermore, The last example is relevant for QBFT only: but there we decide the There are probably more weird edge cases or "race conditions" I did not think about, and that is why I decided for the timeout mechanism as easiest prevention. Hope this makes sense, let me know if something is unclear |
Issue Addressed
Signature Collector never cleans up, causing a memory leak.
Proposed Changes
Introduce an expiry slot to the
SignatureRequest. The signature collector removes all requests older than this expiry slot, plus a safety margin (which is 1 slot for now, we'll see if that is sufficient)Additional Info
The design of this is very similar to how clean up is done in the QBFT manager.
Along the way, I noticed that the
sign_validator_registration_datalogic is incorrect, as LH passes the current timestamp, but in SSV we need the epoch timestamp, so I fixed that as well.