Inconsistencies between the SAC and SEP-41 #1776
Replies: 3 comments 13 replies
-
|
Re 1:
I don't see too many options for addressing this incosistencies besides relaxing the SEP-41 phrasing and basically decoupling the events from the functions. I think this is going to be generally beneficial, as it opens doors for more compatible implementations. I don't see much harm in that for the consumers as well, as consumers are going to consume events, not transactions, so it doesn't really matter which functions produce which events. Are there any other options that I'm missing? Re 2:
Sorry for being pedantic here, but SEP-41 does not define the mint function interface so I guess this is rather internal SAC inconsistency and not SEP-41<->SAC inconsistency (beyond point 1, of course). #1775 updates the mint event specification, so at least the consumers have the necessary information to ingest these events. But I'm not sure if the interface inconsistency is particularly problematic.
The same argument can be made for To add some context, the decision to minimize the use of
The second requirement can indeed be challenged. But I'd like to see some strong arguments for it, because so far I haven't seen evidence that muxed destinations are useful elsewhere beyond direct transfers. Re 3: I agree this might be a footgun for unaware event consumers. But I'm also not sure if there is a good solution on the SAC/Core side. We could add another optional backfill flag that massages all SAC transfers into the map format, but we can't do the same for the custom tokens. Maybe that's still ok for most of consumers, but I'm generally not a huge fan of adjusting the events post-factum, and this seems like a pretty bad precedent to set. |
Beta Was this translation helpful? Give feedback.
-
|
Re 1: +1 what @dmkozh said in https://github.com/orgs/stellar/discussions/1776#discussioncomment-14250403. Events are intended to be emitted for off-chain systems when the event occurs, and don't / shouldn't be tied to specific functions. We included comments about events on the transactions because there is some general expectation that folks implementing a token will probably want to emit the event during those functions. But they might emit additional events, or multiple events, or events at other times and that's fine. Function calls are not designed to be consumed off chain, and integrators should avoid looking at function calls as a way to understand the movement of value. Integrators should use events only. @JakeUrban Do you see any issue with this approach? What problem are you trying to solve by linking functions to events concretely? |
Beta Was this translation helpful? Give feedback.
-
|
Re 3: I don't think the inconsistency for consumers is a big concern, especially once SDKs can code generate event parsers. I understand it is a surprise today that the events take several shapes. Once you can generate an event ingestor and you just get given the concrete types you need to handle, I think the issues discussed will be small and mostly insignificant. See #1765 for that initiative. At the very least I think it's worth waiting to see if the issues disappear as a result of that. I do think there could be value to update the SAC to emit data events for a different reason: to set a good example of how to create extendable events. I understand we went with i128 data to reduce data, but is that data saving worth encouraging others to hyperoptimise by producing a variety of event shapes? If the optimisation is worthwhile for the SAC, then it's worthwhile for everyone. If we switch to in the future emitting map data, I also don't think we necessarily need to provide a backfill facility. It can just be a from now on thing. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion aims to cover the full scope of inconsistencies between the interface and behavior of Stellar asset contracts (SAC's) and SEP-41, or inconsistencies within their own interfaces, with the intention of identifying resolutions to those inconsistencies.
It is likely that this discussion will result in new discussions that are more narrowly defined. This discussion should be focused on identifying the full set of inconsistencies and the relationships between them, at which point we can continue to discuss interconnected issues here or create separate discussions for inconsistencies that are independent of the others.
The inconsistencies that we've identified through prior discussion are:
transferfunction emitsmintevents whenfromis the asset's issuer account, but SEP-41 states thattransferfunctions should only emittransferevents.mintfunction on the SAC does not accept muxed info, but themintevent will emit muxed infodatavalue fortransferandmintevents will be ai128if muxed info is not provided, and a map if muxed info is providedAll of these pose challenges for developers looking to integrate tokens on Stellar.
mintevents to be emitted as a result oftransferinvocations if they're only familiar with SEP-41 and not the SAC. Similarly, developers may expectmintevents fromtransferinvocations of contract tokens if they are familiar with the SAC.mintfunction. If its possible through thetransferfunction, I don't see why we'd prohibit doing so in themintfunction.datavalue ofmintandtransferevents to be amapgiven that the case wheredatais ai128is likely to be much more common and was the only possible type before v23 of stellar-core.Beta Was this translation helpful? Give feedback.
All reactions