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

remove Agora cost models #971

Open
2 of 5 tasks
Theodus opened this issue Nov 11, 2024 · 1 comment
Open
2 of 5 tasks

remove Agora cost models #971

Theodus opened this issue Nov 11, 2024 · 1 comment
Assignees

Comments

@Theodus
Copy link
Member

Theodus commented Nov 11, 2024

Recently I’ve started thinking about the graph network more holistically for the first time in a while. And I think I’ve come to the conclusion that we should abandon Agora cost models for subgraph queries in favor of a simpler pricing system. I have always considered Agora cost models to be over-engineered for the problems that we face in practice, but I had previously believed that they served a role in a future state of the network. But my opinion on this has recently shifted.

This is the current state of Agora cost models from my perspective:

  • Indexers don’t use them. And those that do require complex automation like auto-agora. The maintenance plan for auto-agora is currently unknown/stalled.
  • We do not have a way to reliably associate GraphQL query shapes with the cost to execute a query.
  • Agora does not provide a practical way for indexers to reject incoming queries by excluding patterns manually.
  • Compiling cost models in the gateway is often costly. And will become a bigger performance issue if more indexers were to set them. I don’t think anyone can justify rewriting the Agora compiler to fix the performance issues I’ve identified.
  • Complex cost models from indexers don’t provide any benefit for price efficiency if the gateway isn’t making pricing decisions based on query shapes. There are currently no plans to pursue this.
  • Removing Agora would reduce the maintenance burden for gateway, indexer-service, and indexer-agent.
  • DIPs agreements will facilitate indexers expressing their costs for service beyond just queries.

Proposal:

  • Indexers set a static price per query, in GRT, for each (deployment, TAP sender), instead of a cost model. This facilitates a much simpler price discovery automation on the indexer side. And is practically equivalent to a cost model of default => ...;.
  • The gateway isolates ISA state by (deployment, API key). This means that indexers gain the ability to reject potentially malicious queries from a user without it impacting selection decisions more globally.

Technical plan:

  • Remove the /budget endpoint. No automated tool depends on it, and and future iteration of this idea should provide a value in GRT.
  • Replace cost model request & compilation with a new interface provided by indexer-service. Ideally, the/cost GraphQL server would be replaced with a fee field in the deployment status from the /status server (entries without a fee set or a fee of 0 should be omitted).
    • As an intermediate step, the gateway will continue to use the /cost server as it currently exists. But it will only support cost models of the form default => x; where x is a numeric literal.
  • Isolate indexer-selection state by (deployment, API key). These state isolates should be cached until they remain unused for some period of time (on the order of minutes). Queries made infrequently to the (deployment, API key) pair should fall back to a global indexer-selection state.
  • Reduce selection limit from 3 to 2.
@Theodus
Copy link
Member Author

Theodus commented Nov 12, 2024

At the time of writing, only one indexer with active allocations has a cost model set. The result of that single cost model could be accomplished with this proposal, without Agora: default => 0.00001;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant