-
Notifications
You must be signed in to change notification settings - Fork 60
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
Consider what contract event to implement (if any) #2265
Comments
After a brief discussion with @ureeves and @herr-seppia we recognized that, while Stake events are necessary, we need to carefully consider whether or not loading the contract execution with the overhead of emitting other type of events.
Crafting events in the Archival rather than during contract execution introduces inefficiency in proving the correctness, consistency, and completeness of events. In fact, a client wishing to prove that the events sent by the Archival are honest, might have to extract events from the transactions, rather than collecting them directly from a transfer execution. Although event emission in contract is not free and introduces a (perhaps moderate) hike in gas price and overhead, this seems to be justified in the case of Moonlight transactions. Paraphrasing @herr-seppia:
|
Another reason that strengthens the case of having the contract emitting Moonlight events has to do with the fact that the Archival would already need to store the Stake events and those must necessarily be created during the contract execution. It would indeed be undesirable to have half of the events created by the VM and some others created by the Archival in an arbitrary fashion. |
@herr-seppia and I have considered the events to emit as a matter of course for the protocol. Here's our notes from the meeting, and we will be proceeding to implement them all today. Transfer Events
Stake Events
|
The following events are added, which are emitted when the function with their same name is successful: - `mint` - `withdraw` - `convert` - `deposit` - `transfer_to_contract` - `transfer_to_account` Additionally an event is emitted at the end of any transaction ingestion. This event will either be `phoenix` or `moonlight`, depending on the model used, and are emitted during the host's call to `refund`. This is so that the event data can contain both the change and gas spent. As a consequence of the above changes, we needed to slightly change the way in which we insert notes into the tree, and make some changes to the `transitory` module to support including the change note in the emission event. See-also: #2265
Possible events are:
The text was updated successfully, but these errors were encountered: