RFC-145 (former RFC-4) host functions implementation#8641
RFC-145 (former RFC-4) host functions implementation#8641s0me0ne-unkn0wn wants to merge 115 commits intomasterfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
While we implemented these methods, they never got used. So, not sure. They provide some value and we could fix it by having some extra function for getting the cursor and we buffer the cursor internally on the node. |
Yeah, I just wasn't sure if I could just get rid of the version and that's it, was afraid to rip something useful. It's clear now, thank you!
That has already been clarified with @koute, and I think your proposal, which you made in the original RFC discussion, to have a single function instead of two, makes a lot of sense. Even more sense would be made by passing the data length as an argument (as well as passing the fat pointer right now) so the runtime knows at once how much to allocate before calling the "gimme input" function.
I'm currently trying to integrate it into the implementation as much as possible (it's in #8866 but please don't dive there yet, it's far from being ready) cuz you and @tomaka did a great job sorting that out, so why would we lose that, especially given that we're breaking host function signatures anyway. That comes with some challenges because we don't really know how much buffer a storage key would require, as it's unbounded, and we basically cannot repeat the call if the buffer was not enough, because something has already been deleted after the call, but I believe we'll be able to find some common ground here when #8866 comes to the review point. |
What I mean above is that you create some new extra host function |
A good idea, I'll give it a try, thank you! |
|
Okay, I've just found out I'm a dumbass cuz I dropped in the |
This PR starts using the runtime allocator and new host functions introduced by #8641. It also introduces host function wrappers that allow for keeping the change footprint small and the developer experience smooth. --------- Co-authored-by: Jan Bujak <jan@parity.io>
|
Uh, that escalated quickly. We have a |
|
@s0me0ne-unkn0wn You don't need an RFC for a PolkaVM-only host function. You should be able to easily modify the host function macro machinery to support a |
5b92d33 to
e70ff56
Compare
This PR implements the host functions introduced by the proposed RFC-145.
The allocator and the new versions of the host functions introduced by this PR are not activated; they are just added to the host, so by the time we start using them (#8866), the supermajority of nodes already had the functions ready to use.