-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid forcing the Ledger pulsers when serializing the Ledger State #4191
Comments
Some Notes. The pulser is a complicated structure. It is a polymorpjic data type, that is used at only one type.
Instantiating the RewardPulser at the only type it is ever used at, the type of its constructor is thus
Here is a pattern that matches RSLP at runtime. This helps us visualize what is stored in side, and which components need to be serialized, so that only the initial state is serialized.
The itemsPerPulse never changes and is needed to reset to the initial state So to reset we need to remember the initial state of the itemsLeftToPulse, which is a huge data structure with type
Luckily this structure consists of a wrapper and a huge array. Even luckier, is that the function that updates this at So the strategy is to change the Pulser construcot to have the type
To serialize we get the protVer from the FreeVars to know how to serialize
To deserialize
Hopefully completing this pulser will give the same answer as completing the one we serialized. |
Wow, thank you for the excellent analysis. The solution makes sense; I wonder if it'd be possible to benchmark the memory consumption of patch #4196 with the baseline (current |
Storing the ledger state on disk requires forcing the pulser, which consumes a significant amount of CPU time and memory, and raises garbage collection activity significantly. As a consequence, slot leadership checks are missed.
Possible ways to mitigate this are:
The text was updated successfully, but these errors were encountered: