Record predictable addresses in actor roots #477
Replies: 5 comments 7 replies
-
Extension: remove addresses from account state (now redundant)? |
Beta Was this translation helpful? Give feedback.
-
Thanks @Stebalien, I think this is a good proposal. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Planned extension: use this address as the source of truth in the |
Beta Was this translation helpful? Give feedback.
-
This proposal seems to be missing description of what Perhaps this should be merged into FIP-0048? If not, the proposals probably need to refer to each other and clearly describe interactions, in order to function as a spec. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Deprecated: This proposal has been merged into FIP0048 in #572.
Proposal: Record an actor's predictable1 address (f1/f3/f4) (if any) in the actor's state-root object.
Depends on #474.
Motivation
We call f1, f3, and f4 addresses "predictable" because, unlike f0 and f2 addresses, they address types can (sometimes) be predicted before an actor is deployed on chain. Specifically:
These addresses may be useful to know because:
At the moment, the only predictable addresses on-chain (f1 and f3) are stored inside account state and can be accessed by calling the
PubkeyAddress
method on the target account actor. However:Proposal
Extend the
ActorState
object as follows:When an actor object is first created, the
address
would be set if specified. Actors created throughInit.Exec
would not have this field set because these actors would only havef2
addresses.Additionally, extend the
create_actor
syscall to take an optional "predictable" address:Finally, add a new
lookup_address
syscall for looking up an actor's "predictable" address by ID:Analysis
The benefits of this approach are:
The downside is that we're making all actor objects slightly bigger, and paying that cost on every actor invocation and every time an actor updates their balance, state, etc. However:
Alternatives
Userspace
We could continue to implement this feature in userspace. This would require:
Separate Table
Alternatively, we could create a new map (or even an AMT) in the init actor mapping ID addresses to stable addresses.
The downside is that this we'd need to maintain this separate table along with a separate cache for performance (handling reverts, etc.). Really, there's little benefit over storing this information in the actor state object itself.
Footnotes
This isn't a great name, but I can't think of a better one other than "not randomly chosen" or "useful" or "meaningful". ↩
Beta Was this translation helpful? Give feedback.
All reactions