filecoin-project / specs-actors

DEPRECATED Specification of builtin actors, in the form of executable code.
Other
86 stars 102 forks source link

Runtime IpldGet/Put should require context parameter #140

Open anorth opened 4 years ago

anorth commented 4 years ago

The adt.Store runtime wrapper drops the context from the method signature when adapting to the cbor store interface. While it's possible for it to be hooked up behind the runtime, it would be more straightfoward to simply use the context already provided.

anorth commented 4 years ago

For a counterpoint, @icorderi argues that the cbor.IpldStore interface the HAMT/AMT interfaces need should not require the Go context as a parameter (but it should be connected deeper down). In that case, we would not need to expose the Go context in the runtime at all.

This would certainly be nice, but it's not canonical use of the Go context.

Do not store Contexts inside a struct type; instead, pass a Context explicitly to each function that needs it.

@whyrusleeping as our HAMT/AMT contact, do you have an opinion here? (cc @frrist )