Problem
The /waitForConfirmation endpoint only looks in the Request Node's store to see if the request has been confirmed.
| constresult=awaitthis.store.getConfirmedTransaction(transactionHash); |
| |
| if(result){ |
| serverResponse.status(StatusCodes.OK).send(result); |
| return; |
| } |
| |
| serverResponse.status(StatusCodes.NOT_FOUND).send(); |
But if the subgraph confirmation times out after 100 seconds, the confirmed transaction is never added to the confirmedTransactionStore
| {maxRetries: 100,retryDelay: 1000}, |
| // when the transaction fails, log an error |
| dataAccessResponse.on('error',async(e)=>{ |
| constlogData=[ |
| 'transactionHash', |
| transactionHash.value, |
| 'channelId', |
| clientRequest.body.channelId, |
| 'topics', |
| clientRequest.body.topics, |
| 'transactionData', |
| JSON.stringify(clientRequest.body.transactionData), |
| ].join('\n'); |
| |
| this.logger.error(`persistTransaction error: ${e}. \n${logData}`); |
| }); |
As a result, the /waitForConfirmation endpoint will never return a confirmed transaction if it takes longer than 100 seconds for The Graph node to index the new request.
Bandaid
Use a faster Ethereum Node RPC in The Graph Node so it never takes longer than 100 seconds to index a new request.
Solution
The /waitForConfirmation endpoint should query the storage subgraph if it cannot find the confirmed transaction in the store .
Migrated from Asana: https://app.asana.com/0/1203912381456855/1205385812620545/f
Problem
The
/waitForConfirmationendpoint only looks in the Request Node's store to see if the request has been confirmed.requestNetwork/packages/request-node/src/request/getConfirmedTransactionHandler.ts
Lines 26 to 33 in 2ff5b09
But if the subgraph confirmation times out after 100 seconds, the confirmed transaction is never added to the confirmedTransactionStore
requestNetwork/packages/thegraph-data-access/src/data-access.ts
Line 282 in 2ff5b09
requestNetwork/packages/request-node/src/request/persistTransaction.ts
Lines 86 to 100 in 2ff5b09
As a result, the
/waitForConfirmationendpoint will never return a confirmed transaction if it takes longer than 100 seconds for The Graph node to index the new request.Bandaid
Use a faster Ethereum Node RPC in The Graph Node so it never takes longer than 100 seconds to index a new request.
Solution
The
/waitForConfirmationendpoint should query the storage subgraph if it cannot find the confirmed transaction in the store .Migrated from Asana: https://app.asana.com/0/1203912381456855/1205385812620545/f