-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fix MinerActor.prove_replica_updates not to require Blockstore to be Cloned #133
Comments
See #137 |
Unfortunately, the EVM also requires |
A thought I had recently: I'm increasingly of the opinion that having components be generic in the blockstore is probably a design error. Instead, they should work with a dynamic dispatch reference. On the scale of the work done for a blockstore read/write, a vtable lookup will be unmeasurable. Even a pure in-memory store is probably dominated by hashing (the internal hashtable) even if one ignores all the data de/encoding and CID generation that almost always accompanies it. The blockstore generic infects a huge amount of code and causes real development friction that I don't think is justified. Unfortunately, resolving it probably requires working bottom-up from things like the H/AMT implementations, which are shared between repos, and so can't be trialled in a limited scope like the built-in actors. |
This is a bit tricky in rust, unfortunately.
So all of our APIs would likely need to take an Alternatively:
But if we're not careful, we'll have blockstores wrapped in boxes wrapped in rcs wrapped in boxes etc. |
Could you expand on those? One candidate would be for mutations, but the current trait has no
Could you expand on those too? My framing is explicitly for actor development. In this frame, I'm not aware of examples of either of these. If there are different contexts that have different needs, perhaps they should use a different trait and an adaptor (or actors uses the adaptor). We should be able to find a pattern than works best for this context of on-chain smart contracts without suffering too much from unrelated uses of similar functionality. |
I was assuming that the runtime would own a let mut rt = Runtime::new(Box::new(some_bs) as Box<dyn Blockstore>);
let hamt = Hamt::new(rt.blockstore());
rt.delete_actor(...); // oops, needs to borrow `rt` as mutable but it's already borrowed by the HAMT. However, we could trivially solve this my removing all
I can't actually remember why I said that. Maybe for testing? But yeah, that's probably not an issue. The remaining issue with But that should be doable: filecoin-project/ref-fvm#1694. |
Here's another case where a |
Now done! #1248 |
Note the nested H/AMT structures like MapMap, MultiMap require the blockstore to be |
Introduced in https://github.com/filecoin-project/builtin-actors/pull/50/files
After resolving, remove
Clone
from the blockstore trait bounds defined in ActorCode.invoke_method.Also consider improving prove_replica_updates to not be a 400-line behemoth single method.
The text was updated successfully, but these errors were encountered: