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

Use contract calls when confirming allocate action #878

Open
fordN opened this issue Apr 12, 2024 · 1 comment · May be fixed by #885
Open

Use contract calls when confirming allocate action #878

fordN opened this issue Apr 12, 2024 · 1 comment · May be fixed by #885
Assignees
Labels
enhancement New feature or request indexer-agent

Comments

@fordN
Copy link
Contributor

fordN commented Apr 12, 2024

Currently when confirming an allocate action the network subgraph is queried to get the subgraph deployment. If the process of publishing the subgraph to the network and allocating happened very quickly in sequence the subgraph deployment may not be searchable on the network subgraph yet, leading to the following error SHOULD BE UNREACHABLE: No matching subgraphDeployment (${subgraphDeploymentID.ipfsHash}) found on the network. Code here

To improve robustness of this step we should update the matchingRuleExists function to get this data from the contracts directly (or fall back to the contracts if not available on the network subgraph), so we are not relying on the network subgraph being instantly updated to get this information. Additionally let's take a minute to audit any other confirmation data and update to this more robust method to avoid similar race conditions.

@fordN fordN added enhancement New feature or request indexer-agent labels Apr 12, 2024
@fordN fordN assigned fordN and dwerner and unassigned fordN Apr 15, 2024
@dwerner
Copy link
Contributor

dwerner commented Apr 18, 2024

I ended up searching through the contract interface, and I didn't find an extant method for retrieving this.

The motivation is to eliminate a race condition where we are looking to query for a subgraph when it may not yet have been synced. The work changed and was directed towards waiting for the block in which that subgraph had been deployed, instead of querying contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request indexer-agent
Projects
Status: 🏗️ In Progress
2 participants