-
Notifications
You must be signed in to change notification settings - Fork 379
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
Track and identify emitted events #2437
Comments
@zivkovicmilos @thehowl Can you take a look, please? |
There is an assumption in this OP, and that is that having the information on where the event was called is useful information to begin with. I tend to disagree. If in the event we have information on where an event was emitted, then a consumer of the event will use this information to discriminate between different events. Personally, I actually think we should remove more functionality from the current event implementation; ie. the In light of this, here's what I think:
Does this sound like something which could fit your use case? |
I agree with that we shouldn't include too much information in So instead of showing metadata like previous function or realm through the In this case, I think we can use |
If I understand your proposal correctly @notJoon,
This sounds OK to me, but also like a functionality that maybe should be disabled on a node by default. I'm summoning @zivkovicmilos for a second opinion. |
Yes, you're right. I'll start working on it later based on the results. thank you |
Description
We're planning to introduce a new feature in GnoScan which traces and displays events that occured within a transaction.
Below is the preview of the UI.
Unfortunately, we've come across an issue in the progress.
There isn't a clear way to guarantee (1) the "depth" of each event within the function call stack, and (2) the function from which the event was emitted.
Here’s a simple contract example.
Two functions(
EmitEventMain
,EmitEventMainWithSub
) in a Realm(emit_main
) emit the same event "EVENT_MAIN".In the
EmitEventMainWithSub
function, another contract(emit_sub
)'s function is called to emit the "EVENT_SUB" event.In this case, we cannot identify which of the two functions in the
emit_main
realm has triggered the emission of "EVENT_SUB" simply by parsing the events.[Realm: gno.land/r/demo/emit_sub]
[Realm: gno.land/r/demo/emit_main]
Block Results's ResponseBase when the
EmitEventMain
function andEmitEventMainWithSub
function are executed as multi messagesPR #2061, was an attempt to provide such a way by adding an index to each event, but was closed due to some concerns.
Are there any suggestions on how we should approach this issue?
If not, it seems like it's worth re-exploring the
msg_idx
idea or something similar.This event support in GnoScan will be useful for users and developers to track events in-depth, especially for contracts that require connected events, such as DAOs, DEXes, etc.
The text was updated successfully, but these errors were encountered: