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

Transaction succeeds with a revert error #2898

Closed
petertonysmith94 opened this issue Aug 7, 2024 · 4 comments
Closed

Transaction succeeds with a revert error #2898

petertonysmith94 opened this issue Aug 7, 2024 · 4 comments
Assignees
Labels
bug Issue is a bug

Comments

@petertonysmith94
Copy link
Contributor

Summary

A number of reports (1, 2) of a transaction succeeding, but the SDK throwing a revert error:

FuelError: The transaction reverted with an unknown reason

After investigations locally, I was unable to replicate this issue. However, using testnet, I was able to replicate this issue in around 1/10 transactions.

The issue arises due to a race condition, this occurs when:

This leads to the transaction with SubmittedStatus being used as the transaction with no receipts and the following error and stack trace:

_FuelError: The transaction reverted with an unknown reason.
    at assembleRevertError (/fuel/fuels-ts/packages/account/src/providers/utils/extract-tx-error.ts:109:10)
    at Module.extractTxError (/fuel/fuels-ts/packages/account/src/providers/utils/extract-tx-error.ts:142:10)
    at decodeCallResult (/fuel/fuels-ts/packages/program/src/script-request.ts:111:13)
    at decodeContractCallScriptResult (/fuel/fuels-ts/packages/program/src/contract-call-script.ts:145:20)
    at extractInvocationResult (/fuel/fuels-ts/packages/program/src/response.ts:29:26)
    at buildFunctionResult (/fuel/fuels-ts/packages/program/src/response.ts:64:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at createPool (/fuel/fuels-ts/packages/fuel-gauge/src/griffy-contract.test.ts:95:19)
    at test.repeats (/fuel/fuels-ts/packages/fuel-gauge/src/griffy-contract.test.ts:151:9)
    at runTest (file:///fuel/fuels-ts/node_modules/.pnpm/@vitest+runner@1.6.0/node_modules/@vitest/runner/dist/index.js:781:11) {
  VERSIONS: { FORC: '0.62.0', FUEL_CORE: '0.31.0', FUELS: '0.93.0' },
  metadata: { logs: [], receipts: [], panic: false, revert: false, reason: '' },
  rawError: {},
  code: 'script-reverted'
}
@petertonysmith94 petertonysmith94 self-assigned this Aug 7, 2024
@petertonysmith94 petertonysmith94 added the bug Issue is a bug label Aug 7, 2024
@arboleya
Copy link
Member

arboleya commented Aug 7, 2024

Thanks for getting to the bottom of this. Seriously.

@petertonysmith94
Copy link
Contributor Author

Relates to:

@petertonysmith94 petertonysmith94 changed the title Transaction succeed with revert error Transaction succeeds with a revert error Aug 8, 2024
@petertonysmith94
Copy link
Contributor Author

We're currently exploring a solution at the network level.

@nedsalk
Copy link
Contributor

nedsalk commented Aug 13, 2024

This was resolved in #2896. #1644 will tackle the same problem but by using subscriptions instead of polling.

@nedsalk nedsalk closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants