Skip to content
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

Fate of the ResolveAddress syscall #368

Closed
anorth opened this issue Mar 9, 2022 · 4 comments
Closed

Fate of the ResolveAddress syscall #368

anorth opened this issue Mar 9, 2022 · 4 comments

Comments

@anorth
Copy link
Member

anorth commented Mar 9, 2022

I think I saw a comment somewhere from @Stebalien that the ResolveAddress syscall should be removed, and instead be an explicit method send to the InitActor. It's been omitted in new gas model discussions.

I advocate for retaining the syscall, and pricing it in expectation that the resolutions are cached in memory with a pretty high hit rate.

During the original VM development it was noted that actor address resolution by looking up the Init actor's HAMT was a significant contributor to overall block validation times. Resolution happens during top-level message dispatch, and also many internal sends (except to singletons). Since address->ID is constant for any address I believe that Lotus and other implementations cache it. Dispatch and sends were priced accordingly.

If we remove the syscall, then actors will be forced to take an expensive path to resolve addresses, when a cheap one exists already.

@raulk
Copy link
Member

raulk commented Mar 9, 2022

Similar heuristics apply to the ideas around an eventual naming registry (or a standard to create naming registries). I bring them up here because from a developer pespective, it would be unfortunate to have to identify if what's being provided as input is a name, an actor ID or an actor address, and have to take different code paths as a result.

In fact, one could generalise the address => ActorID resolution path as an immutable name resolution path.

A well-designed naming system would integrate deeply with the protocol such that every place where an address or an ActorID can be used, a name can be specified instead. As a dev, I would expect that resolve_address syscall would take any of those inputs and return an ActorID, or an error.

On the other hand, I think we do want to enable a multi-registry environment where users can deploy their own naming registries. These would be separate actors, so if we want to obviate the message dispatch cost (which IMO we do), there needs to be a fast path mechanism for the resolution syscall to efficiently interact with a naming registry actor.

@raulk
Copy link
Member

raulk commented Mar 9, 2022

Related: filecoin-project/FIPs#297

@Stebalien
Copy link
Member

My goal, really, was to avoid having the FVM "understand" the init actor's state. Unfortunately, you're probably right that we'll need a syscall to facilitate caching.

However, I would still like to have the resolve_address syscall call a method on the init actor, when the address isn't cached, instead of reading the actor state directly.

@Stebalien
Copy link
Member

If/when we revisit this, it'll likely be a FIP discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants