graphprotocol / graphprotocol/indexer
Immediate allocation syncing between agent and service
@Jannis is already working on this.
Since Nov 25, 2020.
- Dominant language
- TypeScript
- Stars
- 262
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
This is a follow-up to the conversation in https://github.com/graphprotocol/indexer/issues/122.
Current behavior
Right now, what happens is that the indexer-agent creates an allocation on-chain. Then, independently, the gateway and indexer-service detect it by querying the network subgraph or contracts. And because gateway and indexer-service don't detect them at the same time, it can happen that the gateway sees an allocation before the indexer-service does, and sends payments through a state channel created for this allocation before the indexer-service has created an attestation signer for the allocation.
Potential improvements
-
Add an internal API in indexer-service that allocations are pushed to by the agent, as soon as they are created. This drastically reduces the chances of the gateway detecting allocations earlier than the indexer-service. This wouldn't be hard to do but requires agent and service to have a direct connection. Alternatively, push the allocations through a shared db, which we already have.
-
Persist allocations in the shared indexer-agent/-service db so that they are not only available to the indexer-service immediately but are also available again immediately after a restart.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.