move
move copied to clipboard
[Feature Request] Make VM parametric in event format
To support user-defined events emitted during execution, the VM keeps a Vec<Event> log, where Event as defined as
pub type Event = (Vec<u8>, u64, TypeTag, Vec<u8>)
here. In this representation, the event's user-defined type is in the TypeTag and the event value of this type is in the Vec<u8>.
However, there's no reason why events must have this structure--conceptually, the VM could just as easily allow the adapter to choose the structure of Event. This would be useful for an adapter we are currently working on where events look a bit different, and I expect that future adapters will find other uses of events that might not want to use this structure.
Note: the Move stdlib has an Event module and accompanying emit native function that do rely on the structure the VM assumes. We should think carefully about how we want to handle this. One option is splitting out a part of the Move stdlib that is fully generic and would be used by every conceivable adapter (e.g., Vector, Signer, Option, BitVector, ASCII, FixedPoint32). But that's a topic for another issue.
(copied from https://github.com/diem/move/issues/29)
This is something I've been wanting to do for a long time. Although I'm wondering if we still need an official event system or not -- events can now be implemented using extensions.
I think we can just kill any official event system. We would be just fine using native extensions (at least on the Sui side)
Yeah same here. And in fact it was already killed by moving event to the nursery (ahem graveyard)