-
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
Make Gnorkle Agents Gas-Less #2777
Comments
@deelawn I would really appreciate your input here 💯 |
Thanks @Villaquiranm; I'll take a look at this soon. @leohhhn because he said he'd be looking at gnorkle this week as well. |
Taking a look; can you please name the issue more appropriately? It's not only about optimizing gas fees. |
Thanks you're right maybe Enhance Gnorkle with Relayed Messages to Shift Gas Fees to Users for GitHub Verification would do ? |
I propose: "Make Gnorkle Agents Gas-Less" although the initial title was already pretty accurate
|
I'm not convinced by this approach. I'd prefer if we changed
(This could be an eventual substitute for GetOrigX functions; but I digress). This way we can have gas-less gnorkle; by having the oracle multi-sig a message sent by the user. |
As for viewing verification requests, I agree it should be a gas-free query, but it should not work with events. It should be a simple function, queryable using |
it could be also, but I think an event should be available too, so the nodes can push to the agents instead of the agents pulling repeatedly |
If the problem we're trying to tackle is an off-chain oracle asking the chain "What users do I need to verify?", events do nothing to answer it; because they don't reflect what the chain has already stored. On the other hand, a queryable function does this. I am starting to see that you and other contributors are beginning to use events for just about everything. I understand where you're coming from; working with the result of MsgCall is garbage for now, until we have #1776 and #1842. But understand that stuffing things into events to pass them off-chain is not good, as this is information that at least for now cannot be retrieved on-chain. We should look to make working off-chain just about as useful as working on-chain. To me, in this specific case, there is no good reason to use events:
Understand this is already possible and easy to do; you can use the websocket endpoint on the indexer and listen for events on the realm+function combination. Once you receive them, you can vm/qeval the node. Yes, it's an added step, but it also means that the oracle can work more statelessly, and use the chain as the source of truth rather than keeping an internal database of who's verified and who's not. |
I agree that we should also have the eval query
I disagree and answered there #2778 (comment)
if the indexer is up to date it does
See my answer to the second point
Again, this will ignore non-EOA calls |
I believe @thehowl suggested the correct approach in regards to retrieving feed tasks without incurring any gas fees: use In regards to emitting events -- this could be added in the gnorkle package, but it seems like the event data the oracle realm may want to emit is highly specific to the particular application. I think it is easier and more reliable to query the realm rather than subscribe to events -- what if the agent crashes? It will need to query the realm anyway to see what it might have missed. In any case, leaving this up to the oracle realm to emit events partially solves this because the agents can choose their own method of obtaining the feed tasks that need to be completed. As for the proposed strategy to offload the verification gas fees from the agent, how does the agent communicate its signed message with the user that should pay the fee? By storing it in the ghverify realm? It seems unneessary. I propose that we establish a pattern that allows oracle realms to pay out agents for data provider services rendered. In this case, the fee would be required by the ghverify realm when verification is requested, say 5gnot (I currently have no idea what a reasonable fee would be, so use this as an example). Upon receipt of the verification message from the agent, the fee can be paid out to the caller during the This is a very simple solution for a very simple case -- a single agent doing the verification for a static feed with a single task value ingester. In the future, the agent incentive payout mechanism can be expanded by defining an So one interesting exercise might be to figure out the best way to work in an incentive mechanism into the gnorkle package. It might involve modifying the That was a lot. Let me know what needs clarification. |
I was thinking mostly as the off-chain whitelisted agent does have access as a bridge to realms and to internet. Maybe this is not at all what we want but I just wanted to better explain what was the flow I had thought about :) |
I started working on a simple agent for GH verify; it's still very WIP, but thought I'd share it here. It bases the logic on a simpler approach - see the PR description. I like @deelawn's idea to just pay a fee to the Two main points:
|
<!-- please provide a detailed description of the changes made in this pull request. --> related to #2777 <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> Co-authored-by: 6h057 <15034695+omarsy@users.noreply.github.com>
Related issues and PRs
Motivation
In issue #1568, @deelawn implemented a Gno-based oracle and provided an example of how to use Gnorkle to link a Gno wallet address with a GitHub handle.
Upon reviewing the current process, we identified two key points:
The challenge with this approach is that Gnorkle bears the entire cost of the GitHub verification process. While this is feasible, we must ensure that the agent consistently has enough tokens to cover these expenses.
Proposition
Allow Gnorkle to execute messages from any sender, whether they are whitelisted or not, but only if the message is proven to be signed by a whitelisted address.
An GnoEvent should be published each time a user requests verification (this covers first point). This event can then be indexed by the off-chain agent, which will attempt to verify the ownership of the account. If ownership is confirmed, the agent will issue a payload to the user in the following format:
Delivrables
The text was updated successfully, but these errors were encountered: