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
A sub-View contains a reference to the parent View, used to propagate updates to the parent. If the subview is kept around, this reference prevents the parent from being garbage-collected.
You may look at making the reference to the parent a "weak reference", if python allows that sort of thing.
Haven't looked too deep to see if this is an actual issue here, I just know our implementation is based on remerkleable, so seems pertinent.
Thanks for the report. Generally subviews are meant to mutate the subtree in the super view. The GC is indeed problematic views are cached or retained somewhere. The way around it is to not retain sub-views unnecessarily: views are more like temporary typed interfaces, and the bare tree of nodes is wrapped with a view whenever necessary, and the view is then thrown away again when you are done with it. I'd only really retain the view around the beacon state as a whole, and throw away any smaller views (or alternatively "copy" them to un-hook from parent).
A sub-
View
contains a reference to the parentView
, used to propagate updates to the parent. If the subview is kept around, this reference prevents the parent from being garbage-collected.You may look at making the reference to the parent a "weak reference", if python allows that sort of thing.
Haven't looked too deep to see if this is an actual issue here, I just know our implementation is based on
remerkleable
, so seems pertinent.See ChainSafe/persistent-merkle-tree#26 for our proposed fix.
The text was updated successfully, but these errors were encountered: