Skip to content
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

Add output to OutputExecuted event #212

Closed
guidanoli opened this issue Jan 22, 2024 · 3 comments · Fixed by #231
Closed

Add output to OutputExecuted event #212

guidanoli opened this issue Jan 22, 2024 · 3 comments · Fixed by #231
Assignees
Labels
A-contracts Area: contracts T-feature Type: feature
Milestone

Comments

@guidanoli
Copy link
Collaborator

📚 Context

In the context of the Output Unification effort, there will be a single event for all output executed called, intuitively, OutputExecuted. This event can be listened to by outsiders to index what on-chain side effects have taken effect until any given point. For example, if you are monitoring the assets locked in a given application, there are two main routes: polling or folding.

You can monitor deposits via the InputAdded event emitted by the InputBox contract. If the input is coming from a portal, you can decode the input and figure out who transferred, what asset, how much, and to which application.

Previously, if you wanted to monitor withdrawals, you'd have to listen to events emitted by each token contract supported by the application. Now, if you're indexing this kind of information for all applications that use Cartesi, the problem only gets harder.

Furthermore, it would be impossible to monitor Ether withdrawals, since they do not necessarily trigger events that can be listened to from outside the blockchain.

Of course, you could go another way, and ask the user to input a GraphQL endpoint, and from there extract the output blob. But then you're relying on a centralized solution. Why not use the blockchain for this information, since that's where it actually happens, right?

✔️ Solution

We can modify the OutputExecuted event to include the output blob. With this, it would be much easier to monitor deposits as well as any other on-chain action taking place. Also, you wouldn't have to monitor several token contracts. Instead, you'd only have to monitor the InputBox and Application contracts.

📚 Requirements

@guidanoli guidanoli added T-feature Type: feature D-average A-contracts Area: contracts labels Jan 22, 2024
@guidanoli guidanoli added this to the 2.0.0 milestone Jan 22, 2024
@guidanoli
Copy link
Collaborator Author

FYI @tuler

@guidanoli
Copy link
Collaborator Author

Would this be interesting for the node, @cartesi/node-unit?

@gligneul
Copy link
Contributor

Would this be interesting for the node, @cartesi/node-unit?

Maybe in the future but not for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contracts Area: contracts T-feature Type: feature
Projects
Status: 🚀 Done
Development

Successfully merging a pull request may close this issue.

2 participants