Skip to content

[graphql-alt] Handle transaction execution/simulation errors as BAD_USER_INPUT#25261

Merged
tpham-mysten merged 2 commits intomainfrom
tpham/graphql-bad-user-input-errors
Feb 14, 2026
Merged

[graphql-alt] Handle transaction execution/simulation errors as BAD_USER_INPUT#25261
tpham-mysten merged 2 commits intomainfrom
tpham/graphql-bad-user-input-errors

Conversation

@tpham-mysten
Copy link
Copy Markdown
Contributor

@tpham-mysten tpham-mysten commented Feb 3, 2026

Description

  • gRPC InvalidArgument and NotFound errors from executeTransaction and simulateTransaction now return GraphQL BAD_USER_INPUT errors instead of being returned in an error/errors field
  • Added InvalidArgument variant to TransactionInputError with message prefix "Invalid argument:"
  • Removed error field from SimulationResult and errors field from ExecutionResult

Example error:

{
  "data": null,
  "errors": [
    {
      "message": "Invalid argument: Invalid user signature: Signature is not valid: Fail to verify user sig Invalid signature was given to the function",
      "locations": [
        {
          "line": 3,
          "column": 17
        }
      ],
      "path": [
        "executeTransaction"
      ],
      "extensions": {
        "code": "BAD_USER_INPUT"
      }
    }
  ]
}

Test plan

  • test_execute_transaction_grpc_errors verifies BAD_USER_INPUT code and ServerValidation message
  • Existing e2e tests updated to remove error/errors field references

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL: Error field is no longer available in simulateResult and ExecutionResult. They will be propagated in GraphQL errors
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Error Error Feb 11, 2026 4:04am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Feb 11, 2026 4:04am
sui-kiosk Ignored Ignored Preview Feb 11, 2026 4:04am

Request Review

@tpham-mysten tpham-mysten temporarily deployed to sui-typescript-aws-kms-test-env February 3, 2026 23:10 — with GitHub Actions Inactive
@tpham-mysten tpham-mysten force-pushed the tpham/graphql-bad-user-input-errors branch from 669548c to 3936215 Compare February 4, 2026 02:47
@tpham-mysten tpham-mysten temporarily deployed to sui-typescript-aws-kms-test-env February 4, 2026 02:47 — with GitHub Actions Inactive
@tpham-mysten tpham-mysten changed the title [graphql-alt] Convert gRPC user input errors to BAD_USER_INPUT GraphQL errors [graphql-alt] Handle transaction execution/simulation errors as BAD_USER_INPUT Feb 4, 2026
Copy link
Copy Markdown
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me, but just to be sure, can you include an example of what one of these error messages looks like and/or add a test for that case? One of the issues we had previously was that the error looked slightly out of place because it was obviously a gRPC error being output from a GraphQL request.

@tpham-mysten tpham-mysten temporarily deployed to sui-typescript-aws-kms-test-env February 11, 2026 04:01 — with GitHub Actions Inactive
@tpham-mysten
Copy link
Copy Markdown
Contributor Author

tpham-mysten commented Feb 11, 2026

Thanks for the review!

Sure. I have added the example error and also added a snapshot test to show how the error would look like in crates/sui-indexer-alt-e2e-tests/tests/snapshots/graphql_execute_transaction_tests__execute_transaction_grpc_error.snap.

@tpham-mysten tpham-mysten merged commit 2ff7011 into main Feb 14, 2026
109 of 113 checks passed
@tpham-mysten tpham-mysten deleted the tpham/graphql-bad-user-input-errors branch February 14, 2026 02:47
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

Successfully merging this pull request may close these issues.

2 participants