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
Currently, Visor uses HAMT & AMT Diffing logic implemented in Lotus to determine what changed within actor states. The ADT diffing logic all lives here. There are two performance-related issues I see with the current diffing logic:
It requires the state contained within the ADT to be deserialized to perform the diff.
It will iterate over each entry in the ADT regardless if there has been a change or not. Needless serialization can be avoided by comparing the ADT Root CID before performing the Diff. Unfortunately, the ADT Root methods require a write to their underlying blockstore, which is not allowed in the current lotus implementation. I've described the issue in greater detail here
This also carries the side-effect of making the actor interfaces presented by lotus unimplementable due to their unexported interface methods.
ADT diffing is one of the largest bottlenecks of Visors chain state processing and must be improved for Visor to watch and process the chain in real-time.
We can address (1) in two parts:
When diffing AMT's, use faster AMT diffing logic. code here.
Implement and use fast HAMT diffing logic. issue here.
Addressing (2) requires some decisions/discussion. A couple of ideas on how to address this (open to more):
Modify the ADT Root method to avoid writing to their underlying blockstore. Unclear if this is even possible.
Make the blockstore used by lotus for ADT diffing writeable. Probably a bad idea since diffing should be read-only
Extract the actor interfaces and diffing logic from lotus to a new repository or into Visor. This will allow the ADT to be backed by a blockstore that allows Root to be called. This will also make landing code changes easier as we won't be tied to the lotus review cycle but will become a repo we need to maintain as new actor versions are added.
I think there is a lot over overlap between option 3 and 4. I assume we'd end up implementing something similar to the lotus shims if we choose to operate over the native actor states.
The largest drawback I see with this aproach is it adds more code for us to maintain and could slow out ability to release new versions of Visor when there is a network/specs-actors upgrade since we will need to update our shims.
After some synchronous discussion, we're left with a couple of options:
Modify the HAMT (usage in specs-actors) and AMT (go-amt-ipld) code to work with a read-only IPLD store. We need to understand:
a. Who would own this work?
b. What would it require to implement?
Implement visor-specific actor shim. This will sidestep the read-only store requirement but will add more code to maintain and update when there is a specs-actors release.
Description
Currently, Visor uses HAMT & AMT Diffing logic implemented in Lotus to determine what changed within actor states. The ADT diffing logic all lives here. There are two performance-related issues I see with the current diffing logic:
ADT diffing is one of the largest bottlenecks of Visors chain state processing and must be improved for Visor to watch and process the chain in real-time.
We can address (1) in two parts:
Addressing (2) requires some decisions/discussion. A couple of ideas on how to address this (open to more):
Root
method to avoid writing to their underlying blockstore. Unclear if this is even possible.Root
to be called. This will also make landing code changes easier as we won't be tied to the lotus review cycle but will become a repo we need to maintain as new actor versions are added.Acceptance Criteria
The text was updated successfully, but these errors were encountered: